@egjs/flicking 4.11.3-beta.1 → 4.11.3-beta.3
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/Flicking.d.ts +240 -240
- package/declaration/camera/Camera.d.ts +82 -89
- package/declaration/camera/index.d.ts +4 -4
- package/declaration/camera/mode/BoundCameraMode.d.ts +13 -13
- package/declaration/camera/mode/CameraMode.d.ts +20 -20
- package/declaration/camera/mode/CircularCameraMode.d.ts +19 -19
- package/declaration/camera/mode/LinearCameraMode.d.ts +9 -9
- package/declaration/camera/mode/index.d.ts +6 -6
- package/declaration/cfc/getDefaultCameraTransform.d.ts +3 -3
- package/declaration/cfc/getRenderingPanels.d.ts +4 -4
- package/declaration/cfc/index.d.ts +5 -5
- package/declaration/cfc/sync.d.ts +4 -4
- package/declaration/cfc/withFlickingMethods.d.ts +2 -2
- package/declaration/const/axes.d.ts +8 -8
- package/declaration/const/error.d.ts +34 -34
- package/declaration/const/external.d.ts +44 -48
- package/declaration/control/AxesController.d.ts +44 -44
- package/declaration/control/Control.d.ts +44 -45
- package/declaration/control/FreeControl.d.ts +14 -14
- package/declaration/control/SnapControl.d.ts +16 -16
- package/declaration/control/StateMachine.d.ts +14 -14
- package/declaration/control/StrictControl.d.ts +20 -20
- package/declaration/control/index.d.ts +14 -14
- package/declaration/control/states/AnimatingState.d.ts +9 -9
- package/declaration/control/states/DisabledState.d.ts +9 -9
- package/declaration/control/states/DraggingState.d.ts +8 -8
- package/declaration/control/states/HoldingState.d.ts +10 -10
- package/declaration/control/states/IdleState.d.ts +9 -9
- package/declaration/control/states/State.d.ts +47 -47
- package/declaration/core/AnchorPoint.d.ts +15 -15
- package/declaration/core/AutoResizer.d.ts +16 -16
- package/declaration/core/FlickingError.d.ts +5 -5
- package/declaration/core/ResizeWatcher.d.ts +33 -33
- package/declaration/core/Viewport.d.ts +25 -25
- package/declaration/core/VirtualManager.d.ts +37 -37
- package/declaration/core/index.d.ts +6 -6
- package/declaration/core/panel/Panel.d.ts +89 -89
- package/declaration/core/panel/VirtualPanel.d.ts +19 -19
- package/declaration/core/panel/index.d.ts +5 -5
- package/declaration/core/panel/provider/ElementProvider.d.ts +8 -8
- package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -12
- package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -15
- package/declaration/core/panel/provider/index.d.ts +5 -5
- package/declaration/index.cjs.d.ts +3 -3
- package/declaration/index.d.ts +13 -13
- package/declaration/index.umd.d.ts +2 -2
- package/declaration/renderer/ExternalRenderer.d.ts +7 -7
- package/declaration/renderer/Renderer.d.ts +59 -59
- package/declaration/renderer/VanillaRenderer.d.ts +10 -10
- package/declaration/renderer/index.d.ts +6 -6
- package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -23
- package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -15
- package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -17
- package/declaration/renderer/strategy/index.d.ts +5 -5
- package/declaration/type/event.d.ts +88 -88
- package/declaration/type/external.d.ts +31 -31
- package/declaration/type/internal.d.ts +13 -13
- package/declaration/utils.d.ts +45 -45
- package/dist/flicking.cjs.js +20 -77
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +21 -76
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +20 -76
- 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 +20 -76
- 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 +6 -0
- package/src/control/Control.ts +3 -3
- package/src/control/SnapControl.ts +4 -4
package/dist/flicking.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.0-snapshot
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
|
|
@@ -12,7 +12,7 @@ version: 4.11.3-beta.1
|
|
|
12
12
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Flicking = factory(global.eg.Component, global.eg.Axes, global.eg.ImReady));
|
|
13
13
|
})(this, (function (Component, Axes, ImReady) { 'use strict';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/*! *****************************************************************************
|
|
16
16
|
Copyright (c) Microsoft Corporation.
|
|
17
17
|
|
|
18
18
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -26,7 +26,7 @@ version: 4.11.3-beta.1
|
|
|
26
26
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
27
27
|
PERFORMANCE OF THIS SOFTWARE.
|
|
28
28
|
***************************************************************************** */
|
|
29
|
-
/* global Reflect, Promise
|
|
29
|
+
/* global Reflect, Promise */
|
|
30
30
|
|
|
31
31
|
var extendStatics = function (d, b) {
|
|
32
32
|
extendStatics = Object.setPrototypeOf || {
|
|
@@ -111,7 +111,7 @@ version: 4.11.3-beta.1
|
|
|
111
111
|
}
|
|
112
112
|
function step(op) {
|
|
113
113
|
if (f) throw new TypeError("Generator is already executing.");
|
|
114
|
-
while (
|
|
114
|
+
while (_) try {
|
|
115
115
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
116
116
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
117
117
|
switch (op[0]) {
|
|
@@ -215,10 +215,6 @@ version: 4.11.3-beta.1
|
|
|
215
215
|
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
216
216
|
return ar;
|
|
217
217
|
}
|
|
218
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
219
|
-
var e = new Error(message);
|
|
220
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
221
|
-
};
|
|
222
218
|
|
|
223
219
|
/*
|
|
224
220
|
* Copyright (c) 2015 NAVER Corp.
|
|
@@ -402,17 +398,6 @@ version: 4.11.3-beta.1
|
|
|
402
398
|
LINEAR: "linear",
|
|
403
399
|
BOUND: "bound"
|
|
404
400
|
};
|
|
405
|
-
/**
|
|
406
|
-
* An object for identifying {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
|
|
407
|
-
* @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성을 구분하기 위한 객체
|
|
408
|
-
* @type {object}
|
|
409
|
-
* @property {string} LTR "ltr"
|
|
410
|
-
* @property {string} RTL "rtl"
|
|
411
|
-
*/
|
|
412
|
-
var ORDER = {
|
|
413
|
-
LTR: "ltr",
|
|
414
|
-
RTL: "rtl"
|
|
415
|
-
};
|
|
416
401
|
|
|
417
402
|
var Constants = {
|
|
418
403
|
__proto__: null,
|
|
@@ -422,7 +407,6 @@ version: 4.11.3-beta.1
|
|
|
422
407
|
MOVE_TYPE: MOVE_TYPE,
|
|
423
408
|
CLASS: CLASS,
|
|
424
409
|
CIRCULAR_FALLBACK: CIRCULAR_FALLBACK,
|
|
425
|
-
ORDER: ORDER,
|
|
426
410
|
ERROR_CODE: CODE
|
|
427
411
|
};
|
|
428
412
|
|
|
@@ -718,22 +702,20 @@ version: 4.11.3-beta.1
|
|
|
718
702
|
useFractionalSize = _a.useFractionalSize,
|
|
719
703
|
useOffset = _a.useOffset,
|
|
720
704
|
style = _a.style;
|
|
721
|
-
var size = 0;
|
|
722
705
|
if (useFractionalSize) {
|
|
723
|
-
var baseSize = parseFloat(horizontal ? style.width : style.height)
|
|
706
|
+
var baseSize = parseFloat(horizontal ? style.width : style.height);
|
|
724
707
|
var isBorderBoxSizing = style.boxSizing === "border-box";
|
|
725
708
|
var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
|
|
726
709
|
if (isBorderBoxSizing) {
|
|
727
|
-
|
|
710
|
+
return useOffset ? baseSize : baseSize - border;
|
|
728
711
|
} else {
|
|
729
712
|
var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
|
|
730
|
-
|
|
713
|
+
return useOffset ? baseSize + padding + border : baseSize + padding;
|
|
731
714
|
}
|
|
732
715
|
} else {
|
|
733
716
|
var sizeStr = horizontal ? "Width" : "Height";
|
|
734
|
-
|
|
717
|
+
return useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
|
|
735
718
|
}
|
|
736
|
-
return Math.max(size, 0);
|
|
737
719
|
};
|
|
738
720
|
var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
739
721
|
obj.__proto__ = proto;
|
|
@@ -2150,7 +2132,7 @@ version: 4.11.3-beta.1
|
|
|
2150
2132
|
threshold: 1,
|
|
2151
2133
|
iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
|
|
2152
2134
|
preventDefaultOnDrag: flicking.preventDefaultOnDrag,
|
|
2153
|
-
scale: flicking.horizontal ? [
|
|
2135
|
+
scale: flicking.horizontal ? [-1, 0] : [0, -1],
|
|
2154
2136
|
releaseOnScroll: true
|
|
2155
2137
|
});
|
|
2156
2138
|
var axes = this._axes;
|
|
@@ -2375,7 +2357,7 @@ version: 4.11.3-beta.1
|
|
|
2375
2357
|
var panInput = this._panInput;
|
|
2376
2358
|
axes.disconnect(panInput);
|
|
2377
2359
|
axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
|
|
2378
|
-
panInput.options.scale = flicking.horizontal ? [
|
|
2360
|
+
panInput.options.scale = flicking.horizontal ? [-1, 0] : [0, -1];
|
|
2379
2361
|
};
|
|
2380
2362
|
__proto._resetInternalValues = function () {
|
|
2381
2363
|
this._flicking = null;
|
|
@@ -2657,7 +2639,6 @@ version: 4.11.3-beta.1
|
|
|
2657
2639
|
var _a;
|
|
2658
2640
|
var flicking = getFlickingAttached(this._flicking);
|
|
2659
2641
|
this._activePanel = newActivePanel;
|
|
2660
|
-
this._nextPanel = null;
|
|
2661
2642
|
flicking.camera.updateAdaptiveHeight();
|
|
2662
2643
|
if (newActivePanel !== prevActivePanel) {
|
|
2663
2644
|
flicking.trigger(new Component.ComponentEvent(EVENTS.CHANGED, {
|
|
@@ -2694,7 +2675,6 @@ version: 4.11.3-beta.1
|
|
|
2694
2675
|
isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
|
|
2695
2676
|
direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
|
|
2696
2677
|
});
|
|
2697
|
-
this._nextPanel = panel;
|
|
2698
2678
|
flicking.trigger(event);
|
|
2699
2679
|
if (event.isCanceled()) {
|
|
2700
2680
|
throw new FlickingError(MESSAGE.STOP_CALLED_BY_USER, CODE.STOP_CALLED_BY_USER);
|
|
@@ -3282,20 +3262,19 @@ version: 4.11.3-beta.1
|
|
|
3282
3262
|
* @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
|
|
3283
3263
|
*/
|
|
3284
3264
|
__proto.moveToPosition = function (position, duration, axesEvent) {
|
|
3285
|
-
var _a;
|
|
3286
3265
|
var flicking = getFlickingAttached(this._flicking);
|
|
3287
3266
|
var camera = flicking.camera;
|
|
3288
|
-
var
|
|
3267
|
+
var activePanel = this._activePanel;
|
|
3289
3268
|
var axesRange = this._controller.range;
|
|
3290
3269
|
var indexRange = this._indexRange;
|
|
3291
3270
|
var cameraRange = camera.range;
|
|
3292
3271
|
var state = this._controller.state;
|
|
3293
3272
|
var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
|
|
3294
3273
|
var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
|
|
3295
|
-
if (!anchorAtPosition || !
|
|
3274
|
+
if (!anchorAtPosition || !activePanel) {
|
|
3296
3275
|
return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
|
|
3297
3276
|
}
|
|
3298
|
-
var prevPos =
|
|
3277
|
+
var prevPos = activePanel.position;
|
|
3299
3278
|
var posDelta = flicking.animating ? state.delta : position - camera.position;
|
|
3300
3279
|
var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
|
|
3301
3280
|
var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
|
|
@@ -3312,7 +3291,7 @@ version: 4.11.3-beta.1
|
|
|
3312
3291
|
var targetAnchor = position < cameraRange.min ? firstAnchor : lastAnchor;
|
|
3313
3292
|
targetPanel = targetAnchor.panel;
|
|
3314
3293
|
targetPos = targetAnchor.position;
|
|
3315
|
-
} else if (isOverThreshold && anchorAtPosition.position !==
|
|
3294
|
+
} else if (isOverThreshold && anchorAtPosition.position !== activePanel.position) {
|
|
3316
3295
|
// Move to anchor at position
|
|
3317
3296
|
targetPanel = anchorAtPosition.panel;
|
|
3318
3297
|
targetPos = anchorAtPosition.position;
|
|
@@ -4071,19 +4050,6 @@ version: 4.11.3-beta.1
|
|
|
4071
4050
|
enumerable: false,
|
|
4072
4051
|
configurable: true
|
|
4073
4052
|
});
|
|
4074
|
-
Object.defineProperty(__proto, "panelOrder", {
|
|
4075
|
-
/**
|
|
4076
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
|
|
4077
|
-
* @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성
|
|
4078
|
-
* @type {string}
|
|
4079
|
-
* @readonly
|
|
4080
|
-
*/
|
|
4081
|
-
get: function () {
|
|
4082
|
-
return this._panelOrder;
|
|
4083
|
-
},
|
|
4084
|
-
enumerable: false,
|
|
4085
|
-
configurable: true
|
|
4086
|
-
});
|
|
4087
4053
|
Object.defineProperty(__proto, "align", {
|
|
4088
4054
|
// Options Getter
|
|
4089
4055
|
/**
|
|
@@ -4115,7 +4081,6 @@ version: 4.11.3-beta.1
|
|
|
4115
4081
|
this._el = viewportEl.firstElementChild;
|
|
4116
4082
|
this._checkTranslateSupport();
|
|
4117
4083
|
this._updateMode();
|
|
4118
|
-
this.updatePanelOrder();
|
|
4119
4084
|
return this;
|
|
4120
4085
|
};
|
|
4121
4086
|
/**
|
|
@@ -4237,13 +4202,11 @@ version: 4.11.3-beta.1
|
|
|
4237
4202
|
* @return {AnchorPoint | null}
|
|
4238
4203
|
*/
|
|
4239
4204
|
__proto.findActiveAnchor = function () {
|
|
4240
|
-
var _a;
|
|
4241
4205
|
var flicking = getFlickingAttached(this._flicking);
|
|
4242
|
-
var
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
})) !== null && _a !== void 0 ? _a : this.findNearestAnchor(activePanel.position);
|
|
4206
|
+
var activeIndex = flicking.control.activeIndex;
|
|
4207
|
+
return find(this._anchors, function (anchor) {
|
|
4208
|
+
return anchor.panel.index === activeIndex;
|
|
4209
|
+
});
|
|
4247
4210
|
};
|
|
4248
4211
|
/**
|
|
4249
4212
|
* Clamp the given position between camera's range
|
|
@@ -4360,24 +4323,6 @@ version: 4.11.3-beta.1
|
|
|
4360
4323
|
this.applyTransform();
|
|
4361
4324
|
return this;
|
|
4362
4325
|
};
|
|
4363
|
-
/**
|
|
4364
|
-
* Update direction to match the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element
|
|
4365
|
-
* @ko 카메라 엘리먼트에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성에 맞게 방향을 업데이트합니다
|
|
4366
|
-
* @return {this}
|
|
4367
|
-
*/
|
|
4368
|
-
__proto.updatePanelOrder = function () {
|
|
4369
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
4370
|
-
if (!flicking.horizontal) return this;
|
|
4371
|
-
var el = this._el;
|
|
4372
|
-
var direction = getStyle(el).direction;
|
|
4373
|
-
if (direction !== this._panelOrder) {
|
|
4374
|
-
this._panelOrder = direction === ORDER.RTL ? ORDER.RTL : ORDER.LTR;
|
|
4375
|
-
if (flicking.initialized) {
|
|
4376
|
-
flicking.control.controller.updateDirection();
|
|
4377
|
-
}
|
|
4378
|
-
}
|
|
4379
|
-
return this;
|
|
4380
|
-
};
|
|
4381
4326
|
/**
|
|
4382
4327
|
* Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
|
|
4383
4328
|
* @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
|
|
@@ -4402,7 +4347,7 @@ version: 4.11.3-beta.1
|
|
|
4402
4347
|
var renderer = flicking.renderer;
|
|
4403
4348
|
if (renderer.rendering || !flicking.initialized) return this;
|
|
4404
4349
|
var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
|
|
4405
|
-
el.style[this._transform] = flicking.horizontal ? "translate(" +
|
|
4350
|
+
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
4406
4351
|
return this;
|
|
4407
4352
|
};
|
|
4408
4353
|
__proto._resetInternalValues = function () {
|
|
@@ -7682,7 +7627,6 @@ version: 4.11.3-beta.1
|
|
|
7682
7627
|
camera.updateRange();
|
|
7683
7628
|
camera.updateAnchors();
|
|
7684
7629
|
camera.updateAdaptiveHeight();
|
|
7685
|
-
camera.updatePanelOrder();
|
|
7686
7630
|
camera.updateOffset();
|
|
7687
7631
|
return [4 /*yield*/, renderer.render()];
|
|
7688
7632
|
case 2:
|
|
@@ -7923,7 +7867,7 @@ version: 4.11.3-beta.1
|
|
|
7923
7867
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7924
7868
|
* ```
|
|
7925
7869
|
*/
|
|
7926
|
-
Flicking.VERSION = "4.11.
|
|
7870
|
+
Flicking.VERSION = "4.11.0-snapshot";
|
|
7927
7871
|
return Flicking;
|
|
7928
7872
|
}(Component);
|
|
7929
7873
|
|