@egjs/react-flicking 4.11.3-beta.0 → 4.11.3-beta.1

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.0
7
+ version: 4.10.7
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.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.11.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
- /* 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.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
+
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.0
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.0
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.0
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.0
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.0
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.0
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.0
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,14 @@ version: 4.11.3-beta.0
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;
292
+
249
293
  _this._afterRender();
294
+
250
295
  resolve();
251
296
  });
252
297
  reactFlicking.forceUpdate();
@@ -254,19 +299,28 @@ version: 4.11.3-beta.0
254
299
  });
255
300
  });
256
301
  };
302
+
257
303
  __proto.forceRenderAllPanels = function () {
258
304
  return __awaiter(this, void 0, void 0, function () {
259
305
  var reactFlicking;
306
+
260
307
  var _this = this;
308
+
261
309
  return __generator(this, function (_a) {
262
310
  switch (_a.label) {
263
311
  case 0:
264
312
  reactFlicking = this._reactFlicking;
265
313
  this._rendering = true;
266
- return [4 /*yield*/, _super.prototype.forceRenderAllPanels.call(this)];
314
+ return [4
315
+ /*yield*/
316
+ , _super.prototype.forceRenderAllPanels.call(this)];
317
+
267
318
  case 1:
268
319
  _a.sent();
269
- return [2 /*return*/, new Promise(function (resolve) {
320
+
321
+ return [2
322
+ /*return*/
323
+ , new Promise(function (resolve) {
270
324
  reactFlicking.renderEmitter.once("render", function () {
271
325
  _this._rendering = false;
272
326
  resolve();
@@ -277,30 +331,40 @@ version: 4.11.3-beta.0
277
331
  });
278
332
  });
279
333
  };
334
+
280
335
  __proto.destroy = function () {
281
336
  _super.prototype.destroy.call(this);
337
+
282
338
  this._reactFlicking.renderEmitter.off("render");
283
339
  };
340
+
284
341
  __proto._collectPanels = function () {
285
342
  var flicking = VanillaFlicking.getFlickingAttached(this._flicking);
286
343
  var reactFlicking = this._reactFlicking;
287
344
  var reactPanels = reactFlicking.reactPanels;
288
345
  this._panels = this._strategy.collectPanels(flicking, reactPanels);
289
346
  };
347
+
290
348
  __proto._createPanel = function (externalComponent, options) {
291
349
  return this._strategy.createPanel(externalComponent, options);
292
350
  };
351
+
293
352
  return ReactRenderer;
294
353
  }(VanillaFlicking.ExternalRenderer);
295
354
 
296
- var StrictPanel = /*#__PURE__*/function (_super) {
355
+ var StrictPanel =
356
+ /*#__PURE__*/
357
+ function (_super) {
297
358
  __extends(StrictPanel, _super);
359
+
298
360
  function StrictPanel() {
299
361
  var _this = _super !== null && _super.apply(this, arguments) || this;
362
+
300
363
  _this._hide = false;
301
364
  _this._elRef = React.createRef();
302
365
  return _this;
303
366
  }
367
+
304
368
  var __proto = StrictPanel.prototype;
305
369
  Object.defineProperty(__proto, "nativeElement", {
306
370
  get: function () {
@@ -316,30 +380,40 @@ version: 4.11.3-beta.0
316
380
  enumerable: false,
317
381
  configurable: true
318
382
  });
383
+
319
384
  __proto.render = function () {
320
385
  return this._hide ? React.createElement(React.Fragment, null) : this._getElement();
321
386
  };
387
+
322
388
  __proto.show = function () {
323
389
  this._hide = false;
324
390
  };
391
+
325
392
  __proto.hide = function () {
326
393
  this._hide = true;
327
394
  };
395
+
328
396
  __proto._getElement = function () {
329
397
  return React.cloneElement(React.Children.only(this.props.children), {
330
398
  ref: this._elRef
331
399
  });
332
400
  };
401
+
333
402
  return StrictPanel;
334
403
  }(React.Component);
335
404
 
336
- var NonStrictPanel = /*#__PURE__*/function (_super) {
405
+ var NonStrictPanel =
406
+ /*#__PURE__*/
407
+ function (_super) {
337
408
  __extends(NonStrictPanel, _super);
409
+
338
410
  function NonStrictPanel() {
339
411
  var _this = _super !== null && _super.apply(this, arguments) || this;
412
+
340
413
  _this._hide = false;
341
414
  return _this;
342
415
  }
416
+
343
417
  var __proto = NonStrictPanel.prototype;
344
418
  Object.defineProperty(__proto, "nativeElement", {
345
419
  get: function () {
@@ -355,30 +429,37 @@ version: 4.11.3-beta.0
355
429
  enumerable: false,
356
430
  configurable: true
357
431
  });
432
+
358
433
  __proto.render = function () {
359
434
  return this._hide ? React.createElement(React.Fragment, null) : this.props.children;
360
435
  };
436
+
361
437
  __proto.show = function () {
362
438
  this._hide = false;
363
439
  };
440
+
364
441
  __proto.hide = function () {
365
442
  this._hide = true;
366
443
  };
444
+
367
445
  return NonStrictPanel;
368
446
  }(React.Component);
369
447
 
370
- /*
371
- * Copyright (c) 2015 NAVER Corp.
372
- * egjs projects are licensed under the MIT license
448
+ /*
449
+ * Copyright (c) 2015 NAVER Corp.
450
+ * egjs projects are licensed under the MIT license
373
451
  */
374
452
  var ViewportSlot = React.memo(function (props) {
375
453
  return React.createElement(React.Fragment, null, props.children);
376
454
  });
377
455
 
378
- var ReactElementProvider = /*#__PURE__*/function () {
456
+ var ReactElementProvider =
457
+ /*#__PURE__*/
458
+ function () {
379
459
  function ReactElementProvider(el) {
380
460
  this._el = el;
381
461
  }
462
+
382
463
  var __proto = ReactElementProvider.prototype;
383
464
  Object.defineProperty(__proto, "element", {
384
465
  get: function () {
@@ -394,26 +475,36 @@ version: 4.11.3-beta.0
394
475
  enumerable: false,
395
476
  configurable: true
396
477
  });
478
+
397
479
  __proto.show = function () {
398
480
  this._el.show();
399
481
  };
482
+
400
483
  __proto.hide = function () {
401
484
  this._el.hide();
402
485
  };
486
+
403
487
  return ReactElementProvider;
404
488
  }();
405
489
 
406
- var Flicking = /*#__PURE__*/function (_super) {
490
+ var Flicking =
491
+ /*#__PURE__*/
492
+ function (_super) {
407
493
  __extends(Flicking, _super);
494
+
408
495
  function Flicking(props) {
409
496
  var _this = _super.call(this, props) || this;
497
+
410
498
  _this._panels = [];
411
499
  _this._renderEmitter = new Component();
500
+
412
501
  var children = _this._getChildren();
502
+
413
503
  _this._panels = _this._createPanelRefs(props, children);
414
504
  _this._prevChildren = children;
415
505
  return _this;
416
506
  }
507
+
417
508
  var __proto = Flicking.prototype;
418
509
  Object.defineProperty(__proto, "reactPanels", {
419
510
  get: function () {
@@ -431,6 +522,7 @@ version: 4.11.3-beta.0
431
522
  enumerable: false,
432
523
  configurable: true
433
524
  });
525
+
434
526
  __proto.componentDidMount = function () {
435
527
  var props = this.props;
436
528
  var rendererOptions = {
@@ -444,103 +536,134 @@ version: 4.11.3-beta.0
444
536
  externalRenderer: new ReactRenderer(rendererOptions)
445
537
  }));
446
538
  this._vanillaFlicking = flicking;
539
+
447
540
  var children = this._getChildren();
541
+
448
542
  this._jsxDiffer = new ListDiffer(children, function (panel) {
449
543
  return panel.key;
450
544
  });
451
545
  this._pluginsDiffer = new ListDiffer();
452
546
  this._prevChildren = children;
547
+
453
548
  this._bindEvents();
549
+
454
550
  this._checkPlugins();
551
+
455
552
  if (props.status) {
456
553
  flicking.setStatus(props.status);
457
554
  }
458
555
  };
556
+
459
557
  __proto.componentWillUnmount = function () {
460
558
  var _a;
559
+
461
560
  (_a = this._vanillaFlicking) === null || _a === void 0 ? void 0 : _a.destroy();
462
561
  };
562
+
463
563
  __proto.shouldComponentUpdate = function (nextProps) {
464
564
  var vanillaFlicking = this._vanillaFlicking;
465
565
  var prevProps = this.props;
466
566
  if (!vanillaFlicking || !vanillaFlicking.initialized) return false;
567
+
467
568
  var children = nextProps.children,
468
- restProps = __rest(nextProps, ["children"]);
569
+ restProps = __rest(nextProps, ["children"]);
570
+
469
571
  for (var key in restProps) {
470
572
  if (prevProps[key] !== nextProps[key]) {
471
573
  return true;
472
574
  }
473
575
  }
576
+
474
577
  var prevChildren = this._prevChildren;
578
+
475
579
  var nextChildren = this._getChildren(children);
580
+
476
581
  if (nextProps.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) return true;
477
582
  return false;
478
583
  };
584
+
479
585
  __proto.beforeRender = function () {
480
586
  var vanillaFlicking = this._vanillaFlicking;
481
587
  var props = this.props;
482
- var prevChildren = this._prevChildren;
483
- // Ignore updates before init, they will be updated after "ready" event's force update
588
+ var prevChildren = this._prevChildren; // Ignore updates before init, they will be updated after "ready" event's force update
484
589
  // Also, prevent updates when another update is already queued.
485
590
  // This usually happens when render() called twice without calling componentDidMount, like in the case of React.StrictMode.
591
+
486
592
  if (!vanillaFlicking || !vanillaFlicking.initialized || this._diffResult) return;
593
+
487
594
  var nextChildren = this._getChildren(props.children);
595
+
488
596
  if (props.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) {
489
597
  this._panels = this._createPanelRefs(props, nextChildren);
490
598
  this._diffResult = this._jsxDiffer.update(nextChildren);
491
599
  this._prevChildren = nextChildren;
492
600
  }
493
601
  };
602
+
494
603
  __proto.componentDidUpdate = function () {
495
604
  var flicking = this._vanillaFlicking;
496
605
  var renderEmitter = this._renderEmitter;
497
606
  var diffResult = this._diffResult;
607
+
498
608
  this._checkPlugins();
609
+
499
610
  renderEmitter.trigger("render");
500
- flicking.camera.updateOffset();
501
- // Omit 'virtual', as it can't have any setter
611
+ flicking.camera.updateOffset(); // Omit 'virtual', as it can't have any setter
612
+
502
613
  var _a = this.props;
503
- _a.virtual;
504
- var props = __rest(_a, ["virtual"]);
614
+ _a.virtual;
615
+ var props = __rest(_a, ["virtual"]);
616
+
505
617
  for (var key in props) {
506
618
  if (key in flicking && flicking[key] !== props[key]) {
507
619
  flicking[key] = props[key];
508
620
  }
509
621
  }
622
+
510
623
  if (!diffResult || !flicking.initialized) return;
511
624
  VanillaFlicking.sync(flicking, diffResult, this.reactPanels);
512
625
  this._diffResult = null;
513
626
  };
627
+
514
628
  __proto.render = function () {
515
629
  var _this = this;
630
+
516
631
  var _a, _b;
632
+
517
633
  var props = this.props;
518
634
  var Viewport = props.viewportTag;
519
635
  var Camera = props.cameraTag;
520
636
  var attributes = {};
521
637
  var flicking = this._vanillaFlicking;
522
638
  this.beforeRender();
639
+
523
640
  for (var name in props) {
524
641
  if (!(name in DEFAULT_PROPS) && !(name in VanillaFlicking.prototype)) {
525
642
  attributes[name] = props[name];
526
643
  }
527
644
  }
645
+
528
646
  var initialized = flicking && flicking.initialized;
529
647
  var viewportClasses = ["flicking-viewport"];
530
648
  var cameraClasses = ["flicking-camera"];
531
649
  var isHorizontal = flicking ? flicking.horizontal : (_a = props.horizontal) !== null && _a !== void 0 ? _a : true;
650
+
532
651
  if (!isHorizontal) {
533
652
  viewportClasses.push("vertical");
534
653
  }
654
+
535
655
  if (props.hideBeforeInit && !initialized) {
536
656
  viewportClasses.push("flicking-hidden");
537
657
  }
658
+
538
659
  if (attributes.className) {
539
660
  viewportClasses.push(attributes.className);
540
661
  }
662
+
541
663
  if (props.cameraClass) {
542
664
  cameraClasses.push(props.cameraClass);
543
665
  }
666
+
544
667
  var cameraProps = !initialized && props.firstPanelSize ? {
545
668
  style: {
546
669
  transform: VanillaFlicking.getDefaultCameraTransform(this.props.align, this.props.horizontal, this.props.firstPanelSize)
@@ -556,8 +679,10 @@ version: 4.11.3-beta.0
556
679
  className: cameraClasses.join(" ")
557
680
  }, cameraProps), panels), this._getViewportSlot());
558
681
  };
682
+
559
683
  __proto._createPanelRefs = function (props, children) {
560
684
  var _a;
685
+
561
686
  var panelsPerView = (_a = props.panelsPerView) !== null && _a !== void 0 ? _a : -1;
562
687
  return panelsPerView > 0 && !!props.virtual ? VanillaFlicking.range(panelsPerView + 1).map(function () {
563
688
  return React.createRef();
@@ -565,8 +690,10 @@ version: 4.11.3-beta.0
565
690
  return React.createRef();
566
691
  });
567
692
  };
693
+
568
694
  __proto._bindEvents = function () {
569
695
  var _this = this;
696
+
570
697
  var flicking = this._vanillaFlicking;
571
698
  Object.keys(VanillaFlicking.EVENTS).forEach(function (eventKey) {
572
699
  var eventName = VanillaFlicking.EVENTS[eventKey];
@@ -581,13 +708,16 @@ version: 4.11.3-beta.0
581
708
  _this.forceUpdate();
582
709
  });
583
710
  };
711
+
584
712
  __proto._checkPlugins = function () {
585
713
  var flicking = this._vanillaFlicking;
714
+
586
715
  var _a = this._pluginsDiffer.update(this.props.plugins),
587
- list = _a.list,
588
- added = _a.added,
589
- removed = _a.removed,
590
- prevList = _a.prevList;
716
+ list = _a.list,
717
+ added = _a.added,
718
+ removed = _a.removed,
719
+ prevList = _a.prevList;
720
+
591
721
  flicking.addPlugins.apply(flicking, added.map(function (index) {
592
722
  return list[index];
593
723
  }));
@@ -595,10 +725,12 @@ version: 4.11.3-beta.0
595
725
  return prevList[index];
596
726
  }));
597
727
  };
728
+
598
729
  __proto._hasSameChildren = function (prevChildren, nextChildren) {
599
730
  if (prevChildren.length !== nextChildren.length || prevChildren.length === 0) return false;
600
731
  var same = prevChildren.every(function (child, idx) {
601
732
  var nextChild = nextChildren[idx];
733
+
602
734
  if (child.key && nextChild.key) {
603
735
  return child.key === nextChild.key;
604
736
  } else {
@@ -607,32 +739,40 @@ version: 4.11.3-beta.0
607
739
  });
608
740
  return same;
609
741
  };
742
+
610
743
  __proto._getChildren = function (children) {
611
744
  var _this = this;
745
+
612
746
  if (children === void 0) {
613
747
  children = this.props.children;
614
748
  }
749
+
615
750
  return React.Children.toArray(children).filter(function (child) {
616
751
  return child.type !== ViewportSlot;
617
752
  }).reduce(function (all, child) {
618
753
  return __spreadArray(__spreadArray([], all, true), _this._unpackFragment(child), true);
619
754
  }, []);
620
755
  };
756
+
621
757
  __proto._getViewportSlot = function () {
622
758
  return React.Children.toArray(this.props.children).filter(function (child) {
623
759
  return child.type === ViewportSlot;
624
760
  });
625
761
  };
762
+
626
763
  __proto._unpackFragment = function (child) {
627
764
  var _this = this;
765
+
628
766
  return this._isFragment(child) ? React.Children.toArray(child.props.children).reduce(function (allChilds, fragChild) {
629
767
  return __spreadArray(__spreadArray([], allChilds, true), _this._unpackFragment(fragChild), true);
630
768
  }, []) : [child];
631
769
  };
770
+
632
771
  __proto._getVirtualPanels = function () {
633
772
  var _this = this;
773
+
634
774
  var _a = this.props.virtual.panelClass,
635
- panelClass = _a === void 0 ? "flicking-panel" : _a;
775
+ panelClass = _a === void 0 ? "flicking-panel" : _a;
636
776
  var panelsPerView = this.props.panelsPerView;
637
777
  var flicking = this._vanillaFlicking;
638
778
  var initialized = flicking && flicking.initialized;
@@ -653,9 +793,12 @@ version: 4.11.3-beta.0
653
793
  });
654
794
  });
655
795
  };
796
+
656
797
  __proto._getPanels = function () {
657
798
  var _this = this;
799
+
658
800
  var origChildren = this._getChildren();
801
+
659
802
  var vanillaFlicking = this._vanillaFlicking;
660
803
  var diffResult = this._diffResult;
661
804
  var children = vanillaFlicking && vanillaFlicking.initialized ? diffResult ? VanillaFlicking.getRenderingPanels(vanillaFlicking, diffResult) : VanillaFlicking.getRenderingPanels(vanillaFlicking, ListDiffer.diff(origChildren, origChildren)) : origChildren;
@@ -671,20 +814,25 @@ version: 4.11.3-beta.0
671
814
  }, child);
672
815
  });
673
816
  };
817
+
674
818
  __proto._isFragment = function (child) {
675
819
  if (child.type) {
676
820
  return child.type === React.Fragment;
677
821
  }
822
+
678
823
  return child === React.Fragment;
679
824
  };
825
+
680
826
  Flicking.defaultProps = DEFAULT_PROPS;
827
+
681
828
  __decorate([VanillaFlicking.withFlickingMethods], Flicking.prototype, "_vanillaFlicking", void 0);
829
+
682
830
  return Flicking;
683
831
  }(React.Component);
684
832
 
685
- /*
686
- * Copyright (c) 2015 NAVER Corp.
687
- * egjs projects are licensed under the MIT license
833
+ /*
834
+ * Copyright (c) 2015 NAVER Corp.
835
+ * egjs projects are licensed under the MIT license
688
836
  */
689
837
  Flicking.ViewportSlot = ViewportSlot;
690
838