@egjs/flicking 4.10.8 → 4.11.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/declaration/Flicking.d.ts +5 -1
- package/declaration/camera/Camera.d.ts +7 -0
- package/declaration/const/external.d.ts +4 -0
- package/declaration/index.cjs.d.ts +3 -0
- package/dist/flicking.cjs.js +8197 -0
- package/dist/flicking.cjs.js.map +1 -0
- package/dist/flicking.esm.js +105 -34
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +105 -33
- 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 +125 -60
- 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 +4 -4
- package/rollup.config.js +6 -0
- package/src/Flicking.ts +22 -1
- package/src/camera/Camera.ts +36 -3
- package/src/const/external.ts +12 -0
- package/src/control/AxesController.ts +4 -2
- package/src/index.cjs.ts +14 -0
- package/src/utils.ts +7 -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.
|
|
7
|
+
version: 4.11.1
|
|
8
8
|
*/
|
|
9
9
|
import Component, { ComponentEvent } from '@egjs/component';
|
|
10
10
|
import Axes, { PanInput } from '@egjs/axes';
|
|
@@ -396,6 +396,17 @@ var CIRCULAR_FALLBACK = {
|
|
|
396
396
|
LINEAR: "linear",
|
|
397
397
|
BOUND: "bound"
|
|
398
398
|
};
|
|
399
|
+
/**
|
|
400
|
+
* 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`)
|
|
401
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성을 구분하기 위한 객체
|
|
402
|
+
* @type {object}
|
|
403
|
+
* @property {string} LTR "ltr"
|
|
404
|
+
* @property {string} RTL "rtl"
|
|
405
|
+
*/
|
|
406
|
+
var ORDER = {
|
|
407
|
+
LTR: "ltr",
|
|
408
|
+
RTL: "rtl"
|
|
409
|
+
};
|
|
399
410
|
|
|
400
411
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
401
412
|
var merge = function (target) {
|
|
@@ -689,20 +700,22 @@ var getElementSize = function (_a) {
|
|
|
689
700
|
useFractionalSize = _a.useFractionalSize,
|
|
690
701
|
useOffset = _a.useOffset,
|
|
691
702
|
style = _a.style;
|
|
703
|
+
var size = 0;
|
|
692
704
|
if (useFractionalSize) {
|
|
693
|
-
var baseSize = parseFloat(horizontal ? style.width : style.height);
|
|
705
|
+
var baseSize = parseFloat(horizontal ? style.width : style.height) || 0;
|
|
694
706
|
var isBorderBoxSizing = style.boxSizing === "border-box";
|
|
695
707
|
var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
|
|
696
708
|
if (isBorderBoxSizing) {
|
|
697
|
-
|
|
709
|
+
size = useOffset ? baseSize : baseSize - border;
|
|
698
710
|
} else {
|
|
699
711
|
var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
|
|
700
|
-
|
|
712
|
+
size = useOffset ? baseSize + padding + border : baseSize + padding;
|
|
701
713
|
}
|
|
702
714
|
} else {
|
|
703
715
|
var sizeStr = horizontal ? "Width" : "Height";
|
|
704
|
-
|
|
716
|
+
size = useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
|
|
705
717
|
}
|
|
718
|
+
return Math.max(size, 0);
|
|
706
719
|
};
|
|
707
720
|
var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
708
721
|
obj.__proto__ = proto;
|
|
@@ -2085,7 +2098,8 @@ var AxesController = /*#__PURE__*/function () {
|
|
|
2085
2098
|
inputType: flicking.inputType,
|
|
2086
2099
|
threshold: 1,
|
|
2087
2100
|
iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
|
|
2088
|
-
|
|
2101
|
+
preventDefaultOnDrag: flicking.preventDefaultOnDrag,
|
|
2102
|
+
scale: flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1],
|
|
2089
2103
|
releaseOnScroll: true
|
|
2090
2104
|
});
|
|
2091
2105
|
var axes = this._axes;
|
|
@@ -2310,7 +2324,7 @@ var AxesController = /*#__PURE__*/function () {
|
|
|
2310
2324
|
var panInput = this._panInput;
|
|
2311
2325
|
axes.disconnect(panInput);
|
|
2312
2326
|
axes.connect(flicking.horizontal ? [POSITION_KEY, ""] : ["", POSITION_KEY], panInput);
|
|
2313
|
-
panInput.options.scale = flicking.horizontal ? [-1, 0] : [0, -1];
|
|
2327
|
+
panInput.options.scale = flicking.horizontal ? [flicking.camera.panelOrder === ORDER.RTL ? 1 : -1, 0] : [0, -1];
|
|
2314
2328
|
};
|
|
2315
2329
|
__proto._resetInternalValues = function () {
|
|
2316
2330
|
this._flicking = null;
|
|
@@ -3982,6 +3996,19 @@ var Camera = /*#__PURE__*/function () {
|
|
|
3982
3996
|
enumerable: false,
|
|
3983
3997
|
configurable: true
|
|
3984
3998
|
});
|
|
3999
|
+
Object.defineProperty(__proto, "panelOrder", {
|
|
4000
|
+
/**
|
|
4001
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element(`.flicking-camera`)
|
|
4002
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성
|
|
4003
|
+
* @type {string}
|
|
4004
|
+
* @readonly
|
|
4005
|
+
*/
|
|
4006
|
+
get: function () {
|
|
4007
|
+
return this._panelOrder;
|
|
4008
|
+
},
|
|
4009
|
+
enumerable: false,
|
|
4010
|
+
configurable: true
|
|
4011
|
+
});
|
|
3985
4012
|
Object.defineProperty(__proto, "align", {
|
|
3986
4013
|
// Options Getter
|
|
3987
4014
|
/**
|
|
@@ -4013,6 +4040,7 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4013
4040
|
this._el = viewportEl.firstElementChild;
|
|
4014
4041
|
this._checkTranslateSupport();
|
|
4015
4042
|
this._updateMode();
|
|
4043
|
+
this.updatePanelOrder();
|
|
4016
4044
|
return this;
|
|
4017
4045
|
};
|
|
4018
4046
|
/**
|
|
@@ -4255,6 +4283,24 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4255
4283
|
this.applyTransform();
|
|
4256
4284
|
return this;
|
|
4257
4285
|
};
|
|
4286
|
+
/**
|
|
4287
|
+
* Update direction to match the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS property applied to the camera element
|
|
4288
|
+
* @ko 카메라 엘리먼트에 적용된 {@link https://developer.mozilla.org/en-US/docs/Web/CSS/direction direction} CSS 속성에 맞게 방향을 업데이트합니다
|
|
4289
|
+
* @return {this}
|
|
4290
|
+
*/
|
|
4291
|
+
__proto.updatePanelOrder = function () {
|
|
4292
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4293
|
+
if (!flicking.horizontal) return this;
|
|
4294
|
+
var el = this._el;
|
|
4295
|
+
var direction = getStyle(el).direction;
|
|
4296
|
+
if (direction !== this._panelOrder) {
|
|
4297
|
+
this._panelOrder = direction === ORDER.RTL ? ORDER.RTL : ORDER.LTR;
|
|
4298
|
+
if (flicking.initialized) {
|
|
4299
|
+
flicking.control.controller.updateDirection();
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
return this;
|
|
4303
|
+
};
|
|
4258
4304
|
/**
|
|
4259
4305
|
* Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
|
|
4260
4306
|
* @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
|
|
@@ -4279,7 +4325,7 @@ var Camera = /*#__PURE__*/function () {
|
|
|
4279
4325
|
var renderer = flicking.renderer;
|
|
4280
4326
|
if (renderer.rendering || !flicking.initialized) return this;
|
|
4281
4327
|
var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
|
|
4282
|
-
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
4328
|
+
el.style[this._transform] = flicking.horizontal ? "translate(" + (this._panelOrder === ORDER.RTL ? actualPosition : -actualPosition) + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
4283
4329
|
return this;
|
|
4284
4330
|
};
|
|
4285
4331
|
__proto._resetInternalValues = function () {
|
|
@@ -5963,30 +6009,32 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
5963
6009
|
iOSEdgeSwipeThreshold = _z === void 0 ? 30 : _z,
|
|
5964
6010
|
_0 = _b.preventClickOnDrag,
|
|
5965
6011
|
preventClickOnDrag = _0 === void 0 ? true : _0,
|
|
5966
|
-
_1 = _b.
|
|
5967
|
-
|
|
5968
|
-
_2 = _b.
|
|
5969
|
-
|
|
5970
|
-
_3 = _b.
|
|
5971
|
-
|
|
5972
|
-
_4 = _b.
|
|
5973
|
-
|
|
5974
|
-
_5 = _b.
|
|
5975
|
-
|
|
5976
|
-
_6 = _b.
|
|
5977
|
-
|
|
5978
|
-
_7 = _b.
|
|
5979
|
-
|
|
5980
|
-
_8 = _b.
|
|
5981
|
-
|
|
5982
|
-
_9 = _b.
|
|
5983
|
-
|
|
5984
|
-
_10 = _b.
|
|
5985
|
-
|
|
5986
|
-
_11 = _b.
|
|
5987
|
-
|
|
5988
|
-
_12 = _b.
|
|
5989
|
-
|
|
6012
|
+
_1 = _b.preventDefaultOnDrag,
|
|
6013
|
+
preventDefaultOnDrag = _1 === void 0 ? false : _1,
|
|
6014
|
+
_2 = _b.disableOnInit,
|
|
6015
|
+
disableOnInit = _2 === void 0 ? false : _2,
|
|
6016
|
+
_3 = _b.changeOnHold,
|
|
6017
|
+
changeOnHold = _3 === void 0 ? false : _3,
|
|
6018
|
+
_4 = _b.renderOnlyVisible,
|
|
6019
|
+
renderOnlyVisible = _4 === void 0 ? false : _4,
|
|
6020
|
+
_5 = _b.virtual,
|
|
6021
|
+
virtual = _5 === void 0 ? null : _5,
|
|
6022
|
+
_6 = _b.autoInit,
|
|
6023
|
+
autoInit = _6 === void 0 ? true : _6,
|
|
6024
|
+
_7 = _b.autoResize,
|
|
6025
|
+
autoResize = _7 === void 0 ? true : _7,
|
|
6026
|
+
_8 = _b.useResizeObserver,
|
|
6027
|
+
useResizeObserver = _8 === void 0 ? true : _8,
|
|
6028
|
+
_9 = _b.resizeDebounce,
|
|
6029
|
+
resizeDebounce = _9 === void 0 ? 0 : _9,
|
|
6030
|
+
_10 = _b.maxResizeDebounce,
|
|
6031
|
+
maxResizeDebounce = _10 === void 0 ? 100 : _10,
|
|
6032
|
+
_11 = _b.useFractionalSize,
|
|
6033
|
+
useFractionalSize = _11 === void 0 ? false : _11,
|
|
6034
|
+
_12 = _b.externalRenderer,
|
|
6035
|
+
externalRenderer = _12 === void 0 ? null : _12,
|
|
6036
|
+
_13 = _b.renderExternal,
|
|
6037
|
+
renderExternal = _13 === void 0 ? null : _13;
|
|
5990
6038
|
var _this = _super.call(this) || this;
|
|
5991
6039
|
// Internal states
|
|
5992
6040
|
_this._initialized = false;
|
|
@@ -6016,6 +6064,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6016
6064
|
_this._bounce = bounce;
|
|
6017
6065
|
_this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
|
|
6018
6066
|
_this._preventClickOnDrag = preventClickOnDrag;
|
|
6067
|
+
_this._preventDefaultOnDrag = preventDefaultOnDrag;
|
|
6019
6068
|
_this._disableOnInit = disableOnInit;
|
|
6020
6069
|
_this._changeOnHold = changeOnHold;
|
|
6021
6070
|
_this._renderOnlyVisible = renderOnlyVisible;
|
|
@@ -6814,6 +6863,27 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6814
6863
|
enumerable: false,
|
|
6815
6864
|
configurable: true
|
|
6816
6865
|
});
|
|
6866
|
+
Object.defineProperty(__proto, "preventDefaultOnDrag", {
|
|
6867
|
+
/**
|
|
6868
|
+
* Whether to use the {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} when the user starts dragging
|
|
6869
|
+
* @ko 사용자가 드래그를 시작할 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} 실행 여부
|
|
6870
|
+
* @type {boolean}
|
|
6871
|
+
* @default false
|
|
6872
|
+
* @see {@link https://naver.github.io/egjs-flicking/Options#preventDefaultOnDrag preventDefaultOnDrag ( Options )}
|
|
6873
|
+
*/
|
|
6874
|
+
get: function () {
|
|
6875
|
+
return this._preventDefaultOnDrag;
|
|
6876
|
+
},
|
|
6877
|
+
set: function (val) {
|
|
6878
|
+
this._preventDefaultOnDrag = val;
|
|
6879
|
+
var panInput = this._control.controller.panInput;
|
|
6880
|
+
if (panInput) {
|
|
6881
|
+
panInput.options.preventDefaultOnDrag = val;
|
|
6882
|
+
}
|
|
6883
|
+
},
|
|
6884
|
+
enumerable: false,
|
|
6885
|
+
configurable: true
|
|
6886
|
+
});
|
|
6817
6887
|
Object.defineProperty(__proto, "disableOnInit", {
|
|
6818
6888
|
/**
|
|
6819
6889
|
* Automatically call {@link Flicking#disableInput disableInput()} on initialization
|
|
@@ -7508,6 +7578,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7508
7578
|
camera.updateRange();
|
|
7509
7579
|
camera.updateAnchors();
|
|
7510
7580
|
camera.updateAdaptiveHeight();
|
|
7581
|
+
camera.updatePanelOrder();
|
|
7511
7582
|
camera.updateOffset();
|
|
7512
7583
|
return [4 /*yield*/, renderer.render()];
|
|
7513
7584
|
case 2:
|
|
@@ -7748,7 +7819,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7748
7819
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7749
7820
|
* ```
|
|
7750
7821
|
*/
|
|
7751
|
-
Flicking.VERSION = "4.
|
|
7822
|
+
Flicking.VERSION = "4.11.1";
|
|
7752
7823
|
return Flicking;
|
|
7753
7824
|
}(Component);
|
|
7754
7825
|
|
|
@@ -7966,5 +8037,5 @@ var parseAlign = function (alignVal) {
|
|
|
7966
8037
|
* egjs projects are licensed under the MIT license
|
|
7967
8038
|
*/
|
|
7968
8039
|
|
|
7969
|
-
export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getElementSize, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
|
|
8040
|
+
export { ALIGN, AnchorPoint, AnimatingState, AxesController, BoundCameraMode, CIRCULAR_FALLBACK, CLASS, Camera, CircularCameraMode, Control, DIRECTION, DisabledState, DraggingState, CODE as ERROR_CODE, EVENTS, ExternalRenderer, FlickingError, FreeControl, HoldingState, IdleState, LinearCameraMode, MOVE_TYPE, NormalRenderingStrategy, ORDER, Panel, Renderer, SnapControl, State, StateMachine, StrictControl, VanillaElementProvider, VanillaRenderer, Viewport, VirtualElementProvider, VirtualManager, VirtualPanel, VirtualRenderingStrategy, checkExistence, circulateIndex, circulatePosition, clamp, Flicking as default, find, findIndex, findRight, getDefaultCameraTransform, getDirection, getElement, getElementSize, getFlickingAttached, getMinusCompensatedIndex, getProgress, getRenderingPanels, getStyle, includes, isBetween, isString, merge, parseAlign$1 as parseAlign, parseArithmeticExpression, parseArithmeticSize, parseBounce, parseCSSSizeValue, parseElement, parsePanelAlign, range, setPrototypeOf, setSize, sync, toArray, withFlickingMethods };
|
|
7970
8041
|
//# sourceMappingURL=flicking.esm.js.map
|