@egjs/flicking-plugins 4.8.0-beta.1 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -51
- package/css/all.css +2 -0
- package/css/arrow.css +2 -2
- package/css/pagination.css +5 -3
- package/declaration/Arrow.d.ts +106 -51
- package/declaration/AutoPlay.d.ts +104 -44
- package/declaration/Fade.d.ts +41 -16
- package/declaration/Parallax.d.ts +41 -16
- package/declaration/Perspective.d.ts +71 -28
- package/declaration/Sync.d.ts +93 -37
- package/declaration/const.d.ts +31 -31
- package/declaration/event.d.ts +5 -5
- package/declaration/index.d.ts +13 -10
- package/declaration/pagination/Pagination.d.ts +141 -61
- package/declaration/pagination/index.d.ts +3 -3
- package/declaration/pagination/renderer/BulletRenderer.d.ts +11 -11
- package/declaration/pagination/renderer/FractionRenderer.d.ts +9 -9
- package/declaration/pagination/renderer/Renderer.d.ts +19 -19
- package/declaration/pagination/renderer/ScrollBulletRenderer.d.ts +12 -12
- package/declaration/tsdoc-metadata.json +11 -0
- package/declaration/type.d.ts +9 -9
- package/declaration/utils.d.ts +3 -3
- package/dist/arrow.css +2 -2
- package/dist/flicking-plugins.css +23 -8
- package/dist/flicking-plugins.min.css +1 -1
- package/dist/pagination.css +21 -6
- package/dist/pagination.min.css +1 -1
- package/dist/plugins.esm.js +1029 -1591
- package/dist/plugins.esm.js.map +1 -1
- package/dist/plugins.js +1046 -1620
- package/dist/plugins.js.map +1 -1
- package/dist/plugins.min.js +1 -9
- package/dist/plugins.min.js.map +1 -1
- package/package.json +49 -105
- package/src/Arrow.ts +133 -82
- package/src/AutoPlay.ts +105 -35
- package/src/Fade.ts +31 -11
- package/src/Parallax.ts +31 -11
- package/src/Perspective.ts +69 -22
- package/src/Sync.ts +69 -25
- package/src/index.ts +9 -22
- package/src/pagination/Pagination.ts +163 -40
- package/src/pagination/index.ts +2 -6
- package/src/pagination/renderer/BulletRenderer.ts +1 -4
- package/src/pagination/renderer/FractionRenderer.ts +1 -3
- package/src/pagination/renderer/Renderer.ts +14 -13
- package/src/pagination/renderer/ScrollBulletRenderer.ts +5 -12
- package/CONTRIBUTING +0 -58
- package/rollup.config.dev.js +0 -17
- package/rollup.config.js +0 -33
- package/tsconfig.declaration.json +0 -10
- package/tsconfig.eslint.json +0 -8
- package/tsconfig.json +0 -17
- package/tsconfig.test.json +0 -21
|
@@ -1,28 +1,71 @@
|
|
|
1
|
-
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the {@link Perspective} plugin
|
|
4
|
+
*/
|
|
5
|
+
export interface PerspectiveOptions {
|
|
6
|
+
/**
|
|
7
|
+
* CSS selector for the element to apply the perspective effect. If empty, the panel element itself is used
|
|
8
|
+
* @defaultValue ""
|
|
9
|
+
*/
|
|
10
|
+
selector: string;
|
|
11
|
+
/**
|
|
12
|
+
* Effect amplification scale
|
|
13
|
+
* @defaultValue 1
|
|
14
|
+
*/
|
|
15
|
+
scale: number;
|
|
16
|
+
/**
|
|
17
|
+
* Rotation amplification scale
|
|
18
|
+
* @defaultValue 1
|
|
19
|
+
*/
|
|
20
|
+
rotate: number;
|
|
21
|
+
/**
|
|
22
|
+
* The value of the CSS `perspective` property (px)
|
|
23
|
+
* @defaultValue 1000
|
|
24
|
+
*/
|
|
25
|
+
perspective: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A plugin to apply 3D perspective effect while panels are moving
|
|
29
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/perspective | Demo: Perspective}
|
|
30
|
+
*/
|
|
31
|
+
declare class Perspective implements Plugin {
|
|
32
|
+
private _flicking;
|
|
33
|
+
private _selector;
|
|
34
|
+
private _scale;
|
|
35
|
+
private _rotate;
|
|
36
|
+
private _perspective;
|
|
37
|
+
/** Current value of the {@link PerspectiveOptions.selector | selector} option. */
|
|
38
|
+
get selector(): string;
|
|
39
|
+
/** Current value of the {@link PerspectiveOptions.scale | scale} option. */
|
|
40
|
+
get scale(): number;
|
|
41
|
+
/** Current value of the {@link PerspectiveOptions.rotate | rotate} option. */
|
|
42
|
+
get rotate(): number;
|
|
43
|
+
/** Current value of the {@link PerspectiveOptions.perspective | perspective} option. */
|
|
44
|
+
get perspective(): number;
|
|
45
|
+
/** Sets {@link PerspectiveOptions.selector | selector}. */
|
|
46
|
+
set selector(val: string);
|
|
47
|
+
/** Sets {@link PerspectiveOptions.scale | scale}. */
|
|
48
|
+
set scale(val: number);
|
|
49
|
+
/** Sets {@link PerspectiveOptions.rotate | rotate}. */
|
|
50
|
+
set rotate(val: number);
|
|
51
|
+
/** Sets {@link PerspectiveOptions.perspective | perspective}. */
|
|
52
|
+
set perspective(val: number);
|
|
53
|
+
/**
|
|
54
|
+
* @param options - Options for the Perspective instance
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* flicking.addPlugins(new Perspective({ selector: "p", scale: 1, rotate: 1, perspective: 1000 }));
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
constructor(options?: Partial<PerspectiveOptions>);
|
|
61
|
+
/** Initialize the plugin and apply the perspective effect to the Flicking instance.
|
|
62
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
63
|
+
*/
|
|
64
|
+
init(flicking: Flicking): void;
|
|
65
|
+
/** Destroy the plugin and remove all event listeners. */
|
|
66
|
+
destroy(): void;
|
|
67
|
+
/** Recalculate and apply the perspective effect to all visible panels. */
|
|
68
|
+
update: () => void;
|
|
69
|
+
private _onMove;
|
|
70
|
+
}
|
|
71
|
+
export default Perspective;
|
package/declaration/Sync.d.ts
CHANGED
|
@@ -1,37 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { SYNC } from "./const";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import type { Plugin } from "@egjs/flicking";
|
|
2
|
+
import Flicking from "@egjs/flicking";
|
|
3
|
+
import { SYNC } from "./const";
|
|
4
|
+
/**
|
|
5
|
+
* Options for the {@link Sync} plugin
|
|
6
|
+
*/
|
|
7
|
+
export interface SyncOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Method to synchronize between Flickings. `"camera"` syncs by camera position, `"index"` syncs by panel index
|
|
10
|
+
* @defaultValue "camera"
|
|
11
|
+
*/
|
|
12
|
+
type: typeof SYNC.TYPE.CAMERA | typeof SYNC.TYPE.INDEX;
|
|
13
|
+
/**
|
|
14
|
+
* Detailed options for each Flicking instance to synchronize
|
|
15
|
+
* @defaultValue []
|
|
16
|
+
*/
|
|
17
|
+
synchronizedFlickingOptions: SychronizableFlickingOptions[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Per-instance synchronization options used in {@link SyncOptions.synchronizedFlickingOptions}
|
|
21
|
+
*/
|
|
22
|
+
export interface SychronizableFlickingOptions {
|
|
23
|
+
/**
|
|
24
|
+
* The Flicking instance to synchronize
|
|
25
|
+
*/
|
|
26
|
+
flicking: Flicking;
|
|
27
|
+
/**
|
|
28
|
+
* Whether clicking this Flicking's panel changes the index of all synced Flickings
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
isClickable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether mouse/touch scroll on this Flicking changes other Flickings' index. Only available for the `"index"` type
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
isSlidable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* CSS class added to the active (selected) panel
|
|
39
|
+
* @defaultValue undefined
|
|
40
|
+
*/
|
|
41
|
+
activeClass?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Plugin for synchronizing multiple Flicking instances
|
|
45
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/sync | Demo: Sync}
|
|
46
|
+
*/
|
|
47
|
+
declare class Sync implements Plugin {
|
|
48
|
+
private _flicking;
|
|
49
|
+
private _disabledIndex;
|
|
50
|
+
private _type;
|
|
51
|
+
private _synchronizedFlickingOptions;
|
|
52
|
+
/** Current value of the {@link SyncOptions.type | type} option. */
|
|
53
|
+
get type(): SyncOptions["type"];
|
|
54
|
+
/** Current value of the {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions} option. */
|
|
55
|
+
get synchronizedFlickingOptions(): SyncOptions["synchronizedFlickingOptions"];
|
|
56
|
+
/** Sets {@link SyncOptions.type | type}. */
|
|
57
|
+
set type(val: SyncOptions["type"]);
|
|
58
|
+
/** Sets {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions}. */
|
|
59
|
+
set synchronizedFlickingOptions(val: SyncOptions["synchronizedFlickingOptions"]);
|
|
60
|
+
/**
|
|
61
|
+
* @param options - Options for the Sync instance
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* flicking.addPlugins(new Sync({
|
|
65
|
+
* type: "camera",
|
|
66
|
+
* synchronizedFlickingOptions: [
|
|
67
|
+
* { flicking: flicking1 },
|
|
68
|
+
* { flicking: flicking2, isClickable: true }
|
|
69
|
+
* ]
|
|
70
|
+
* }));
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
constructor(options?: Partial<SyncOptions>);
|
|
74
|
+
/** Initialize the plugin and set up synchronization event listeners between Flicking instances.
|
|
75
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
76
|
+
*/
|
|
77
|
+
init(flicking: Flicking): void;
|
|
78
|
+
/** Destroy the plugin and remove all synchronization event listeners. */
|
|
79
|
+
destroy(): void;
|
|
80
|
+
/** Update the active class state for all synchronized Flicking instances. */
|
|
81
|
+
update(): void;
|
|
82
|
+
private _preventEvent;
|
|
83
|
+
private _addEvents;
|
|
84
|
+
private _removeEvents;
|
|
85
|
+
private _onIndexChange;
|
|
86
|
+
private _onMove;
|
|
87
|
+
private _onMoveStart;
|
|
88
|
+
private _onMoveEnd;
|
|
89
|
+
private _onSelect;
|
|
90
|
+
private _synchronizeByIndex;
|
|
91
|
+
private _updateClass;
|
|
92
|
+
}
|
|
93
|
+
export default Sync;
|
package/declaration/const.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export declare const ARROW: {
|
|
2
|
-
readonly PREV_SELECTOR: ".flicking-arrow-prev";
|
|
3
|
-
readonly NEXT_SELECTOR: ".flicking-arrow-next";
|
|
4
|
-
readonly DISABLED_CLASS: "flicking-arrow-disabled";
|
|
5
|
-
};
|
|
6
|
-
export declare const PAGINATION: {
|
|
7
|
-
readonly SELECTOR: ".flicking-pagination";
|
|
8
|
-
readonly PREFIX: "flicking-pagination";
|
|
9
|
-
readonly BULLET_WRAPPER_SUFFIX: "bullets";
|
|
10
|
-
readonly BULLET_SUFFIX: "bullet";
|
|
11
|
-
readonly BULLET_ACTIVE_SUFFIX: "bullet-active";
|
|
12
|
-
readonly FRACTION_WRAPPER_SUFFIX: "fraction";
|
|
13
|
-
readonly FRACTION_CURRENT_SUFFIX: "fraction-current";
|
|
14
|
-
readonly FRACTION_TOTAL_SUFFIX: "fraction-total";
|
|
15
|
-
readonly SCROLL_UNINIT_SUFFIX: "uninitialized";
|
|
16
|
-
readonly SCROLL_WRAPPER_SUFFIX: "scroll";
|
|
17
|
-
readonly SCROLL_SLIDER_SUFFIX: "slider";
|
|
18
|
-
readonly SCROLL_PREV_SUFFIX: "bullet-prev";
|
|
19
|
-
readonly SCROLL_NEXT_SUFFIX: "bullet-next";
|
|
20
|
-
readonly TYPE: {
|
|
21
|
-
readonly BULLET: "bullet";
|
|
22
|
-
readonly FRACTION: "fraction";
|
|
23
|
-
readonly SCROLL: "scroll";
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare const SYNC: {
|
|
27
|
-
readonly TYPE: {
|
|
28
|
-
readonly CAMERA: "camera";
|
|
29
|
-
readonly INDEX: "index";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
1
|
+
export declare const ARROW: {
|
|
2
|
+
readonly PREV_SELECTOR: ".flicking-arrow-prev";
|
|
3
|
+
readonly NEXT_SELECTOR: ".flicking-arrow-next";
|
|
4
|
+
readonly DISABLED_CLASS: "flicking-arrow-disabled";
|
|
5
|
+
};
|
|
6
|
+
export declare const PAGINATION: {
|
|
7
|
+
readonly SELECTOR: ".flicking-pagination";
|
|
8
|
+
readonly PREFIX: "flicking-pagination";
|
|
9
|
+
readonly BULLET_WRAPPER_SUFFIX: "bullets";
|
|
10
|
+
readonly BULLET_SUFFIX: "bullet";
|
|
11
|
+
readonly BULLET_ACTIVE_SUFFIX: "bullet-active";
|
|
12
|
+
readonly FRACTION_WRAPPER_SUFFIX: "fraction";
|
|
13
|
+
readonly FRACTION_CURRENT_SUFFIX: "fraction-current";
|
|
14
|
+
readonly FRACTION_TOTAL_SUFFIX: "fraction-total";
|
|
15
|
+
readonly SCROLL_UNINIT_SUFFIX: "uninitialized";
|
|
16
|
+
readonly SCROLL_WRAPPER_SUFFIX: "scroll";
|
|
17
|
+
readonly SCROLL_SLIDER_SUFFIX: "slider";
|
|
18
|
+
readonly SCROLL_PREV_SUFFIX: "bullet-prev";
|
|
19
|
+
readonly SCROLL_NEXT_SUFFIX: "bullet-next";
|
|
20
|
+
readonly TYPE: {
|
|
21
|
+
readonly BULLET: "bullet";
|
|
22
|
+
readonly FRACTION: "fraction";
|
|
23
|
+
readonly SCROLL: "scroll";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const SYNC: {
|
|
27
|
+
readonly TYPE: {
|
|
28
|
+
readonly CAMERA: "camera";
|
|
29
|
+
readonly INDEX: "index";
|
|
30
|
+
};
|
|
31
|
+
};
|
package/declaration/event.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const BROWSER: {
|
|
2
|
-
CLICK: string;
|
|
3
|
-
MOUSE_DOWN: string;
|
|
4
|
-
TOUCH_START: string;
|
|
5
|
-
};
|
|
1
|
+
export declare const BROWSER: {
|
|
2
|
+
CLICK: string;
|
|
3
|
+
MOUSE_DOWN: string;
|
|
4
|
+
TOUCH_START: string;
|
|
5
|
+
};
|
package/declaration/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
export * from "./pagination";
|
|
8
|
-
export { Parallax, Fade, AutoPlay, Arrow, Sync, Perspective };
|
|
9
|
-
export type { SyncOptions, SychronizableFlickingOptions };
|
|
10
|
-
export
|
|
1
|
+
import Arrow from "./Arrow";
|
|
2
|
+
import AutoPlay from "./AutoPlay";
|
|
3
|
+
import Fade from "./Fade";
|
|
4
|
+
import Parallax from "./Parallax";
|
|
5
|
+
import Perspective from "./Perspective";
|
|
6
|
+
import Sync, { SychronizableFlickingOptions, SyncOptions } from "./Sync";
|
|
7
|
+
export * from "./pagination";
|
|
8
|
+
export { Parallax, Fade, AutoPlay, Arrow, Sync, Perspective };
|
|
9
|
+
export type { SyncOptions, SychronizableFlickingOptions };
|
|
10
|
+
export type { ArrowOptions } from "./Arrow";
|
|
11
|
+
export type { AutoPlayOptions } from "./AutoPlay";
|
|
12
|
+
export * from "./const";
|
|
13
|
+
export type { PerspectiveOptions } from "./Perspective";
|
|
@@ -1,61 +1,141 @@
|
|
|
1
|
-
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
-
import ScrollContext from "../type";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
1
|
+
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
+
import ScrollContext from "../type";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the {@link Pagination} plugin
|
|
5
|
+
*/
|
|
6
|
+
export interface PaginationOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The parent element to search for the pagination wrapper. If `null`, the Flicking element is used
|
|
9
|
+
* @defaultValue null
|
|
10
|
+
*/
|
|
11
|
+
parentEl: HTMLElement | null;
|
|
12
|
+
/**
|
|
13
|
+
* CSS selector for the pagination wrapper element
|
|
14
|
+
* @defaultValue ".flicking-pagination"
|
|
15
|
+
*/
|
|
16
|
+
selector: string;
|
|
17
|
+
/**
|
|
18
|
+
* Pagination display type
|
|
19
|
+
* @defaultValue "bullet"
|
|
20
|
+
*/
|
|
21
|
+
type: "bullet" | "fraction" | "scroll";
|
|
22
|
+
/**
|
|
23
|
+
* CSS class prefix for pagination elements
|
|
24
|
+
* @defaultValue "flicking-pagination"
|
|
25
|
+
*/
|
|
26
|
+
classPrefix: string;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum number of bullet indicators displayed at once (only for `"scroll"` type)
|
|
29
|
+
* @defaultValue 5
|
|
30
|
+
*/
|
|
31
|
+
bulletCount: number;
|
|
32
|
+
/**
|
|
33
|
+
* Custom render function for each bullet element
|
|
34
|
+
*/
|
|
35
|
+
renderBullet: (className: string, index: number) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Custom render function for the fraction display
|
|
38
|
+
*/
|
|
39
|
+
renderFraction: (currentClass: string, totalClass: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom render function for the active bullet element. If `null`, the default bullet is used
|
|
42
|
+
* @defaultValue null
|
|
43
|
+
*/
|
|
44
|
+
renderActiveBullet: ((className: string, index: number) => string) | null;
|
|
45
|
+
/**
|
|
46
|
+
* Format function for the current index in fraction type
|
|
47
|
+
*/
|
|
48
|
+
fractionCurrentFormat: (index: number) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Format function for the total count in fraction type
|
|
51
|
+
*/
|
|
52
|
+
fractionTotalFormat: (total: number) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Callback invoked when the scroll pagination index changes
|
|
55
|
+
*/
|
|
56
|
+
scrollOnChange: (index: number, ctx: ScrollContext) => any;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A plugin to add pagination indicators (bullets, fractions, or scrollable bullets) to Flicking
|
|
60
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/pagination | Demo: Pagination}
|
|
61
|
+
*/
|
|
62
|
+
declare class Pagination implements Plugin {
|
|
63
|
+
private _flicking;
|
|
64
|
+
private _renderer;
|
|
65
|
+
private _wrapper;
|
|
66
|
+
private _parentEl;
|
|
67
|
+
private _selector;
|
|
68
|
+
private _type;
|
|
69
|
+
private _classPrefix;
|
|
70
|
+
private _bulletCount;
|
|
71
|
+
private _renderBullet;
|
|
72
|
+
private _renderActiveBullet;
|
|
73
|
+
private _renderFraction;
|
|
74
|
+
private _fractionCurrentFormat;
|
|
75
|
+
private _fractionTotalFormat;
|
|
76
|
+
private _scrollOnChange;
|
|
77
|
+
/** Current value of the {@link PaginationOptions.parentEl | parentEl} option. */
|
|
78
|
+
get parentEl(): PaginationOptions["parentEl"];
|
|
79
|
+
/** Current value of the {@link PaginationOptions.selector | selector} option. */
|
|
80
|
+
get selector(): PaginationOptions["selector"];
|
|
81
|
+
/** Current value of the {@link PaginationOptions.type | type} option. */
|
|
82
|
+
get type(): PaginationOptions["type"];
|
|
83
|
+
/** Current value of the {@link PaginationOptions.classPrefix | classPrefix} option. */
|
|
84
|
+
get classPrefix(): string;
|
|
85
|
+
/** Current value of the {@link PaginationOptions.bulletCount | bulletCount} option. */
|
|
86
|
+
get bulletCount(): PaginationOptions["bulletCount"];
|
|
87
|
+
/** Current value of the {@link PaginationOptions.renderBullet | renderBullet} option. */
|
|
88
|
+
get renderBullet(): PaginationOptions["renderBullet"];
|
|
89
|
+
/** Current value of the {@link PaginationOptions.renderActiveBullet | renderActiveBullet} option. */
|
|
90
|
+
get renderActiveBullet(): PaginationOptions["renderActiveBullet"];
|
|
91
|
+
/** Current value of the {@link PaginationOptions.renderFraction | renderFraction} option. */
|
|
92
|
+
get renderFraction(): PaginationOptions["renderFraction"];
|
|
93
|
+
/** Current value of the {@link PaginationOptions.fractionCurrentFormat | fractionCurrentFormat} option. */
|
|
94
|
+
get fractionCurrentFormat(): PaginationOptions["fractionCurrentFormat"];
|
|
95
|
+
/** Current value of the {@link PaginationOptions.fractionTotalFormat | fractionTotalFormat} option. */
|
|
96
|
+
get fractionTotalFormat(): PaginationOptions["fractionTotalFormat"];
|
|
97
|
+
/** Current value of the {@link PaginationOptions.scrollOnChange | scrollOnChange} option. */
|
|
98
|
+
get scrollOnChange(): PaginationOptions["scrollOnChange"];
|
|
99
|
+
/** Sets {@link PaginationOptions.parentEl | parentEl}. */
|
|
100
|
+
set parentEl(val: PaginationOptions["parentEl"]);
|
|
101
|
+
/** Sets {@link PaginationOptions.selector | selector}. */
|
|
102
|
+
set selector(val: PaginationOptions["selector"]);
|
|
103
|
+
/** Sets {@link PaginationOptions.type | type}. */
|
|
104
|
+
set type(val: PaginationOptions["type"]);
|
|
105
|
+
/** Sets {@link PaginationOptions.classPrefix | classPrefix}. */
|
|
106
|
+
set bulletWrapperclassPrefixClass(val: PaginationOptions["classPrefix"]);
|
|
107
|
+
/** Sets {@link PaginationOptions.bulletCount | bulletCount}. */
|
|
108
|
+
set bulletCount(val: PaginationOptions["bulletCount"]);
|
|
109
|
+
/** Sets {@link PaginationOptions.renderBullet | renderBullet}. */
|
|
110
|
+
set renderBullet(val: PaginationOptions["renderBullet"]);
|
|
111
|
+
/** Sets {@link PaginationOptions.renderActiveBullet | renderActiveBullet}. */
|
|
112
|
+
set renderActiveBullet(val: PaginationOptions["renderActiveBullet"]);
|
|
113
|
+
/** Sets {@link PaginationOptions.renderFraction | renderFraction}. */
|
|
114
|
+
set renderFraction(val: PaginationOptions["renderFraction"]);
|
|
115
|
+
/** Sets {@link PaginationOptions.fractionCurrentFormat | fractionCurrentFormat}. */
|
|
116
|
+
set fractionCurrentFormat(val: PaginationOptions["fractionCurrentFormat"]);
|
|
117
|
+
/** Sets {@link PaginationOptions.fractionTotalFormat | fractionTotalFormat}. */
|
|
118
|
+
set fractionTotalFormat(val: PaginationOptions["fractionTotalFormat"]);
|
|
119
|
+
/** Sets {@link PaginationOptions.scrollOnChange | scrollOnChange}. */
|
|
120
|
+
set scrollOnChange(val: PaginationOptions["scrollOnChange"]);
|
|
121
|
+
/**
|
|
122
|
+
* @param options - Options for the Pagination instance
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* flicking.addPlugins(new Pagination({ type: "bullet", selector: ".flicking-pagination" }));
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
constructor(options?: Partial<PaginationOptions>);
|
|
129
|
+
/** Initialize the plugin, create the pagination renderer, and attach event listeners to the Flicking instance.
|
|
130
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
131
|
+
*/
|
|
132
|
+
init(flicking: Flicking): void;
|
|
133
|
+
/** Destroy the plugin, remove all event listeners, and clean up pagination DOM elements. */
|
|
134
|
+
destroy(): void;
|
|
135
|
+
/** Re-render the pagination indicators to reflect the current panel state. */
|
|
136
|
+
update: () => void;
|
|
137
|
+
private _createRenderer;
|
|
138
|
+
private _onIndexChange;
|
|
139
|
+
private _removeAllChilds;
|
|
140
|
+
}
|
|
141
|
+
export default Pagination;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Pagination, { PaginationOptions } from "./Pagination";
|
|
2
|
-
export { Pagination };
|
|
3
|
-
export type { PaginationOptions };
|
|
1
|
+
import Pagination, { PaginationOptions } from "./Pagination";
|
|
2
|
+
export { Pagination };
|
|
3
|
+
export type { PaginationOptions };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Renderer from "./Renderer";
|
|
2
|
-
declare class BulletRenderer extends Renderer {
|
|
3
|
-
private _bullets;
|
|
4
|
-
private _prevIndex;
|
|
5
|
-
private get _bulletClass();
|
|
6
|
-
private get _activeClass();
|
|
7
|
-
destroy(): void;
|
|
8
|
-
render(): void;
|
|
9
|
-
update(index: number): void;
|
|
10
|
-
}
|
|
11
|
-
export default BulletRenderer;
|
|
1
|
+
import Renderer from "./Renderer";
|
|
2
|
+
declare class BulletRenderer extends Renderer {
|
|
3
|
+
private _bullets;
|
|
4
|
+
private _prevIndex;
|
|
5
|
+
private get _bulletClass();
|
|
6
|
+
private get _activeClass();
|
|
7
|
+
destroy(): void;
|
|
8
|
+
render(): void;
|
|
9
|
+
update(index: number): void;
|
|
10
|
+
}
|
|
11
|
+
export default BulletRenderer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Renderer from "./Renderer";
|
|
2
|
-
declare class FractionRenderer extends Renderer {
|
|
3
|
-
private _prevIndex;
|
|
4
|
-
private _prevTotal;
|
|
5
|
-
destroy(): void;
|
|
6
|
-
render(): void;
|
|
7
|
-
update(index: number): void;
|
|
8
|
-
}
|
|
9
|
-
export default FractionRenderer;
|
|
1
|
+
import Renderer from "./Renderer";
|
|
2
|
+
declare class FractionRenderer extends Renderer {
|
|
3
|
+
private _prevIndex;
|
|
4
|
+
private _prevTotal;
|
|
5
|
+
destroy(): void;
|
|
6
|
+
render(): void;
|
|
7
|
+
update(index: number): void;
|
|
8
|
+
}
|
|
9
|
+
export default FractionRenderer;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import Flicking from "@egjs/flicking";
|
|
2
|
-
import Pagination from "../Pagination";
|
|
3
|
-
export interface RendererOptions {
|
|
4
|
-
flicking: Flicking;
|
|
5
|
-
pagination: Pagination;
|
|
6
|
-
wrapper: HTMLElement;
|
|
7
|
-
}
|
|
8
|
-
declare abstract class Renderer {
|
|
9
|
-
protected _flicking: Flicking;
|
|
10
|
-
protected _pagination: Pagination;
|
|
11
|
-
protected _wrapper: HTMLElement;
|
|
12
|
-
constructor(
|
|
13
|
-
abstract destroy(): void;
|
|
14
|
-
abstract render(): void;
|
|
15
|
-
abstract update(index: number): void;
|
|
16
|
-
protected _createBulletFromString(html: string, index: number): HTMLElement;
|
|
17
|
-
protected _addBulletEvents(bullet: HTMLElement, index: number): void;
|
|
18
|
-
}
|
|
19
|
-
export default Renderer;
|
|
1
|
+
import Flicking from "@egjs/flicking";
|
|
2
|
+
import Pagination from "../Pagination";
|
|
3
|
+
export interface RendererOptions {
|
|
4
|
+
flicking: Flicking;
|
|
5
|
+
pagination: Pagination;
|
|
6
|
+
wrapper: HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
declare abstract class Renderer {
|
|
9
|
+
protected _flicking: Flicking;
|
|
10
|
+
protected _pagination: Pagination;
|
|
11
|
+
protected _wrapper: HTMLElement;
|
|
12
|
+
constructor(options: RendererOptions);
|
|
13
|
+
abstract destroy(): void;
|
|
14
|
+
abstract render(): void;
|
|
15
|
+
abstract update(index: number): void;
|
|
16
|
+
protected _createBulletFromString(html: string, index: number): HTMLElement;
|
|
17
|
+
protected _addBulletEvents(bullet: HTMLElement, index: number): void;
|
|
18
|
+
}
|
|
19
|
+
export default Renderer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Renderer from "./Renderer";
|
|
2
|
-
declare class ScrollBulletRenderer extends Renderer {
|
|
3
|
-
private _bullets;
|
|
4
|
-
private _bulletSize;
|
|
5
|
-
private _previousIndex;
|
|
6
|
-
private _sliderIndex;
|
|
7
|
-
destroy(): void;
|
|
8
|
-
render(): void;
|
|
9
|
-
update(index: number): void;
|
|
10
|
-
moveTo: (index: number) => void;
|
|
11
|
-
}
|
|
12
|
-
export default ScrollBulletRenderer;
|
|
1
|
+
import Renderer from "./Renderer";
|
|
2
|
+
declare class ScrollBulletRenderer extends Renderer {
|
|
3
|
+
private _bullets;
|
|
4
|
+
private _bulletSize;
|
|
5
|
+
private _previousIndex;
|
|
6
|
+
private _sliderIndex;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
render(): void;
|
|
9
|
+
update(index: number): void;
|
|
10
|
+
moveTo: (index: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export default ScrollBulletRenderer;
|