@egjs/flicking 4.12.1-beta.2 → 4.12.1-beta.4
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/declaration/control/Control.d.ts +1 -1
- package/dist/flicking.cjs.js +11 -9
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +11 -9
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +11 -9
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +11 -9
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/control/Control.ts +1 -1
- package/src/control/SnapControl.ts +11 -7
package/dist/flicking.cjs.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.12.1-beta.
|
|
7
|
+
version: 4.12.1-beta.4
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -2917,7 +2917,6 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2917
2917
|
targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
|
|
2918
2918
|
} else if (absPosDelta >= flicking.threshold && absPosDelta > 0 && anchorAtCamera === activeAnchor) {
|
|
2919
2919
|
// Move to the adjacent panel
|
|
2920
|
-
// console.log("moveToPosition anchorAtCamera activeAnchor absPosDelta", camera.position, anchorAtCamera, activeAnchor, absPosDelta, snapThreshold)
|
|
2921
2920
|
targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
|
|
2922
2921
|
} else {
|
|
2923
2922
|
// Fallback to nearest panel from current camera
|
|
@@ -2926,11 +2925,14 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2926
2925
|
axesEvent: axesEvent
|
|
2927
2926
|
});
|
|
2928
2927
|
}
|
|
2929
|
-
|
|
2928
|
+
var nextPanel = targetAnchor.panel;
|
|
2929
|
+
var direction = posDelta === 0 || activeAnchor === targetAnchor ? DIRECTION.NONE : posDelta > 0 ? DIRECTION.NEXT : DIRECTION.PREV;
|
|
2930
|
+
var nextPosition = this._getPosition(nextPanel, direction);
|
|
2931
|
+
this._triggerIndexChangeEvent(nextPanel, position, axesEvent);
|
|
2930
2932
|
return this._animateToPosition({
|
|
2931
|
-
position: camera.clampToReachablePosition(
|
|
2933
|
+
position: camera.clampToReachablePosition(nextPosition),
|
|
2932
2934
|
duration: duration,
|
|
2933
|
-
newActivePanel:
|
|
2935
|
+
newActivePanel: nextPanel,
|
|
2934
2936
|
axesEvent: axesEvent
|
|
2935
2937
|
});
|
|
2936
2938
|
};
|
|
@@ -2940,12 +2942,13 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2940
2942
|
var count = this._count;
|
|
2941
2943
|
var currentPos = camera.position;
|
|
2942
2944
|
var clampedPosition = camera.clampToReachablePosition(position);
|
|
2945
|
+
var nearestAnchor = camera.findNearestAnchor(clampedPosition);
|
|
2943
2946
|
var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
|
|
2944
|
-
if (!anchorAtCamera || !anchorAtPosition) {
|
|
2947
|
+
if (!anchorAtCamera || !anchorAtPosition || !nearestAnchor) {
|
|
2945
2948
|
throw new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE);
|
|
2946
2949
|
}
|
|
2947
2950
|
if (!isFinite(count)) {
|
|
2948
|
-
return
|
|
2951
|
+
return nearestAnchor;
|
|
2949
2952
|
}
|
|
2950
2953
|
var panelCount = flicking.panelCount;
|
|
2951
2954
|
var anchors = camera.anchorPoints;
|
|
@@ -2992,7 +2995,6 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2992
2995
|
return anchorIncludePosition;
|
|
2993
2996
|
}
|
|
2994
2997
|
}
|
|
2995
|
-
// console.log("_findAdjacentAnchor", position, posDelta, anchorAtCamera)
|
|
2996
2998
|
var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
|
|
2997
2999
|
return adjacentAnchor;
|
|
2998
3000
|
};
|
|
@@ -7923,7 +7925,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7923
7925
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7924
7926
|
* ```
|
|
7925
7927
|
*/
|
|
7926
|
-
Flicking.VERSION = "4.12.1-beta.
|
|
7928
|
+
Flicking.VERSION = "4.12.1-beta.4";
|
|
7927
7929
|
return Flicking;
|
|
7928
7930
|
}(Component);
|
|
7929
7931
|
|