@egjs/flicking 4.10.8 → 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.10.8
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.10.8
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.10.8
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.10.8
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.10.8
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.10.8
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.10.8
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.10.8
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;
@@ -2641,7 +2640,7 @@ version: 4.10.8
2641
2640
  license: MIT
2642
2641
  author: NAVER Corp.
2643
2642
  repository: https://github.com/naver/egjs-axes
2644
- version: 3.8.4
2643
+ version: 3.9.0
2645
2644
  */
2646
2645
 
2647
2646
  /*! *****************************************************************************
@@ -4346,6 +4345,9 @@ version: 4.10.8
4346
4345
  return v + pos[k];
4347
4346
  }), duration);
4348
4347
  };
4348
+ __proto.setOptions = function (options) {
4349
+ this._options = __assign$1(__assign$1({}, this._options), options);
4350
+ };
4349
4351
  __proto._createAnimationParam = function (pos, duration, option) {
4350
4352
  var depaPos = this.axisManager.get();
4351
4353
  var destPos = pos;
@@ -4908,6 +4910,7 @@ version: 4.10.8
4908
4910
  */
4909
4911
  __proto.setOptions = function (options) {
4910
4912
  this.options = __assign$1(__assign$1({}, this.options), options);
4913
+ this.animationManager.setOptions(options);
4911
4914
  return this;
4912
4915
  };
4913
4916
  /**
@@ -5042,7 +5045,7 @@ version: 4.10.8
5042
5045
  * eg.Axes.VERSION; // ex) 3.3.3
5043
5046
  * ```
5044
5047
  */
5045
- Axes.VERSION = "3.8.4";
5048
+ Axes.VERSION = "3.9.0";
5046
5049
  /* eslint-enable */
5047
5050
  /**
5048
5051
  * @name TRANSFORM
@@ -5158,6 +5161,7 @@ version: 4.10.8
5158
5161
  * @param {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>
5159
5162
  * @param {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>
5160
5163
  * @param {Boolean} [preventClickOnDrag=false] Whether to cancel the {@link https://developer.mozilla.org/en/docs/Web/API/Element/click_event click} event when the user finishes dragging more than 1 pixel <ko>사용자가 1픽셀 이상 드래그를 마쳤을 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Element/click_event click} 이벤트 취소 여부</ko>
5164
+ * @param {Boolean} [preventDefaultOnDrag=false] Whether to use the {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} when the user starts dragging <ko>사용자가 드래그를 시작할 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} 실행 여부</ko>
5161
5165
  * @param {Number} [iOSEdgeSwipeThreshold=30] Area (px) that can go to the next page when swiping the right edge in iOS safari <ko>iOS Safari에서 오른쪽 엣지를 스와이프 하는 경우 다음 페이지로 넘어갈 수 있는 영역(px)</ko>
5162
5166
  * @param {String} [touchAction=null] Value that overrides the element's "touch-action" css property. If set to null, it is automatically set to prevent scrolling in the direction of the connected axis. <ko>엘리먼트의 "touch-action" CSS 속성을 덮어쓰는 값. 만약 null로 설정된 경우, 연결된 축 방향으로의 스크롤을 방지하게끔 자동으로 설정된다.</ko>
5163
5167
  **/
@@ -5216,6 +5220,7 @@ version: 4.10.8
5216
5220
  thresholdAngle: 45,
5217
5221
  threshold: 0,
5218
5222
  preventClickOnDrag: false,
5223
+ preventDefaultOnDrag: false,
5219
5224
  iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD,
5220
5225
  releaseOnScroll: false,
5221
5226
  touchAction: null
@@ -5297,7 +5302,8 @@ version: 4.10.8
5297
5302
  __proto._onPanstart = function (event) {
5298
5303
  var _a = this.options,
5299
5304
  inputKey = _a.inputKey,
5300
- inputButton = _a.inputButton;
5305
+ inputButton = _a.inputButton,
5306
+ preventDefaultOnDrag = _a.preventDefaultOnDrag;
5301
5307
  var activeEvent = this._activeEvent;
5302
5308
  var panEvent = activeEvent.onEventStart(event, inputKey, inputButton);
5303
5309
  if (!panEvent || !this._enabled || activeEvent.getTouches(event, inputButton) > 1) {
@@ -5310,6 +5316,7 @@ version: 4.10.8
5310
5316
  this._observer.hold(this, panEvent);
5311
5317
  this._atRightEdge = IS_IOS_SAFARI && panEvent.center.x > window.innerWidth - edgeThreshold;
5312
5318
  this._attachWindowEvent(activeEvent);
5319
+ preventDefaultOnDrag && panEvent.srcEvent.type !== "touchstart" && panEvent.srcEvent.preventDefault();
5313
5320
  activeEvent.prevEvent = panEvent;
5314
5321
  }
5315
5322
  };
@@ -6281,7 +6288,8 @@ version: 4.10.8
6281
6288
  inputType: flicking.inputType,
6282
6289
  threshold: 1,
6283
6290
  iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
6284
- scale: flicking.horizontal ? [-1, 0] : [0, -1],
6291
+ preventDefaultOnDrag: flicking.preventDefaultOnDrag,
6292
+ scale: flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1],
6285
6293
  releaseOnScroll: true
6286
6294
  });
6287
6295
  var axes = this._axes;
@@ -6506,7 +6514,7 @@ version: 4.10.8
6506
6514
  var panInput = this._panInput;
6507
6515
  axes.disconnect(panInput);
6508
6516
  axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
6509
- 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];
6510
6518
  };
6511
6519
  __proto._resetInternalValues = function () {
6512
6520
  this._flicking = null;
@@ -8199,6 +8207,19 @@ version: 4.10.8
8199
8207
  enumerable: false,
8200
8208
  configurable: true
8201
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
+ });
8202
8223
  Object.defineProperty(__proto, "align", {
8203
8224
  // Options Getter
8204
8225
  /**
@@ -8230,6 +8251,7 @@ version: 4.10.8
8230
8251
  this._el = viewportEl.firstElementChild;
8231
8252
  this._checkTranslateSupport();
8232
8253
  this._updateMode();
8254
+ this.updatePanelOrder();
8233
8255
  return this;
8234
8256
  };
8235
8257
  /**
@@ -8472,6 +8494,24 @@ version: 4.10.8
8472
8494
  this.applyTransform();
8473
8495
  return this;
8474
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
+ };
8475
8515
  /**
8476
8516
  * Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
8477
8517
  * @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
@@ -8496,7 +8536,7 @@ version: 4.10.8
8496
8536
  var renderer = flicking.renderer;
8497
8537
  if (renderer.rendering || !flicking.initialized) return this;
8498
8538
  var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
8499
- 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)";
8500
8540
  return this;
8501
8541
  };
8502
8542
  __proto._resetInternalValues = function () {
@@ -11077,30 +11117,32 @@ version: 4.10.8
11077
11117
  iOSEdgeSwipeThreshold = _z === void 0 ? 30 : _z,
11078
11118
  _0 = _b.preventClickOnDrag,
11079
11119
  preventClickOnDrag = _0 === void 0 ? true : _0,
11080
- _1 = _b.disableOnInit,
11081
- disableOnInit = _1 === void 0 ? false : _1,
11082
- _2 = _b.changeOnHold,
11083
- changeOnHold = _2 === void 0 ? false : _2,
11084
- _3 = _b.renderOnlyVisible,
11085
- renderOnlyVisible = _3 === void 0 ? false : _3,
11086
- _4 = _b.virtual,
11087
- virtual = _4 === void 0 ? null : _4,
11088
- _5 = _b.autoInit,
11089
- autoInit = _5 === void 0 ? true : _5,
11090
- _6 = _b.autoResize,
11091
- autoResize = _6 === void 0 ? true : _6,
11092
- _7 = _b.useResizeObserver,
11093
- useResizeObserver = _7 === void 0 ? true : _7,
11094
- _8 = _b.resizeDebounce,
11095
- resizeDebounce = _8 === void 0 ? 0 : _8,
11096
- _9 = _b.maxResizeDebounce,
11097
- maxResizeDebounce = _9 === void 0 ? 100 : _9,
11098
- _10 = _b.useFractionalSize,
11099
- useFractionalSize = _10 === void 0 ? false : _10,
11100
- _11 = _b.externalRenderer,
11101
- externalRenderer = _11 === void 0 ? null : _11,
11102
- _12 = _b.renderExternal,
11103
- renderExternal = _12 === void 0 ? null : _12;
11120
+ _1 = _b.preventDefaultOnDrag,
11121
+ preventDefaultOnDrag = _1 === void 0 ? false : _1,
11122
+ _2 = _b.disableOnInit,
11123
+ disableOnInit = _2 === void 0 ? false : _2,
11124
+ _3 = _b.changeOnHold,
11125
+ changeOnHold = _3 === void 0 ? false : _3,
11126
+ _4 = _b.renderOnlyVisible,
11127
+ renderOnlyVisible = _4 === void 0 ? false : _4,
11128
+ _5 = _b.virtual,
11129
+ virtual = _5 === void 0 ? null : _5,
11130
+ _6 = _b.autoInit,
11131
+ autoInit = _6 === void 0 ? true : _6,
11132
+ _7 = _b.autoResize,
11133
+ autoResize = _7 === void 0 ? true : _7,
11134
+ _8 = _b.useResizeObserver,
11135
+ useResizeObserver = _8 === void 0 ? true : _8,
11136
+ _9 = _b.resizeDebounce,
11137
+ resizeDebounce = _9 === void 0 ? 0 : _9,
11138
+ _10 = _b.maxResizeDebounce,
11139
+ maxResizeDebounce = _10 === void 0 ? 100 : _10,
11140
+ _11 = _b.useFractionalSize,
11141
+ useFractionalSize = _11 === void 0 ? false : _11,
11142
+ _12 = _b.externalRenderer,
11143
+ externalRenderer = _12 === void 0 ? null : _12,
11144
+ _13 = _b.renderExternal,
11145
+ renderExternal = _13 === void 0 ? null : _13;
11104
11146
  var _this = _super.call(this) || this;
11105
11147
  // Internal states
11106
11148
  _this._initialized = false;
@@ -11130,6 +11172,7 @@ version: 4.10.8
11130
11172
  _this._bounce = bounce;
11131
11173
  _this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
11132
11174
  _this._preventClickOnDrag = preventClickOnDrag;
11175
+ _this._preventDefaultOnDrag = preventDefaultOnDrag;
11133
11176
  _this._disableOnInit = disableOnInit;
11134
11177
  _this._changeOnHold = changeOnHold;
11135
11178
  _this._renderOnlyVisible = renderOnlyVisible;
@@ -11928,6 +11971,27 @@ version: 4.10.8
11928
11971
  enumerable: false,
11929
11972
  configurable: true
11930
11973
  });
11974
+ Object.defineProperty(__proto, "preventDefaultOnDrag", {
11975
+ /**
11976
+ * Whether to use the {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} when the user starts dragging
11977
+ * @ko 사용자가 드래그를 시작할 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} 실행 여부
11978
+ * @type {boolean}
11979
+ * @default false
11980
+ * @see {@link https://naver.github.io/egjs-flicking/Options#preventDefaultOnDrag preventDefaultOnDrag ( Options )}
11981
+ */
11982
+ get: function () {
11983
+ return this._preventDefaultOnDrag;
11984
+ },
11985
+ set: function (val) {
11986
+ this._preventDefaultOnDrag = val;
11987
+ var panInput = this._control.controller.panInput;
11988
+ if (panInput) {
11989
+ panInput.options.preventDefaultOnDrag = val;
11990
+ }
11991
+ },
11992
+ enumerable: false,
11993
+ configurable: true
11994
+ });
11931
11995
  Object.defineProperty(__proto, "disableOnInit", {
11932
11996
  /**
11933
11997
  * Automatically call {@link Flicking#disableInput disableInput()} on initialization
@@ -12622,6 +12686,7 @@ version: 4.10.8
12622
12686
  camera.updateRange();
12623
12687
  camera.updateAnchors();
12624
12688
  camera.updateAdaptiveHeight();
12689
+ camera.updatePanelOrder();
12625
12690
  camera.updateOffset();
12626
12691
  return [4 /*yield*/, renderer.render()];
12627
12692
  case 2:
@@ -12862,7 +12927,7 @@ version: 4.10.8
12862
12927
  * Flicking.VERSION; // ex) 4.0.0
12863
12928
  * ```
12864
12929
  */
12865
- Flicking.VERSION = "4.10.8";
12930
+ Flicking.VERSION = "4.11.1";
12866
12931
  return Flicking;
12867
12932
  }(Component);
12868
12933