@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.
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.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(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
@@ -955,6 +955,10 @@ version: 4.11.5-beta.0
955
955
  return Viewport;
956
956
  }();
957
957
 
958
+ /**
959
+ * A component that detects size change and trigger resize method when the autoResize option is used
960
+ * @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트
961
+ */
958
962
  var AutoResizer = /*#__PURE__*/function () {
959
963
  function AutoResizer(flicking) {
960
964
  var _this = this;
@@ -1018,7 +1022,7 @@ version: 4.11.5-beta.0
1018
1022
  if (flicking.useResizeObserver && !!window.ResizeObserver) {
1019
1023
  var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
1020
1024
  var resizeObserver_1 = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
1021
- __spread([flicking.viewport.element], flicking.camera.element ? [flicking.camera.element] : [], flicking.panels.map(function (panel) {
1025
+ __spread([flicking.viewport.element, flicking.camera.element], flicking.panels.map(function (panel) {
1022
1026
  return panel.element;
1023
1027
  })).forEach(function (element) {
1024
1028
  resizeObserver_1.observe(element);
@@ -1042,6 +1046,12 @@ version: 4.11.5-beta.0
1042
1046
  this._enabled = false;
1043
1047
  return this;
1044
1048
  };
1049
+ __proto.observe = function (element) {
1050
+ if (this._resizeObserver) {
1051
+ this._resizeObserver.observe(element);
1052
+ }
1053
+ return this;
1054
+ };
1045
1055
  return AutoResizer;
1046
1056
  }();
1047
1057
 
@@ -4849,8 +4859,10 @@ version: 4.11.5-beta.0
4849
4859
  var activePanel = control.activePanel;
4850
4860
  // Update camera & control
4851
4861
  this._updateCameraAndControl();
4852
- if (flicking.autoResize) {
4853
- flicking.autoResizer.enable();
4862
+ if (flicking.autoResize && flicking.useResizeObserver) {
4863
+ panelsAdded.forEach(function (panel) {
4864
+ flicking.autoResizer.observe(panel.element);
4865
+ });
4854
4866
  }
4855
4867
  void this.render();
4856
4868
  if (!flicking.animating) {
@@ -6268,6 +6280,12 @@ version: 4.11.5-beta.0
6268
6280
  configurable: true
6269
6281
  });
6270
6282
  Object.defineProperty(__proto, "autoResizer", {
6283
+ /**
6284
+ * {@link AutoResizer} instance of the Flicking
6285
+ * @ko 현재 Flicking에 활성화된 {@link AutoResizer} 인스턴스
6286
+ * @internal
6287
+ * @readonly
6288
+ */
6271
6289
  get: function () {
6272
6290
  return this._autoResizer;
6273
6291
  },
@@ -7126,6 +7144,9 @@ version: 4.11.5-beta.0
7126
7144
  // OTHERS
7127
7145
  set: function (val) {
7128
7146
  this._autoResize = val;
7147
+ if (!this._initialized) {
7148
+ return;
7149
+ }
7129
7150
  if (val) {
7130
7151
  this._autoResizer.enable();
7131
7152
  } else {
@@ -7148,7 +7169,7 @@ version: 4.11.5-beta.0
7148
7169
  },
7149
7170
  set: function (val) {
7150
7171
  this._useResizeObserver = val;
7151
- if (this._autoResize) {
7172
+ if (this._initialized && this._autoResize) {
7152
7173
  this._autoResizer.enable();
7153
7174
  }
7154
7175
  },
@@ -7945,7 +7966,7 @@ version: 4.11.5-beta.0
7945
7966
  * Flicking.VERSION; // ex) 4.0.0
7946
7967
  * ```
7947
7968
  */
7948
- Flicking.VERSION = "4.11.5-beta.0";
7969
+ Flicking.VERSION = "4.11.5-beta.1";
7949
7970
  return Flicking;
7950
7971
  }(Component);
7951
7972