@egjs/react-flicking 4.11.3-beta.3 → 4.11.3-beta.5

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.
@@ -4,7 +4,7 @@ name: @egjs/react-flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking/tree/master/packages/react-flicking
7
- version: 4.10.3-beta.0
7
+ version: 4.11.3-beta.5
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('@egjs/component'), require('@egjs/list-differ'), require('@egjs/flicking'), require('react-dom')) :
@@ -12,7 +12,7 @@ version: 4.10.3-beta.0
12
12
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ReactFlicking = factory(global.React, global.Component, global.eg.ListDiffer, global.Flicking, global.ReactDOM));
13
13
  })(this, (function (React, Component, ListDiffer, VanillaFlicking, reactDom) { 'use strict';
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,8 +26,8 @@ version: 4.10.3-beta.0
26
26
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
27
  PERFORMANCE OF THIS SOFTWARE.
28
28
  ***************************************************************************** */
29
-
30
29
  /* global Reflect, Promise */
30
+
31
31
  var extendStatics = function (d, b) {
32
32
  extendStatics = Object.setPrototypeOf || {
33
33
  __proto__: []
@@ -36,38 +36,29 @@ version: 4.10.3-beta.0
36
36
  } || function (d, b) {
37
37
  for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
38
38
  };
39
-
40
39
  return extendStatics(d, b);
41
40
  };
42
-
43
41
  function __extends(d, b) {
44
42
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
45
43
  extendStatics(d, b);
46
-
47
44
  function __() {
48
45
  this.constructor = d;
49
46
  }
50
-
51
47
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
52
48
  }
53
49
  var __assign = function () {
54
50
  __assign = Object.assign || function __assign(t) {
55
51
  for (var s, i = 1, n = arguments.length; i < n; i++) {
56
52
  s = arguments[i];
57
-
58
53
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
59
54
  }
60
-
61
55
  return t;
62
56
  };
63
-
64
57
  return __assign.apply(this, arguments);
65
58
  };
66
59
  function __rest(s, e) {
67
60
  var t = {};
68
-
69
61
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
70
-
71
62
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
72
63
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
73
64
  }
@@ -75,8 +66,8 @@ version: 4.10.3-beta.0
75
66
  }
76
67
  function __decorate(decorators, target, key, desc) {
77
68
  var c = arguments.length,
78
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
79
- d;
69
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
70
+ d;
80
71
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
81
72
  return c > 3 && r && Object.defineProperty(target, key, r), r;
82
73
  }
@@ -86,7 +77,6 @@ version: 4.10.3-beta.0
86
77
  resolve(value);
87
78
  });
88
79
  }
89
-
90
80
  return new (P || (P = Promise))(function (resolve, reject) {
91
81
  function fulfilled(value) {
92
82
  try {
@@ -95,7 +85,6 @@ version: 4.10.3-beta.0
95
85
  reject(e);
96
86
  }
97
87
  }
98
-
99
88
  function rejected(value) {
100
89
  try {
101
90
  step(generator["throw"](value));
@@ -103,28 +92,26 @@ version: 4.10.3-beta.0
103
92
  reject(e);
104
93
  }
105
94
  }
106
-
107
95
  function step(result) {
108
96
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
109
97
  }
110
-
111
98
  step((generator = generator.apply(thisArg, _arguments || [])).next());
112
99
  });
113
100
  }
114
101
  function __generator(thisArg, body) {
115
102
  var _ = {
116
- label: 0,
117
- sent: function () {
118
- if (t[0] & 1) throw t[1];
119
- return t[1];
103
+ label: 0,
104
+ sent: function () {
105
+ if (t[0] & 1) throw t[1];
106
+ return t[1];
107
+ },
108
+ trys: [],
109
+ ops: []
120
110
  },
121
- trys: [],
122
- ops: []
123
- },
124
- f,
125
- y,
126
- t,
127
- g;
111
+ f,
112
+ y,
113
+ t,
114
+ g;
128
115
  return g = {
129
116
  next: verb(0),
130
117
  "throw": verb(1),
@@ -132,78 +119,59 @@ version: 4.10.3-beta.0
132
119
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
133
120
  return this;
134
121
  }), g;
135
-
136
122
  function verb(n) {
137
123
  return function (v) {
138
124
  return step([n, v]);
139
125
  };
140
126
  }
141
-
142
127
  function step(op) {
143
128
  if (f) throw new TypeError("Generator is already executing.");
144
-
145
- while (_) try {
129
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
146
130
  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;
147
131
  if (y = 0, t) op = [op[0] & 2, t.value];
148
-
149
132
  switch (op[0]) {
150
133
  case 0:
151
134
  case 1:
152
135
  t = op;
153
136
  break;
154
-
155
137
  case 4:
156
138
  _.label++;
157
139
  return {
158
140
  value: op[1],
159
141
  done: false
160
142
  };
161
-
162
143
  case 5:
163
144
  _.label++;
164
145
  y = op[1];
165
146
  op = [0];
166
147
  continue;
167
-
168
148
  case 7:
169
149
  op = _.ops.pop();
170
-
171
150
  _.trys.pop();
172
-
173
151
  continue;
174
-
175
152
  default:
176
153
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
177
154
  _ = 0;
178
155
  continue;
179
156
  }
180
-
181
157
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
182
158
  _.label = op[1];
183
159
  break;
184
160
  }
185
-
186
161
  if (op[0] === 6 && _.label < t[1]) {
187
162
  _.label = t[1];
188
163
  t = op;
189
164
  break;
190
165
  }
191
-
192
166
  if (t && _.label < t[2]) {
193
167
  _.label = t[2];
194
-
195
168
  _.ops.push(op);
196
-
197
169
  break;
198
170
  }
199
-
200
171
  if (t[2]) _.ops.pop();
201
-
202
172
  _.trys.pop();
203
-
204
173
  continue;
205
174
  }
206
-
207
175
  op = body.call(thisArg, _);
208
176
  } catch (e) {
209
177
  op = [6, e];
@@ -211,7 +179,6 @@ version: 4.10.3-beta.0
211
179
  } finally {
212
180
  f = t = 0;
213
181
  }
214
-
215
182
  if (op[0] & 5) throw op[1];
216
183
  return {
217
184
  value: op[0] ? op[1] : void 0,
@@ -256,27 +223,19 @@ version: 4.10.3-beta.0
256
223
  onPanelChange: function (e) {}
257
224
  };
258
225
 
259
- var ReactRenderer =
260
- /*#__PURE__*/
261
- function (_super) {
226
+ var ReactRenderer = /*#__PURE__*/function (_super) {
262
227
  __extends(ReactRenderer, _super);
263
-
264
228
  function ReactRenderer(options) {
265
229
  var _this = _super.call(this, options) || this;
266
-
267
230
  _this._reactFlicking = options.reactFlicking;
268
231
  return _this;
269
- } // eslint-disable-next-line @typescript-eslint/require-await
270
-
271
-
232
+ }
233
+ // eslint-disable-next-line @typescript-eslint/require-await
272
234
  var __proto = ReactRenderer.prototype;
273
-
274
235
  __proto.render = function () {
275
236
  return __awaiter(this, void 0, void 0, function () {
276
237
  var flicking, reactFlicking, strategy;
277
-
278
238
  var _this = this;
279
-
280
239
  return __generator(this, function (_a) {
281
240
  flicking = VanillaFlicking.getFlickingAttached(this._flicking);
282
241
  reactFlicking = this._reactFlicking;
@@ -284,11 +243,10 @@ version: 4.10.3-beta.0
284
243
  this._rendering = true;
285
244
  strategy.updateRenderingPanels(flicking);
286
245
  strategy.renderPanels(flicking);
287
- return [2
288
- /*return*/
289
- , new Promise(function (resolve) {
246
+ return [2 /*return*/, new Promise(function (resolve) {
290
247
  reactFlicking.renderEmitter.once("render", function () {
291
248
  _this._rendering = false;
249
+ _this._afterRender();
292
250
  resolve();
293
251
  });
294
252
  reactFlicking.forceUpdate();
@@ -296,28 +254,19 @@ version: 4.10.3-beta.0
296
254
  });
297
255
  });
298
256
  };
299
-
300
257
  __proto.forceRenderAllPanels = function () {
301
258
  return __awaiter(this, void 0, void 0, function () {
302
259
  var reactFlicking;
303
-
304
260
  var _this = this;
305
-
306
261
  return __generator(this, function (_a) {
307
262
  switch (_a.label) {
308
263
  case 0:
309
264
  reactFlicking = this._reactFlicking;
310
265
  this._rendering = true;
311
- return [4
312
- /*yield*/
313
- , _super.prototype.forceRenderAllPanels.call(this)];
314
-
266
+ return [4 /*yield*/, _super.prototype.forceRenderAllPanels.call(this)];
315
267
  case 1:
316
268
  _a.sent();
317
-
318
- return [2
319
- /*return*/
320
- , new Promise(function (resolve) {
269
+ return [2 /*return*/, new Promise(function (resolve) {
321
270
  reactFlicking.renderEmitter.once("render", function () {
322
271
  _this._rendering = false;
323
272
  resolve();
@@ -328,34 +277,30 @@ version: 4.10.3-beta.0
328
277
  });
329
278
  });
330
279
  };
331
-
280
+ __proto.destroy = function () {
281
+ _super.prototype.destroy.call(this);
282
+ this._reactFlicking.renderEmitter.off("render");
283
+ };
332
284
  __proto._collectPanels = function () {
333
285
  var flicking = VanillaFlicking.getFlickingAttached(this._flicking);
334
286
  var reactFlicking = this._reactFlicking;
335
287
  var reactPanels = reactFlicking.reactPanels;
336
288
  this._panels = this._strategy.collectPanels(flicking, reactPanels);
337
289
  };
338
-
339
290
  __proto._createPanel = function (externalComponent, options) {
340
291
  return this._strategy.createPanel(externalComponent, options);
341
292
  };
342
-
343
293
  return ReactRenderer;
344
294
  }(VanillaFlicking.ExternalRenderer);
345
295
 
346
- var StrictPanel =
347
- /*#__PURE__*/
348
- function (_super) {
296
+ var StrictPanel = /*#__PURE__*/function (_super) {
349
297
  __extends(StrictPanel, _super);
350
-
351
298
  function StrictPanel() {
352
299
  var _this = _super !== null && _super.apply(this, arguments) || this;
353
-
354
300
  _this._hide = false;
355
301
  _this._elRef = React.createRef();
356
302
  return _this;
357
303
  }
358
-
359
304
  var __proto = StrictPanel.prototype;
360
305
  Object.defineProperty(__proto, "nativeElement", {
361
306
  get: function () {
@@ -371,40 +316,30 @@ version: 4.10.3-beta.0
371
316
  enumerable: false,
372
317
  configurable: true
373
318
  });
374
-
375
319
  __proto.render = function () {
376
320
  return this._hide ? React.createElement(React.Fragment, null) : this._getElement();
377
321
  };
378
-
379
322
  __proto.show = function () {
380
323
  this._hide = false;
381
324
  };
382
-
383
325
  __proto.hide = function () {
384
326
  this._hide = true;
385
327
  };
386
-
387
328
  __proto._getElement = function () {
388
329
  return React.cloneElement(React.Children.only(this.props.children), {
389
330
  ref: this._elRef
390
331
  });
391
332
  };
392
-
393
333
  return StrictPanel;
394
334
  }(React.Component);
395
335
 
396
- var NonStrictPanel =
397
- /*#__PURE__*/
398
- function (_super) {
336
+ var NonStrictPanel = /*#__PURE__*/function (_super) {
399
337
  __extends(NonStrictPanel, _super);
400
-
401
338
  function NonStrictPanel() {
402
339
  var _this = _super !== null && _super.apply(this, arguments) || this;
403
-
404
340
  _this._hide = false;
405
341
  return _this;
406
342
  }
407
-
408
343
  var __proto = NonStrictPanel.prototype;
409
344
  Object.defineProperty(__proto, "nativeElement", {
410
345
  get: function () {
@@ -420,19 +355,15 @@ version: 4.10.3-beta.0
420
355
  enumerable: false,
421
356
  configurable: true
422
357
  });
423
-
424
358
  __proto.render = function () {
425
359
  return this._hide ? React.createElement(React.Fragment, null) : this.props.children;
426
360
  };
427
-
428
361
  __proto.show = function () {
429
362
  this._hide = false;
430
363
  };
431
-
432
364
  __proto.hide = function () {
433
365
  this._hide = true;
434
366
  };
435
-
436
367
  return NonStrictPanel;
437
368
  }(React.Component);
438
369
 
@@ -444,13 +375,10 @@ version: 4.10.3-beta.0
444
375
  return React.createElement(React.Fragment, null, props.children);
445
376
  });
446
377
 
447
- var ReactElementProvider =
448
- /*#__PURE__*/
449
- function () {
378
+ var ReactElementProvider = /*#__PURE__*/function () {
450
379
  function ReactElementProvider(el) {
451
380
  this._el = el;
452
381
  }
453
-
454
382
  var __proto = ReactElementProvider.prototype;
455
383
  Object.defineProperty(__proto, "element", {
456
384
  get: function () {
@@ -466,36 +394,26 @@ version: 4.10.3-beta.0
466
394
  enumerable: false,
467
395
  configurable: true
468
396
  });
469
-
470
397
  __proto.show = function () {
471
398
  this._el.show();
472
399
  };
473
-
474
400
  __proto.hide = function () {
475
401
  this._el.hide();
476
402
  };
477
-
478
403
  return ReactElementProvider;
479
404
  }();
480
405
 
481
- var Flicking =
482
- /*#__PURE__*/
483
- function (_super) {
406
+ var Flicking = /*#__PURE__*/function (_super) {
484
407
  __extends(Flicking, _super);
485
-
486
408
  function Flicking(props) {
487
409
  var _this = _super.call(this, props) || this;
488
-
489
410
  _this._panels = [];
490
411
  _this._renderEmitter = new Component();
491
-
492
412
  var children = _this._getChildren();
493
-
494
413
  _this._panels = _this._createPanelRefs(props, children);
495
414
  _this._prevChildren = children;
496
415
  return _this;
497
416
  }
498
-
499
417
  var __proto = Flicking.prototype;
500
418
  Object.defineProperty(__proto, "reactPanels", {
501
419
  get: function () {
@@ -513,7 +431,6 @@ version: 4.10.3-beta.0
513
431
  enumerable: false,
514
432
  configurable: true
515
433
  });
516
-
517
434
  __proto.componentDidMount = function () {
518
435
  var props = this.props;
519
436
  var rendererOptions = {
@@ -527,123 +444,105 @@ version: 4.10.3-beta.0
527
444
  externalRenderer: new ReactRenderer(rendererOptions)
528
445
  }));
529
446
  this._vanillaFlicking = flicking;
530
-
531
447
  var children = this._getChildren();
532
-
533
448
  this._jsxDiffer = new ListDiffer(children, function (panel) {
534
449
  return panel.key;
535
450
  });
536
451
  this._pluginsDiffer = new ListDiffer();
537
452
  this._prevChildren = children;
538
-
539
453
  this._bindEvents();
540
-
541
454
  this._checkPlugins();
542
-
543
455
  if (props.status) {
544
456
  flicking.setStatus(props.status);
545
457
  }
546
458
  };
547
-
548
459
  __proto.componentWillUnmount = function () {
549
460
  var _a;
550
-
551
461
  (_a = this._vanillaFlicking) === null || _a === void 0 ? void 0 : _a.destroy();
552
462
  };
553
-
554
463
  __proto.shouldComponentUpdate = function (nextProps) {
555
464
  var vanillaFlicking = this._vanillaFlicking;
556
465
  var prevProps = this.props;
557
466
  if (!vanillaFlicking || !vanillaFlicking.initialized) return false;
558
-
559
467
  var children = nextProps.children,
560
- restProps = __rest(nextProps, ["children"]);
561
-
468
+ restProps = __rest(nextProps, ["children"]);
562
469
  for (var key in restProps) {
563
470
  if (prevProps[key] !== nextProps[key]) {
564
471
  return true;
565
472
  }
566
473
  }
567
-
568
474
  var prevChildren = this._prevChildren;
569
-
570
475
  var nextChildren = this._getChildren(children);
571
-
572
476
  if (nextProps.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) return true;
573
477
  return false;
574
478
  };
575
-
576
479
  __proto.beforeRender = function () {
577
480
  var vanillaFlicking = this._vanillaFlicking;
578
481
  var props = this.props;
579
- var prevChildren = this._prevChildren; // Ignore updates before init, they will be updated after "ready" event's force update
482
+ var prevChildren = this._prevChildren;
483
+ // Ignore updates before init, they will be updated after "ready" event's force update
580
484
  // Also, prevent updates when another update is already queued.
581
485
  // This usually happens when render() called twice without calling componentDidMount, like in the case of React.StrictMode.
582
-
583
486
  if (!vanillaFlicking || !vanillaFlicking.initialized || this._diffResult) return;
584
-
585
487
  var nextChildren = this._getChildren(props.children);
586
-
587
488
  if (props.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) {
588
489
  this._panels = this._createPanelRefs(props, nextChildren);
589
490
  this._diffResult = this._jsxDiffer.update(nextChildren);
590
491
  this._prevChildren = nextChildren;
591
492
  }
592
493
  };
593
-
594
494
  __proto.componentDidUpdate = function () {
595
495
  var flicking = this._vanillaFlicking;
596
496
  var renderEmitter = this._renderEmitter;
597
497
  var diffResult = this._diffResult;
598
-
599
498
  this._checkPlugins();
600
-
601
499
  renderEmitter.trigger("render");
602
500
  flicking.camera.updateOffset();
501
+ // Omit 'virtual', as it can't have any setter
502
+ var _a = this.props;
503
+ _a.virtual;
504
+ var props = __rest(_a, ["virtual"]);
505
+ for (var key in props) {
506
+ if (key in flicking && flicking[key] !== props[key]) {
507
+ try {
508
+ flicking[key] = props[key];
509
+ } catch (e) {}
510
+ }
511
+ }
603
512
  if (!diffResult || !flicking.initialized) return;
604
513
  VanillaFlicking.sync(flicking, diffResult, this.reactPanels);
605
514
  this._diffResult = null;
606
515
  };
607
-
608
516
  __proto.render = function () {
609
517
  var _this = this;
610
-
611
518
  var _a, _b;
612
-
613
519
  var props = this.props;
614
520
  var Viewport = props.viewportTag;
615
521
  var Camera = props.cameraTag;
616
522
  var attributes = {};
617
523
  var flicking = this._vanillaFlicking;
618
524
  this.beforeRender();
619
-
620
525
  for (var name in props) {
621
526
  if (!(name in DEFAULT_PROPS) && !(name in VanillaFlicking.prototype)) {
622
527
  attributes[name] = props[name];
623
528
  }
624
529
  }
625
-
626
530
  var initialized = flicking && flicking.initialized;
627
531
  var viewportClasses = ["flicking-viewport"];
628
532
  var cameraClasses = ["flicking-camera"];
629
533
  var isHorizontal = flicking ? flicking.horizontal : (_a = props.horizontal) !== null && _a !== void 0 ? _a : true;
630
-
631
534
  if (!isHorizontal) {
632
535
  viewportClasses.push("vertical");
633
536
  }
634
-
635
537
  if (props.hideBeforeInit && !initialized) {
636
538
  viewportClasses.push("flicking-hidden");
637
539
  }
638
-
639
540
  if (attributes.className) {
640
541
  viewportClasses.push(attributes.className);
641
542
  }
642
-
643
543
  if (props.cameraClass) {
644
544
  cameraClasses.push(props.cameraClass);
645
545
  }
646
-
647
546
  var cameraProps = !initialized && props.firstPanelSize ? {
648
547
  style: {
649
548
  transform: VanillaFlicking.getDefaultCameraTransform(this.props.align, this.props.horizontal, this.props.firstPanelSize)
@@ -659,10 +558,8 @@ version: 4.10.3-beta.0
659
558
  className: cameraClasses.join(" ")
660
559
  }, cameraProps), panels), this._getViewportSlot());
661
560
  };
662
-
663
561
  __proto._createPanelRefs = function (props, children) {
664
562
  var _a;
665
-
666
563
  var panelsPerView = (_a = props.panelsPerView) !== null && _a !== void 0 ? _a : -1;
667
564
  return panelsPerView > 0 && !!props.virtual ? VanillaFlicking.range(panelsPerView + 1).map(function () {
668
565
  return React.createRef();
@@ -670,10 +567,8 @@ version: 4.10.3-beta.0
670
567
  return React.createRef();
671
568
  });
672
569
  };
673
-
674
570
  __proto._bindEvents = function () {
675
571
  var _this = this;
676
-
677
572
  var flicking = this._vanillaFlicking;
678
573
  Object.keys(VanillaFlicking.EVENTS).forEach(function (eventKey) {
679
574
  var eventName = VanillaFlicking.EVENTS[eventKey];
@@ -688,16 +583,13 @@ version: 4.10.3-beta.0
688
583
  _this.forceUpdate();
689
584
  });
690
585
  };
691
-
692
586
  __proto._checkPlugins = function () {
693
587
  var flicking = this._vanillaFlicking;
694
-
695
588
  var _a = this._pluginsDiffer.update(this.props.plugins),
696
- list = _a.list,
697
- added = _a.added,
698
- removed = _a.removed,
699
- prevList = _a.prevList;
700
-
589
+ list = _a.list,
590
+ added = _a.added,
591
+ removed = _a.removed,
592
+ prevList = _a.prevList;
701
593
  flicking.addPlugins.apply(flicking, added.map(function (index) {
702
594
  return list[index];
703
595
  }));
@@ -705,12 +597,10 @@ version: 4.10.3-beta.0
705
597
  return prevList[index];
706
598
  }));
707
599
  };
708
-
709
600
  __proto._hasSameChildren = function (prevChildren, nextChildren) {
710
601
  if (prevChildren.length !== nextChildren.length || prevChildren.length === 0) return false;
711
602
  var same = prevChildren.every(function (child, idx) {
712
603
  var nextChild = nextChildren[idx];
713
-
714
604
  if (child.key && nextChild.key) {
715
605
  return child.key === nextChild.key;
716
606
  } else {
@@ -719,40 +609,32 @@ version: 4.10.3-beta.0
719
609
  });
720
610
  return same;
721
611
  };
722
-
723
612
  __proto._getChildren = function (children) {
724
613
  var _this = this;
725
-
726
614
  if (children === void 0) {
727
615
  children = this.props.children;
728
616
  }
729
-
730
617
  return React.Children.toArray(children).filter(function (child) {
731
618
  return child.type !== ViewportSlot;
732
619
  }).reduce(function (all, child) {
733
620
  return __spreadArray(__spreadArray([], all, true), _this._unpackFragment(child), true);
734
621
  }, []);
735
622
  };
736
-
737
623
  __proto._getViewportSlot = function () {
738
624
  return React.Children.toArray(this.props.children).filter(function (child) {
739
625
  return child.type === ViewportSlot;
740
626
  });
741
627
  };
742
-
743
628
  __proto._unpackFragment = function (child) {
744
629
  var _this = this;
745
-
746
630
  return this._isFragment(child) ? React.Children.toArray(child.props.children).reduce(function (allChilds, fragChild) {
747
631
  return __spreadArray(__spreadArray([], allChilds, true), _this._unpackFragment(fragChild), true);
748
632
  }, []) : [child];
749
633
  };
750
-
751
634
  __proto._getVirtualPanels = function () {
752
635
  var _this = this;
753
-
754
636
  var _a = this.props.virtual.panelClass,
755
- panelClass = _a === void 0 ? "flicking-panel" : _a;
637
+ panelClass = _a === void 0 ? "flicking-panel" : _a;
756
638
  var panelsPerView = this.props.panelsPerView;
757
639
  var flicking = this._vanillaFlicking;
758
640
  var initialized = flicking && flicking.initialized;
@@ -773,12 +655,9 @@ version: 4.10.3-beta.0
773
655
  });
774
656
  });
775
657
  };
776
-
777
658
  __proto._getPanels = function () {
778
659
  var _this = this;
779
-
780
660
  var origChildren = this._getChildren();
781
-
782
661
  var vanillaFlicking = this._vanillaFlicking;
783
662
  var diffResult = this._diffResult;
784
663
  var children = vanillaFlicking && vanillaFlicking.initialized ? diffResult ? VanillaFlicking.getRenderingPanels(vanillaFlicking, diffResult) : VanillaFlicking.getRenderingPanels(vanillaFlicking, ListDiffer.diff(origChildren, origChildren)) : origChildren;
@@ -794,19 +673,14 @@ version: 4.10.3-beta.0
794
673
  }, child);
795
674
  });
796
675
  };
797
-
798
676
  __proto._isFragment = function (child) {
799
677
  if (child.type) {
800
678
  return child.type === React.Fragment;
801
679
  }
802
-
803
680
  return child === React.Fragment;
804
681
  };
805
-
806
682
  Flicking.defaultProps = DEFAULT_PROPS;
807
-
808
683
  __decorate([VanillaFlicking.withFlickingMethods], Flicking.prototype, "_vanillaFlicking", void 0);
809
-
810
684
  return Flicking;
811
685
  }(React.Component);
812
686