@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
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import Axes, { PanInput, OnRelease } from "@egjs/axes";
|
|
2
|
-
import Flicking from "../Flicking";
|
|
3
|
-
import { ControlParams } from "../type/external";
|
|
4
|
-
import StateMachine from "./StateMachine";
|
|
5
|
-
declare class AxesController {
|
|
6
|
-
private _flicking;
|
|
7
|
-
private _axes;
|
|
8
|
-
private _panInput;
|
|
9
|
-
private _stateMachine;
|
|
10
|
-
private _animatingContext;
|
|
11
|
-
private _dragged;
|
|
12
|
-
get axes(): Axes;
|
|
13
|
-
get panInput(): PanInput;
|
|
14
|
-
get stateMachine(): StateMachine;
|
|
15
|
-
get state(): import("./states/State").default;
|
|
16
|
-
get animatingContext(): {
|
|
17
|
-
start: number;
|
|
18
|
-
end: number;
|
|
19
|
-
offset: number;
|
|
20
|
-
};
|
|
21
|
-
get controlParams(): ControlParams;
|
|
22
|
-
get enabled(): boolean;
|
|
23
|
-
get position(): number;
|
|
24
|
-
get range(): number[];
|
|
25
|
-
get bounce(): number[];
|
|
26
|
-
constructor();
|
|
27
|
-
init(flicking: Flicking): this;
|
|
28
|
-
destroy(): void;
|
|
29
|
-
enable(): this;
|
|
30
|
-
disable(): this;
|
|
31
|
-
release(): this;
|
|
32
|
-
updateAnimation(position: number, duration?: number): this;
|
|
33
|
-
stopAnimation(): this;
|
|
34
|
-
update(controlParams: ControlParams): this;
|
|
35
|
-
addPreventClickHandler(): this;
|
|
36
|
-
removePreventClickHandler(): this;
|
|
37
|
-
animateTo(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
38
|
-
getCurrentPosition(): number;
|
|
39
|
-
updateDirection(): void;
|
|
40
|
-
private _resetInternalValues;
|
|
41
|
-
private _onAxesHold;
|
|
42
|
-
private _onAxesChange;
|
|
43
|
-
private _preventClickWhenDragged;
|
|
44
|
-
}
|
|
45
|
-
export default AxesController;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { OnRelease } from "@egjs/axes";
|
|
2
|
-
import Flicking from "../Flicking";
|
|
3
|
-
import Panel from "../core/panel/Panel";
|
|
4
|
-
import AxesController from "../control/AxesController";
|
|
5
|
-
import { DIRECTION } from "../const/external";
|
|
6
|
-
import { ValueOf } from "../type/internal";
|
|
7
|
-
declare abstract class Control {
|
|
8
|
-
protected _flicking: Flicking | null;
|
|
9
|
-
protected _controller: AxesController;
|
|
10
|
-
protected _activePanel: Panel | null;
|
|
11
|
-
protected _nextPanel: Panel | null;
|
|
12
|
-
get controller(): AxesController;
|
|
13
|
-
get activeIndex(): number;
|
|
14
|
-
get activePanel(): Panel;
|
|
15
|
-
get animating(): boolean;
|
|
16
|
-
get holding(): boolean;
|
|
17
|
-
constructor();
|
|
18
|
-
abstract moveToPosition(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
19
|
-
init(flicking: Flicking): this;
|
|
20
|
-
destroy(): void;
|
|
21
|
-
enable(): this;
|
|
22
|
-
disable(): this;
|
|
23
|
-
release(): this;
|
|
24
|
-
updateAnimation(panel: Panel, duration?: number, direction?: ValueOf<typeof DIRECTION>): this;
|
|
25
|
-
stopAnimation(): this;
|
|
26
|
-
updatePosition(progressInPanel: number): void;
|
|
27
|
-
updateInput(): this;
|
|
28
|
-
resetActive(): this;
|
|
29
|
-
moveToPanel(panel: Panel, { duration, direction, axesEvent }: {
|
|
30
|
-
duration: number;
|
|
31
|
-
direction?: ValueOf<typeof DIRECTION>;
|
|
32
|
-
axesEvent?: OnRelease;
|
|
33
|
-
}): Promise<void>;
|
|
34
|
-
setActive(newActivePanel: Panel, prevActivePanel: Panel | null, isTrusted: boolean): void;
|
|
35
|
-
copy(control: Control): void;
|
|
36
|
-
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease, direction?: ValueOf<typeof DIRECTION>): void;
|
|
37
|
-
protected _animateToPosition({ position, duration, newActivePanel, axesEvent }: {
|
|
38
|
-
position: number;
|
|
39
|
-
duration: number;
|
|
40
|
-
newActivePanel: Panel;
|
|
41
|
-
axesEvent?: OnRelease;
|
|
42
|
-
}): Promise<void>;
|
|
43
|
-
private _getPosition;
|
|
44
|
-
}
|
|
45
|
-
export default Control;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OnRelease } from "@egjs/axes";
|
|
2
|
-
import Control from "./Control";
|
|
3
|
-
export interface FreeControlOptions {
|
|
4
|
-
stopAtEdge: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare class FreeControl extends Control {
|
|
7
|
-
private _stopAtEdge;
|
|
8
|
-
get stopAtEdge(): FreeControlOptions["stopAtEdge"];
|
|
9
|
-
set stopAtEdge(val: FreeControlOptions["stopAtEdge"]);
|
|
10
|
-
constructor({ stopAtEdge }?: Partial<FreeControlOptions>);
|
|
11
|
-
updatePosition(progressInPanel: number): void;
|
|
12
|
-
moveToPosition(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export default FreeControl;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { OnRelease } from "@egjs/axes";
|
|
2
|
-
import Control from "./Control";
|
|
3
|
-
export interface SnapControlOptions {
|
|
4
|
-
count: number;
|
|
5
|
-
}
|
|
6
|
-
declare class SnapControl extends Control {
|
|
7
|
-
private _count;
|
|
8
|
-
get count(): SnapControlOptions["count"];
|
|
9
|
-
set count(val: SnapControlOptions["count"]);
|
|
10
|
-
constructor({ count }?: Partial<SnapControlOptions>);
|
|
11
|
-
moveToPosition(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
12
|
-
private _findSnappedAnchor;
|
|
13
|
-
private _findAdjacentAnchor;
|
|
14
|
-
private _calcSnapThreshold;
|
|
15
|
-
}
|
|
16
|
-
export default SnapControl;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { OnRelease } from "@egjs/axes";
|
|
2
|
-
import Panel from "../core/panel/Panel";
|
|
3
|
-
import Control from "./Control";
|
|
4
|
-
export interface StrictControlOptions {
|
|
5
|
-
count: number;
|
|
6
|
-
}
|
|
7
|
-
declare class StrictControl extends Control {
|
|
8
|
-
private _count;
|
|
9
|
-
private _indexRange;
|
|
10
|
-
get count(): StrictControlOptions["count"];
|
|
11
|
-
set count(val: StrictControlOptions["count"]);
|
|
12
|
-
constructor({ count }?: Partial<StrictControlOptions>);
|
|
13
|
-
destroy(): void;
|
|
14
|
-
updateInput(): this;
|
|
15
|
-
moveToPanel(panel: Panel, options: Parameters<Control["moveToPanel"]>[1]): Promise<void>;
|
|
16
|
-
moveToPosition(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
17
|
-
setActive: (newActivePanel: Panel, prevActivePanel: Panel | null, isTrusted: boolean) => void;
|
|
18
|
-
private _resetIndexRange;
|
|
19
|
-
}
|
|
20
|
-
export default StrictControl;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { OnAnimationEnd, OnChange, OnFinish, OnHold, OnRelease } from "@egjs/axes";
|
|
2
|
-
import Flicking from "../../Flicking";
|
|
3
|
-
import Panel from "../../core/panel/Panel";
|
|
4
|
-
export declare enum STATE_TYPE {
|
|
5
|
-
IDLE = 0,
|
|
6
|
-
HOLDING = 1,
|
|
7
|
-
DRAGGING = 2,
|
|
8
|
-
ANIMATING = 3,
|
|
9
|
-
DISABLED = 4
|
|
10
|
-
}
|
|
11
|
-
declare abstract class State {
|
|
12
|
-
abstract readonly holding: boolean;
|
|
13
|
-
abstract readonly animating: boolean;
|
|
14
|
-
protected _delta: number;
|
|
15
|
-
protected _targetPanel: Panel | null;
|
|
16
|
-
get delta(): number;
|
|
17
|
-
get targetPanel(): Panel | null;
|
|
18
|
-
set targetPanel(val: Panel | null);
|
|
19
|
-
onEnter(prevState: State): void;
|
|
20
|
-
onHold(ctx: {
|
|
21
|
-
flicking: Flicking;
|
|
22
|
-
axesEvent: OnHold;
|
|
23
|
-
transitTo: (nextState: STATE_TYPE) => State;
|
|
24
|
-
}): void;
|
|
25
|
-
onChange(ctx: {
|
|
26
|
-
flicking: Flicking;
|
|
27
|
-
axesEvent: OnChange;
|
|
28
|
-
transitTo: (nextState: STATE_TYPE) => State;
|
|
29
|
-
}): void;
|
|
30
|
-
onRelease(ctx: {
|
|
31
|
-
flicking: Flicking;
|
|
32
|
-
axesEvent: OnRelease;
|
|
33
|
-
transitTo: (nextState: STATE_TYPE) => State;
|
|
34
|
-
}): void;
|
|
35
|
-
onAnimationEnd(ctx: {
|
|
36
|
-
flicking: Flicking;
|
|
37
|
-
axesEvent: OnAnimationEnd;
|
|
38
|
-
transitTo: (nextState: STATE_TYPE) => State;
|
|
39
|
-
}): void;
|
|
40
|
-
onFinish(ctx: {
|
|
41
|
-
flicking: Flicking;
|
|
42
|
-
axesEvent: OnFinish;
|
|
43
|
-
transitTo: (nextState: STATE_TYPE) => State;
|
|
44
|
-
}): void;
|
|
45
|
-
protected _moveToChangedPosition(ctx: Parameters<State["onChange"]>[0]): void;
|
|
46
|
-
}
|
|
47
|
-
export default State;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Panel from "./panel/Panel";
|
|
2
|
-
declare class AnchorPoint {
|
|
3
|
-
private _index;
|
|
4
|
-
private _pos;
|
|
5
|
-
private _panel;
|
|
6
|
-
get index(): number;
|
|
7
|
-
get position(): number;
|
|
8
|
-
get panel(): Panel;
|
|
9
|
-
constructor({ index, position, panel }: {
|
|
10
|
-
index: number;
|
|
11
|
-
position: number;
|
|
12
|
-
panel: Panel;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export default AnchorPoint;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import Flicking from "../Flicking";
|
|
2
|
-
declare class Viewport {
|
|
3
|
-
private _flicking;
|
|
4
|
-
private _el;
|
|
5
|
-
private _width;
|
|
6
|
-
private _height;
|
|
7
|
-
private _isBorderBoxSizing;
|
|
8
|
-
private _padding;
|
|
9
|
-
get element(): HTMLElement;
|
|
10
|
-
get width(): number;
|
|
11
|
-
get height(): number;
|
|
12
|
-
get padding(): {
|
|
13
|
-
left: number;
|
|
14
|
-
right: number;
|
|
15
|
-
top: number;
|
|
16
|
-
bottom: number;
|
|
17
|
-
};
|
|
18
|
-
constructor(flicking: Flicking, el: HTMLElement);
|
|
19
|
-
setSize({ width, height }: Partial<{
|
|
20
|
-
width: number | string;
|
|
21
|
-
height: number | string;
|
|
22
|
-
}>): void;
|
|
23
|
-
resize(): void;
|
|
24
|
-
}
|
|
25
|
-
export default Viewport;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import Flicking from "../Flicking";
|
|
2
|
-
import VirtualPanel from "./panel/VirtualPanel";
|
|
3
|
-
export interface VirtualOptions {
|
|
4
|
-
renderPanel: (panel: VirtualPanel, index: number) => string;
|
|
5
|
-
initialPanelCount: number;
|
|
6
|
-
cache?: boolean;
|
|
7
|
-
panelClass?: string;
|
|
8
|
-
}
|
|
9
|
-
declare class VirtualManager {
|
|
10
|
-
private _flicking;
|
|
11
|
-
private _renderPanel;
|
|
12
|
-
private _initialPanelCount;
|
|
13
|
-
private _cache;
|
|
14
|
-
private _panelClass;
|
|
15
|
-
private _elements;
|
|
16
|
-
get elements(): {
|
|
17
|
-
nativeElement: HTMLElement;
|
|
18
|
-
visible: boolean;
|
|
19
|
-
}[];
|
|
20
|
-
get renderPanel(): VirtualOptions["renderPanel"];
|
|
21
|
-
get initialPanelCount(): number;
|
|
22
|
-
get cache(): NonNullable<VirtualOptions["cache"]>;
|
|
23
|
-
get panelClass(): NonNullable<VirtualOptions["panelClass"]>;
|
|
24
|
-
set renderPanel(val: VirtualOptions["renderPanel"]);
|
|
25
|
-
set cache(val: NonNullable<VirtualOptions["cache"]>);
|
|
26
|
-
set panelClass(val: NonNullable<VirtualOptions["panelClass"]>);
|
|
27
|
-
constructor(flicking: Flicking, options: VirtualOptions | null);
|
|
28
|
-
init(): void;
|
|
29
|
-
show(index: number): void;
|
|
30
|
-
hide(index: number): void;
|
|
31
|
-
append(count?: number): VirtualPanel[];
|
|
32
|
-
prepend(count?: number): VirtualPanel[];
|
|
33
|
-
insert(index: number, count?: number): VirtualPanel[];
|
|
34
|
-
remove(index: number, count: number): VirtualPanel[];
|
|
35
|
-
private _initVirtualElements;
|
|
36
|
-
}
|
|
37
|
-
export default VirtualManager;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import Flicking from "../../Flicking";
|
|
2
|
-
import { ALIGN, DIRECTION } from "../../const/external";
|
|
3
|
-
import { LiteralUnion, ValueOf } from "../../type/internal";
|
|
4
|
-
import ElementProvider from "./provider/ElementProvider";
|
|
5
|
-
export interface PanelOptions {
|
|
6
|
-
index: number;
|
|
7
|
-
align: LiteralUnion<ValueOf<typeof ALIGN>> | number;
|
|
8
|
-
flicking: Flicking;
|
|
9
|
-
elementProvider: ElementProvider;
|
|
10
|
-
}
|
|
11
|
-
declare class Panel {
|
|
12
|
-
protected _flicking: Flicking;
|
|
13
|
-
protected _elProvider: ElementProvider;
|
|
14
|
-
protected _index: number;
|
|
15
|
-
protected _pos: number;
|
|
16
|
-
protected _size: number;
|
|
17
|
-
protected _height: number;
|
|
18
|
-
protected _margin: {
|
|
19
|
-
prev: number;
|
|
20
|
-
next: number;
|
|
21
|
-
};
|
|
22
|
-
protected _alignPos: number;
|
|
23
|
-
protected _rendered: boolean;
|
|
24
|
-
protected _removed: boolean;
|
|
25
|
-
protected _loading: boolean;
|
|
26
|
-
protected _toggleDirection: ValueOf<typeof DIRECTION>;
|
|
27
|
-
protected _toggled: boolean;
|
|
28
|
-
protected _togglePosition: number;
|
|
29
|
-
protected _align: PanelOptions["align"];
|
|
30
|
-
get element(): HTMLElement;
|
|
31
|
-
get elementProvider(): ElementProvider;
|
|
32
|
-
get index(): number;
|
|
33
|
-
get position(): number;
|
|
34
|
-
get size(): number;
|
|
35
|
-
get sizeIncludingMargin(): number;
|
|
36
|
-
get height(): number;
|
|
37
|
-
get margin(): {
|
|
38
|
-
prev: number;
|
|
39
|
-
next: number;
|
|
40
|
-
};
|
|
41
|
-
get alignPosition(): number;
|
|
42
|
-
get removed(): boolean;
|
|
43
|
-
get rendered(): boolean;
|
|
44
|
-
get loading(): boolean;
|
|
45
|
-
get range(): {
|
|
46
|
-
min: number;
|
|
47
|
-
max: number;
|
|
48
|
-
};
|
|
49
|
-
get toggled(): boolean;
|
|
50
|
-
get toggleDirection(): any;
|
|
51
|
-
get offset(): number;
|
|
52
|
-
get progress(): number;
|
|
53
|
-
get outsetProgress(): number;
|
|
54
|
-
get visibleRatio(): number;
|
|
55
|
-
set loading(val: boolean);
|
|
56
|
-
get align(): PanelOptions["align"];
|
|
57
|
-
set align(val: PanelOptions["align"]);
|
|
58
|
-
constructor({ index, align, flicking, elementProvider }: PanelOptions);
|
|
59
|
-
markForShow(): void;
|
|
60
|
-
markForHide(): void;
|
|
61
|
-
resize(cached?: {
|
|
62
|
-
size: number;
|
|
63
|
-
height?: number;
|
|
64
|
-
margin: {
|
|
65
|
-
prev: number;
|
|
66
|
-
next: number;
|
|
67
|
-
};
|
|
68
|
-
}): this;
|
|
69
|
-
setSize(size: Partial<{
|
|
70
|
-
width: number | string;
|
|
71
|
-
height: number | string;
|
|
72
|
-
}>): this;
|
|
73
|
-
contains(element: HTMLElement): boolean;
|
|
74
|
-
destroy(): void;
|
|
75
|
-
includePosition(pos: number, includeMargin?: boolean): boolean;
|
|
76
|
-
includeRange(min: number, max: number, includeMargin?: boolean): boolean;
|
|
77
|
-
isVisibleOnRange(min: number, max: number): boolean;
|
|
78
|
-
focus(duration?: number): Promise<void>;
|
|
79
|
-
prev(): Panel | null;
|
|
80
|
-
next(): Panel | null;
|
|
81
|
-
increaseIndex(val: number): this;
|
|
82
|
-
decreaseIndex(val: number): this;
|
|
83
|
-
updatePosition(): this;
|
|
84
|
-
toggle(prevPos: number, newPos: number): boolean;
|
|
85
|
-
updateCircularToggleDirection(): this;
|
|
86
|
-
private _updateAlignPos;
|
|
87
|
-
private _resetInternalStates;
|
|
88
|
-
}
|
|
89
|
-
export default Panel;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Panel, { PanelOptions } from "./Panel";
|
|
2
|
-
import VirtualElementProvider from "./provider/VirtualElementProvider";
|
|
3
|
-
interface VirtualPanelOptions extends PanelOptions {
|
|
4
|
-
elementProvider: VirtualElementProvider;
|
|
5
|
-
}
|
|
6
|
-
declare class VirtualPanel extends Panel {
|
|
7
|
-
protected _elProvider: VirtualElementProvider;
|
|
8
|
-
protected _cachedInnerHTML: string | null;
|
|
9
|
-
get element(): HTMLElement;
|
|
10
|
-
get cachedInnerHTML(): string;
|
|
11
|
-
get elementIndex(): number;
|
|
12
|
-
constructor(options: VirtualPanelOptions);
|
|
13
|
-
cacheRenderResult(result: string): void;
|
|
14
|
-
uncacheRenderResult(): void;
|
|
15
|
-
render(): void;
|
|
16
|
-
increaseIndex(val: number): this;
|
|
17
|
-
decreaseIndex(val: number): this;
|
|
18
|
-
}
|
|
19
|
-
export default VirtualPanel;
|
package/declaration/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Flicking from "./Flicking";
|
|
2
|
-
import type { FlickingOptions, FlickingEvents } from "./Flicking";
|
|
3
|
-
import type { CrossFlickingOptions } from "./CrossFlicking";
|
|
4
|
-
export * from "./CrossFlicking";
|
|
5
|
-
export * from "./core";
|
|
6
|
-
export * from "./camera";
|
|
7
|
-
export * from "./control";
|
|
8
|
-
export * from "./renderer";
|
|
9
|
-
export * from "./const/external";
|
|
10
|
-
export * from "./cfc";
|
|
11
|
-
export * from "./utils";
|
|
12
|
-
export * from "./reactive";
|
|
13
|
-
export * from "./type/event";
|
|
14
|
-
export * from "./type/external";
|
|
15
|
-
export type { FlickingOptions, FlickingEvents, CrossFlickingOptions };
|
|
16
|
-
export default Flicking;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactiveObject, ReactiveSetupAdapter } from "@cfcs/core";
|
|
2
|
-
import Flicking from "../Flicking";
|
|
3
|
-
export declare type FlickingReactiveObject = ReactiveObject<FlickingReactiveState & FlickingReactiveMethod>;
|
|
4
|
-
export interface FlickingReactiveState {
|
|
5
|
-
isReachStart: boolean;
|
|
6
|
-
isReachEnd: boolean;
|
|
7
|
-
totalPanelCount: number;
|
|
8
|
-
currentPanelIndex: number;
|
|
9
|
-
progress: number;
|
|
10
|
-
indexProgress: number;
|
|
11
|
-
}
|
|
12
|
-
export interface FlickingReactiveMethod {
|
|
13
|
-
moveTo: (i: number) => Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export interface FlickingReactiveData {
|
|
16
|
-
flicking?: Flicking;
|
|
17
|
-
options?: FlickingReactiveAPIOptions;
|
|
18
|
-
}
|
|
19
|
-
export interface FlickingReactiveAPIOptions {
|
|
20
|
-
defaultIndex?: number;
|
|
21
|
-
totalPanelCount?: number;
|
|
22
|
-
}
|
|
23
|
-
declare const flickingReactiveAPIAdapter: ReactiveSetupAdapter<FlickingReactiveObject, FlickingReactiveState, "moveTo", FlickingReactiveData>;
|
|
24
|
-
declare const connectFlickingReactiveAPI: (flicking: Flicking, options?: FlickingReactiveAPIOptions) => ReactiveObject<FlickingReactiveState & FlickingReactiveMethod>;
|
|
25
|
-
export { flickingReactiveAPIAdapter, connectFlickingReactiveAPI };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import Flicking, { FlickingOptions } from "../Flicking";
|
|
2
|
-
import Panel, { PanelOptions } from "../core/panel/Panel";
|
|
3
|
-
import RenderingStrategy from "./strategy/RenderingStrategy";
|
|
4
|
-
export interface RendererOptions {
|
|
5
|
-
align?: FlickingOptions["align"];
|
|
6
|
-
strategy: RenderingStrategy;
|
|
7
|
-
}
|
|
8
|
-
declare abstract class Renderer {
|
|
9
|
-
protected _flicking: Flicking | null;
|
|
10
|
-
protected _panels: Panel[];
|
|
11
|
-
protected _rendering: boolean;
|
|
12
|
-
protected _align: NonNullable<RendererOptions["align"]>;
|
|
13
|
-
protected _strategy: RendererOptions["strategy"];
|
|
14
|
-
get panels(): Panel[];
|
|
15
|
-
get rendering(): boolean;
|
|
16
|
-
get panelCount(): number;
|
|
17
|
-
get strategy(): RenderingStrategy;
|
|
18
|
-
get align(): NonNullable<RendererOptions["align"]>;
|
|
19
|
-
set align(val: NonNullable<RendererOptions["align"]>);
|
|
20
|
-
constructor({ align, strategy }: RendererOptions);
|
|
21
|
-
abstract render(): Promise<void>;
|
|
22
|
-
protected abstract _collectPanels(): void;
|
|
23
|
-
protected abstract _createPanel(el: any, options: Omit<PanelOptions, "elementProvider">): Panel;
|
|
24
|
-
init(flicking: Flicking): this;
|
|
25
|
-
destroy(): void;
|
|
26
|
-
getPanel(index: number): Panel | null;
|
|
27
|
-
forceRenderAllPanels(): Promise<void>;
|
|
28
|
-
getRenderedPanels(): Panel[];
|
|
29
|
-
updatePanelSize(): this;
|
|
30
|
-
batchInsert(...items: Array<{
|
|
31
|
-
index: number;
|
|
32
|
-
elements: any[];
|
|
33
|
-
hasDOMInElements: boolean;
|
|
34
|
-
}>): Panel[];
|
|
35
|
-
batchInsertDefer(...items: Array<{
|
|
36
|
-
index: number;
|
|
37
|
-
elements: any[];
|
|
38
|
-
hasDOMInElements: boolean;
|
|
39
|
-
}>): any[];
|
|
40
|
-
batchRemove(...items: Array<{
|
|
41
|
-
index: number;
|
|
42
|
-
deleteCount: number;
|
|
43
|
-
hasDOMInElements: boolean;
|
|
44
|
-
}>): Panel[];
|
|
45
|
-
batchRemoveDefer(...items: Array<{
|
|
46
|
-
index: number;
|
|
47
|
-
deleteCount: number;
|
|
48
|
-
hasDOMInElements: boolean;
|
|
49
|
-
}>): any[];
|
|
50
|
-
updateAfterPanelChange(panelsAdded: Panel[], panelsRemoved: Panel[]): void;
|
|
51
|
-
checkPanelContentsReady(checkingPanels: Panel[]): void;
|
|
52
|
-
protected _updateCameraAndControl(): void;
|
|
53
|
-
protected _showOnlyVisiblePanels(flicking: Flicking): void;
|
|
54
|
-
protected _updatePanelSizeByGrid(referencePanel: Panel, panels: Panel[]): void;
|
|
55
|
-
protected _removeAllChildsFromCamera(): void;
|
|
56
|
-
protected _insertPanelElements(panels: Panel[], nextSibling?: Panel | null): void;
|
|
57
|
-
protected _removePanelElements(panels: Panel[]): void;
|
|
58
|
-
protected _afterRender(): void;
|
|
59
|
-
}
|
|
60
|
-
export default Renderer;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { OnChange, OnFinish, OnHold, OnRelease } from "@egjs/axes";
|
|
2
|
-
import { ComponentEvent } from "@egjs/component";
|
|
3
|
-
import Flicking from "../Flicking";
|
|
4
|
-
import Panel from "../core/panel/Panel";
|
|
5
|
-
import { EVENTS, DIRECTION } from "../const/external";
|
|
6
|
-
import { ValueOf } from "../type/internal";
|
|
7
|
-
export declare type ReadyEvent<T extends Flicking = Flicking> = ComponentEvent<{}, typeof EVENTS["READY"], T>;
|
|
8
|
-
export interface BeforeResizeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["BEFORE_RESIZE"], T> {
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
element: HTMLElement;
|
|
12
|
-
}
|
|
13
|
-
export interface AfterResizeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["AFTER_RESIZE"], T> {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
prev: {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
};
|
|
20
|
-
sizeChanged: boolean;
|
|
21
|
-
element: HTMLElement;
|
|
22
|
-
}
|
|
23
|
-
export interface HoldStartEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["HOLD_START"], T> {
|
|
24
|
-
axesEvent: OnHold;
|
|
25
|
-
}
|
|
26
|
-
export interface HoldEndEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["HOLD_END"], T> {
|
|
27
|
-
axesEvent: OnRelease;
|
|
28
|
-
}
|
|
29
|
-
export interface MoveStartEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["MOVE_START"], T> {
|
|
30
|
-
isTrusted: boolean;
|
|
31
|
-
holding: boolean;
|
|
32
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
33
|
-
axesEvent: OnChange;
|
|
34
|
-
}
|
|
35
|
-
export interface MoveEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["MOVE"], T> {
|
|
36
|
-
isTrusted: boolean;
|
|
37
|
-
holding: boolean;
|
|
38
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
39
|
-
axesEvent: OnChange;
|
|
40
|
-
}
|
|
41
|
-
export interface MoveEndEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["MOVE_END"], T> {
|
|
42
|
-
isTrusted: boolean;
|
|
43
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
44
|
-
axesEvent: OnFinish;
|
|
45
|
-
}
|
|
46
|
-
export interface WillChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["WILL_CHANGE"], T> {
|
|
47
|
-
index: number;
|
|
48
|
-
panel: Panel;
|
|
49
|
-
isTrusted: boolean;
|
|
50
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
51
|
-
}
|
|
52
|
-
export interface ChangedEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["CHANGED"], T> {
|
|
53
|
-
index: number;
|
|
54
|
-
panel: Panel;
|
|
55
|
-
prevIndex: number;
|
|
56
|
-
prevPanel: Panel | null;
|
|
57
|
-
isTrusted: boolean;
|
|
58
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
59
|
-
}
|
|
60
|
-
export interface WillRestoreEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["WILL_RESTORE"], T> {
|
|
61
|
-
index: number;
|
|
62
|
-
panel: Panel;
|
|
63
|
-
isTrusted: boolean;
|
|
64
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
65
|
-
}
|
|
66
|
-
export interface RestoredEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["RESTORED"], T> {
|
|
67
|
-
isTrusted: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface SelectEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["SELECT"], T> {
|
|
70
|
-
index: number;
|
|
71
|
-
panel: Panel;
|
|
72
|
-
direction: ValueOf<typeof DIRECTION> | null;
|
|
73
|
-
}
|
|
74
|
-
export interface NeedPanelEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["NEED_PANEL"], T> {
|
|
75
|
-
direction: Exclude<ValueOf<typeof DIRECTION>, null>;
|
|
76
|
-
}
|
|
77
|
-
export interface VisibleChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["VISIBLE_CHANGE"], T> {
|
|
78
|
-
added: Panel[];
|
|
79
|
-
removed: Panel[];
|
|
80
|
-
visiblePanels: Panel[];
|
|
81
|
-
}
|
|
82
|
-
export interface ReachEdgeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["REACH_EDGE"], T> {
|
|
83
|
-
direction: ValueOf<typeof DIRECTION>;
|
|
84
|
-
}
|
|
85
|
-
export interface PanelChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["PANEL_CHANGE"], T> {
|
|
86
|
-
added: Panel[];
|
|
87
|
-
removed: Panel[];
|
|
88
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Flicking from "../Flicking";
|
|
2
|
-
import { SnapControlOptions, FreeControlOptions, StrictControlOptions } from "../control";
|
|
3
|
-
import { MOVE_TYPE } from "../const/external";
|
|
4
|
-
import { ValueOf } from "../type/internal";
|
|
5
|
-
export declare type ElementLike = string | HTMLElement;
|
|
6
|
-
export interface Plugin {
|
|
7
|
-
init(flicking: Flicking): void;
|
|
8
|
-
destroy(): void;
|
|
9
|
-
update(flicking: Flicking): void;
|
|
10
|
-
}
|
|
11
|
-
export interface Status {
|
|
12
|
-
index?: number;
|
|
13
|
-
position?: {
|
|
14
|
-
panel: number;
|
|
15
|
-
progressInPanel: number;
|
|
16
|
-
};
|
|
17
|
-
visibleOffset?: number;
|
|
18
|
-
panels: Array<{
|
|
19
|
-
index: number;
|
|
20
|
-
html?: string;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
export declare type MoveTypeOptions<T extends ValueOf<typeof MOVE_TYPE>> = T extends typeof MOVE_TYPE.SNAP ? [T] | [T, Partial<SnapControlOptions>] : T extends typeof MOVE_TYPE.FREE_SCROLL ? [T] | [T, Partial<FreeControlOptions>] : T extends typeof MOVE_TYPE.STRICT ? [T] | [T, Partial<StrictControlOptions>] : [T];
|
|
24
|
-
export interface ControlParams {
|
|
25
|
-
range: {
|
|
26
|
-
min: number;
|
|
27
|
-
max: number;
|
|
28
|
-
};
|
|
29
|
-
position: number;
|
|
30
|
-
circular: boolean;
|
|
31
|
-
}
|
package/jsconfig.json
DELETED
package/jsdoc-to-mdx.json
DELETED
package/rollup.config.demo.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
3
|
-
import serve from "rollup-plugin-serve";
|
|
4
|
-
import livereload from "rollup-plugin-livereload";
|
|
5
|
-
|
|
6
|
-
const buildHelper = require("./config/build-helper");
|
|
7
|
-
|
|
8
|
-
export default buildHelper([
|
|
9
|
-
{
|
|
10
|
-
name: "Flicking",
|
|
11
|
-
input: "./src/index.umd.ts",
|
|
12
|
-
output: "./demo/release/latest/dist/flicking.pkgd.js",
|
|
13
|
-
format: "umd",
|
|
14
|
-
resolve: true,
|
|
15
|
-
plugins: [
|
|
16
|
-
serve({
|
|
17
|
-
open: true,
|
|
18
|
-
contentBase: "demo"
|
|
19
|
-
}),
|
|
20
|
-
livereload(".")
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
]);
|
|
24
|
-
|