@egjs/flicking 4.14.2-beta.1 → 4.14.2-beta.2
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 +6 -5
- package/dist/flicking.cjs.js +36 -20
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +36 -20
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +36 -20
- 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 +36 -20
- 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 +1 -1
- package/src/Flicking.ts +33 -17
- package/src/cfc/getRenderingPanels.ts +2 -2
- package/src/renderer/Renderer.ts +2 -2
- package/src/renderer/VanillaRenderer.ts +2 -2
|
@@ -54,7 +54,7 @@ export interface FlickingOptions {
|
|
|
54
54
|
threshold: number;
|
|
55
55
|
dragThreshold: number;
|
|
56
56
|
animationThreshold: number;
|
|
57
|
-
|
|
57
|
+
useCSSOrder: boolean;
|
|
58
58
|
interruptable: boolean;
|
|
59
59
|
bounce: number | string | [number | string, number | string];
|
|
60
60
|
iOSEdgeSwipeThreshold: number;
|
|
@@ -108,7 +108,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
108
108
|
private _threshold;
|
|
109
109
|
private _dragThreshold;
|
|
110
110
|
private _animationThreshold;
|
|
111
|
-
private
|
|
111
|
+
private _useCSSOrder;
|
|
112
112
|
private _interruptable;
|
|
113
113
|
private _bounce;
|
|
114
114
|
private _iOSEdgeSwipeThreshold;
|
|
@@ -130,6 +130,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
130
130
|
private _initialized;
|
|
131
131
|
private _plugins;
|
|
132
132
|
private _isResizing;
|
|
133
|
+
private _scheduleResize;
|
|
133
134
|
get control(): Control;
|
|
134
135
|
get camera(): Camera;
|
|
135
136
|
get renderer(): Renderer;
|
|
@@ -171,7 +172,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
171
172
|
get threshold(): FlickingOptions["threshold"];
|
|
172
173
|
get dragThreshold(): FlickingOptions["dragThreshold"];
|
|
173
174
|
get animationThreshold(): FlickingOptions["animationThreshold"];
|
|
174
|
-
get
|
|
175
|
+
get useCSSOrder(): FlickingOptions["useCSSOrder"];
|
|
175
176
|
get interruptable(): FlickingOptions["interruptable"];
|
|
176
177
|
get bounce(): FlickingOptions["bounce"];
|
|
177
178
|
get iOSEdgeSwipeThreshold(): FlickingOptions["iOSEdgeSwipeThreshold"];
|
|
@@ -214,7 +215,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
214
215
|
set threshold(val: FlickingOptions["threshold"]);
|
|
215
216
|
set dragThreshold(val: FlickingOptions["dragThreshold"]);
|
|
216
217
|
set animationThreshold(val: FlickingOptions["animationThreshold"]);
|
|
217
|
-
set
|
|
218
|
+
set useCSSOrder(val: FlickingOptions["useCSSOrder"]);
|
|
218
219
|
set interruptable(val: FlickingOptions["interruptable"]);
|
|
219
220
|
set bounce(val: FlickingOptions["bounce"]);
|
|
220
221
|
set iOSEdgeSwipeThreshold(val: FlickingOptions["iOSEdgeSwipeThreshold"]);
|
|
@@ -227,7 +228,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
227
228
|
set useResizeObserver(val: FlickingOptions["useResizeObserver"]);
|
|
228
229
|
set observePanelResize(val: FlickingOptions["observePanelResize"]);
|
|
229
230
|
set optimizeSizeUpdate(val: FlickingOptions["optimizeSizeUpdate"]);
|
|
230
|
-
constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, dragThreshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, preventDefaultOnDrag, disableOnInit, changeOnHold, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, observePanelResize, maxResizeDebounce, useFractionalSize, externalRenderer, renderExternal, optimizeSizeUpdate, animationThreshold,
|
|
231
|
+
constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, dragThreshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, preventDefaultOnDrag, disableOnInit, changeOnHold, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, observePanelResize, maxResizeDebounce, useFractionalSize, externalRenderer, renderExternal, optimizeSizeUpdate, animationThreshold, useCSSOrder, }?: Partial<FlickingOptions>);
|
|
231
232
|
init(): Promise<void>;
|
|
232
233
|
destroy(): void;
|
|
233
234
|
prev(duration?: number): Promise<void>;
|
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.14.2-beta.
|
|
7
|
+
version: 4.14.2-beta.2
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -5129,8 +5129,8 @@ var Renderer = /*#__PURE__*/function () {
|
|
|
5129
5129
|
__proto._afterRender = function () {
|
|
5130
5130
|
var flicking = getFlickingAttached(this._flicking);
|
|
5131
5131
|
flicking.camera.applyTransform();
|
|
5132
|
-
if (flicking.
|
|
5133
|
-
//
|
|
5132
|
+
if (flicking.useCSSOrder) {
|
|
5133
|
+
// useCSSOrder를 사용하는 경우 DOM은 변화가 없지만 대신 CSS Order가 추가 된다.
|
|
5134
5134
|
var panels_1 = flicking.panels;
|
|
5135
5135
|
this._strategy.getRenderingIndexesByOrder(flicking).forEach(function (domIndex, index) {
|
|
5136
5136
|
panels_1[domIndex].element.style.order = "" + index;
|
|
@@ -5179,8 +5179,8 @@ var VanillaRenderer = /*#__PURE__*/function (_super) {
|
|
|
5179
5179
|
var cameraEl = flicking.camera.element;
|
|
5180
5180
|
// We're using reversed panels here as last panel should be the last element of camera element
|
|
5181
5181
|
var reversedElements = [];
|
|
5182
|
-
if (flicking.
|
|
5183
|
-
//
|
|
5182
|
+
if (flicking.useCSSOrder) {
|
|
5183
|
+
// useCSSOrder를 사용하는 경우 원본 그대로 렌더링
|
|
5184
5184
|
reversedElements = this.getRenderedPanels().map(function (panel) {
|
|
5185
5185
|
return panel.element;
|
|
5186
5186
|
}).reverse();
|
|
@@ -6252,9 +6252,10 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6252
6252
|
optimizeSizeUpdate = _16 === void 0 ? false : _16,
|
|
6253
6253
|
_17 = _b.animationThreshold,
|
|
6254
6254
|
animationThreshold = _17 === void 0 ? 0.5 : _17,
|
|
6255
|
-
_18 = _b.
|
|
6256
|
-
|
|
6255
|
+
_18 = _b.useCSSOrder,
|
|
6256
|
+
useCSSOrder = _18 === void 0 ? false : _18;
|
|
6257
6257
|
var _this = _super.call(this) || this;
|
|
6258
|
+
_this._scheduleResize = false;
|
|
6258
6259
|
// Internal states
|
|
6259
6260
|
_this._initialized = false;
|
|
6260
6261
|
_this._plugins = [];
|
|
@@ -6300,7 +6301,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6300
6301
|
_this._renderExternal = renderExternal;
|
|
6301
6302
|
_this._optimizeSizeUpdate = optimizeSizeUpdate;
|
|
6302
6303
|
_this._animationThreshold = animationThreshold;
|
|
6303
|
-
_this.
|
|
6304
|
+
_this._useCSSOrder = useCSSOrder;
|
|
6304
6305
|
// Create core components
|
|
6305
6306
|
_this._viewport = new Viewport(_this, getElement(root));
|
|
6306
6307
|
_this._autoResizer = new AutoResizer(_this);
|
|
@@ -7029,22 +7030,23 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7029
7030
|
enumerable: false,
|
|
7030
7031
|
configurable: true
|
|
7031
7032
|
});
|
|
7032
|
-
Object.defineProperty(__proto, "
|
|
7033
|
+
Object.defineProperty(__proto, "useCSSOrder", {
|
|
7033
7034
|
/**
|
|
7034
|
-
*
|
|
7035
|
+
* Using `useCSSOrder` does not change the DOM order, but the `order` CSS property changes the order on the screen. (When `circular` is used, the DOM order changes depending on the position.)
|
|
7035
7036
|
* When using `iframe`, you can prevent reloading when the DOM order changes.
|
|
7036
|
-
*
|
|
7037
|
+
* In svelte, CSS order is always used.
|
|
7038
|
+
* @ko `useCSSOrder`를 사용하면 DOM의 순서는 변경되지 않지만 `order` css가 설정되면서 화면상 순서가 바뀐다. (`circular`를 사용한 경우 위치에 따라 DOM의 순서가 변경된다.)
|
|
7037
7039
|
* `iframe`을 사용하는 경우 DOM의 순서가 변경되면서 reload가 되는 것을 막을 수 있다.
|
|
7040
|
+
* svelte에서는 css order를 무조건 사용한다.
|
|
7038
7041
|
* @type {boolean}
|
|
7039
|
-
* @requires `circular`
|
|
7040
7042
|
* @default false
|
|
7041
|
-
* @see {@link https://naver.github.io/egjs-flicking/Options#
|
|
7043
|
+
* @see {@link https://naver.github.io/egjs-flicking/Options#useCSSOrder useCSSOrder ( Options )}
|
|
7042
7044
|
*/
|
|
7043
7045
|
get: function () {
|
|
7044
|
-
return this.
|
|
7046
|
+
return this._useCSSOrder;
|
|
7045
7047
|
},
|
|
7046
7048
|
set: function (val) {
|
|
7047
|
-
this.
|
|
7049
|
+
this._useCSSOrder = val;
|
|
7048
7050
|
},
|
|
7049
7051
|
enumerable: false,
|
|
7050
7052
|
configurable: true
|
|
@@ -7531,7 +7533,9 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7531
7533
|
this._plugins.forEach(function (plugin) {
|
|
7532
7534
|
return plugin.destroy();
|
|
7533
7535
|
});
|
|
7536
|
+
this._scheduleResize = false;
|
|
7534
7537
|
this._initialized = false;
|
|
7538
|
+
this._isResizing = false;
|
|
7535
7539
|
};
|
|
7536
7540
|
/**
|
|
7537
7541
|
* Move to the previous panel (current index - 1)
|
|
@@ -7896,7 +7900,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7896
7900
|
* @method
|
|
7897
7901
|
* @fires Flicking#beforeResize
|
|
7898
7902
|
* @fires Flicking#afterResize
|
|
7899
|
-
* @return {
|
|
7903
|
+
* @return {boolean}
|
|
7900
7904
|
*/
|
|
7901
7905
|
__proto.resize = function () {
|
|
7902
7906
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -7904,7 +7908,16 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7904
7908
|
return __generator(this, function (_a) {
|
|
7905
7909
|
switch (_a.label) {
|
|
7906
7910
|
case 0:
|
|
7907
|
-
if (this.
|
|
7911
|
+
if (!this._initialized) {
|
|
7912
|
+
return [2 /*return*/];
|
|
7913
|
+
}
|
|
7914
|
+
|
|
7915
|
+
if (this._isResizing) {
|
|
7916
|
+
this._scheduleResize = true;
|
|
7917
|
+
return [2 /*return*/];
|
|
7918
|
+
}
|
|
7919
|
+
|
|
7920
|
+
this._scheduleResize = false;
|
|
7908
7921
|
this._isResizing = true;
|
|
7909
7922
|
viewport = this._viewport;
|
|
7910
7923
|
renderer = this._renderer;
|
|
@@ -7970,6 +7983,9 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7970
7983
|
element: viewport.element
|
|
7971
7984
|
}));
|
|
7972
7985
|
this._isResizing = false;
|
|
7986
|
+
if (this._scheduleResize) {
|
|
7987
|
+
this.resize();
|
|
7988
|
+
}
|
|
7973
7989
|
return [2 /*return*/];
|
|
7974
7990
|
}
|
|
7975
7991
|
});
|
|
@@ -8189,7 +8205,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
8189
8205
|
* Flicking.VERSION; // ex) 4.0.0
|
|
8190
8206
|
* ```
|
|
8191
8207
|
*/
|
|
8192
|
-
Flicking.VERSION = "4.14.2-beta.
|
|
8208
|
+
Flicking.VERSION = "4.14.2-beta.2";
|
|
8193
8209
|
return Flicking;
|
|
8194
8210
|
}(Component);
|
|
8195
8211
|
|
|
@@ -8708,8 +8724,8 @@ var getRenderingPanels = (function (flicking, diffResult) {
|
|
|
8708
8724
|
var renderingPanels = flicking.panels.filter(function (panel) {
|
|
8709
8725
|
return !removedPanels[panel.index];
|
|
8710
8726
|
});
|
|
8711
|
-
if (!flicking.
|
|
8712
|
-
//
|
|
8727
|
+
if (!flicking.useCSSOrder) {
|
|
8728
|
+
// useCSSOrder를 사용하게 되는 경우 sort를 하지 않는다.
|
|
8713
8729
|
renderingPanels.sort(function (panel1, panel2) {
|
|
8714
8730
|
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
8715
8731
|
});
|