@egjs/flicking 4.6.3 → 4.7.2

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 CHANGED
@@ -7,7 +7,7 @@
7
7
  <a href="https://www.npmjs.com/package/@egjs/flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/flicking.svg?style=flat-square&color=007acc&label=version&logo=NPM" alt="version" /></a>
8
8
  <a href="https://www.npmjs.com/package/@egjs/flicking" target="_blank"><img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@egjs/flicking.svg?style=flat-square&label=%F0%9F%92%BE%20gzipped&color=007acc" /></a>
9
9
  <a href="https://coveralls.io/github/naver/egjs-flicking?branch=master&style=flat-square" target="_blank"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/naver/egjs-flicking.svg?style=flat-square&label=%E2%9C%85%20coverage" /></a>
10
- <a href="https://deepscan.io/dashboard#view=project&tid=3998&pid=5802&bid=46086"><img src="https://deepscan.io/api/teams/3998/projects/5802/branches/46086/badge/grade.svg" alt="DeepScan grade" /></a>
10
+ <a href="https://deepscan.io/dashboard#view=project&tid=3998&pid=5802&bid=46086"><img src="https://flat.badgen.net/deepscan/grade/team/3998/project/5802/branch/46086" alt="DeepScan grade" /></a>
11
11
  </p>
12
12
  <p align="center" style="line-height: 2;">
13
13
  <a href="https://github.com/naver/egjs-flicking/graphs/commit-activity">
@@ -42,6 +42,7 @@ export interface FlickingOptions {
42
42
  panelsPerView: number;
43
43
  noPanelStyleOverride: boolean;
44
44
  resizeOnContentsReady: boolean;
45
+ nested: boolean;
45
46
  needPanelThreshold: number;
46
47
  preventEventsBeforeInit: boolean;
47
48
  deceleration: number;
@@ -87,6 +88,7 @@ declare class Flicking extends Component<FlickingEvents> {
87
88
  private _noPanelStyleOverride;
88
89
  private _resizeOnContentsReady;
89
90
  private _virtual;
91
+ private _nested;
90
92
  private _needPanelThreshold;
91
93
  private _preventEventsBeforeInit;
92
94
  private _deceleration;
@@ -139,6 +141,7 @@ declare class Flicking extends Component<FlickingEvents> {
139
141
  get panelsPerView(): FlickingOptions["panelsPerView"];
140
142
  get noPanelStyleOverride(): FlickingOptions["noPanelStyleOverride"];
141
143
  get resizeOnContentsReady(): FlickingOptions["resizeOnContentsReady"];
144
+ get nested(): FlickingOptions["nested"];
142
145
  get needPanelThreshold(): FlickingOptions["needPanelThreshold"];
143
146
  get preventEventsBeforeInit(): FlickingOptions["preventEventsBeforeInit"];
144
147
  get deceleration(): FlickingOptions["deceleration"];
@@ -173,6 +176,7 @@ declare class Flicking extends Component<FlickingEvents> {
173
176
  set panelsPerView(val: FlickingOptions["panelsPerView"]);
174
177
  set noPanelStyleOverride(val: FlickingOptions["noPanelStyleOverride"]);
175
178
  set resizeOnContentsReady(val: FlickingOptions["resizeOnContentsReady"]);
179
+ set nested(val: FlickingOptions["nested"]);
176
180
  set needPanelThreshold(val: FlickingOptions["needPanelThreshold"]);
177
181
  set preventEventsBeforeInit(val: FlickingOptions["preventEventsBeforeInit"]);
178
182
  set deceleration(val: FlickingOptions["deceleration"]);
@@ -189,7 +193,7 @@ declare class Flicking extends Component<FlickingEvents> {
189
193
  set renderOnlyVisible(val: FlickingOptions["renderOnlyVisible"]);
190
194
  set autoResize(val: FlickingOptions["autoResize"]);
191
195
  set useResizeObserver(val: FlickingOptions["useResizeObserver"]);
192
- constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, disableOnInit, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, maxResizeDebounce, externalRenderer, renderExternal }?: Partial<FlickingOptions>);
196
+ constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, disableOnInit, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, maxResizeDebounce, externalRenderer, renderExternal }?: Partial<FlickingOptions>);
193
197
  init(): Promise<void>;
194
198
  destroy(): void;
195
199
  prev(duration?: number): Promise<void>;
@@ -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.6.3
7
+ version: 4.7.2
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -2261,7 +2261,7 @@ function () {
2261
2261
  get: function () {
2262
2262
  var _a, _b;
2263
2263
 
2264
- return (_b = (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.isEnable()) !== null && _b !== void 0 ? _b : false;
2264
+ return (_b = (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.isEnabled()) !== null && _b !== void 0 ? _b : false;
2265
2265
  },
2266
2266
  enumerable: false,
2267
2267
  configurable: true
@@ -2332,6 +2332,7 @@ function () {
2332
2332
  }, _a), {
2333
2333
  deceleration: flicking.deceleration,
2334
2334
  interruptable: flicking.interruptable,
2335
+ nested: flicking.nested,
2335
2336
  easing: flicking.easing
2336
2337
  });
2337
2338
  this._panInput = new PanInput(flicking.viewport.element, {
@@ -2428,7 +2429,7 @@ function () {
2428
2429
  axis.circular = [controlParams.circular, controlParams.circular];
2429
2430
  axis.range = [controlParams.range.min, controlParams.range.max];
2430
2431
  axis.bounce = parseBounce(flicking.bounce, camera.size);
2431
- axes.axm.set((_a = {}, _a[POSITION_KEY] = controlParams.position, _a));
2432
+ axes.axisManager.set((_a = {}, _a[POSITION_KEY] = controlParams.position, _a));
2432
2433
  return this;
2433
2434
  };
2434
2435
  /**
@@ -2544,7 +2545,7 @@ function () {
2544
2545
  var camera = flicking.camera;
2545
2546
  animate();
2546
2547
  var newPos = flicking.circularEnabled ? circulatePosition(position, camera.range.min, camera.range.max) : position;
2547
- axes.axm.set((_a = {}, _a[POSITION_KEY] = newPos, _a));
2548
+ axes.axisManager.set((_a = {}, _a[POSITION_KEY] = newPos, _a));
2548
2549
  return Promise.resolve();
2549
2550
  } else {
2550
2551
  return new Promise(function (resolve, reject) {
@@ -5321,7 +5322,7 @@ function () {
5321
5322
  if (!resizeOnContentsReady || flicking.virtualEnabled) return;
5322
5323
 
5323
5324
  var hasContents = function (panel) {
5324
- return !!panel.element.querySelector("img, video");
5325
+ return panel.element && !!panel.element.querySelector("img, video");
5325
5326
  };
5326
5327
 
5327
5328
  checkingPanels = checkingPanels.filter(function (panel) {
@@ -6631,52 +6632,54 @@ function (_super) {
6631
6632
  noPanelStyleOverride = _l === void 0 ? false : _l,
6632
6633
  _m = _b.resizeOnContentsReady,
6633
6634
  resizeOnContentsReady = _m === void 0 ? false : _m,
6634
- _o = _b.needPanelThreshold,
6635
- needPanelThreshold = _o === void 0 ? 0 : _o,
6636
- _p = _b.preventEventsBeforeInit,
6637
- preventEventsBeforeInit = _p === void 0 ? true : _p,
6638
- _q = _b.deceleration,
6639
- deceleration = _q === void 0 ? 0.0075 : _q,
6640
- _r = _b.duration,
6641
- duration = _r === void 0 ? 500 : _r,
6642
- _s = _b.easing,
6643
- easing = _s === void 0 ? function (x) {
6635
+ _o = _b.nested,
6636
+ nested = _o === void 0 ? false : _o,
6637
+ _p = _b.needPanelThreshold,
6638
+ needPanelThreshold = _p === void 0 ? 0 : _p,
6639
+ _q = _b.preventEventsBeforeInit,
6640
+ preventEventsBeforeInit = _q === void 0 ? true : _q,
6641
+ _r = _b.deceleration,
6642
+ deceleration = _r === void 0 ? 0.0075 : _r,
6643
+ _s = _b.duration,
6644
+ duration = _s === void 0 ? 500 : _s,
6645
+ _t = _b.easing,
6646
+ easing = _t === void 0 ? function (x) {
6644
6647
  return 1 - Math.pow(1 - x, 3);
6645
- } : _s,
6646
- _t = _b.inputType,
6647
- inputType = _t === void 0 ? ["mouse", "touch"] : _t,
6648
- _u = _b.moveType,
6649
- moveType = _u === void 0 ? "snap" : _u,
6650
- _v = _b.threshold,
6651
- threshold = _v === void 0 ? 40 : _v,
6652
- _w = _b.interruptable,
6653
- interruptable = _w === void 0 ? true : _w,
6654
- _x = _b.bounce,
6655
- bounce = _x === void 0 ? "20%" : _x,
6656
- _y = _b.iOSEdgeSwipeThreshold,
6657
- iOSEdgeSwipeThreshold = _y === void 0 ? 30 : _y,
6658
- _z = _b.preventClickOnDrag,
6659
- preventClickOnDrag = _z === void 0 ? true : _z,
6660
- _0 = _b.disableOnInit,
6661
- disableOnInit = _0 === void 0 ? false : _0,
6662
- _1 = _b.renderOnlyVisible,
6663
- renderOnlyVisible = _1 === void 0 ? false : _1,
6664
- _2 = _b.virtual,
6665
- virtual = _2 === void 0 ? null : _2,
6666
- _3 = _b.autoInit,
6667
- autoInit = _3 === void 0 ? true : _3,
6668
- _4 = _b.autoResize,
6669
- autoResize = _4 === void 0 ? true : _4,
6670
- _5 = _b.useResizeObserver,
6671
- useResizeObserver = _5 === void 0 ? true : _5,
6672
- _6 = _b.resizeDebounce,
6673
- resizeDebounce = _6 === void 0 ? 0 : _6,
6674
- _7 = _b.maxResizeDebounce,
6675
- maxResizeDebounce = _7 === void 0 ? 100 : _7,
6676
- _8 = _b.externalRenderer,
6677
- externalRenderer = _8 === void 0 ? null : _8,
6678
- _9 = _b.renderExternal,
6679
- renderExternal = _9 === void 0 ? null : _9;
6648
+ } : _t,
6649
+ _u = _b.inputType,
6650
+ inputType = _u === void 0 ? ["mouse", "touch"] : _u,
6651
+ _v = _b.moveType,
6652
+ moveType = _v === void 0 ? "snap" : _v,
6653
+ _w = _b.threshold,
6654
+ threshold = _w === void 0 ? 40 : _w,
6655
+ _x = _b.interruptable,
6656
+ interruptable = _x === void 0 ? true : _x,
6657
+ _y = _b.bounce,
6658
+ bounce = _y === void 0 ? "20%" : _y,
6659
+ _z = _b.iOSEdgeSwipeThreshold,
6660
+ iOSEdgeSwipeThreshold = _z === void 0 ? 30 : _z,
6661
+ _0 = _b.preventClickOnDrag,
6662
+ preventClickOnDrag = _0 === void 0 ? true : _0,
6663
+ _1 = _b.disableOnInit,
6664
+ disableOnInit = _1 === void 0 ? false : _1,
6665
+ _2 = _b.renderOnlyVisible,
6666
+ renderOnlyVisible = _2 === void 0 ? false : _2,
6667
+ _3 = _b.virtual,
6668
+ virtual = _3 === void 0 ? null : _3,
6669
+ _4 = _b.autoInit,
6670
+ autoInit = _4 === void 0 ? true : _4,
6671
+ _5 = _b.autoResize,
6672
+ autoResize = _5 === void 0 ? true : _5,
6673
+ _6 = _b.useResizeObserver,
6674
+ useResizeObserver = _6 === void 0 ? true : _6,
6675
+ _7 = _b.resizeDebounce,
6676
+ resizeDebounce = _7 === void 0 ? 0 : _7,
6677
+ _8 = _b.maxResizeDebounce,
6678
+ maxResizeDebounce = _8 === void 0 ? 100 : _8,
6679
+ _9 = _b.externalRenderer,
6680
+ externalRenderer = _9 === void 0 ? null : _9,
6681
+ _10 = _b.renderExternal,
6682
+ renderExternal = _10 === void 0 ? null : _10;
6680
6683
 
6681
6684
  var _this = _super.call(this) || this; // Internal states
6682
6685
 
@@ -6694,6 +6697,7 @@ function (_super) {
6694
6697
  _this._panelsPerView = panelsPerView;
6695
6698
  _this._noPanelStyleOverride = noPanelStyleOverride;
6696
6699
  _this._resizeOnContentsReady = resizeOnContentsReady;
6700
+ _this._nested = nested;
6697
6701
  _this._virtual = virtual;
6698
6702
  _this._needPanelThreshold = needPanelThreshold;
6699
6703
  _this._preventEventsBeforeInit = preventEventsBeforeInit;
@@ -7167,6 +7171,24 @@ function (_super) {
7167
7171
  enumerable: false,
7168
7172
  configurable: true
7169
7173
  });
7174
+ Object.defineProperty(__proto, "nested", {
7175
+ /**
7176
+ * If you enable this option on child Flicking when the Flicking is placed inside the Flicking, the parent Flicking will move in the same direction after the child Flicking reaches the first/last panel.
7177
+ * If the parent Flicking and child Flicking have different horizontal option, you do not need to set this option.
7178
+ * @ko Flicking 내부에 Flicking이 배치될 때 하위 Flicking에서 이 옵션을 활성화하면 하위 Flicking이 첫/마지막 패널에 도달한 뒤부터 같은 방향으로 상위 Flicking이 움직입니다.
7179
+ * 만약 상위 Flicking과 하위 Flicking이 서로 다른 horizontal 옵션을 가지고 있다면 이 옵션을 설정할 필요가 없습니다.
7180
+ * @type {boolean}
7181
+ * @default false
7182
+ */
7183
+ get: function () {
7184
+ return this._nested;
7185
+ },
7186
+ set: function (val) {
7187
+ this._nested = val;
7188
+ },
7189
+ enumerable: false,
7190
+ configurable: true
7191
+ });
7170
7192
  Object.defineProperty(__proto, "needPanelThreshold", {
7171
7193
  // EVENTS
7172
7194
 
@@ -8403,7 +8425,7 @@ function (_super) {
8403
8425
  */
8404
8426
 
8405
8427
 
8406
- Flicking.VERSION = "4.6.3";
8428
+ Flicking.VERSION = "4.7.2";
8407
8429
  return Flicking;
8408
8430
  }(Component);
8409
8431