@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.pkgd.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() :
|
|
@@ -1404,10 +1404,25 @@ version: 4.12.1-beta.1
|
|
|
1404
1404
|
var AutoResizer = /*#__PURE__*/function () {
|
|
1405
1405
|
function AutoResizer(flicking) {
|
|
1406
1406
|
var _this = this;
|
|
1407
|
-
this._onResize = function () {
|
|
1407
|
+
this._onResize = function (entries) {
|
|
1408
1408
|
var flicking = _this._flicking;
|
|
1409
1409
|
var resizeDebounce = flicking.resizeDebounce;
|
|
1410
1410
|
var maxResizeDebounce = flicking.maxResizeDebounce;
|
|
1411
|
+
if (entries.length) {
|
|
1412
|
+
var resizeEntryInfo = entries[0].contentRect;
|
|
1413
|
+
var beforeSize = {
|
|
1414
|
+
width: flicking.viewport.width,
|
|
1415
|
+
height: flicking.viewport.height
|
|
1416
|
+
};
|
|
1417
|
+
var afterSize = {
|
|
1418
|
+
width: resizeEntryInfo.width,
|
|
1419
|
+
height: resizeEntryInfo.height
|
|
1420
|
+
};
|
|
1421
|
+
// resize 이벤트가 발생했으나 이전과 width, height의 변화가 없다면 이후 로직을 진행하지 않는다.
|
|
1422
|
+
if (beforeSize.height === afterSize.height && beforeSize.width === afterSize.width) {
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1411
1426
|
if (resizeDebounce <= 0) {
|
|
1412
1427
|
void flicking.resize();
|
|
1413
1428
|
} else {
|
|
@@ -1433,12 +1448,12 @@ version: 4.12.1-beta.1
|
|
|
1433
1448
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1434
1449
|
this._skipFirstResize = function () {
|
|
1435
1450
|
var isFirstResize = true;
|
|
1436
|
-
return function () {
|
|
1451
|
+
return function (entries) {
|
|
1437
1452
|
if (isFirstResize) {
|
|
1438
1453
|
isFirstResize = false;
|
|
1439
1454
|
return;
|
|
1440
1455
|
}
|
|
1441
|
-
_this._onResize();
|
|
1456
|
+
_this._onResize(entries);
|
|
1442
1457
|
};
|
|
1443
1458
|
}();
|
|
1444
1459
|
this._flicking = flicking;
|
|
@@ -1456,6 +1471,7 @@ version: 4.12.1-beta.1
|
|
|
1456
1471
|
configurable: true
|
|
1457
1472
|
});
|
|
1458
1473
|
__proto.enable = function () {
|
|
1474
|
+
var _this = this;
|
|
1459
1475
|
var flicking = this._flicking;
|
|
1460
1476
|
var viewport = flicking.viewport;
|
|
1461
1477
|
if (this._enabled) {
|
|
@@ -1463,23 +1479,32 @@ version: 4.12.1-beta.1
|
|
|
1463
1479
|
}
|
|
1464
1480
|
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
1465
1481
|
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
1466
|
-
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(
|
|
1482
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(function (entries) {
|
|
1483
|
+
return _this._skipFirstResize(entries);
|
|
1484
|
+
}) : new ResizeObserver(function (entries) {
|
|
1485
|
+
return _this._onResize(entries);
|
|
1486
|
+
});
|
|
1467
1487
|
resizeObserver.observe(flicking.viewport.element);
|
|
1468
1488
|
this._resizeObserver = resizeObserver;
|
|
1469
1489
|
} else {
|
|
1470
|
-
window.addEventListener("resize",
|
|
1490
|
+
window.addEventListener("resize", function () {
|
|
1491
|
+
return _this._onResize([]);
|
|
1492
|
+
});
|
|
1471
1493
|
}
|
|
1472
1494
|
this._enabled = true;
|
|
1473
1495
|
return this;
|
|
1474
1496
|
};
|
|
1475
1497
|
__proto.disable = function () {
|
|
1498
|
+
var _this = this;
|
|
1476
1499
|
if (!this._enabled) return this;
|
|
1477
1500
|
var resizeObserver = this._resizeObserver;
|
|
1478
1501
|
if (resizeObserver) {
|
|
1479
1502
|
resizeObserver.disconnect();
|
|
1480
1503
|
this._resizeObserver = null;
|
|
1481
1504
|
} else {
|
|
1482
|
-
window.removeEventListener("resize",
|
|
1505
|
+
window.removeEventListener("resize", function () {
|
|
1506
|
+
return _this._onResize([]);
|
|
1507
|
+
});
|
|
1483
1508
|
}
|
|
1484
1509
|
this._enabled = false;
|
|
1485
1510
|
return this;
|
|
@@ -11242,6 +11267,7 @@ version: 4.12.1-beta.1
|
|
|
11242
11267
|
// Internal states
|
|
11243
11268
|
_this._initialized = false;
|
|
11244
11269
|
_this._plugins = [];
|
|
11270
|
+
_this._isResizing = false;
|
|
11245
11271
|
// Bind options
|
|
11246
11272
|
_this._align = align;
|
|
11247
11273
|
_this._defaultIndex = defaultIndex;
|
|
@@ -12781,6 +12807,8 @@ version: 4.12.1-beta.1
|
|
|
12781
12807
|
return __generator(this, function (_a) {
|
|
12782
12808
|
switch (_a.label) {
|
|
12783
12809
|
case 0:
|
|
12810
|
+
if (this._isResizing) return [2 /*return*/];
|
|
12811
|
+
this._isResizing = true;
|
|
12784
12812
|
viewport = this._viewport;
|
|
12785
12813
|
renderer = this._renderer;
|
|
12786
12814
|
camera = this._camera;
|
|
@@ -12833,6 +12861,7 @@ version: 4.12.1-beta.1
|
|
|
12833
12861
|
sizeChanged: sizeChanged,
|
|
12834
12862
|
element: viewport.element
|
|
12835
12863
|
}));
|
|
12864
|
+
this._isResizing = false;
|
|
12836
12865
|
return [2 /*return*/];
|
|
12837
12866
|
}
|
|
12838
12867
|
});
|
|
@@ -12960,7 +12989,7 @@ version: 4.12.1-beta.1
|
|
|
12960
12989
|
__proto._createCamera = function () {
|
|
12961
12990
|
if (this._circular && this._bound) {
|
|
12962
12991
|
// eslint-disable-next-line no-console
|
|
12963
|
-
console.warn("
|
|
12992
|
+
console.warn('"circular" and "bound" option cannot be used together, ignoring bound.');
|
|
12964
12993
|
}
|
|
12965
12994
|
return new Camera$1(this, {
|
|
12966
12995
|
align: this._align
|
|
@@ -12970,7 +12999,7 @@ version: 4.12.1-beta.1
|
|
|
12970
12999
|
var externalRenderer = this._externalRenderer;
|
|
12971
13000
|
if (this._virtual && this._panelsPerView <= 0) {
|
|
12972
13001
|
// eslint-disable-next-line no-console
|
|
12973
|
-
console.warn("
|
|
13002
|
+
console.warn('"virtual" and "panelsPerView" option should be used together, ignoring virtual.');
|
|
12974
13003
|
}
|
|
12975
13004
|
return externalRenderer ? externalRenderer : this._renderExternal ? this._createExternalRenderer() : this._createVanillaRenderer();
|
|
12976
13005
|
};
|
|
@@ -13052,7 +13081,7 @@ version: 4.12.1-beta.1
|
|
|
13052
13081
|
* Flicking.VERSION; // ex) 4.0.0
|
|
13053
13082
|
* ```
|
|
13054
13083
|
*/
|
|
13055
|
-
Flicking.VERSION = "4.12.
|
|
13084
|
+
Flicking.VERSION = "4.12.2-beta.0";
|
|
13056
13085
|
return Flicking;
|
|
13057
13086
|
}(Component);
|
|
13058
13087
|
|