@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.
- package/declaration/control/Control.d.ts +1 -1
- package/dist/flicking.cjs.js +8 -8
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +8 -8
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +8 -8
- 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 +8 -8
- 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 +3 -3
- package/src/control/SnapControl.ts +4 -4
|
@@ -33,7 +33,7 @@ declare abstract class Control {
|
|
|
33
33
|
}): Promise<void>;
|
|
34
34
|
setActive(newActivePanel: Panel, prevActivePanel: Panel | null, isTrusted: boolean): void;
|
|
35
35
|
copy(control: Control): void;
|
|
36
|
-
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease): void;
|
|
36
|
+
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease, direction?: ValueOf<typeof DIRECTION>): void;
|
|
37
37
|
protected _animateToPosition({ position, duration, newActivePanel, axesEvent }: {
|
|
38
38
|
position: number;
|
|
39
39
|
duration: number;
|
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.11.3-beta.
|
|
7
|
+
version: 4.11.3-beta.2
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -2595,7 +2595,7 @@ var Control = /*#__PURE__*/function () {
|
|
|
2595
2595
|
var position;
|
|
2596
2596
|
return __generator(this, function (_c) {
|
|
2597
2597
|
position = this._getPosition(panel, direction);
|
|
2598
|
-
this._triggerIndexChangeEvent(panel, panel.position, axesEvent);
|
|
2598
|
+
this._triggerIndexChangeEvent(panel, panel.position, axesEvent, direction);
|
|
2599
2599
|
return [2 /*return*/, this._animateToPosition({
|
|
2600
2600
|
position: position,
|
|
2601
2601
|
duration: duration,
|
|
@@ -2637,7 +2637,7 @@ var Control = /*#__PURE__*/function () {
|
|
|
2637
2637
|
this._activePanel = control._activePanel;
|
|
2638
2638
|
this._controller = control._controller;
|
|
2639
2639
|
};
|
|
2640
|
-
__proto._triggerIndexChangeEvent = function (panel, position, axesEvent) {
|
|
2640
|
+
__proto._triggerIndexChangeEvent = function (panel, position, axesEvent, direction) {
|
|
2641
2641
|
var _a;
|
|
2642
2642
|
var flicking = getFlickingAttached(this._flicking);
|
|
2643
2643
|
var triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
|
|
@@ -2647,7 +2647,7 @@ var Control = /*#__PURE__*/function () {
|
|
|
2647
2647
|
index: panel.index,
|
|
2648
2648
|
panel: panel,
|
|
2649
2649
|
isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
|
|
2650
|
-
direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
|
|
2650
|
+
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)
|
|
2651
2651
|
});
|
|
2652
2652
|
this._nextPanel = panel;
|
|
2653
2653
|
flicking.trigger(event);
|
|
@@ -2868,7 +2868,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2868
2868
|
if (!activeAnchor || !anchorAtCamera) {
|
|
2869
2869
|
return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
|
|
2870
2870
|
}
|
|
2871
|
-
var snapThreshold = this._calcSnapThreshold(
|
|
2871
|
+
var snapThreshold = this._calcSnapThreshold(position, activeAnchor);
|
|
2872
2872
|
var posDelta = flicking.animating ? state.delta : position - camera.position;
|
|
2873
2873
|
var absPosDelta = Math.abs(posDelta);
|
|
2874
2874
|
var snapDelta = axesEvent && axesEvent.delta[POSITION_KEY] !== 0 ? Math.abs(axesEvent.delta[POSITION_KEY]) : absPosDelta;
|
|
@@ -2955,7 +2955,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2955
2955
|
var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
|
|
2956
2956
|
return adjacentAnchor;
|
|
2957
2957
|
};
|
|
2958
|
-
__proto._calcSnapThreshold = function (
|
|
2958
|
+
__proto._calcSnapThreshold = function (position, activeAnchor) {
|
|
2959
2959
|
var isNextDirection = position > activeAnchor.position;
|
|
2960
2960
|
var panel = activeAnchor.panel;
|
|
2961
2961
|
var panelSize = panel.size;
|
|
@@ -2966,7 +2966,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
|
|
|
2966
2966
|
* |<------>|<------------>|
|
|
2967
2967
|
* [ |<-Anchor ]
|
|
2968
2968
|
*/
|
|
2969
|
-
return
|
|
2969
|
+
return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
|
|
2970
2970
|
};
|
|
2971
2971
|
return SnapControl;
|
|
2972
2972
|
}(Control);
|
|
@@ -7828,7 +7828,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7828
7828
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7829
7829
|
* ```
|
|
7830
7830
|
*/
|
|
7831
|
-
Flicking.VERSION = "4.11.3-beta.
|
|
7831
|
+
Flicking.VERSION = "4.11.3-beta.2";
|
|
7832
7832
|
return Flicking;
|
|
7833
7833
|
}(Component);
|
|
7834
7834
|
|