@egjs/flicking 4.11.0 → 4.11.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.0
7
+ version: 4.11.1
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -222,7 +222,7 @@ version: 4.11.0
222
222
  license: MIT
223
223
  author: NAVER Corp.
224
224
  repository: https://github.com/naver/egjs-component
225
- version: 3.0.4
225
+ version: 3.0.5
226
226
  */
227
227
  /*! *****************************************************************************
228
228
  Copyright (c) Microsoft Corporation.
@@ -554,7 +554,6 @@ version: 4.11.0
554
554
  * ```
555
555
  */
556
556
  __proto.off = function (eventName, handlerToDetach) {
557
- var e_1, _a;
558
557
  // Detach all event handlers.
559
558
  if (isUndefined(eventName)) {
560
559
  this._eventHandler = {};
@@ -576,28 +575,14 @@ version: 4.11.0
576
575
  // Detach single event handler
577
576
  var handlerList = this._eventHandler[eventName];
578
577
  if (handlerList) {
579
- var idx = 0;
580
- try {
581
- for (var handlerList_1 = __values(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
582
- var handlerFunction = handlerList_1_1.value;
583
- if (handlerFunction === handlerToDetach) {
584
- handlerList.splice(idx, 1);
585
- if (handlerList.length <= 0) {
586
- delete this._eventHandler[eventName];
587
- }
588
- break;
578
+ var length = handlerList.length;
579
+ for (var i = 0; i < length; ++i) {
580
+ if (handlerList[i] === handlerToDetach) {
581
+ handlerList.splice(i, 1);
582
+ if (length <= 1) {
583
+ delete this._eventHandler[eventName];
589
584
  }
590
- idx++;
591
- }
592
- } catch (e_1_1) {
593
- e_1 = {
594
- error: e_1_1
595
- };
596
- } finally {
597
- try {
598
- if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);
599
- } finally {
600
- if (e_1) throw e_1.error;
585
+ break;
601
586
  }
602
587
  }
603
588
  }
@@ -612,7 +597,7 @@ version: 4.11.0
612
597
  * Component.VERSION; // ex) 3.0.0
613
598
  * @memberof Component
614
599
  */
615
- Component.VERSION = "3.0.4";
600
+ Component.VERSION = "3.0.5";
616
601
  return Component;
617
602
  }();
618
603
 
@@ -805,6 +790,17 @@ version: 4.11.0
805
790
  LINEAR: "linear",
806
791
  BOUND: "bound"
807
792
  };
793
+ /**
794
+ * An object for identifying {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
795
+ * @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성을 구분하기 위한 객체
796
+ * @type {object}
797
+ * @property {string} LTR "ltr"
798
+ * @property {string} RTL "rtl"
799
+ */
800
+ var ORDER = {
801
+ LTR: "ltr",
802
+ RTL: "rtl"
803
+ };
808
804
 
809
805
  var Constants = {
810
806
  __proto__: null,
@@ -814,6 +810,7 @@ version: 4.11.0
814
810
  MOVE_TYPE: MOVE_TYPE,
815
811
  CLASS: CLASS,
816
812
  CIRCULAR_FALLBACK: CIRCULAR_FALLBACK,
813
+ ORDER: ORDER,
817
814
  ERROR_CODE: CODE
818
815
  };
819
816
 
@@ -1109,20 +1106,22 @@ version: 4.11.0
1109
1106
  useFractionalSize = _a.useFractionalSize,
1110
1107
  useOffset = _a.useOffset,
1111
1108
  style = _a.style;
1109
+ var size = 0;
1112
1110
  if (useFractionalSize) {
1113
- var baseSize = parseFloat(horizontal ? style.width : style.height);
1111
+ var baseSize = parseFloat(horizontal ? style.width : style.height) || 0;
1114
1112
  var isBorderBoxSizing = style.boxSizing === "border-box";
1115
1113
  var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
1116
1114
  if (isBorderBoxSizing) {
1117
- return useOffset ? baseSize : baseSize - border;
1115
+ size = useOffset ? baseSize : baseSize - border;
1118
1116
  } else {
1119
1117
  var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
1120
- return useOffset ? baseSize + padding + border : baseSize + padding;
1118
+ size = useOffset ? baseSize + padding + border : baseSize + padding;
1121
1119
  }
1122
1120
  } else {
1123
1121
  var sizeStr = horizontal ? "Width" : "Height";
1124
- return useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
1122
+ size = useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
1125
1123
  }
1124
+ return Math.max(size, 0);
1126
1125
  };
1127
1126
  var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
1128
1127
  obj.__proto__ = proto;
@@ -6290,7 +6289,7 @@ version: 4.11.0
6290
6289
  threshold: 1,
6291
6290
  iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
6292
6291
  preventDefaultOnDrag: flicking.preventDefaultOnDrag,
6293
- scale: flicking.horizontal ? [-1, 0] : [0, -1],
6292
+ scale: flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1],
6294
6293
  releaseOnScroll: true
6295
6294
  });
6296
6295
  var axes = this._axes;
@@ -6515,7 +6514,7 @@ version: 4.11.0
6515
6514
  var panInput = this._panInput;
6516
6515
  axes.disconnect(panInput);
6517
6516
  axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
6518
- panInput.options.scale = flicking.horizontal ? [-1, 0] : [0, -1];
6517
+ panInput.options.scale = flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1];
6519
6518
  };
6520
6519
  __proto._resetInternalValues = function () {
6521
6520
  this._flicking = null;
@@ -8208,6 +8207,19 @@ version: 4.11.0
8208
8207
  enumerable: false,
8209
8208
  configurable: true
8210
8209
  });
8210
+ Object.defineProperty(__proto, "panelOrder", {
8211
+ /**
8212
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
8213
+ * @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성
8214
+ * @type {string}
8215
+ * @readonly
8216
+ */
8217
+ get: function () {
8218
+ return this._panelOrder;
8219
+ },
8220
+ enumerable: false,
8221
+ configurable: true
8222
+ });
8211
8223
  Object.defineProperty(__proto, "align", {
8212
8224
  // Options Getter
8213
8225
  /**
@@ -8239,6 +8251,7 @@ version: 4.11.0
8239
8251
  this._el = viewportEl.firstElementChild;
8240
8252
  this._checkTranslateSupport();
8241
8253
  this._updateMode();
8254
+ this.updatePanelOrder();
8242
8255
  return this;
8243
8256
  };
8244
8257
  /**
@@ -8481,6 +8494,24 @@ version: 4.11.0
8481
8494
  this.applyTransform();
8482
8495
  return this;
8483
8496
  };
8497
+ /**
8498
+ * Update direction to match the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element
8499
+ * @ko 카메라 엘리먼트에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성에 맞게 방향을 업데이트합니다
8500
+ * @return {this}
8501
+ */
8502
+ __proto.updatePanelOrder = function () {
8503
+ var flicking = getFlickingAttached(this._flicking);
8504
+ if (!flicking.horizontal) return this;
8505
+ var el = this._el;
8506
+ var direction = getStyle(el).direction;
8507
+ if (direction !== this._panelOrder) {
8508
+ this._panelOrder = direction === ORDER.RTL ? ORDER.RTL : ORDER.LTR;
8509
+ if (flicking.initialized) {
8510
+ flicking.control.controller.updateDirection();
8511
+ }
8512
+ }
8513
+ return this;
8514
+ };
8484
8515
  /**
8485
8516
  * Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
8486
8517
  * @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
@@ -8505,7 +8536,7 @@ version: 4.11.0
8505
8536
  var renderer = flicking.renderer;
8506
8537
  if (renderer.rendering || !flicking.initialized) return this;
8507
8538
  var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
8508
- el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
8539
+ el.style[this._transform] = flicking.horizontal ? "translate(" + (this._panelOrder === ORDER.RTL ? actualPosition : -actualPosition) + "px)" : "translate(0, " + -actualPosition + "px)";
8509
8540
  return this;
8510
8541
  };
8511
8542
  __proto._resetInternalValues = function () {
@@ -12655,6 +12686,7 @@ version: 4.11.0
12655
12686
  camera.updateRange();
12656
12687
  camera.updateAnchors();
12657
12688
  camera.updateAdaptiveHeight();
12689
+ camera.updatePanelOrder();
12658
12690
  camera.updateOffset();
12659
12691
  return [4 /*yield*/, renderer.render()];
12660
12692
  case 2:
@@ -12895,7 +12927,7 @@ version: 4.11.0
12895
12927
  * Flicking.VERSION; // ex) 4.0.0
12896
12928
  * ```
12897
12929
  */
12898
- Flicking.VERSION = "4.11.0";
12930
+ Flicking.VERSION = "4.11.1";
12899
12931
  return Flicking;
12900
12932
  }(Component);
12901
12933