@egjs/flicking 4.11.4-beta.0 → 4.11.5-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/declaration/Flicking.d.ts +242 -240
- package/declaration/camera/Camera.d.ts +89 -89
- package/declaration/camera/index.d.ts +4 -4
- package/declaration/camera/mode/BoundCameraMode.d.ts +13 -13
- package/declaration/camera/mode/CameraMode.d.ts +20 -20
- package/declaration/camera/mode/CircularCameraMode.d.ts +19 -19
- package/declaration/camera/mode/LinearCameraMode.d.ts +9 -9
- package/declaration/camera/mode/index.d.ts +6 -6
- package/declaration/cfc/getDefaultCameraTransform.d.ts +3 -3
- package/declaration/cfc/getRenderingPanels.d.ts +4 -4
- package/declaration/cfc/index.d.ts +5 -5
- package/declaration/cfc/sync.d.ts +4 -4
- package/declaration/cfc/withFlickingMethods.d.ts +2 -2
- package/declaration/const/axes.d.ts +8 -8
- package/declaration/const/error.d.ts +34 -34
- package/declaration/const/external.d.ts +48 -48
- package/declaration/control/AxesController.d.ts +44 -44
- package/declaration/control/Control.d.ts +45 -45
- package/declaration/control/FreeControl.d.ts +14 -14
- package/declaration/control/SnapControl.d.ts +16 -16
- package/declaration/control/StateMachine.d.ts +14 -14
- package/declaration/control/StrictControl.d.ts +20 -20
- package/declaration/control/index.d.ts +14 -14
- package/declaration/control/states/AnimatingState.d.ts +9 -9
- package/declaration/control/states/DisabledState.d.ts +9 -9
- package/declaration/control/states/DraggingState.d.ts +8 -8
- package/declaration/control/states/HoldingState.d.ts +10 -10
- package/declaration/control/states/IdleState.d.ts +9 -9
- package/declaration/control/states/State.d.ts +47 -47
- package/declaration/core/AnchorPoint.d.ts +15 -15
- package/declaration/core/AutoResizer.d.ts +16 -16
- package/declaration/core/FlickingError.d.ts +5 -5
- package/declaration/core/ResizeWatcher.d.ts +33 -33
- package/declaration/core/Viewport.d.ts +25 -25
- package/declaration/core/VirtualManager.d.ts +37 -37
- package/declaration/core/index.d.ts +6 -6
- package/declaration/core/panel/Panel.d.ts +89 -89
- package/declaration/core/panel/VirtualPanel.d.ts +19 -19
- package/declaration/core/panel/index.d.ts +5 -5
- package/declaration/core/panel/provider/ElementProvider.d.ts +8 -8
- package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -12
- package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -15
- package/declaration/core/panel/provider/index.d.ts +5 -5
- package/declaration/index.cjs.d.ts +3 -3
- package/declaration/index.d.ts +13 -13
- package/declaration/index.umd.d.ts +2 -2
- package/declaration/renderer/ExternalRenderer.d.ts +7 -7
- package/declaration/renderer/Renderer.d.ts +59 -59
- package/declaration/renderer/VanillaRenderer.d.ts +10 -10
- package/declaration/renderer/index.d.ts +6 -6
- package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -23
- package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -15
- package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -17
- package/declaration/renderer/strategy/index.d.ts +5 -5
- package/declaration/type/event.d.ts +88 -88
- package/declaration/type/external.d.ts +31 -31
- package/declaration/type/internal.d.ts +13 -13
- package/declaration/utils.d.ts +45 -45
- package/dist/flicking.cjs.js +19 -5
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +19 -5
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +19 -5
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +769 -755
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/Flicking.ts +1 -0
- package/src/core/AutoResizer.ts +5 -2
- package/src/renderer/Renderer.ts +4 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import Flicking from "../../Flicking";
|
|
2
|
-
import Panel, { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
-
import ElementProvider from "../../core/panel/provider/ElementProvider";
|
|
4
|
-
import RenderingStrategy from "./RenderingStrategy";
|
|
5
|
-
export interface NormalRenderingStrategyOptions {
|
|
6
|
-
providerCtor: new (...args: any) => ElementProvider;
|
|
7
|
-
}
|
|
8
|
-
declare class NormalRenderingStrategy implements RenderingStrategy {
|
|
9
|
-
private _providerCtor;
|
|
10
|
-
constructor({ providerCtor }: NormalRenderingStrategyOptions);
|
|
11
|
-
renderPanels(): void;
|
|
12
|
-
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
13
|
-
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
14
|
-
updateRenderingPanels(flicking: Flicking): void;
|
|
15
|
-
collectPanels(flicking: Flicking, elements: any[]): Panel[];
|
|
16
|
-
createPanel(element: any, options: Omit<PanelOptions, "elementProvider">): Panel;
|
|
17
|
-
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
18
|
-
width: number | string;
|
|
19
|
-
height: number | string;
|
|
20
|
-
}>): void;
|
|
21
|
-
private _showOnlyVisiblePanels;
|
|
22
|
-
}
|
|
23
|
-
export default NormalRenderingStrategy;
|
|
1
|
+
import Flicking from "../../Flicking";
|
|
2
|
+
import Panel, { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
+
import ElementProvider from "../../core/panel/provider/ElementProvider";
|
|
4
|
+
import RenderingStrategy from "./RenderingStrategy";
|
|
5
|
+
export interface NormalRenderingStrategyOptions {
|
|
6
|
+
providerCtor: new (...args: any) => ElementProvider;
|
|
7
|
+
}
|
|
8
|
+
declare class NormalRenderingStrategy implements RenderingStrategy {
|
|
9
|
+
private _providerCtor;
|
|
10
|
+
constructor({ providerCtor }: NormalRenderingStrategyOptions);
|
|
11
|
+
renderPanels(): void;
|
|
12
|
+
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
13
|
+
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
14
|
+
updateRenderingPanels(flicking: Flicking): void;
|
|
15
|
+
collectPanels(flicking: Flicking, elements: any[]): Panel[];
|
|
16
|
+
createPanel(element: any, options: Omit<PanelOptions, "elementProvider">): Panel;
|
|
17
|
+
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
18
|
+
width: number | string;
|
|
19
|
+
height: number | string;
|
|
20
|
+
}>): void;
|
|
21
|
+
private _showOnlyVisiblePanels;
|
|
22
|
+
}
|
|
23
|
+
export default NormalRenderingStrategy;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Flicking from "../../Flicking";
|
|
2
|
-
import Panel, { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
-
interface RenderingStrategy {
|
|
4
|
-
renderPanels(flicking: Flicking): void;
|
|
5
|
-
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
6
|
-
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
7
|
-
updateRenderingPanels(flicking: Flicking): void;
|
|
8
|
-
createPanel(element: any, options: Omit<PanelOptions, "elementProvider">): Panel;
|
|
9
|
-
collectPanels(flicking: Flicking, elements: any[]): Panel[];
|
|
10
|
-
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
11
|
-
width: number | string;
|
|
12
|
-
height: number | string;
|
|
13
|
-
}>): void;
|
|
14
|
-
}
|
|
15
|
-
export default RenderingStrategy;
|
|
1
|
+
import Flicking from "../../Flicking";
|
|
2
|
+
import Panel, { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
+
interface RenderingStrategy {
|
|
4
|
+
renderPanels(flicking: Flicking): void;
|
|
5
|
+
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
6
|
+
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
7
|
+
updateRenderingPanels(flicking: Flicking): void;
|
|
8
|
+
createPanel(element: any, options: Omit<PanelOptions, "elementProvider">): Panel;
|
|
9
|
+
collectPanels(flicking: Flicking, elements: any[]): Panel[];
|
|
10
|
+
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
11
|
+
width: number | string;
|
|
12
|
+
height: number | string;
|
|
13
|
+
}>): void;
|
|
14
|
+
}
|
|
15
|
+
export default RenderingStrategy;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import Flicking from "../../Flicking";
|
|
2
|
-
import { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
-
import VirtualPanel from "../../core/panel/VirtualPanel";
|
|
4
|
-
import RenderingStrategy from "./RenderingStrategy";
|
|
5
|
-
declare class VirtualRenderingStrategy implements RenderingStrategy {
|
|
6
|
-
renderPanels(flicking: Flicking): void;
|
|
7
|
-
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
8
|
-
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
9
|
-
updateRenderingPanels(flicking: Flicking): void;
|
|
10
|
-
collectPanels(flicking: Flicking): VirtualPanel[];
|
|
11
|
-
createPanel(_el: any, options: PanelOptions): VirtualPanel;
|
|
12
|
-
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
13
|
-
width: number | string;
|
|
14
|
-
height: number | string;
|
|
15
|
-
}>): void;
|
|
16
|
-
}
|
|
17
|
-
export default VirtualRenderingStrategy;
|
|
1
|
+
import Flicking from "../../Flicking";
|
|
2
|
+
import { PanelOptions } from "../../core/panel/Panel";
|
|
3
|
+
import VirtualPanel from "../../core/panel/VirtualPanel";
|
|
4
|
+
import RenderingStrategy from "./RenderingStrategy";
|
|
5
|
+
declare class VirtualRenderingStrategy implements RenderingStrategy {
|
|
6
|
+
renderPanels(flicking: Flicking): void;
|
|
7
|
+
getRenderingIndexesByOrder(flicking: Flicking): number[];
|
|
8
|
+
getRenderingElementsByOrder(flicking: Flicking): HTMLElement[];
|
|
9
|
+
updateRenderingPanels(flicking: Flicking): void;
|
|
10
|
+
collectPanels(flicking: Flicking): VirtualPanel[];
|
|
11
|
+
createPanel(_el: any, options: PanelOptions): VirtualPanel;
|
|
12
|
+
updatePanelSizes(flicking: Flicking, size: Partial<{
|
|
13
|
+
width: number | string;
|
|
14
|
+
height: number | string;
|
|
15
|
+
}>): void;
|
|
16
|
+
}
|
|
17
|
+
export default VirtualRenderingStrategy;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import RenderingStrategy from "./RenderingStrategy";
|
|
2
|
-
import NormalRenderingStrategy, { NormalRenderingStrategyOptions } from "./NormalRenderingStrategy";
|
|
3
|
-
import VirtualRenderingStrategy from "./VirtualRenderingStrategy";
|
|
4
|
-
export { NormalRenderingStrategy, VirtualRenderingStrategy };
|
|
5
|
-
export type { RenderingStrategy, NormalRenderingStrategyOptions };
|
|
1
|
+
import RenderingStrategy from "./RenderingStrategy";
|
|
2
|
+
import NormalRenderingStrategy, { NormalRenderingStrategyOptions } from "./NormalRenderingStrategy";
|
|
3
|
+
import VirtualRenderingStrategy from "./VirtualRenderingStrategy";
|
|
4
|
+
export { NormalRenderingStrategy, VirtualRenderingStrategy };
|
|
5
|
+
export type { RenderingStrategy, NormalRenderingStrategyOptions };
|
|
@@ -1,88 +1,88 @@
|
|
|
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
|
+
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 +1,31 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare type ValueOf<T> = T[keyof T];
|
|
2
|
-
export declare type LiteralUnion<T extends U, U = string> = T | (Pick<U, never> & {
|
|
3
|
-
_?: never;
|
|
4
|
-
});
|
|
5
|
-
export interface ArrayLike<T> {
|
|
6
|
-
[index: number]: T;
|
|
7
|
-
length: number;
|
|
8
|
-
}
|
|
9
|
-
export declare type Unique<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
|
|
10
|
-
export declare type MergeObject<T, U> = {
|
|
11
|
-
[K in keyof T & keyof U]: T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? Merged<T[K], U[K]> : T[K] : T[K];
|
|
12
|
-
};
|
|
13
|
-
export declare type Merged<From, To> = Unique<From, To> & Unique<To, From> & MergeObject<From, To>;
|
|
1
|
+
export declare type ValueOf<T> = T[keyof T];
|
|
2
|
+
export declare type LiteralUnion<T extends U, U = string> = T | (Pick<U, never> & {
|
|
3
|
+
_?: never;
|
|
4
|
+
});
|
|
5
|
+
export interface ArrayLike<T> {
|
|
6
|
+
[index: number]: T;
|
|
7
|
+
length: number;
|
|
8
|
+
}
|
|
9
|
+
export declare type Unique<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
|
|
10
|
+
export declare type MergeObject<T, U> = {
|
|
11
|
+
[K in keyof T & keyof U]: T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? Merged<T[K], U[K]> : T[K] : T[K];
|
|
12
|
+
};
|
|
13
|
+
export declare type Merged<From, To> = Unique<From, To> & Unique<To, From> & MergeObject<From, To>;
|
package/declaration/utils.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import Flicking, { FlickingOptions } from "./Flicking";
|
|
2
|
-
import { ALIGN, DIRECTION } from "./const/external";
|
|
3
|
-
import { LiteralUnion, Merged, ValueOf } from "./type/internal";
|
|
4
|
-
import { ElementLike } from "./type/external";
|
|
5
|
-
export declare const merge: <From extends object, To extends object>(target: From, ...sources: To[]) => Merged<From, To>;
|
|
6
|
-
export declare const getElement: (el: HTMLElement | string | null, parent?: HTMLElement) => HTMLElement;
|
|
7
|
-
export declare const checkExistence: (value: any, nameOnErrMsg: string) => void;
|
|
8
|
-
export declare const clamp: (x: number, min: number, max: number) => number;
|
|
9
|
-
export declare const getFlickingAttached: (val: Flicking | null) => Flicking;
|
|
10
|
-
export declare const toArray: <T>(iterable: ArrayLike<T>) => T[];
|
|
11
|
-
export declare const parseAlign: (align: LiteralUnion<ValueOf<typeof ALIGN>> | number, size: number) => number;
|
|
12
|
-
export declare const parseBounce: (bounce: FlickingOptions["bounce"], size: number) => number[];
|
|
13
|
-
export declare const parseArithmeticSize: (cssValue: number | string, base: number) => number | null;
|
|
14
|
-
export declare const parseArithmeticExpression: (cssValue: number | string) => {
|
|
15
|
-
percentage: number;
|
|
16
|
-
absolute: number;
|
|
17
|
-
} | null;
|
|
18
|
-
export declare const parseCSSSizeValue: (val: string | number) => string;
|
|
19
|
-
export declare const parsePanelAlign: (align: FlickingOptions["align"]) => string | number;
|
|
20
|
-
export declare const getDirection: (start: number, end: number) => ValueOf<typeof DIRECTION>;
|
|
21
|
-
export declare const parseElement: (element: ElementLike | ElementLike[]) => HTMLElement[];
|
|
22
|
-
export declare const getMinusCompensatedIndex: (idx: number, max: number) => number;
|
|
23
|
-
export declare const includes: <T>(array: T[], target: any) => target is T;
|
|
24
|
-
export declare const isString: (val: any) => val is string;
|
|
25
|
-
export declare const circulatePosition: (pos: number, min: number, max: number) => number;
|
|
26
|
-
export declare const find: <T>(array: T[], checker: (val: T) => boolean) => T;
|
|
27
|
-
export declare const findRight: <T>(array: T[], checker: (val: T) => boolean) => T;
|
|
28
|
-
export declare const findIndex: <T>(array: T[], checker: (val: T) => boolean) => number;
|
|
29
|
-
export declare const getProgress: (pos: number, prev: number, next: number) => number;
|
|
30
|
-
export declare const getStyle: (el: HTMLElement) => CSSStyleDeclaration;
|
|
31
|
-
export declare const setSize: (el: HTMLElement, { width, height }: Partial<{
|
|
32
|
-
width: number | string;
|
|
33
|
-
height: number | string;
|
|
34
|
-
}>) => void;
|
|
35
|
-
export declare const isBetween: (val: number, min: number, max: number) => boolean;
|
|
36
|
-
export declare const circulateIndex: (index: number, max: number) => number;
|
|
37
|
-
export declare const range: (end: number) => number[];
|
|
38
|
-
export declare const getElementSize: ({ el, horizontal, useFractionalSize, useOffset, style }: {
|
|
39
|
-
el: HTMLElement;
|
|
40
|
-
horizontal: boolean;
|
|
41
|
-
useFractionalSize: boolean;
|
|
42
|
-
useOffset: boolean;
|
|
43
|
-
style: CSSStyleDeclaration;
|
|
44
|
-
}) => number;
|
|
45
|
-
export declare const setPrototypeOf: (o: any, proto: object) => any;
|
|
1
|
+
import Flicking, { FlickingOptions } from "./Flicking";
|
|
2
|
+
import { ALIGN, DIRECTION } from "./const/external";
|
|
3
|
+
import { LiteralUnion, Merged, ValueOf } from "./type/internal";
|
|
4
|
+
import { ElementLike } from "./type/external";
|
|
5
|
+
export declare const merge: <From extends object, To extends object>(target: From, ...sources: To[]) => Merged<From, To>;
|
|
6
|
+
export declare const getElement: (el: HTMLElement | string | null, parent?: HTMLElement) => HTMLElement;
|
|
7
|
+
export declare const checkExistence: (value: any, nameOnErrMsg: string) => void;
|
|
8
|
+
export declare const clamp: (x: number, min: number, max: number) => number;
|
|
9
|
+
export declare const getFlickingAttached: (val: Flicking | null) => Flicking;
|
|
10
|
+
export declare const toArray: <T>(iterable: ArrayLike<T>) => T[];
|
|
11
|
+
export declare const parseAlign: (align: LiteralUnion<ValueOf<typeof ALIGN>> | number, size: number) => number;
|
|
12
|
+
export declare const parseBounce: (bounce: FlickingOptions["bounce"], size: number) => number[];
|
|
13
|
+
export declare const parseArithmeticSize: (cssValue: number | string, base: number) => number | null;
|
|
14
|
+
export declare const parseArithmeticExpression: (cssValue: number | string) => {
|
|
15
|
+
percentage: number;
|
|
16
|
+
absolute: number;
|
|
17
|
+
} | null;
|
|
18
|
+
export declare const parseCSSSizeValue: (val: string | number) => string;
|
|
19
|
+
export declare const parsePanelAlign: (align: FlickingOptions["align"]) => string | number;
|
|
20
|
+
export declare const getDirection: (start: number, end: number) => ValueOf<typeof DIRECTION>;
|
|
21
|
+
export declare const parseElement: (element: ElementLike | ElementLike[]) => HTMLElement[];
|
|
22
|
+
export declare const getMinusCompensatedIndex: (idx: number, max: number) => number;
|
|
23
|
+
export declare const includes: <T>(array: T[], target: any) => target is T;
|
|
24
|
+
export declare const isString: (val: any) => val is string;
|
|
25
|
+
export declare const circulatePosition: (pos: number, min: number, max: number) => number;
|
|
26
|
+
export declare const find: <T>(array: T[], checker: (val: T) => boolean) => T;
|
|
27
|
+
export declare const findRight: <T>(array: T[], checker: (val: T) => boolean) => T;
|
|
28
|
+
export declare const findIndex: <T>(array: T[], checker: (val: T) => boolean) => number;
|
|
29
|
+
export declare const getProgress: (pos: number, prev: number, next: number) => number;
|
|
30
|
+
export declare const getStyle: (el: HTMLElement) => CSSStyleDeclaration;
|
|
31
|
+
export declare const setSize: (el: HTMLElement, { width, height }: Partial<{
|
|
32
|
+
width: number | string;
|
|
33
|
+
height: number | string;
|
|
34
|
+
}>) => void;
|
|
35
|
+
export declare const isBetween: (val: number, min: number, max: number) => boolean;
|
|
36
|
+
export declare const circulateIndex: (index: number, max: number) => number;
|
|
37
|
+
export declare const range: (end: number) => number[];
|
|
38
|
+
export declare const getElementSize: ({ el, horizontal, useFractionalSize, useOffset, style }: {
|
|
39
|
+
el: HTMLElement;
|
|
40
|
+
horizontal: boolean;
|
|
41
|
+
useFractionalSize: boolean;
|
|
42
|
+
useOffset: boolean;
|
|
43
|
+
style: CSSStyleDeclaration;
|
|
44
|
+
}) => number;
|
|
45
|
+
export declare const setPrototypeOf: (o: any, proto: object) => any;
|
package/dist/flicking.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ name: @egjs/flicking
|
|
|
4
4
|
license: MIT
|
|
5
5
|
author: NAVER Corp.
|
|
6
6
|
repository: https://github.com/naver/egjs-flicking
|
|
7
|
-
version: 4.11.
|
|
7
|
+
version: 4.11.5-beta.0
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -972,9 +972,13 @@ var AutoResizer = /*#__PURE__*/function () {
|
|
|
972
972
|
}
|
|
973
973
|
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
974
974
|
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
975
|
-
var
|
|
976
|
-
|
|
977
|
-
|
|
975
|
+
var resizeObserver_1 = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
|
|
976
|
+
__spread([flicking.viewport.element], flicking.camera.element ? [flicking.camera.element] : [], flicking.panels.map(function (panel) {
|
|
977
|
+
return panel.element;
|
|
978
|
+
})).forEach(function (element) {
|
|
979
|
+
resizeObserver_1.observe(element);
|
|
980
|
+
});
|
|
981
|
+
this._resizeObserver = resizeObserver_1;
|
|
978
982
|
} else {
|
|
979
983
|
window.addEventListener("resize", this._onResize);
|
|
980
984
|
}
|
|
@@ -4766,6 +4770,9 @@ var Renderer = /*#__PURE__*/function () {
|
|
|
4766
4770
|
var activePanel = control.activePanel;
|
|
4767
4771
|
// Update camera & control
|
|
4768
4772
|
this._updateCameraAndControl();
|
|
4773
|
+
if (flicking.autoResize) {
|
|
4774
|
+
flicking.autoResizer.enable();
|
|
4775
|
+
}
|
|
4769
4776
|
void this.render();
|
|
4770
4777
|
if (!flicking.animating) {
|
|
4771
4778
|
if (!activePanel || activePanel.removed) {
|
|
@@ -6167,6 +6174,13 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6167
6174
|
enumerable: false,
|
|
6168
6175
|
configurable: true
|
|
6169
6176
|
});
|
|
6177
|
+
Object.defineProperty(__proto, "autoResizer", {
|
|
6178
|
+
get: function () {
|
|
6179
|
+
return this._autoResizer;
|
|
6180
|
+
},
|
|
6181
|
+
enumerable: false,
|
|
6182
|
+
configurable: true
|
|
6183
|
+
});
|
|
6170
6184
|
Object.defineProperty(__proto, "initialized", {
|
|
6171
6185
|
// Internal States
|
|
6172
6186
|
/**
|
|
@@ -7838,7 +7852,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7838
7852
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7839
7853
|
* ```
|
|
7840
7854
|
*/
|
|
7841
|
-
Flicking.VERSION = "4.11.
|
|
7855
|
+
Flicking.VERSION = "4.11.5-beta.0";
|
|
7842
7856
|
return Flicking;
|
|
7843
7857
|
}(Component);
|
|
7844
7858
|
|