@egjs/flicking 4.10.0 → 4.10.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/AxesController.d.ts +3 -1
- package/declaration/control/Control.d.ts +1 -0
- package/dist/flicking.esm.js +106 -13
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +106 -13
- 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 +106 -13
- 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/Flicking.ts +121 -16
- package/src/camera/Camera.ts +2 -3
- package/src/control/AxesController.ts +24 -4
- package/src/control/Control.ts +9 -0
- package/src/core/panel/Panel.ts +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Axes, { OnRelease } from "@egjs/axes";
|
|
1
|
+
import Axes, { PanInput, OnRelease } from "@egjs/axes";
|
|
2
2
|
import Flicking from "../Flicking";
|
|
3
3
|
import { ControlParams } from "../type/external";
|
|
4
4
|
import StateMachine from "./StateMachine";
|
|
@@ -10,6 +10,7 @@ declare class AxesController {
|
|
|
10
10
|
private _animatingContext;
|
|
11
11
|
private _dragged;
|
|
12
12
|
get axes(): Axes;
|
|
13
|
+
get panInput(): PanInput;
|
|
13
14
|
get stateMachine(): StateMachine;
|
|
14
15
|
get state(): import("./states/State").default;
|
|
15
16
|
get animatingContext(): {
|
|
@@ -34,6 +35,7 @@ declare class AxesController {
|
|
|
34
35
|
addPreventClickHandler(): this;
|
|
35
36
|
removePreventClickHandler(): this;
|
|
36
37
|
animateTo(position: number, duration: number, axesEvent?: OnRelease): Promise<void>;
|
|
38
|
+
updateDirection(): void;
|
|
37
39
|
private _resetInternalValues;
|
|
38
40
|
private _onAxesHold;
|
|
39
41
|
private _onAxesChange;
|
|
@@ -31,6 +31,7 @@ declare abstract class Control {
|
|
|
31
31
|
axesEvent?: OnRelease;
|
|
32
32
|
}): Promise<void>;
|
|
33
33
|
setActive(newActivePanel: Panel, prevActivePanel: Panel | null, isTrusted: boolean): void;
|
|
34
|
+
copy(control: Control): void;
|
|
34
35
|
protected _triggerIndexChangeEvent(panel: Panel, position: number, axesEvent?: OnRelease): void;
|
|
35
36
|
protected _animateToPosition({ position, duration, newActivePanel, axesEvent }: {
|
|
36
37
|
position: number;
|
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.10.
|
|
7
|
+
version: 4.10.2
|
|
8
8
|
*/
|
|
9
9
|
import Component, { ComponentEvent } from '@egjs/component';
|
|
10
10
|
import Axes, { PanInput } from '@egjs/axes';
|
|
@@ -2206,10 +2206,10 @@ function () {
|
|
|
2206
2206
|
var __proto = AxesController.prototype;
|
|
2207
2207
|
Object.defineProperty(__proto, "axes", {
|
|
2208
2208
|
/**
|
|
2209
|
-
* An {@link https://naver.github.io/egjs-axes/
|
|
2210
|
-
* @ko {@link https://naver.github.io/egjs-axes/
|
|
2211
|
-
* @type {Axes}
|
|
2212
|
-
* @see https://naver.github.io/egjs-axes/
|
|
2209
|
+
* An {@link https://naver.github.io/egjs-axes/docs/api/Axes Axes} instance
|
|
2210
|
+
* @ko {@link https://naver.github.io/egjs-axes/docs/api/Axes Axes}의 인스턴스
|
|
2211
|
+
* @type {Axes | null}
|
|
2212
|
+
* @see https://naver.github.io/egjs-axes/docs/api/Axes
|
|
2213
2213
|
* @readonly
|
|
2214
2214
|
*/
|
|
2215
2215
|
get: function () {
|
|
@@ -2218,6 +2218,20 @@ function () {
|
|
|
2218
2218
|
enumerable: false,
|
|
2219
2219
|
configurable: true
|
|
2220
2220
|
});
|
|
2221
|
+
Object.defineProperty(__proto, "panInput", {
|
|
2222
|
+
/**
|
|
2223
|
+
* An {@link https://naver.github.io/egjs-axes/docs/api/PanInput PanInput} instance
|
|
2224
|
+
* @ko {@link https://naver.github.io/egjs-axes/docs/api/PanInput PanInput}의 인스턴스
|
|
2225
|
+
* @type {PanInput | null}
|
|
2226
|
+
* @see https://naver.github.io/egjs-axes/docs/api/PanInput
|
|
2227
|
+
* @readonly
|
|
2228
|
+
*/
|
|
2229
|
+
get: function () {
|
|
2230
|
+
return this._panInput;
|
|
2231
|
+
},
|
|
2232
|
+
enumerable: false,
|
|
2233
|
+
configurable: true
|
|
2234
|
+
});
|
|
2221
2235
|
Object.defineProperty(__proto, "stateMachine", {
|
|
2222
2236
|
/**
|
|
2223
2237
|
* @internal
|
|
@@ -2375,6 +2389,7 @@ function () {
|
|
|
2375
2389
|
});
|
|
2376
2390
|
this._panInput = new PanInput(flicking.viewport.element, {
|
|
2377
2391
|
inputType: flicking.inputType,
|
|
2392
|
+
threshold: 1,
|
|
2378
2393
|
iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
|
|
2379
2394
|
scale: flicking.horizontal ? [-1, 0] : [0, -1],
|
|
2380
2395
|
releaseOnScroll: true
|
|
@@ -2656,6 +2671,15 @@ function () {
|
|
|
2656
2671
|
}
|
|
2657
2672
|
};
|
|
2658
2673
|
|
|
2674
|
+
__proto.updateDirection = function () {
|
|
2675
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2676
|
+
var axes = this._axes;
|
|
2677
|
+
var panInput = this._panInput;
|
|
2678
|
+
axes.disconnect(panInput);
|
|
2679
|
+
axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
|
|
2680
|
+
panInput.options.scale = flicking.horizontal ? [-1, 0] : [0, -1];
|
|
2681
|
+
};
|
|
2682
|
+
|
|
2659
2683
|
__proto._resetInternalValues = function () {
|
|
2660
2684
|
this._flicking = null;
|
|
2661
2685
|
this._axes = null;
|
|
@@ -3002,6 +3026,16 @@ function () {
|
|
|
3002
3026
|
}));
|
|
3003
3027
|
}
|
|
3004
3028
|
};
|
|
3029
|
+
/**
|
|
3030
|
+
* @internal
|
|
3031
|
+
*/
|
|
3032
|
+
|
|
3033
|
+
|
|
3034
|
+
__proto.copy = function (control) {
|
|
3035
|
+
this._flicking = control._flicking;
|
|
3036
|
+
this._activePanel = control._activePanel;
|
|
3037
|
+
this._controller = control._controller;
|
|
3038
|
+
};
|
|
3005
3039
|
|
|
3006
3040
|
__proto._triggerIndexChangeEvent = function (panel, position, axesEvent) {
|
|
3007
3041
|
var _a;
|
|
@@ -4828,13 +4862,9 @@ function () {
|
|
|
4828
4862
|
this._updateMode();
|
|
4829
4863
|
|
|
4830
4864
|
this._range = this._mode.getRange();
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
return panel.updateCircularToggleDirection();
|
|
4835
|
-
});
|
|
4836
|
-
}
|
|
4837
|
-
|
|
4865
|
+
panels.forEach(function (panel) {
|
|
4866
|
+
return panel.updateCircularToggleDirection();
|
|
4867
|
+
});
|
|
4838
4868
|
return this;
|
|
4839
4869
|
};
|
|
4840
4870
|
/**
|
|
@@ -5071,6 +5101,7 @@ function () {
|
|
|
5071
5101
|
this._circularEnabled = canSetCircularMode;
|
|
5072
5102
|
} else {
|
|
5073
5103
|
this._mode = flicking.bound ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
|
|
5104
|
+
this._circularEnabled = false;
|
|
5074
5105
|
}
|
|
5075
5106
|
};
|
|
5076
5107
|
|
|
@@ -6099,6 +6130,8 @@ function () {
|
|
|
6099
6130
|
// Options Setter
|
|
6100
6131
|
set: function (val) {
|
|
6101
6132
|
this._align = val;
|
|
6133
|
+
|
|
6134
|
+
this._updateAlignPos();
|
|
6102
6135
|
},
|
|
6103
6136
|
enumerable: false,
|
|
6104
6137
|
configurable: true
|
|
@@ -6393,6 +6426,7 @@ function () {
|
|
|
6393
6426
|
|
|
6394
6427
|
if (!flicking.circularEnabled) {
|
|
6395
6428
|
this._toggleDirection = DIRECTION.NONE;
|
|
6429
|
+
this._togglePosition = 0;
|
|
6396
6430
|
this._toggled = false;
|
|
6397
6431
|
return this;
|
|
6398
6432
|
}
|
|
@@ -7212,6 +7246,7 @@ function (_super) {
|
|
|
7212
7246
|
this._align = val;
|
|
7213
7247
|
this._renderer.align = val;
|
|
7214
7248
|
this._camera.align = val;
|
|
7249
|
+
void this.resize();
|
|
7215
7250
|
},
|
|
7216
7251
|
enumerable: false,
|
|
7217
7252
|
configurable: true
|
|
@@ -7244,6 +7279,10 @@ function (_super) {
|
|
|
7244
7279
|
},
|
|
7245
7280
|
set: function (val) {
|
|
7246
7281
|
this._horizontal = val;
|
|
7282
|
+
|
|
7283
|
+
this._control.controller.updateDirection();
|
|
7284
|
+
|
|
7285
|
+
void this.resize();
|
|
7247
7286
|
},
|
|
7248
7287
|
enumerable: false,
|
|
7249
7288
|
configurable: true
|
|
@@ -7260,6 +7299,7 @@ function (_super) {
|
|
|
7260
7299
|
},
|
|
7261
7300
|
set: function (val) {
|
|
7262
7301
|
this._circular = val;
|
|
7302
|
+
void this.resize();
|
|
7263
7303
|
},
|
|
7264
7304
|
enumerable: false,
|
|
7265
7305
|
configurable: true
|
|
@@ -7296,6 +7336,7 @@ function (_super) {
|
|
|
7296
7336
|
},
|
|
7297
7337
|
set: function (val) {
|
|
7298
7338
|
this._bound = val;
|
|
7339
|
+
void this.resize();
|
|
7299
7340
|
},
|
|
7300
7341
|
enumerable: false,
|
|
7301
7342
|
configurable: true
|
|
@@ -7312,6 +7353,7 @@ function (_super) {
|
|
|
7312
7353
|
},
|
|
7313
7354
|
set: function (val) {
|
|
7314
7355
|
this._adaptive = val;
|
|
7356
|
+
void this.resize();
|
|
7315
7357
|
},
|
|
7316
7358
|
enumerable: false,
|
|
7317
7359
|
configurable: true
|
|
@@ -7328,6 +7370,7 @@ function (_super) {
|
|
|
7328
7370
|
},
|
|
7329
7371
|
set: function (val) {
|
|
7330
7372
|
this._panelsPerView = val;
|
|
7373
|
+
void this.resize();
|
|
7331
7374
|
},
|
|
7332
7375
|
enumerable: false,
|
|
7333
7376
|
configurable: true
|
|
@@ -7346,6 +7389,7 @@ function (_super) {
|
|
|
7346
7389
|
},
|
|
7347
7390
|
set: function (val) {
|
|
7348
7391
|
this._noPanelStyleOverride = val;
|
|
7392
|
+
void this.resize();
|
|
7349
7393
|
},
|
|
7350
7394
|
enumerable: false,
|
|
7351
7395
|
configurable: true
|
|
@@ -7364,6 +7408,10 @@ function (_super) {
|
|
|
7364
7408
|
},
|
|
7365
7409
|
set: function (val) {
|
|
7366
7410
|
this._resizeOnContentsReady = val;
|
|
7411
|
+
|
|
7412
|
+
if (val) {
|
|
7413
|
+
this._renderer.checkPanelContentsReady(this._renderer.panels);
|
|
7414
|
+
}
|
|
7367
7415
|
},
|
|
7368
7416
|
enumerable: false,
|
|
7369
7417
|
configurable: true
|
|
@@ -7382,6 +7430,11 @@ function (_super) {
|
|
|
7382
7430
|
},
|
|
7383
7431
|
set: function (val) {
|
|
7384
7432
|
this._nested = val;
|
|
7433
|
+
var axes = this._control.controller.axes;
|
|
7434
|
+
|
|
7435
|
+
if (axes) {
|
|
7436
|
+
axes.options.nested = val;
|
|
7437
|
+
}
|
|
7385
7438
|
},
|
|
7386
7439
|
enumerable: false,
|
|
7387
7440
|
configurable: true
|
|
@@ -7436,6 +7489,11 @@ function (_super) {
|
|
|
7436
7489
|
// ANIMATION
|
|
7437
7490
|
set: function (val) {
|
|
7438
7491
|
this._deceleration = val;
|
|
7492
|
+
var axes = this._control.controller.axes;
|
|
7493
|
+
|
|
7494
|
+
if (axes) {
|
|
7495
|
+
axes.options.deceleration = val;
|
|
7496
|
+
}
|
|
7439
7497
|
},
|
|
7440
7498
|
enumerable: false,
|
|
7441
7499
|
configurable: true
|
|
@@ -7453,6 +7511,11 @@ function (_super) {
|
|
|
7453
7511
|
},
|
|
7454
7512
|
set: function (val) {
|
|
7455
7513
|
this._easing = val;
|
|
7514
|
+
var axes = this._control.controller.axes;
|
|
7515
|
+
|
|
7516
|
+
if (axes) {
|
|
7517
|
+
axes.options.easing = val;
|
|
7518
|
+
}
|
|
7456
7519
|
},
|
|
7457
7520
|
enumerable: false,
|
|
7458
7521
|
configurable: true
|
|
@@ -7490,6 +7553,11 @@ function (_super) {
|
|
|
7490
7553
|
// INPUT
|
|
7491
7554
|
set: function (val) {
|
|
7492
7555
|
this._inputType = val;
|
|
7556
|
+
var panInput = this._control.controller.panInput;
|
|
7557
|
+
|
|
7558
|
+
if (panInput) {
|
|
7559
|
+
panInput.options.inputType = val;
|
|
7560
|
+
}
|
|
7493
7561
|
},
|
|
7494
7562
|
enumerable: false,
|
|
7495
7563
|
configurable: true
|
|
@@ -7530,6 +7598,18 @@ function (_super) {
|
|
|
7530
7598
|
},
|
|
7531
7599
|
set: function (val) {
|
|
7532
7600
|
this._moveType = val;
|
|
7601
|
+
var prevControl = this._control;
|
|
7602
|
+
|
|
7603
|
+
var newControl = this._createControl();
|
|
7604
|
+
|
|
7605
|
+
var activePanel = prevControl.activePanel;
|
|
7606
|
+
newControl.copy(prevControl);
|
|
7607
|
+
var prevProgressInPanel = activePanel ? this._camera.getProgressInPanel(activePanel) : 0;
|
|
7608
|
+
this._control = newControl;
|
|
7609
|
+
|
|
7610
|
+
this._control.updatePosition(prevProgressInPanel);
|
|
7611
|
+
|
|
7612
|
+
this._control.updateInput();
|
|
7533
7613
|
},
|
|
7534
7614
|
enumerable: false,
|
|
7535
7615
|
configurable: true
|
|
@@ -7562,6 +7642,11 @@ function (_super) {
|
|
|
7562
7642
|
},
|
|
7563
7643
|
set: function (val) {
|
|
7564
7644
|
this._interruptable = val;
|
|
7645
|
+
var axes = this._control.controller.axes;
|
|
7646
|
+
|
|
7647
|
+
if (axes) {
|
|
7648
|
+
axes.options.interruptable = val;
|
|
7649
|
+
}
|
|
7565
7650
|
},
|
|
7566
7651
|
enumerable: false,
|
|
7567
7652
|
configurable: true
|
|
@@ -7603,6 +7688,8 @@ function (_super) {
|
|
|
7603
7688
|
},
|
|
7604
7689
|
set: function (val) {
|
|
7605
7690
|
this._bounce = val;
|
|
7691
|
+
|
|
7692
|
+
this._control.updateInput();
|
|
7606
7693
|
},
|
|
7607
7694
|
enumerable: false,
|
|
7608
7695
|
configurable: true
|
|
@@ -7619,6 +7706,11 @@ function (_super) {
|
|
|
7619
7706
|
},
|
|
7620
7707
|
set: function (val) {
|
|
7621
7708
|
this._iOSEdgeSwipeThreshold = val;
|
|
7709
|
+
var panInput = this._control.controller.panInput;
|
|
7710
|
+
|
|
7711
|
+
if (panInput) {
|
|
7712
|
+
panInput.options.iOSEdgeSwipeThreshold = val;
|
|
7713
|
+
}
|
|
7622
7714
|
},
|
|
7623
7715
|
enumerable: false,
|
|
7624
7716
|
configurable: true
|
|
@@ -7698,6 +7790,7 @@ function (_super) {
|
|
|
7698
7790
|
// PERFORMANCE
|
|
7699
7791
|
set: function (val) {
|
|
7700
7792
|
this._renderOnlyVisible = val;
|
|
7793
|
+
void this._renderer.render();
|
|
7701
7794
|
},
|
|
7702
7795
|
enumerable: false,
|
|
7703
7796
|
configurable: true
|
|
@@ -8707,7 +8800,7 @@ function (_super) {
|
|
|
8707
8800
|
*/
|
|
8708
8801
|
|
|
8709
8802
|
|
|
8710
|
-
Flicking.VERSION = "4.10.
|
|
8803
|
+
Flicking.VERSION = "4.10.2";
|
|
8711
8804
|
return Flicking;
|
|
8712
8805
|
}(Component);
|
|
8713
8806
|
|