From 88e866646fa1f08c00e9268de4a0ec44f6f9fcca Mon Sep 17 00:00:00 2001 From: Janne Julkunen Date: Thu, 30 Nov 2017 19:54:50 +0200 Subject: [PATCH] Removed unnecessary swiper breakpoint interface --- example/src/app/app.module.ts | 33 ++++----------------------------- src/index.ts | 4 +--- src/lib/swiper.interfaces.ts | 13 ++++--------- 3 files changed, 9 insertions(+), 41 deletions(-) diff --git a/example/src/app/app.module.ts b/example/src/app/app.module.ts index fccd8ac..f1f9d08 100644 --- a/example/src/app/app.module.ts +++ b/example/src/app/app.module.ts @@ -12,35 +12,10 @@ import { AppComponent } from './app.component'; const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = { observer: true, direction: 'horizontal', - slidesPerView: 4, - spaceBetween: 40, - breakpoints: { - 1024: { - slidesPerView: 4, - spaceBetween: 40, - }, - 767: { - slidesPerView: 3, - spaceBetween: 20, - }, - 479: { - slidesPerView: 2, - spaceBetween: 10 - - } -}, - centeredSlides: true, - keyboard: true, - mousewheel: false, - freeMode: false, - speed: 1000, - autoplay: { -delay: 2000, -stopOnLast: false -}, - effect: 'slide', - grabCursor: true, - loop: true, + threshold: 50, + spaceBetween: 5, + slidesPerView: 1, + centeredSlides: true }; @NgModule({ diff --git a/src/index.ts b/src/index.ts index ec7200a..a098054 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,8 +6,6 @@ export { SwiperConfig, SwiperConfigInterface, - - SwiperBreakpointInterface, SwiperBreakpointsInterface, SwiperA11YInterface, @@ -17,10 +15,10 @@ export { SwiperVirtualInterface, SwiperAutoplayInterface, SwiperScrollbarInterface, + SwiperMousewheelInterface, SwiperControllerInterface, SwiperNavigationInterface, SwiperPaginationInterface, - SwiperMousewheelInterface, SwiperHashNavigationInterface, SwiperFadeEffectInterface, diff --git a/src/lib/swiper.interfaces.ts b/src/lib/swiper.interfaces.ts index 89fd370..025e921 100644 --- a/src/lib/swiper.interfaces.ts +++ b/src/lib/swiper.interfaces.ts @@ -182,10 +182,10 @@ export interface SwiperConfigInterface { virtual?: boolean | SwiperVirtualInterface, autoplay?: boolean | SwiperAutoplayInterface, scrollbar?: boolean | SwiperScrollbarInterface, + mousewheel?: boolean | SwiperMousewheelInterface, controller?: boolean | SwiperControllerInterface, navigation?: boolean | SwiperNavigationInterface, pagination?: boolean | SwiperPaginationInterface, - mousewheel?: boolean | SwiperMousewheelInterface, hashNavigation?: boolean | SwiperHashNavigationInterface } @@ -314,14 +314,8 @@ export interface SwiperCoverflowEffectInterface { slideShadows?: boolean } -export interface SwiperBreakpointInterface { - spaceBetween?: number, - slidesPerView?: number, - slidesPerGroup?: number -} - export interface SwiperBreakpointsInterface { - [size: number]: SwiperBreakpointInterface + [size: number]: SwiperConfigInterface } export class SwiperConfig implements SwiperConfigInterface { @@ -453,10 +447,10 @@ export class SwiperConfig implements SwiperConfigInterface { public virtual: boolean | any; public autoplay: boolean | any; public scrollbar: boolean | any; + public mousewheel: boolean | any; public controller: boolean | any; public navigation: boolean | any; public pagination: boolean | any; - public mousewheel: boolean | any; public hashNavigation: boolean | any; constructor(config: SwiperConfigInterface = {}) { @@ -484,6 +478,7 @@ export type SwiperRenderSlideFunction = (index: number) => HTMLElement; export type SwiperRenderExternalFunction = (data: any) => void; export type SwiperRenderCustomFunction = (current: number, total: number) => string; + export type SwiperRenderBulletFunction = (index: number, className: string) => string; export type SwiperRenderFractionFunction = (currentClass: string, totalClass: string) => string; export type SwiperRenderProgressbarFunction = (progressbarClass: string) => string;