@egjs/flicking 4.12.0-beta.10 → 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.
@@ -0,0 +1,44 @@
1
+ .flicking-viewport {
2
+ position: relative;
3
+ overflow: hidden;
4
+ }
5
+
6
+ .flicking-viewport.vertical {
7
+ display: -webkit-inline-box;
8
+ display: -ms-inline-flexbox;
9
+ display: inline-flex;
10
+ }
11
+
12
+ .flicking-viewport.vertical > .flicking-camera {
13
+ display: -webkit-inline-box;
14
+ display: -ms-inline-flexbox;
15
+ display: inline-flex;
16
+ -webkit-box-orient: vertical;
17
+ -webkit-box-direction: normal;
18
+ -ms-flex-direction: column;
19
+ flex-direction: column;
20
+ }
21
+
22
+ .flicking-viewport.flicking-hidden > .flicking-camera > * {
23
+ visibility: hidden;
24
+ }
25
+
26
+ .flicking-camera {
27
+ width: 100%;
28
+ height: 100%;
29
+ display: -webkit-box;
30
+ display: -ms-flexbox;
31
+ display: flex;
32
+ position: relative;
33
+ -webkit-box-orient: horizontal;
34
+ -webkit-box-direction: normal;
35
+ -ms-flex-direction: row;
36
+ flex-direction: row;
37
+ z-index: 1;
38
+ will-change: transform;
39
+ }
40
+
41
+ .flicking-camera > * {
42
+ -ms-flex-negative: 0;
43
+ flex-shrink: 0;
44
+ }
@@ -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.10
7
+ version: 4.12.0-beta.12
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -677,6 +677,9 @@ var getStyle = function (el) {
677
677
  var setSize = function (el, _a) {
678
678
  var width = _a.width,
679
679
  height = _a.height;
680
+ if (!el) {
681
+ return;
682
+ }
680
683
  if (width != null) {
681
684
  if (isString(width)) {
682
685
  el.style.width = width;
@@ -1590,6 +1593,9 @@ var HoldingState = /*#__PURE__*/function (_super) {
1590
1593
  axesEvent = ctx.axesEvent,
1591
1594
  transitTo = ctx.transitTo;
1592
1595
  var inputEvent = axesEvent.inputEvent;
1596
+ if (!inputEvent) {
1597
+ return;
1598
+ }
1593
1599
  var offset = flicking.horizontal ? inputEvent.offsetX : inputEvent.offsetY;
1594
1600
  var moveStartEvent = new ComponentEvent(EVENTS.MOVE_START, {
1595
1601
  isTrusted: axesEvent.isTrusted,
@@ -5449,6 +5455,9 @@ var Panel = /*#__PURE__*/function () {
5449
5455
  var flicking = this._flicking;
5450
5456
  var horizontal = flicking.horizontal,
5451
5457
  useFractionalSize = flicking.useFractionalSize;
5458
+ if (!el) {
5459
+ return this;
5460
+ }
5452
5461
  if (cached) {
5453
5462
  this._size = cached.size;
5454
5463
  this._margin = __assign({}, cached.margin);
@@ -7910,7 +7919,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7910
7919
  * Flicking.VERSION; // ex) 4.0.0
7911
7920
  * ```
7912
7921
  */
7913
- Flicking.VERSION = "4.12.0-beta.10";
7922
+ Flicking.VERSION = "4.12.0-beta.12";
7914
7923
  return Flicking;
7915
7924
  }(Component);
7916
7925
 
@@ -7921,7 +7930,9 @@ var SIDE_EVENTS = {
7921
7930
  MOVE: "sideMove",
7922
7931
  MOVE_END: "sideMoveEnd",
7923
7932
  WILL_CHANGE: "sideWillChange",
7924
- CHANGED: "sideChanged"
7933
+ CHANGED: "sideChanged",
7934
+ WILL_RESTORE: "sideWillRestore",
7935
+ RESTORED: "sideRestored"
7925
7936
  };
7926
7937
  var CrossFlicking = /*#__PURE__*/function (_super) {
7927
7938
  __extends(CrossFlicking, _super);
@@ -7979,6 +7990,9 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
7979
7990
  }
7980
7991
  });
7981
7992
  };
7993
+ _this._addSideIndex = function (e) {
7994
+ e.sideIndex = _this._sideFlicking[e.index].index;
7995
+ };
7982
7996
  _this._onHorizontalHoldStart = function () {
7983
7997
  _this._setDraggable(MOVE_DIRECTION.HORIZONTAL, true);
7984
7998
  _this._moveDirection = null;
@@ -8055,6 +8069,15 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
8055
8069
  enumerable: false,
8056
8070
  configurable: true
8057
8071
  });
8072
+ Object.defineProperty(__proto, "sideIndex", {
8073
+ get: function () {
8074
+ return this._sideFlicking.map(function (i) {
8075
+ return i.index;
8076
+ });
8077
+ },
8078
+ enumerable: false,
8079
+ configurable: true
8080
+ });
8058
8081
  Object.defineProperty(__proto, "sideState", {
8059
8082
  get: function () {
8060
8083
  return this._sideState;
@@ -8123,6 +8146,9 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
8123
8146
  this.on(EVENTS.HOLD_START, this._onHorizontalHoldStart);
8124
8147
  this.on(EVENTS.MOVE, this._onHorizontalMove);
8125
8148
  this.on(EVENTS.MOVE_END, this._onHorizontalMoveEnd);
8149
+ [EVENTS.CHANGED, EVENTS.WILL_CHANGE].forEach(function (event) {
8150
+ _this.on(event, _this._addSideIndex);
8151
+ });
8126
8152
  this._sideFlicking.forEach(function (flicking, mainIndex) {
8127
8153
  flicking.on(EVENTS.HOLD_START, _this._onSideHoldStart);
8128
8154
  flicking.on(EVENTS.MOVE, _this._onSideMove);