@egjs/flicking 4.15.0 → 4.16.0-beta.1
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 +6 -175
- package/{declaration → dist}/CrossFlicking.d.ts +7 -2
- package/dist/Flicking.d.ts +1231 -0
- package/dist/camera/Camera.d.ts +324 -0
- package/{declaration → dist}/camera/mode/BoundCameraMode.d.ts +5 -4
- package/{declaration → dist}/camera/mode/CameraMode.d.ts +7 -6
- package/{declaration → dist}/camera/mode/CircularCameraMode.d.ts +9 -5
- package/{declaration → dist}/camera/mode/LinearCameraMode.d.ts +2 -4
- package/{declaration → dist}/cfc/getDefaultCameraTransform.d.ts +1 -1
- package/dist/cfc/withFlickingMethods.d.ts +15 -0
- package/{declaration/const/axes.d.ts → dist/constants/internal.d.ts} +8 -0
- package/dist/constants/values.d.ts +67 -0
- package/dist/control/AxesController.d.ts +186 -0
- package/dist/control/Control.d.ts +185 -0
- package/dist/control/FreeControl.d.ts +44 -0
- package/dist/control/SnapControl.d.ts +54 -0
- package/{declaration → dist}/control/StateMachine.d.ts +3 -0
- package/dist/control/StrictControl.d.ts +60 -0
- package/{declaration → dist}/control/states/AnimatingState.d.ts +12 -0
- package/{declaration → dist}/control/states/DisabledState.d.ts +12 -0
- package/{declaration → dist}/control/states/DraggingState.d.ts +12 -0
- package/{declaration → dist}/control/states/HoldingState.d.ts +12 -0
- package/{declaration → dist}/control/states/IdleState.d.ts +12 -0
- package/dist/control/states/State.d.ts +86 -0
- package/dist/core/AnchorPoint.d.ts +40 -0
- package/{declaration → dist}/core/AutoResizer.d.ts +6 -0
- package/dist/core/Viewport.d.ts +60 -0
- package/dist/core/VirtualManager.d.ts +84 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/panel/Panel.d.ts +298 -0
- package/dist/core/panel/VirtualPanel.d.ts +41 -0
- package/dist/core/panel/index.d.ts +5 -0
- package/{declaration → dist}/core/panel/provider/VanillaElementProvider.d.ts +3 -0
- package/{declaration → dist}/core/panel/provider/VirtualElementProvider.d.ts +3 -0
- package/dist/error/FlickingError.d.ts +25 -0
- package/dist/error/codes.d.ts +79 -0
- package/dist/error/groups.d.ts +94 -0
- package/dist/error/index.d.ts +4 -0
- package/dist/error/types.d.ts +516 -0
- package/dist/event/groups.d.ts +40 -0
- package/dist/event/index.d.ts +3 -0
- package/dist/event/names.d.ts +47 -0
- package/dist/event/types.d.ts +318 -0
- package/dist/flicking.cjs.js +5559 -7791
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +5637 -7699
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +6722 -8893
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +1 -9
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +9661 -14086
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +1 -9
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/reactive/index.d.ts +126 -0
- package/{declaration → dist}/renderer/ExternalRenderer.d.ts +3 -0
- package/dist/renderer/Renderer.d.ts +215 -0
- package/{declaration → dist}/renderer/VanillaRenderer.d.ts +6 -0
- package/{declaration → dist}/renderer/strategy/NormalRenderingStrategy.d.ts +5 -2
- package/{declaration → dist}/renderer/strategy/RenderingStrategy.d.ts +4 -1
- package/dist/types/external.d.ts +58 -0
- package/dist/types/params.d.ts +10 -0
- package/{declaration → dist}/utils.d.ts +7 -7
- package/package.json +35 -162
- package/src/CrossFlicking.ts +68 -96
- package/src/Flicking.ts +1051 -972
- package/src/camera/Camera.ts +217 -206
- package/src/camera/index.ts +2 -6
- package/src/camera/mode/BoundCameraMode.ts +38 -27
- package/src/camera/mode/CameraMode.ts +14 -12
- package/src/camera/mode/CircularCameraMode.ts +24 -16
- package/src/camera/mode/LinearCameraMode.ts +3 -1
- package/src/camera/mode/index.ts +4 -10
- package/src/cfc/getDefaultCameraTransform.ts +9 -11
- package/src/cfc/getRenderingPanels.ts +2 -4
- package/src/cfc/index.ts +4 -9
- package/src/cfc/sync.ts +11 -5
- package/src/cfc/withFlickingMethods.ts +6 -7
- package/src/{const/axes.ts → constants/internal.ts} +1 -0
- package/src/constants/values.ts +78 -0
- package/src/control/AxesController.ts +119 -110
- package/src/control/Control.ts +147 -180
- package/src/control/FreeControl.ts +36 -60
- package/src/control/SnapControl.ts +64 -68
- package/src/control/StateMachine.ts +14 -11
- package/src/control/StrictControl.ts +58 -73
- package/src/control/index.ts +9 -12
- package/src/control/states/AnimatingState.ts +8 -11
- package/src/control/states/DisabledState.ts +0 -5
- package/src/control/states/DraggingState.ts +8 -12
- package/src/control/states/HoldingState.ts +10 -15
- package/src/control/states/IdleState.ts +1 -6
- package/src/control/states/State.ts +46 -85
- package/src/core/AnchorPoint.ts +25 -23
- package/src/core/AutoResizer.ts +6 -15
- package/src/core/ResizeWatcher.ts +17 -16
- package/src/core/Viewport.ts +35 -46
- package/src/core/VirtualManager.ts +48 -36
- package/src/core/index.ts +6 -9
- package/src/core/panel/Panel.ts +190 -185
- package/src/core/panel/VirtualPanel.ts +17 -21
- package/src/core/panel/index.ts +4 -9
- package/src/core/panel/provider/VanillaElementProvider.ts +6 -2
- package/src/core/panel/provider/VirtualElementProvider.ts +6 -2
- package/src/core/panel/provider/index.ts +2 -7
- package/src/{core → error}/FlickingError.ts +5 -7
- package/src/error/codes.ts +164 -0
- package/src/error/groups.ts +124 -0
- package/src/error/index.ts +9 -0
- package/src/error/types.ts +535 -0
- package/src/event/groups.ts +61 -0
- package/src/event/index.ts +8 -0
- package/src/event/names.ts +52 -0
- package/src/event/types.ts +355 -0
- package/src/index.ts +9 -11
- package/src/index.umd.ts +9 -3
- package/src/reactive/index.ts +39 -74
- package/src/renderer/Renderer.ts +170 -115
- package/src/renderer/VanillaRenderer.ts +12 -9
- package/src/renderer/index.ts +4 -9
- package/src/renderer/strategy/NormalRenderingStrategy.ts +26 -22
- package/src/renderer/strategy/RenderingStrategy.ts +2 -1
- package/src/renderer/strategy/VirtualRenderingStrategy.ts +20 -13
- package/src/renderer/strategy/index.ts +4 -9
- package/src/types/external.ts +72 -0
- package/src/{type → types}/internal.ts +2 -5
- package/src/types/params.ts +15 -0
- package/src/utils.ts +37 -32
- package/CONTRIBUTING.md +0 -59
- package/NOTICE +0 -31
- package/core-packages-link.js +0 -75
- package/debug/reactive/index.html +0 -240
- package/declaration/Flicking.d.ts +0 -264
- package/declaration/camera/Camera.d.ts +0 -90
- package/declaration/cfc/withFlickingMethods.d.ts +0 -2
- package/declaration/const/error.d.ts +0 -34
- package/declaration/const/external.d.ts +0 -54
- package/declaration/control/AxesController.d.ts +0 -45
- package/declaration/control/Control.d.ts +0 -45
- package/declaration/control/FreeControl.d.ts +0 -14
- package/declaration/control/SnapControl.d.ts +0 -16
- package/declaration/control/StrictControl.d.ts +0 -20
- package/declaration/control/states/State.d.ts +0 -47
- package/declaration/core/AnchorPoint.d.ts +0 -15
- package/declaration/core/FlickingError.d.ts +0 -5
- package/declaration/core/Viewport.d.ts +0 -25
- package/declaration/core/VirtualManager.d.ts +0 -37
- package/declaration/core/index.d.ts +0 -6
- package/declaration/core/panel/Panel.d.ts +0 -89
- package/declaration/core/panel/VirtualPanel.d.ts +0 -19
- package/declaration/core/panel/index.d.ts +0 -5
- package/declaration/index.d.ts +0 -16
- package/declaration/reactive/index.d.ts +0 -25
- package/declaration/renderer/Renderer.d.ts +0 -60
- package/declaration/type/event.d.ts +0 -88
- package/declaration/type/external.d.ts +0 -31
- package/jsconfig.json +0 -5
- package/jsdoc-to-mdx.json +0 -7
- package/rollup.config.demo.js +0 -24
- package/rollup.config.dev.js +0 -12
- package/rollup.config.js +0 -57
- package/src/const/error.ts +0 -64
- package/src/const/external.ts +0 -138
- package/src/type/event.ts +0 -315
- package/src/type/external.ts +0 -78
- package/tsconfig.declaration.json +0 -17
- package/tsconfig.eslint.json +0 -10
- package/tsconfig.json +0 -23
- package/{declaration → dist}/camera/index.d.ts +0 -0
- package/{declaration → dist}/camera/mode/index.d.ts +2 -2
- package/{declaration → dist}/cfc/getRenderingPanels.d.ts +0 -0
- package/{declaration → dist}/cfc/index.d.ts +3 -3
- package/{declaration → dist}/cfc/sync.d.ts +0 -0
- package/{declaration → dist}/control/index.d.ts +7 -7
- package/{declaration → dist}/core/ResizeWatcher.d.ts +0 -0
- package/{declaration → dist}/core/panel/provider/ElementProvider.d.ts +0 -0
- package/{declaration → dist}/core/panel/provider/index.d.ts +0 -0
- package/{declaration → dist}/index.cjs.d.ts +0 -0
- package/{declaration → dist}/index.umd.d.ts +0 -0
- package/{declaration → dist}/renderer/index.d.ts +1 -1
- package/{declaration → dist}/renderer/strategy/VirtualRenderingStrategy.d.ts +1 -1
- package/{declaration → dist}/renderer/strategy/index.d.ts +1 -1
- /package/{declaration/type → dist/types}/internal.d.ts +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event groups for documentation purposes.
|
|
3
|
+
* These interfaces are not used at runtime but serve as centralized documentation
|
|
4
|
+
* for events fired by related methods.
|
|
5
|
+
*/
|
|
6
|
+
import type { AfterResizeEvent, BeforeResizeEvent, ChangedEvent, MoveEndEvent, MoveEvent, MoveStartEvent, NeedPanelEvent, ReachEdgeEvent, RestoredEvent, VisibleChangeEvent, WillChangeEvent, WillRestoreEvent } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* Events fired during panel movement operations (prev, next, moveTo).
|
|
9
|
+
*/
|
|
10
|
+
export interface MovementEvents {
|
|
11
|
+
/** see {@link WillChangeEvent} */
|
|
12
|
+
willChange: WillChangeEvent;
|
|
13
|
+
/** see {@link ChangedEvent} */
|
|
14
|
+
changed: ChangedEvent;
|
|
15
|
+
/** see {@link WillRestoreEvent} */
|
|
16
|
+
willRestore: WillRestoreEvent;
|
|
17
|
+
/** see {@link RestoredEvent} */
|
|
18
|
+
restored: RestoredEvent;
|
|
19
|
+
/** see {@link MoveStartEvent} */
|
|
20
|
+
moveStart: MoveStartEvent;
|
|
21
|
+
/** see {@link MoveEvent} */
|
|
22
|
+
move: MoveEvent;
|
|
23
|
+
/** see {@link MoveEndEvent} */
|
|
24
|
+
moveEnd: MoveEndEvent;
|
|
25
|
+
/** see {@link NeedPanelEvent} */
|
|
26
|
+
needPanel: NeedPanelEvent;
|
|
27
|
+
/** see {@link VisibleChangeEvent} */
|
|
28
|
+
visibleChange: VisibleChangeEvent;
|
|
29
|
+
/** see {@link ReachEdgeEvent} */
|
|
30
|
+
reachEdge: ReachEdgeEvent;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Events fired during resize operations.
|
|
34
|
+
*/
|
|
35
|
+
export interface ResizeEvents {
|
|
36
|
+
/** see {@link BeforeResizeEvent} */
|
|
37
|
+
beforeResize: BeforeResizeEvent;
|
|
38
|
+
/** see {@link AfterResizeEvent} */
|
|
39
|
+
afterResize: AfterResizeEvent;
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event type object with event name strings of {@link Flicking}
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { EVENTS } from "@egjs/flicking";
|
|
6
|
+
* EVENTS.MOVE_START; // "moveStart"
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export declare const EVENTS: {
|
|
10
|
+
/** ready event */
|
|
11
|
+
readonly READY: "ready";
|
|
12
|
+
/** beforeResize event */
|
|
13
|
+
readonly BEFORE_RESIZE: "beforeResize";
|
|
14
|
+
/** afterResize event */
|
|
15
|
+
readonly AFTER_RESIZE: "afterResize";
|
|
16
|
+
/** holdStart event */
|
|
17
|
+
readonly HOLD_START: "holdStart";
|
|
18
|
+
/** holdEnd event */
|
|
19
|
+
readonly HOLD_END: "holdEnd";
|
|
20
|
+
/** moveStart event */
|
|
21
|
+
readonly MOVE_START: "moveStart";
|
|
22
|
+
/** move event */
|
|
23
|
+
readonly MOVE: "move";
|
|
24
|
+
/** moveEnd event */
|
|
25
|
+
readonly MOVE_END: "moveEnd";
|
|
26
|
+
/** willChange event */
|
|
27
|
+
readonly WILL_CHANGE: "willChange";
|
|
28
|
+
/** changed event */
|
|
29
|
+
readonly CHANGED: "changed";
|
|
30
|
+
/** willRestore event */
|
|
31
|
+
readonly WILL_RESTORE: "willRestore";
|
|
32
|
+
/** restored event */
|
|
33
|
+
readonly RESTORED: "restored";
|
|
34
|
+
/** select event */
|
|
35
|
+
readonly SELECT: "select";
|
|
36
|
+
/** needPanel event */
|
|
37
|
+
readonly NEED_PANEL: "needPanel";
|
|
38
|
+
/** visibleChange event */
|
|
39
|
+
readonly VISIBLE_CHANGE: "visibleChange";
|
|
40
|
+
/** reachEdge event */
|
|
41
|
+
readonly REACH_EDGE: "reachEdge";
|
|
42
|
+
/**
|
|
43
|
+
* panelChange event
|
|
44
|
+
* @since 4.1.0
|
|
45
|
+
*/
|
|
46
|
+
readonly PANEL_CHANGE: "panelChange";
|
|
47
|
+
};
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { OnChange, OnFinish, OnHold, OnRelease } from "@egjs/axes";
|
|
2
|
+
import { ComponentEvent } from "@egjs/component";
|
|
3
|
+
import { DIRECTION } from "../constants/values";
|
|
4
|
+
import Panel from "../core/panel/Panel";
|
|
5
|
+
import Flicking from "../Flicking";
|
|
6
|
+
import { ValueOf } from "../types/internal";
|
|
7
|
+
import { EVENTS } from "./names";
|
|
8
|
+
/**
|
|
9
|
+
* Events of the Flicking component.
|
|
10
|
+
* @privateRemarks
|
|
11
|
+
* This interface is crucial as it maps event names to their actual event interfaces.
|
|
12
|
+
* It is also functionally important because it is registered as the event generic parameter of Component, which is Flicking's parent class.
|
|
13
|
+
*/
|
|
14
|
+
export interface FlickingEvents {
|
|
15
|
+
/**
|
|
16
|
+
* Event that fires when Flicking's {@link Flicking.init | init()} is called.
|
|
17
|
+
* @remarks
|
|
18
|
+
* See {@link ReadyEvent} for more details.
|
|
19
|
+
*/
|
|
20
|
+
[EVENTS.READY]: ReadyEvent;
|
|
21
|
+
/**
|
|
22
|
+
* Event that fires when Flicking's {@link Flicking.resize} is called, before updating the sizes of panels and viewport.
|
|
23
|
+
* @remarks
|
|
24
|
+
* See {@link BeforeResizeEvent} for more details.
|
|
25
|
+
*/
|
|
26
|
+
[EVENTS.BEFORE_RESIZE]: BeforeResizeEvent;
|
|
27
|
+
/**
|
|
28
|
+
* Event that fires when Flicking's {@link Flicking.resize} is called, after updating the sizes of panels and viewport.
|
|
29
|
+
* @remarks
|
|
30
|
+
* See {@link AfterResizeEvent} for more details.
|
|
31
|
+
*/
|
|
32
|
+
[EVENTS.AFTER_RESIZE]: AfterResizeEvent;
|
|
33
|
+
/**
|
|
34
|
+
* Event that fires when user started dragging.
|
|
35
|
+
* @remarks
|
|
36
|
+
* See {@link HoldStartEvent} for more details.
|
|
37
|
+
*/
|
|
38
|
+
[EVENTS.HOLD_START]: HoldStartEvent;
|
|
39
|
+
/**
|
|
40
|
+
* Event that fires when user stopped dragging.
|
|
41
|
+
* @remarks
|
|
42
|
+
* See {@link HoldEndEvent} for more details.
|
|
43
|
+
*/
|
|
44
|
+
[EVENTS.HOLD_END]: HoldEndEvent;
|
|
45
|
+
/**
|
|
46
|
+
* Event that fires once before first {@link Flicking.event:move | move} event.
|
|
47
|
+
* @remarks
|
|
48
|
+
* See {@link MoveStartEvent} for more details.
|
|
49
|
+
*/
|
|
50
|
+
[EVENTS.MOVE_START]: MoveStartEvent;
|
|
51
|
+
/**
|
|
52
|
+
* Event that fires for every movement.
|
|
53
|
+
* @remarks
|
|
54
|
+
* See {@link MoveEvent} for more details.
|
|
55
|
+
*/
|
|
56
|
+
[EVENTS.MOVE]: MoveEvent;
|
|
57
|
+
/**
|
|
58
|
+
* Event that fires when the movement is finished by user input release or animation end.
|
|
59
|
+
* @remarks
|
|
60
|
+
* See {@link MoveEndEvent} for more details.
|
|
61
|
+
*/
|
|
62
|
+
[EVENTS.MOVE_END]: MoveEndEvent;
|
|
63
|
+
/**
|
|
64
|
+
* Event that fires BEFORE the active panel changes.
|
|
65
|
+
* @remarks
|
|
66
|
+
* See {@link WillChangeEvent} for more details.
|
|
67
|
+
*/
|
|
68
|
+
[EVENTS.WILL_CHANGE]: WillChangeEvent;
|
|
69
|
+
/**
|
|
70
|
+
* Event that fires AFTER the active panel change completes.
|
|
71
|
+
* @remarks
|
|
72
|
+
* See {@link ChangedEvent} for more details.
|
|
73
|
+
*/
|
|
74
|
+
[EVENTS.CHANGED]: ChangedEvent;
|
|
75
|
+
/**
|
|
76
|
+
* Event fires BEFORE returning to the current panel when drag doesn't reach threshold.
|
|
77
|
+
* @remarks
|
|
78
|
+
* See {@link WillRestoreEvent} for more details.
|
|
79
|
+
*/
|
|
80
|
+
[EVENTS.WILL_RESTORE]: WillRestoreEvent;
|
|
81
|
+
/**
|
|
82
|
+
* Event that fires AFTER Flicking has returned to {@link Flicking.currentPanel | currentPanel}.
|
|
83
|
+
* @remarks
|
|
84
|
+
* See {@link RestoredEvent} for more details.
|
|
85
|
+
*/
|
|
86
|
+
[EVENTS.RESTORED]: RestoredEvent;
|
|
87
|
+
/**
|
|
88
|
+
* Event that fires when panel is statically click / touched.
|
|
89
|
+
* @remarks
|
|
90
|
+
* See {@link SelectEvent} for more details.
|
|
91
|
+
*/
|
|
92
|
+
[EVENTS.SELECT]: SelectEvent;
|
|
93
|
+
/**
|
|
94
|
+
* Event that fires when an empty panel area is visible at the edge of viewport.
|
|
95
|
+
* @remarks
|
|
96
|
+
* See {@link NeedPanelEvent} for more details.
|
|
97
|
+
*/
|
|
98
|
+
[EVENTS.NEED_PANEL]: NeedPanelEvent;
|
|
99
|
+
/**
|
|
100
|
+
* Event that fires when visible panel inside the viewport changes.
|
|
101
|
+
* @remarks
|
|
102
|
+
* See {@link VisibleChangeEvent} for more details.
|
|
103
|
+
*/
|
|
104
|
+
[EVENTS.VISIBLE_CHANGE]: VisibleChangeEvent;
|
|
105
|
+
/**
|
|
106
|
+
* Event that fires when camera reaches the maximum/minimum range.
|
|
107
|
+
* @remarks
|
|
108
|
+
* See {@link ReachEdgeEvent} for more details.
|
|
109
|
+
*/
|
|
110
|
+
[EVENTS.REACH_EDGE]: ReachEdgeEvent;
|
|
111
|
+
/**
|
|
112
|
+
* Event that fires when a panel is added or removed.
|
|
113
|
+
* @since 4.1.0
|
|
114
|
+
* @remarks
|
|
115
|
+
* See {@link PanelChangeEvent} for more details.
|
|
116
|
+
*/
|
|
117
|
+
[EVENTS.PANEL_CHANGE]: PanelChangeEvent;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Event that fires when Flicking's {@link Flicking.init | init()} is called
|
|
121
|
+
*/
|
|
122
|
+
export declare type ReadyEvent<T extends Flicking = Flicking> = ComponentEvent<{}, (typeof EVENTS)["READY"], T>;
|
|
123
|
+
/**
|
|
124
|
+
* Event that fires when Flicking's {@link Flicking.resize} is called, before updating the sizes of panels and viewport.
|
|
125
|
+
* @remarks
|
|
126
|
+
* You can update the sizes of panels and viewport with this event, and it'll be applied after {@link Flicking.resize} is finished.
|
|
127
|
+
*/
|
|
128
|
+
export interface BeforeResizeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["BEFORE_RESIZE"], T> {
|
|
129
|
+
/** Previous width of the viewport */
|
|
130
|
+
width: number;
|
|
131
|
+
/** Previous height of the viewport */
|
|
132
|
+
height: number;
|
|
133
|
+
/** The viewport element */
|
|
134
|
+
element: HTMLElement;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Event that fires when Flicking's {@link Flicking.resize} is called, after updating the sizes of panels and viewport.
|
|
138
|
+
*/
|
|
139
|
+
export interface AfterResizeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["AFTER_RESIZE"], T> {
|
|
140
|
+
/** New width of the viewport */
|
|
141
|
+
width: number;
|
|
142
|
+
/** New height of the viewport */
|
|
143
|
+
height: number;
|
|
144
|
+
/** Previous size of the viewport */
|
|
145
|
+
prev: {
|
|
146
|
+
/** Previous width of the viewport */
|
|
147
|
+
width: number;
|
|
148
|
+
/** Previous height of the viewport */
|
|
149
|
+
height: number;
|
|
150
|
+
};
|
|
151
|
+
/** A Boolean value indicating whether the width/height of the viewport element is changed */
|
|
152
|
+
sizeChanged: boolean;
|
|
153
|
+
/** The viewport element */
|
|
154
|
+
element: HTMLElement;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Event that fires when user started dragging.
|
|
158
|
+
*/
|
|
159
|
+
export interface HoldStartEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["HOLD_START"], T> {
|
|
160
|
+
/** {@link https://naver.github.io/egjs-axes/docs/api/Axes#event-hold | hold} event of {@link https://naver.github.io/egjs-axes/ | Axes} */
|
|
161
|
+
axesEvent: OnHold;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Event that fires when user stopped dragging.
|
|
165
|
+
*/
|
|
166
|
+
export interface HoldEndEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["HOLD_END"], T> {
|
|
167
|
+
/** {@link https://naver.github.io/egjs-axes/docs/api/Axes#event-release | release} event of {@link https://naver.github.io/egjs-axes/ | Axes} */
|
|
168
|
+
axesEvent: OnRelease;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Event that fires once before first {@link Flicking.event:move | move} event
|
|
172
|
+
*/
|
|
173
|
+
export interface MoveStartEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["MOVE_START"], T> {
|
|
174
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
175
|
+
isTrusted: boolean;
|
|
176
|
+
/** Boolean that indicates whether the user is dragging the viewport element */
|
|
177
|
+
holding: boolean;
|
|
178
|
+
/** Moving direction relative to previous position of the camera */
|
|
179
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
180
|
+
/** {@link https://naver.github.io/egjs-axes/docs/api/Axes#event-change | change} event of {@link https://naver.github.io/egjs-axes/ | Axes} */
|
|
181
|
+
axesEvent: OnChange;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Event that fires for every movement
|
|
185
|
+
*/
|
|
186
|
+
export interface MoveEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["MOVE"], T> {
|
|
187
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
188
|
+
isTrusted: boolean;
|
|
189
|
+
/** Boolean that indicates whether the user is dragging the viewport element */
|
|
190
|
+
holding: boolean;
|
|
191
|
+
/** Moving direction relative to previous position of the camera */
|
|
192
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
193
|
+
/** {@link https://naver.github.io/egjs-axes/docs/api/Axes#event-change | change} event of {@link https://naver.github.io/egjs-axes/ | Axes} */
|
|
194
|
+
axesEvent: OnChange;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Event that fires when the movement is finished by user input release or animation end.
|
|
198
|
+
*/
|
|
199
|
+
export interface MoveEndEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["MOVE_END"], T> {
|
|
200
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
201
|
+
isTrusted: boolean;
|
|
202
|
+
/** Moving direction relative to previous position of the camera */
|
|
203
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
204
|
+
/** {@link https://naver.github.io/egjs-axes/docs/api/Axes#event-finish | finish} event of {@link https://naver.github.io/egjs-axes/ | Axes} */
|
|
205
|
+
axesEvent: OnFinish;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Event that fires BEFORE the active panel changes.
|
|
209
|
+
* @remarks
|
|
210
|
+
* Index will be changed at the {@link ChangedEvent | changed} event.
|
|
211
|
+
* It can be triggered when user finished input, or flicking start to move by method.
|
|
212
|
+
* Calling `stop()` in event will prevent index change and camera movement.
|
|
213
|
+
* @see {@link ChangedEvent} - Fired AFTER the panel change completes
|
|
214
|
+
*/
|
|
215
|
+
export interface WillChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["WILL_CHANGE"], T> {
|
|
216
|
+
/** New active index */
|
|
217
|
+
index: number;
|
|
218
|
+
/** New active panel */
|
|
219
|
+
panel: Panel;
|
|
220
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
221
|
+
isTrusted: boolean;
|
|
222
|
+
/** Moving direction from the active panel to the target panel */
|
|
223
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Event that fires AFTER the active panel change completes.
|
|
227
|
+
* @remarks
|
|
228
|
+
* This event fires after the panel movement animation finishes and the index is updated.
|
|
229
|
+
* @see {@link WillChangeEvent} - Fired BEFORE the panel change starts
|
|
230
|
+
*/
|
|
231
|
+
export interface ChangedEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["CHANGED"], T> {
|
|
232
|
+
/** New index */
|
|
233
|
+
index: number;
|
|
234
|
+
/** New active panel */
|
|
235
|
+
panel: Panel;
|
|
236
|
+
/** Previous index */
|
|
237
|
+
prevIndex: number;
|
|
238
|
+
/** Previous active panel */
|
|
239
|
+
prevPanel: Panel | null;
|
|
240
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
241
|
+
isTrusted: boolean;
|
|
242
|
+
/** Moving direction from the active panel to the target panel */
|
|
243
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Event fires BEFORE returning to the current panel when drag doesn't reach threshold.
|
|
247
|
+
* @remarks
|
|
248
|
+
* Fired when user drag amount does not reach {@link Flicking.threshold | threshold} and the camera starts returning to {@link Flicking.currentPanel | currentPanel}.
|
|
249
|
+
* @see {@link RestoredEvent} - Fired AFTER restoration completes
|
|
250
|
+
*/
|
|
251
|
+
export interface WillRestoreEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["WILL_RESTORE"], T> {
|
|
252
|
+
/** Index of the panel to restore */
|
|
253
|
+
index: number;
|
|
254
|
+
/** Panel to restore */
|
|
255
|
+
panel: Panel;
|
|
256
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
257
|
+
isTrusted: boolean;
|
|
258
|
+
/** Moving direction relative to previous position of the camera */
|
|
259
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Event that fires AFTER Flicking has returned to {@link Flicking.currentPanel | currentPanel}.
|
|
263
|
+
* @remarks
|
|
264
|
+
* Fired after the restoration animation completes and the camera has returned to the current panel.
|
|
265
|
+
* @see {@link WillRestoreEvent} - Fired BEFORE restoration starts
|
|
266
|
+
*/
|
|
267
|
+
export interface RestoredEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["RESTORED"], T> {
|
|
268
|
+
/** Boolean that indicates whether the event was generated by a user action */
|
|
269
|
+
isTrusted: boolean;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Event that fires when panel is statically click / touched
|
|
273
|
+
*/
|
|
274
|
+
export interface SelectEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["SELECT"], T> {
|
|
275
|
+
/** Selected panel's index */
|
|
276
|
+
index: number;
|
|
277
|
+
/** Selected panel */
|
|
278
|
+
panel: Panel;
|
|
279
|
+
/** Direction from current camera position to the selected panel's position */
|
|
280
|
+
direction: ValueOf<typeof DIRECTION> | null;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Event that fires when an empty panel area is visible at the edge of viewport
|
|
284
|
+
* @remarks
|
|
285
|
+
* You can set its threshold with {@link Flicking.needPanelThreshold | needPanelThreshold}
|
|
286
|
+
*/
|
|
287
|
+
export interface NeedPanelEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["NEED_PANEL"], T> {
|
|
288
|
+
/** Direction where new panel is needed. `DIRECTION.PREV` means panels should be {@link Flicking.prepend | prepend}ed and `DIRECTION.NEXT` means panels should be {@link Flicking.append | append}ed */
|
|
289
|
+
direction: Exclude<ValueOf<typeof DIRECTION>, null>;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Event that fires when visible panel inside the viewport changes
|
|
293
|
+
*/
|
|
294
|
+
export interface VisibleChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["VISIBLE_CHANGE"], T> {
|
|
295
|
+
/** Panels that added from previous visible panels */
|
|
296
|
+
added: Panel[];
|
|
297
|
+
/** Panels that removed from previous visible panels */
|
|
298
|
+
removed: Panel[];
|
|
299
|
+
/** Current visible panels */
|
|
300
|
+
visiblePanels: Panel[];
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Event that fires when camera reaches the maximum/minimum range
|
|
304
|
+
*/
|
|
305
|
+
export interface ReachEdgeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["REACH_EDGE"], T> {
|
|
306
|
+
/** Direction indicates whether the camera's position is at the maximum range({@link DIRECTION | DIRECTION.NEXT}) or minimum range({@link DIRECTION | DIRECTION.PREV}) */
|
|
307
|
+
direction: ValueOf<typeof DIRECTION>;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Event that fires when a panel is added or removed
|
|
311
|
+
* @since 4.1.0
|
|
312
|
+
*/
|
|
313
|
+
export interface PanelChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, (typeof EVENTS)["PANEL_CHANGE"], T> {
|
|
314
|
+
/** An array of new panels added */
|
|
315
|
+
added: Panel[];
|
|
316
|
+
/** An array of panels removed */
|
|
317
|
+
removed: Panel[];
|
|
318
|
+
}
|