@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.
Files changed (54) hide show
  1. package/README.md +42 -51
  2. package/css/all.css +2 -0
  3. package/css/arrow.css +2 -2
  4. package/css/pagination.css +5 -3
  5. package/declaration/Arrow.d.ts +106 -51
  6. package/declaration/AutoPlay.d.ts +104 -44
  7. package/declaration/Fade.d.ts +41 -16
  8. package/declaration/Parallax.d.ts +41 -16
  9. package/declaration/Perspective.d.ts +71 -28
  10. package/declaration/Sync.d.ts +93 -37
  11. package/declaration/const.d.ts +31 -31
  12. package/declaration/event.d.ts +5 -5
  13. package/declaration/index.d.ts +13 -10
  14. package/declaration/pagination/Pagination.d.ts +141 -61
  15. package/declaration/pagination/index.d.ts +3 -3
  16. package/declaration/pagination/renderer/BulletRenderer.d.ts +11 -11
  17. package/declaration/pagination/renderer/FractionRenderer.d.ts +9 -9
  18. package/declaration/pagination/renderer/Renderer.d.ts +19 -19
  19. package/declaration/pagination/renderer/ScrollBulletRenderer.d.ts +12 -12
  20. package/declaration/tsdoc-metadata.json +11 -0
  21. package/declaration/type.d.ts +9 -9
  22. package/declaration/utils.d.ts +3 -3
  23. package/dist/arrow.css +2 -2
  24. package/dist/flicking-plugins.css +23 -8
  25. package/dist/flicking-plugins.min.css +1 -1
  26. package/dist/pagination.css +21 -6
  27. package/dist/pagination.min.css +1 -1
  28. package/dist/plugins.esm.js +1029 -1591
  29. package/dist/plugins.esm.js.map +1 -1
  30. package/dist/plugins.js +1046 -1620
  31. package/dist/plugins.js.map +1 -1
  32. package/dist/plugins.min.js +1 -9
  33. package/dist/plugins.min.js.map +1 -1
  34. package/package.json +49 -105
  35. package/src/Arrow.ts +133 -82
  36. package/src/AutoPlay.ts +105 -35
  37. package/src/Fade.ts +31 -11
  38. package/src/Parallax.ts +31 -11
  39. package/src/Perspective.ts +69 -22
  40. package/src/Sync.ts +69 -25
  41. package/src/index.ts +9 -22
  42. package/src/pagination/Pagination.ts +163 -40
  43. package/src/pagination/index.ts +2 -6
  44. package/src/pagination/renderer/BulletRenderer.ts +1 -4
  45. package/src/pagination/renderer/FractionRenderer.ts +1 -3
  46. package/src/pagination/renderer/Renderer.ts +14 -13
  47. package/src/pagination/renderer/ScrollBulletRenderer.ts +5 -12
  48. package/CONTRIBUTING +0 -58
  49. package/rollup.config.dev.js +0 -17
  50. package/rollup.config.js +0 -33
  51. package/tsconfig.declaration.json +0 -10
  52. package/tsconfig.eslint.json +0 -8
  53. package/tsconfig.json +0 -17
  54. package/tsconfig.test.json +0 -21
@@ -1,28 +1,71 @@
1
- import Flicking, { Plugin } from "@egjs/flicking";
2
- interface PerspectiveOptions {
3
- selector: string;
4
- scale: number;
5
- rotate: number;
6
- perspective: number;
7
- }
8
- declare class Perspective implements Plugin {
9
- private _flicking;
10
- private _selector;
11
- private _scale;
12
- private _rotate;
13
- private _perspective;
14
- get selector(): string;
15
- get scale(): number;
16
- get rotate(): number;
17
- get perspective(): number;
18
- set selector(val: string);
19
- set scale(val: number);
20
- set rotate(val: number);
21
- set perspective(val: number);
22
- constructor({ selector, scale, rotate, perspective }?: Partial<PerspectiveOptions>);
23
- init(flicking: Flicking): void;
24
- destroy(): void;
25
- update: () => void;
26
- private _onMove;
27
- }
28
- export default Perspective;
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;
@@ -1,37 +1,93 @@
1
- import Flicking from "@egjs/flicking";
2
- import type { Plugin } from "@egjs/flicking";
3
- import { SYNC } from "./const";
4
- export interface SyncOptions {
5
- type: typeof SYNC.TYPE.CAMERA | typeof SYNC.TYPE.INDEX;
6
- synchronizedFlickingOptions: SychronizableFlickingOptions[];
7
- }
8
- export interface SychronizableFlickingOptions {
9
- flicking: Flicking;
10
- isClickable?: boolean;
11
- isSlidable?: boolean;
12
- activeClass?: string;
13
- }
14
- declare class Sync implements Plugin {
15
- private _flicking;
16
- private _type;
17
- private _synchronizedFlickingOptions;
18
- get type(): SyncOptions["type"];
19
- get synchronizedFlickingOptions(): SyncOptions["synchronizedFlickingOptions"];
20
- set type(val: SyncOptions["type"]);
21
- set synchronizedFlickingOptions(val: SyncOptions["synchronizedFlickingOptions"]);
22
- constructor({ type, synchronizedFlickingOptions }?: Partial<SyncOptions>);
23
- init(flicking: Flicking): void;
24
- destroy(): void;
25
- update(): void;
26
- private _preventEvent;
27
- private _addEvents;
28
- private _removeEvents;
29
- private _onIndexChange;
30
- private _onMove;
31
- private _onMoveStart;
32
- private _onMoveEnd;
33
- private _onSelect;
34
- private _synchronizeByIndex;
35
- private _updateClass;
36
- }
37
- export default Sync;
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;
@@ -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
+ };
@@ -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
+ };
@@ -1,10 +1,13 @@
1
- import Parallax from "./Parallax";
2
- import Fade from "./Fade";
3
- import AutoPlay from "./AutoPlay";
4
- import Arrow from "./Arrow";
5
- import Sync, { SyncOptions, SychronizableFlickingOptions } from "./Sync";
6
- import Perspective from "./Perspective";
7
- export * from "./pagination";
8
- export { Parallax, Fade, AutoPlay, Arrow, Sync, Perspective };
9
- export type { SyncOptions, SychronizableFlickingOptions };
10
- export * from "./const";
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
- export interface PaginationOptions {
4
- parentEl: HTMLElement | null;
5
- selector: string;
6
- type: "bullet" | "fraction" | "scroll";
7
- classPrefix: string;
8
- bulletCount: number;
9
- renderBullet: (className: string, index: number) => string;
10
- renderFraction: (currentClass: string, totalClass: string) => string;
11
- renderActiveBullet: ((className: string, index: number) => string) | null;
12
- fractionCurrentFormat: (index: number) => string;
13
- fractionTotalFormat: (total: number) => string;
14
- scrollOnChange: (index: number, ctx: ScrollContext) => any;
15
- }
16
- declare class Pagination implements Plugin {
17
- private _flicking;
18
- private _renderer;
19
- private _wrapper;
20
- private _parentEl;
21
- private _selector;
22
- private _type;
23
- private _classPrefix;
24
- private _bulletCount;
25
- private _renderBullet;
26
- private _renderActiveBullet;
27
- private _renderFraction;
28
- private _fractionCurrentFormat;
29
- private _fractionTotalFormat;
30
- private _scrollOnChange;
31
- get parentEl(): PaginationOptions["parentEl"];
32
- get selector(): PaginationOptions["selector"];
33
- get type(): PaginationOptions["type"];
34
- get classPrefix(): string;
35
- get bulletCount(): PaginationOptions["bulletCount"];
36
- get renderBullet(): PaginationOptions["renderBullet"];
37
- get renderActiveBullet(): PaginationOptions["renderActiveBullet"];
38
- get renderFraction(): PaginationOptions["renderFraction"];
39
- get fractionCurrentFormat(): PaginationOptions["fractionCurrentFormat"];
40
- get fractionTotalFormat(): PaginationOptions["fractionTotalFormat"];
41
- get scrollOnChange(): PaginationOptions["scrollOnChange"];
42
- set parentEl(val: PaginationOptions["parentEl"]);
43
- set selector(val: PaginationOptions["selector"]);
44
- set type(val: PaginationOptions["type"]);
45
- set bulletWrapperclassPrefixClass(val: PaginationOptions["classPrefix"]);
46
- set bulletCount(val: PaginationOptions["bulletCount"]);
47
- set renderBullet(val: PaginationOptions["renderBullet"]);
48
- set renderActiveBullet(val: PaginationOptions["renderActiveBullet"]);
49
- set renderFraction(val: PaginationOptions["renderFraction"]);
50
- set fractionCurrentFormat(val: PaginationOptions["fractionCurrentFormat"]);
51
- set fractionTotalFormat(val: PaginationOptions["fractionTotalFormat"]);
52
- set scrollOnChange(val: PaginationOptions["scrollOnChange"]);
53
- constructor({ parentEl, selector, type, classPrefix, bulletCount, renderBullet, renderActiveBullet, renderFraction, fractionCurrentFormat, fractionTotalFormat, scrollOnChange }?: Partial<PaginationOptions>);
54
- init(flicking: Flicking): void;
55
- destroy(): void;
56
- update: () => void;
57
- private _createRenderer;
58
- private _onIndexChange;
59
- private _removeAllChilds;
60
- }
61
- export default Pagination;
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({ flicking, pagination, wrapper }: 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
+ 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;