@egjs/flicking 4.11.1 → 4.11.2-beta.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.
@@ -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.1
7
+ version: 4.11.2-beta.0
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -6796,6 +6796,7 @@ version: 4.11.1
6796
6796
  var _a;
6797
6797
  var flicking = getFlickingAttached(this._flicking);
6798
6798
  this._activePanel = newActivePanel;
6799
+ this._nextPanel = null;
6799
6800
  flicking.camera.updateAdaptiveHeight();
6800
6801
  if (newActivePanel !== prevActivePanel) {
6801
6802
  flicking.trigger(new ComponentEvent$1(EVENTS.CHANGED, {
@@ -6832,6 +6833,7 @@ version: 4.11.1
6832
6833
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
6833
6834
  direction: getDirection$1((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
6834
6835
  });
6836
+ this._nextPanel = panel;
6835
6837
  flicking.trigger(event);
6836
6838
  if (event.isCanceled()) {
6837
6839
  throw new FlickingError(MESSAGE.STOP_CALLED_BY_USER, CODE.STOP_CALLED_BY_USER);
@@ -7419,19 +7421,20 @@ version: 4.11.1
7419
7421
  * @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
7420
7422
  */
7421
7423
  __proto.moveToPosition = function (position, duration, axesEvent) {
7424
+ var _a;
7422
7425
  var flicking = getFlickingAttached(this._flicking);
7423
7426
  var camera = flicking.camera;
7424
- var activePanel = this._activePanel;
7427
+ var currentPanel = (_a = this._nextPanel) !== null && _a !== void 0 ? _a : this._activePanel;
7425
7428
  var axesRange = this._controller.range;
7426
7429
  var indexRange = this._indexRange;
7427
7430
  var cameraRange = camera.range;
7428
7431
  var state = this._controller.state;
7429
7432
  var clampedPosition = clamp$1(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
7430
7433
  var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
7431
- if (!anchorAtPosition || !activePanel) {
7434
+ if (!anchorAtPosition || !currentPanel) {
7432
7435
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
7433
7436
  }
7434
- var prevPos = activePanel.position;
7437
+ var prevPos = currentPanel.position;
7435
7438
  var posDelta = flicking.animating ? state.delta : position - camera.position;
7436
7439
  var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
7437
7440
  var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
@@ -7448,7 +7451,7 @@ version: 4.11.1
7448
7451
  var targetAnchor = position < cameraRange.min ? firstAnchor : lastAnchor;
7449
7452
  targetPanel = targetAnchor.panel;
7450
7453
  targetPos = targetAnchor.position;
7451
- } else if (isOverThreshold && anchorAtPosition.position !== activePanel.position) {
7454
+ } else if (isOverThreshold && anchorAtPosition.position !== currentPanel.position) {
7452
7455
  // Move to anchor at position
7453
7456
  targetPanel = anchorAtPosition.panel;
7454
7457
  targetPos = anchorAtPosition.position;
@@ -12927,7 +12930,7 @@ version: 4.11.1
12927
12930
  * Flicking.VERSION; // ex) 4.0.0
12928
12931
  * ```
12929
12932
  */
12930
- Flicking.VERSION = "4.11.1";
12933
+ Flicking.VERSION = "4.11.2-beta.0";
12931
12934
  return Flicking;
12932
12935
  }(Component);
12933
12936