@egjs/flicking 4.12.0-beta.5 → 4.12.0-beta.7

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.
Files changed (78) hide show
  1. package/declaration/CrossFlicking.d.ts +36 -0
  2. package/declaration/Flicking.d.ts +244 -244
  3. package/declaration/camera/Camera.d.ts +89 -90
  4. package/declaration/camera/index.d.ts +4 -4
  5. package/declaration/camera/mode/BoundCameraMode.d.ts +13 -13
  6. package/declaration/camera/mode/CameraMode.d.ts +20 -20
  7. package/declaration/camera/mode/CircularCameraMode.d.ts +19 -19
  8. package/declaration/camera/mode/LinearCameraMode.d.ts +9 -9
  9. package/declaration/camera/mode/index.d.ts +6 -6
  10. package/declaration/cfc/getDefaultCameraTransform.d.ts +3 -3
  11. package/declaration/cfc/getRenderingPanels.d.ts +4 -4
  12. package/declaration/cfc/index.d.ts +5 -5
  13. package/declaration/cfc/sync.d.ts +4 -4
  14. package/declaration/cfc/withFlickingMethods.d.ts +2 -2
  15. package/declaration/const/axes.d.ts +8 -8
  16. package/declaration/const/error.d.ts +34 -34
  17. package/declaration/const/external.d.ts +54 -48
  18. package/declaration/control/AxesController.d.ts +44 -44
  19. package/declaration/control/Control.d.ts +45 -45
  20. package/declaration/control/FreeControl.d.ts +14 -14
  21. package/declaration/control/SnapControl.d.ts +16 -16
  22. package/declaration/control/StateMachine.d.ts +14 -14
  23. package/declaration/control/StrictControl.d.ts +20 -20
  24. package/declaration/control/index.d.ts +14 -14
  25. package/declaration/control/states/AnimatingState.d.ts +9 -9
  26. package/declaration/control/states/DisabledState.d.ts +9 -9
  27. package/declaration/control/states/DraggingState.d.ts +8 -8
  28. package/declaration/control/states/HoldingState.d.ts +10 -10
  29. package/declaration/control/states/IdleState.d.ts +9 -9
  30. package/declaration/control/states/State.d.ts +47 -47
  31. package/declaration/core/AnchorPoint.d.ts +15 -15
  32. package/declaration/core/AutoResizer.d.ts +16 -16
  33. package/declaration/core/FlickingError.d.ts +5 -5
  34. package/declaration/core/ResizeWatcher.d.ts +33 -33
  35. package/declaration/core/Viewport.d.ts +25 -25
  36. package/declaration/core/VirtualManager.d.ts +37 -37
  37. package/declaration/core/index.d.ts +6 -6
  38. package/declaration/core/panel/Panel.d.ts +89 -89
  39. package/declaration/core/panel/VirtualPanel.d.ts +19 -19
  40. package/declaration/core/panel/index.d.ts +5 -5
  41. package/declaration/core/panel/provider/ElementProvider.d.ts +8 -8
  42. package/declaration/core/panel/provider/VanillaElementProvider.d.ts +12 -12
  43. package/declaration/core/panel/provider/VirtualElementProvider.d.ts +15 -15
  44. package/declaration/core/panel/provider/index.d.ts +5 -5
  45. package/declaration/index.cjs.d.ts +3 -3
  46. package/declaration/index.d.ts +15 -13
  47. package/declaration/index.umd.d.ts +2 -2
  48. package/declaration/renderer/ExternalRenderer.d.ts +7 -7
  49. package/declaration/renderer/Renderer.d.ts +59 -59
  50. package/declaration/renderer/VanillaRenderer.d.ts +10 -10
  51. package/declaration/renderer/index.d.ts +6 -6
  52. package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +23 -23
  53. package/declaration/renderer/strategy/RenderingStrategy.d.ts +15 -15
  54. package/declaration/renderer/strategy/VirtualRenderingStrategy.d.ts +17 -17
  55. package/declaration/renderer/strategy/index.d.ts +5 -5
  56. package/declaration/type/event.d.ts +88 -88
  57. package/declaration/type/external.d.ts +31 -31
  58. package/declaration/type/internal.d.ts +13 -13
  59. package/declaration/utils.d.ts +47 -45
  60. package/dist/flicking.cjs.js +363 -27
  61. package/dist/flicking.cjs.js.map +1 -1
  62. package/dist/flicking.esm.js +355 -27
  63. package/dist/flicking.esm.js.map +1 -1
  64. package/dist/flicking.js +364 -27
  65. package/dist/flicking.js.map +1 -1
  66. package/dist/flicking.min.js +2 -2
  67. package/dist/flicking.min.js.map +1 -1
  68. package/dist/flicking.pkgd.js +1129 -785
  69. package/dist/flicking.pkgd.js.map +1 -1
  70. package/dist/flicking.pkgd.min.js +2 -2
  71. package/dist/flicking.pkgd.min.js.map +1 -1
  72. package/package.json +3 -2
  73. package/src/CrossFlicking.ts +403 -0
  74. package/src/camera/Camera.ts +4 -24
  75. package/src/const/external.ts +14 -0
  76. package/src/index.ts +4 -1
  77. package/src/index.umd.ts +2 -0
  78. package/src/utils.ts +21 -0
@@ -1,45 +1,47 @@
1
- import Flicking, { FlickingOptions } from "./Flicking";
2
- import { ALIGN, DIRECTION } from "./const/external";
3
- import { LiteralUnion, Merged, ValueOf } from "./type/internal";
4
- import { ElementLike } from "./type/external";
5
- export declare const merge: <From extends object, To extends object>(target: From, ...sources: To[]) => Merged<From, To>;
6
- export declare const getElement: (el: HTMLElement | string | null, parent?: HTMLElement) => HTMLElement;
7
- export declare const checkExistence: (value: any, nameOnErrMsg: string) => void;
8
- export declare const clamp: (x: number, min: number, max: number) => number;
9
- export declare const getFlickingAttached: (val: Flicking | null) => Flicking;
10
- export declare const toArray: <T>(iterable: ArrayLike<T>) => T[];
11
- export declare const parseAlign: (align: LiteralUnion<ValueOf<typeof ALIGN>> | number, size: number) => number;
12
- export declare const parseBounce: (bounce: FlickingOptions["bounce"], size: number) => number[];
13
- export declare const parseArithmeticSize: (cssValue: number | string, base: number) => number | null;
14
- export declare const parseArithmeticExpression: (cssValue: number | string) => {
15
- percentage: number;
16
- absolute: number;
17
- } | null;
18
- export declare const parseCSSSizeValue: (val: string | number) => string;
19
- export declare const parsePanelAlign: (align: FlickingOptions["align"]) => string | number;
20
- export declare const getDirection: (start: number, end: number) => ValueOf<typeof DIRECTION>;
21
- export declare const parseElement: (element: ElementLike | ElementLike[]) => HTMLElement[];
22
- export declare const getMinusCompensatedIndex: (idx: number, max: number) => number;
23
- export declare const includes: <T>(array: T[], target: any) => target is T;
24
- export declare const isString: (val: any) => val is string;
25
- export declare const circulatePosition: (pos: number, min: number, max: number) => number;
26
- export declare const find: <T>(array: T[], checker: (val: T) => boolean) => T;
27
- export declare const findRight: <T>(array: T[], checker: (val: T) => boolean) => T;
28
- export declare const findIndex: <T>(array: T[], checker: (val: T) => boolean) => number;
29
- export declare const getProgress: (pos: number, prev: number, next: number) => number;
30
- export declare const getStyle: (el: HTMLElement) => CSSStyleDeclaration;
31
- export declare const setSize: (el: HTMLElement, { width, height }: Partial<{
32
- width: number | string;
33
- height: number | string;
34
- }>) => void;
35
- export declare const isBetween: (val: number, min: number, max: number) => boolean;
36
- export declare const circulateIndex: (index: number, max: number) => number;
37
- export declare const range: (end: number) => number[];
38
- export declare const getElementSize: ({ el, horizontal, useFractionalSize, useOffset, style }: {
39
- el: HTMLElement;
40
- horizontal: boolean;
41
- useFractionalSize: boolean;
42
- useOffset: boolean;
43
- style: CSSStyleDeclaration;
44
- }) => number;
45
- export declare const setPrototypeOf: (o: any, proto: object) => any;
1
+ import Flicking, { FlickingOptions } from "./Flicking";
2
+ import { ALIGN, DIRECTION } from "./const/external";
3
+ import { LiteralUnion, Merged, ValueOf } from "./type/internal";
4
+ import { ElementLike } from "./type/external";
5
+ export declare const merge: <From extends object, To extends object>(target: From, ...sources: To[]) => Merged<From, To>;
6
+ export declare const getElement: (el: HTMLElement | string | null, parent?: HTMLElement) => HTMLElement;
7
+ export declare const checkExistence: (value: any, nameOnErrMsg: string) => void;
8
+ export declare const clamp: (x: number, min: number, max: number) => number;
9
+ export declare const getFlickingAttached: (val: Flicking | null) => Flicking;
10
+ export declare const toArray: <T>(iterable: ArrayLike<T>) => T[];
11
+ export declare const parseAlign: (align: LiteralUnion<ValueOf<typeof ALIGN>> | number, size: number) => number;
12
+ export declare const parseBounce: (bounce: FlickingOptions["bounce"], size: number) => number[];
13
+ export declare const parseArithmeticSize: (cssValue: number | string, base: number) => number | null;
14
+ export declare const parseArithmeticExpression: (cssValue: number | string) => {
15
+ percentage: number;
16
+ absolute: number;
17
+ } | null;
18
+ export declare const parseCSSSizeValue: (val: string | number) => string;
19
+ export declare const parsePanelAlign: (align: FlickingOptions["align"]) => string | number;
20
+ export declare const getDirection: (start: number, end: number) => ValueOf<typeof DIRECTION>;
21
+ export declare const parseElement: (element: ElementLike | ElementLike[]) => HTMLElement[];
22
+ export declare const getMinusCompensatedIndex: (idx: number, max: number) => number;
23
+ export declare const includes: <T>(array: T[], target: any) => target is T;
24
+ export declare const isString: (val: any) => val is string;
25
+ export declare const circulatePosition: (pos: number, min: number, max: number) => number;
26
+ export declare const find: <T>(array: T[], checker: (val: T) => boolean) => T;
27
+ export declare const findRight: <T>(array: T[], checker: (val: T) => boolean) => T;
28
+ export declare const findIndex: <T>(array: T[], checker: (val: T) => boolean) => number;
29
+ export declare const getProgress: (pos: number, prev: number, next: number) => number;
30
+ export declare const getStyle: (el: HTMLElement) => CSSStyleDeclaration;
31
+ export declare const setSize: (el: HTMLElement, { width, height }: Partial<{
32
+ width: number | string;
33
+ height: number | string;
34
+ }>) => void;
35
+ export declare const isBetween: (val: number, min: number, max: number) => boolean;
36
+ export declare const circulateIndex: (index: number, max: number) => number;
37
+ export declare const range: (end: number) => number[];
38
+ export declare const getElementSize: ({ el, horizontal, useFractionalSize, useOffset, style }: {
39
+ el: HTMLElement;
40
+ horizontal: boolean;
41
+ useFractionalSize: boolean;
42
+ useOffset: boolean;
43
+ style: CSSStyleDeclaration;
44
+ }) => number;
45
+ export declare const setPrototypeOf: (o: any, proto: object) => any;
46
+ export declare const camelize: (str: string) => string;
47
+ export declare const getDataAttributes: (element: HTMLElement, attributePrefix: string) => Record<string, string>;
@@ -4,7 +4,7 @@ name: @egjs/flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking
7
- version: 4.12.0-beta.5
7
+ version: 4.12.0-beta.7
8
8
  */
9
9
  'use strict';
10
10
 
@@ -12,7 +12,7 @@ var Component = require('@egjs/component');
12
12
  var Axes = require('@egjs/axes');
13
13
  var ImReady = require('@egjs/imready');
14
14
 
15
- /*! *****************************************************************************
15
+ /******************************************************************************
16
16
  Copyright (c) Microsoft Corporation.
17
17
 
18
18
  Permission to use, copy, modify, and/or distribute this software for any
@@ -26,7 +26,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
26
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
27
  PERFORMANCE OF THIS SOFTWARE.
28
28
  ***************************************************************************** */
29
- /* global Reflect, Promise */
29
+ /* global Reflect, Promise, SuppressedError, Symbol */
30
30
 
31
31
  var extendStatics = function (d, b) {
32
32
  extendStatics = Object.setPrototypeOf || {
@@ -111,7 +111,7 @@ function __generator(thisArg, body) {
111
111
  }
112
112
  function step(op) {
113
113
  if (f) throw new TypeError("Generator is already executing.");
114
- while (_) try {
114
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
115
115
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
116
116
  if (y = 0, t) op = [op[0] & 2, t.value];
117
117
  switch (op[0]) {
@@ -215,6 +215,10 @@ function __spread() {
215
215
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
216
216
  return ar;
217
217
  }
218
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
219
+ var e = new Error(message);
220
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
221
+ };
218
222
 
219
223
  /*
220
224
  * Copyright (c) 2015 NAVER Corp.
@@ -383,6 +387,8 @@ var MOVE_TYPE = {
383
387
  STRICT: "strict"
384
388
  };
385
389
  var CLASS = {
390
+ VIEWPORT: "flicking-viewport",
391
+ CAMERA: "flicking-camera",
386
392
  VERTICAL: "vertical",
387
393
  HIDDEN: "flicking-hidden",
388
394
  DEFAULT_VIRTUAL: "flicking-panel"
@@ -409,6 +415,17 @@ var ORDER = {
409
415
  LTR: "ltr",
410
416
  RTL: "rtl"
411
417
  };
418
+ /**
419
+ * An object that contains the direction that {@link Flicking} is moving
420
+ * @ko {@link Flicking}이 움직이는 방향을 담고 있는 객체
421
+ * @type {object}
422
+ * @property {"horizontal"} HORIZONTAL horizontal<ko>수평 방향</ko>
423
+ * @property {"vertical"} VERTICAL vertical<ko>수직 방향</ko>
424
+ */
425
+ var MOVE_DIRECTION = {
426
+ HORIZONTAL: "horizontal",
427
+ VERTICAL: "vertical"
428
+ };
412
429
 
413
430
  // eslint-disable-next-line @typescript-eslint/ban-types
414
431
  var merge = function (target) {
@@ -723,6 +740,26 @@ var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
723
740
  obj.__proto__ = proto;
724
741
  return obj;
725
742
  };
743
+ var camelize = function (str) {
744
+ return str.replace(/[\s-_]([a-z])/g, function (all, letter) {
745
+ return letter.toUpperCase();
746
+ });
747
+ };
748
+ var getDataAttributes = function (element, attributePrefix) {
749
+ var dataAttributes = {};
750
+ var attributes = element.attributes;
751
+ var length = attributes.length;
752
+ for (var i = 0; i < length; ++i) {
753
+ var attribute = attributes[i];
754
+ var name_1 = attribute.name,
755
+ value = attribute.value;
756
+ if (name_1.indexOf(attributePrefix) === -1) {
757
+ continue;
758
+ }
759
+ dataAttributes[camelize(name_1.replace(attributePrefix, ""))] = value;
760
+ }
761
+ return dataAttributes;
762
+ };
726
763
 
727
764
  /*
728
765
  * Copyright (c) 2015 NAVER Corp.
@@ -3709,7 +3746,6 @@ var Camera = /*#__PURE__*/function () {
3709
3746
  var _this = this;
3710
3747
  var _b = (_a === void 0 ? {} : _a).align,
3711
3748
  align = _b === void 0 ? ALIGN.CENTER : _b;
3712
- this._lookedOffset = 0;
3713
3749
  this._checkTranslateSupport = function () {
3714
3750
  var e_1, _a;
3715
3751
  var transforms = ["webkitTransform", "msTransform", "MozTransform", "OTransform", "transform"];
@@ -4069,8 +4105,6 @@ var Camera = /*#__PURE__*/function () {
4069
4105
  */
4070
4106
  __proto.lookAt = function (pos) {
4071
4107
  var _this = this;
4072
- var prevOffset = this._offset;
4073
- var isChangedOffset = this._lookedOffset !== prevOffset;
4074
4108
  var flicking = getFlickingAttached(this._flicking);
4075
4109
  var prevPos = this._position;
4076
4110
  this._position = pos;
@@ -4081,12 +4115,7 @@ var Camera = /*#__PURE__*/function () {
4081
4115
  if (toggled) {
4082
4116
  void flicking.renderer.render().then(function () {
4083
4117
  _this.updateOffset();
4084
- _this._lookedOffset = _this._offset;
4085
4118
  });
4086
- } else if (isChangedOffset) {
4087
- // sync offset for renderOnlyVisible on resize
4088
- this.updateOffset();
4089
- this._lookedOffset = this._offset;
4090
4119
  } else {
4091
4120
  this.applyTransform();
4092
4121
  }
@@ -4261,8 +4290,8 @@ var Camera = /*#__PURE__*/function () {
4261
4290
  return this;
4262
4291
  };
4263
4292
  /**
4264
- * Update Viewport's height to visible panel's max height
4265
- * @ko 현재 활성화된 패널과 보이는 패널의 최대 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
4293
+ * Update Viewport's height to active panel's height
4294
+ * @ko 현재 선택된 패널의 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
4266
4295
  * @throws {FlickingError}
4267
4296
  * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
4268
4297
  * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
@@ -4272,17 +4301,9 @@ var Camera = /*#__PURE__*/function () {
4272
4301
  __proto.updateAdaptiveHeight = function () {
4273
4302
  var flicking = getFlickingAttached(this._flicking);
4274
4303
  var activePanel = flicking.control.activePanel;
4275
- var visiblePanels = flicking.visiblePanels;
4276
- var selectedPanels = __spread(visiblePanels);
4277
- if (activePanel) {
4278
- selectedPanels.push(activePanel);
4279
- }
4280
- if (!flicking.horizontal || !flicking.adaptive || !selectedPanels.length) return;
4281
- var maxHeight = Math.max.apply(Math, __spread(selectedPanels.map(function (panel) {
4282
- return panel.height;
4283
- })));
4304
+ if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
4284
4305
  flicking.viewport.setSize({
4285
- height: maxHeight
4306
+ height: activePanel.height
4286
4307
  });
4287
4308
  };
4288
4309
  /**
@@ -4353,7 +4374,6 @@ var Camera = /*#__PURE__*/function () {
4353
4374
  };
4354
4375
  __proto._resetInternalValues = function () {
4355
4376
  this._position = 0;
4356
- this._lookedOffset = 0;
4357
4377
  this._alignPos = 0;
4358
4378
  this._offset = 0;
4359
4379
  this._circularOffset = 0;
@@ -7875,10 +7895,318 @@ var Flicking = /*#__PURE__*/function (_super) {
7875
7895
  * Flicking.VERSION; // ex) 4.0.0
7876
7896
  * ```
7877
7897
  */
7878
- Flicking.VERSION = "4.12.0-beta.5";
7898
+ Flicking.VERSION = "4.12.0-beta.7";
7879
7899
  return Flicking;
7880
7900
  }(Component);
7881
7901
 
7902
+ /*
7903
+ * Copyright (c) 2015 NAVER Corp.
7904
+ * egjs projects are licensed under the MIT license
7905
+ */
7906
+ /**
7907
+ * @extends Component
7908
+ * @support {"ie": "9+(with polyfill)", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "4.X+"}
7909
+ * @requires {@link https://github.com/naver/egjs-component|@egjs/component}
7910
+ * @requires {@link https://github.com/naver/egjs-axes|@egjs/axes}
7911
+ */
7912
+ var CrossFlicking = /*#__PURE__*/function (_super) {
7913
+ __extends(CrossFlicking, _super);
7914
+ // Options Setter
7915
+ // public set align(val: FlickingOptions["align"]) {
7916
+ // this._align = val;
7917
+ // }
7918
+ function CrossFlicking(root, options) {
7919
+ if (options === void 0) {
7920
+ options = {};
7921
+ }
7922
+ var _this = _super.call(this, root, options) || this;
7923
+ _this._onHorizontalHoldStart = function () {
7924
+ _this.dragThreshold = 10;
7925
+ _this._moveDirection = null;
7926
+ };
7927
+ _this._onHorizontalMove = function (e) {
7928
+ if (e.isTrusted && !_this._moveDirection) {
7929
+ _this._sideFlicking.forEach(function (child) {
7930
+ child.dragThreshold = Infinity;
7931
+ });
7932
+ _this._moveDirection = MOVE_DIRECTION.HORIZONTAL;
7933
+ }
7934
+ };
7935
+ _this._onHorizontalMoveEnd = function (e) {
7936
+ var visiblePanels = _this.visiblePanels;
7937
+ _this._sideFlicking.forEach(function (child) {
7938
+ child.dragThreshold = 10;
7939
+ });
7940
+ _this._moveDirection = null;
7941
+ if (visiblePanels.length > 1) {
7942
+ _this._nextIndex = e.direction === "NEXT" ? visiblePanels[1].index : visiblePanels[0].index;
7943
+ } else {
7944
+ _this._nextIndex = visiblePanels[0].index;
7945
+ }
7946
+ // _syncToCategory에서 완전히 가로 이동이 이루어지기 전에 세로 방향 index가 변하는 경우가 있어 timeout으로 처리
7947
+ _this._sideFlicking.forEach(function (child, i) {
7948
+ if (_this._nextIndex !== i) {
7949
+ var _a = _this._sideState[i],
7950
+ start = _a.start,
7951
+ end = _a.end;
7952
+ if (child.index < start) {
7953
+ child.stopAnimation();
7954
+ void child.moveTo(start, 0);
7955
+ } else if (child.index > end) {
7956
+ child.stopAnimation();
7957
+ void child.moveTo(end, 0);
7958
+ }
7959
+ }
7960
+ });
7961
+ if (e.isTrusted) {
7962
+ _this._syncToCategory(_this._sideFlicking[_this._nextIndex].index, _this._nextIndex);
7963
+ }
7964
+ };
7965
+ _this._onSideHoldStart = function () {
7966
+ _this._sideFlicking.forEach(function (child) {
7967
+ child.dragThreshold = 10;
7968
+ });
7969
+ _this._moveDirection = null;
7970
+ };
7971
+ _this._onSideMove = function (e) {
7972
+ if (e.isTrusted && !_this._moveDirection) {
7973
+ _this.dragThreshold = Infinity;
7974
+ _this._moveDirection = MOVE_DIRECTION.VERTICAL;
7975
+ }
7976
+ };
7977
+ _this._onSideMoveEnd = function () {
7978
+ _this.dragThreshold = 10;
7979
+ _this._moveDirection = null;
7980
+ };
7981
+ _this._onSideChanged = function (e) {
7982
+ // this.visiblePanels.length 가 2보다 크다면 가로 방향 Flicking이 조작 중이라는 것을 의미합니다.
7983
+ // 이 경우 가로 방향 Flicking의 이동이 완전히 끝난 뒤 _onHorizontalMoveEnd 에서 syncToCategory할 것이므로 여기서는 하지 않습니다.
7984
+ if (_this.visiblePanels.length < 2 && _this._sideFlicking[_this.index] === e.currentTarget) {
7985
+ _this._syncToCategory(e.index, _this.index);
7986
+ }
7987
+ };
7988
+ // Internal states
7989
+ _this._sideState = _this._createSideState();
7990
+ _this._moveDirection = null;
7991
+ _this._nextIndex = 0;
7992
+ // Bind options
7993
+ _this._sideOptions = options.sideOptions;
7994
+ // Create core components
7995
+ _this._sideFlicking = _this._createSideFlicking();
7996
+ return _this;
7997
+ }
7998
+ var __proto = CrossFlicking.prototype;
7999
+ Object.defineProperty(__proto, "sideFlicking", {
8000
+ // Components
8001
+ /**
8002
+ * {@link Control} instance of the Flicking
8003
+ * @ko 현재 Flicking에 활성화된 {@link Control} 인스턴스
8004
+ * @type {Control}
8005
+ * @default SnapControl
8006
+ * @readonly
8007
+ * @see Control
8008
+ * @see SnapControl
8009
+ * @see FreeControl
8010
+ */
8011
+ get: function () {
8012
+ return this._sideFlicking;
8013
+ },
8014
+ enumerable: false,
8015
+ configurable: true
8016
+ });
8017
+ Object.defineProperty(__proto, "sideState", {
8018
+ // Internal States
8019
+ /**
8020
+ * Whether Flicking's {@link Flicking#init init()} is called.
8021
+ * This is `true` when {@link Flicking#init init()} is called, and is `false` after calling {@link Flicking#destroy destroy()}.
8022
+ * @ko Flicking의 {@link Flicking#init init()}이 호출되었는지를 나타내는 멤버 변수.
8023
+ * 이 값은 {@link Flicking#init init()}이 호출되었으면 `true`로 변하고, {@link Flicking#destroy destroy()}호출 이후에 다시 `false`로 변경됩니다.
8024
+ * @type {boolean}
8025
+ * @default false
8026
+ * @readonly
8027
+ */
8028
+ get: function () {
8029
+ return this._sideState;
8030
+ },
8031
+ enumerable: false,
8032
+ configurable: true
8033
+ });
8034
+ Object.defineProperty(__proto, "sideOptions", {
8035
+ // Options Getter
8036
+ /**
8037
+ * Change active panel index on mouse/touch hold while animating.
8038
+ * `index` of the `willChange`/`willRestore` event will be used as new index.
8039
+ * @ko 애니메이션 도중 마우스/터치 입력시 현재 활성화된 패널의 인덱스를 변경합니다.
8040
+ * `willChange`/`willRestore` 이벤트의 `index`값이 새로운 인덱스로 사용될 것입니다.
8041
+ * @type {FlickingOptions}
8042
+ * @default undefined
8043
+ * @see {@link https://naver.github.io/egjs-flicking/Options#changeonhold changeOnHold ( Options )}
8044
+ */
8045
+ get: function () {
8046
+ return this._sideOptions;
8047
+ },
8048
+ enumerable: false,
8049
+ configurable: true
8050
+ });
8051
+ /**
8052
+ * Initialize Flicking and move to the default index
8053
+ * This is automatically called on Flicking's constructor when `autoInit` is true(default)
8054
+ * @ko Flicking을 초기화하고, 디폴트 인덱스로 이동합니다
8055
+ * 이 메소드는 `autoInit` 옵션이 true(default)일 경우 Flicking이 생성될 때 자동으로 호출됩니다
8056
+ * @fires Flicking#ready
8057
+ * @return {Promise<void>}
8058
+ */
8059
+ __proto.init = function () {
8060
+ var _this = this;
8061
+ return _super.prototype.init.call(this).then(function () {
8062
+ return _this._addComponentEvents();
8063
+ });
8064
+ };
8065
+ /**
8066
+ * Destroy Flicking and remove all event handlers
8067
+ * @ko Flicking과 하위 컴포넌트들을 초기 상태로 되돌리고, 부착된 모든 이벤트 핸들러를 제거합니다
8068
+ * @return {void}
8069
+ */
8070
+ __proto.destroy = function () {
8071
+ // TODO 모든 child flicking destroy
8072
+ _super.prototype.destroy.call(this);
8073
+ };
8074
+ __proto._addComponentEvents = function () {
8075
+ var _this = this;
8076
+ this.on(EVENTS.HOLD_START, this._onHorizontalHoldStart);
8077
+ this.on(EVENTS.MOVE, this._onHorizontalMove);
8078
+ this.on(EVENTS.MOVE_END, this._onHorizontalMoveEnd);
8079
+ this._sideFlicking.forEach(function (flicking) {
8080
+ flicking.on(EVENTS.HOLD_START, _this._onSideHoldStart);
8081
+ flicking.on(EVENTS.MOVE, _this._onSideMove);
8082
+ flicking.on(EVENTS.MOVE_END, _this._onSideMoveEnd);
8083
+ flicking.on(EVENTS.CHANGED, _this._onSideChanged);
8084
+ });
8085
+ };
8086
+ __proto._createSideState = function () {
8087
+ var _this = this;
8088
+ // data-index로 분류하기 전에 임시로 모든 children에 대해 side flicking으로 해보자.
8089
+ // panels에 data-attributes가 붙어있을 때와 안 붙어있을 때를 다르게 처리
8090
+ // 붙어있다면 가상의 viewport들을 index 갯수만큼 만들어줘야 한다
8091
+ var viewportEl = this.element;
8092
+ var cameraEl = this.camera.element;
8093
+ var panels = toArray(cameraEl.children);
8094
+ var sideState = [];
8095
+ var sidePanels = "";
8096
+ // check data attribute exists
8097
+ var groupKeys = [];
8098
+ var groupPanels = {};
8099
+ var sideCamera = document.createElement("div");
8100
+ sideCamera.classList.add(CLASS.CAMERA);
8101
+ var isCrossStructure = getDataAttributes(viewportEl, "data-cross-").structure;
8102
+ if (!isCrossStructure) {
8103
+ viewportEl.setAttribute("data-cross-structure", "true");
8104
+ panels.forEach(function (panel) {
8105
+ var groupKey = getDataAttributes(panel, "data-cross-").groupkey;
8106
+ if (groupKey && !includes(groupKeys, groupKey)) {
8107
+ groupKeys.push(groupKey);
8108
+ groupPanels[groupKey] = [panel];
8109
+ } else if (groupKey) {
8110
+ groupPanels[groupKey].push(panel);
8111
+ }
8112
+ });
8113
+ if (groupKeys.length) {
8114
+ sideState = groupKeys.reduce(function (state, key) {
8115
+ var start = state.length ? +state[state.length - 1].end + 1 : 0;
8116
+ var element = groupPanels[key].reduce(function (el, panel) {
8117
+ sidePanels += panel.outerHTML;
8118
+ el.innerHTML += panel.outerHTML;
8119
+ return el;
8120
+ }, document.createElement("div"));
8121
+ return __spread(state, [{
8122
+ key: key,
8123
+ start: start,
8124
+ end: start + groupPanels[key].length - 1,
8125
+ element: element
8126
+ }]);
8127
+ }, []);
8128
+ this.remove(0, this.panelCount - groupKeys.length);
8129
+ sideState.forEach(function (_, i) {
8130
+ var panel = _this.camera.children[i];
8131
+ Array.from(panel.attributes).forEach(function (attribute) {
8132
+ return panel.removeAttribute(attribute.name);
8133
+ });
8134
+ });
8135
+ } else {
8136
+ sideState = panels.reduce(function (state, panel, i) {
8137
+ var start = state.length ? +state[state.length - 1].end + 1 : 0;
8138
+ sidePanels += panel.innerHTML;
8139
+ return __spread(state, [{
8140
+ key: i.toString(),
8141
+ start: start,
8142
+ end: start + panel.children.length - 1,
8143
+ element: panel
8144
+ }]);
8145
+ }, []);
8146
+ }
8147
+ sideCamera.innerHTML = sidePanels;
8148
+ sideState.forEach(function (_, i) {
8149
+ var panel = _this.camera.children[i];
8150
+ [CLASS.VIEWPORT, CLASS.VERTICAL].forEach(function (className) {
8151
+ if (!panel.classList.contains(className)) {
8152
+ panel.classList.add(className);
8153
+ }
8154
+ });
8155
+ panel.innerHTML = sideCamera.outerHTML;
8156
+ });
8157
+ } else {
8158
+ toArray(panels[0].children[0].children).forEach(function (panel) {
8159
+ var groupKey = getDataAttributes(panel, "data-cross-").groupkey;
8160
+ if (groupKey && !includes(groupKeys, groupKey)) {
8161
+ groupKeys.push(groupKey);
8162
+ groupPanels[groupKey] = [panel];
8163
+ } else if (groupKey) {
8164
+ groupPanels[groupKey].push(panel);
8165
+ }
8166
+ });
8167
+ sideState = groupKeys.reduce(function (state, key) {
8168
+ var start = state.length ? +state[state.length - 1].end + 1 : 0;
8169
+ var element = groupPanels[key].reduce(function (el, panel) {
8170
+ el.innerHTML += panel.outerHTML;
8171
+ return el;
8172
+ }, document.createElement("div"));
8173
+ return __spread(state, [{
8174
+ key: key,
8175
+ start: start,
8176
+ end: start + groupPanels[key].length - 1,
8177
+ element: element
8178
+ }]);
8179
+ }, []);
8180
+ }
8181
+ return sideState;
8182
+ };
8183
+ __proto._createSideFlicking = function () {
8184
+ var _this = this;
8185
+ return this.sideState.map(function (state, i) {
8186
+ return new Flicking(_this.camera.children[i], __assign(__assign({}, _this.sideOptions), {
8187
+ horizontal: false,
8188
+ panelsPerView: 1,
8189
+ defaultIndex: state.start
8190
+ }));
8191
+ });
8192
+ };
8193
+ __proto._syncToCategory = function (index, outerIndex) {
8194
+ var _this = this;
8195
+ this.stopAnimation();
8196
+ this._sideFlicking.forEach(function (child, i) {
8197
+ var _a = _this._sideState[i],
8198
+ start = _a.start,
8199
+ end = _a.end;
8200
+ if (start <= index && end >= index && outerIndex !== i) {
8201
+ child.stopAnimation();
8202
+ void child.moveTo(index, 0);
8203
+ void _this.moveTo(i, 0);
8204
+ }
8205
+ });
8206
+ };
8207
+ return CrossFlicking;
8208
+ }(Flicking);
8209
+
7882
8210
  /**
7883
8211
  * Decorator that makes the method of flicking available in the framework.
7884
8212
  * @ko 프레임워크에서 플리킹의 메소드를 사용할 수 있게 하는 데코레이터.
@@ -8096,6 +8424,7 @@ var parseAlign = function (alignVal) {
8096
8424
  var modules = {
8097
8425
  __proto__: null,
8098
8426
  'default': Flicking,
8427
+ CrossFlicking: CrossFlicking,
8099
8428
  VanillaElementProvider: VanillaElementProvider,
8100
8429
  VirtualElementProvider: VirtualElementProvider,
8101
8430
  Panel: Panel,
@@ -8133,6 +8462,7 @@ var modules = {
8133
8462
  CLASS: CLASS,
8134
8463
  CIRCULAR_FALLBACK: CIRCULAR_FALLBACK,
8135
8464
  ORDER: ORDER,
8465
+ MOVE_DIRECTION: MOVE_DIRECTION,
8136
8466
  withFlickingMethods: withFlickingMethods,
8137
8467
  sync: sync,
8138
8468
  getRenderingPanels: getRenderingPanels,
@@ -8165,7 +8495,9 @@ var modules = {
8165
8495
  circulateIndex: circulateIndex,
8166
8496
  range: range,
8167
8497
  getElementSize: getElementSize,
8168
- setPrototypeOf: setPrototypeOf
8498
+ setPrototypeOf: setPrototypeOf,
8499
+ camelize: camelize,
8500
+ getDataAttributes: getDataAttributes
8169
8501
  };
8170
8502
 
8171
8503
  /*
@@ -8187,6 +8519,7 @@ exports.CLASS = CLASS;
8187
8519
  exports.Camera = Camera;
8188
8520
  exports.CircularCameraMode = CircularCameraMode;
8189
8521
  exports.Control = Control;
8522
+ exports.CrossFlicking = CrossFlicking;
8190
8523
  exports.DIRECTION = DIRECTION;
8191
8524
  exports.DisabledState = DisabledState;
8192
8525
  exports.DraggingState = DraggingState;
@@ -8198,6 +8531,7 @@ exports.FreeControl = FreeControl;
8198
8531
  exports.HoldingState = HoldingState;
8199
8532
  exports.IdleState = IdleState;
8200
8533
  exports.LinearCameraMode = LinearCameraMode;
8534
+ exports.MOVE_DIRECTION = MOVE_DIRECTION;
8201
8535
  exports.MOVE_TYPE = MOVE_TYPE;
8202
8536
  exports.NormalRenderingStrategy = NormalRenderingStrategy;
8203
8537
  exports.ORDER = ORDER;
@@ -8214,6 +8548,7 @@ exports.VirtualElementProvider = VirtualElementProvider;
8214
8548
  exports.VirtualManager = VirtualManager;
8215
8549
  exports.VirtualPanel = VirtualPanel;
8216
8550
  exports.VirtualRenderingStrategy = VirtualRenderingStrategy;
8551
+ exports.camelize = camelize;
8217
8552
  exports.checkExistence = checkExistence;
8218
8553
  exports.circulateIndex = circulateIndex;
8219
8554
  exports.circulatePosition = circulatePosition;
@@ -8222,6 +8557,7 @@ exports["default"] = Flicking;
8222
8557
  exports.find = find;
8223
8558
  exports.findIndex = findIndex;
8224
8559
  exports.findRight = findRight;
8560
+ exports.getDataAttributes = getDataAttributes;
8225
8561
  exports.getDefaultCameraTransform = getDefaultCameraTransform;
8226
8562
  exports.getDirection = getDirection;
8227
8563
  exports.getElement = getElement;