@egjs/flicking 4.15.0 → 4.16.0-beta.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 +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,324 @@
|
|
|
1
|
+
import { ORDER } from "../constants/values";
|
|
2
|
+
import AnchorPoint from "../core/AnchorPoint";
|
|
3
|
+
import Panel from "../core/panel/Panel";
|
|
4
|
+
import Flicking, { FlickingOptions } from "../Flicking";
|
|
5
|
+
import { ValueOf } from "../types/internal";
|
|
6
|
+
import { CameraMode } from "./mode";
|
|
7
|
+
export interface CameraOptions {
|
|
8
|
+
align: FlickingOptions["align"];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A range with minimum and maximum values
|
|
12
|
+
*/
|
|
13
|
+
export interface CameraRange {
|
|
14
|
+
/** A minimum position */
|
|
15
|
+
min: number;
|
|
16
|
+
/** A maximum position */
|
|
17
|
+
max: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A component that manages actual movement inside the viewport
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
declare class Camera {
|
|
24
|
+
private _align;
|
|
25
|
+
private _flicking;
|
|
26
|
+
private _mode;
|
|
27
|
+
private _el;
|
|
28
|
+
private _transform;
|
|
29
|
+
private _lookedOffset;
|
|
30
|
+
private _position;
|
|
31
|
+
private _alignPos;
|
|
32
|
+
private _offset;
|
|
33
|
+
private _circularOffset;
|
|
34
|
+
private _circularEnabled;
|
|
35
|
+
private _range;
|
|
36
|
+
private _visiblePanels;
|
|
37
|
+
private _anchors;
|
|
38
|
+
private _needPanelTriggered;
|
|
39
|
+
private _panelOrder;
|
|
40
|
+
/**
|
|
41
|
+
* The camera element(`.flicking-camera`)
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
get element(): HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* An array of the child elements of the camera element(`.flicking-camera`)
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
49
|
+
get children(): HTMLElement[];
|
|
50
|
+
/**
|
|
51
|
+
* Current position of the camera
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
54
|
+
get position(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Align position inside the viewport where {@link Panel}'s {@link Panel.alignPosition | alignPosition} should be located at
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
get alignPosition(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Position offset, used for the {@link Flicking.renderOnlyVisible | renderOnlyVisible} option
|
|
62
|
+
* @defaultValue 0
|
|
63
|
+
* @readonly
|
|
64
|
+
*/
|
|
65
|
+
get offset(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the `circular` option is enabled.
|
|
68
|
+
* @remarks
|
|
69
|
+
* The {@link Flicking.circular | circular} option can't be enabled when sum of the panel sizes are too small.
|
|
70
|
+
* @defaultValue false
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
get circularEnabled(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* A current camera mode
|
|
76
|
+
* @readonly
|
|
77
|
+
*/
|
|
78
|
+
get mode(): CameraMode;
|
|
79
|
+
/**
|
|
80
|
+
* A range that Camera's {@link Camera.position | position} can reach
|
|
81
|
+
* @readonly
|
|
82
|
+
*/
|
|
83
|
+
get range(): CameraRange;
|
|
84
|
+
/**
|
|
85
|
+
* A difference between Camera's minimum and maximum position that can reach
|
|
86
|
+
* @readonly
|
|
87
|
+
*/
|
|
88
|
+
get rangeDiff(): number;
|
|
89
|
+
/**
|
|
90
|
+
* An array of visible panels from the current position
|
|
91
|
+
* @readonly
|
|
92
|
+
*/
|
|
93
|
+
get visiblePanels(): Panel[];
|
|
94
|
+
/**
|
|
95
|
+
* A range of the visible area from the current position
|
|
96
|
+
* @readonly
|
|
97
|
+
*/
|
|
98
|
+
get visibleRange(): CameraRange;
|
|
99
|
+
/**
|
|
100
|
+
* An array of {@link AnchorPoint}s that Camera can be stopped at
|
|
101
|
+
* @readonly
|
|
102
|
+
*/
|
|
103
|
+
get anchorPoints(): AnchorPoint[];
|
|
104
|
+
/**
|
|
105
|
+
* A current parameters of the Camera for updating {@link AxesController}
|
|
106
|
+
* @readonly
|
|
107
|
+
*/
|
|
108
|
+
get controlParams(): {
|
|
109
|
+
range: CameraRange;
|
|
110
|
+
position: number;
|
|
111
|
+
circular: boolean;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* A Boolean value indicating whether Camera's over the minimum or maximum position reachable
|
|
115
|
+
* @readonly
|
|
116
|
+
*/
|
|
117
|
+
get atEdge(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Return the size of the viewport
|
|
120
|
+
* @readonly
|
|
121
|
+
*/
|
|
122
|
+
get size(): number;
|
|
123
|
+
/**
|
|
124
|
+
* Return the camera's position progress from the first panel to last panel
|
|
125
|
+
* @remarks
|
|
126
|
+
* Range is from 0 to last panel's index
|
|
127
|
+
* @readonly
|
|
128
|
+
*/
|
|
129
|
+
get progress(): number;
|
|
130
|
+
/**
|
|
131
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction | direction} CSS property applied to the camera element(`.flicking-camera`)
|
|
132
|
+
* @readonly
|
|
133
|
+
*/
|
|
134
|
+
get panelOrder(): ValueOf<typeof ORDER>;
|
|
135
|
+
/**
|
|
136
|
+
* A value indicating where the {@link Camera.alignPosition | alignPosition} should be located at inside the viewport element
|
|
137
|
+
*/
|
|
138
|
+
get align(): FlickingOptions["align"];
|
|
139
|
+
set align(val: FlickingOptions["align"]);
|
|
140
|
+
/**
|
|
141
|
+
* Creates a new Camera instance
|
|
142
|
+
* @param flicking - An instance of {@link Flicking}
|
|
143
|
+
* @param options - Options for the Camera
|
|
144
|
+
*/
|
|
145
|
+
constructor(flicking: Flicking, { align }?: Partial<CameraOptions>);
|
|
146
|
+
/**
|
|
147
|
+
* Initialize Camera
|
|
148
|
+
* @remarks
|
|
149
|
+
* This method is called automatically during {@link Flicking.init}. It finds the camera element inside the viewport.
|
|
150
|
+
* @throws {@link InitializationErrors}
|
|
151
|
+
* @returns The current instance for method chaining
|
|
152
|
+
*/
|
|
153
|
+
init(): this;
|
|
154
|
+
/**
|
|
155
|
+
* Destroy Camera and return to initial state
|
|
156
|
+
* @remarks
|
|
157
|
+
* This method resets all internal values to their initial state.
|
|
158
|
+
* @returns The current instance for method chaining
|
|
159
|
+
*/
|
|
160
|
+
destroy(): this;
|
|
161
|
+
/**
|
|
162
|
+
* Move to the given position and apply CSS transform
|
|
163
|
+
* @remarks
|
|
164
|
+
* This method updates the camera position, toggles panels for circular mode, and refreshes visible panels.
|
|
165
|
+
* @param pos - A new position
|
|
166
|
+
* @throws {@link InitializationErrors}
|
|
167
|
+
*/
|
|
168
|
+
lookAt(pos: number): void;
|
|
169
|
+
/**
|
|
170
|
+
* Return a previous {@link AnchorPoint} of given {@link AnchorPoint}
|
|
171
|
+
* @remarks
|
|
172
|
+
* If it does not exist, return `null` instead
|
|
173
|
+
* @param anchor - A reference {@link AnchorPoint}
|
|
174
|
+
* @returns The previous {@link AnchorPoint}
|
|
175
|
+
*/
|
|
176
|
+
getPrevAnchor(anchor: AnchorPoint): AnchorPoint | null;
|
|
177
|
+
/**
|
|
178
|
+
* Return a next {@link AnchorPoint} of given {@link AnchorPoint}
|
|
179
|
+
* @remarks
|
|
180
|
+
* If it does not exist, return `null` instead
|
|
181
|
+
* @param anchor - A reference {@link AnchorPoint}
|
|
182
|
+
* @returns The next {@link AnchorPoint}
|
|
183
|
+
*/
|
|
184
|
+
getNextAnchor(anchor: AnchorPoint): AnchorPoint | null;
|
|
185
|
+
/**
|
|
186
|
+
* Return the camera's position progress in the panel below
|
|
187
|
+
* @remarks
|
|
188
|
+
* Value is from 0 to 1 when the camera's inside panel.
|
|
189
|
+
* Value can be lower than 0 or bigger than 1 when it's in the margin area
|
|
190
|
+
* @param panel - A panel to check
|
|
191
|
+
* @returns Progress value from 0 to 1 (or outside this range when in margin area)
|
|
192
|
+
*/
|
|
193
|
+
getProgressInPanel(panel: Panel): number;
|
|
194
|
+
/**
|
|
195
|
+
* Return {@link AnchorPoint} that includes given position
|
|
196
|
+
* @remarks
|
|
197
|
+
* If there's no {@link AnchorPoint} that includes the given position, return `null` instead
|
|
198
|
+
* @param position - A position to check
|
|
199
|
+
* @returns The {@link AnchorPoint} that includes the given position
|
|
200
|
+
*/
|
|
201
|
+
findAnchorIncludePosition(position: number): AnchorPoint | null;
|
|
202
|
+
/**
|
|
203
|
+
* Return {@link AnchorPoint} nearest to given position
|
|
204
|
+
* @remarks
|
|
205
|
+
* If there're no {@link AnchorPoint}s, return `null` instead
|
|
206
|
+
* @param position - A position to check
|
|
207
|
+
* @returns The {@link AnchorPoint} nearest to the given position
|
|
208
|
+
*/
|
|
209
|
+
findNearestAnchor(position: number): AnchorPoint | null;
|
|
210
|
+
/**
|
|
211
|
+
* Return {@link AnchorPoint} that matches {@link Flicking.currentPanel}
|
|
212
|
+
* @returns The {@link AnchorPoint} that matches current panel
|
|
213
|
+
*/
|
|
214
|
+
findActiveAnchor(): AnchorPoint | null;
|
|
215
|
+
/**
|
|
216
|
+
* Clamp the given position between camera's range
|
|
217
|
+
* @param position - A position to clamp
|
|
218
|
+
* @returns A clamped position
|
|
219
|
+
*/
|
|
220
|
+
clampToReachablePosition(position: number): number;
|
|
221
|
+
/**
|
|
222
|
+
* Check whether the given panel is inside of the Camera's range
|
|
223
|
+
* @param panel - An instance of {@link Panel} to check
|
|
224
|
+
* @returns Whether the panel's inside Camera's range
|
|
225
|
+
*/
|
|
226
|
+
canReach(panel: Panel): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Check whether the given panel element is visible at the current position
|
|
229
|
+
* @param panel - An instance of {@link Panel} to check
|
|
230
|
+
* @returns Whether the panel element is visible at the current position
|
|
231
|
+
*/
|
|
232
|
+
canSee(panel: Panel): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Update {@link Camera.range | range} of Camera
|
|
235
|
+
* @remarks
|
|
236
|
+
* This method recalculates the camera range based on the current panel positions and circular mode settings.
|
|
237
|
+
* @throws {@link InitializationErrors}
|
|
238
|
+
* @returns The current instance for method chaining
|
|
239
|
+
*/
|
|
240
|
+
updateRange(): this;
|
|
241
|
+
/**
|
|
242
|
+
* Update Camera's {@link Camera.alignPosition | alignPosition}
|
|
243
|
+
* @returns The current instance for method chaining
|
|
244
|
+
*/
|
|
245
|
+
updateAlignPos(): this;
|
|
246
|
+
/**
|
|
247
|
+
* Update Camera's {@link Camera.anchorPoints | anchorPoints}
|
|
248
|
+
* @remarks
|
|
249
|
+
* Anchor points are positions where the camera can stop. This method recalculates them based on the current mode.
|
|
250
|
+
* @throws {@link InitializationErrors}
|
|
251
|
+
* @returns The current instance for method chaining
|
|
252
|
+
*/
|
|
253
|
+
updateAnchors(): this;
|
|
254
|
+
/**
|
|
255
|
+
* Update Viewport's height to visible panel's max height
|
|
256
|
+
* @remarks
|
|
257
|
+
* This method only takes effect when {@link FlickingOptions.horizontal | horizontal} is `true` and {@link FlickingOptions.adaptive | adaptive} is enabled.
|
|
258
|
+
* @throws {@link InitializationErrors}
|
|
259
|
+
*/
|
|
260
|
+
updateAdaptiveHeight(): void;
|
|
261
|
+
/**
|
|
262
|
+
* Update current offset of the camera
|
|
263
|
+
* @returns The current instance for method chaining
|
|
264
|
+
*/
|
|
265
|
+
updateOffset(): this;
|
|
266
|
+
/**
|
|
267
|
+
* Update direction to match the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction | direction} CSS property applied to the camera element
|
|
268
|
+
* @returns The current instance for method chaining
|
|
269
|
+
*/
|
|
270
|
+
updatePanelOrder(): this;
|
|
271
|
+
/**
|
|
272
|
+
* Reset the history of {@link Flicking.event:needPanel | needPanel} events so it can be triggered again
|
|
273
|
+
* @returns The current instance for method chaining
|
|
274
|
+
*/
|
|
275
|
+
resetNeedPanelHistory(): this;
|
|
276
|
+
/**
|
|
277
|
+
* Apply "transform" style with the current position to camera element
|
|
278
|
+
* @returns The current instance for method chaining
|
|
279
|
+
*/
|
|
280
|
+
applyTransform(): this;
|
|
281
|
+
/**
|
|
282
|
+
* @internal
|
|
283
|
+
* @privateRemarks
|
|
284
|
+
* Resets all internal state values to their defaults. Called during construction and destruction.
|
|
285
|
+
*/
|
|
286
|
+
private _resetInternalValues;
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
* @privateRemarks
|
|
290
|
+
* Updates the list of visible panels and triggers {@link VisibleChangeEvent} if panels were added or removed.
|
|
291
|
+
*/
|
|
292
|
+
private _refreshVisiblePanels;
|
|
293
|
+
/**
|
|
294
|
+
* @internal
|
|
295
|
+
* @privateRemarks
|
|
296
|
+
* Checks if the camera is near the edges and triggers {@link NeedPanelEvent} for infinite scrolling implementations.
|
|
297
|
+
*/
|
|
298
|
+
private _checkNeedPanel;
|
|
299
|
+
/**
|
|
300
|
+
* @internal
|
|
301
|
+
* @privateRemarks
|
|
302
|
+
* Checks if the camera has reached the edge of the range and triggers {@link ReachEdgeEvent}.
|
|
303
|
+
*/
|
|
304
|
+
private _checkReachEnd;
|
|
305
|
+
/**
|
|
306
|
+
* @internal
|
|
307
|
+
* @privateRemarks
|
|
308
|
+
* Checks for CSS transform support and stores the vendor-prefixed property name. Throws if transforms are not supported.
|
|
309
|
+
*/
|
|
310
|
+
private _checkTranslateSupport;
|
|
311
|
+
/**
|
|
312
|
+
* @internal
|
|
313
|
+
* @privateRemarks
|
|
314
|
+
* Updates the camera mode based on {@link FlickingOptions.circular | circular} and {@link FlickingOptions.bound | bound} options.
|
|
315
|
+
*/
|
|
316
|
+
private _updateMode;
|
|
317
|
+
/**
|
|
318
|
+
* @internal
|
|
319
|
+
* @privateRemarks
|
|
320
|
+
* Toggles panel positions for circular mode. Returns true if any panel was toggled.
|
|
321
|
+
*/
|
|
322
|
+
private _togglePanels;
|
|
323
|
+
}
|
|
324
|
+
export default Camera;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import AnchorPoint from "../../core/AnchorPoint";
|
|
2
|
+
import { CameraRange } from "../Camera";
|
|
2
3
|
import CameraMode from "./CameraMode";
|
|
3
4
|
declare class BoundCameraMode extends CameraMode {
|
|
4
5
|
checkAvailability(): boolean;
|
|
5
|
-
getRange():
|
|
6
|
-
min: number;
|
|
7
|
-
max: number;
|
|
8
|
-
};
|
|
6
|
+
getRange(): CameraRange;
|
|
9
7
|
getAnchors(): AnchorPoint[];
|
|
10
8
|
findAnchorIncludePosition(position: number): AnchorPoint | null;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
11
12
|
private _findNearestPanel;
|
|
12
13
|
}
|
|
13
14
|
export default BoundCameraMode;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import Flicking from "../../Flicking";
|
|
2
|
-
import Panel from "../../core/panel/Panel";
|
|
3
1
|
import AnchorPoint from "../../core/AnchorPoint";
|
|
2
|
+
import Panel from "../../core/panel/Panel";
|
|
3
|
+
import Flicking from "../../Flicking";
|
|
4
|
+
import { CameraRange } from "../Camera";
|
|
5
|
+
/**
|
|
6
|
+
* A mode of camera
|
|
7
|
+
*/
|
|
4
8
|
declare abstract class CameraMode {
|
|
5
9
|
protected _flicking: Flicking;
|
|
6
10
|
constructor(flicking: Flicking);
|
|
7
11
|
abstract checkAvailability(): boolean;
|
|
8
|
-
abstract getRange():
|
|
9
|
-
min: number;
|
|
10
|
-
max: number;
|
|
11
|
-
};
|
|
12
|
+
abstract getRange(): CameraRange;
|
|
12
13
|
getAnchors(): AnchorPoint[];
|
|
13
14
|
findAnchorIncludePosition(position: number): AnchorPoint | null;
|
|
14
15
|
findNearestAnchor(position: number): AnchorPoint | null;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import Panel from "../../core/panel/Panel";
|
|
2
1
|
import AnchorPoint from "../../core/AnchorPoint";
|
|
2
|
+
import Panel from "../../core/panel/Panel";
|
|
3
|
+
import { CameraRange } from "../Camera";
|
|
3
4
|
import CameraMode from "./CameraMode";
|
|
5
|
+
/**
|
|
6
|
+
* A {@link Camera} mode that connects the last panel and the first panel, enabling continuous loop
|
|
7
|
+
*/
|
|
4
8
|
declare class CircularCameraMode extends CameraMode {
|
|
5
9
|
checkAvailability(): boolean;
|
|
6
|
-
getRange():
|
|
7
|
-
min: number;
|
|
8
|
-
max: number;
|
|
9
|
-
};
|
|
10
|
+
getRange(): CameraRange;
|
|
10
11
|
getAnchors(): AnchorPoint[];
|
|
11
12
|
findNearestAnchor(position: number): AnchorPoint | null;
|
|
12
13
|
findAnchorIncludePosition(position: number): AnchorPoint | null;
|
|
@@ -14,6 +15,9 @@ declare class CircularCameraMode extends CameraMode {
|
|
|
14
15
|
clampToReachablePosition(position: number): number;
|
|
15
16
|
canReach(panel: Panel): boolean;
|
|
16
17
|
canSee(panel: Panel): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
17
21
|
private _calcPanelAreaSum;
|
|
18
22
|
}
|
|
19
23
|
export default CircularCameraMode;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { CameraRange } from "../Camera";
|
|
1
2
|
import CameraMode from "./CameraMode";
|
|
2
3
|
declare class LinearCameraMode extends CameraMode {
|
|
3
4
|
checkAvailability(): boolean;
|
|
4
|
-
getRange():
|
|
5
|
-
min: number;
|
|
6
|
-
max: number;
|
|
7
|
-
};
|
|
5
|
+
getRange(): CameraRange;
|
|
8
6
|
}
|
|
9
7
|
export default LinearCameraMode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FlickingOptions } from "../Flicking";
|
|
2
|
-
declare const _default: (align?: FlickingOptions["align"], horizontal?: boolean, firstPanelSize?: string) => string;
|
|
2
|
+
declare const _default: (align?: FlickingOptions["align"], horizontal?: boolean, firstPanelSize?: string | undefined) => string;
|
|
3
3
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator that makes the method of flicking available in the framework.
|
|
3
|
+
* @internal
|
|
4
|
+
* @example
|
|
5
|
+
* ```js
|
|
6
|
+
* import Flicking, { withFlickingMethods } from "@egjs/flicking";
|
|
7
|
+
*
|
|
8
|
+
* class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>> {
|
|
9
|
+
* @withFlickingMethods
|
|
10
|
+
* private flicking: Flicking;
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare const withFlickingMethods: (prototype: any, flickingName: string) => void;
|
|
15
|
+
export default withFlickingMethods;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All possible @egjs/axes event keys
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
1
5
|
export declare const EVENT: {
|
|
2
6
|
readonly HOLD: "hold";
|
|
3
7
|
readonly CHANGE: "change";
|
|
@@ -5,4 +9,8 @@ export declare const EVENT: {
|
|
|
5
9
|
readonly ANIMATION_END: "animationEnd";
|
|
6
10
|
readonly FINISH: "finish";
|
|
7
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* An Axis key that Flicking uses
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
8
16
|
export declare const POSITION_KEY = "flick";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object with all possible predefined literal string for the {@link Flicking.align | align} option
|
|
3
|
+
*/
|
|
4
|
+
export declare const ALIGN: {
|
|
5
|
+
/** left/top align */
|
|
6
|
+
readonly PREV: "prev";
|
|
7
|
+
/** center align */
|
|
8
|
+
readonly CENTER: "center";
|
|
9
|
+
/** right/bottom align */
|
|
10
|
+
readonly NEXT: "next";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* An object of directions
|
|
14
|
+
*/
|
|
15
|
+
export declare const DIRECTION: {
|
|
16
|
+
/** "left" when {@link Flicking.horizontal | horizontal} is true, and "top" when {@link Flicking.horizontal | horizontal} is false */
|
|
17
|
+
readonly PREV: "PREV";
|
|
18
|
+
/** "right" when {@link Flicking.horizontal | horizontal} is true, and "bottom" when {@link Flicking.horizontal | horizontal} is false */
|
|
19
|
+
readonly NEXT: "NEXT";
|
|
20
|
+
/** This value usually means it's the same position */
|
|
21
|
+
readonly NONE: null;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* An object with all possible {@link Flicking.moveType | moveType}s
|
|
25
|
+
*/
|
|
26
|
+
export declare const MOVE_TYPE: {
|
|
27
|
+
/** Flicking's {@link Flicking.moveType | moveType} that enables {@link SnapControl} as a Flicking's {@link Flicking.control | control} */
|
|
28
|
+
readonly SNAP: "snap";
|
|
29
|
+
/** Flicking's {@link Flicking.moveType | moveType} that enables {@link FreeControl} as a Flicking's {@link Flicking.control | control} */
|
|
30
|
+
readonly FREE_SCROLL: "freeScroll";
|
|
31
|
+
/** Flicking's {@link Flicking.moveType | moveType} that enables {@link StrictControl} as a Flicking's {@link Flicking.control | control} */
|
|
32
|
+
readonly STRICT: "strict";
|
|
33
|
+
};
|
|
34
|
+
export declare const CLASS: {
|
|
35
|
+
VIEWPORT: string;
|
|
36
|
+
CAMERA: string;
|
|
37
|
+
VERTICAL: string;
|
|
38
|
+
HIDDEN: string;
|
|
39
|
+
DEFAULT_VIRTUAL: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* An object with all possible {@link Flicking.circularFallback | circularFallback}s
|
|
43
|
+
*/
|
|
44
|
+
export declare const CIRCULAR_FALLBACK: {
|
|
45
|
+
/** "linear" */
|
|
46
|
+
readonly LINEAR: "linear";
|
|
47
|
+
/** "bound" */
|
|
48
|
+
readonly BOUND: "bound";
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* An object for identifying {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction | direction} CSS property applied to the camera element(`.flicking-camera`)
|
|
52
|
+
*/
|
|
53
|
+
export declare const ORDER: {
|
|
54
|
+
/** "ltr" */
|
|
55
|
+
readonly LTR: "ltr";
|
|
56
|
+
/** "rtl" */
|
|
57
|
+
readonly RTL: "rtl";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* An object that contains the direction that {@link Flicking} is moving
|
|
61
|
+
*/
|
|
62
|
+
export declare const MOVE_DIRECTION: {
|
|
63
|
+
/** horizontal */
|
|
64
|
+
readonly HORIZONTAL: "horizontal";
|
|
65
|
+
/** vertical */
|
|
66
|
+
readonly VERTICAL: "vertical";
|
|
67
|
+
};
|