@egjs/flicking 4.7.3 → 4.8.0

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.7.3
7
+ version: 4.8.0
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')) :
@@ -826,7 +826,7 @@ version: 4.7.3
826
826
  * @ko Flicking 내부에서 알려진 오류 발생시 throw되는 에러
827
827
  * @property {number} code Error code<ko>에러 코드</ko>
828
828
  * @property {string} message Error message<ko>에러 메시지</ko>
829
- * @see {@link Constants.ERROR_CODE ERROR_CODE}
829
+ * @see {@link ERROR_CODE ERROR_CODE}
830
830
  * @example
831
831
  * ```ts
832
832
  * import Flicking, { FlickingError, ERROR_CODES } from "@egjs/flicking";
@@ -1985,8 +1985,15 @@ version: 4.7.3
1985
1985
  var flicking = ctx.flicking,
1986
1986
  axesEvent = ctx.axesEvent,
1987
1987
  transitTo = ctx.transitTo;
1988
+ var targetPanel = this._targetPanel;
1989
+ var control = flicking.control;
1988
1990
  this._delta = 0;
1989
1991
  flicking.control.updateInput();
1992
+
1993
+ if (flicking.changeOnHold && targetPanel) {
1994
+ control.setActive(targetPanel, control.activePanel, axesEvent.isTrusted);
1995
+ }
1996
+
1990
1997
  var holdStartEvent = new Component.ComponentEvent(EVENTS.HOLD_START, {
1991
1998
  axesEvent: axesEvent
1992
1999
  });
@@ -3156,7 +3163,7 @@ version: 4.7.3
3156
3163
  var camera = flicking.camera;
3157
3164
  var activeAnchor = camera.findActiveAnchor();
3158
3165
  var anchorAtCamera = camera.findNearestAnchor(camera.position);
3159
- var state = flicking.control.controller.state;
3166
+ var state = this._controller.state;
3160
3167
 
3161
3168
  if (!activeAnchor || !anchorAtCamera) {
3162
3169
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
@@ -3598,6 +3605,7 @@ version: 4.7.3
3598
3605
  var axesRange = this._controller.range;
3599
3606
  var indexRange = this._indexRange;
3600
3607
  var cameraRange = camera.range;
3608
+ var state = this._controller.state;
3601
3609
  var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
3602
3610
  var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
3603
3611
 
@@ -3606,7 +3614,8 @@ version: 4.7.3
3606
3614
  }
3607
3615
 
3608
3616
  var prevPos = activePanel.position;
3609
- var isOverThreshold = Math.abs(position - prevPos) >= flicking.threshold;
3617
+ var posDelta = flicking.animating ? state.delta : position - camera.position;
3618
+ var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
3610
3619
  var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
3611
3620
  var targetPos;
3612
3621
  var targetPanel;
@@ -6755,24 +6764,26 @@ version: 4.7.3
6755
6764
  preventClickOnDrag = _0 === void 0 ? true : _0,
6756
6765
  _1 = _b.disableOnInit,
6757
6766
  disableOnInit = _1 === void 0 ? false : _1,
6758
- _2 = _b.renderOnlyVisible,
6759
- renderOnlyVisible = _2 === void 0 ? false : _2,
6760
- _3 = _b.virtual,
6761
- virtual = _3 === void 0 ? null : _3,
6762
- _4 = _b.autoInit,
6763
- autoInit = _4 === void 0 ? true : _4,
6764
- _5 = _b.autoResize,
6765
- autoResize = _5 === void 0 ? true : _5,
6766
- _6 = _b.useResizeObserver,
6767
- useResizeObserver = _6 === void 0 ? true : _6,
6768
- _7 = _b.resizeDebounce,
6769
- resizeDebounce = _7 === void 0 ? 0 : _7,
6770
- _8 = _b.maxResizeDebounce,
6771
- maxResizeDebounce = _8 === void 0 ? 100 : _8,
6772
- _9 = _b.externalRenderer,
6773
- externalRenderer = _9 === void 0 ? null : _9,
6774
- _10 = _b.renderExternal,
6775
- renderExternal = _10 === void 0 ? null : _10;
6767
+ _2 = _b.changeOnHold,
6768
+ changeOnHold = _2 === void 0 ? false : _2,
6769
+ _3 = _b.renderOnlyVisible,
6770
+ renderOnlyVisible = _3 === void 0 ? false : _3,
6771
+ _4 = _b.virtual,
6772
+ virtual = _4 === void 0 ? null : _4,
6773
+ _5 = _b.autoInit,
6774
+ autoInit = _5 === void 0 ? true : _5,
6775
+ _6 = _b.autoResize,
6776
+ autoResize = _6 === void 0 ? true : _6,
6777
+ _7 = _b.useResizeObserver,
6778
+ useResizeObserver = _7 === void 0 ? true : _7,
6779
+ _8 = _b.resizeDebounce,
6780
+ resizeDebounce = _8 === void 0 ? 0 : _8,
6781
+ _9 = _b.maxResizeDebounce,
6782
+ maxResizeDebounce = _9 === void 0 ? 100 : _9,
6783
+ _10 = _b.externalRenderer,
6784
+ externalRenderer = _10 === void 0 ? null : _10,
6785
+ _11 = _b.renderExternal,
6786
+ renderExternal = _11 === void 0 ? null : _11;
6776
6787
 
6777
6788
  var _this = _super.call(this) || this; // Internal states
6778
6789
 
@@ -6805,6 +6816,7 @@ version: 4.7.3
6805
6816
  _this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
6806
6817
  _this._preventClickOnDrag = preventClickOnDrag;
6807
6818
  _this._disableOnInit = disableOnInit;
6819
+ _this._changeOnHold = changeOnHold;
6808
6820
  _this._renderOnlyVisible = renderOnlyVisible;
6809
6821
  _this._autoInit = autoInit;
6810
6822
  _this._autoResize = autoResize;
@@ -7561,6 +7573,24 @@ version: 4.7.3
7561
7573
  enumerable: false,
7562
7574
  configurable: true
7563
7575
  });
7576
+ Object.defineProperty(__proto, "changeOnHold", {
7577
+ /**
7578
+ * Change active panel index on mouse/touch hold while animating.
7579
+ * `index` of the `willChange`/`willRestore` event will be used as new index.
7580
+ * @ko 애니메이션 도중 마우스/터치 입력시 현재 활성화된 패널의 인덱스를 변경합니다.
7581
+ * `willChange`/`willRestore` 이벤트의 `index`값이 새로운 인덱스로 사용될 것입니다.
7582
+ * @type {boolean}
7583
+ * @default false
7584
+ */
7585
+ get: function () {
7586
+ return this._changeOnHold;
7587
+ },
7588
+ set: function (val) {
7589
+ this._changeOnHold = val;
7590
+ },
7591
+ enumerable: false,
7592
+ configurable: true
7593
+ });
7564
7594
  Object.defineProperty(__proto, "renderOnlyVisible", {
7565
7595
  // PERFORMANCE
7566
7596
 
@@ -8241,6 +8271,8 @@ version: 4.7.3
8241
8271
  camera.updateAlignPos();
8242
8272
  camera.updateRange();
8243
8273
  camera.updateAnchors();
8274
+ camera.updateAdaptiveHeight();
8275
+ camera.updateOffset();
8244
8276
  return [4
8245
8277
  /*yield*/
8246
8278
  , renderer.render()];
@@ -8518,7 +8550,7 @@ version: 4.7.3
8518
8550
  */
8519
8551
 
8520
8552
 
8521
- Flicking.VERSION = "4.7.3";
8553
+ Flicking.VERSION = "4.8.0";
8522
8554
  return Flicking;
8523
8555
  }(Component);
8524
8556