-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvendors~exchange~explorer.9bd7e94dd662e5bd3b64.js
1114 lines (835 loc) · 90.7 KB
/
vendors~exchange~explorer.9bd7e94dd662e5bd3b64.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(this["webpackJsonp"] = this["webpackJsonp"] || []).push([[16],{
/***/ 2781:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(395);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(824);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _TransitionGroup = __webpack_require__(2782);
var _TransitionGroup2 = _interopRequireDefault(_TransitionGroup);
var _CSSTransitionGroupChild = __webpack_require__(2786);
var _CSSTransitionGroupChild2 = _interopRequireDefault(_CSSTransitionGroupChild);
var _PropTypes = __webpack_require__(2793);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = {
transitionName: _PropTypes.nameShape.isRequired,
transitionAppear: _propTypes2.default.bool,
transitionEnter: _propTypes2.default.bool,
transitionLeave: _propTypes2.default.bool,
transitionAppearTimeout: (0, _PropTypes.transitionTimeout)('Appear'),
transitionEnterTimeout: (0, _PropTypes.transitionTimeout)('Enter'),
transitionLeaveTimeout: (0, _PropTypes.transitionTimeout)('Leave')
};
var defaultProps = {
transitionAppear: false,
transitionEnter: true,
transitionLeave: true
};
var CSSTransitionGroup = function (_React$Component) {
_inherits(CSSTransitionGroup, _React$Component);
function CSSTransitionGroup() {
var _temp, _this, _ret;
_classCallCheck(this, CSSTransitionGroup);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._wrapChild = function (child) {
return _react2.default.createElement(_CSSTransitionGroupChild2.default, {
name: _this.props.transitionName,
appear: _this.props.transitionAppear,
enter: _this.props.transitionEnter,
leave: _this.props.transitionLeave,
appearTimeout: _this.props.transitionAppearTimeout,
enterTimeout: _this.props.transitionEnterTimeout,
leaveTimeout: _this.props.transitionLeaveTimeout
}, child);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
// We need to provide this childFactory so that
// ReactCSSTransitionGroupChild can receive updates to name, enter, and
// leave while it is leaving.
CSSTransitionGroup.prototype.render = function render() {
return _react2.default.createElement(_TransitionGroup2.default, _extends({}, this.props, { childFactory: this._wrapChild }));
};
return CSSTransitionGroup;
}(_react2.default.Component);
CSSTransitionGroup.displayName = 'CSSTransitionGroup';
CSSTransitionGroup.propTypes = true ? propTypes : undefined;
CSSTransitionGroup.defaultProps = defaultProps;
exports.default = CSSTransitionGroup;
module.exports = exports['default'];
/***/ }),
/***/ 2782:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _chainFunction = __webpack_require__(2783);
var _chainFunction2 = _interopRequireDefault(_chainFunction);
var _react = __webpack_require__(395);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(824);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _warning = __webpack_require__(2784);
var _warning2 = _interopRequireDefault(_warning);
var _ChildMapping = __webpack_require__(2785);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = {
component: _propTypes2.default.any,
childFactory: _propTypes2.default.func,
children: _propTypes2.default.node
};
var defaultProps = {
component: 'span',
childFactory: function childFactory(child) {
return child;
}
};
var TransitionGroup = function (_React$Component) {
_inherits(TransitionGroup, _React$Component);
function TransitionGroup(props, context) {
_classCallCheck(this, TransitionGroup);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.performAppear = function (key, component) {
_this.currentlyTransitioningKeys[key] = true;
if (component.componentWillAppear) {
component.componentWillAppear(_this._handleDoneAppearing.bind(_this, key, component));
} else {
_this._handleDoneAppearing(key, component);
}
};
_this._handleDoneAppearing = function (key, component) {
if (component.componentDidAppear) {
component.componentDidAppear();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping = (0, _ChildMapping.getChildMapping)(_this.props.children);
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully appeared. Remove it.
_this.performLeave(key, component);
}
};
_this.performEnter = function (key, component) {
_this.currentlyTransitioningKeys[key] = true;
if (component.componentWillEnter) {
component.componentWillEnter(_this._handleDoneEntering.bind(_this, key, component));
} else {
_this._handleDoneEntering(key, component);
}
};
_this._handleDoneEntering = function (key, component) {
if (component.componentDidEnter) {
component.componentDidEnter();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping = (0, _ChildMapping.getChildMapping)(_this.props.children);
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully entered. Remove it.
_this.performLeave(key, component);
}
};
_this.performLeave = function (key, component) {
_this.currentlyTransitioningKeys[key] = true;
if (component.componentWillLeave) {
component.componentWillLeave(_this._handleDoneLeaving.bind(_this, key, component));
} else {
// Note that this is somewhat dangerous b/c it calls setState()
// again, effectively mutating the component before all the work
// is done.
_this._handleDoneLeaving(key, component);
}
};
_this._handleDoneLeaving = function (key, component) {
if (component.componentDidLeave) {
component.componentDidLeave();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping = (0, _ChildMapping.getChildMapping)(_this.props.children);
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
// This entered again before it fully left. Add it again.
_this.keysToEnter.push(key);
} else {
_this.setState(function (state) {
var newChildren = _extends({}, state.children);
delete newChildren[key];
return { children: newChildren };
});
}
};
_this.childRefs = Object.create(null);
_this.state = {
children: (0, _ChildMapping.getChildMapping)(props.children)
};
return _this;
}
TransitionGroup.prototype.componentWillMount = function componentWillMount() {
this.currentlyTransitioningKeys = {};
this.keysToEnter = [];
this.keysToLeave = [];
};
TransitionGroup.prototype.componentDidMount = function componentDidMount() {
var initialChildMapping = this.state.children;
for (var key in initialChildMapping) {
if (initialChildMapping[key]) {
this.performAppear(key, this.childRefs[key]);
}
}
};
TransitionGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var nextChildMapping = (0, _ChildMapping.getChildMapping)(nextProps.children);
var prevChildMapping = this.state.children;
this.setState({
children: (0, _ChildMapping.mergeChildMappings)(prevChildMapping, nextChildMapping)
});
for (var key in nextChildMapping) {
var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
this.keysToEnter.push(key);
}
}
for (var _key in prevChildMapping) {
var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(_key);
if (prevChildMapping[_key] && !hasNext && !this.currentlyTransitioningKeys[_key]) {
this.keysToLeave.push(_key);
}
}
// If we want to someday check for reordering, we could do it here.
};
TransitionGroup.prototype.componentDidUpdate = function componentDidUpdate() {
var _this2 = this;
var keysToEnter = this.keysToEnter;
this.keysToEnter = [];
keysToEnter.forEach(function (key) {
return _this2.performEnter(key, _this2.childRefs[key]);
});
var keysToLeave = this.keysToLeave;
this.keysToLeave = [];
keysToLeave.forEach(function (key) {
return _this2.performLeave(key, _this2.childRefs[key]);
});
};
TransitionGroup.prototype.render = function render() {
var _this3 = this;
// TODO: we could get rid of the need for the wrapper node
// by cloning a single child
var childrenToRender = [];
var _loop = function _loop(key) {
var child = _this3.state.children[key];
if (child) {
var isCallbackRef = typeof child.ref !== 'string';
var factoryChild = _this3.props.childFactory(child);
var ref = function ref(r) {
_this3.childRefs[key] = r;
};
true ? (0, _warning2.default)(isCallbackRef, 'string refs are not supported on children of TransitionGroup and will be ignored. ' + 'Please use a callback ref instead: https://facebook.github.io/react/docs/refs-and-the-dom.html#the-ref-callback-attribute') : undefined;
// Always chaining the refs leads to problems when the childFactory
// wraps the child. The child ref callback gets called twice with the
// wrapper and the child. So we only need to chain the ref if the
// factoryChild is not different from child.
if (factoryChild === child && isCallbackRef) {
ref = (0, _chainFunction2.default)(child.ref, ref);
}
// You may need to apply reactive updates to a child as it is leaving.
// The normal React way to do it won't work since the child will have
// already been removed. In case you need this behavior you can provide
// a childFactory function to wrap every child, even the ones that are
// leaving.
childrenToRender.push(_react2.default.cloneElement(factoryChild, {
key: key,
ref: ref
}));
}
};
for (var key in this.state.children) {
_loop(key);
}
// Do not forward TransitionGroup props to primitive DOM nodes
var props = _extends({}, this.props);
delete props.transitionLeave;
delete props.transitionName;
delete props.transitionAppear;
delete props.transitionEnter;
delete props.childFactory;
delete props.transitionLeaveTimeout;
delete props.transitionEnterTimeout;
delete props.transitionAppearTimeout;
delete props.component;
return _react2.default.createElement(this.props.component, props, childrenToRender);
};
return TransitionGroup;
}(_react2.default.Component);
TransitionGroup.displayName = 'TransitionGroup';
TransitionGroup.propTypes = true ? propTypes : undefined;
TransitionGroup.defaultProps = defaultProps;
exports.default = TransitionGroup;
module.exports = exports['default'];
/***/ }),
/***/ 2783:
/***/ (function(module, exports) {
module.exports = function chain(){
var len = arguments.length
var args = [];
for (var i = 0; i < len; i++)
args[i] = arguments[i]
args = args.filter(function(fn){ return fn != null })
if (args.length === 0) return undefined
if (args.length === 1) return args[0]
return args.reduce(function(current, next){
return function chainedFunction() {
current.apply(this, arguments);
next.apply(this, arguments);
};
})
}
/***/ }),
/***/ 2784:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (true) {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/***/ }),
/***/ 2785:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.getChildMapping = getChildMapping;
exports.mergeChildMappings = mergeChildMappings;
var _react = __webpack_require__(395);
/**
* Given `this.props.children`, return an object mapping key to child.
*
* @param {*} children `this.props.children`
* @return {object} Mapping of key to child
*/
function getChildMapping(children) {
if (!children) {
return children;
}
var result = {};
_react.Children.map(children, function (child) {
return child;
}).forEach(function (child) {
result[child.key] = child;
});
return result;
}
/**
* When you're adding or removing children some may be added or removed in the
* same render pass. We want to show *both* since we want to simultaneously
* animate elements in and out. This function takes a previous set of keys
* and a new set of keys and merges them with its best guess of the correct
* ordering. In the future we may expose some of the utilities in
* ReactMultiChild to make this easy, but for now React itself does not
* directly have this concept of the union of prevChildren and nextChildren
* so we implement it here.
*
* @param {object} prev prev children as returned from
* `ReactTransitionChildMapping.getChildMapping()`.
* @param {object} next next children as returned from
* `ReactTransitionChildMapping.getChildMapping()`.
* @return {object} a key set that contains all keys in `prev` and all keys
* in `next` in a reasonable order.
*/
function mergeChildMappings(prev, next) {
prev = prev || {};
next = next || {};
function getValueForKey(key) {
if (next.hasOwnProperty(key)) {
return next[key];
}
return prev[key];
}
// For each key of `next`, the list of keys to insert before that key in
// the combined list
var nextKeysPending = {};
var pendingKeys = [];
for (var prevKey in prev) {
if (next.hasOwnProperty(prevKey)) {
if (pendingKeys.length) {
nextKeysPending[prevKey] = pendingKeys;
pendingKeys = [];
}
} else {
pendingKeys.push(prevKey);
}
}
var i = void 0;
var childMapping = {};
for (var nextKey in next) {
if (nextKeysPending.hasOwnProperty(nextKey)) {
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
var pendingNextKey = nextKeysPending[nextKey][i];
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
}
}
childMapping[nextKey] = getValueForKey(nextKey);
}
// Finally, add the keys which didn't appear before any key in `next`
for (i = 0; i < pendingKeys.length; i++) {
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
}
return childMapping;
}
/***/ }),
/***/ 2786:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _addClass = __webpack_require__(2787);
var _addClass2 = _interopRequireDefault(_addClass);
var _removeClass = __webpack_require__(2789);
var _removeClass2 = _interopRequireDefault(_removeClass);
var _requestAnimationFrame = __webpack_require__(2790);
var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame);
var _properties = __webpack_require__(2792);
var _react = __webpack_require__(395);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(824);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(400);
var _PropTypes = __webpack_require__(2793);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var events = [];
if (_properties.transitionEnd) events.push(_properties.transitionEnd);
if (_properties.animationEnd) events.push(_properties.animationEnd);
function addEndListener(node, listener) {
if (events.length) {
events.forEach(function (e) {
return node.addEventListener(e, listener, false);
});
} else {
setTimeout(listener, 0);
}
return function () {
if (!events.length) return;
events.forEach(function (e) {
return node.removeEventListener(e, listener, false);
});
};
}
var propTypes = {
children: _propTypes2.default.node,
name: _PropTypes.nameShape.isRequired,
// Once we require timeouts to be specified, we can remove the
// boolean flags (appear etc.) and just accept a number
// or a bool for the timeout flags (appearTimeout etc.)
appear: _propTypes2.default.bool,
enter: _propTypes2.default.bool,
leave: _propTypes2.default.bool,
appearTimeout: _propTypes2.default.number,
enterTimeout: _propTypes2.default.number,
leaveTimeout: _propTypes2.default.number
};
var CSSTransitionGroupChild = function (_React$Component) {
_inherits(CSSTransitionGroupChild, _React$Component);
function CSSTransitionGroupChild() {
var _temp, _this, _ret;
_classCallCheck(this, CSSTransitionGroupChild);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.componentWillAppear = function (done) {
if (_this.props.appear) {
_this.transition('appear', done, _this.props.appearTimeout);
} else {
done();
}
}, _this.componentWillEnter = function (done) {
if (_this.props.enter) {
_this.transition('enter', done, _this.props.enterTimeout);
} else {
done();
}
}, _this.componentWillLeave = function (done) {
if (_this.props.leave) {
_this.transition('leave', done, _this.props.leaveTimeout);
} else {
done();
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
CSSTransitionGroupChild.prototype.componentWillMount = function componentWillMount() {
this.classNameAndNodeQueue = [];
this.transitionTimeouts = [];
};
CSSTransitionGroupChild.prototype.componentWillUnmount = function componentWillUnmount() {
this.unmounted = true;
if (this.timeout) {
clearTimeout(this.timeout);
}
this.transitionTimeouts.forEach(function (timeout) {
clearTimeout(timeout);
});
this.classNameAndNodeQueue.length = 0;
};
CSSTransitionGroupChild.prototype.transition = function transition(animationType, finishCallback, timeout) {
var node = (0, _reactDom.findDOMNode)(this);
if (!node) {
if (finishCallback) {
finishCallback();
}
return;
}
var className = this.props.name[animationType] || this.props.name + '-' + animationType;
var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
var timer = null;
var removeListeners = void 0;
(0, _addClass2.default)(node, className);
// Need to do this to actually trigger a transition.
this.queueClassAndNode(activeClassName, node);
// Clean-up the animation after the specified delay
var finish = function finish(e) {
if (e && e.target !== node) {
return;
}
clearTimeout(timer);
if (removeListeners) removeListeners();
(0, _removeClass2.default)(node, className);
(0, _removeClass2.default)(node, activeClassName);
if (removeListeners) removeListeners();
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (finishCallback) {
finishCallback();
}
};
if (timeout) {
timer = setTimeout(finish, timeout);
this.transitionTimeouts.push(timer);
} else if (_properties.transitionEnd) {
removeListeners = addEndListener(node, finish);
}
};
CSSTransitionGroupChild.prototype.queueClassAndNode = function queueClassAndNode(className, node) {
var _this2 = this;
this.classNameAndNodeQueue.push({
className: className,
node: node
});
if (!this.rafHandle) {
this.rafHandle = (0, _requestAnimationFrame2.default)(function () {
return _this2.flushClassNameAndNodeQueue();
});
}
};
CSSTransitionGroupChild.prototype.flushClassNameAndNodeQueue = function flushClassNameAndNodeQueue() {
if (!this.unmounted) {
this.classNameAndNodeQueue.forEach(function (obj) {
// This is for to force a repaint,
// which is necessary in order to transition styles when adding a class name.
/* eslint-disable no-unused-expressions */
obj.node.scrollTop;
/* eslint-enable no-unused-expressions */
(0, _addClass2.default)(obj.node, obj.className);
});
}
this.classNameAndNodeQueue.length = 0;
this.rafHandle = null;
};
CSSTransitionGroupChild.prototype.render = function render() {
var props = _extends({}, this.props);
delete props.name;
delete props.appear;
delete props.enter;
delete props.leave;
delete props.appearTimeout;
delete props.enterTimeout;
delete props.leaveTimeout;
delete props.children;
return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), props);
};
return CSSTransitionGroupChild;
}(_react2.default.Component);
CSSTransitionGroupChild.displayName = 'CSSTransitionGroupChild';
CSSTransitionGroupChild.propTypes = true ? propTypes : undefined;
exports.default = CSSTransitionGroupChild;
module.exports = exports['default'];
/***/ }),
/***/ 2787:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addClass;
var _hasClass = __webpack_require__(2788);
var _hasClass2 = _interopRequireDefault(_hasClass);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function addClass(element, className) {
if (element.classList) element.classList.add(className);else if (!(0, _hasClass2.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
}
module.exports = exports['default'];
/***/ }),
/***/ 2788:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hasClass;
function hasClass(element, className) {
if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
}
module.exports = exports["default"];
/***/ }),
/***/ 2789:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function replaceClassName(origClass, classToRemove) {
return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
}
module.exports = function removeClass(element, className) {
if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
};
/***/ }),
/***/ 2790:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(2791);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var vendors = ['', 'webkit', 'moz', 'o', 'ms'];
var cancel = 'clearTimeout';
var raf = fallback;
var compatRaf = void 0;
var getKey = function getKey(vendor, k) {
return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame';
};
if (_inDOM2.default) {
vendors.some(function (vendor) {
var rafKey = getKey(vendor, 'request');
if (rafKey in window) {
cancel = getKey(vendor, 'cancel');
return raf = function raf(cb) {
return window[rafKey](cb);
};
}
});
}
/* https://github.com/component/raf */
var prev = new Date().getTime();
function fallback(fn) {
var curr = new Date().getTime(),
ms = Math.max(0, 16 - (curr - prev)),
req = setTimeout(fn, ms);
prev = curr;
return req;
}
compatRaf = function compatRaf(cb) {
return raf(cb);
};
compatRaf.cancel = function (id) {
window[cancel] && typeof window[cancel] === 'function' && window[cancel](id);
};
exports.default = compatRaf;
module.exports = exports['default'];
/***/ }),
/***/ 2791:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
module.exports = exports['default'];
/***/ }),
/***/ 2792:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;
var _inDOM = __webpack_require__(2791);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var transform = 'transform';
var prefix = void 0,
transitionEnd = void 0,
animationEnd = void 0;
var transitionProperty = void 0,
transitionDuration = void 0,
transitionTiming = void 0,
transitionDelay = void 0;
var animationName = void 0,
animationDuration = void 0,
animationTiming = void 0,
animationDelay = void 0;
if (_inDOM2.default) {
var _getTransitionPropert = getTransitionProperties();
prefix = _getTransitionPropert.prefix;
exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
exports.transform = transform = prefix + '-' + transform;
exports.transitionProperty = transitionProperty = prefix + '-transition-property';
exports.transitionDuration = transitionDuration = prefix + '-transition-duration';
exports.transitionDelay = transitionDelay = prefix + '-transition-delay';
exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';
exports.animationName = animationName = prefix + '-animation-name';
exports.animationDuration = animationDuration = prefix + '-animation-duration';
exports.animationTiming = animationTiming = prefix + '-animation-delay';
exports.animationDelay = animationDelay = prefix + '-animation-timing-function';
}
exports.transform = transform;
exports.transitionProperty = transitionProperty;
exports.transitionTiming = transitionTiming;
exports.transitionDelay = transitionDelay;
exports.transitionDuration = transitionDuration;
exports.transitionEnd = transitionEnd;
exports.animationName = animationName;
exports.animationDuration = animationDuration;
exports.animationTiming = animationTiming;
exports.animationDelay = animationDelay;
exports.animationEnd = animationEnd;