@egjs/flicking 4.2.5 → 4.4.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/README.md +1 -1
- package/declaration/Flicking.d.ts +27 -11
- package/declaration/camera/Camera.d.ts +3 -2
- package/declaration/camera/CircularCamera.d.ts +2 -1
- package/declaration/const/error.d.ts +3 -1
- package/declaration/const/external.d.ts +5 -0
- package/declaration/core/AutoResizer.d.ts +13 -0
- package/declaration/core/VirtualManager.d.ts +37 -0
- package/declaration/core/index.d.ts +2 -1
- package/declaration/core/panel/Panel.d.ts +17 -10
- package/declaration/core/panel/VirtualPanel.d.ts +19 -0
- package/declaration/core/panel/index.d.ts +4 -4
- package/declaration/core/panel/provider/ElementProvider.d.ts +8 -0
- package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -0
- package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -0
- package/declaration/core/panel/provider/index.d.ts +5 -0
- package/declaration/index.d.ts +11 -1
- package/declaration/renderer/ExternalRenderer.d.ts +1 -1
- package/declaration/renderer/Renderer.d.ts +18 -13
- package/declaration/renderer/VanillaRenderer.d.ts +2 -7
- package/declaration/renderer/index.d.ts +1 -0
- package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -0
- package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -0
- package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -0
- package/declaration/renderer/strategy/index.d.ts +5 -0
- package/declaration/utils.d.ts +7 -1
- package/dist/flicking.esm.js +1616 -562
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +1571 -494
- 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 +8733 -6647
- 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 +10 -22
- package/src/Flicking.ts +163 -32
- package/src/camera/BoundCamera.ts +2 -2
- package/src/camera/Camera.ts +49 -26
- package/src/camera/CircularCamera.ts +52 -27
- package/src/camera/LinearCamera.ts +1 -1
- package/src/cfc/sync.ts +2 -2
- package/src/const/error.ts +6 -3
- package/src/const/external.ts +6 -0
- package/src/control/AxesController.ts +15 -8
- package/src/control/Control.ts +7 -7
- package/src/control/FreeControl.ts +2 -2
- package/src/control/SnapControl.ts +3 -3
- package/src/control/StrictControl.ts +2 -2
- package/src/core/AutoResizer.ts +81 -0
- package/src/core/Viewport.ts +4 -4
- package/src/core/VirtualManager.ts +188 -0
- package/src/core/index.ts +3 -1
- package/src/core/panel/Panel.ts +68 -60
- package/src/core/panel/VirtualPanel.ts +110 -0
- package/src/core/panel/index.ts +5 -7
- package/src/core/panel/provider/ElementProvider.ts +14 -0
- package/src/core/panel/provider/VanillaElementProvider.ts +45 -0
- package/src/core/panel/provider/VirtualElementProvider.ts +48 -0
- package/src/core/panel/provider/index.ts +16 -0
- package/src/index.ts +12 -1
- package/src/index.umd.ts +2 -0
- package/src/renderer/ExternalRenderer.ts +7 -7
- package/src/renderer/Renderer.ts +173 -68
- package/src/renderer/VanillaRenderer.ts +28 -86
- package/src/renderer/index.ts +2 -0
- package/src/renderer/strategy/NormalRenderingStrategy.ts +106 -0
- package/src/renderer/strategy/RenderingStrategy.ts +21 -0
- package/src/renderer/strategy/VirtualRenderingStrategy.ts +110 -0
- package/src/renderer/strategy/index.ts +17 -0
- package/src/utils.ts +36 -2
- package/declaration/core/panel/ElementPanel.d.ts +0 -14
- package/declaration/core/panel/ExternalPanel.d.ts +0 -9
- package/declaration/exports.d.ts +0 -10
- package/src/core/panel/ElementPanel.ts +0 -52
- package/src/core/panel/ExternalPanel.ts +0 -32
- package/src/exports.ts +0 -16
package/dist/flicking.js
CHANGED
|
@@ -4,13 +4,13 @@ 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.4.1
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes')) :
|
|
11
|
-
typeof define === 'function' && define.amd ? define(['@egjs/component', '@egjs/axes'], factory) :
|
|
12
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Flicking = factory(global.eg.Component, global.eg.Axes));
|
|
13
|
-
}(this, (function (Component, Axes) { 'use strict';
|
|
10
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
|
|
11
|
+
typeof define === 'function' && define.amd ? define(['@egjs/component', '@egjs/axes', '@egjs/imready'], factory) :
|
|
12
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Flicking = factory(global.eg.Component, global.eg.Axes, global.eg.ImReady));
|
|
13
|
+
})(this, (function (Component, Axes, ImReady) { 'use strict';
|
|
14
14
|
|
|
15
15
|
/*! *****************************************************************************
|
|
16
16
|
Copyright (c) Microsoft Corporation.
|
|
@@ -276,6 +276,7 @@ version: 4.2.5
|
|
|
276
276
|
* <ko>프레임워크(React, Angular, Vue ...)에서 사용 불가능한 메소드를 호출했을 경우</ko>
|
|
277
277
|
* @property {number} NOT_INITIALIZED When the {@link Flicking#init} is not called before but is needed<ko>{@link Flicking#init}의 호출이 필요하나, 아직 호출되지 않았을 경우</ko>
|
|
278
278
|
* @property {number} NO_ACTIVE When there're no active panel that flicking has selected. This may be due to the absence of any panels<ko>현재 Flicking이 선택한 패널이 없을 경우. 일반적으로 패널이 하나도 없는 경우에 발생할 수 있습니다</ko>
|
|
279
|
+
* @property {number} NOT_ALLOWED_IN_VIRTUAL When the non-allowed method is called while the virtual option is enabled<ko>virtual 옵션이 활성화된 상태에서 사용 불가능한 메소드가 호출되었을 경우</ko>
|
|
279
280
|
*/
|
|
280
281
|
var CODE = {
|
|
281
282
|
WRONG_TYPE: 0,
|
|
@@ -291,7 +292,8 @@ version: 4.2.5
|
|
|
291
292
|
ANIMATION_ALREADY_PLAYING: 10,
|
|
292
293
|
NOT_ALLOWED_IN_FRAMEWORK: 11,
|
|
293
294
|
NOT_INITIALIZED: 12,
|
|
294
|
-
NO_ACTIVE: 13
|
|
295
|
+
NO_ACTIVE: 13,
|
|
296
|
+
NOT_ALLOWED_IN_VIRTUAL: 14
|
|
295
297
|
};
|
|
296
298
|
var MESSAGE = {
|
|
297
299
|
WRONG_TYPE: function (wrongVal, correctTypes) {
|
|
@@ -305,9 +307,7 @@ version: 4.2.5
|
|
|
305
307
|
VAL_MUST_NOT_NULL: function (val, name) {
|
|
306
308
|
return name + " should be provided. Given: " + val;
|
|
307
309
|
},
|
|
308
|
-
NOT_ATTACHED_TO_FLICKING:
|
|
309
|
-
return name + " is not attached to the Flicking instance. \"init()\" should be called first.";
|
|
310
|
-
},
|
|
310
|
+
NOT_ATTACHED_TO_FLICKING: "This module is not attached to the Flicking instance. \"init()\" should be called first.",
|
|
311
311
|
WRONG_OPTION: function (optionName, val) {
|
|
312
312
|
return "Option \"" + optionName + "\" is not in correct format, given: " + val;
|
|
313
313
|
},
|
|
@@ -323,7 +323,8 @@ version: 4.2.5
|
|
|
323
323
|
ANIMATION_ALREADY_PLAYING: "Animation is already playing.",
|
|
324
324
|
NOT_ALLOWED_IN_FRAMEWORK: "This behavior is not allowed in the frameworks like React, Vue, or Angular.",
|
|
325
325
|
NOT_INITIALIZED: "Flicking is not initialized yet, call init() first.",
|
|
326
|
-
NO_ACTIVE: "There's no active panel that Flicking has selected. This may be due to the absence of any panels."
|
|
326
|
+
NO_ACTIVE: "There's no active panel that Flicking has selected. This may be due to the absence of any panels.",
|
|
327
|
+
NOT_ALLOWED_IN_VIRTUAL: "This behavior is not allowed when the virtual option is enabled"
|
|
327
328
|
};
|
|
328
329
|
|
|
329
330
|
/*
|
|
@@ -419,6 +420,11 @@ version: 4.2.5
|
|
|
419
420
|
FREE_SCROLL: "freeScroll",
|
|
420
421
|
STRICT: "strict"
|
|
421
422
|
};
|
|
423
|
+
var CLASS = {
|
|
424
|
+
VERTICAL: "vertical",
|
|
425
|
+
HIDDEN: "flicking-hidden",
|
|
426
|
+
DEFAULT_VIRTUAL: "flicking-panel"
|
|
427
|
+
};
|
|
422
428
|
|
|
423
429
|
var Constants = {
|
|
424
430
|
__proto__: null,
|
|
@@ -426,6 +432,7 @@ version: 4.2.5
|
|
|
426
432
|
ALIGN: ALIGN,
|
|
427
433
|
DIRECTION: DIRECTION,
|
|
428
434
|
MOVE_TYPE: MOVE_TYPE,
|
|
435
|
+
CLASS: CLASS,
|
|
429
436
|
ERROR_CODE: CODE
|
|
430
437
|
};
|
|
431
438
|
|
|
@@ -473,9 +480,9 @@ version: 4.2.5
|
|
|
473
480
|
var clamp = function (x, min, max) {
|
|
474
481
|
return Math.max(Math.min(x, max), min);
|
|
475
482
|
};
|
|
476
|
-
var getFlickingAttached = function (val
|
|
483
|
+
var getFlickingAttached = function (val) {
|
|
477
484
|
if (!val) {
|
|
478
|
-
throw new FlickingError(MESSAGE.NOT_ATTACHED_TO_FLICKING
|
|
485
|
+
throw new FlickingError(MESSAGE.NOT_ATTACHED_TO_FLICKING, CODE.NOT_ATTACHED_TO_FLICKING);
|
|
479
486
|
}
|
|
480
487
|
|
|
481
488
|
return val;
|
|
@@ -591,6 +598,12 @@ version: 4.2.5
|
|
|
591
598
|
|
|
592
599
|
return parsed;
|
|
593
600
|
};
|
|
601
|
+
var parseCSSSizeValue = function (val) {
|
|
602
|
+
return isString(val) ? val : val + "px";
|
|
603
|
+
};
|
|
604
|
+
var parsePanelAlign = function (align) {
|
|
605
|
+
return typeof align === "object" ? align.panel : align;
|
|
606
|
+
};
|
|
594
607
|
var getDirection = function (start, end) {
|
|
595
608
|
if (start === end) return DIRECTION.NONE;
|
|
596
609
|
return start < end ? DIRECTION.NEXT : DIRECTION.PREV;
|
|
@@ -684,6 +697,17 @@ version: 4.2.5
|
|
|
684
697
|
|
|
685
698
|
return null;
|
|
686
699
|
};
|
|
700
|
+
var findRight = function (array, checker) {
|
|
701
|
+
for (var idx = array.length - 1; idx >= 0; idx--) {
|
|
702
|
+
var val = array[idx];
|
|
703
|
+
|
|
704
|
+
if (checker(val)) {
|
|
705
|
+
return val;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return null;
|
|
710
|
+
};
|
|
687
711
|
var findIndex = function (array, checker) {
|
|
688
712
|
for (var idx = 0; idx < array.length; idx++) {
|
|
689
713
|
if (checker(array[idx])) {
|
|
@@ -700,6 +724,26 @@ version: 4.2.5
|
|
|
700
724
|
var getStyle = function (el) {
|
|
701
725
|
return window.getComputedStyle(el) || el.currentStyle;
|
|
702
726
|
};
|
|
727
|
+
var setSize = function (el, _a) {
|
|
728
|
+
var width = _a.width,
|
|
729
|
+
height = _a.height;
|
|
730
|
+
|
|
731
|
+
if (width != null) {
|
|
732
|
+
if (isString(width)) {
|
|
733
|
+
el.style.width = width;
|
|
734
|
+
} else {
|
|
735
|
+
el.style.width = width + "px";
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (height != null) {
|
|
740
|
+
if (isString(height)) {
|
|
741
|
+
el.style.height = height;
|
|
742
|
+
} else {
|
|
743
|
+
el.style.height = height + "px";
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
};
|
|
703
747
|
var isBetween = function (val, min, max) {
|
|
704
748
|
return val >= min && val <= max;
|
|
705
749
|
};
|
|
@@ -712,11 +756,52 @@ version: 4.2.5
|
|
|
712
756
|
return index;
|
|
713
757
|
}
|
|
714
758
|
};
|
|
759
|
+
var range = function (end) {
|
|
760
|
+
var arr = new Array(end);
|
|
761
|
+
|
|
762
|
+
for (var i = 0; i < end; i++) {
|
|
763
|
+
arr[i] = i;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
return arr;
|
|
767
|
+
};
|
|
715
768
|
var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
716
769
|
obj.__proto__ = proto;
|
|
717
770
|
return obj;
|
|
718
771
|
};
|
|
719
772
|
|
|
773
|
+
var Utils = {
|
|
774
|
+
__proto__: null,
|
|
775
|
+
merge: merge,
|
|
776
|
+
getElement: getElement,
|
|
777
|
+
checkExistence: checkExistence,
|
|
778
|
+
clamp: clamp,
|
|
779
|
+
getFlickingAttached: getFlickingAttached,
|
|
780
|
+
toArray: toArray,
|
|
781
|
+
parseAlign: parseAlign$1,
|
|
782
|
+
parseBounce: parseBounce,
|
|
783
|
+
parseArithmeticSize: parseArithmeticSize,
|
|
784
|
+
parseArithmeticExpression: parseArithmeticExpression,
|
|
785
|
+
parseCSSSizeValue: parseCSSSizeValue,
|
|
786
|
+
parsePanelAlign: parsePanelAlign,
|
|
787
|
+
getDirection: getDirection,
|
|
788
|
+
parseElement: parseElement,
|
|
789
|
+
getMinusCompensatedIndex: getMinusCompensatedIndex,
|
|
790
|
+
includes: includes,
|
|
791
|
+
isString: isString,
|
|
792
|
+
circulatePosition: circulatePosition,
|
|
793
|
+
find: find,
|
|
794
|
+
findRight: findRight,
|
|
795
|
+
findIndex: findIndex,
|
|
796
|
+
getProgress: getProgress,
|
|
797
|
+
getStyle: getStyle,
|
|
798
|
+
setSize: setSize,
|
|
799
|
+
isBetween: isBetween,
|
|
800
|
+
circulateIndex: circulateIndex,
|
|
801
|
+
range: range,
|
|
802
|
+
setPrototypeOf: setPrototypeOf
|
|
803
|
+
};
|
|
804
|
+
|
|
720
805
|
/*
|
|
721
806
|
* Copyright (c) 2015 NAVER Corp.
|
|
722
807
|
* egjs projects are licensed under the MIT license
|
|
@@ -740,7 +825,9 @@ version: 4.2.5
|
|
|
740
825
|
* ```
|
|
741
826
|
*/
|
|
742
827
|
|
|
743
|
-
var FlickingError =
|
|
828
|
+
var FlickingError =
|
|
829
|
+
/*#__PURE__*/
|
|
830
|
+
function (_super) {
|
|
744
831
|
__extends(FlickingError, _super);
|
|
745
832
|
/**
|
|
746
833
|
* @param message Error message<ko>에러 메시지</ko>
|
|
@@ -769,7 +856,9 @@ version: 4.2.5
|
|
|
769
856
|
* @ko 뷰포트 크기 정보를 담당하는 컴포넌트
|
|
770
857
|
*/
|
|
771
858
|
|
|
772
|
-
var Viewport =
|
|
859
|
+
var Viewport =
|
|
860
|
+
/*#__PURE__*/
|
|
861
|
+
function () {
|
|
773
862
|
/**
|
|
774
863
|
* @param el A viewport element<ko>뷰포트 엘리먼트</ko>
|
|
775
864
|
*/
|
|
@@ -892,10 +981,10 @@ version: 4.2.5
|
|
|
892
981
|
this._width = el.clientWidth;
|
|
893
982
|
this._height = el.clientHeight;
|
|
894
983
|
this._padding = {
|
|
895
|
-
left: parseFloat(elStyle.paddingLeft),
|
|
896
|
-
right: parseFloat(elStyle.paddingRight),
|
|
897
|
-
top: parseFloat(elStyle.paddingTop),
|
|
898
|
-
bottom: parseFloat(elStyle.paddingBottom)
|
|
984
|
+
left: elStyle.paddingLeft ? parseFloat(elStyle.paddingLeft) : 0,
|
|
985
|
+
right: elStyle.paddingRight ? parseFloat(elStyle.paddingRight) : 0,
|
|
986
|
+
top: elStyle.paddingTop ? parseFloat(elStyle.paddingTop) : 0,
|
|
987
|
+
bottom: elStyle.paddingBottom ? parseFloat(elStyle.paddingBottom) : 0
|
|
899
988
|
};
|
|
900
989
|
this._isBorderBoxSizing = elStyle.boxSizing === "border-box";
|
|
901
990
|
};
|
|
@@ -903,6 +992,412 @@ version: 4.2.5
|
|
|
903
992
|
return Viewport;
|
|
904
993
|
}();
|
|
905
994
|
|
|
995
|
+
var AutoResizer =
|
|
996
|
+
/*#__PURE__*/
|
|
997
|
+
function () {
|
|
998
|
+
function AutoResizer(flicking) {
|
|
999
|
+
var _this = this;
|
|
1000
|
+
|
|
1001
|
+
this._onResize = function () {
|
|
1002
|
+
void _this._flicking.resize();
|
|
1003
|
+
}; // eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
this._skipFirstResize = function () {
|
|
1007
|
+
var isFirstResize = true;
|
|
1008
|
+
return function () {
|
|
1009
|
+
if (isFirstResize) {
|
|
1010
|
+
isFirstResize = false;
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
_this._onResize();
|
|
1015
|
+
};
|
|
1016
|
+
}();
|
|
1017
|
+
|
|
1018
|
+
this._flicking = flicking;
|
|
1019
|
+
this._enabled = false;
|
|
1020
|
+
this._resizeObserver = null;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
var __proto = AutoResizer.prototype;
|
|
1024
|
+
Object.defineProperty(__proto, "enabled", {
|
|
1025
|
+
get: function () {
|
|
1026
|
+
return this._enabled;
|
|
1027
|
+
},
|
|
1028
|
+
enumerable: false,
|
|
1029
|
+
configurable: true
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
__proto.enable = function () {
|
|
1033
|
+
var flicking = this._flicking;
|
|
1034
|
+
var viewport = flicking.viewport;
|
|
1035
|
+
|
|
1036
|
+
if (this._enabled) {
|
|
1037
|
+
this.disable();
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
1041
|
+
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
1042
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
|
|
1043
|
+
resizeObserver.observe(flicking.viewport.element);
|
|
1044
|
+
this._resizeObserver = resizeObserver;
|
|
1045
|
+
} else {
|
|
1046
|
+
window.addEventListener("resize", this._onResize);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
this._enabled = true;
|
|
1050
|
+
return this;
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
__proto.disable = function () {
|
|
1054
|
+
if (!this._enabled) return this;
|
|
1055
|
+
var resizeObserver = this._resizeObserver;
|
|
1056
|
+
|
|
1057
|
+
if (resizeObserver) {
|
|
1058
|
+
resizeObserver.disconnect();
|
|
1059
|
+
this._resizeObserver = null;
|
|
1060
|
+
} else {
|
|
1061
|
+
window.removeEventListener("resize", this._onResize);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
this._enabled = false;
|
|
1065
|
+
return this;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
return AutoResizer;
|
|
1069
|
+
}();
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* @internal
|
|
1073
|
+
*/
|
|
1074
|
+
var VanillaElementProvider =
|
|
1075
|
+
/*#__PURE__*/
|
|
1076
|
+
function () {
|
|
1077
|
+
function VanillaElementProvider(element) {
|
|
1078
|
+
this._element = element;
|
|
1079
|
+
this._rendered = true;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
var __proto = VanillaElementProvider.prototype;
|
|
1083
|
+
Object.defineProperty(__proto, "element", {
|
|
1084
|
+
get: function () {
|
|
1085
|
+
return this._element;
|
|
1086
|
+
},
|
|
1087
|
+
enumerable: false,
|
|
1088
|
+
configurable: true
|
|
1089
|
+
});
|
|
1090
|
+
Object.defineProperty(__proto, "rendered", {
|
|
1091
|
+
get: function () {
|
|
1092
|
+
return this._rendered;
|
|
1093
|
+
},
|
|
1094
|
+
enumerable: false,
|
|
1095
|
+
configurable: true
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
__proto.show = function (flicking) {
|
|
1099
|
+
var el = this.element;
|
|
1100
|
+
var cameraEl = flicking.camera.element;
|
|
1101
|
+
|
|
1102
|
+
if (el.parentElement !== cameraEl) {
|
|
1103
|
+
cameraEl.appendChild(el);
|
|
1104
|
+
this._rendered = true;
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
__proto.hide = function (flicking) {
|
|
1109
|
+
var el = this.element;
|
|
1110
|
+
var cameraEl = flicking.camera.element;
|
|
1111
|
+
|
|
1112
|
+
if (el.parentElement === cameraEl) {
|
|
1113
|
+
cameraEl.removeChild(el);
|
|
1114
|
+
this._rendered = false;
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
return VanillaElementProvider;
|
|
1119
|
+
}();
|
|
1120
|
+
|
|
1121
|
+
/*
|
|
1122
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
1123
|
+
* egjs projects are licensed under the MIT license
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* @internal
|
|
1128
|
+
*/
|
|
1129
|
+
var VirtualElementProvider =
|
|
1130
|
+
/*#__PURE__*/
|
|
1131
|
+
function () {
|
|
1132
|
+
function VirtualElementProvider(flicking) {
|
|
1133
|
+
this._flicking = flicking;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
var __proto = VirtualElementProvider.prototype;
|
|
1137
|
+
Object.defineProperty(__proto, "element", {
|
|
1138
|
+
get: function () {
|
|
1139
|
+
return this._virtualElement.nativeElement;
|
|
1140
|
+
},
|
|
1141
|
+
enumerable: false,
|
|
1142
|
+
configurable: true
|
|
1143
|
+
});
|
|
1144
|
+
Object.defineProperty(__proto, "rendered", {
|
|
1145
|
+
get: function () {
|
|
1146
|
+
return this._virtualElement.visible;
|
|
1147
|
+
},
|
|
1148
|
+
enumerable: false,
|
|
1149
|
+
configurable: true
|
|
1150
|
+
});
|
|
1151
|
+
Object.defineProperty(__proto, "_virtualElement", {
|
|
1152
|
+
get: function () {
|
|
1153
|
+
var flicking = this._flicking;
|
|
1154
|
+
var elIndex = this._panel.elementIndex;
|
|
1155
|
+
var virtualElements = flicking.virtual.elements;
|
|
1156
|
+
return virtualElements[elIndex];
|
|
1157
|
+
},
|
|
1158
|
+
enumerable: false,
|
|
1159
|
+
configurable: true
|
|
1160
|
+
});
|
|
1161
|
+
|
|
1162
|
+
__proto.init = function (panel) {
|
|
1163
|
+
this._panel = panel;
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
__proto.show = function () {// DO_NOTHING
|
|
1167
|
+
// Actual element visibility is controlled by VirtualManager
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
__proto.hide = function () {// DO_NOTHING
|
|
1171
|
+
// Actual element visibility is controlled by VirtualManager
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
return VirtualElementProvider;
|
|
1175
|
+
}();
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* A manager class to add / remove virtual panels
|
|
1179
|
+
*/
|
|
1180
|
+
|
|
1181
|
+
var VirtualManager =
|
|
1182
|
+
/*#__PURE__*/
|
|
1183
|
+
function () {
|
|
1184
|
+
function VirtualManager(flicking, options) {
|
|
1185
|
+
var _a, _b, _c, _d;
|
|
1186
|
+
|
|
1187
|
+
this._flicking = flicking;
|
|
1188
|
+
this._renderPanel = (_a = options === null || options === void 0 ? void 0 : options.renderPanel) !== null && _a !== void 0 ? _a : function () {
|
|
1189
|
+
return "";
|
|
1190
|
+
};
|
|
1191
|
+
this._initialPanelCount = (_b = options === null || options === void 0 ? void 0 : options.initialPanelCount) !== null && _b !== void 0 ? _b : -1;
|
|
1192
|
+
this._cache = (_c = options === null || options === void 0 ? void 0 : options.cache) !== null && _c !== void 0 ? _c : false;
|
|
1193
|
+
this._panelClass = (_d = options === null || options === void 0 ? void 0 : options.panelClass) !== null && _d !== void 0 ? _d : CLASS.DEFAULT_VIRTUAL;
|
|
1194
|
+
this._elements = [];
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
var __proto = VirtualManager.prototype;
|
|
1198
|
+
Object.defineProperty(__proto, "elements", {
|
|
1199
|
+
get: function () {
|
|
1200
|
+
return this._elements;
|
|
1201
|
+
},
|
|
1202
|
+
enumerable: false,
|
|
1203
|
+
configurable: true
|
|
1204
|
+
});
|
|
1205
|
+
Object.defineProperty(__proto, "renderPanel", {
|
|
1206
|
+
// Options
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* A rendering function for the panel element's innerHTML
|
|
1210
|
+
* @ko 패널 엘리먼트의 innerHTML을 렌더링하는 함수
|
|
1211
|
+
* @type {function}
|
|
1212
|
+
* @param {VirtualPanel} panel Instance of the panel<ko>패널 인스턴스</ko>
|
|
1213
|
+
* @param {number} index Index of the panel<ko>패널 인덱스</ko>
|
|
1214
|
+
* @default "() => {}"
|
|
1215
|
+
*/
|
|
1216
|
+
get: function () {
|
|
1217
|
+
return this._renderPanel;
|
|
1218
|
+
},
|
|
1219
|
+
set: function (val) {
|
|
1220
|
+
this._renderPanel = val;
|
|
1221
|
+
|
|
1222
|
+
this._flicking.renderer.panels.forEach(function (panel) {
|
|
1223
|
+
return panel.uncacheRenderResult();
|
|
1224
|
+
});
|
|
1225
|
+
},
|
|
1226
|
+
enumerable: false,
|
|
1227
|
+
configurable: true
|
|
1228
|
+
});
|
|
1229
|
+
Object.defineProperty(__proto, "initialPanelCount", {
|
|
1230
|
+
/**
|
|
1231
|
+
* Initial panel count to render
|
|
1232
|
+
* @ko 최초로 렌더링할 패널의 개수
|
|
1233
|
+
* @readonly
|
|
1234
|
+
* @type {number}
|
|
1235
|
+
* @default -1
|
|
1236
|
+
*/
|
|
1237
|
+
get: function () {
|
|
1238
|
+
return this._initialPanelCount;
|
|
1239
|
+
},
|
|
1240
|
+
enumerable: false,
|
|
1241
|
+
configurable: true
|
|
1242
|
+
});
|
|
1243
|
+
Object.defineProperty(__proto, "cache", {
|
|
1244
|
+
/**
|
|
1245
|
+
* Whether to cache rendered panel's innerHTML
|
|
1246
|
+
* @ko 렌더링된 패널의 innerHTML 정보를 캐시할지 여부
|
|
1247
|
+
* @type {boolean}
|
|
1248
|
+
* @default false
|
|
1249
|
+
*/
|
|
1250
|
+
get: function () {
|
|
1251
|
+
return this._cache;
|
|
1252
|
+
},
|
|
1253
|
+
set: function (val) {
|
|
1254
|
+
this._cache = val;
|
|
1255
|
+
},
|
|
1256
|
+
enumerable: false,
|
|
1257
|
+
configurable: true
|
|
1258
|
+
});
|
|
1259
|
+
Object.defineProperty(__proto, "panelClass", {
|
|
1260
|
+
/**
|
|
1261
|
+
* The class name that will be applied to rendered panel elements
|
|
1262
|
+
* @ko 렌더링되는 패널 엘리먼트에 적용될 클래스 이름
|
|
1263
|
+
* @type {string}
|
|
1264
|
+
* @default "flicking-panel"
|
|
1265
|
+
*/
|
|
1266
|
+
get: function () {
|
|
1267
|
+
return this._panelClass;
|
|
1268
|
+
},
|
|
1269
|
+
set: function (val) {
|
|
1270
|
+
this._panelClass = val;
|
|
1271
|
+
},
|
|
1272
|
+
enumerable: false,
|
|
1273
|
+
configurable: true
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
__proto.init = function () {
|
|
1277
|
+
var flicking = this._flicking;
|
|
1278
|
+
if (!flicking.virtualEnabled) return;
|
|
1279
|
+
|
|
1280
|
+
if (!flicking.externalRenderer && !flicking.renderExternal) {
|
|
1281
|
+
this._initVirtualElements();
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
var virtualElements = flicking.camera.children;
|
|
1285
|
+
this._elements = virtualElements.map(function (el) {
|
|
1286
|
+
return {
|
|
1287
|
+
nativeElement: el,
|
|
1288
|
+
visible: true
|
|
1289
|
+
};
|
|
1290
|
+
});
|
|
1291
|
+
};
|
|
1292
|
+
|
|
1293
|
+
__proto.show = function (index) {
|
|
1294
|
+
var el = this._elements[index];
|
|
1295
|
+
var nativeEl = el.nativeElement;
|
|
1296
|
+
el.visible = true;
|
|
1297
|
+
|
|
1298
|
+
if (nativeEl.style.display) {
|
|
1299
|
+
nativeEl.style.display = "";
|
|
1300
|
+
}
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
__proto.hide = function (index) {
|
|
1304
|
+
var el = this._elements[index];
|
|
1305
|
+
var nativeEl = el.nativeElement;
|
|
1306
|
+
el.visible = false;
|
|
1307
|
+
nativeEl.style.display = "none";
|
|
1308
|
+
};
|
|
1309
|
+
/**
|
|
1310
|
+
* Add new virtual panels at the end of the list
|
|
1311
|
+
* @ko 새로운 가상 패널들을 리스트의 끝에 추가합니다
|
|
1312
|
+
* @param {number} count The number of panels to add<ko>추가할 패널의 개수</ko>
|
|
1313
|
+
* @returns {Array<VirtualPanel>} The new panels added<ko>새롭게 추가된 패널들</ko>
|
|
1314
|
+
*/
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
__proto.append = function (count) {
|
|
1318
|
+
if (count === void 0) {
|
|
1319
|
+
count = 1;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
var flicking = this._flicking;
|
|
1323
|
+
return this.insert(flicking.panels.length, count);
|
|
1324
|
+
};
|
|
1325
|
+
/**
|
|
1326
|
+
* Add new virtual panels at the start of the list
|
|
1327
|
+
* @ko 새로운 가상 패널들을 리스트의 시작에 추가합니다
|
|
1328
|
+
* @param {number} count The number of panels to add<ko>추가할 패널의 개수</ko>
|
|
1329
|
+
* @returns {Array<VirtualPanel>} The new panels added<ko>새롭게 추가된 패널들</ko>
|
|
1330
|
+
*/
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
__proto.prepend = function (count) {
|
|
1334
|
+
if (count === void 0) {
|
|
1335
|
+
count = 1;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
return this.insert(0, count);
|
|
1339
|
+
};
|
|
1340
|
+
/**
|
|
1341
|
+
* Add new virtual panels at the given index
|
|
1342
|
+
* @ko 새로운 가상 패널들을 주어진 인덱스에 추가합니다
|
|
1343
|
+
* @param {number} count The number of panels to add<ko>추가할 패널의 개수</ko>
|
|
1344
|
+
* @returns {Array<VirtualPanel>} The new panels added<ko>새롭게 추가된 패널들</ko>
|
|
1345
|
+
*/
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
__proto.insert = function (index, count) {
|
|
1349
|
+
if (count === void 0) {
|
|
1350
|
+
count = 1;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
if (count <= 0) return [];
|
|
1354
|
+
var flicking = this._flicking;
|
|
1355
|
+
return flicking.renderer.batchInsert({
|
|
1356
|
+
index: index,
|
|
1357
|
+
elements: range(count),
|
|
1358
|
+
hasDOMInElements: false
|
|
1359
|
+
});
|
|
1360
|
+
};
|
|
1361
|
+
/**
|
|
1362
|
+
* Remove panels at the given index
|
|
1363
|
+
* @ko 주어진 인덱스에서 패널들을 삭제합니다
|
|
1364
|
+
* @param {number} count The number of panels to remove<ko>삭제할 패널의 개수</ko>
|
|
1365
|
+
* @returns {Array<VirtualPanel>} The panels removed<ko>삭제된 패널들</ko>
|
|
1366
|
+
*/
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
__proto.remove = function (index, count) {
|
|
1370
|
+
if (count <= 0) return [];
|
|
1371
|
+
var flicking = this._flicking;
|
|
1372
|
+
return flicking.renderer.batchRemove({
|
|
1373
|
+
index: index,
|
|
1374
|
+
deleteCount: count,
|
|
1375
|
+
hasDOMInElements: false
|
|
1376
|
+
});
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
__proto._initVirtualElements = function () {
|
|
1380
|
+
var _this = this;
|
|
1381
|
+
|
|
1382
|
+
var flicking = this._flicking;
|
|
1383
|
+
var cameraElement = flicking.camera.element;
|
|
1384
|
+
var panelsPerView = flicking.panelsPerView;
|
|
1385
|
+
var fragment = document.createDocumentFragment();
|
|
1386
|
+
var newElements = range(panelsPerView + 1).map(function (idx) {
|
|
1387
|
+
var panelEl = document.createElement("div");
|
|
1388
|
+
panelEl.className = _this._panelClass;
|
|
1389
|
+
panelEl.dataset.elementIndex = idx.toString();
|
|
1390
|
+
return panelEl;
|
|
1391
|
+
});
|
|
1392
|
+
newElements.forEach(function (el) {
|
|
1393
|
+
fragment.appendChild(el);
|
|
1394
|
+
});
|
|
1395
|
+
cameraElement.appendChild(fragment);
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1398
|
+
return VirtualManager;
|
|
1399
|
+
}();
|
|
1400
|
+
|
|
906
1401
|
/**
|
|
907
1402
|
* All possible @egjs/axes event keys
|
|
908
1403
|
* @internal
|
|
@@ -937,7 +1432,9 @@ version: 4.2.5
|
|
|
937
1432
|
*/
|
|
938
1433
|
|
|
939
1434
|
|
|
940
|
-
var State =
|
|
1435
|
+
var State =
|
|
1436
|
+
/*#__PURE__*/
|
|
1437
|
+
function () {
|
|
941
1438
|
function State() {
|
|
942
1439
|
this._delta = 0;
|
|
943
1440
|
this._targetPanel = null;
|
|
@@ -1094,7 +1591,9 @@ version: 4.2.5
|
|
|
1094
1591
|
* @internal
|
|
1095
1592
|
*/
|
|
1096
1593
|
|
|
1097
|
-
var IdleState =
|
|
1594
|
+
var IdleState =
|
|
1595
|
+
/*#__PURE__*/
|
|
1596
|
+
function (_super) {
|
|
1098
1597
|
__extends(IdleState, _super);
|
|
1099
1598
|
|
|
1100
1599
|
function IdleState() {
|
|
@@ -1181,7 +1680,9 @@ version: 4.2.5
|
|
|
1181
1680
|
* @internal
|
|
1182
1681
|
*/
|
|
1183
1682
|
|
|
1184
|
-
var HoldingState =
|
|
1683
|
+
var HoldingState =
|
|
1684
|
+
/*#__PURE__*/
|
|
1685
|
+
function (_super) {
|
|
1185
1686
|
__extends(HoldingState, _super);
|
|
1186
1687
|
|
|
1187
1688
|
function HoldingState() {
|
|
@@ -1334,7 +1835,9 @@ version: 4.2.5
|
|
|
1334
1835
|
* @internal
|
|
1335
1836
|
*/
|
|
1336
1837
|
|
|
1337
|
-
var DraggingState =
|
|
1838
|
+
var DraggingState =
|
|
1839
|
+
/*#__PURE__*/
|
|
1840
|
+
function (_super) {
|
|
1338
1841
|
__extends(DraggingState, _super);
|
|
1339
1842
|
|
|
1340
1843
|
function DraggingState() {
|
|
@@ -1397,7 +1900,9 @@ version: 4.2.5
|
|
|
1397
1900
|
* @internal
|
|
1398
1901
|
*/
|
|
1399
1902
|
|
|
1400
|
-
var AnimatingState =
|
|
1903
|
+
var AnimatingState =
|
|
1904
|
+
/*#__PURE__*/
|
|
1905
|
+
function (_super) {
|
|
1401
1906
|
__extends(AnimatingState, _super);
|
|
1402
1907
|
|
|
1403
1908
|
function AnimatingState() {
|
|
@@ -1471,7 +1976,9 @@ version: 4.2.5
|
|
|
1471
1976
|
* @internal
|
|
1472
1977
|
*/
|
|
1473
1978
|
|
|
1474
|
-
var DisabledState =
|
|
1979
|
+
var DisabledState =
|
|
1980
|
+
/*#__PURE__*/
|
|
1981
|
+
function (_super) {
|
|
1475
1982
|
__extends(DisabledState, _super);
|
|
1476
1983
|
|
|
1477
1984
|
function DisabledState() {
|
|
@@ -1527,7 +2034,9 @@ version: 4.2.5
|
|
|
1527
2034
|
* @internal
|
|
1528
2035
|
*/
|
|
1529
2036
|
|
|
1530
|
-
var StateMachine =
|
|
2037
|
+
var StateMachine =
|
|
2038
|
+
/*#__PURE__*/
|
|
2039
|
+
function () {
|
|
1531
2040
|
function StateMachine() {
|
|
1532
2041
|
var _this = this;
|
|
1533
2042
|
|
|
@@ -1616,7 +2125,9 @@ version: 4.2.5
|
|
|
1616
2125
|
* @internal
|
|
1617
2126
|
*/
|
|
1618
2127
|
|
|
1619
|
-
var AxesController =
|
|
2128
|
+
var AxesController =
|
|
2129
|
+
/*#__PURE__*/
|
|
2130
|
+
function () {
|
|
1620
2131
|
/** */
|
|
1621
2132
|
function AxesController() {
|
|
1622
2133
|
var _this = this;
|
|
@@ -1845,11 +2356,15 @@ version: 4.2.5
|
|
|
1845
2356
|
|
|
1846
2357
|
|
|
1847
2358
|
__proto.destroy = function () {
|
|
1848
|
-
var _a
|
|
2359
|
+
var _a;
|
|
1849
2360
|
|
|
1850
|
-
this.
|
|
1851
|
-
|
|
1852
|
-
|
|
2361
|
+
if (this._axes) {
|
|
2362
|
+
this.removePreventClickHandler();
|
|
2363
|
+
|
|
2364
|
+
this._axes.destroy();
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
(_a = this._panInput) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1853
2368
|
|
|
1854
2369
|
this._resetInternalValues();
|
|
1855
2370
|
};
|
|
@@ -1895,7 +2410,7 @@ version: 4.2.5
|
|
|
1895
2410
|
__proto.update = function (controlParams) {
|
|
1896
2411
|
var _a;
|
|
1897
2412
|
|
|
1898
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2413
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
1899
2414
|
var camera = flicking.camera;
|
|
1900
2415
|
var axes = this._axes;
|
|
1901
2416
|
var axis = axes.axis[POSITION_KEY];
|
|
@@ -1913,7 +2428,7 @@ version: 4.2.5
|
|
|
1913
2428
|
|
|
1914
2429
|
|
|
1915
2430
|
__proto.addPreventClickHandler = function () {
|
|
1916
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2431
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
1917
2432
|
var axes = this._axes;
|
|
1918
2433
|
var cameraEl = flicking.camera.element;
|
|
1919
2434
|
axes.on(EVENT.HOLD, this._onAxesHold);
|
|
@@ -1929,7 +2444,7 @@ version: 4.2.5
|
|
|
1929
2444
|
|
|
1930
2445
|
|
|
1931
2446
|
__proto.removePreventClickHandler = function () {
|
|
1932
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2447
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
1933
2448
|
var axes = this._axes;
|
|
1934
2449
|
var cameraEl = flicking.camera.element;
|
|
1935
2450
|
axes.off(EVENT.HOLD, this._onAxesHold);
|
|
@@ -1965,17 +2480,25 @@ version: 4.2.5
|
|
|
1965
2480
|
|
|
1966
2481
|
var _this = this;
|
|
1967
2482
|
|
|
2483
|
+
var _b;
|
|
2484
|
+
|
|
1968
2485
|
var axes = this._axes;
|
|
2486
|
+
var state = this._stateMachine.state;
|
|
1969
2487
|
|
|
1970
2488
|
if (!axes) {
|
|
1971
|
-
return Promise.reject(new FlickingError(MESSAGE.NOT_ATTACHED_TO_FLICKING
|
|
2489
|
+
return Promise.reject(new FlickingError(MESSAGE.NOT_ATTACHED_TO_FLICKING, CODE.NOT_ATTACHED_TO_FLICKING));
|
|
1972
2490
|
}
|
|
1973
2491
|
|
|
1974
2492
|
var startPos = axes.get([POSITION_KEY])[POSITION_KEY];
|
|
1975
2493
|
|
|
1976
2494
|
if (startPos === position) {
|
|
1977
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2495
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
1978
2496
|
flicking.camera.lookAt(position);
|
|
2497
|
+
|
|
2498
|
+
if (state.targetPanel) {
|
|
2499
|
+
flicking.control.setActive(state.targetPanel, flicking.control.activePanel, (_b = axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) !== null && _b !== void 0 ? _b : false);
|
|
2500
|
+
}
|
|
2501
|
+
|
|
1979
2502
|
return Promise.resolve();
|
|
1980
2503
|
}
|
|
1981
2504
|
|
|
@@ -2006,7 +2529,7 @@ version: 4.2.5
|
|
|
2006
2529
|
};
|
|
2007
2530
|
|
|
2008
2531
|
if (duration === 0) {
|
|
2009
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2532
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2010
2533
|
var camera = flicking.camera;
|
|
2011
2534
|
animate();
|
|
2012
2535
|
var newPos = flicking.circularEnabled ? circulatePosition(position, camera.range.min, camera.range.max) : position;
|
|
@@ -2051,7 +2574,9 @@ version: 4.2.5
|
|
|
2051
2574
|
* @ko Flicking의 입력 장치 & 애니메이션을 담당하는 컴포넌트
|
|
2052
2575
|
*/
|
|
2053
2576
|
|
|
2054
|
-
var Control$1 =
|
|
2577
|
+
var Control$1 =
|
|
2578
|
+
/*#__PURE__*/
|
|
2579
|
+
function () {
|
|
2055
2580
|
/** */
|
|
2056
2581
|
function Control() {
|
|
2057
2582
|
this._flicking = null;
|
|
@@ -2195,7 +2720,7 @@ version: 4.2.5
|
|
|
2195
2720
|
|
|
2196
2721
|
|
|
2197
2722
|
__proto.updatePosition = function (_progressInPanel) {
|
|
2198
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2723
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2199
2724
|
var camera = flicking.camera;
|
|
2200
2725
|
var activePanel = this._activePanel;
|
|
2201
2726
|
|
|
@@ -2212,7 +2737,7 @@ version: 4.2.5
|
|
|
2212
2737
|
|
|
2213
2738
|
|
|
2214
2739
|
__proto.updateInput = function () {
|
|
2215
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2740
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2216
2741
|
var camera = flicking.camera;
|
|
2217
2742
|
|
|
2218
2743
|
this._controller.update(camera.controlParams);
|
|
@@ -2279,7 +2804,7 @@ version: 4.2.5
|
|
|
2279
2804
|
return __awaiter(this, void 0, void 0, function () {
|
|
2280
2805
|
var flicking, camera, position, nearestAnchor, camPos_1, camRangeDiff, possiblePositions;
|
|
2281
2806
|
return __generator(this, function (_c) {
|
|
2282
|
-
flicking = getFlickingAttached(this._flicking
|
|
2807
|
+
flicking = getFlickingAttached(this._flicking);
|
|
2283
2808
|
camera = flicking.camera;
|
|
2284
2809
|
position = panel.position;
|
|
2285
2810
|
nearestAnchor = camera.findNearestAnchor(position);
|
|
@@ -2331,7 +2856,7 @@ version: 4.2.5
|
|
|
2331
2856
|
__proto.setActive = function (newActivePanel, prevActivePanel, isTrusted) {
|
|
2332
2857
|
var _a;
|
|
2333
2858
|
|
|
2334
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2859
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2335
2860
|
this._activePanel = newActivePanel;
|
|
2336
2861
|
flicking.camera.updateAdaptiveHeight();
|
|
2337
2862
|
|
|
@@ -2354,7 +2879,7 @@ version: 4.2.5
|
|
|
2354
2879
|
__proto._triggerIndexChangeEvent = function (panel, position, axesEvent) {
|
|
2355
2880
|
var _a;
|
|
2356
2881
|
|
|
2357
|
-
var flicking = getFlickingAttached(this._flicking
|
|
2882
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2358
2883
|
var triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
|
|
2359
2884
|
var camera = flicking.camera;
|
|
2360
2885
|
var activePanel = this._activePanel;
|
|
@@ -2382,7 +2907,7 @@ version: 4.2.5
|
|
|
2382
2907
|
var _this = this;
|
|
2383
2908
|
|
|
2384
2909
|
return __generator(this, function (_b) {
|
|
2385
|
-
flicking = getFlickingAttached(this._flicking
|
|
2910
|
+
flicking = getFlickingAttached(this._flicking);
|
|
2386
2911
|
|
|
2387
2912
|
animate = function () {
|
|
2388
2913
|
return _this._controller.animateTo(position, duration, axesEvent);
|
|
@@ -2432,7 +2957,9 @@ version: 4.2.5
|
|
|
2432
2957
|
* A data component that has actual position where the camera should be stopped at
|
|
2433
2958
|
* @ko 카메라가 정지해야하는 실제 위치를 담고 있는 데이터 컴포넌트
|
|
2434
2959
|
*/
|
|
2435
|
-
var AnchorPoint =
|
|
2960
|
+
var AnchorPoint =
|
|
2961
|
+
/*#__PURE__*/
|
|
2962
|
+
function () {
|
|
2436
2963
|
/**
|
|
2437
2964
|
* @param {object} options An options object<ko>옵션 객체</ko>
|
|
2438
2965
|
* @param {number} [options.index] Index of AnchorPoint<ko>AnchorPoint의 인덱스</ko>
|
|
@@ -2496,7 +3023,9 @@ version: 4.2.5
|
|
|
2496
3023
|
* @ko 입력을 중단한 시점의 가속도에 영향받아 도달할 패널을 계산하는 이동 방식을 사용하는 {@link Control}
|
|
2497
3024
|
*/
|
|
2498
3025
|
|
|
2499
|
-
var SnapControl =
|
|
3026
|
+
var SnapControl =
|
|
3027
|
+
/*#__PURE__*/
|
|
3028
|
+
function (_super) {
|
|
2500
3029
|
__extends(SnapControl, _super);
|
|
2501
3030
|
/** */
|
|
2502
3031
|
|
|
@@ -2570,7 +3099,7 @@ version: 4.2.5
|
|
|
2570
3099
|
return __awaiter(this, void 0, void 0, function () {
|
|
2571
3100
|
var flicking, camera, activeAnchor, anchorAtCamera, state, snapThreshold, posDelta, absPosDelta, snapDelta, targetAnchor;
|
|
2572
3101
|
return __generator(this, function (_a) {
|
|
2573
|
-
flicking = getFlickingAttached(this._flicking
|
|
3102
|
+
flicking = getFlickingAttached(this._flicking);
|
|
2574
3103
|
camera = flicking.camera;
|
|
2575
3104
|
activeAnchor = camera.findActiveAnchor();
|
|
2576
3105
|
anchorAtCamera = camera.findNearestAnchor(camera.position);
|
|
@@ -2613,7 +3142,7 @@ version: 4.2.5
|
|
|
2613
3142
|
};
|
|
2614
3143
|
|
|
2615
3144
|
__proto._findSnappedAnchor = function (position, anchorAtCamera) {
|
|
2616
|
-
var flicking = getFlickingAttached(this._flicking
|
|
3145
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2617
3146
|
var camera = flicking.camera;
|
|
2618
3147
|
var count = this._count;
|
|
2619
3148
|
var currentPos = camera.position;
|
|
@@ -2673,7 +3202,7 @@ version: 4.2.5
|
|
|
2673
3202
|
__proto._findAdjacentAnchor = function (posDelta, anchorAtCamera) {
|
|
2674
3203
|
var _a;
|
|
2675
3204
|
|
|
2676
|
-
var flicking = getFlickingAttached(this._flicking
|
|
3205
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2677
3206
|
var camera = flicking.camera;
|
|
2678
3207
|
var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
|
|
2679
3208
|
return adjacentAnchor;
|
|
@@ -2702,7 +3231,9 @@ version: 4.2.5
|
|
|
2702
3231
|
* @ko 패널이 정해진 지점에 정렬되지 않고, 자유롭게 스크롤할 수 있는 이동 방식을 사용하는 {@link Control}
|
|
2703
3232
|
*/
|
|
2704
3233
|
|
|
2705
|
-
var FreeControl =
|
|
3234
|
+
var FreeControl =
|
|
3235
|
+
/*#__PURE__*/
|
|
3236
|
+
function (_super) {
|
|
2706
3237
|
__extends(FreeControl, _super);
|
|
2707
3238
|
/** */
|
|
2708
3239
|
|
|
@@ -2747,7 +3278,7 @@ version: 4.2.5
|
|
|
2747
3278
|
*/
|
|
2748
3279
|
|
|
2749
3280
|
__proto.updatePosition = function (progressInPanel) {
|
|
2750
|
-
var flicking = getFlickingAttached(this._flicking
|
|
3281
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2751
3282
|
var camera = flicking.camera;
|
|
2752
3283
|
var activePanel = this._activePanel;
|
|
2753
3284
|
|
|
@@ -2799,7 +3330,7 @@ version: 4.2.5
|
|
|
2799
3330
|
return __awaiter(this, void 0, void 0, function () {
|
|
2800
3331
|
var flicking, camera, targetPos, anchorAtPosition, targetPanel;
|
|
2801
3332
|
return __generator(this, function (_a) {
|
|
2802
|
-
flicking = getFlickingAttached(this._flicking
|
|
3333
|
+
flicking = getFlickingAttached(this._flicking);
|
|
2803
3334
|
camera = flicking.camera;
|
|
2804
3335
|
targetPos = camera.clampToReachablePosition(position);
|
|
2805
3336
|
anchorAtPosition = camera.findAnchorIncludePosition(targetPos);
|
|
@@ -2836,7 +3367,9 @@ version: 4.2.5
|
|
|
2836
3367
|
* @ko 한번에 최대로 이동할 패널의 개수를 선택 가능한 {@link Control}
|
|
2837
3368
|
*/
|
|
2838
3369
|
|
|
2839
|
-
var StrictControl =
|
|
3370
|
+
var StrictControl =
|
|
3371
|
+
/*#__PURE__*/
|
|
3372
|
+
function (_super) {
|
|
2840
3373
|
__extends(StrictControl, _super);
|
|
2841
3374
|
/** */
|
|
2842
3375
|
|
|
@@ -2900,7 +3433,7 @@ version: 4.2.5
|
|
|
2900
3433
|
__proto.updateInput = function () {
|
|
2901
3434
|
var _a;
|
|
2902
3435
|
|
|
2903
|
-
var flicking = getFlickingAttached(this._flicking
|
|
3436
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
2904
3437
|
var camera = flicking.camera;
|
|
2905
3438
|
var renderer = flicking.renderer;
|
|
2906
3439
|
var controller = this._controller;
|
|
@@ -3009,7 +3542,7 @@ version: 4.2.5
|
|
|
3009
3542
|
return __awaiter(this, void 0, void 0, function () {
|
|
3010
3543
|
var flicking, camera, activePanel, axesRange, indexRange, cameraRange, clampedPosition, anchorAtPosition, prevPos, isOverThreshold, adjacentAnchor, targetPos, targetPanel, anchors, firstAnchor, lastAnchor, shouldBounceToFirst, shouldBounceToLast, targetAnchor;
|
|
3011
3544
|
return __generator(this, function (_a) {
|
|
3012
|
-
flicking = getFlickingAttached(this._flicking
|
|
3545
|
+
flicking = getFlickingAttached(this._flicking);
|
|
3013
3546
|
camera = flicking.camera;
|
|
3014
3547
|
activePanel = this._activePanel;
|
|
3015
3548
|
axesRange = this._controller.range;
|
|
@@ -3101,7 +3634,9 @@ version: 4.2.5
|
|
|
3101
3634
|
* @ko 뷰포트 내에서의 실제 움직임을 담당하는 컴포넌트
|
|
3102
3635
|
*/
|
|
3103
3636
|
|
|
3104
|
-
var Camera$1 =
|
|
3637
|
+
var Camera$1 =
|
|
3638
|
+
/*#__PURE__*/
|
|
3639
|
+
function () {
|
|
3105
3640
|
/** */
|
|
3106
3641
|
function Camera(_a) {
|
|
3107
3642
|
var _this = this;
|
|
@@ -3157,8 +3692,8 @@ version: 4.2.5
|
|
|
3157
3692
|
// Internal states getter
|
|
3158
3693
|
|
|
3159
3694
|
/**
|
|
3160
|
-
* The camera(`.flicking-camera`)
|
|
3161
|
-
* @ko 카메라(`.flicking-camera`)
|
|
3695
|
+
* The camera element(`.flicking-camera`)
|
|
3696
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)
|
|
3162
3697
|
* @type {HTMLElement}
|
|
3163
3698
|
* @readonly
|
|
3164
3699
|
*/
|
|
@@ -3168,6 +3703,19 @@ version: 4.2.5
|
|
|
3168
3703
|
enumerable: false,
|
|
3169
3704
|
configurable: true
|
|
3170
3705
|
});
|
|
3706
|
+
Object.defineProperty(__proto, "children", {
|
|
3707
|
+
/**
|
|
3708
|
+
* An array of the child elements of the camera element(`.flicking-camera`)
|
|
3709
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)의 자식 엘리먼트 배열
|
|
3710
|
+
* @type {HTMLElement[]}
|
|
3711
|
+
* @readonly
|
|
3712
|
+
*/
|
|
3713
|
+
get: function () {
|
|
3714
|
+
return toArray(this._el.children);
|
|
3715
|
+
},
|
|
3716
|
+
enumerable: false,
|
|
3717
|
+
configurable: true
|
|
3718
|
+
});
|
|
3171
3719
|
Object.defineProperty(__proto, "position", {
|
|
3172
3720
|
/**
|
|
3173
3721
|
* Current position of the camera
|
|
@@ -3451,7 +3999,7 @@ version: 4.2.5
|
|
|
3451
3999
|
|
|
3452
4000
|
this._checkReachEnd(prevPos, pos);
|
|
3453
4001
|
|
|
3454
|
-
this.
|
|
4002
|
+
this.applyTransform();
|
|
3455
4003
|
};
|
|
3456
4004
|
/**
|
|
3457
4005
|
* Return a previous {@link AnchorPoint} of given {@link AnchorPoint}
|
|
@@ -3551,7 +4099,7 @@ version: 4.2.5
|
|
|
3551
4099
|
|
|
3552
4100
|
|
|
3553
4101
|
__proto.findActiveAnchor = function () {
|
|
3554
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4102
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3555
4103
|
var activeIndex = flicking.control.activeIndex;
|
|
3556
4104
|
return find(this._anchors, function (anchor) {
|
|
3557
4105
|
return anchor.panel.index === activeIndex;
|
|
@@ -3594,7 +4142,7 @@ version: 4.2.5
|
|
|
3594
4142
|
__proto.canSee = function (panel) {
|
|
3595
4143
|
var visibleRange = this.visibleRange; // Should not include margin, as we don't declare what the margin is visible as what the panel is visible.
|
|
3596
4144
|
|
|
3597
|
-
return panel.
|
|
4145
|
+
return panel.isVisibleOnRange(visibleRange.min, visibleRange.max);
|
|
3598
4146
|
};
|
|
3599
4147
|
/**
|
|
3600
4148
|
* Update Camera's {@link Camera#alignPosition alignPosition}
|
|
@@ -3622,7 +4170,7 @@ version: 4.2.5
|
|
|
3622
4170
|
|
|
3623
4171
|
|
|
3624
4172
|
__proto.updateAnchors = function () {
|
|
3625
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4173
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3626
4174
|
var panels = flicking.renderer.panels;
|
|
3627
4175
|
this._anchors = panels.map(function (panel, index) {
|
|
3628
4176
|
return new AnchorPoint({
|
|
@@ -3645,27 +4193,34 @@ version: 4.2.5
|
|
|
3645
4193
|
|
|
3646
4194
|
|
|
3647
4195
|
__proto.updateAdaptiveHeight = function () {
|
|
3648
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4196
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3649
4197
|
var activePanel = flicking.control.activePanel;
|
|
3650
4198
|
if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
|
|
3651
4199
|
flicking.viewport.setSize({
|
|
3652
4200
|
height: activePanel.height
|
|
3653
4201
|
});
|
|
3654
4202
|
};
|
|
4203
|
+
/**
|
|
4204
|
+
* Update current offset of the camera
|
|
4205
|
+
* @ko 현재 카메라의 오프셋을 업데이트합니다
|
|
4206
|
+
* @chainable
|
|
4207
|
+
* @return {this}
|
|
4208
|
+
*/
|
|
4209
|
+
|
|
3655
4210
|
|
|
3656
4211
|
__proto.updateOffset = function () {
|
|
3657
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4212
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4213
|
+
var position = this._position;
|
|
3658
4214
|
var unRenderedPanels = flicking.panels.filter(function (panel) {
|
|
3659
4215
|
return !panel.rendered;
|
|
3660
4216
|
});
|
|
3661
|
-
var position = this._position;
|
|
3662
4217
|
this._offset = unRenderedPanels.filter(function (panel) {
|
|
3663
4218
|
return panel.position + panel.offset < position;
|
|
3664
4219
|
}).reduce(function (offset, panel) {
|
|
3665
4220
|
return offset + panel.sizeIncludingMargin;
|
|
3666
4221
|
}, 0);
|
|
3667
|
-
|
|
3668
|
-
this
|
|
4222
|
+
this.applyTransform();
|
|
4223
|
+
return this;
|
|
3669
4224
|
};
|
|
3670
4225
|
/**
|
|
3671
4226
|
* Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
|
|
@@ -3682,6 +4237,21 @@ version: 4.2.5
|
|
|
3682
4237
|
};
|
|
3683
4238
|
return this;
|
|
3684
4239
|
};
|
|
4240
|
+
/**
|
|
4241
|
+
* Apply "transform" style with the current position to camera element
|
|
4242
|
+
* @ko 현재 위치를 기준으로한 transform 스타일을 카메라 엘리먼트에 적용합니다.
|
|
4243
|
+
* @chainable
|
|
4244
|
+
* @return {this}
|
|
4245
|
+
*/
|
|
4246
|
+
|
|
4247
|
+
|
|
4248
|
+
__proto.applyTransform = function () {
|
|
4249
|
+
var el = this._el;
|
|
4250
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4251
|
+
var actualPosition = this._position - this._alignPos - this._offset;
|
|
4252
|
+
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
4253
|
+
return this;
|
|
4254
|
+
};
|
|
3685
4255
|
|
|
3686
4256
|
__proto._resetInternalValues = function () {
|
|
3687
4257
|
this._position = 0;
|
|
@@ -3702,7 +4272,7 @@ version: 4.2.5
|
|
|
3702
4272
|
__proto._refreshVisiblePanels = function () {
|
|
3703
4273
|
var _this = this;
|
|
3704
4274
|
|
|
3705
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4275
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3706
4276
|
var panels = flicking.renderer.panels;
|
|
3707
4277
|
var newVisiblePanels = panels.filter(function (panel) {
|
|
3708
4278
|
return _this.canSee(panel);
|
|
@@ -3730,7 +4300,7 @@ version: 4.2.5
|
|
|
3730
4300
|
__proto._checkNeedPanel = function () {
|
|
3731
4301
|
var needPanelTriggered = this._needPanelTriggered;
|
|
3732
4302
|
if (needPanelTriggered.prev && needPanelTriggered.next) return;
|
|
3733
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4303
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3734
4304
|
var panels = flicking.renderer.panels;
|
|
3735
4305
|
|
|
3736
4306
|
if (panels.length <= 0) {
|
|
@@ -3784,7 +4354,7 @@ version: 4.2.5
|
|
|
3784
4354
|
};
|
|
3785
4355
|
|
|
3786
4356
|
__proto._checkReachEnd = function (prevPos, newPos) {
|
|
3787
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4357
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3788
4358
|
var range = this._range;
|
|
3789
4359
|
var wasBetweenRange = prevPos > range.min && prevPos < range.max;
|
|
3790
4360
|
var isBetweenRange = newPos > range.min && newPos < range.max;
|
|
@@ -3795,13 +4365,6 @@ version: 4.2.5
|
|
|
3795
4365
|
}));
|
|
3796
4366
|
};
|
|
3797
4367
|
|
|
3798
|
-
__proto._applyTransform = function () {
|
|
3799
|
-
var el = this._el;
|
|
3800
|
-
var flicking = getFlickingAttached(this._flicking, "Camera");
|
|
3801
|
-
var actualPosition = this._position - this._alignPos - this._offset;
|
|
3802
|
-
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
3803
|
-
};
|
|
3804
|
-
|
|
3805
4368
|
return Camera;
|
|
3806
4369
|
}();
|
|
3807
4370
|
|
|
@@ -3810,7 +4373,9 @@ version: 4.2.5
|
|
|
3810
4373
|
* @ko 첫번째 패널의 좌표로부터 마지막 패널의 좌표로까지 이동할 수 있는 종류의 {@link Camera}
|
|
3811
4374
|
*/
|
|
3812
4375
|
|
|
3813
|
-
var LinearCamera =
|
|
4376
|
+
var LinearCamera =
|
|
4377
|
+
/*#__PURE__*/
|
|
4378
|
+
function (_super) {
|
|
3814
4379
|
__extends(LinearCamera, _super);
|
|
3815
4380
|
|
|
3816
4381
|
function LinearCamera() {
|
|
@@ -3832,7 +4397,7 @@ version: 4.2.5
|
|
|
3832
4397
|
__proto.updateRange = function () {
|
|
3833
4398
|
var _a, _b;
|
|
3834
4399
|
|
|
3835
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4400
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3836
4401
|
var renderer = flicking.renderer;
|
|
3837
4402
|
var firstPanel = renderer.getPanel(0);
|
|
3838
4403
|
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
@@ -3851,7 +4416,9 @@ version: 4.2.5
|
|
|
3851
4416
|
* @ko 첫번째 패널과 마지막 패널이 이어진 상태로, 무한히 회전할 수 있는 종류의 {@link Camera}
|
|
3852
4417
|
*/
|
|
3853
4418
|
|
|
3854
|
-
var CircularCamera =
|
|
4419
|
+
var CircularCamera =
|
|
4420
|
+
/*#__PURE__*/
|
|
4421
|
+
function (_super) {
|
|
3855
4422
|
__extends(CircularCamera, _super);
|
|
3856
4423
|
|
|
3857
4424
|
function CircularCamera() {
|
|
@@ -3909,12 +4476,32 @@ version: 4.2.5
|
|
|
3909
4476
|
__proto.findAnchorIncludePosition = function (position) {
|
|
3910
4477
|
if (!this._circularEnabled) return _super.prototype.findAnchorIncludePosition.call(this, position);
|
|
3911
4478
|
var range = this._range;
|
|
4479
|
+
var anchors = this._anchors;
|
|
4480
|
+
var rangeDiff = this.rangeDiff;
|
|
4481
|
+
var anchorCount = anchors.length;
|
|
3912
4482
|
var positionInRange = circulatePosition(position, range.min, range.max);
|
|
3913
4483
|
|
|
3914
4484
|
var anchorInRange = _super.prototype.findAnchorIncludePosition.call(this, positionInRange);
|
|
3915
4485
|
|
|
4486
|
+
if (anchorCount > 0 && (position === range.min || position === range.max)) {
|
|
4487
|
+
var possibleAnchors = [anchorInRange, new AnchorPoint({
|
|
4488
|
+
index: 0,
|
|
4489
|
+
position: anchors[0].position + rangeDiff,
|
|
4490
|
+
panel: anchors[0].panel
|
|
4491
|
+
}), new AnchorPoint({
|
|
4492
|
+
index: anchorCount - 1,
|
|
4493
|
+
position: anchors[anchorCount - 1].position - rangeDiff,
|
|
4494
|
+
panel: anchors[anchorCount - 1].panel
|
|
4495
|
+
})].filter(function (anchor) {
|
|
4496
|
+
return !!anchor;
|
|
4497
|
+
});
|
|
4498
|
+
anchorInRange = possibleAnchors.reduce(function (nearest, anchor) {
|
|
4499
|
+
if (!nearest) return anchor;
|
|
4500
|
+
return Math.abs(nearest.position - position) < Math.abs(anchor.position - position) ? nearest : anchor;
|
|
4501
|
+
}, null);
|
|
4502
|
+
}
|
|
4503
|
+
|
|
3916
4504
|
if (!anchorInRange) return null;
|
|
3917
|
-
var rangeDiff = this.rangeDiff;
|
|
3918
4505
|
|
|
3919
4506
|
if (position < range.min) {
|
|
3920
4507
|
var loopCount = -Math.floor((range.min - position) / rangeDiff) - 1;
|
|
@@ -3959,9 +4546,9 @@ version: 4.2.5
|
|
|
3959
4546
|
|
|
3960
4547
|
|
|
3961
4548
|
if (visibleRange.min < range.min) {
|
|
3962
|
-
return visibleInCurrentRange || panel.
|
|
4549
|
+
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min + rangeDiff, visibleRange.max + rangeDiff);
|
|
3963
4550
|
} else if (visibleRange.max > range.max) {
|
|
3964
|
-
return visibleInCurrentRange || panel.
|
|
4551
|
+
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min - rangeDiff, visibleRange.max - rangeDiff);
|
|
3965
4552
|
}
|
|
3966
4553
|
|
|
3967
4554
|
return visibleInCurrentRange;
|
|
@@ -3978,7 +4565,7 @@ version: 4.2.5
|
|
|
3978
4565
|
|
|
3979
4566
|
|
|
3980
4567
|
__proto.updateRange = function () {
|
|
3981
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4568
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
3982
4569
|
var renderer = flicking.renderer;
|
|
3983
4570
|
var panels = renderer.panels;
|
|
3984
4571
|
|
|
@@ -4014,13 +4601,20 @@ version: 4.2.5
|
|
|
4014
4601
|
};
|
|
4015
4602
|
}
|
|
4016
4603
|
|
|
4604
|
+
this.updateOffset();
|
|
4605
|
+
return this;
|
|
4606
|
+
};
|
|
4607
|
+
|
|
4608
|
+
__proto.updateOffset = function () {
|
|
4017
4609
|
this._updateCircularOffset();
|
|
4018
4610
|
|
|
4019
|
-
return this;
|
|
4611
|
+
return _super.prototype.updateOffset.call(this);
|
|
4020
4612
|
};
|
|
4021
4613
|
|
|
4022
4614
|
__proto.lookAt = function (pos) {
|
|
4023
|
-
var
|
|
4615
|
+
var _this = this;
|
|
4616
|
+
|
|
4617
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4024
4618
|
var prevPos = this._position;
|
|
4025
4619
|
if (pos === prevPos) return _super.prototype.lookAt.call(this, pos);
|
|
4026
4620
|
var panels = flicking.renderer.panels;
|
|
@@ -4029,22 +4623,23 @@ version: 4.2.5
|
|
|
4029
4623
|
});
|
|
4030
4624
|
this._position = pos;
|
|
4031
4625
|
|
|
4626
|
+
_super.prototype.lookAt.call(this, pos);
|
|
4627
|
+
|
|
4032
4628
|
if (toggled.some(function (isToggled) {
|
|
4033
4629
|
return isToggled;
|
|
4034
4630
|
})) {
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4631
|
+
void flicking.renderer.render().then(function () {
|
|
4632
|
+
_this.updateOffset();
|
|
4633
|
+
});
|
|
4038
4634
|
}
|
|
4039
|
-
|
|
4040
|
-
return _super.prototype.lookAt.call(this, pos);
|
|
4041
4635
|
};
|
|
4042
4636
|
|
|
4043
|
-
__proto.
|
|
4637
|
+
__proto.applyTransform = function () {
|
|
4044
4638
|
var el = this._el;
|
|
4045
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4639
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4046
4640
|
var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
|
|
4047
4641
|
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
4642
|
+
return this;
|
|
4048
4643
|
};
|
|
4049
4644
|
|
|
4050
4645
|
__proto._resetInternalValues = function () {
|
|
@@ -4066,17 +4661,15 @@ version: 4.2.5
|
|
|
4066
4661
|
return;
|
|
4067
4662
|
}
|
|
4068
4663
|
|
|
4069
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4070
|
-
var
|
|
4071
|
-
var toggledNext = [];
|
|
4072
|
-
flicking.panels.filter(function (panel) {
|
|
4664
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4665
|
+
var toggled = flicking.panels.filter(function (panel) {
|
|
4073
4666
|
return panel.toggled;
|
|
4074
|
-
})
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4667
|
+
});
|
|
4668
|
+
var toggledPrev = toggled.filter(function (panel) {
|
|
4669
|
+
return panel.toggleDirection === DIRECTION.PREV;
|
|
4670
|
+
});
|
|
4671
|
+
var toggledNext = toggled.filter(function (panel) {
|
|
4672
|
+
return panel.toggleDirection === DIRECTION.NEXT;
|
|
4080
4673
|
});
|
|
4081
4674
|
this._circularOffset = this._calcPanelAreaSum(toggledPrev) - this._calcPanelAreaSum(toggledNext);
|
|
4082
4675
|
};
|
|
@@ -4089,7 +4682,9 @@ version: 4.2.5
|
|
|
4089
4682
|
* @ko 첫번째와 마지막 패널 밖으로 넘어가지 못하도록 범위를 설정하여, 첫번째/마지막 패널 전/후의 빈 공간을 보이지 않도록 하는 종류의 {@link Camera}
|
|
4090
4683
|
*/
|
|
4091
4684
|
|
|
4092
|
-
var BoundCamera =
|
|
4685
|
+
var BoundCamera =
|
|
4686
|
+
/*#__PURE__*/
|
|
4687
|
+
function (_super) {
|
|
4093
4688
|
__extends(BoundCamera, _super);
|
|
4094
4689
|
|
|
4095
4690
|
function BoundCamera() {
|
|
@@ -4109,7 +4704,7 @@ version: 4.2.5
|
|
|
4109
4704
|
var __proto = BoundCamera.prototype;
|
|
4110
4705
|
|
|
4111
4706
|
__proto.updateRange = function () {
|
|
4112
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4707
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4113
4708
|
var renderer = flicking.renderer;
|
|
4114
4709
|
var alignPos = this._alignPos;
|
|
4115
4710
|
var firstPanel = renderer.getPanel(0);
|
|
@@ -4152,7 +4747,7 @@ version: 4.2.5
|
|
|
4152
4747
|
__proto.updateAnchors = function () {
|
|
4153
4748
|
var _this = this;
|
|
4154
4749
|
|
|
4155
|
-
var flicking = getFlickingAttached(this._flicking
|
|
4750
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4156
4751
|
var panels = flicking.renderer.panels;
|
|
4157
4752
|
|
|
4158
4753
|
if (panels.length <= 0) {
|
|
@@ -4274,20 +4869,23 @@ version: 4.2.5
|
|
|
4274
4869
|
* @ko {@link Panel}과 그 엘리먼트들을 관리하는 컴포넌트
|
|
4275
4870
|
*/
|
|
4276
4871
|
|
|
4277
|
-
var Renderer$1 =
|
|
4872
|
+
var Renderer$1 =
|
|
4873
|
+
/*#__PURE__*/
|
|
4874
|
+
function () {
|
|
4278
4875
|
/**
|
|
4279
4876
|
* @param {object} options An options object<ko>옵션 오브젝트</ko>
|
|
4280
|
-
* @param {Constants.ALIGN | string | number} [options.align] An {@link Flicking#align align} value that will be applied to all panels<ko>전체 패널에 적용될 {@link Flicking#align align} 값</ko>
|
|
4877
|
+
* @param {Constants.ALIGN | string | number} [options.align="center"] An {@link Flicking#align align} value that will be applied to all panels<ko>전체 패널에 적용될 {@link Flicking#align align} 값</ko>
|
|
4878
|
+
* @param {object} [options.strategy] An instance of RenderingStrategy(internal module)<ko>RenderingStrategy의 인스턴스(내부 모듈)</ko>
|
|
4281
4879
|
*/
|
|
4282
4880
|
function Renderer(_a) {
|
|
4283
|
-
var _b = _a
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4881
|
+
var _b = _a.align,
|
|
4882
|
+
align = _b === void 0 ? ALIGN.CENTER : _b,
|
|
4883
|
+
strategy = _a.strategy;
|
|
4287
4884
|
this._flicking = null;
|
|
4288
4885
|
this._panels = []; // Bind options
|
|
4289
4886
|
|
|
4290
4887
|
this._align = align;
|
|
4888
|
+
this._strategy = strategy;
|
|
4291
4889
|
}
|
|
4292
4890
|
|
|
4293
4891
|
var __proto = Renderer.prototype;
|
|
@@ -4320,6 +4918,16 @@ version: 4.2.5
|
|
|
4320
4918
|
enumerable: false,
|
|
4321
4919
|
configurable: true
|
|
4322
4920
|
});
|
|
4921
|
+
Object.defineProperty(__proto, "strategy", {
|
|
4922
|
+
/**
|
|
4923
|
+
* @internal
|
|
4924
|
+
*/
|
|
4925
|
+
get: function () {
|
|
4926
|
+
return this._strategy;
|
|
4927
|
+
},
|
|
4928
|
+
enumerable: false,
|
|
4929
|
+
configurable: true
|
|
4930
|
+
});
|
|
4323
4931
|
Object.defineProperty(__proto, "align", {
|
|
4324
4932
|
// Options Getter
|
|
4325
4933
|
|
|
@@ -4334,8 +4942,7 @@ version: 4.2.5
|
|
|
4334
4942
|
// Options Setter
|
|
4335
4943
|
set: function (val) {
|
|
4336
4944
|
this._align = val;
|
|
4337
|
-
|
|
4338
|
-
var panelAlign = this._getPanelAlign();
|
|
4945
|
+
var panelAlign = parsePanelAlign(val);
|
|
4339
4946
|
|
|
4340
4947
|
this._panels.forEach(function (panel) {
|
|
4341
4948
|
panel.align = panelAlign;
|
|
@@ -4381,6 +4988,14 @@ version: 4.2.5
|
|
|
4381
4988
|
__proto.getPanel = function (index) {
|
|
4382
4989
|
return this._panels[index] || null;
|
|
4383
4990
|
};
|
|
4991
|
+
|
|
4992
|
+
__proto.forceRenderAllPanels = function () {
|
|
4993
|
+
this._panels.forEach(function (panel) {
|
|
4994
|
+
return panel.markForShow();
|
|
4995
|
+
});
|
|
4996
|
+
|
|
4997
|
+
return Promise.resolve();
|
|
4998
|
+
};
|
|
4384
4999
|
/**
|
|
4385
5000
|
* Update all panel sizes
|
|
4386
5001
|
* @ko 모든 패널의 크기를 업데이트합니다
|
|
@@ -4390,10 +5005,15 @@ version: 4.2.5
|
|
|
4390
5005
|
|
|
4391
5006
|
|
|
4392
5007
|
__proto.updatePanelSize = function () {
|
|
4393
|
-
var flicking = getFlickingAttached(this._flicking
|
|
5008
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5009
|
+
var panels = this._panels;
|
|
5010
|
+
if (panels.length <= 0) return this;
|
|
4394
5011
|
|
|
4395
5012
|
if (flicking.panelsPerView > 0) {
|
|
4396
|
-
|
|
5013
|
+
var firstPanel = panels[0];
|
|
5014
|
+
firstPanel.resize();
|
|
5015
|
+
|
|
5016
|
+
this._updatePanelSizeByGrid(firstPanel, panels);
|
|
4397
5017
|
} else {
|
|
4398
5018
|
flicking.panels.forEach(function (panel) {
|
|
4399
5019
|
return panel.resize();
|
|
@@ -4407,8 +5027,10 @@ version: 4.2.5
|
|
|
4407
5027
|
* This will increase index of panels after by the number of panels added
|
|
4408
5028
|
* @ko 주어진 인덱스에 새로운 패널들을 추가합니다
|
|
4409
5029
|
* 해당 인덱스보다 같거나 큰 인덱스를 가진 기존 패널들은 추가한 패널의 개수만큼 인덱스가 증가합니다.
|
|
4410
|
-
* @param {
|
|
4411
|
-
* @param {
|
|
5030
|
+
* @param {Array<object>} items An array of items to insert<ko>추가할 아이템들의 배열</ko>
|
|
5031
|
+
* @param {number} [items.index] Index to insert new panels at<ko>새로 패널들을 추가할 인덱스</ko>
|
|
5032
|
+
* @param {any[]} [items.elements] An array of element or framework component with element in it<ko>엘리먼트의 배열 혹은 프레임워크에서 엘리먼트를 포함한 컴포넌트들의 배열</ko>
|
|
5033
|
+
* @param {boolean} [items.hasDOMInElements] Whether it contains actual DOM elements. If set to true, renderer will add them to the camera element<ko>내부에 실제 DOM 엘리먼트들을 포함하고 있는지 여부. true로 설정할 경우, 렌더러는 해당 엘리먼트들을 카메라 엘리먼트 내부에 추가합니다</ko>
|
|
4412
5034
|
* @return {Panel[]} An array of prepended panels<ko>추가된 패널들의 배열</ko>
|
|
4413
5035
|
*/
|
|
4414
5036
|
|
|
@@ -4423,11 +5045,10 @@ version: 4.2.5
|
|
|
4423
5045
|
}
|
|
4424
5046
|
|
|
4425
5047
|
var panels = this._panels;
|
|
4426
|
-
var flicking = getFlickingAttached(this._flicking
|
|
5048
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4427
5049
|
var control = flicking.control;
|
|
4428
|
-
|
|
4429
|
-
var align = this.
|
|
4430
|
-
|
|
5050
|
+
var prevFirstPanel = panels[0];
|
|
5051
|
+
var align = parsePanelAlign(this._align);
|
|
4431
5052
|
var allPanelsInserted = items.reduce(function (addedPanels, item) {
|
|
4432
5053
|
var _a;
|
|
4433
5054
|
|
|
@@ -4440,23 +5061,30 @@ version: 4.2.5
|
|
|
4440
5061
|
flicking: flicking
|
|
4441
5062
|
});
|
|
4442
5063
|
});
|
|
4443
|
-
panels.splice.apply(panels, __spreadArray([insertingIdx, 0], __read(panelsInserted)));
|
|
5064
|
+
panels.splice.apply(panels, __spreadArray([insertingIdx, 0], __read(panelsInserted)));
|
|
4444
5065
|
|
|
4445
|
-
|
|
5066
|
+
if (item.hasDOMInElements) {
|
|
5067
|
+
// Insert the actual elements as camera element's children
|
|
5068
|
+
_this._insertPanelElements(panelsInserted, (_a = panelsPushed[0]) !== null && _a !== void 0 ? _a : null);
|
|
5069
|
+
} // Resize the newly added panels
|
|
4446
5070
|
|
|
4447
5071
|
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
});
|
|
5072
|
+
if (flicking.panelsPerView > 0) {
|
|
5073
|
+
var firstPanel = prevFirstPanel || panelsInserted[0].resize();
|
|
4451
5074
|
|
|
4452
|
-
|
|
5075
|
+
_this._updatePanelSizeByGrid(firstPanel, panelsInserted);
|
|
5076
|
+
} else {
|
|
5077
|
+
panelsInserted.forEach(function (panel) {
|
|
5078
|
+
return panel.resize();
|
|
5079
|
+
});
|
|
5080
|
+
} // Update panel indexes & positions
|
|
4453
5081
|
|
|
4454
5082
|
|
|
4455
5083
|
panelsPushed.forEach(function (panel) {
|
|
4456
5084
|
panel.increaseIndex(panelsInserted.length);
|
|
4457
|
-
panel.
|
|
5085
|
+
panel.updatePosition();
|
|
4458
5086
|
});
|
|
4459
|
-
return __spreadArray(__spreadArray([], __read(addedPanels)), __read(panelsInserted));
|
|
5087
|
+
return __spreadArray(__spreadArray([], __read(addedPanels), false), __read(panelsInserted));
|
|
4460
5088
|
}, []);
|
|
4461
5089
|
if (allPanelsInserted.length <= 0) return []; // Update camera & control
|
|
4462
5090
|
|
|
@@ -4478,6 +5106,7 @@ version: 4.2.5
|
|
|
4478
5106
|
added: allPanelsInserted,
|
|
4479
5107
|
removed: []
|
|
4480
5108
|
}));
|
|
5109
|
+
this.checkPanelContentsReady(allPanelsInserted);
|
|
4481
5110
|
return allPanelsInserted;
|
|
4482
5111
|
};
|
|
4483
5112
|
/**
|
|
@@ -4485,8 +5114,10 @@ version: 4.2.5
|
|
|
4485
5114
|
* This will decrease index of panels after by the number of panels removed
|
|
4486
5115
|
* @ko 주어진 인덱스의 패널을 제거합니다
|
|
4487
5116
|
* 해당 인덱스보다 큰 인덱스를 가진 기존 패널들은 제거한 패널의 개수만큼 인덱스가 감소합니다
|
|
4488
|
-
* @param {
|
|
4489
|
-
* @param {number} [
|
|
5117
|
+
* @param {Array<object>} items An array of items to remove<ko>제거할 아이템들의 배열</ko>
|
|
5118
|
+
* @param {number} [items.index] Index of panel to remove<ko>제거할 패널의 인덱스</ko>
|
|
5119
|
+
* @param {number} [items.deleteCount=1] Number of panels to remove from index<ko>`index` 이후로 제거할 패널의 개수</ko>
|
|
5120
|
+
* @param {boolean} [items.hasDOMInElements=1] Whether it contains actual DOM elements. If set to true, renderer will remove them from the camera element<ko>내부에 실제 DOM 엘리먼트들을 포함하고 있는지 여부. true로 설정할 경우, 렌더러는 해당 엘리먼트들을 카메라 엘리먼트 내부에서 제거합니다</ko>
|
|
4490
5121
|
* @return An array of removed panels<ko>제거된 패널들의 배열</ko>
|
|
4491
5122
|
*/
|
|
4492
5123
|
|
|
@@ -4501,7 +5132,7 @@ version: 4.2.5
|
|
|
4501
5132
|
}
|
|
4502
5133
|
|
|
4503
5134
|
var panels = this._panels;
|
|
4504
|
-
var flicking = getFlickingAttached(this._flicking
|
|
5135
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4505
5136
|
var camera = flicking.camera,
|
|
4506
5137
|
control = flicking.control;
|
|
4507
5138
|
var activePanel = control.activePanel;
|
|
@@ -4514,28 +5145,29 @@ version: 4.2.5
|
|
|
4514
5145
|
var panelsRemoved = panels.splice(removingIdx, deleteCount);
|
|
4515
5146
|
if (panelsRemoved.length <= 0) return []; // Update panel indexes & positions
|
|
4516
5147
|
|
|
4517
|
-
var removedSize = _this._getPanelSizeSum(panelsRemoved);
|
|
4518
|
-
|
|
4519
5148
|
panelsPulled.forEach(function (panel) {
|
|
4520
5149
|
panel.decreaseIndex(panelsRemoved.length);
|
|
4521
|
-
panel.
|
|
5150
|
+
panel.updatePosition();
|
|
4522
5151
|
});
|
|
4523
5152
|
|
|
4524
|
-
|
|
5153
|
+
if (item.hasDOMInElements) {
|
|
5154
|
+
_this._removePanelElements(panelsRemoved);
|
|
5155
|
+
} // Remove panel elements
|
|
4525
5156
|
|
|
4526
5157
|
|
|
4527
5158
|
panelsRemoved.forEach(function (panel) {
|
|
4528
5159
|
return panel.destroy();
|
|
4529
|
-
});
|
|
4530
|
-
|
|
4531
|
-
_this._updateCameraAndControl();
|
|
5160
|
+
});
|
|
4532
5161
|
|
|
4533
5162
|
if (includes(panelsRemoved, activePanel)) {
|
|
4534
5163
|
control.resetActive();
|
|
4535
5164
|
}
|
|
4536
5165
|
|
|
4537
|
-
return __spreadArray(__spreadArray([], __read(removed)), __read(panelsRemoved));
|
|
4538
|
-
}, []);
|
|
5166
|
+
return __spreadArray(__spreadArray([], __read(removed), false), __read(panelsRemoved));
|
|
5167
|
+
}, []); // Update camera & control
|
|
5168
|
+
|
|
5169
|
+
this._updateCameraAndControl();
|
|
5170
|
+
|
|
4539
5171
|
void this.render(); // FIXME: fix for animating case
|
|
4540
5172
|
|
|
4541
5173
|
if (allPanelsRemoved.length > 0 && !control.animating) {
|
|
@@ -4560,21 +5192,79 @@ version: 4.2.5
|
|
|
4560
5192
|
}));
|
|
4561
5193
|
return allPanelsRemoved;
|
|
4562
5194
|
};
|
|
5195
|
+
/**
|
|
5196
|
+
* @internal
|
|
5197
|
+
*/
|
|
4563
5198
|
|
|
4564
|
-
__proto._getPanelAlign = function () {
|
|
4565
|
-
var align = this._align;
|
|
4566
|
-
return typeof align === "object" ? align.panel : align;
|
|
4567
|
-
};
|
|
4568
5199
|
|
|
4569
|
-
__proto.
|
|
4570
|
-
var
|
|
4571
|
-
|
|
4572
|
-
var
|
|
4573
|
-
|
|
5200
|
+
__proto.checkPanelContentsReady = function (checkingPanels) {
|
|
5201
|
+
var _this = this;
|
|
5202
|
+
|
|
5203
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5204
|
+
var resizeOnContentsReady = flicking.resizeOnContentsReady;
|
|
5205
|
+
var panels = this._panels;
|
|
5206
|
+
if (!resizeOnContentsReady || flicking.virtualEnabled) return;
|
|
5207
|
+
|
|
5208
|
+
var hasContents = function (panel) {
|
|
5209
|
+
return !!panel.element.querySelector("img, video");
|
|
5210
|
+
};
|
|
5211
|
+
|
|
5212
|
+
checkingPanels = checkingPanels.filter(function (panel) {
|
|
5213
|
+
return hasContents(panel);
|
|
5214
|
+
});
|
|
5215
|
+
if (checkingPanels.length <= 0) return;
|
|
5216
|
+
var contentsReadyChecker = new ImReady();
|
|
5217
|
+
checkingPanels.forEach(function (panel) {
|
|
5218
|
+
panel.loading = true;
|
|
5219
|
+
});
|
|
5220
|
+
contentsReadyChecker.on("readyElement", function (e) {
|
|
5221
|
+
if (!_this._flicking) {
|
|
5222
|
+
// Renderer's destroy() is called before
|
|
5223
|
+
contentsReadyChecker.destroy();
|
|
5224
|
+
return;
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
var panel = checkingPanels[e.index];
|
|
5228
|
+
var camera = flicking.camera;
|
|
5229
|
+
var control = flicking.control;
|
|
5230
|
+
var prevProgressInPanel = control.activePanel ? camera.getProgressInPanel(control.activePanel) : 0;
|
|
5231
|
+
panel.loading = false;
|
|
5232
|
+
panel.resize();
|
|
5233
|
+
panels.slice(panel.index + 1).forEach(function (panelBehind) {
|
|
5234
|
+
return panelBehind.updatePosition();
|
|
5235
|
+
});
|
|
5236
|
+
if (!flicking.initialized) return;
|
|
5237
|
+
camera.updateRange();
|
|
5238
|
+
camera.updateAnchors();
|
|
5239
|
+
|
|
5240
|
+
if (control.animating) ; else {
|
|
5241
|
+
control.updatePosition(prevProgressInPanel);
|
|
5242
|
+
control.updateInput();
|
|
5243
|
+
}
|
|
5244
|
+
});
|
|
5245
|
+
contentsReadyChecker.on("preReady", function (e) {
|
|
5246
|
+
if (_this._flicking) {
|
|
5247
|
+
void _this.render();
|
|
5248
|
+
}
|
|
5249
|
+
|
|
5250
|
+
if (e.readyCount === e.totalCount) {
|
|
5251
|
+
contentsReadyChecker.destroy();
|
|
5252
|
+
}
|
|
5253
|
+
});
|
|
5254
|
+
contentsReadyChecker.on("ready", function () {
|
|
5255
|
+
if (_this._flicking) {
|
|
5256
|
+
void _this.render();
|
|
5257
|
+
}
|
|
5258
|
+
|
|
5259
|
+
contentsReadyChecker.destroy();
|
|
5260
|
+
});
|
|
5261
|
+
contentsReadyChecker.check(checkingPanels.map(function (panel) {
|
|
5262
|
+
return panel.element;
|
|
5263
|
+
}));
|
|
4574
5264
|
};
|
|
4575
5265
|
|
|
4576
5266
|
__proto._updateCameraAndControl = function () {
|
|
4577
|
-
var flicking = getFlickingAttached(this._flicking
|
|
5267
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4578
5268
|
var camera = flicking.camera,
|
|
4579
5269
|
control = flicking.control;
|
|
4580
5270
|
camera.updateRange();
|
|
@@ -4583,18 +5273,6 @@ version: 4.2.5
|
|
|
4583
5273
|
control.updateInput();
|
|
4584
5274
|
};
|
|
4585
5275
|
|
|
4586
|
-
__proto._updateRenderingPanels = function () {
|
|
4587
|
-
var flicking = getFlickingAttached(this._flicking, "Renderer");
|
|
4588
|
-
|
|
4589
|
-
if (flicking.renderOnlyVisible) {
|
|
4590
|
-
this._showOnlyVisiblePanels(flicking);
|
|
4591
|
-
} else {
|
|
4592
|
-
flicking.panels.forEach(function (panel) {
|
|
4593
|
-
return panel.markForShow();
|
|
4594
|
-
});
|
|
4595
|
-
}
|
|
4596
|
-
};
|
|
4597
|
-
|
|
4598
5276
|
__proto._showOnlyVisiblePanels = function (flicking) {
|
|
4599
5277
|
var panels = flicking.renderer.panels;
|
|
4600
5278
|
var camera = flicking.camera;
|
|
@@ -4603,7 +5281,7 @@ version: 4.2.5
|
|
|
4603
5281
|
return visibles;
|
|
4604
5282
|
}, {});
|
|
4605
5283
|
panels.forEach(function (panel) {
|
|
4606
|
-
if (panel.index in visibleIndexes) {
|
|
5284
|
+
if (panel.index in visibleIndexes || panel.loading) {
|
|
4607
5285
|
panel.markForShow();
|
|
4608
5286
|
} else if (!flicking.holding) {
|
|
4609
5287
|
// During the input sequence,
|
|
@@ -4611,23 +5289,19 @@ version: 4.2.5
|
|
|
4611
5289
|
panel.markForHide();
|
|
4612
5290
|
}
|
|
4613
5291
|
});
|
|
4614
|
-
camera.updateOffset();
|
|
4615
5292
|
};
|
|
4616
5293
|
|
|
4617
|
-
__proto._updatePanelSizeByGrid = function (
|
|
4618
|
-
var
|
|
5294
|
+
__proto._updatePanelSizeByGrid = function (referencePanel, panels) {
|
|
5295
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
4619
5296
|
var panelsPerView = flicking.panelsPerView;
|
|
4620
5297
|
|
|
4621
5298
|
if (panelsPerView <= 0) {
|
|
4622
5299
|
throw new FlickingError(MESSAGE.WRONG_OPTION("panelsPerView", panelsPerView), CODE.WRONG_OPTION);
|
|
4623
5300
|
}
|
|
4624
5301
|
|
|
4625
|
-
if (panels.length <= 0) return;
|
|
4626
|
-
|
|
4627
|
-
var firstPanel = panels[0];
|
|
4628
|
-
firstPanel.resize();
|
|
5302
|
+
if (panels.length <= 0) return;
|
|
4629
5303
|
var viewportSize = flicking.camera.size;
|
|
4630
|
-
var gap =
|
|
5304
|
+
var gap = referencePanel.margin.prev + referencePanel.margin.next;
|
|
4631
5305
|
var panelSize = (viewportSize - gap * (panelsPerView - 1)) / panelsPerView;
|
|
4632
5306
|
var panelSizeObj = flicking.horizontal ? {
|
|
4633
5307
|
width: panelSize
|
|
@@ -4636,14 +5310,12 @@ version: 4.2.5
|
|
|
4636
5310
|
};
|
|
4637
5311
|
var firstPanelSizeObj = {
|
|
4638
5312
|
size: panelSize,
|
|
4639
|
-
height:
|
|
4640
|
-
margin:
|
|
5313
|
+
height: referencePanel.height,
|
|
5314
|
+
margin: referencePanel.margin
|
|
4641
5315
|
};
|
|
4642
5316
|
|
|
4643
5317
|
if (!flicking.noPanelStyleOverride) {
|
|
4644
|
-
|
|
4645
|
-
return panel.setSize(panelSizeObj);
|
|
4646
|
-
});
|
|
5318
|
+
this._strategy.updatePanelSizes(flicking, panelSizeObj);
|
|
4647
5319
|
}
|
|
4648
5320
|
|
|
4649
5321
|
flicking.panels.forEach(function (panel) {
|
|
@@ -4651,29 +5323,202 @@ version: 4.2.5
|
|
|
4651
5323
|
});
|
|
4652
5324
|
};
|
|
4653
5325
|
|
|
5326
|
+
__proto._removeAllChildsFromCamera = function () {
|
|
5327
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5328
|
+
var cameraElement = flicking.camera.element; // Remove other elements
|
|
5329
|
+
|
|
5330
|
+
while (cameraElement.firstChild) {
|
|
5331
|
+
cameraElement.removeChild(cameraElement.firstChild);
|
|
5332
|
+
}
|
|
5333
|
+
};
|
|
5334
|
+
|
|
5335
|
+
__proto._insertPanelElements = function (panels, nextSibling) {
|
|
5336
|
+
if (nextSibling === void 0) {
|
|
5337
|
+
nextSibling = null;
|
|
5338
|
+
}
|
|
5339
|
+
|
|
5340
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5341
|
+
var camera = flicking.camera;
|
|
5342
|
+
var cameraElement = camera.element;
|
|
5343
|
+
var nextSiblingElement = (nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.element) || null;
|
|
5344
|
+
var fragment = document.createDocumentFragment();
|
|
5345
|
+
panels.forEach(function (panel) {
|
|
5346
|
+
return fragment.appendChild(panel.element);
|
|
5347
|
+
});
|
|
5348
|
+
cameraElement.insertBefore(fragment, nextSiblingElement);
|
|
5349
|
+
};
|
|
5350
|
+
|
|
5351
|
+
__proto._removePanelElements = function (panels) {
|
|
5352
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5353
|
+
var cameraElement = flicking.camera.element;
|
|
5354
|
+
panels.forEach(function (panel) {
|
|
5355
|
+
cameraElement.removeChild(panel.element);
|
|
5356
|
+
});
|
|
5357
|
+
};
|
|
5358
|
+
|
|
4654
5359
|
return Renderer;
|
|
4655
5360
|
}();
|
|
4656
5361
|
|
|
4657
|
-
|
|
5362
|
+
/**
|
|
5363
|
+
*
|
|
5364
|
+
*/
|
|
5365
|
+
|
|
5366
|
+
var VanillaRenderer =
|
|
5367
|
+
/*#__PURE__*/
|
|
5368
|
+
function (_super) {
|
|
5369
|
+
__extends(VanillaRenderer, _super);
|
|
5370
|
+
|
|
5371
|
+
function VanillaRenderer() {
|
|
5372
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5373
|
+
} // eslint-disable-next-line @typescript-eslint/require-await
|
|
5374
|
+
|
|
5375
|
+
|
|
5376
|
+
var __proto = VanillaRenderer.prototype;
|
|
5377
|
+
|
|
5378
|
+
__proto.render = function () {
|
|
5379
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5380
|
+
var flicking, strategy;
|
|
5381
|
+
return __generator(this, function (_a) {
|
|
5382
|
+
flicking = getFlickingAttached(this._flicking);
|
|
5383
|
+
strategy = this._strategy;
|
|
5384
|
+
strategy.updateRenderingPanels(flicking);
|
|
5385
|
+
strategy.renderPanels(flicking);
|
|
5386
|
+
|
|
5387
|
+
this._resetPanelElementOrder();
|
|
5388
|
+
|
|
5389
|
+
return [2
|
|
5390
|
+
/*return*/
|
|
5391
|
+
];
|
|
5392
|
+
});
|
|
5393
|
+
});
|
|
5394
|
+
};
|
|
5395
|
+
|
|
5396
|
+
__proto._collectPanels = function () {
|
|
5397
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5398
|
+
var camera = flicking.camera;
|
|
5399
|
+
|
|
5400
|
+
this._removeAllTextNodes();
|
|
5401
|
+
|
|
5402
|
+
this._panels = this._strategy.collectPanels(flicking, camera.children);
|
|
5403
|
+
};
|
|
5404
|
+
|
|
5405
|
+
__proto._createPanel = function (el, options) {
|
|
5406
|
+
return this._strategy.createPanel(el, options);
|
|
5407
|
+
};
|
|
5408
|
+
|
|
5409
|
+
__proto._resetPanelElementOrder = function () {
|
|
5410
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5411
|
+
var cameraEl = flicking.camera.element; // We're using reversed panels here as last panel should be the last element of camera element
|
|
5412
|
+
|
|
5413
|
+
var reversedElements = this._strategy.getRenderingElementsByOrder(flicking).reverse();
|
|
5414
|
+
|
|
5415
|
+
reversedElements.forEach(function (el, idx) {
|
|
5416
|
+
var nextEl = reversedElements[idx - 1] ? reversedElements[idx - 1] : null;
|
|
5417
|
+
|
|
5418
|
+
if (el.nextElementSibling !== nextEl) {
|
|
5419
|
+
cameraEl.insertBefore(el, nextEl);
|
|
5420
|
+
}
|
|
5421
|
+
});
|
|
5422
|
+
};
|
|
5423
|
+
|
|
5424
|
+
__proto._removeAllTextNodes = function () {
|
|
5425
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
5426
|
+
var cameraElement = flicking.camera.element; // Remove all text nodes in the camera element
|
|
5427
|
+
|
|
5428
|
+
toArray(cameraElement.childNodes).forEach(function (node) {
|
|
5429
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
5430
|
+
cameraElement.removeChild(node);
|
|
5431
|
+
}
|
|
5432
|
+
});
|
|
5433
|
+
};
|
|
5434
|
+
|
|
5435
|
+
return VanillaRenderer;
|
|
5436
|
+
}(Renderer$1);
|
|
5437
|
+
|
|
5438
|
+
/**
|
|
5439
|
+
* @internal
|
|
5440
|
+
*/
|
|
5441
|
+
|
|
5442
|
+
var ExternalRenderer =
|
|
5443
|
+
/*#__PURE__*/
|
|
5444
|
+
function (_super) {
|
|
5445
|
+
__extends(ExternalRenderer, _super);
|
|
5446
|
+
|
|
5447
|
+
function ExternalRenderer() {
|
|
5448
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5449
|
+
}
|
|
5450
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5451
|
+
|
|
5452
|
+
|
|
5453
|
+
var __proto = ExternalRenderer.prototype;
|
|
5454
|
+
|
|
5455
|
+
__proto._removePanelElements = function (panels) {// DO NOTHING, overrided to prevent an unexpected error
|
|
5456
|
+
};
|
|
5457
|
+
|
|
5458
|
+
__proto._removeAllChildsFromCamera = function () {// DO NOTHING, overrided to prevent an unexpected error
|
|
5459
|
+
};
|
|
5460
|
+
|
|
5461
|
+
return ExternalRenderer;
|
|
5462
|
+
}(Renderer$1);
|
|
5463
|
+
|
|
5464
|
+
/**
|
|
5465
|
+
* A slide data component that holds information of a single HTMLElement
|
|
5466
|
+
* @ko 슬라이드 데이터 컴포넌트로, 단일 HTMLElement의 정보를 갖고 있습니다
|
|
5467
|
+
*/
|
|
5468
|
+
|
|
5469
|
+
var Panel =
|
|
5470
|
+
/*#__PURE__*/
|
|
5471
|
+
function () {
|
|
4658
5472
|
/**
|
|
4659
5473
|
* @param {object} options An options object<ko>옵션 오브젝트</ko>
|
|
4660
5474
|
* @param {number} [options.index] An initial index of the panel<ko>패널의 초기 인덱스</ko>
|
|
4661
5475
|
* @param {Constants.ALIGN | string | number} [options.align] An initial {@link Flicking#align align} value of the panel<ko>패널의 초기 {@link Flicking#align align}값</ko>
|
|
4662
5476
|
* @param {Flicking} [options.flicking] A Flicking instance panel's referencing<ko>패널이 참조하는 {@link Flicking} 인스턴스</ko>
|
|
5477
|
+
* @param {Flicking} [options.elementProvider] A provider instance that redirects elements<ko>실제 엘리먼트를 반환하는 엘리먼트 공급자의 인스턴스</ko>
|
|
4663
5478
|
*/
|
|
4664
5479
|
function Panel(_a) {
|
|
4665
5480
|
var index = _a.index,
|
|
4666
5481
|
align = _a.align,
|
|
4667
|
-
flicking = _a.flicking
|
|
5482
|
+
flicking = _a.flicking,
|
|
5483
|
+
elementProvider = _a.elementProvider;
|
|
4668
5484
|
this._index = index;
|
|
4669
5485
|
this._flicking = flicking;
|
|
5486
|
+
this._elProvider = elementProvider;
|
|
4670
5487
|
this._align = align;
|
|
4671
5488
|
this._removed = false;
|
|
5489
|
+
this._rendered = true;
|
|
5490
|
+
this._loading = false;
|
|
4672
5491
|
|
|
4673
5492
|
this._resetInternalStates();
|
|
4674
5493
|
}
|
|
4675
5494
|
|
|
4676
5495
|
var __proto = Panel.prototype;
|
|
5496
|
+
Object.defineProperty(__proto, "element", {
|
|
5497
|
+
// Internal States Getter
|
|
5498
|
+
|
|
5499
|
+
/**
|
|
5500
|
+
* `HTMLElement` that panel's referencing
|
|
5501
|
+
* @ko 패널이 참조하고 있는 `HTMLElement`
|
|
5502
|
+
* @type {HTMLElement}
|
|
5503
|
+
* @readonly
|
|
5504
|
+
*/
|
|
5505
|
+
get: function () {
|
|
5506
|
+
return this._elProvider.element;
|
|
5507
|
+
},
|
|
5508
|
+
enumerable: false,
|
|
5509
|
+
configurable: true
|
|
5510
|
+
});
|
|
5511
|
+
Object.defineProperty(__proto, "elementProvider", {
|
|
5512
|
+
/**
|
|
5513
|
+
* @internal
|
|
5514
|
+
* @readonly
|
|
5515
|
+
*/
|
|
5516
|
+
get: function () {
|
|
5517
|
+
return this._elProvider;
|
|
5518
|
+
},
|
|
5519
|
+
enumerable: false,
|
|
5520
|
+
configurable: true
|
|
5521
|
+
});
|
|
4677
5522
|
Object.defineProperty(__proto, "index", {
|
|
4678
5523
|
/**
|
|
4679
5524
|
* Index of the panel
|
|
@@ -4786,6 +5631,35 @@ version: 4.2.5
|
|
|
4786
5631
|
enumerable: false,
|
|
4787
5632
|
configurable: true
|
|
4788
5633
|
});
|
|
5634
|
+
Object.defineProperty(__proto, "rendered", {
|
|
5635
|
+
/**
|
|
5636
|
+
* A value indicating whether the panel's element is being rendered on the screen
|
|
5637
|
+
* @ko 패널의 엘리먼트가 화면상에 렌더링되고있는지 여부를 나타내는 값
|
|
5638
|
+
* @type {boolean}
|
|
5639
|
+
* @readonly
|
|
5640
|
+
*/
|
|
5641
|
+
get: function () {
|
|
5642
|
+
return this._rendered;
|
|
5643
|
+
},
|
|
5644
|
+
enumerable: false,
|
|
5645
|
+
configurable: true
|
|
5646
|
+
});
|
|
5647
|
+
Object.defineProperty(__proto, "loading", {
|
|
5648
|
+
/**
|
|
5649
|
+
* A value indicating whether the panel's image/video is not loaded and waiting for resize
|
|
5650
|
+
* @ko 패널 내부의 이미지/비디오가 아직 로드되지 않아 {@link Panel#resize resize}될 것인지를 나타내는 값
|
|
5651
|
+
* @type {boolean}
|
|
5652
|
+
* @readonly
|
|
5653
|
+
*/
|
|
5654
|
+
get: function () {
|
|
5655
|
+
return this._loading;
|
|
5656
|
+
},
|
|
5657
|
+
set: function (val) {
|
|
5658
|
+
this._loading = val;
|
|
5659
|
+
},
|
|
5660
|
+
enumerable: false,
|
|
5661
|
+
configurable: true
|
|
5662
|
+
});
|
|
4789
5663
|
Object.defineProperty(__proto, "range", {
|
|
4790
5664
|
/**
|
|
4791
5665
|
* Panel element's range of the bounding box
|
|
@@ -4934,13 +5808,34 @@ version: 4.2.5
|
|
|
4934
5808
|
get: function () {
|
|
4935
5809
|
return this._align;
|
|
4936
5810
|
},
|
|
4937
|
-
// Options
|
|
5811
|
+
// Options Setter
|
|
4938
5812
|
set: function (val) {
|
|
4939
5813
|
this._align = val;
|
|
4940
5814
|
},
|
|
4941
5815
|
enumerable: false,
|
|
4942
5816
|
configurable: true
|
|
4943
5817
|
});
|
|
5818
|
+
/**
|
|
5819
|
+
* Mark panel element to be appended on the camera element
|
|
5820
|
+
* @internal
|
|
5821
|
+
*/
|
|
5822
|
+
|
|
5823
|
+
__proto.markForShow = function () {
|
|
5824
|
+
this._rendered = true;
|
|
5825
|
+
|
|
5826
|
+
this._elProvider.show(this._flicking);
|
|
5827
|
+
};
|
|
5828
|
+
/**
|
|
5829
|
+
* Mark panel element to be removed from the camera element
|
|
5830
|
+
* @internal
|
|
5831
|
+
*/
|
|
5832
|
+
|
|
5833
|
+
|
|
5834
|
+
__proto.markForHide = function () {
|
|
5835
|
+
this._rendered = false;
|
|
5836
|
+
|
|
5837
|
+
this._elProvider.hide(this._flicking);
|
|
5838
|
+
};
|
|
4944
5839
|
/**
|
|
4945
5840
|
* Update size of the panel
|
|
4946
5841
|
* @ko 패널의 크기를 갱신합니다
|
|
@@ -4949,18 +5844,18 @@ version: 4.2.5
|
|
|
4949
5844
|
* @return {this}
|
|
4950
5845
|
*/
|
|
4951
5846
|
|
|
5847
|
+
|
|
4952
5848
|
__proto.resize = function (cached) {
|
|
4953
5849
|
var el = this.element;
|
|
4954
|
-
var elStyle = getStyle(el);
|
|
4955
5850
|
var flicking = this._flicking;
|
|
4956
5851
|
var horizontal = flicking.horizontal;
|
|
4957
|
-
var prevPanel = flicking.renderer.panels[this._index - 1];
|
|
4958
5852
|
|
|
4959
5853
|
if (cached) {
|
|
4960
5854
|
this._size = cached.size;
|
|
4961
5855
|
this._margin = __assign({}, cached.margin);
|
|
4962
5856
|
this._height = cached.height;
|
|
4963
5857
|
} else {
|
|
5858
|
+
var elStyle = getStyle(el);
|
|
4964
5859
|
this._size = horizontal ? el.offsetWidth : el.offsetHeight;
|
|
4965
5860
|
this._margin = horizontal ? {
|
|
4966
5861
|
prev: parseFloat(elStyle.marginLeft || "0"),
|
|
@@ -4972,7 +5867,7 @@ version: 4.2.5
|
|
|
4972
5867
|
this._height = horizontal ? el.offsetHeight : this._size;
|
|
4973
5868
|
}
|
|
4974
5869
|
|
|
4975
|
-
this.
|
|
5870
|
+
this.updatePosition();
|
|
4976
5871
|
|
|
4977
5872
|
this._updateAlignPos();
|
|
4978
5873
|
|
|
@@ -4989,27 +5884,8 @@ version: 4.2.5
|
|
|
4989
5884
|
*/
|
|
4990
5885
|
|
|
4991
5886
|
|
|
4992
|
-
__proto.setSize = function (
|
|
4993
|
-
|
|
4994
|
-
height = _a.height;
|
|
4995
|
-
var el = this.element;
|
|
4996
|
-
|
|
4997
|
-
if (width != null) {
|
|
4998
|
-
if (isString(width)) {
|
|
4999
|
-
el.style.width = width;
|
|
5000
|
-
} else {
|
|
5001
|
-
el.style.width = width + "px";
|
|
5002
|
-
}
|
|
5003
|
-
}
|
|
5004
|
-
|
|
5005
|
-
if (height != null) {
|
|
5006
|
-
if (isString(height)) {
|
|
5007
|
-
el.style.height = height;
|
|
5008
|
-
} else {
|
|
5009
|
-
el.style.height = height + "px";
|
|
5010
|
-
}
|
|
5011
|
-
}
|
|
5012
|
-
|
|
5887
|
+
__proto.setSize = function (size) {
|
|
5888
|
+
setSize(this.element, size);
|
|
5013
5889
|
return this;
|
|
5014
5890
|
};
|
|
5015
5891
|
/**
|
|
@@ -5054,7 +5930,7 @@ version: 4.2.5
|
|
|
5054
5930
|
return this.includeRange(pos, pos, includeMargin);
|
|
5055
5931
|
};
|
|
5056
5932
|
/**
|
|
5057
|
-
* Check whether the given range is fully included in this panel's area
|
|
5933
|
+
* Check whether the given range is fully included in this panel's area (inclusive)
|
|
5058
5934
|
* @ko 주어진 범위가 이 패널 내부에 완전히 포함되는지를 반환합니다
|
|
5059
5935
|
* @param {number} min Minimum value of the range to check<ko>확인하고자 하는 최소 범위</ko>
|
|
5060
5936
|
* @param {number} max Maximum value of the range to check<ko>확인하고자 하는 최대 범위</ko>
|
|
@@ -5078,6 +5954,19 @@ version: 4.2.5
|
|
|
5078
5954
|
|
|
5079
5955
|
return max >= panelRange.min && min <= panelRange.max;
|
|
5080
5956
|
};
|
|
5957
|
+
/**
|
|
5958
|
+
* Check whether the panel is visble in the given range (exclusive)
|
|
5959
|
+
* @ko 주어진 범위 내에서 이 패널의 일부가 보여지는지를 반환합니다
|
|
5960
|
+
* @param {number} min Minimum value of the range to check<ko>확인하고자 하는 최소 범위</ko>
|
|
5961
|
+
* @param {number} max Maximum value of the range to check<ko>확인하고자 하는 최대 범위</ko>
|
|
5962
|
+
* @returns {boolean} A Boolean value indicating whether the panel is visible<ko>해당 범위 내에서 패널을 볼 수 있는지 여부</ko>
|
|
5963
|
+
*/
|
|
5964
|
+
|
|
5965
|
+
|
|
5966
|
+
__proto.isVisibleOnRange = function (min, max) {
|
|
5967
|
+
var panelRange = this.range;
|
|
5968
|
+
return max > panelRange.min && min < panelRange.max;
|
|
5969
|
+
};
|
|
5081
5970
|
/**
|
|
5082
5971
|
* Move {@link Camera} to this panel
|
|
5083
5972
|
* @ko {@link Camera}를 이 패널로 이동합니다
|
|
@@ -5152,33 +6041,13 @@ version: 4.2.5
|
|
|
5152
6041
|
return this;
|
|
5153
6042
|
};
|
|
5154
6043
|
/**
|
|
5155
|
-
* Increase panel's position by the given value
|
|
5156
|
-
* @ko 패널의 위치를 주어진 값만큼 증가시킵니다
|
|
5157
|
-
* @internal
|
|
5158
|
-
* @chainable
|
|
5159
|
-
* @param val An integer greater than or equal to 0<ko>0보다 같거나 큰 정수</ko>
|
|
5160
|
-
* @returns {this}
|
|
5161
|
-
*/
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
__proto.increasePosition = function (val) {
|
|
5165
|
-
this._moveBy(Math.max(val, 0));
|
|
5166
|
-
|
|
5167
|
-
return this;
|
|
5168
|
-
};
|
|
5169
|
-
/**
|
|
5170
|
-
* Decrease panel's position by the given value
|
|
5171
|
-
* @ko 패널의위치를 주어진 값만큼 감소시킵니다
|
|
5172
6044
|
* @internal
|
|
5173
|
-
* @chainable
|
|
5174
|
-
* @param val An integer greater than or equal to 0<ko>0보다 같거나 큰 정수</ko>
|
|
5175
|
-
* @returns {this}
|
|
5176
6045
|
*/
|
|
5177
6046
|
|
|
5178
6047
|
|
|
5179
|
-
__proto.
|
|
5180
|
-
this.
|
|
5181
|
-
|
|
6048
|
+
__proto.updatePosition = function () {
|
|
6049
|
+
var prevPanel = this._flicking.renderer.panels[this._index - 1];
|
|
6050
|
+
this._pos = prevPanel ? prevPanel.range.max + prevPanel.margin.next + this._margin.prev : this._margin.prev;
|
|
5182
6051
|
return this;
|
|
5183
6052
|
};
|
|
5184
6053
|
/**
|
|
@@ -5246,11 +6115,6 @@ version: 4.2.5
|
|
|
5246
6115
|
return this;
|
|
5247
6116
|
};
|
|
5248
6117
|
|
|
5249
|
-
__proto._moveBy = function (val) {
|
|
5250
|
-
this._pos += val;
|
|
5251
|
-
return this;
|
|
5252
|
-
};
|
|
5253
|
-
|
|
5254
6118
|
__proto._updateAlignPos = function () {
|
|
5255
6119
|
this._alignPos = parseAlign$1(this._align, this._size);
|
|
5256
6120
|
};
|
|
@@ -5269,7 +6133,103 @@ version: 4.2.5
|
|
|
5269
6133
|
this._toggleDirection = DIRECTION.NONE;
|
|
5270
6134
|
};
|
|
5271
6135
|
|
|
5272
|
-
return Panel;
|
|
6136
|
+
return Panel;
|
|
6137
|
+
}();
|
|
6138
|
+
|
|
6139
|
+
var NormalRenderingStrategy =
|
|
6140
|
+
/*#__PURE__*/
|
|
6141
|
+
function () {
|
|
6142
|
+
function NormalRenderingStrategy(_a) {
|
|
6143
|
+
var providerCtor = _a.providerCtor;
|
|
6144
|
+
this._providerCtor = providerCtor;
|
|
6145
|
+
}
|
|
6146
|
+
|
|
6147
|
+
var __proto = NormalRenderingStrategy.prototype;
|
|
6148
|
+
|
|
6149
|
+
__proto.renderPanels = function () {// DO_NOTHING
|
|
6150
|
+
};
|
|
6151
|
+
|
|
6152
|
+
__proto.getRenderingIndexesByOrder = function (flicking) {
|
|
6153
|
+
var renderedPanels = flicking.renderer.panels.filter(function (panel) {
|
|
6154
|
+
return panel.rendered;
|
|
6155
|
+
});
|
|
6156
|
+
var toggledPrev = renderedPanels.filter(function (panel) {
|
|
6157
|
+
return panel.toggled && panel.toggleDirection === DIRECTION.PREV;
|
|
6158
|
+
});
|
|
6159
|
+
var toggledNext = renderedPanels.filter(function (panel) {
|
|
6160
|
+
return panel.toggled && panel.toggleDirection === DIRECTION.NEXT;
|
|
6161
|
+
});
|
|
6162
|
+
var notToggled = renderedPanels.filter(function (panel) {
|
|
6163
|
+
return !panel.toggled;
|
|
6164
|
+
});
|
|
6165
|
+
return __spreadArray(__spreadArray(__spreadArray([], __read(toggledPrev), false), __read(notToggled), false), __read(toggledNext)).map(function (panel) {
|
|
6166
|
+
return panel.index;
|
|
6167
|
+
});
|
|
6168
|
+
};
|
|
6169
|
+
|
|
6170
|
+
__proto.getRenderingElementsByOrder = function (flicking) {
|
|
6171
|
+
var panels = flicking.panels;
|
|
6172
|
+
return this.getRenderingIndexesByOrder(flicking).map(function (index) {
|
|
6173
|
+
return panels[index].element;
|
|
6174
|
+
});
|
|
6175
|
+
};
|
|
6176
|
+
|
|
6177
|
+
__proto.updateRenderingPanels = function (flicking) {
|
|
6178
|
+
if (flicking.renderOnlyVisible) {
|
|
6179
|
+
this._showOnlyVisiblePanels(flicking);
|
|
6180
|
+
} else {
|
|
6181
|
+
flicking.panels.forEach(function (panel) {
|
|
6182
|
+
return panel.markForShow();
|
|
6183
|
+
});
|
|
6184
|
+
}
|
|
6185
|
+
};
|
|
6186
|
+
|
|
6187
|
+
__proto.collectPanels = function (flicking, elements) {
|
|
6188
|
+
var _this = this;
|
|
6189
|
+
|
|
6190
|
+
var align = parsePanelAlign(flicking.renderer.align);
|
|
6191
|
+
return elements.map(function (el, index) {
|
|
6192
|
+
return new Panel({
|
|
6193
|
+
index: index,
|
|
6194
|
+
elementProvider: new _this._providerCtor(el),
|
|
6195
|
+
align: align,
|
|
6196
|
+
flicking: flicking
|
|
6197
|
+
});
|
|
6198
|
+
});
|
|
6199
|
+
};
|
|
6200
|
+
|
|
6201
|
+
__proto.createPanel = function (element, options) {
|
|
6202
|
+
return new Panel(__assign(__assign({}, options), {
|
|
6203
|
+
elementProvider: new this._providerCtor(element)
|
|
6204
|
+
}));
|
|
6205
|
+
};
|
|
6206
|
+
|
|
6207
|
+
__proto.updatePanelSizes = function (flicking, size) {
|
|
6208
|
+
flicking.panels.forEach(function (panel) {
|
|
6209
|
+
return panel.setSize(size);
|
|
6210
|
+
});
|
|
6211
|
+
};
|
|
6212
|
+
|
|
6213
|
+
__proto._showOnlyVisiblePanels = function (flicking) {
|
|
6214
|
+
var panels = flicking.renderer.panels;
|
|
6215
|
+
var camera = flicking.camera;
|
|
6216
|
+
var visibleIndexes = camera.visiblePanels.reduce(function (visibles, panel) {
|
|
6217
|
+
visibles[panel.index] = true;
|
|
6218
|
+
return visibles;
|
|
6219
|
+
}, {});
|
|
6220
|
+
panels.forEach(function (panel) {
|
|
6221
|
+
if (panel.index in visibleIndexes || panel.loading) {
|
|
6222
|
+
panel.markForShow();
|
|
6223
|
+
} else if (!flicking.holding) {
|
|
6224
|
+
// During the input sequence,
|
|
6225
|
+
// Do not remove panel elements as it won't trigger touchend event.
|
|
6226
|
+
panel.markForHide();
|
|
6227
|
+
}
|
|
6228
|
+
});
|
|
6229
|
+
camera.updateOffset();
|
|
6230
|
+
};
|
|
6231
|
+
|
|
6232
|
+
return NormalRenderingStrategy;
|
|
5273
6233
|
}();
|
|
5274
6234
|
|
|
5275
6235
|
/**
|
|
@@ -5277,26 +6237,28 @@ version: 4.2.5
|
|
|
5277
6237
|
* @ko 슬라이드 데이터 컴포넌트로, 단일 HTMLElement의 정보를 갖고 있습니다
|
|
5278
6238
|
*/
|
|
5279
6239
|
|
|
5280
|
-
var
|
|
5281
|
-
|
|
6240
|
+
var VirtualPanel =
|
|
6241
|
+
/*#__PURE__*/
|
|
6242
|
+
function (_super) {
|
|
6243
|
+
__extends(VirtualPanel, _super);
|
|
5282
6244
|
/**
|
|
5283
6245
|
* @param {object} options An options object<ko>옵션 오브젝트</ko>
|
|
5284
|
-
* @param {HTMLElement} [options.el] A `HTMLElement` panel's referencing<ko>패널이 참조하는 `HTMLElement`</ko>
|
|
5285
6246
|
* @param {number} [options.index] An initial index of the panel<ko>패널의 초기 인덱스</ko>
|
|
5286
6247
|
* @param {Constants.ALIGN | string | number} [options.align] An initial {@link Flicking#align align} value of the panel<ko>패널의 초기 {@link Flicking#align align}값</ko>
|
|
5287
6248
|
* @param {Flicking} [options.flicking] A Flicking instance panel's referencing<ko>패널이 참조하는 {@link Flicking} 인스턴스</ko>
|
|
5288
6249
|
*/
|
|
5289
6250
|
|
|
5290
6251
|
|
|
5291
|
-
function
|
|
6252
|
+
function VirtualPanel(options) {
|
|
5292
6253
|
var _this = _super.call(this, options) || this;
|
|
5293
6254
|
|
|
5294
|
-
|
|
5295
|
-
_this.
|
|
6255
|
+
options.elementProvider.init(_this);
|
|
6256
|
+
_this._elProvider = options.elementProvider;
|
|
6257
|
+
_this._cachedInnerHTML = null;
|
|
5296
6258
|
return _this;
|
|
5297
6259
|
}
|
|
5298
6260
|
|
|
5299
|
-
var __proto =
|
|
6261
|
+
var __proto = VirtualPanel.prototype;
|
|
5300
6262
|
Object.defineProperty(__proto, "element", {
|
|
5301
6263
|
/**
|
|
5302
6264
|
* `HTMLElement` that panel's referencing
|
|
@@ -5305,211 +6267,189 @@ version: 4.2.5
|
|
|
5305
6267
|
* @readonly
|
|
5306
6268
|
*/
|
|
5307
6269
|
get: function () {
|
|
5308
|
-
return this.
|
|
6270
|
+
return this._elProvider.element;
|
|
5309
6271
|
},
|
|
5310
6272
|
enumerable: false,
|
|
5311
6273
|
configurable: true
|
|
5312
6274
|
});
|
|
5313
|
-
Object.defineProperty(__proto, "
|
|
6275
|
+
Object.defineProperty(__proto, "cachedInnerHTML", {
|
|
6276
|
+
/**
|
|
6277
|
+
* Cached innerHTML by the previous render function
|
|
6278
|
+
* @ko 이전 렌더링에서 캐시된 innerHTML 정보
|
|
6279
|
+
* @type {string|null}
|
|
6280
|
+
* @readonly
|
|
6281
|
+
*/
|
|
5314
6282
|
get: function () {
|
|
5315
|
-
return this.
|
|
6283
|
+
return this._cachedInnerHTML;
|
|
5316
6284
|
},
|
|
5317
6285
|
enumerable: false,
|
|
5318
6286
|
configurable: true
|
|
5319
6287
|
});
|
|
6288
|
+
Object.defineProperty(__proto, "elementIndex", {
|
|
6289
|
+
/**
|
|
6290
|
+
* An number for indexing which element it will be rendered on
|
|
6291
|
+
* @ko 몇 번째 엘리먼트에 렌더링될 것인지를 나타내는 숫자
|
|
6292
|
+
* @type {number}
|
|
6293
|
+
* @readonly
|
|
6294
|
+
*/
|
|
6295
|
+
get: function () {
|
|
6296
|
+
var flicking = this._flicking;
|
|
6297
|
+
var virtualElCount = flicking.panelsPerView + 1;
|
|
6298
|
+
var panelCount = flicking.panelCount;
|
|
6299
|
+
var index = this._index;
|
|
5320
6300
|
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
__proto.markForHide = function () {
|
|
5326
|
-
this._rendered = false;
|
|
5327
|
-
};
|
|
5328
|
-
|
|
5329
|
-
return ElementPanel;
|
|
5330
|
-
}(Panel);
|
|
5331
|
-
|
|
5332
|
-
/**
|
|
5333
|
-
*
|
|
5334
|
-
*/
|
|
5335
|
-
|
|
5336
|
-
var VanillaRenderer = function (_super) {
|
|
5337
|
-
__extends(VanillaRenderer, _super);
|
|
6301
|
+
if (this._toggled) {
|
|
6302
|
+
// To prevent element duplication
|
|
6303
|
+
index = this._toggleDirection === DIRECTION.NEXT ? index + panelCount : index - panelCount;
|
|
6304
|
+
}
|
|
5338
6305
|
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
6306
|
+
return circulateIndex(index, virtualElCount);
|
|
6307
|
+
},
|
|
6308
|
+
enumerable: false,
|
|
6309
|
+
configurable: true
|
|
6310
|
+
});
|
|
5342
6311
|
|
|
6312
|
+
__proto.cacheRenderResult = function (result) {
|
|
6313
|
+
this._cachedInnerHTML = result;
|
|
6314
|
+
};
|
|
5343
6315
|
|
|
5344
|
-
|
|
6316
|
+
__proto.uncacheRenderResult = function () {
|
|
6317
|
+
this._cachedInnerHTML = null;
|
|
6318
|
+
};
|
|
5345
6319
|
|
|
5346
6320
|
__proto.render = function () {
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
6321
|
+
var flicking = this._flicking;
|
|
6322
|
+
var _a = flicking.virtual,
|
|
6323
|
+
renderPanel = _a.renderPanel,
|
|
6324
|
+
cache = _a.cache;
|
|
6325
|
+
var element = this._elProvider.element;
|
|
6326
|
+
var newInnerHTML = this._cachedInnerHTML || renderPanel(this, this._index);
|
|
6327
|
+
if (newInnerHTML === element.innerHTML) return;
|
|
6328
|
+
element.innerHTML = newInnerHTML;
|
|
6329
|
+
|
|
6330
|
+
if (cache) {
|
|
6331
|
+
this.cacheRenderResult(newInnerHTML);
|
|
6332
|
+
}
|
|
6333
|
+
};
|
|
5359
6334
|
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
6335
|
+
__proto.increaseIndex = function (val) {
|
|
6336
|
+
this.uncacheRenderResult();
|
|
6337
|
+
return _super.prototype.increaseIndex.call(this, val);
|
|
6338
|
+
};
|
|
5363
6339
|
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
6340
|
+
__proto.decreaseIndex = function (val) {
|
|
6341
|
+
this.uncacheRenderResult();
|
|
6342
|
+
return _super.prototype.decreaseIndex.call(this, val);
|
|
6343
|
+
};
|
|
5367
6344
|
|
|
5368
|
-
|
|
6345
|
+
return VirtualPanel;
|
|
6346
|
+
}(Panel);
|
|
5369
6347
|
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
6348
|
+
var VirtualRenderingStrategy =
|
|
6349
|
+
/*#__PURE__*/
|
|
6350
|
+
function () {
|
|
6351
|
+
function VirtualRenderingStrategy() {}
|
|
6352
|
+
|
|
6353
|
+
var __proto = VirtualRenderingStrategy.prototype;
|
|
6354
|
+
|
|
6355
|
+
__proto.renderPanels = function (flicking) {
|
|
6356
|
+
var virtualManager = flicking.virtual;
|
|
6357
|
+
var visiblePanels = flicking.visiblePanels;
|
|
6358
|
+
var invisibleIndexes = range(flicking.panelsPerView + 1);
|
|
6359
|
+
visiblePanels.forEach(function (panel) {
|
|
6360
|
+
var elementIndex = panel.elementIndex;
|
|
6361
|
+
panel.render();
|
|
6362
|
+
virtualManager.show(elementIndex);
|
|
6363
|
+
invisibleIndexes[elementIndex] = -1;
|
|
5374
6364
|
});
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5380
|
-
var flicking, camera, cameraElement, fragment;
|
|
5381
|
-
return __generator(this, function (_a) {
|
|
5382
|
-
flicking = getFlickingAttached(this._flicking, "Renderer");
|
|
5383
|
-
camera = flicking.camera;
|
|
5384
|
-
cameraElement = camera.element;
|
|
5385
|
-
fragment = document.createDocumentFragment();
|
|
5386
|
-
|
|
5387
|
-
this._panels.forEach(function (panel) {
|
|
5388
|
-
return fragment.appendChild(panel.element);
|
|
5389
|
-
});
|
|
5390
|
-
|
|
5391
|
-
this._removeAllChildsFromCamera();
|
|
5392
|
-
|
|
5393
|
-
cameraElement.appendChild(fragment);
|
|
5394
|
-
return [2
|
|
5395
|
-
/*return*/
|
|
5396
|
-
];
|
|
5397
|
-
});
|
|
6365
|
+
invisibleIndexes.filter(function (val) {
|
|
6366
|
+
return val >= 0;
|
|
6367
|
+
}).forEach(function (idx) {
|
|
6368
|
+
virtualManager.hide(idx);
|
|
5398
6369
|
});
|
|
5399
6370
|
};
|
|
5400
6371
|
|
|
5401
|
-
__proto.
|
|
5402
|
-
var
|
|
5403
|
-
var cameraElement = flicking.camera.element; // Remove all text nodes in the camera element
|
|
6372
|
+
__proto.getRenderingIndexesByOrder = function (flicking) {
|
|
6373
|
+
var virtualManager = flicking.virtual;
|
|
5404
6374
|
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
6375
|
+
var visiblePanels = __spreadArray([], __read(flicking.visiblePanels)).filter(function (panel) {
|
|
6376
|
+
return panel.rendered;
|
|
6377
|
+
}).sort(function (panel1, panel2) {
|
|
6378
|
+
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
5409
6379
|
});
|
|
5410
6380
|
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
return
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
6381
|
+
if (visiblePanels.length <= 0) return virtualManager.elements.map(function (_, idx) {
|
|
6382
|
+
return idx;
|
|
6383
|
+
});
|
|
6384
|
+
var visibleIndexes = visiblePanels.map(function (panel) {
|
|
6385
|
+
return panel.elementIndex;
|
|
6386
|
+
});
|
|
6387
|
+
var invisibleIndexes = virtualManager.elements.map(function (el, idx) {
|
|
6388
|
+
return __assign(__assign({}, el), {
|
|
6389
|
+
idx: idx
|
|
5420
6390
|
});
|
|
6391
|
+
}).filter(function (el) {
|
|
6392
|
+
return !el.visible;
|
|
6393
|
+
}).map(function (el) {
|
|
6394
|
+
return el.idx;
|
|
5421
6395
|
});
|
|
6396
|
+
return __spreadArray(__spreadArray([], __read(visibleIndexes), false), __read(invisibleIndexes));
|
|
5422
6397
|
};
|
|
5423
6398
|
|
|
5424
|
-
__proto.
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
__proto._insertPanelElements = function (panels, nextSibling) {
|
|
5431
|
-
var flicking = getFlickingAttached(this._flicking, "Renderer");
|
|
5432
|
-
var camera = flicking.camera;
|
|
5433
|
-
var cameraElement = camera.element;
|
|
5434
|
-
var nextSiblingElement = (nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.element) || null;
|
|
5435
|
-
var fragment = document.createDocumentFragment();
|
|
5436
|
-
panels.forEach(function (panel) {
|
|
5437
|
-
return fragment.appendChild(panel.element);
|
|
6399
|
+
__proto.getRenderingElementsByOrder = function (flicking) {
|
|
6400
|
+
var virtualManager = flicking.virtual;
|
|
6401
|
+
var elements = virtualManager.elements;
|
|
6402
|
+
return this.getRenderingIndexesByOrder(flicking).map(function (index) {
|
|
6403
|
+
return elements[index].nativeElement;
|
|
5438
6404
|
});
|
|
5439
|
-
cameraElement.insertBefore(fragment, nextSiblingElement);
|
|
5440
|
-
return this;
|
|
5441
6405
|
};
|
|
5442
6406
|
|
|
5443
|
-
__proto.
|
|
5444
|
-
var
|
|
5445
|
-
var
|
|
6407
|
+
__proto.updateRenderingPanels = function (flicking) {
|
|
6408
|
+
var panels = flicking.renderer.panels;
|
|
6409
|
+
var camera = flicking.camera;
|
|
6410
|
+
var visibleIndexes = camera.visiblePanels.reduce(function (visibles, panel) {
|
|
6411
|
+
visibles[panel.index] = true;
|
|
6412
|
+
return visibles;
|
|
6413
|
+
}, {});
|
|
5446
6414
|
panels.forEach(function (panel) {
|
|
5447
|
-
|
|
6415
|
+
if (panel.index in visibleIndexes || panel.loading) {
|
|
6416
|
+
panel.markForShow();
|
|
6417
|
+
} else {
|
|
6418
|
+
panel.markForHide();
|
|
6419
|
+
}
|
|
5448
6420
|
});
|
|
5449
|
-
|
|
6421
|
+
camera.updateOffset();
|
|
5450
6422
|
};
|
|
5451
6423
|
|
|
5452
|
-
__proto.
|
|
5453
|
-
var
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
if (panel.element.nextElementSibling !== nextPanelEl) {
|
|
5463
|
-
cameraEl.insertBefore(panel.element, nextPanelEl);
|
|
5464
|
-
}
|
|
6424
|
+
__proto.collectPanels = function (flicking) {
|
|
6425
|
+
var align = parsePanelAlign(flicking.renderer.align);
|
|
6426
|
+
return range(flicking.virtual.initialPanelCount).map(function (index) {
|
|
6427
|
+
return new VirtualPanel({
|
|
6428
|
+
index: index,
|
|
6429
|
+
elementProvider: new VirtualElementProvider(flicking),
|
|
6430
|
+
align: align,
|
|
6431
|
+
flicking: flicking
|
|
6432
|
+
});
|
|
5465
6433
|
});
|
|
5466
6434
|
};
|
|
5467
6435
|
|
|
5468
|
-
__proto.
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
while (cameraElement.firstChild) {
|
|
5473
|
-
cameraElement.removeChild(cameraElement.firstChild);
|
|
5474
|
-
}
|
|
6436
|
+
__proto.createPanel = function (_el, options) {
|
|
6437
|
+
return new VirtualPanel(__assign(__assign({}, options), {
|
|
6438
|
+
elementProvider: new VirtualElementProvider(options.flicking)
|
|
6439
|
+
}));
|
|
5475
6440
|
};
|
|
5476
6441
|
|
|
5477
|
-
__proto.
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
return a.position + a.offset - (b.position + b.offset);
|
|
6442
|
+
__proto.updatePanelSizes = function (flicking, size) {
|
|
6443
|
+
flicking.virtual.elements.forEach(function (el) {
|
|
6444
|
+
setSize(el.nativeElement, size);
|
|
6445
|
+
});
|
|
6446
|
+
flicking.panels.forEach(function (panel) {
|
|
6447
|
+
return panel.setSize(size);
|
|
5484
6448
|
});
|
|
5485
6449
|
};
|
|
5486
6450
|
|
|
5487
|
-
return
|
|
5488
|
-
}(
|
|
5489
|
-
|
|
5490
|
-
/**
|
|
5491
|
-
*
|
|
5492
|
-
*/
|
|
5493
|
-
|
|
5494
|
-
var ExternalRenderer = function (_super) {
|
|
5495
|
-
__extends(ExternalRenderer, _super);
|
|
5496
|
-
|
|
5497
|
-
function ExternalRenderer() {
|
|
5498
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5499
|
-
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
var __proto = ExternalRenderer.prototype;
|
|
5503
|
-
|
|
5504
|
-
__proto._insertPanelElements = function (panels, nextSibling) {// DO NOTHING
|
|
5505
|
-
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
__proto._removePanelElements = function (panels) {// DO NOTHING
|
|
5509
|
-
};
|
|
5510
|
-
|
|
5511
|
-
return ExternalRenderer;
|
|
5512
|
-
}(Renderer$1);
|
|
6451
|
+
return VirtualRenderingStrategy;
|
|
6452
|
+
}();
|
|
5513
6453
|
|
|
5514
6454
|
/*
|
|
5515
6455
|
* Copyright (c) 2015 NAVER Corp.
|
|
@@ -5520,7 +6460,9 @@ version: 4.2.5
|
|
|
5520
6460
|
__proto__: null,
|
|
5521
6461
|
Renderer: Renderer$1,
|
|
5522
6462
|
VanillaRenderer: VanillaRenderer,
|
|
5523
|
-
ExternalRenderer: ExternalRenderer
|
|
6463
|
+
ExternalRenderer: ExternalRenderer,
|
|
6464
|
+
NormalRenderingStrategy: NormalRenderingStrategy,
|
|
6465
|
+
VirtualRenderingStrategy: VirtualRenderingStrategy
|
|
5524
6466
|
};
|
|
5525
6467
|
|
|
5526
6468
|
/**
|
|
@@ -5530,7 +6472,9 @@ version: 4.2.5
|
|
|
5530
6472
|
* @requires {@link https://github.com/naver/egjs-axes|@egjs/axes}
|
|
5531
6473
|
*/
|
|
5532
6474
|
|
|
5533
|
-
var Flicking =
|
|
6475
|
+
var Flicking =
|
|
6476
|
+
/*#__PURE__*/
|
|
6477
|
+
function (_super) {
|
|
5534
6478
|
__extends(Flicking, _super);
|
|
5535
6479
|
/**
|
|
5536
6480
|
* @param root A root HTMLElement to initialize Flicking on it. When it's a typeof `string`, it should be a css selector string
|
|
@@ -5580,42 +6524,50 @@ version: 4.2.5
|
|
|
5580
6524
|
panelsPerView = _j === void 0 ? -1 : _j,
|
|
5581
6525
|
_k = _b.noPanelStyleOverride,
|
|
5582
6526
|
noPanelStyleOverride = _k === void 0 ? false : _k,
|
|
5583
|
-
_l = _b.
|
|
5584
|
-
|
|
5585
|
-
_m = _b.
|
|
5586
|
-
|
|
5587
|
-
_o = _b.
|
|
5588
|
-
|
|
5589
|
-
_p = _b.
|
|
5590
|
-
|
|
5591
|
-
_q = _b.
|
|
5592
|
-
|
|
6527
|
+
_l = _b.resizeOnContentsReady,
|
|
6528
|
+
resizeOnContentsReady = _l === void 0 ? false : _l,
|
|
6529
|
+
_m = _b.needPanelThreshold,
|
|
6530
|
+
needPanelThreshold = _m === void 0 ? 0 : _m,
|
|
6531
|
+
_o = _b.preventEventsBeforeInit,
|
|
6532
|
+
preventEventsBeforeInit = _o === void 0 ? true : _o,
|
|
6533
|
+
_p = _b.deceleration,
|
|
6534
|
+
deceleration = _p === void 0 ? 0.0075 : _p,
|
|
6535
|
+
_q = _b.duration,
|
|
6536
|
+
duration = _q === void 0 ? 500 : _q,
|
|
6537
|
+
_r = _b.easing,
|
|
6538
|
+
easing = _r === void 0 ? function (x) {
|
|
5593
6539
|
return 1 - Math.pow(1 - x, 3);
|
|
5594
|
-
} :
|
|
5595
|
-
|
|
5596
|
-
inputType =
|
|
5597
|
-
|
|
5598
|
-
moveType =
|
|
5599
|
-
|
|
5600
|
-
threshold =
|
|
5601
|
-
|
|
5602
|
-
interruptable =
|
|
5603
|
-
|
|
5604
|
-
bounce =
|
|
5605
|
-
|
|
5606
|
-
iOSEdgeSwipeThreshold =
|
|
5607
|
-
|
|
5608
|
-
preventClickOnDrag =
|
|
5609
|
-
|
|
5610
|
-
disableOnInit =
|
|
5611
|
-
|
|
5612
|
-
renderOnlyVisible =
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
6540
|
+
} : _r,
|
|
6541
|
+
_s = _b.inputType,
|
|
6542
|
+
inputType = _s === void 0 ? ["mouse", "touch"] : _s,
|
|
6543
|
+
_t = _b.moveType,
|
|
6544
|
+
moveType = _t === void 0 ? "snap" : _t,
|
|
6545
|
+
_u = _b.threshold,
|
|
6546
|
+
threshold = _u === void 0 ? 40 : _u,
|
|
6547
|
+
_v = _b.interruptable,
|
|
6548
|
+
interruptable = _v === void 0 ? true : _v,
|
|
6549
|
+
_w = _b.bounce,
|
|
6550
|
+
bounce = _w === void 0 ? "20%" : _w,
|
|
6551
|
+
_x = _b.iOSEdgeSwipeThreshold,
|
|
6552
|
+
iOSEdgeSwipeThreshold = _x === void 0 ? 30 : _x,
|
|
6553
|
+
_y = _b.preventClickOnDrag,
|
|
6554
|
+
preventClickOnDrag = _y === void 0 ? true : _y,
|
|
6555
|
+
_z = _b.disableOnInit,
|
|
6556
|
+
disableOnInit = _z === void 0 ? false : _z,
|
|
6557
|
+
_0 = _b.renderOnlyVisible,
|
|
6558
|
+
renderOnlyVisible = _0 === void 0 ? false : _0,
|
|
6559
|
+
_1 = _b.virtual,
|
|
6560
|
+
virtual = _1 === void 0 ? null : _1,
|
|
6561
|
+
_2 = _b.autoInit,
|
|
6562
|
+
autoInit = _2 === void 0 ? true : _2,
|
|
6563
|
+
_3 = _b.autoResize,
|
|
6564
|
+
autoResize = _3 === void 0 ? true : _3,
|
|
6565
|
+
_4 = _b.useResizeObserver,
|
|
6566
|
+
useResizeObserver = _4 === void 0 ? true : _4,
|
|
6567
|
+
_5 = _b.externalRenderer,
|
|
6568
|
+
externalRenderer = _5 === void 0 ? null : _5,
|
|
6569
|
+
_6 = _b.renderExternal,
|
|
6570
|
+
renderExternal = _6 === void 0 ? null : _6;
|
|
5619
6571
|
|
|
5620
6572
|
var _this = _super.call(this) || this; // Internal states
|
|
5621
6573
|
|
|
@@ -5631,6 +6583,8 @@ version: 4.2.5
|
|
|
5631
6583
|
_this._adaptive = adaptive;
|
|
5632
6584
|
_this._panelsPerView = panelsPerView;
|
|
5633
6585
|
_this._noPanelStyleOverride = noPanelStyleOverride;
|
|
6586
|
+
_this._resizeOnContentsReady = resizeOnContentsReady;
|
|
6587
|
+
_this._virtual = virtual;
|
|
5634
6588
|
_this._needPanelThreshold = needPanelThreshold;
|
|
5635
6589
|
_this._preventEventsBeforeInit = preventEventsBeforeInit;
|
|
5636
6590
|
_this._deceleration = deceleration;
|
|
@@ -5645,15 +6599,18 @@ version: 4.2.5
|
|
|
5645
6599
|
_this._preventClickOnDrag = preventClickOnDrag;
|
|
5646
6600
|
_this._disableOnInit = disableOnInit;
|
|
5647
6601
|
_this._renderOnlyVisible = renderOnlyVisible;
|
|
5648
|
-
_this._autoResize = autoResize;
|
|
5649
6602
|
_this._autoInit = autoInit;
|
|
6603
|
+
_this._autoResize = autoResize;
|
|
6604
|
+
_this._useResizeObserver = useResizeObserver;
|
|
6605
|
+
_this._externalRenderer = externalRenderer;
|
|
5650
6606
|
_this._renderExternal = renderExternal; // Create core components
|
|
5651
6607
|
|
|
5652
6608
|
_this._viewport = new Viewport(getElement(root));
|
|
6609
|
+
_this._autoResizer = new AutoResizer(_this);
|
|
5653
6610
|
_this._renderer = _this._createRenderer();
|
|
5654
6611
|
_this._camera = _this._createCamera();
|
|
5655
6612
|
_this._control = _this._createControl();
|
|
5656
|
-
_this.
|
|
6613
|
+
_this._virtualManager = new VirtualManager(_this, virtual);
|
|
5657
6614
|
|
|
5658
6615
|
if (_this._autoInit) {
|
|
5659
6616
|
void _this.init();
|
|
@@ -5765,6 +6722,22 @@ version: 4.2.5
|
|
|
5765
6722
|
enumerable: false,
|
|
5766
6723
|
configurable: true
|
|
5767
6724
|
});
|
|
6725
|
+
Object.defineProperty(__proto, "virtualEnabled", {
|
|
6726
|
+
/**
|
|
6727
|
+
* Whether the `virtual` option is enabled.
|
|
6728
|
+
* The {@link Flicking#virtual virtual} option can't be enabled when {@link Flicking#panelsPerView panelsPerView} is less or equal than zero.
|
|
6729
|
+
* @ko {@link Flicking#virtual virtual} 옵션이 활성화되었는지 여부를 나타내는 멤버 변수.
|
|
6730
|
+
* {@link Flicking#virtual virtual} 옵션은 {@link Flicking#panelsPerView panelsPerView} 옵션의 값이 0보다 같거나 작으면 비활성화됩니다.
|
|
6731
|
+
* @type {boolean}
|
|
6732
|
+
* @default false
|
|
6733
|
+
* @readonly
|
|
6734
|
+
*/
|
|
6735
|
+
get: function () {
|
|
6736
|
+
return this._panelsPerView > 0 && this._virtual != null;
|
|
6737
|
+
},
|
|
6738
|
+
enumerable: false,
|
|
6739
|
+
configurable: true
|
|
6740
|
+
});
|
|
5768
6741
|
Object.defineProperty(__proto, "index", {
|
|
5769
6742
|
/**
|
|
5770
6743
|
* Index number of the {@link Flicking#currentPanel currentPanel}
|
|
@@ -6046,6 +7019,24 @@ version: 4.2.5
|
|
|
6046
7019
|
enumerable: false,
|
|
6047
7020
|
configurable: true
|
|
6048
7021
|
});
|
|
7022
|
+
Object.defineProperty(__proto, "resizeOnContentsReady", {
|
|
7023
|
+
/**
|
|
7024
|
+
* Enabling this option will automatically call {@link Flicking#resize} when all image/video inside panels are loaded.
|
|
7025
|
+
* This can be useful when you have contents inside Flicking that changes its size when it's loaded
|
|
7026
|
+
* @ko 이 옵션을 활성화할 경우, Flicking 패널 내부의 이미지/비디오들이 로드되었을 때 자동으로 {@link Flicking#resize}를 호출합니다.
|
|
7027
|
+
* 이 동작은 Flicking 내부에 로드 전/후로 크기가 변하는 콘텐츠를 포함하고 있을 때 유용하게 사용하실 수 있습니다.
|
|
7028
|
+
* @type {boolean}
|
|
7029
|
+
* @default false
|
|
7030
|
+
*/
|
|
7031
|
+
get: function () {
|
|
7032
|
+
return this._resizeOnContentsReady;
|
|
7033
|
+
},
|
|
7034
|
+
set: function (val) {
|
|
7035
|
+
this._resizeOnContentsReady = val;
|
|
7036
|
+
},
|
|
7037
|
+
enumerable: false,
|
|
7038
|
+
configurable: true
|
|
7039
|
+
});
|
|
6049
7040
|
Object.defineProperty(__proto, "needPanelThreshold", {
|
|
6050
7041
|
// EVENTS
|
|
6051
7042
|
|
|
@@ -6329,8 +7320,8 @@ version: 4.2.5
|
|
|
6329
7320
|
// PERFORMANCE
|
|
6330
7321
|
|
|
6331
7322
|
/**
|
|
6332
|
-
* Whether to render visible panels only. This can dramatically increase performance when there're many panels
|
|
6333
|
-
* @ko 보이는 패널만 렌더링할지 여부를 설정합니다. 패널이 많을 경우에 퍼포먼스를 크게 향상시킬 수
|
|
7323
|
+
* Whether to render visible panels only. This can dramatically increase performance when there're many panels
|
|
7324
|
+
* @ko 보이는 패널만 렌더링할지 여부를 설정합니다. 패널이 많을 경우에 퍼포먼스를 크게 향상시킬 수 있습니다
|
|
6334
7325
|
* @type {boolean}
|
|
6335
7326
|
* @default false
|
|
6336
7327
|
*/
|
|
@@ -6344,6 +7335,44 @@ version: 4.2.5
|
|
|
6344
7335
|
enumerable: false,
|
|
6345
7336
|
configurable: true
|
|
6346
7337
|
});
|
|
7338
|
+
Object.defineProperty(__proto, "virtual", {
|
|
7339
|
+
/**
|
|
7340
|
+
* By enabling this option, it will reduce memory consumption by restricting the number of DOM elements to `panelsPerView + 1`
|
|
7341
|
+
* Must be used with `panelsPerview`.
|
|
7342
|
+
* After Flicking's initialized, this property can be used to add/remove the panel count.
|
|
7343
|
+
* @ko 이 옵션을 활성화할 경우 패널 엘리먼트의 개수를 `panelsPerView + 1` 개로 고정함으로써, 메모리 사용량을 줄일 수 있습니다.
|
|
7344
|
+
* `panelsPerView` 옵션과 함께 사용되어야만 합니다.
|
|
7345
|
+
* Flicking 초기화 이후에, 이 프로퍼티는 렌더링하는 패널의 개수를 추가/제거하기 위해 사용될 수 있습니다.
|
|
7346
|
+
* @type {VirtualManager}
|
|
7347
|
+
* @property {function} renderPanel A rendering function for the panel element's innerHTML<ko>패널 엘리먼트의 innerHTML을 렌더링하는 함수</ko>
|
|
7348
|
+
* @property {number} initialPanelCount Initial panel count to render<ko>최초로 렌더링할 패널의 개수</ko>
|
|
7349
|
+
* @property {boolean} [cache=false] Whether to cache rendered panel's innerHTML<ko>렌더링된 패널의 innerHTML 정보를 캐시할지 여부</ko>
|
|
7350
|
+
* @property {string} [panelClass="flicking-panel"] The class name that will be applied to rendered panel elements<ko>렌더링되는 패널 엘리먼트에 적용될 클래스 이름</ko>
|
|
7351
|
+
* @example
|
|
7352
|
+
* ```ts
|
|
7353
|
+
* import Flicking, { VirtualPanel } from "@egjs/flicking";
|
|
7354
|
+
*
|
|
7355
|
+
* const flicking = new Flicking("#some_el", {
|
|
7356
|
+
* panelsPerView: 3,
|
|
7357
|
+
* virtual: {
|
|
7358
|
+
* renderPanel: (panel: VirtualPanel, index: number) => `Panel ${index}`,
|
|
7359
|
+
* initialPanelCount: 100
|
|
7360
|
+
* }
|
|
7361
|
+
* });
|
|
7362
|
+
*
|
|
7363
|
+
* // Add 100 virtual panels (at the end)
|
|
7364
|
+
* flicking.virtual.append(100);
|
|
7365
|
+
*
|
|
7366
|
+
* // Remove 100 virtual panels from 0 to 100
|
|
7367
|
+
* flicking.virtual.remove(0, 100);
|
|
7368
|
+
* ```
|
|
7369
|
+
*/
|
|
7370
|
+
get: function () {
|
|
7371
|
+
return this._virtualManager;
|
|
7372
|
+
},
|
|
7373
|
+
enumerable: false,
|
|
7374
|
+
configurable: true
|
|
7375
|
+
});
|
|
6347
7376
|
Object.defineProperty(__proto, "autoInit", {
|
|
6348
7377
|
// OTHERS
|
|
6349
7378
|
|
|
@@ -6362,10 +7391,8 @@ version: 4.2.5
|
|
|
6362
7391
|
});
|
|
6363
7392
|
Object.defineProperty(__proto, "autoResize", {
|
|
6364
7393
|
/**
|
|
6365
|
-
*
|
|
6366
|
-
*
|
|
6367
|
-
* @ko Flicking의 {@link Flicking#resize resize} 메소드를 window의 resize 이벤트 핸들러로 등록합니다.
|
|
6368
|
-
* 설정시 window 창 크기 및 orientation 변경에 의해 자동으로 {@link Flicking#resize resize}를 호출합니다.
|
|
7394
|
+
* Whether to automatically call {@link Flicking#resize resize()} when the viewport element(.flicking-viewport)'s size is changed
|
|
7395
|
+
* @ko 뷰포트 엘리먼트(.flicking-viewport)의 크기 변경시 {@link Flicking#resize resize()} 메소드를 자동으로 호출할지 여부를 설정합니다
|
|
6369
7396
|
* @type {boolean}
|
|
6370
7397
|
* @default true
|
|
6371
7398
|
*/
|
|
@@ -6375,6 +7402,46 @@ version: 4.2.5
|
|
|
6375
7402
|
// OTHERS
|
|
6376
7403
|
set: function (val) {
|
|
6377
7404
|
this._autoResize = val;
|
|
7405
|
+
|
|
7406
|
+
if (val) {
|
|
7407
|
+
this._autoResizer.enable();
|
|
7408
|
+
} else {
|
|
7409
|
+
this._autoResizer.disable();
|
|
7410
|
+
}
|
|
7411
|
+
},
|
|
7412
|
+
enumerable: false,
|
|
7413
|
+
configurable: true
|
|
7414
|
+
});
|
|
7415
|
+
Object.defineProperty(__proto, "useResizeObserver", {
|
|
7416
|
+
/**
|
|
7417
|
+
* Whether to listen {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver}'s event instead of Window's {@link https://developer.mozilla.org/ko/docs/Web/API/Window/resize_event resize} event when using the `autoResize` option
|
|
7418
|
+
* @ko autoResize 옵션 사용시 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver}의 이벤트를 Window객체의 {@link https://developer.mozilla.org/ko/docs/Web/API/Window/resize_event resize} 이벤트 대신 수신할지 여부를 설정합니다
|
|
7419
|
+
* @type {boolean}
|
|
7420
|
+
* @default true
|
|
7421
|
+
*/
|
|
7422
|
+
get: function () {
|
|
7423
|
+
return this._useResizeObserver;
|
|
7424
|
+
},
|
|
7425
|
+
set: function (val) {
|
|
7426
|
+
this._useResizeObserver = val;
|
|
7427
|
+
|
|
7428
|
+
if (this._autoResize) {
|
|
7429
|
+
this._autoResizer.enable();
|
|
7430
|
+
}
|
|
7431
|
+
},
|
|
7432
|
+
enumerable: false,
|
|
7433
|
+
configurable: true
|
|
7434
|
+
});
|
|
7435
|
+
Object.defineProperty(__proto, "externalRenderer", {
|
|
7436
|
+
/**
|
|
7437
|
+
* This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
|
|
7438
|
+
* @ko 프레임워크(React, Vue, Angular, ...)에서만 사용하는 옵션으로, 자동으로 설정되므로 따로 사용하실 필요 없습니다!
|
|
7439
|
+
* @default null
|
|
7440
|
+
* @internal
|
|
7441
|
+
* @readonly
|
|
7442
|
+
*/
|
|
7443
|
+
get: function () {
|
|
7444
|
+
return this._externalRenderer;
|
|
6378
7445
|
},
|
|
6379
7446
|
enumerable: false,
|
|
6380
7447
|
configurable: true
|
|
@@ -6383,10 +7450,10 @@ version: 4.2.5
|
|
|
6383
7450
|
/**
|
|
6384
7451
|
* This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
|
|
6385
7452
|
* @ko 프레임워크(React, Vue, Angular, ...)에서만 사용하는 옵션으로, 자동으로 설정되므로 따로 사용하실 필요 없습니다!
|
|
6386
|
-
* @
|
|
6387
|
-
* @default false
|
|
7453
|
+
* @default null
|
|
6388
7454
|
* @internal
|
|
6389
7455
|
* @readonly
|
|
7456
|
+
* @deprecated
|
|
6390
7457
|
*/
|
|
6391
7458
|
get: function () {
|
|
6392
7459
|
return this._renderExternal;
|
|
@@ -6405,7 +7472,7 @@ version: 4.2.5
|
|
|
6405
7472
|
|
|
6406
7473
|
__proto.init = function () {
|
|
6407
7474
|
return __awaiter(this, void 0, void 0, function () {
|
|
6408
|
-
var camera, renderer, control, originalTrigger, preventEventsBeforeInit;
|
|
7475
|
+
var camera, renderer, control, virtualManager, originalTrigger, preventEventsBeforeInit;
|
|
6409
7476
|
|
|
6410
7477
|
var _this = this;
|
|
6411
7478
|
|
|
@@ -6418,9 +7485,11 @@ version: 4.2.5
|
|
|
6418
7485
|
camera = this._camera;
|
|
6419
7486
|
renderer = this._renderer;
|
|
6420
7487
|
control = this._control;
|
|
7488
|
+
virtualManager = this._virtualManager;
|
|
6421
7489
|
originalTrigger = this.trigger;
|
|
6422
7490
|
preventEventsBeforeInit = this._preventEventsBeforeInit;
|
|
6423
7491
|
camera.init(this);
|
|
7492
|
+
virtualManager.init();
|
|
6424
7493
|
renderer.init(this);
|
|
6425
7494
|
control.init(this);
|
|
6426
7495
|
|
|
@@ -6447,7 +7516,7 @@ version: 4.2.5
|
|
|
6447
7516
|
_a.sent();
|
|
6448
7517
|
|
|
6449
7518
|
if (this._autoResize) {
|
|
6450
|
-
|
|
7519
|
+
this._autoResizer.enable();
|
|
6451
7520
|
}
|
|
6452
7521
|
|
|
6453
7522
|
if (this._preventClickOnDrag) {
|
|
@@ -6458,6 +7527,8 @@ version: 4.2.5
|
|
|
6458
7527
|
this.disableInput();
|
|
6459
7528
|
}
|
|
6460
7529
|
|
|
7530
|
+
renderer.checkPanelContentsReady(renderer.panels);
|
|
7531
|
+
|
|
6461
7532
|
this._plugins.forEach(function (plugin) {
|
|
6462
7533
|
return plugin.init(_this);
|
|
6463
7534
|
}); // Done initializing & emit ready event
|
|
@@ -6485,9 +7556,9 @@ version: 4.2.5
|
|
|
6485
7556
|
|
|
6486
7557
|
|
|
6487
7558
|
__proto.destroy = function () {
|
|
6488
|
-
if (!this._initialized) return;
|
|
6489
7559
|
this.off();
|
|
6490
|
-
|
|
7560
|
+
|
|
7561
|
+
this._autoResizer.disable();
|
|
6491
7562
|
|
|
6492
7563
|
this._control.destroy();
|
|
6493
7564
|
|
|
@@ -6704,7 +7775,7 @@ version: 4.2.5
|
|
|
6704
7775
|
* @param {boolean} [options.includePanelHTML=false] Include panel's `outerHTML` to the returning status<ko>패널의 `outerHTML`을 반환값에 포함시킵니다</ko>
|
|
6705
7776
|
* @param {boolean} [options.visiblePanelsOnly=false] Include only {@link Flicking#visiblePanel visiblePanel}'s HTML. This option is available only when the `includePanelHTML` is true
|
|
6706
7777
|
* <ko>현재 보이는 패널({@link Flicking#visiblePanel visiblePanel})의 HTML만 반환합니다. `includePanelHTML`이 `true`일 경우에만 동작합니다.</ko>
|
|
6707
|
-
* @return {
|
|
7778
|
+
* @return {Status} An object with current status value information<ko>현재 상태값 정보를 가진 객체.</ko>
|
|
6708
7779
|
*/
|
|
6709
7780
|
|
|
6710
7781
|
|
|
@@ -6784,13 +7855,15 @@ version: 4.2.5
|
|
|
6784
7855
|
if (((_a = panels[0]) === null || _a === void 0 ? void 0 : _a.html) && !this._renderExternal) {
|
|
6785
7856
|
renderer.batchRemove({
|
|
6786
7857
|
index: 0,
|
|
6787
|
-
deleteCount: this.panels.length
|
|
7858
|
+
deleteCount: this.panels.length,
|
|
7859
|
+
hasDOMInElements: true
|
|
6788
7860
|
});
|
|
6789
7861
|
renderer.batchInsert({
|
|
6790
7862
|
index: 0,
|
|
6791
7863
|
elements: parseElement(panels.map(function (panel) {
|
|
6792
7864
|
return panel.html;
|
|
6793
|
-
}))
|
|
7865
|
+
})),
|
|
7866
|
+
hasDOMInElements: true
|
|
6794
7867
|
});
|
|
6795
7868
|
}
|
|
6796
7869
|
|
|
@@ -7027,7 +8100,8 @@ version: 4.2.5
|
|
|
7027
8100
|
|
|
7028
8101
|
return this._renderer.batchInsert({
|
|
7029
8102
|
index: index,
|
|
7030
|
-
elements: parseElement(element)
|
|
8103
|
+
elements: parseElement(element),
|
|
8104
|
+
hasDOMInElements: true
|
|
7031
8105
|
});
|
|
7032
8106
|
};
|
|
7033
8107
|
/**
|
|
@@ -7052,7 +8126,8 @@ version: 4.2.5
|
|
|
7052
8126
|
|
|
7053
8127
|
return this._renderer.batchRemove({
|
|
7054
8128
|
index: index,
|
|
7055
|
-
deleteCount: deleteCount
|
|
8129
|
+
deleteCount: deleteCount,
|
|
8130
|
+
hasDOMInElements: true
|
|
7056
8131
|
});
|
|
7057
8132
|
};
|
|
7058
8133
|
|
|
@@ -7102,11 +8177,33 @@ version: 4.2.5
|
|
|
7102
8177
|
};
|
|
7103
8178
|
|
|
7104
8179
|
__proto._createRenderer = function () {
|
|
7105
|
-
var
|
|
8180
|
+
var externalRenderer = this._externalRenderer;
|
|
8181
|
+
|
|
8182
|
+
if (this._virtual && this._panelsPerView <= 0) {
|
|
8183
|
+
// eslint-disable-next-line no-console
|
|
8184
|
+
console.warn("\"virtual\" and \"panelsPerView\" option should be used together, ignoring virtual.");
|
|
8185
|
+
}
|
|
8186
|
+
|
|
8187
|
+
return externalRenderer ? externalRenderer : this._renderExternal ? this._createExternalRenderer() : this._createVanillaRenderer();
|
|
8188
|
+
};
|
|
8189
|
+
|
|
8190
|
+
__proto._createExternalRenderer = function () {
|
|
8191
|
+
var _a = this._renderExternal,
|
|
8192
|
+
renderer = _a.renderer,
|
|
8193
|
+
rendererOptions = _a.rendererOptions;
|
|
8194
|
+
return new renderer(__assign({
|
|
7106
8195
|
align: this._align
|
|
7107
|
-
};
|
|
7108
|
-
|
|
7109
|
-
|
|
8196
|
+
}, rendererOptions));
|
|
8197
|
+
};
|
|
8198
|
+
|
|
8199
|
+
__proto._createVanillaRenderer = function () {
|
|
8200
|
+
var virtual = this.virtualEnabled;
|
|
8201
|
+
return new VanillaRenderer({
|
|
8202
|
+
align: this._align,
|
|
8203
|
+
strategy: virtual ? new VirtualRenderingStrategy() : new NormalRenderingStrategy({
|
|
8204
|
+
providerCtor: VanillaElementProvider
|
|
8205
|
+
})
|
|
8206
|
+
});
|
|
7110
8207
|
};
|
|
7111
8208
|
|
|
7112
8209
|
__proto._moveToInitialPanel = function () {
|
|
@@ -7119,6 +8216,7 @@ version: 4.2.5
|
|
|
7119
8216
|
if (!initialPanel) return [2
|
|
7120
8217
|
/*return*/
|
|
7121
8218
|
];
|
|
8219
|
+
control.setActive(initialPanel, null, false);
|
|
7122
8220
|
return [2
|
|
7123
8221
|
/*return*/
|
|
7124
8222
|
, control.moveToPanel(initialPanel, {
|
|
@@ -7139,36 +8237,10 @@ version: 4.2.5
|
|
|
7139
8237
|
*/
|
|
7140
8238
|
|
|
7141
8239
|
|
|
7142
|
-
Flicking.VERSION = "4.
|
|
8240
|
+
Flicking.VERSION = "4.4.1";
|
|
7143
8241
|
return Flicking;
|
|
7144
8242
|
}(Component);
|
|
7145
8243
|
|
|
7146
|
-
/**
|
|
7147
|
-
* An slide data component that holds information of a single HTMLElement
|
|
7148
|
-
* @ko 슬라이드 데이터 컴포넌트로, 단일 HTMLElement의 정보를 갖고 있습니다
|
|
7149
|
-
*/
|
|
7150
|
-
|
|
7151
|
-
var ExternalPanel = function (_super) {
|
|
7152
|
-
__extends(ExternalPanel, _super);
|
|
7153
|
-
/**
|
|
7154
|
-
* @param {object} options An options object<ko>옵션 오브젝트</ko>
|
|
7155
|
-
* @param {HTMLElement} [options.el] A `HTMLElement` panel's referencing<ko>패널이 참조하는 `HTMLElement`</ko>
|
|
7156
|
-
* @param {number} [options.index] An initial index of the panel<ko>패널의 초기 인덱스</ko>
|
|
7157
|
-
* @param {Constants.ALIGN | string | number} [options.align] An initial {@link Flicking#align align} value of the panel<ko>패널의 초기 {@link Flicking#align align}값</ko>
|
|
7158
|
-
* @param {Flicking} [options.flicking] A Flicking instance panel's referencing<ko>패널이 참조하는 {@link Flicking} 인스턴스</ko>
|
|
7159
|
-
*/
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
function ExternalPanel(options) {
|
|
7163
|
-
var _this = _super.call(this, options) || this;
|
|
7164
|
-
|
|
7165
|
-
_this._externalComponent = options.externalComponent;
|
|
7166
|
-
return _this;
|
|
7167
|
-
}
|
|
7168
|
-
|
|
7169
|
-
return ExternalPanel;
|
|
7170
|
-
}(Panel);
|
|
7171
|
-
|
|
7172
8244
|
/*
|
|
7173
8245
|
* Copyright (c) 2015 NAVER Corp.
|
|
7174
8246
|
* egjs projects are licensed under the MIT license
|
|
@@ -7179,9 +8251,11 @@ version: 4.2.5
|
|
|
7179
8251
|
Viewport: Viewport,
|
|
7180
8252
|
FlickingError: FlickingError,
|
|
7181
8253
|
AnchorPoint: AnchorPoint,
|
|
8254
|
+
VirtualManager: VirtualManager,
|
|
8255
|
+
VanillaElementProvider: VanillaElementProvider,
|
|
8256
|
+
VirtualElementProvider: VirtualElementProvider,
|
|
7182
8257
|
Panel: Panel,
|
|
7183
|
-
|
|
7184
|
-
ExternalPanel: ExternalPanel
|
|
8258
|
+
VirtualPanel: VirtualPanel
|
|
7185
8259
|
};
|
|
7186
8260
|
|
|
7187
8261
|
/**
|
|
@@ -7335,7 +8409,8 @@ version: 4.2.5
|
|
|
7335
8409
|
renderer.batchInsert.apply(renderer, __spreadArray([], __read(diffResult.added.slice(startIdx, endIdx).map(function (index, elIdx) {
|
|
7336
8410
|
return {
|
|
7337
8411
|
index: index,
|
|
7338
|
-
elements: [rendered[elIdx + diffResult.prevList.length]]
|
|
8412
|
+
elements: [rendered[elIdx + diffResult.prevList.length]],
|
|
8413
|
+
hasDOMInElements: false
|
|
7339
8414
|
};
|
|
7340
8415
|
}))));
|
|
7341
8416
|
};
|
|
@@ -7344,7 +8419,8 @@ version: 4.2.5
|
|
|
7344
8419
|
var removed = renderer.panels.slice(startIdx, endIdx);
|
|
7345
8420
|
renderer.batchRemove({
|
|
7346
8421
|
index: startIdx,
|
|
7347
|
-
deleteCount: removed.length
|
|
8422
|
+
deleteCount: removed.length,
|
|
8423
|
+
hasDOMInElements: false
|
|
7348
8424
|
});
|
|
7349
8425
|
};
|
|
7350
8426
|
|
|
@@ -7368,7 +8444,7 @@ version: 4.2.5
|
|
|
7368
8444
|
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
7369
8445
|
}).map(function (panel) {
|
|
7370
8446
|
return diffResult.list[maintainedMap[panel.index]];
|
|
7371
|
-
}))), __read(diffResult.added.map(function (idx) {
|
|
8447
|
+
})), false), __read(diffResult.added.map(function (idx) {
|
|
7372
8448
|
return diffResult.list[idx];
|
|
7373
8449
|
})));
|
|
7374
8450
|
});
|
|
@@ -7437,8 +8513,9 @@ version: 4.2.5
|
|
|
7437
8513
|
merge(Flicking, Renderer);
|
|
7438
8514
|
merge(Flicking, Constants);
|
|
7439
8515
|
merge(Flicking, CFC);
|
|
8516
|
+
merge(Flicking, Utils);
|
|
7440
8517
|
|
|
7441
8518
|
return Flicking;
|
|
7442
8519
|
|
|
7443
|
-
}))
|
|
8520
|
+
}));
|
|
7444
8521
|
//# sourceMappingURL=flicking.js.map
|