@egjs/flicking 4.11.3-beta.0 → 4.11.3-beta.1
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.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/camera/Camera.ts +4 -2
- package/src/control/SnapControl.ts +4 -4
package/dist/flicking.esm.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.11.3-beta.
|
|
7
|
+
version: 4.11.3-beta.1
|
|
8
8
|
*/
|
|
9
9
|
import Component, { ComponentEvent } from '@egjs/component';
|
|
10
10
|
import Axes, { PanInput } from '@egjs/axes';
|
|
@@ -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(
|
|
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 (
|
|
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
|
|
2967
|
+
return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
|
|
2968
2968
|
};
|
|
2969
2969
|
return SnapControl;
|
|
2970
2970
|
}(Control);
|
|
@@ -4169,11 +4169,13 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4169
4169
|
* @return {AnchorPoint | null}
|
|
4170
4170
|
*/
|
|
4171
4171
|
__proto.findActiveAnchor = function () {
|
|
4172
|
+
var _a;
|
|
4172
4173
|
var flicking = getFlickingAttached(this._flicking);
|
|
4173
|
-
var
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4174
|
+
var activePanel = flicking.control.activePanel;
|
|
4175
|
+
if (!activePanel) return null;
|
|
4176
|
+
return (_a = find(this._anchors, function (anchor) {
|
|
4177
|
+
return anchor.panel.index === activePanel.index;
|
|
4178
|
+
})) !== null && _a !== void 0 ? _a : this.findNearestAnchor(activePanel.position);
|
|
4177
4179
|
};
|
|
4178
4180
|
/**
|
|
4179
4181
|
* Clamp the given position between camera's range
|
|
@@ -7826,7 +7828,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7826
7828
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7827
7829
|
* ```
|
|
7828
7830
|
*/
|
|
7829
|
-
Flicking.VERSION = "4.11.3-beta.
|
|
7831
|
+
Flicking.VERSION = "4.11.3-beta.1";
|
|
7830
7832
|
return Flicking;
|
|
7831
7833
|
}(Component);
|
|
7832
7834
|
|