@egjs/flicking 4.11.3-beta.0 → 4.11.3-beta.2

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.3-beta.0
7
+ version: 4.11.3-beta.2
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -2593,7 +2593,7 @@ var Control = /*#__PURE__*/function () {
2593
2593
  var position;
2594
2594
  return __generator(this, function (_c) {
2595
2595
  position = this._getPosition(panel, direction);
2596
- this._triggerIndexChangeEvent(panel, panel.position, axesEvent);
2596
+ this._triggerIndexChangeEvent(panel, panel.position, axesEvent, direction);
2597
2597
  return [2 /*return*/, this._animateToPosition({
2598
2598
  position: position,
2599
2599
  duration: duration,
@@ -2635,7 +2635,7 @@ var Control = /*#__PURE__*/function () {
2635
2635
  this._activePanel = control._activePanel;
2636
2636
  this._controller = control._controller;
2637
2637
  };
2638
- __proto._triggerIndexChangeEvent = function (panel, position, axesEvent) {
2638
+ __proto._triggerIndexChangeEvent = function (panel, position, axesEvent, direction) {
2639
2639
  var _a;
2640
2640
  var flicking = getFlickingAttached(this._flicking);
2641
2641
  var triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
@@ -2645,7 +2645,7 @@ var Control = /*#__PURE__*/function () {
2645
2645
  index: panel.index,
2646
2646
  panel: panel,
2647
2647
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
2648
- direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
2648
+ direction: direction !== null && direction !== void 0 ? direction : getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
2649
2649
  });
2650
2650
  this._nextPanel = panel;
2651
2651
  flicking.trigger(event);
@@ -2866,7 +2866,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2866
2866
  if (!activeAnchor || !anchorAtCamera) {
2867
2867
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
2868
2868
  }
2869
- var snapThreshold = this._calcSnapThreshold(flicking.threshold, position, activeAnchor);
2869
+ var snapThreshold = this._calcSnapThreshold(position, activeAnchor);
2870
2870
  var posDelta = flicking.animating ? state.delta : position - camera.position;
2871
2871
  var absPosDelta = Math.abs(posDelta);
2872
2872
  var snapDelta = axesEvent && axesEvent.delta[POSITION_KEY] !== 0 ? Math.abs(axesEvent.delta[POSITION_KEY]) : absPosDelta;
@@ -2953,7 +2953,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2953
2953
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
2954
2954
  return adjacentAnchor;
2955
2955
  };
2956
- __proto._calcSnapThreshold = function (threshold, position, activeAnchor) {
2956
+ __proto._calcSnapThreshold = function (position, activeAnchor) {
2957
2957
  var isNextDirection = position > activeAnchor.position;
2958
2958
  var panel = activeAnchor.panel;
2959
2959
  var panelSize = panel.size;
@@ -2964,7 +2964,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2964
2964
  * |<------>|<------------>|
2965
2965
  * [ |<-Anchor ]
2966
2966
  */
2967
- return Math.max(threshold, isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev);
2967
+ return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
2968
2968
  };
2969
2969
  return SnapControl;
2970
2970
  }(Control);
@@ -7826,7 +7826,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7826
7826
  * Flicking.VERSION; // ex) 4.0.0
7827
7827
  * ```
7828
7828
  */
7829
- Flicking.VERSION = "4.11.3-beta.0";
7829
+ Flicking.VERSION = "4.11.3-beta.2";
7830
7830
  return Flicking;
7831
7831
  }(Component);
7832
7832