@egjs/flicking 4.12.0-beta.11 → 4.12.0-beta.12

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.
@@ -37,6 +37,12 @@ export interface SideState {
37
37
  end: number;
38
38
  element: HTMLElement;
39
39
  }
40
+ export interface CrossFlickingChangedEvent extends ChangedEvent {
41
+ sideIndex?: number;
42
+ }
43
+ export interface CrossFlickingWillChangeEvent extends WillChangeEvent {
44
+ sideIndex?: number;
45
+ }
40
46
  export declare class CrossFlicking extends Flicking {
41
47
  private _sideFlicking;
42
48
  private _sideOptions;
@@ -48,6 +54,7 @@ export declare class CrossFlicking extends Flicking {
48
54
  private _originalDragThreshold;
49
55
  private _nextIndex;
50
56
  get sideFlicking(): Flicking[];
57
+ get sideIndex(): number[];
51
58
  get sideState(): SideState[];
52
59
  get sideOptions(): CrossFlickingOptions["sideOptions"];
53
60
  get preserveIndex(): CrossFlickingOptions["preserveIndex"];
@@ -71,6 +78,7 @@ export declare class CrossFlicking extends Flicking {
71
78
  private _syncToCategory;
72
79
  private _setDraggable;
73
80
  private _setPreviousSideIndex;
81
+ private _addSideIndex;
74
82
  private _onHorizontalHoldStart;
75
83
  private _onHorizontalMove;
76
84
  private _onHorizontalMoveEnd;
@@ -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.11
7
+ version: 4.12.0-beta.12
8
8
  */
9
9
  'use strict';
10
10
 
@@ -679,6 +679,9 @@ var getStyle = function (el) {
679
679
  var setSize = function (el, _a) {
680
680
  var width = _a.width,
681
681
  height = _a.height;
682
+ if (!el) {
683
+ return;
684
+ }
682
685
  if (width != null) {
683
686
  if (isString(width)) {
684
687
  el.style.width = width;
@@ -7918,7 +7921,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7918
7921
  * Flicking.VERSION; // ex) 4.0.0
7919
7922
  * ```
7920
7923
  */
7921
- Flicking.VERSION = "4.12.0-beta.11";
7924
+ Flicking.VERSION = "4.12.0-beta.12";
7922
7925
  return Flicking;
7923
7926
  }(Component);
7924
7927
 
@@ -7989,6 +7992,9 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
7989
7992
  }
7990
7993
  });
7991
7994
  };
7995
+ _this._addSideIndex = function (e) {
7996
+ e.sideIndex = _this._sideFlicking[e.index].index;
7997
+ };
7992
7998
  _this._onHorizontalHoldStart = function () {
7993
7999
  _this._setDraggable(MOVE_DIRECTION.HORIZONTAL, true);
7994
8000
  _this._moveDirection = null;
@@ -8065,6 +8071,15 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
8065
8071
  enumerable: false,
8066
8072
  configurable: true
8067
8073
  });
8074
+ Object.defineProperty(__proto, "sideIndex", {
8075
+ get: function () {
8076
+ return this._sideFlicking.map(function (i) {
8077
+ return i.index;
8078
+ });
8079
+ },
8080
+ enumerable: false,
8081
+ configurable: true
8082
+ });
8068
8083
  Object.defineProperty(__proto, "sideState", {
8069
8084
  get: function () {
8070
8085
  return this._sideState;
@@ -8133,6 +8148,9 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
8133
8148
  this.on(EVENTS.HOLD_START, this._onHorizontalHoldStart);
8134
8149
  this.on(EVENTS.MOVE, this._onHorizontalMove);
8135
8150
  this.on(EVENTS.MOVE_END, this._onHorizontalMoveEnd);
8151
+ [EVENTS.CHANGED, EVENTS.WILL_CHANGE].forEach(function (event) {
8152
+ _this.on(event, _this._addSideIndex);
8153
+ });
8136
8154
  this._sideFlicking.forEach(function (flicking, mainIndex) {
8137
8155
  flicking.on(EVENTS.HOLD_START, _this._onSideHoldStart);
8138
8156
  flicking.on(EVENTS.MOVE, _this._onSideMove);