@egjs/flicking 4.7.3 → 4.9.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/TODO.md +3 -0
- package/declaration/Flicking.d.ts +8 -1
- package/declaration/core/Viewport.d.ts +3 -1
- package/declaration/utils.d.ts +7 -0
- package/dist/flicking.esm.js +151 -39
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +151 -38
- 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 +265 -133
- 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 +32 -1
- package/src/control/AxesController.ts +1 -1
- package/src/control/SnapControl.ts +16 -4
- package/src/control/StrictControl.ts +5 -1
- package/src/control/states/AnimatingState.ts +6 -0
- package/src/core/FlickingError.ts +1 -1
- package/src/core/Viewport.ts +23 -4
- package/src/core/panel/Panel.ts +23 -4
- package/src/utils.ts +42 -0
package/TODO.md
ADDED
|
@@ -56,6 +56,7 @@ export interface FlickingOptions {
|
|
|
56
56
|
iOSEdgeSwipeThreshold: number;
|
|
57
57
|
preventClickOnDrag: boolean;
|
|
58
58
|
disableOnInit: boolean;
|
|
59
|
+
changeOnHold: boolean;
|
|
59
60
|
renderOnlyVisible: boolean;
|
|
60
61
|
virtual: VirtualOptions | null;
|
|
61
62
|
autoInit: boolean;
|
|
@@ -63,6 +64,7 @@ export interface FlickingOptions {
|
|
|
63
64
|
useResizeObserver: boolean;
|
|
64
65
|
resizeDebounce: number;
|
|
65
66
|
maxResizeDebounce: number;
|
|
67
|
+
useFractionalSize: boolean;
|
|
66
68
|
externalRenderer: ExternalRenderer | null;
|
|
67
69
|
renderExternal: {
|
|
68
70
|
renderer: new (options: RendererOptions) => ExternalRenderer;
|
|
@@ -102,12 +104,14 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
102
104
|
private _iOSEdgeSwipeThreshold;
|
|
103
105
|
private _preventClickOnDrag;
|
|
104
106
|
private _disableOnInit;
|
|
107
|
+
private _changeOnHold;
|
|
105
108
|
private _renderOnlyVisible;
|
|
106
109
|
private _autoInit;
|
|
107
110
|
private _autoResize;
|
|
108
111
|
private _useResizeObserver;
|
|
109
112
|
private _resizeDebounce;
|
|
110
113
|
private _maxResizeDebounce;
|
|
114
|
+
private _useFractionalSize;
|
|
111
115
|
private _externalRenderer;
|
|
112
116
|
private _renderExternal;
|
|
113
117
|
private _initialized;
|
|
@@ -155,6 +159,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
155
159
|
get iOSEdgeSwipeThreshold(): FlickingOptions["iOSEdgeSwipeThreshold"];
|
|
156
160
|
get preventClickOnDrag(): FlickingOptions["preventClickOnDrag"];
|
|
157
161
|
get disableOnInit(): FlickingOptions["disableOnInit"];
|
|
162
|
+
get changeOnHold(): FlickingOptions["changeOnHold"];
|
|
158
163
|
get renderOnlyVisible(): FlickingOptions["renderOnlyVisible"];
|
|
159
164
|
get virtual(): VirtualManager;
|
|
160
165
|
get autoInit(): boolean;
|
|
@@ -162,6 +167,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
162
167
|
get useResizeObserver(): FlickingOptions["useResizeObserver"];
|
|
163
168
|
get resizeDebounce(): number;
|
|
164
169
|
get maxResizeDebounce(): number;
|
|
170
|
+
get useFractionalSize(): boolean;
|
|
165
171
|
get externalRenderer(): ExternalRenderer;
|
|
166
172
|
get renderExternal(): {
|
|
167
173
|
renderer: new (options: RendererOptions) => ExternalRenderer;
|
|
@@ -190,10 +196,11 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
190
196
|
set iOSEdgeSwipeThreshold(val: FlickingOptions["iOSEdgeSwipeThreshold"]);
|
|
191
197
|
set preventClickOnDrag(val: FlickingOptions["preventClickOnDrag"]);
|
|
192
198
|
set disableOnInit(val: FlickingOptions["disableOnInit"]);
|
|
199
|
+
set changeOnHold(val: FlickingOptions["changeOnHold"]);
|
|
193
200
|
set renderOnlyVisible(val: FlickingOptions["renderOnlyVisible"]);
|
|
194
201
|
set autoResize(val: FlickingOptions["autoResize"]);
|
|
195
202
|
set useResizeObserver(val: FlickingOptions["useResizeObserver"]);
|
|
196
|
-
constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, disableOnInit, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, maxResizeDebounce, externalRenderer, renderExternal }?: Partial<FlickingOptions>);
|
|
203
|
+
constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, disableOnInit, changeOnHold, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, maxResizeDebounce, useFractionalSize, externalRenderer, renderExternal }?: Partial<FlickingOptions>);
|
|
197
204
|
init(): Promise<void>;
|
|
198
205
|
destroy(): void;
|
|
199
206
|
prev(duration?: number): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import Flicking from "../Flicking";
|
|
1
2
|
declare class Viewport {
|
|
3
|
+
private _flicking;
|
|
2
4
|
private _el;
|
|
3
5
|
private _width;
|
|
4
6
|
private _height;
|
|
@@ -13,7 +15,7 @@ declare class Viewport {
|
|
|
13
15
|
top: number;
|
|
14
16
|
bottom: number;
|
|
15
17
|
};
|
|
16
|
-
constructor(el: HTMLElement);
|
|
18
|
+
constructor(flicking: Flicking, el: HTMLElement);
|
|
17
19
|
setSize({ width, height }: Partial<{
|
|
18
20
|
width: number | string;
|
|
19
21
|
height: number | string;
|
package/declaration/utils.d.ts
CHANGED
|
@@ -35,4 +35,11 @@ export declare const setSize: (el: HTMLElement, { width, height }: Partial<{
|
|
|
35
35
|
export declare const isBetween: (val: number, min: number, max: number) => boolean;
|
|
36
36
|
export declare const circulateIndex: (index: number, max: number) => number;
|
|
37
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;
|
|
38
45
|
export declare const setPrototypeOf: (o: any, proto: object) => any;
|
package/dist/flicking.esm.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.
|
|
7
|
+
version: 4.9.0
|
|
8
8
|
*/
|
|
9
9
|
import Component, { ComponentEvent } from '@egjs/component';
|
|
10
10
|
import Axes, { PanInput } from '@egjs/axes';
|
|
@@ -767,6 +767,29 @@ var range = function (end) {
|
|
|
767
767
|
|
|
768
768
|
return arr;
|
|
769
769
|
};
|
|
770
|
+
var getElementSize = function (_a) {
|
|
771
|
+
var el = _a.el,
|
|
772
|
+
horizontal = _a.horizontal,
|
|
773
|
+
useFractionalSize = _a.useFractionalSize,
|
|
774
|
+
useOffset = _a.useOffset,
|
|
775
|
+
style = _a.style;
|
|
776
|
+
|
|
777
|
+
if (useFractionalSize) {
|
|
778
|
+
var baseSize = parseFloat(horizontal ? style.width : style.height);
|
|
779
|
+
var isBorderBoxSizing = style.boxSizing === "border-box";
|
|
780
|
+
var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
|
|
781
|
+
|
|
782
|
+
if (isBorderBoxSizing) {
|
|
783
|
+
return useOffset ? baseSize : baseSize - border;
|
|
784
|
+
} else {
|
|
785
|
+
var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
|
|
786
|
+
return useOffset ? baseSize + padding + border : baseSize + padding;
|
|
787
|
+
}
|
|
788
|
+
} else {
|
|
789
|
+
var sizeStr = horizontal ? "Width" : "Height";
|
|
790
|
+
return useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
|
|
791
|
+
}
|
|
792
|
+
};
|
|
770
793
|
var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
771
794
|
obj.__proto__ = proto;
|
|
772
795
|
return obj;
|
|
@@ -781,7 +804,7 @@ var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
|
781
804
|
* @ko Flicking 내부에서 알려진 오류 발생시 throw되는 에러
|
|
782
805
|
* @property {number} code Error code<ko>에러 코드</ko>
|
|
783
806
|
* @property {string} message Error message<ko>에러 메시지</ko>
|
|
784
|
-
* @see {@link
|
|
807
|
+
* @see {@link ERROR_CODE ERROR_CODE}
|
|
785
808
|
* @example
|
|
786
809
|
* ```ts
|
|
787
810
|
* import Flicking, { FlickingError, ERROR_CODES } from "@egjs/flicking";
|
|
@@ -817,10 +840,6 @@ function (_super) {
|
|
|
817
840
|
return FlickingError;
|
|
818
841
|
}(Error);
|
|
819
842
|
|
|
820
|
-
/*
|
|
821
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
822
|
-
* egjs projects are licensed under the MIT license
|
|
823
|
-
*/
|
|
824
843
|
/**
|
|
825
844
|
* A component that manages viewport size
|
|
826
845
|
* @ko 뷰포트 크기 정보를 담당하는 컴포넌트
|
|
@@ -832,7 +851,8 @@ function () {
|
|
|
832
851
|
/**
|
|
833
852
|
* @param el A viewport element<ko>뷰포트 엘리먼트</ko>
|
|
834
853
|
*/
|
|
835
|
-
function Viewport(el) {
|
|
854
|
+
function Viewport(flicking, el) {
|
|
855
|
+
this._flicking = flicking;
|
|
836
856
|
this._el = el;
|
|
837
857
|
this._width = 0;
|
|
838
858
|
this._height = 0;
|
|
@@ -948,8 +968,21 @@ function () {
|
|
|
948
968
|
__proto.resize = function () {
|
|
949
969
|
var el = this._el;
|
|
950
970
|
var elStyle = getStyle(el);
|
|
951
|
-
|
|
952
|
-
this.
|
|
971
|
+
var useFractionalSize = this._flicking.useFractionalSize;
|
|
972
|
+
this._width = getElementSize({
|
|
973
|
+
el: el,
|
|
974
|
+
horizontal: true,
|
|
975
|
+
useFractionalSize: useFractionalSize,
|
|
976
|
+
useOffset: false,
|
|
977
|
+
style: elStyle
|
|
978
|
+
});
|
|
979
|
+
this._height = getElementSize({
|
|
980
|
+
el: el,
|
|
981
|
+
horizontal: false,
|
|
982
|
+
useFractionalSize: useFractionalSize,
|
|
983
|
+
useOffset: false,
|
|
984
|
+
style: elStyle
|
|
985
|
+
});
|
|
953
986
|
this._padding = {
|
|
954
987
|
left: elStyle.paddingLeft ? parseFloat(elStyle.paddingLeft) : 0,
|
|
955
988
|
right: elStyle.paddingRight ? parseFloat(elStyle.paddingRight) : 0,
|
|
@@ -1940,8 +1973,15 @@ function (_super) {
|
|
|
1940
1973
|
var flicking = ctx.flicking,
|
|
1941
1974
|
axesEvent = ctx.axesEvent,
|
|
1942
1975
|
transitTo = ctx.transitTo;
|
|
1976
|
+
var targetPanel = this._targetPanel;
|
|
1977
|
+
var control = flicking.control;
|
|
1943
1978
|
this._delta = 0;
|
|
1944
1979
|
flicking.control.updateInput();
|
|
1980
|
+
|
|
1981
|
+
if (flicking.changeOnHold && targetPanel) {
|
|
1982
|
+
control.setActive(targetPanel, control.activePanel, axesEvent.isTrusted);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1945
1985
|
var holdStartEvent = new ComponentEvent(EVENTS.HOLD_START, {
|
|
1946
1986
|
axesEvent: axesEvent
|
|
1947
1987
|
});
|
|
@@ -2148,7 +2188,9 @@ function () {
|
|
|
2148
2188
|
};
|
|
2149
2189
|
|
|
2150
2190
|
this._onAxesChange = function () {
|
|
2151
|
-
|
|
2191
|
+
var _a;
|
|
2192
|
+
|
|
2193
|
+
_this._dragged = !!((_a = _this._panInput) === null || _a === void 0 ? void 0 : _a.isEnabled());
|
|
2152
2194
|
};
|
|
2153
2195
|
|
|
2154
2196
|
this._preventClickWhenDragged = function (e) {
|
|
@@ -3111,7 +3153,7 @@ function (_super) {
|
|
|
3111
3153
|
var camera = flicking.camera;
|
|
3112
3154
|
var activeAnchor = camera.findActiveAnchor();
|
|
3113
3155
|
var anchorAtCamera = camera.findNearestAnchor(camera.position);
|
|
3114
|
-
var state =
|
|
3156
|
+
var state = this._controller.state;
|
|
3115
3157
|
|
|
3116
3158
|
if (!activeAnchor || !anchorAtCamera) {
|
|
3117
3159
|
return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
|
|
@@ -3129,10 +3171,13 @@ function (_super) {
|
|
|
3129
3171
|
targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
|
|
3130
3172
|
} else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
|
|
3131
3173
|
// Move to the adjacent panel
|
|
3132
|
-
targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
|
|
3174
|
+
targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
|
|
3133
3175
|
} else {
|
|
3134
3176
|
// Restore to active panel
|
|
3135
|
-
|
|
3177
|
+
return this.moveToPanel(activeAnchor.panel, {
|
|
3178
|
+
duration: duration,
|
|
3179
|
+
axesEvent: axesEvent
|
|
3180
|
+
});
|
|
3136
3181
|
}
|
|
3137
3182
|
|
|
3138
3183
|
this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
|
|
@@ -3203,11 +3248,20 @@ function (_super) {
|
|
|
3203
3248
|
}
|
|
3204
3249
|
};
|
|
3205
3250
|
|
|
3206
|
-
__proto._findAdjacentAnchor = function (posDelta, anchorAtCamera) {
|
|
3251
|
+
__proto._findAdjacentAnchor = function (position, posDelta, anchorAtCamera) {
|
|
3207
3252
|
var _a;
|
|
3208
3253
|
|
|
3209
3254
|
var flicking = getFlickingAttached(this._flicking);
|
|
3210
3255
|
var camera = flicking.camera;
|
|
3256
|
+
|
|
3257
|
+
if (camera.circularEnabled) {
|
|
3258
|
+
var anchorIncludePosition = camera.findAnchorIncludePosition(position);
|
|
3259
|
+
|
|
3260
|
+
if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
|
|
3261
|
+
return anchorIncludePosition;
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3211
3265
|
var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
|
|
3212
3266
|
return adjacentAnchor;
|
|
3213
3267
|
};
|
|
@@ -3553,6 +3607,7 @@ function (_super) {
|
|
|
3553
3607
|
var axesRange = this._controller.range;
|
|
3554
3608
|
var indexRange = this._indexRange;
|
|
3555
3609
|
var cameraRange = camera.range;
|
|
3610
|
+
var state = this._controller.state;
|
|
3556
3611
|
var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
|
|
3557
3612
|
var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
|
|
3558
3613
|
|
|
@@ -3561,7 +3616,8 @@ function (_super) {
|
|
|
3561
3616
|
}
|
|
3562
3617
|
|
|
3563
3618
|
var prevPos = activePanel.position;
|
|
3564
|
-
var
|
|
3619
|
+
var posDelta = flicking.animating ? state.delta : position - camera.position;
|
|
3620
|
+
var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
|
|
3565
3621
|
var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
|
|
3566
3622
|
var targetPos;
|
|
3567
3623
|
var targetPanel;
|
|
@@ -5966,7 +6022,8 @@ function () {
|
|
|
5966
6022
|
__proto.resize = function (cached) {
|
|
5967
6023
|
var el = this.element;
|
|
5968
6024
|
var flicking = this._flicking;
|
|
5969
|
-
var horizontal = flicking.horizontal
|
|
6025
|
+
var horizontal = flicking.horizontal,
|
|
6026
|
+
useFractionalSize = flicking.useFractionalSize;
|
|
5970
6027
|
|
|
5971
6028
|
if (cached) {
|
|
5972
6029
|
this._size = cached.size;
|
|
@@ -5974,7 +6031,13 @@ function () {
|
|
|
5974
6031
|
this._height = cached.height;
|
|
5975
6032
|
} else {
|
|
5976
6033
|
var elStyle = getStyle(el);
|
|
5977
|
-
this._size =
|
|
6034
|
+
this._size = getElementSize({
|
|
6035
|
+
el: el,
|
|
6036
|
+
horizontal: horizontal,
|
|
6037
|
+
useFractionalSize: useFractionalSize,
|
|
6038
|
+
useOffset: true,
|
|
6039
|
+
style: elStyle
|
|
6040
|
+
});
|
|
5978
6041
|
this._margin = horizontal ? {
|
|
5979
6042
|
prev: parseFloat(elStyle.marginLeft || "0"),
|
|
5980
6043
|
next: parseFloat(elStyle.marginRight || "0")
|
|
@@ -5982,7 +6045,13 @@ function () {
|
|
|
5982
6045
|
prev: parseFloat(elStyle.marginTop || "0"),
|
|
5983
6046
|
next: parseFloat(elStyle.marginBottom || "0")
|
|
5984
6047
|
};
|
|
5985
|
-
this._height = horizontal ?
|
|
6048
|
+
this._height = horizontal ? getElementSize({
|
|
6049
|
+
el: el,
|
|
6050
|
+
horizontal: false,
|
|
6051
|
+
useFractionalSize: useFractionalSize,
|
|
6052
|
+
useOffset: true,
|
|
6053
|
+
style: elStyle
|
|
6054
|
+
}) : this._size;
|
|
5986
6055
|
}
|
|
5987
6056
|
|
|
5988
6057
|
this.updatePosition();
|
|
@@ -6662,24 +6731,28 @@ function (_super) {
|
|
|
6662
6731
|
preventClickOnDrag = _0 === void 0 ? true : _0,
|
|
6663
6732
|
_1 = _b.disableOnInit,
|
|
6664
6733
|
disableOnInit = _1 === void 0 ? false : _1,
|
|
6665
|
-
_2 = _b.
|
|
6666
|
-
|
|
6667
|
-
_3 = _b.
|
|
6668
|
-
|
|
6669
|
-
_4 = _b.
|
|
6670
|
-
|
|
6671
|
-
_5 = _b.
|
|
6672
|
-
|
|
6673
|
-
_6 = _b.
|
|
6674
|
-
|
|
6675
|
-
_7 = _b.
|
|
6676
|
-
|
|
6677
|
-
_8 = _b.
|
|
6678
|
-
|
|
6679
|
-
_9 = _b.
|
|
6680
|
-
|
|
6681
|
-
_10 = _b.
|
|
6682
|
-
|
|
6734
|
+
_2 = _b.changeOnHold,
|
|
6735
|
+
changeOnHold = _2 === void 0 ? false : _2,
|
|
6736
|
+
_3 = _b.renderOnlyVisible,
|
|
6737
|
+
renderOnlyVisible = _3 === void 0 ? false : _3,
|
|
6738
|
+
_4 = _b.virtual,
|
|
6739
|
+
virtual = _4 === void 0 ? null : _4,
|
|
6740
|
+
_5 = _b.autoInit,
|
|
6741
|
+
autoInit = _5 === void 0 ? true : _5,
|
|
6742
|
+
_6 = _b.autoResize,
|
|
6743
|
+
autoResize = _6 === void 0 ? true : _6,
|
|
6744
|
+
_7 = _b.useResizeObserver,
|
|
6745
|
+
useResizeObserver = _7 === void 0 ? true : _7,
|
|
6746
|
+
_8 = _b.resizeDebounce,
|
|
6747
|
+
resizeDebounce = _8 === void 0 ? 0 : _8,
|
|
6748
|
+
_9 = _b.maxResizeDebounce,
|
|
6749
|
+
maxResizeDebounce = _9 === void 0 ? 100 : _9,
|
|
6750
|
+
_10 = _b.useFractionalSize,
|
|
6751
|
+
useFractionalSize = _10 === void 0 ? false : _10,
|
|
6752
|
+
_11 = _b.externalRenderer,
|
|
6753
|
+
externalRenderer = _11 === void 0 ? null : _11,
|
|
6754
|
+
_12 = _b.renderExternal,
|
|
6755
|
+
renderExternal = _12 === void 0 ? null : _12;
|
|
6683
6756
|
|
|
6684
6757
|
var _this = _super.call(this) || this; // Internal states
|
|
6685
6758
|
|
|
@@ -6712,16 +6785,18 @@ function (_super) {
|
|
|
6712
6785
|
_this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
|
|
6713
6786
|
_this._preventClickOnDrag = preventClickOnDrag;
|
|
6714
6787
|
_this._disableOnInit = disableOnInit;
|
|
6788
|
+
_this._changeOnHold = changeOnHold;
|
|
6715
6789
|
_this._renderOnlyVisible = renderOnlyVisible;
|
|
6716
6790
|
_this._autoInit = autoInit;
|
|
6717
6791
|
_this._autoResize = autoResize;
|
|
6718
6792
|
_this._useResizeObserver = useResizeObserver;
|
|
6719
6793
|
_this._resizeDebounce = resizeDebounce;
|
|
6720
6794
|
_this._maxResizeDebounce = maxResizeDebounce;
|
|
6795
|
+
_this._useFractionalSize = useFractionalSize;
|
|
6721
6796
|
_this._externalRenderer = externalRenderer;
|
|
6722
6797
|
_this._renderExternal = renderExternal; // Create core components
|
|
6723
6798
|
|
|
6724
|
-
_this._viewport = new Viewport(getElement(root));
|
|
6799
|
+
_this._viewport = new Viewport(_this, getElement(root));
|
|
6725
6800
|
_this._autoResizer = new AutoResizer(_this);
|
|
6726
6801
|
_this._renderer = _this._createRenderer();
|
|
6727
6802
|
_this._camera = _this._createCamera();
|
|
@@ -7468,6 +7543,24 @@ function (_super) {
|
|
|
7468
7543
|
enumerable: false,
|
|
7469
7544
|
configurable: true
|
|
7470
7545
|
});
|
|
7546
|
+
Object.defineProperty(__proto, "changeOnHold", {
|
|
7547
|
+
/**
|
|
7548
|
+
* Change active panel index on mouse/touch hold while animating.
|
|
7549
|
+
* `index` of the `willChange`/`willRestore` event will be used as new index.
|
|
7550
|
+
* @ko 애니메이션 도중 마우스/터치 입력시 현재 활성화된 패널의 인덱스를 변경합니다.
|
|
7551
|
+
* `willChange`/`willRestore` 이벤트의 `index`값이 새로운 인덱스로 사용될 것입니다.
|
|
7552
|
+
* @type {boolean}
|
|
7553
|
+
* @default false
|
|
7554
|
+
*/
|
|
7555
|
+
get: function () {
|
|
7556
|
+
return this._changeOnHold;
|
|
7557
|
+
},
|
|
7558
|
+
set: function (val) {
|
|
7559
|
+
this._changeOnHold = val;
|
|
7560
|
+
},
|
|
7561
|
+
enumerable: false,
|
|
7562
|
+
configurable: true
|
|
7563
|
+
});
|
|
7471
7564
|
Object.defineProperty(__proto, "renderOnlyVisible", {
|
|
7472
7565
|
// PERFORMANCE
|
|
7473
7566
|
|
|
@@ -7616,6 +7709,23 @@ function (_super) {
|
|
|
7616
7709
|
enumerable: false,
|
|
7617
7710
|
configurable: true
|
|
7618
7711
|
});
|
|
7712
|
+
Object.defineProperty(__proto, "useFractionalSize", {
|
|
7713
|
+
/**
|
|
7714
|
+
* By enabling this, Flicking will calculate all internal size with CSS width computed with getComputedStyle.
|
|
7715
|
+
* This can prevent 1px offset issue in some cases where panel size has the fractional part.
|
|
7716
|
+
* All sizes will have the original size before CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform} is applied on the element.
|
|
7717
|
+
* @ko 이 옵션을 활성화할 경우, Flicking은 내부의 모든 크기를 {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect getBoundingClientRect}를 이용하여 계산합니다.
|
|
7718
|
+
* 이를 통해, 패널 크기에 소수점을 포함할 경우에 발생할 수 있는 일부 1px 오프셋 이슈를 해결 가능합니다.
|
|
7719
|
+
* 모든 크기는 CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform}이 엘리먼트에 적용되기 이전의 크기를 사용할 것입니다.
|
|
7720
|
+
* @type {boolean}
|
|
7721
|
+
* @default false
|
|
7722
|
+
*/
|
|
7723
|
+
get: function () {
|
|
7724
|
+
return this._useFractionalSize;
|
|
7725
|
+
},
|
|
7726
|
+
enumerable: false,
|
|
7727
|
+
configurable: true
|
|
7728
|
+
});
|
|
7619
7729
|
Object.defineProperty(__proto, "externalRenderer", {
|
|
7620
7730
|
/**
|
|
7621
7731
|
* This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
|
|
@@ -8148,6 +8258,8 @@ function (_super) {
|
|
|
8148
8258
|
camera.updateAlignPos();
|
|
8149
8259
|
camera.updateRange();
|
|
8150
8260
|
camera.updateAnchors();
|
|
8261
|
+
camera.updateAdaptiveHeight();
|
|
8262
|
+
camera.updateOffset();
|
|
8151
8263
|
return [4
|
|
8152
8264
|
/*yield*/
|
|
8153
8265
|
, renderer.render()];
|
|
@@ -8425,7 +8537,7 @@ function (_super) {
|
|
|
8425
8537
|
*/
|
|
8426
8538
|
|
|
8427
8539
|
|
|
8428
|
-
Flicking.VERSION = "4.
|
|
8540
|
+
Flicking.VERSION = "4.9.0";
|
|
8429
8541
|
return Flicking;
|
|
8430
8542
|
}(Component);
|
|
8431
8543
|
|
|
@@ -8679,5 +8791,5 @@ var parseAlign = function (alignVal) {
|
|
|
8679
8791
|
* egjs projects are licensed under the MIT license
|
|
8680
8792
|
*/
|
|
8681
8793
|
|
|
8682
|
-
export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
|
|
8794
|
+
export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getElementSize, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
|
|
8683
8795
|
//# sourceMappingURL=flicking.esm.js.map
|