@egjs/flicking 4.11.1 → 4.11.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 -0
- package/dist/flicking.cjs.js +9 -6
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +9 -6
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +9 -6
- 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 +9 -6
- 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 +4 -0
- package/src/control/StrictControl.ts +4 -4
|
@@ -8,6 +8,7 @@ declare abstract class Control {
|
|
|
8
8
|
protected _flicking: Flicking | null;
|
|
9
9
|
protected _controller: AxesController;
|
|
10
10
|
protected _activePanel: Panel | null;
|
|
11
|
+
protected _nextPanel: Panel | null;
|
|
11
12
|
get controller(): AxesController;
|
|
12
13
|
get activeIndex(): number;
|
|
13
14
|
get activePanel(): Panel;
|
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.
|
|
7
|
+
version: 4.11.2
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -2608,6 +2608,7 @@ var Control = /*#__PURE__*/function () {
|
|
|
2608
2608
|
var _a;
|
|
2609
2609
|
var flicking = getFlickingAttached(this._flicking);
|
|
2610
2610
|
this._activePanel = newActivePanel;
|
|
2611
|
+
this._nextPanel = null;
|
|
2611
2612
|
flicking.camera.updateAdaptiveHeight();
|
|
2612
2613
|
if (newActivePanel !== prevActivePanel) {
|
|
2613
2614
|
flicking.trigger(new Component.ComponentEvent(EVENTS.CHANGED, {
|
|
@@ -2644,6 +2645,7 @@ var Control = /*#__PURE__*/function () {
|
|
|
2644
2645
|
isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
|
|
2645
2646
|
direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
|
|
2646
2647
|
});
|
|
2648
|
+
this._nextPanel = panel;
|
|
2647
2649
|
flicking.trigger(event);
|
|
2648
2650
|
if (event.isCanceled()) {
|
|
2649
2651
|
throw new FlickingError(MESSAGE.STOP_CALLED_BY_USER, CODE.STOP_CALLED_BY_USER);
|
|
@@ -3231,19 +3233,20 @@ var StrictControl = /*#__PURE__*/function (_super) {
|
|
|
3231
3233
|
* @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
|
|
3232
3234
|
*/
|
|
3233
3235
|
__proto.moveToPosition = function (position, duration, axesEvent) {
|
|
3236
|
+
var _a;
|
|
3234
3237
|
var flicking = getFlickingAttached(this._flicking);
|
|
3235
3238
|
var camera = flicking.camera;
|
|
3236
|
-
var
|
|
3239
|
+
var currentPanel = (_a = this._nextPanel) !== null && _a !== void 0 ? _a : this._activePanel;
|
|
3237
3240
|
var axesRange = this._controller.range;
|
|
3238
3241
|
var indexRange = this._indexRange;
|
|
3239
3242
|
var cameraRange = camera.range;
|
|
3240
3243
|
var state = this._controller.state;
|
|
3241
3244
|
var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
|
|
3242
3245
|
var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
|
|
3243
|
-
if (!anchorAtPosition || !
|
|
3246
|
+
if (!anchorAtPosition || !currentPanel) {
|
|
3244
3247
|
return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
|
|
3245
3248
|
}
|
|
3246
|
-
var prevPos =
|
|
3249
|
+
var prevPos = currentPanel.position;
|
|
3247
3250
|
var posDelta = flicking.animating ? state.delta : position - camera.position;
|
|
3248
3251
|
var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
|
|
3249
3252
|
var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
|
|
@@ -3260,7 +3263,7 @@ var StrictControl = /*#__PURE__*/function (_super) {
|
|
|
3260
3263
|
var targetAnchor = position < cameraRange.min ? firstAnchor : lastAnchor;
|
|
3261
3264
|
targetPanel = targetAnchor.panel;
|
|
3262
3265
|
targetPos = targetAnchor.position;
|
|
3263
|
-
} else if (isOverThreshold && anchorAtPosition.position !==
|
|
3266
|
+
} else if (isOverThreshold && anchorAtPosition.position !== currentPanel.position) {
|
|
3264
3267
|
// Move to anchor at position
|
|
3265
3268
|
targetPanel = anchorAtPosition.panel;
|
|
3266
3269
|
targetPos = anchorAtPosition.position;
|
|
@@ -7821,7 +7824,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7821
7824
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7822
7825
|
* ```
|
|
7823
7826
|
*/
|
|
7824
|
-
Flicking.VERSION = "4.11.
|
|
7827
|
+
Flicking.VERSION = "4.11.2";
|
|
7825
7828
|
return Flicking;
|
|
7826
7829
|
}(Component);
|
|
7827
7830
|
|