@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
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.14.2-beta.
|
|
7
|
+
version: 4.14.2-beta.2
|
|
8
8
|
*/
|
|
9
9
|
import Component, { ComponentEvent } from '@egjs/component';
|
|
10
10
|
import Axes, { PanInput } from '@egjs/axes';
|
|
@@ -5127,8 +5127,8 @@ var Renderer = /*#__PURE__*/function () {
|
|
|
5127
5127
|
__proto._afterRender = function () {
|
|
5128
5128
|
var flicking = getFlickingAttached(this._flicking);
|
|
5129
5129
|
flicking.camera.applyTransform();
|
|
5130
|
-
if (flicking.
|
|
5131
|
-
//
|
|
5130
|
+
if (flicking.useCSSOrder) {
|
|
5131
|
+
// useCSSOrder를 사용하는 경우 DOM은 변화가 없지만 대신 CSS Order가 추가 된다.
|
|
5132
5132
|
var panels_1 = flicking.panels;
|
|
5133
5133
|
this._strategy.getRenderingIndexesByOrder(flicking).forEach(function (domIndex, index) {
|
|
5134
5134
|
panels_1[domIndex].element.style.order = "" + index;
|
|
@@ -5177,8 +5177,8 @@ var VanillaRenderer = /*#__PURE__*/function (_super) {
|
|
|
5177
5177
|
var cameraEl = flicking.camera.element;
|
|
5178
5178
|
// We're using reversed panels here as last panel should be the last element of camera element
|
|
5179
5179
|
var reversedElements = [];
|
|
5180
|
-
if (flicking.
|
|
5181
|
-
//
|
|
5180
|
+
if (flicking.useCSSOrder) {
|
|
5181
|
+
// useCSSOrder를 사용하는 경우 원본 그대로 렌더링
|
|
5182
5182
|
reversedElements = this.getRenderedPanels().map(function (panel) {
|
|
5183
5183
|
return panel.element;
|
|
5184
5184
|
}).reverse();
|
|
@@ -6250,9 +6250,10 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6250
6250
|
optimizeSizeUpdate = _16 === void 0 ? false : _16,
|
|
6251
6251
|
_17 = _b.animationThreshold,
|
|
6252
6252
|
animationThreshold = _17 === void 0 ? 0.5 : _17,
|
|
6253
|
-
_18 = _b.
|
|
6254
|
-
|
|
6253
|
+
_18 = _b.useCSSOrder,
|
|
6254
|
+
useCSSOrder = _18 === void 0 ? false : _18;
|
|
6255
6255
|
var _this = _super.call(this) || this;
|
|
6256
|
+
_this._scheduleResize = false;
|
|
6256
6257
|
// Internal states
|
|
6257
6258
|
_this._initialized = false;
|
|
6258
6259
|
_this._plugins = [];
|
|
@@ -6298,7 +6299,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6298
6299
|
_this._renderExternal = renderExternal;
|
|
6299
6300
|
_this._optimizeSizeUpdate = optimizeSizeUpdate;
|
|
6300
6301
|
_this._animationThreshold = animationThreshold;
|
|
6301
|
-
_this.
|
|
6302
|
+
_this._useCSSOrder = useCSSOrder;
|
|
6302
6303
|
// Create core components
|
|
6303
6304
|
_this._viewport = new Viewport(_this, getElement(root));
|
|
6304
6305
|
_this._autoResizer = new AutoResizer(_this);
|
|
@@ -7027,22 +7028,23 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7027
7028
|
enumerable: false,
|
|
7028
7029
|
configurable: true
|
|
7029
7030
|
});
|
|
7030
|
-
Object.defineProperty(__proto, "
|
|
7031
|
+
Object.defineProperty(__proto, "useCSSOrder", {
|
|
7031
7032
|
/**
|
|
7032
|
-
*
|
|
7033
|
+
* 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.)
|
|
7033
7034
|
* When using `iframe`, you can prevent reloading when the DOM order changes.
|
|
7034
|
-
*
|
|
7035
|
+
* In svelte, CSS order is always used.
|
|
7036
|
+
* @ko `useCSSOrder`를 사용하면 DOM의 순서는 변경되지 않지만 `order` css가 설정되면서 화면상 순서가 바뀐다. (`circular`를 사용한 경우 위치에 따라 DOM의 순서가 변경된다.)
|
|
7035
7037
|
* `iframe`을 사용하는 경우 DOM의 순서가 변경되면서 reload가 되는 것을 막을 수 있다.
|
|
7038
|
+
* svelte에서는 css order를 무조건 사용한다.
|
|
7036
7039
|
* @type {boolean}
|
|
7037
|
-
* @requires `circular`
|
|
7038
7040
|
* @default false
|
|
7039
|
-
* @see {@link https://naver.github.io/egjs-flicking/Options#
|
|
7041
|
+
* @see {@link https://naver.github.io/egjs-flicking/Options#useCSSOrder useCSSOrder ( Options )}
|
|
7040
7042
|
*/
|
|
7041
7043
|
get: function () {
|
|
7042
|
-
return this.
|
|
7044
|
+
return this._useCSSOrder;
|
|
7043
7045
|
},
|
|
7044
7046
|
set: function (val) {
|
|
7045
|
-
this.
|
|
7047
|
+
this._useCSSOrder = val;
|
|
7046
7048
|
},
|
|
7047
7049
|
enumerable: false,
|
|
7048
7050
|
configurable: true
|
|
@@ -7529,7 +7531,9 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7529
7531
|
this._plugins.forEach(function (plugin) {
|
|
7530
7532
|
return plugin.destroy();
|
|
7531
7533
|
});
|
|
7534
|
+
this._scheduleResize = false;
|
|
7532
7535
|
this._initialized = false;
|
|
7536
|
+
this._isResizing = false;
|
|
7533
7537
|
};
|
|
7534
7538
|
/**
|
|
7535
7539
|
* Move to the previous panel (current index - 1)
|
|
@@ -7894,7 +7898,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7894
7898
|
* @method
|
|
7895
7899
|
* @fires Flicking#beforeResize
|
|
7896
7900
|
* @fires Flicking#afterResize
|
|
7897
|
-
* @return {
|
|
7901
|
+
* @return {boolean}
|
|
7898
7902
|
*/
|
|
7899
7903
|
__proto.resize = function () {
|
|
7900
7904
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -7902,7 +7906,16 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7902
7906
|
return __generator(this, function (_a) {
|
|
7903
7907
|
switch (_a.label) {
|
|
7904
7908
|
case 0:
|
|
7905
|
-
if (this.
|
|
7909
|
+
if (!this._initialized) {
|
|
7910
|
+
return [2 /*return*/];
|
|
7911
|
+
}
|
|
7912
|
+
|
|
7913
|
+
if (this._isResizing) {
|
|
7914
|
+
this._scheduleResize = true;
|
|
7915
|
+
return [2 /*return*/];
|
|
7916
|
+
}
|
|
7917
|
+
|
|
7918
|
+
this._scheduleResize = false;
|
|
7906
7919
|
this._isResizing = true;
|
|
7907
7920
|
viewport = this._viewport;
|
|
7908
7921
|
renderer = this._renderer;
|
|
@@ -7968,6 +7981,9 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7968
7981
|
element: viewport.element
|
|
7969
7982
|
}));
|
|
7970
7983
|
this._isResizing = false;
|
|
7984
|
+
if (this._scheduleResize) {
|
|
7985
|
+
this.resize();
|
|
7986
|
+
}
|
|
7971
7987
|
return [2 /*return*/];
|
|
7972
7988
|
}
|
|
7973
7989
|
});
|
|
@@ -8187,7 +8203,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
8187
8203
|
* Flicking.VERSION; // ex) 4.0.0
|
|
8188
8204
|
* ```
|
|
8189
8205
|
*/
|
|
8190
|
-
Flicking.VERSION = "4.14.2-beta.
|
|
8206
|
+
Flicking.VERSION = "4.14.2-beta.2";
|
|
8191
8207
|
return Flicking;
|
|
8192
8208
|
}(Component);
|
|
8193
8209
|
|
|
@@ -8706,8 +8722,8 @@ var getRenderingPanels = (function (flicking, diffResult) {
|
|
|
8706
8722
|
var renderingPanels = flicking.panels.filter(function (panel) {
|
|
8707
8723
|
return !removedPanels[panel.index];
|
|
8708
8724
|
});
|
|
8709
|
-
if (!flicking.
|
|
8710
|
-
//
|
|
8725
|
+
if (!flicking.useCSSOrder) {
|
|
8726
|
+
// useCSSOrder를 사용하게 되는 경우 sort를 하지 않는다.
|
|
8711
8727
|
renderingPanels.sort(function (panel1, panel2) {
|
|
8712
8728
|
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
8713
8729
|
});
|