@egjs/flicking 4.14.1-beta.3 → 4.14.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.14.1-beta.3
7
+ version: 4.14.2-beta.0
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1394,6 +1394,9 @@ version: 4.14.1-beta.3
1394
1394
  * @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트
1395
1395
  */
1396
1396
  var AutoResizer = /*#__PURE__*/function () {
1397
+ /**
1398
+ * @param flicking
1399
+ */
1397
1400
  function AutoResizer(flicking) {
1398
1401
  var _this = this;
1399
1402
  this._onResizeWrapper = function () {
@@ -6937,7 +6940,7 @@ version: 4.14.1-beta.3
6937
6940
  if (!axes) {
6938
6941
  return Promise.reject(new FlickingError(MESSAGE.NOT_ATTACHED_TO_FLICKING, CODE.NOT_ATTACHED_TO_FLICKING));
6939
6942
  }
6940
- var startPos = axes.get([POSITION_KEY])[POSITION_KEY];
6943
+ var startPos = this.getCurrentPosition();
6941
6944
  if (startPos === position) {
6942
6945
  var flicking = getFlickingAttached(this._flicking);
6943
6946
  flicking.camera.lookAt(position);
@@ -6981,6 +6984,14 @@ version: 4.14.1-beta.3
6981
6984
  animate();
6982
6985
  });
6983
6986
  };
6987
+ /**
6988
+ * 현재
6989
+ * @returns
6990
+ */
6991
+ __proto.getCurrentPosition = function () {
6992
+ var _a, _b;
6993
+ return (_b = (_a = this._axes) === null || _a === void 0 ? void 0 : _a.get([POSITION_KEY])[POSITION_KEY]) !== null && _b !== void 0 ? _b : 0;
6994
+ };
6984
6995
  __proto.updateDirection = function () {
6985
6996
  var flicking = getFlickingAttached(this._flicking);
6986
6997
  var axes = this._axes;
@@ -7318,16 +7329,20 @@ version: 4.14.1-beta.3
7318
7329
  newActivePanel = _a.newActivePanel,
7319
7330
  axesEvent = _a.axesEvent;
7320
7331
  return __awaiter(this, void 0, void 0, function () {
7321
- var flicking, animate, state;
7332
+ var flicking, nextDuration, animate, state;
7322
7333
  var _this = this;
7323
7334
  return __generator(this, function (_b) {
7324
7335
  flicking = getFlickingAttached(this._flicking);
7336
+ nextDuration = duration;
7337
+ if (Math.abs(nextDuration - position) < 0.5) {
7338
+ nextDuration = 0;
7339
+ }
7325
7340
  animate = function () {
7326
- return _this._controller.animateTo(position, duration, axesEvent);
7341
+ return _this._controller.animateTo(position, nextDuration, axesEvent);
7327
7342
  };
7328
7343
  state = this._controller.state;
7329
7344
  state.targetPanel = newActivePanel;
7330
- if (duration <= 0) {
7345
+ if (nextDuration <= 0) {
7331
7346
  return [2 /*return*/, animate()];
7332
7347
  } else {
7333
7348
  return [2 /*return*/, animate().then(function () {
@@ -7918,8 +7933,9 @@ version: 4.14.1-beta.3
7918
7933
  var anchors = camera.anchorPoints;
7919
7934
  var firstAnchor = anchors[0];
7920
7935
  var lastAnchor = anchors[anchors.length - 1];
7921
- var shouldBounceToFirst = position <= cameraRange.min && isBetween(firstAnchor.panel.index, indexRange.min, indexRange.max);
7922
- var shouldBounceToLast = position >= cameraRange.max && isBetween(lastAnchor.panel.index, indexRange.min, indexRange.max);
7936
+ // position bounce으로 인하여 범위를 넘어가야 동작하도록 변경
7937
+ var shouldBounceToFirst = position < cameraRange.min && isBetween(firstAnchor.panel.index, indexRange.min, indexRange.max);
7938
+ var shouldBounceToLast = position > cameraRange.max && isBetween(lastAnchor.panel.index, indexRange.min, indexRange.max);
7923
7939
  var isAdjacent = adjacentAnchor && (indexRange.min <= indexRange.max ? isBetween(adjacentAnchor.index, indexRange.min, indexRange.max) : adjacentAnchor.index >= indexRange.min || adjacentAnchor.index <= indexRange.max);
7924
7940
  if (shouldBounceToFirst || shouldBounceToLast) {
7925
7941
  // In bounce area
@@ -13551,7 +13567,7 @@ version: 4.14.1-beta.3
13551
13567
  * Flicking.VERSION; // ex) 4.0.0
13552
13568
  * ```
13553
13569
  */
13554
- Flicking.VERSION = "4.14.1-beta.3";
13570
+ Flicking.VERSION = "4.14.2-beta.0";
13555
13571
  return Flicking;
13556
13572
  }(Component);
13557
13573