@egjs/flicking 4.12.1-beta.1 → 4.12.1-beta.3
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/debug/example/index.html +82 -0
- package/declaration/Flicking.d.ts +3 -2
- package/dist/flicking.cjs.js +39 -10
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +39 -10
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +39 -10
- 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 +39 -10
- 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 +449 -200
- package/src/core/AutoResizer.ts +40 -11
package/dist/flicking.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.12.
|
|
7
|
+
version: 4.12.2-beta.0
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
|
|
@@ -997,10 +997,25 @@ version: 4.12.1-beta.1
|
|
|
997
997
|
var AutoResizer = /*#__PURE__*/function () {
|
|
998
998
|
function AutoResizer(flicking) {
|
|
999
999
|
var _this = this;
|
|
1000
|
-
this._onResize = function () {
|
|
1000
|
+
this._onResize = function (entries) {
|
|
1001
1001
|
var flicking = _this._flicking;
|
|
1002
1002
|
var resizeDebounce = flicking.resizeDebounce;
|
|
1003
1003
|
var maxResizeDebounce = flicking.maxResizeDebounce;
|
|
1004
|
+
if (entries.length) {
|
|
1005
|
+
var resizeEntryInfo = entries[0].contentRect;
|
|
1006
|
+
var beforeSize = {
|
|
1007
|
+
width: flicking.viewport.width,
|
|
1008
|
+
height: flicking.viewport.height
|
|
1009
|
+
};
|
|
1010
|
+
var afterSize = {
|
|
1011
|
+
width: resizeEntryInfo.width,
|
|
1012
|
+
height: resizeEntryInfo.height
|
|
1013
|
+
};
|
|
1014
|
+
// resize 이벤트가 발생했으나 이전과 width, height의 변화가 없다면 이후 로직을 진행하지 않는다.
|
|
1015
|
+
if (beforeSize.height === afterSize.height && beforeSize.width === afterSize.width) {
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1004
1019
|
if (resizeDebounce <= 0) {
|
|
1005
1020
|
void flicking.resize();
|
|
1006
1021
|
} else {
|
|
@@ -1026,12 +1041,12 @@ version: 4.12.1-beta.1
|
|
|
1026
1041
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1027
1042
|
this._skipFirstResize = function () {
|
|
1028
1043
|
var isFirstResize = true;
|
|
1029
|
-
return function () {
|
|
1044
|
+
return function (entries) {
|
|
1030
1045
|
if (isFirstResize) {
|
|
1031
1046
|
isFirstResize = false;
|
|
1032
1047
|
return;
|
|
1033
1048
|
}
|
|
1034
|
-
_this._onResize();
|
|
1049
|
+
_this._onResize(entries);
|
|
1035
1050
|
};
|
|
1036
1051
|
}();
|
|
1037
1052
|
this._flicking = flicking;
|
|
@@ -1049,6 +1064,7 @@ version: 4.12.1-beta.1
|
|
|
1049
1064
|
configurable: true
|
|
1050
1065
|
});
|
|
1051
1066
|
__proto.enable = function () {
|
|
1067
|
+
var _this = this;
|
|
1052
1068
|
var flicking = this._flicking;
|
|
1053
1069
|
var viewport = flicking.viewport;
|
|
1054
1070
|
if (this._enabled) {
|
|
@@ -1056,23 +1072,32 @@ version: 4.12.1-beta.1
|
|
|
1056
1072
|
}
|
|
1057
1073
|
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
1058
1074
|
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
1059
|
-
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(
|
|
1075
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(function (entries) {
|
|
1076
|
+
return _this._skipFirstResize(entries);
|
|
1077
|
+
}) : new ResizeObserver(function (entries) {
|
|
1078
|
+
return _this._onResize(entries);
|
|
1079
|
+
});
|
|
1060
1080
|
resizeObserver.observe(flicking.viewport.element);
|
|
1061
1081
|
this._resizeObserver = resizeObserver;
|
|
1062
1082
|
} else {
|
|
1063
|
-
window.addEventListener("resize",
|
|
1083
|
+
window.addEventListener("resize", function () {
|
|
1084
|
+
return _this._onResize([]);
|
|
1085
|
+
});
|
|
1064
1086
|
}
|
|
1065
1087
|
this._enabled = true;
|
|
1066
1088
|
return this;
|
|
1067
1089
|
};
|
|
1068
1090
|
__proto.disable = function () {
|
|
1091
|
+
var _this = this;
|
|
1069
1092
|
if (!this._enabled) return this;
|
|
1070
1093
|
var resizeObserver = this._resizeObserver;
|
|
1071
1094
|
if (resizeObserver) {
|
|
1072
1095
|
resizeObserver.disconnect();
|
|
1073
1096
|
this._resizeObserver = null;
|
|
1074
1097
|
} else {
|
|
1075
|
-
window.removeEventListener("resize",
|
|
1098
|
+
window.removeEventListener("resize", function () {
|
|
1099
|
+
return _this._onResize([]);
|
|
1100
|
+
});
|
|
1076
1101
|
}
|
|
1077
1102
|
this._enabled = false;
|
|
1078
1103
|
return this;
|
|
@@ -6207,6 +6232,7 @@ version: 4.12.1-beta.1
|
|
|
6207
6232
|
// Internal states
|
|
6208
6233
|
_this._initialized = false;
|
|
6209
6234
|
_this._plugins = [];
|
|
6235
|
+
_this._isResizing = false;
|
|
6210
6236
|
// Bind options
|
|
6211
6237
|
_this._align = align;
|
|
6212
6238
|
_this._defaultIndex = defaultIndex;
|
|
@@ -7746,6 +7772,8 @@ version: 4.12.1-beta.1
|
|
|
7746
7772
|
return __generator(this, function (_a) {
|
|
7747
7773
|
switch (_a.label) {
|
|
7748
7774
|
case 0:
|
|
7775
|
+
if (this._isResizing) return [2 /*return*/];
|
|
7776
|
+
this._isResizing = true;
|
|
7749
7777
|
viewport = this._viewport;
|
|
7750
7778
|
renderer = this._renderer;
|
|
7751
7779
|
camera = this._camera;
|
|
@@ -7798,6 +7826,7 @@ version: 4.12.1-beta.1
|
|
|
7798
7826
|
sizeChanged: sizeChanged,
|
|
7799
7827
|
element: viewport.element
|
|
7800
7828
|
}));
|
|
7829
|
+
this._isResizing = false;
|
|
7801
7830
|
return [2 /*return*/];
|
|
7802
7831
|
}
|
|
7803
7832
|
});
|
|
@@ -7925,7 +7954,7 @@ version: 4.12.1-beta.1
|
|
|
7925
7954
|
__proto._createCamera = function () {
|
|
7926
7955
|
if (this._circular && this._bound) {
|
|
7927
7956
|
// eslint-disable-next-line no-console
|
|
7928
|
-
console.warn("
|
|
7957
|
+
console.warn('"circular" and "bound" option cannot be used together, ignoring bound.');
|
|
7929
7958
|
}
|
|
7930
7959
|
return new Camera$1(this, {
|
|
7931
7960
|
align: this._align
|
|
@@ -7935,7 +7964,7 @@ version: 4.12.1-beta.1
|
|
|
7935
7964
|
var externalRenderer = this._externalRenderer;
|
|
7936
7965
|
if (this._virtual && this._panelsPerView <= 0) {
|
|
7937
7966
|
// eslint-disable-next-line no-console
|
|
7938
|
-
console.warn("
|
|
7967
|
+
console.warn('"virtual" and "panelsPerView" option should be used together, ignoring virtual.');
|
|
7939
7968
|
}
|
|
7940
7969
|
return externalRenderer ? externalRenderer : this._renderExternal ? this._createExternalRenderer() : this._createVanillaRenderer();
|
|
7941
7970
|
};
|
|
@@ -8017,7 +8046,7 @@ version: 4.12.1-beta.1
|
|
|
8017
8046
|
* Flicking.VERSION; // ex) 4.0.0
|
|
8018
8047
|
* ```
|
|
8019
8048
|
*/
|
|
8020
|
-
Flicking.VERSION = "4.12.
|
|
8049
|
+
Flicking.VERSION = "4.12.2-beta.0";
|
|
8021
8050
|
return Flicking;
|
|
8022
8051
|
}(Component);
|
|
8023
8052
|
|