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

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