@egjs/flicking 4.11.5-beta.0 → 4.11.5-beta.1

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.
@@ -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.11.5-beta.0
7
+ version: 4.11.5-beta.1
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1362,6 +1362,10 @@ version: 4.11.5-beta.0
1362
1362
  return Viewport;
1363
1363
  }();
1364
1364
 
1365
+ /**
1366
+ * A component that detects size change and trigger resize method when the autoResize option is used
1367
+ * @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트
1368
+ */
1365
1369
  var AutoResizer = /*#__PURE__*/function () {
1366
1370
  function AutoResizer(flicking) {
1367
1371
  var _this = this;
@@ -1425,7 +1429,7 @@ version: 4.11.5-beta.0
1425
1429
  if (flicking.useResizeObserver && !!window.ResizeObserver) {
1426
1430
  var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
1427
1431
  var resizeObserver_1 = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
1428
- __spread$1([flicking.viewport.element], flicking.camera.element ? [flicking.camera.element] : [], flicking.panels.map(function (panel) {
1432
+ __spread$1([flicking.viewport.element, flicking.camera.element], flicking.panels.map(function (panel) {
1429
1433
  return panel.element;
1430
1434
  })).forEach(function (element) {
1431
1435
  resizeObserver_1.observe(element);
@@ -1449,6 +1453,12 @@ version: 4.11.5-beta.0
1449
1453
  this._enabled = false;
1450
1454
  return this;
1451
1455
  };
1456
+ __proto.observe = function (element) {
1457
+ if (this._resizeObserver) {
1458
+ this._resizeObserver.observe(element);
1459
+ }
1460
+ return this;
1461
+ };
1452
1462
  return AutoResizer;
1453
1463
  }();
1454
1464
 
@@ -9884,8 +9894,10 @@ version: 4.11.5-beta.0
9884
9894
  var activePanel = control.activePanel;
9885
9895
  // Update camera & control
9886
9896
  this._updateCameraAndControl();
9887
- if (flicking.autoResize) {
9888
- flicking.autoResizer.enable();
9897
+ if (flicking.autoResize && flicking.useResizeObserver) {
9898
+ panelsAdded.forEach(function (panel) {
9899
+ flicking.autoResizer.observe(panel.element);
9900
+ });
9889
9901
  }
9890
9902
  void this.render();
9891
9903
  if (!flicking.animating) {
@@ -11303,6 +11315,12 @@ version: 4.11.5-beta.0
11303
11315
  configurable: true
11304
11316
  });
11305
11317
  Object.defineProperty(__proto, "autoResizer", {
11318
+ /**
11319
+ * {@link AutoResizer} instance of the Flicking
11320
+ * @ko 현재 Flicking에 활성화된 {@link AutoResizer} 인스턴스
11321
+ * @internal
11322
+ * @readonly
11323
+ */
11306
11324
  get: function () {
11307
11325
  return this._autoResizer;
11308
11326
  },
@@ -12161,6 +12179,9 @@ version: 4.11.5-beta.0
12161
12179
  // OTHERS
12162
12180
  set: function (val) {
12163
12181
  this._autoResize = val;
12182
+ if (!this._initialized) {
12183
+ return;
12184
+ }
12164
12185
  if (val) {
12165
12186
  this._autoResizer.enable();
12166
12187
  } else {
@@ -12183,7 +12204,7 @@ version: 4.11.5-beta.0
12183
12204
  },
12184
12205
  set: function (val) {
12185
12206
  this._useResizeObserver = val;
12186
- if (this._autoResize) {
12207
+ if (this._initialized && this._autoResize) {
12187
12208
  this._autoResizer.enable();
12188
12209
  }
12189
12210
  },
@@ -12980,7 +13001,7 @@ version: 4.11.5-beta.0
12980
13001
  * Flicking.VERSION; // ex) 4.0.0
12981
13002
  * ```
12982
13003
  */
12983
- Flicking.VERSION = "4.11.5-beta.0";
13004
+ Flicking.VERSION = "4.11.5-beta.1";
12984
13005
  return Flicking;
12985
13006
  }(Component);
12986
13007