@egjs/flicking-plugins 4.7.2-beta.1 → 4.7.2-beta.10
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 +63 -2
- package/declaration/AutoPlay.d.ts +68 -4
- package/declaration/Fade.d.ts +25 -0
- package/declaration/Parallax.d.ts +25 -0
- package/declaration/Perspective.d.ts +45 -2
- package/declaration/Sync.d.ts +57 -2
- package/declaration/index.d.ts +7 -4
- package/declaration/pagination/Pagination.d.ts +81 -1
- package/declaration/pagination/renderer/Renderer.d.ts +1 -1
- package/declaration/tsdoc-metadata.json +11 -0
- 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 +1020 -1535
- package/dist/plugins.esm.js.map +1 -1
- package/dist/plugins.js +1044 -1571
- 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 +124 -49
- package/src/AutoPlay.ts +110 -31
- package/src/Fade.ts +31 -11
- package/src/Parallax.ts +31 -11
- package/src/Perspective.ts +69 -22
- package/src/Sync.ts +61 -19
- 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
package/README.md
CHANGED
|
@@ -1,75 +1,66 @@
|
|
|
1
|
-
# @egjs/flicking-plugins
|
|
1
|
+
# @egjs/flicking-plugins
|
|
2
2
|
|
|
3
|
+
> Part of the [@egjs/flicking](https://github.com/naver/egjs-flicking) monorepo.
|
|
3
4
|
|
|
4
5
|
<h1 align="center" style="max-width: 100%;">
|
|
5
6
|
<img width="800" alt="Flicking Logo" src="https://naver.github.io/egjs-flicking/images/flicking.svg" style="max-width: 100%;" /><br/>
|
|
6
7
|
<a href="https://naver.github.io/egjs-flicking/Plugins">@egjs/flicking-plugins</a>
|
|
7
8
|
</h1>
|
|
8
9
|
|
|
9
|
-
Ready
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
10
|
+
Ready-to-use plugins for [@egjs/flicking](https://github.com/naver/egjs-flicking)
|
|
11
|
+
|
|
12
|
+
## Available Plugins
|
|
13
|
+
|
|
14
|
+
- [**AutoPlay**](https://naver.github.io/egjs-flicking/Plugins#autoplay): Add autoplay to move to the next/previous panel periodically.
|
|
15
|
+
- [**Parallax**](https://naver.github.io/egjs-flicking/Plugins#parallax): Add parallax effect attached with Flicking interaction.
|
|
16
|
+
- [**Fade**](https://naver.github.io/egjs-flicking/Plugins#fade): Add fade effect attached with Flicking interaction.
|
|
17
|
+
- [**Perspective**](https://naver.github.io/egjs-flicking/Plugins#perspective): Add 3D perspective effect.
|
|
18
|
+
- [**Sync**](https://naver.github.io/egjs-flicking/Plugins#sync): Synchronize multiple Flicking instances.
|
|
19
|
+
- [**Arrow**](https://naver.github.io/egjs-flicking/Plugins#arrow): Add prev/next button to Flicking.
|
|
20
|
+
- [**Pagination**](https://naver.github.io/egjs-flicking/Plugins#pagination): Add pagination bullets to Flicking.
|
|
16
21
|
|
|
17
22
|
## ⚙️ Installation
|
|
18
|
-
|
|
23
|
+
|
|
24
|
+
### npm
|
|
19
25
|
```bash
|
|
20
26
|
npm install @egjs/flicking-plugins
|
|
21
27
|
```
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- **Specific version**
|
|
28
|
-
- https://naver.github.io/egjs-flicking-plugins/release/[PLUGIN-VERSION]/dist/plugins.js (all)
|
|
29
|
-
- https://naver.github.io/egjs-flicking-plugins/release/[PLUGIN-VERSION]/dist/plugins.min.js (all)
|
|
29
|
+
### CDN
|
|
30
|
+
```html
|
|
31
|
+
<!-- All plugins -->
|
|
32
|
+
<script src="https://unpkg.com/@egjs/flicking-plugins/dist/plugins.js"></script>
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import { Fade, Parallax, AutoPlay } from "@egjs/flicking-plugins";
|
|
34
|
-
|
|
35
|
-
flicking.addPlugins(new Fade(), new Parallax(), new AutoPlay());
|
|
34
|
+
<!-- Specific version -->
|
|
35
|
+
<script src="https://unpkg.com/@egjs/flicking-plugins@VERSION/dist/plugins.js"></script>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
|
|
38
|
+
## 📖 Documentation
|
|
39
|
+
|
|
40
|
+
Full documentation: [https://naver.github.io/egjs-flicking/Plugins](https://naver.github.io/egjs-flicking/Plugins)
|
|
41
|
+
|
|
42
|
+
## 💻 Development
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
egjs-flicking-plugins is released under the [MIT license](http://naver.github.io/egjs/license.txt).
|
|
44
|
+
This package is part of the [egjs-flicking monorepo](https://github.com/naver/egjs-flicking). See the root README for development instructions.
|
|
43
45
|
|
|
46
|
+
### Building
|
|
47
|
+
```bash
|
|
48
|
+
pnpm build
|
|
44
49
|
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
in the Software without restriction, including without limitation the rights
|
|
50
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
51
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
52
|
-
furnished to do so, subject to the following conditions:
|
|
53
|
-
|
|
54
|
-
The above copyright notice and this permission notice shall be included in
|
|
55
|
-
all copies or substantial portions of the Software.
|
|
56
|
-
|
|
57
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
58
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
59
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
60
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
61
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
62
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
63
|
-
THE SOFTWARE.
|
|
50
|
+
|
|
51
|
+
### Testing
|
|
52
|
+
```bash
|
|
53
|
+
pnpm test
|
|
64
54
|
```
|
|
65
55
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
## 📝 License
|
|
57
|
+
|
|
58
|
+
MIT License
|
|
59
|
+
|
|
60
|
+
Copyright (c) 2015-present NAVER Corp.
|
|
69
61
|
|
|
62
|
+
See [LICENSE](../../LICENSE) for details.
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
[badge-version]: https://img.shields.io/npm/v/@egjs/flicking-plugins.svg?style=flat
|
|
64
|
+
## 🙌 Contributing
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
[link-version]: https://www.npmjs.com/package/@egjs/flicking-plugins
|
|
66
|
+
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines.
|
package/css/all.css
ADDED
package/css/arrow.css
CHANGED
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
.flicking-arrow-prev.is-thin::before,
|
|
91
91
|
.flicking-arrow-prev.is-thin::after,
|
|
92
92
|
.flicking-arrow-next.is-thin::before,
|
|
93
|
-
.flicking-arrow-next.is-thin::after{
|
|
93
|
+
.flicking-arrow-next.is-thin::after {
|
|
94
94
|
height: 3px;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.flicking-arrow-prev.is-thin::after,
|
|
98
|
-
.flicking-arrow-next.is-thin::after{
|
|
98
|
+
.flicking-arrow-next.is-thin::after {
|
|
99
99
|
top: calc(50% - 2px);
|
|
100
100
|
}
|
package/css/pagination.css
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.flicking-pagination-scroll .flicking-pagination-slider {
|
|
23
|
-
transition: .2s transform;
|
|
23
|
+
transition: 0.2s transform;
|
|
24
24
|
}
|
|
25
25
|
.flicking-pagination-scroll.flicking-pagination-uninitialized .flicking-pagination-slider,
|
|
26
26
|
.flicking-pagination-scroll.flicking-pagination-uninitialized .flicking-pagination-bullet {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
.flicking-pagination-scroll .flicking-pagination-bullet {
|
|
42
42
|
vertical-align: middle;
|
|
43
43
|
position: relative;
|
|
44
|
-
transition: .2s transform;
|
|
44
|
+
transition: 0.2s transform;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.flicking-pagination-bullet-active {
|
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
.flicking-pagination-scroll .flicking-pagination-bullet {
|
|
52
52
|
vertical-align: middle;
|
|
53
53
|
position: relative;
|
|
54
|
-
transition:
|
|
54
|
+
transition:
|
|
55
|
+
0.2s transform,
|
|
56
|
+
0.2s left;
|
|
55
57
|
transform: scale(0);
|
|
56
58
|
}
|
|
57
59
|
|
package/declaration/Arrow.d.ts
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Options for the {@link Arrow} plugin
|
|
4
|
+
*/
|
|
5
|
+
export interface ArrowOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The parent element to search for arrow elements. If `null`, the Flicking element is used
|
|
8
|
+
* @defaultValue null
|
|
9
|
+
*/
|
|
3
10
|
parentEl: HTMLElement | null;
|
|
11
|
+
/**
|
|
12
|
+
* CSS selector for the "previous" arrow element
|
|
13
|
+
* @defaultValue ".flicking-arrow-prev"
|
|
14
|
+
*/
|
|
4
15
|
prevElSelector: string;
|
|
16
|
+
/**
|
|
17
|
+
* CSS selector for the "next" arrow element
|
|
18
|
+
* @defaultValue ".flicking-arrow-next"
|
|
19
|
+
*/
|
|
5
20
|
nextElSelector: string;
|
|
21
|
+
/**
|
|
22
|
+
* CSS class added to an arrow element when it is disabled (at the start/end of non-circular Flicking)
|
|
23
|
+
* @defaultValue "flicking-arrow-disabled"
|
|
24
|
+
*/
|
|
6
25
|
disabledClass: string;
|
|
26
|
+
/**
|
|
27
|
+
* Number of panels to move when an arrow is clicked
|
|
28
|
+
* @defaultValue 1
|
|
29
|
+
*/
|
|
7
30
|
moveCount: number;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to move by viewport size instead of panel count
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
8
35
|
moveByViewportSize: boolean;
|
|
9
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* A plugin to easily create prev/next arrow buttons for Flicking
|
|
39
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/arrow | Demo: Arrow}
|
|
40
|
+
*/
|
|
10
41
|
declare class Arrow implements Plugin {
|
|
11
42
|
private _flicking;
|
|
12
43
|
private _prevEl;
|
|
@@ -17,23 +48,53 @@ declare class Arrow implements Plugin {
|
|
|
17
48
|
private _disabledClass;
|
|
18
49
|
private _moveCount;
|
|
19
50
|
private _moveByViewportSize;
|
|
51
|
+
/** The "previous" arrow HTMLElement
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
20
54
|
get prevEl(): HTMLElement;
|
|
55
|
+
/** The "next" arrow HTMLElement
|
|
56
|
+
* @readonly
|
|
57
|
+
*/
|
|
21
58
|
get nextEl(): HTMLElement;
|
|
59
|
+
/** Current value of the {@link ArrowOptions.parentEl | parentEl} option. */
|
|
22
60
|
get parentEl(): ArrowOptions["parentEl"];
|
|
61
|
+
/** Current value of the {@link ArrowOptions.prevElSelector | prevElSelector} option. */
|
|
23
62
|
get prevElSelector(): ArrowOptions["prevElSelector"];
|
|
63
|
+
/** Current value of the {@link ArrowOptions.nextElSelector | nextElSelector} option. */
|
|
24
64
|
get nextElSelector(): ArrowOptions["nextElSelector"];
|
|
65
|
+
/** Current value of the {@link ArrowOptions.disabledClass | disabledClass} option. */
|
|
25
66
|
get disabledClass(): ArrowOptions["disabledClass"];
|
|
67
|
+
/** Current value of the {@link ArrowOptions.moveCount | moveCount} option. */
|
|
26
68
|
get moveCount(): ArrowOptions["moveCount"];
|
|
69
|
+
/** Current value of the {@link ArrowOptions.moveByViewportSize | moveByViewportSize} option. */
|
|
27
70
|
get moveByViewportSize(): ArrowOptions["moveByViewportSize"];
|
|
71
|
+
/** Sets {@link ArrowOptions.parentEl | parentEl}. */
|
|
28
72
|
set parentEl(val: ArrowOptions["parentEl"]);
|
|
73
|
+
/** Sets {@link ArrowOptions.prevElSelector | prevElSelector}. */
|
|
29
74
|
set prevElSelector(val: ArrowOptions["prevElSelector"]);
|
|
75
|
+
/** Sets {@link ArrowOptions.nextElSelector | nextElSelector}. */
|
|
30
76
|
set nextElSelector(val: ArrowOptions["nextElSelector"]);
|
|
77
|
+
/** Sets {@link ArrowOptions.disabledClass | disabledClass}. */
|
|
31
78
|
set disabledClass(val: ArrowOptions["disabledClass"]);
|
|
79
|
+
/** Sets {@link ArrowOptions.moveCount | moveCount}. */
|
|
32
80
|
set moveCount(val: ArrowOptions["moveCount"]);
|
|
81
|
+
/** Sets {@link ArrowOptions.moveByViewportSize | moveByViewportSize}. */
|
|
33
82
|
set moveByViewportSize(val: ArrowOptions["moveByViewportSize"]);
|
|
34
|
-
|
|
83
|
+
/**
|
|
84
|
+
* @param options - Options for the Arrow instance
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* flicking.addPlugins(new Arrow({ parentEl: null, prevElSelector: ".flicking-arrow-prev", nextElSelector: ".flicking-arrow-next" }));
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
constructor(options?: Partial<ArrowOptions>);
|
|
91
|
+
/** Initialize the plugin and attach arrow event listeners to the Flicking instance.
|
|
92
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
93
|
+
*/
|
|
35
94
|
init(flicking: Flicking): void;
|
|
95
|
+
/** Destroy the plugin and remove all arrow event listeners. */
|
|
36
96
|
destroy(): void;
|
|
97
|
+
/** Update the arrow disabled/enabled state based on the current camera position. */
|
|
37
98
|
update(): void;
|
|
38
99
|
private _preventInputPropagation;
|
|
39
100
|
private _onPrevClick;
|
|
@@ -1,37 +1,101 @@
|
|
|
1
|
-
import Flicking, {
|
|
2
|
-
|
|
1
|
+
import Flicking, { DIRECTION, Plugin } from "@egjs/flicking";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the {@link AutoPlay} plugin
|
|
4
|
+
*/
|
|
5
|
+
export interface AutoPlayOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Time to wait before moving on to the next panel (ms)
|
|
8
|
+
* @defaultValue 2000
|
|
9
|
+
*/
|
|
3
10
|
duration: number;
|
|
11
|
+
/**
|
|
12
|
+
* Duration of the panel move animation (ms). If `undefined`, the Flicking instance's `duration` is used
|
|
13
|
+
* @defaultValue undefined
|
|
14
|
+
*/
|
|
4
15
|
animationDuration: number | undefined;
|
|
5
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The direction in which the panel moves
|
|
18
|
+
* @defaultValue "NEXT"
|
|
19
|
+
*/
|
|
20
|
+
direction: (typeof DIRECTION)["NEXT"] | (typeof DIRECTION)["PREV"];
|
|
21
|
+
/**
|
|
22
|
+
* Whether to stop when the mouse hovers over the element
|
|
23
|
+
* @defaultValue false
|
|
24
|
+
*/
|
|
6
25
|
stopOnHover: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to stop autoplay when the plugin is first initialized
|
|
28
|
+
* @defaultValue false
|
|
29
|
+
*/
|
|
30
|
+
stopOnInit: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* If `stopOnHover` is true, time to wait before resuming after mouse leaves (ms)
|
|
33
|
+
* @defaultValue Same as `duration`
|
|
34
|
+
*/
|
|
7
35
|
delayAfterHover: number;
|
|
8
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Plugin that allows you to automatically move to the next/previous panel on a specific time basis
|
|
39
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/autoplay | Demo: AutoPlay}
|
|
40
|
+
*/
|
|
9
41
|
declare class AutoPlay implements Plugin {
|
|
10
42
|
private _duration;
|
|
11
43
|
private _animationDuration;
|
|
12
44
|
private _direction;
|
|
13
45
|
private _stopOnHover;
|
|
46
|
+
private _stopOnInit;
|
|
14
47
|
private _delayAfterHover;
|
|
15
48
|
private _flicking;
|
|
16
49
|
private _timerId;
|
|
17
50
|
private _mouseEntered;
|
|
18
51
|
private _playing;
|
|
52
|
+
/** Current value of the {@link AutoPlayOptions.duration | duration} option. */
|
|
19
53
|
get duration(): number;
|
|
54
|
+
/** Current value of the {@link AutoPlayOptions.animationDuration | animationDuration} option. */
|
|
20
55
|
get animationDuration(): number | undefined;
|
|
56
|
+
/** Current value of the {@link AutoPlayOptions.direction | direction} option. */
|
|
21
57
|
get direction(): AutoPlayOptions["direction"];
|
|
58
|
+
/** Current value of the {@link AutoPlayOptions.stopOnHover | stopOnHover} option. */
|
|
22
59
|
get stopOnHover(): boolean;
|
|
60
|
+
/** Current value of the {@link AutoPlayOptions.stopOnInit | stopOnInit} option. */
|
|
61
|
+
get stopOnInit(): boolean;
|
|
62
|
+
/** Current value of the {@link AutoPlayOptions.delayAfterHover | delayAfterHover} option. */
|
|
23
63
|
get delayAfterHover(): number;
|
|
64
|
+
/** Whether the autoplay is currently active
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
24
67
|
get playing(): boolean;
|
|
68
|
+
/** Sets {@link AutoPlayOptions.duration | duration}. */
|
|
25
69
|
set duration(val: number);
|
|
70
|
+
/** Sets {@link AutoPlayOptions.animationDuration | animationDuration}. */
|
|
26
71
|
set animationDuration(val: number | undefined);
|
|
72
|
+
/** Sets {@link AutoPlayOptions.direction | direction}. */
|
|
27
73
|
set direction(val: AutoPlayOptions["direction"]);
|
|
74
|
+
/** Sets {@link AutoPlayOptions.stopOnHover | stopOnHover}. */
|
|
28
75
|
set stopOnHover(val: boolean);
|
|
76
|
+
/** Sets {@link AutoPlayOptions.stopOnInit | stopOnInit}. */
|
|
77
|
+
set stopOnInit(val: boolean);
|
|
78
|
+
/** Sets {@link AutoPlayOptions.delayAfterHover | delayAfterHover}. */
|
|
29
79
|
set delayAfterHover(val: number);
|
|
30
|
-
|
|
80
|
+
/**
|
|
81
|
+
* @param options - Options for the AutoPlay instance
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* flicking.addPlugins(new AutoPlay({ duration: 2000, direction: "NEXT" }));
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
constructor(options?: Partial<AutoPlayOptions>);
|
|
88
|
+
/** Initialize the plugin and start autoplay on the given Flicking instance.
|
|
89
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
90
|
+
*/
|
|
31
91
|
init(flicking: Flicking): void;
|
|
92
|
+
/** Destroy the plugin, stop autoplay, and remove all event listeners. */
|
|
32
93
|
destroy(): void;
|
|
94
|
+
/** Update the plugin state. This is a no-op for AutoPlay. */
|
|
33
95
|
update(): void;
|
|
96
|
+
/** Start the autoplay timer. Panels will move automatically after the configured {@link AutoPlayOptions.duration | duration}. */
|
|
34
97
|
play: () => void;
|
|
98
|
+
/** Stop the autoplay timer and cancel any pending panel movement. */
|
|
35
99
|
stop: () => void;
|
|
36
100
|
private _movePanel;
|
|
37
101
|
private _onMouseEnter;
|
package/declaration/Fade.d.ts
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin to apply fade in/out effect while panels are moving
|
|
4
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/fade | Demo: Fade}
|
|
5
|
+
*/
|
|
2
6
|
declare class Fade implements Plugin {
|
|
3
7
|
private _flicking;
|
|
4
8
|
private _selector;
|
|
5
9
|
private _scale;
|
|
10
|
+
/** CSS selector for the element to apply the fade effect. If empty, the panel element itself is used
|
|
11
|
+
* @readonly
|
|
12
|
+
*/
|
|
6
13
|
get selector(): string;
|
|
14
|
+
/** Effect amplification scale
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
7
17
|
get scale(): number;
|
|
18
|
+
/** Sets the CSS selector for the target fade element. */
|
|
8
19
|
set selector(val: string);
|
|
20
|
+
/** Sets the effect amplification scale. */
|
|
9
21
|
set scale(val: number);
|
|
22
|
+
/**
|
|
23
|
+
* @param selector - CSS selector for the element to apply the fade effect. If empty, the panel element itself is used
|
|
24
|
+
* @param scale - Effect amplification scale
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* flicking.addPlugins(new Fade("p", 1));
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
constructor(selector?: string, scale?: number);
|
|
31
|
+
/** Initialize the plugin and apply the fade effect to the Flicking instance.
|
|
32
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
33
|
+
*/
|
|
11
34
|
init(flicking: Flicking): void;
|
|
35
|
+
/** Destroy the plugin and remove all event listeners. */
|
|
12
36
|
destroy(): void;
|
|
37
|
+
/** Recalculate and apply the fade effect to all visible panels. */
|
|
13
38
|
update: () => void;
|
|
14
39
|
private _onMove;
|
|
15
40
|
}
|
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin to apply parallax effect while panels are moving
|
|
4
|
+
* @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/parallax | Demo: Parallax}
|
|
5
|
+
*/
|
|
2
6
|
declare class Parallax implements Plugin {
|
|
3
7
|
private _flicking;
|
|
4
8
|
private _selector;
|
|
5
9
|
private _scale;
|
|
10
|
+
/** CSS selector for the element to apply the parallax effect. If empty, the panel element itself is used
|
|
11
|
+
* @readonly
|
|
12
|
+
*/
|
|
6
13
|
get selector(): string;
|
|
14
|
+
/** Effect amplification scale
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
7
17
|
get scale(): number;
|
|
18
|
+
/** Sets the CSS selector for the target parallax element. */
|
|
8
19
|
set selector(val: string);
|
|
20
|
+
/** Sets the effect amplification scale. */
|
|
9
21
|
set scale(val: number);
|
|
22
|
+
/**
|
|
23
|
+
* @param selector - CSS selector for the element to apply the parallax effect. If empty, the panel element itself is used
|
|
24
|
+
* @param scale - Effect amplification scale
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* flicking.addPlugins(new Parallax("img", 1));
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
constructor(selector?: string, scale?: number);
|
|
31
|
+
/** Initialize the plugin and apply the parallax effect to the Flicking instance.
|
|
32
|
+
* @param flicking - The Flicking instance to attach this plugin to
|
|
33
|
+
*/
|
|
11
34
|
init(flicking: Flicking): void;
|
|
35
|
+
/** Destroy the plugin and remove all event listeners. */
|
|
12
36
|
destroy(): void;
|
|
37
|
+
/** Recalculate and apply the parallax effect to all visible panels. */
|
|
13
38
|
update: () => void;
|
|
14
39
|
private _onMove;
|
|
15
40
|
}
|
|
@@ -1,27 +1,70 @@
|
|
|
1
1
|
import Flicking, { Plugin } from "@egjs/flicking";
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
10
|
selector: string;
|
|
11
|
+
/**
|
|
12
|
+
* Effect amplification scale
|
|
13
|
+
* @defaultValue 1
|
|
14
|
+
*/
|
|
4
15
|
scale: number;
|
|
16
|
+
/**
|
|
17
|
+
* Rotation amplification scale
|
|
18
|
+
* @defaultValue 1
|
|
19
|
+
*/
|
|
5
20
|
rotate: number;
|
|
21
|
+
/**
|
|
22
|
+
* The value of the CSS `perspective` property (px)
|
|
23
|
+
* @defaultValue 1000
|
|
24
|
+
*/
|
|
6
25
|
perspective: number;
|
|
7
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
|
+
*/
|
|
8
31
|
declare class Perspective implements Plugin {
|
|
9
32
|
private _flicking;
|
|
10
33
|
private _selector;
|
|
11
34
|
private _scale;
|
|
12
35
|
private _rotate;
|
|
13
36
|
private _perspective;
|
|
37
|
+
/** Current value of the {@link PerspectiveOptions.selector | selector} option. */
|
|
14
38
|
get selector(): string;
|
|
39
|
+
/** Current value of the {@link PerspectiveOptions.scale | scale} option. */
|
|
15
40
|
get scale(): number;
|
|
41
|
+
/** Current value of the {@link PerspectiveOptions.rotate | rotate} option. */
|
|
16
42
|
get rotate(): number;
|
|
43
|
+
/** Current value of the {@link PerspectiveOptions.perspective | perspective} option. */
|
|
17
44
|
get perspective(): number;
|
|
45
|
+
/** Sets {@link PerspectiveOptions.selector | selector}. */
|
|
18
46
|
set selector(val: string);
|
|
47
|
+
/** Sets {@link PerspectiveOptions.scale | scale}. */
|
|
19
48
|
set scale(val: number);
|
|
49
|
+
/** Sets {@link PerspectiveOptions.rotate | rotate}. */
|
|
20
50
|
set rotate(val: number);
|
|
51
|
+
/** Sets {@link PerspectiveOptions.perspective | perspective}. */
|
|
21
52
|
set perspective(val: number);
|
|
22
|
-
|
|
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
|
+
*/
|
|
23
64
|
init(flicking: Flicking): void;
|
|
65
|
+
/** Destroy the plugin and remove all event listeners. */
|
|
24
66
|
destroy(): void;
|
|
67
|
+
/** Recalculate and apply the perspective effect to all visible panels. */
|
|
25
68
|
update: () => void;
|
|
26
69
|
private _onMove;
|
|
27
70
|
}
|
package/declaration/Sync.d.ts
CHANGED
|
@@ -1,28 +1,83 @@
|
|
|
1
|
-
import Flicking from "@egjs/flicking";
|
|
2
1
|
import type { Plugin } from "@egjs/flicking";
|
|
2
|
+
import Flicking from "@egjs/flicking";
|
|
3
3
|
import { SYNC } from "./const";
|
|
4
|
+
/**
|
|
5
|
+
* Options for the {@link Sync} plugin
|
|
6
|
+
*/
|
|
4
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
|
+
*/
|
|
5
12
|
type: typeof SYNC.TYPE.CAMERA | typeof SYNC.TYPE.INDEX;
|
|
13
|
+
/**
|
|
14
|
+
* Detailed options for each Flicking instance to synchronize
|
|
15
|
+
* @defaultValue []
|
|
16
|
+
*/
|
|
6
17
|
synchronizedFlickingOptions: SychronizableFlickingOptions[];
|
|
7
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Per-instance synchronization options used in {@link SyncOptions.synchronizedFlickingOptions}
|
|
21
|
+
*/
|
|
8
22
|
export interface SychronizableFlickingOptions {
|
|
23
|
+
/**
|
|
24
|
+
* The Flicking instance to synchronize
|
|
25
|
+
*/
|
|
9
26
|
flicking: Flicking;
|
|
27
|
+
/**
|
|
28
|
+
* Whether clicking this Flicking's panel changes the index of all synced Flickings
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
10
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
|
+
*/
|
|
11
36
|
isSlidable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* CSS class added to the active (selected) panel
|
|
39
|
+
* @defaultValue undefined
|
|
40
|
+
*/
|
|
12
41
|
activeClass?: string;
|
|
13
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
|
+
*/
|
|
14
47
|
declare class Sync implements Plugin {
|
|
15
48
|
private _flicking;
|
|
16
49
|
private _disabledIndex;
|
|
17
50
|
private _type;
|
|
18
51
|
private _synchronizedFlickingOptions;
|
|
52
|
+
/** Current value of the {@link SyncOptions.type | type} option. */
|
|
19
53
|
get type(): SyncOptions["type"];
|
|
54
|
+
/** Current value of the {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions} option. */
|
|
20
55
|
get synchronizedFlickingOptions(): SyncOptions["synchronizedFlickingOptions"];
|
|
56
|
+
/** Sets {@link SyncOptions.type | type}. */
|
|
21
57
|
set type(val: SyncOptions["type"]);
|
|
58
|
+
/** Sets {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions}. */
|
|
22
59
|
set synchronizedFlickingOptions(val: SyncOptions["synchronizedFlickingOptions"]);
|
|
23
|
-
|
|
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
|
+
*/
|
|
24
77
|
init(flicking: Flicking): void;
|
|
78
|
+
/** Destroy the plugin and remove all synchronization event listeners. */
|
|
25
79
|
destroy(): void;
|
|
80
|
+
/** Update the active class state for all synchronized Flicking instances. */
|
|
26
81
|
update(): void;
|
|
27
82
|
private _preventEvent;
|
|
28
83
|
private _addEvents;
|
package/declaration/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import Parallax from "./Parallax";
|
|
2
|
-
import Fade from "./Fade";
|
|
3
|
-
import AutoPlay from "./AutoPlay";
|
|
4
1
|
import Arrow from "./Arrow";
|
|
5
|
-
import
|
|
2
|
+
import AutoPlay from "./AutoPlay";
|
|
3
|
+
import Fade from "./Fade";
|
|
4
|
+
import Parallax from "./Parallax";
|
|
6
5
|
import Perspective from "./Perspective";
|
|
6
|
+
import Sync, { SychronizableFlickingOptions, SyncOptions } from "./Sync";
|
|
7
7
|
export * from "./pagination";
|
|
8
8
|
export { Parallax, Fade, AutoPlay, Arrow, Sync, Perspective };
|
|
9
9
|
export type { SyncOptions, SychronizableFlickingOptions };
|
|
10
|
+
export type { ArrowOptions } from "./Arrow";
|
|
11
|
+
export type { AutoPlayOptions } from "./AutoPlay";
|
|
10
12
|
export * from "./const";
|
|
13
|
+
export type { PerspectiveOptions } from "./Perspective";
|