react 15.5.3 → 15.6.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.
- package/dist/react-with-addons.js +1808 -1482
- package/dist/react-with-addons.min.js +3 -3
- package/dist/react.js +1772 -1428
- package/dist/react.min.js +2 -2
- package/lib/React.js +45 -17
- package/lib/{ReactComponent.js → ReactBaseClasses.js} +29 -4
- package/lib/ReactCSSTransitionGroup.js +1 -1
- package/lib/ReactComponentTreeHook.js +49 -4
- package/lib/ReactCurrentOwner.js +0 -2
- package/lib/ReactDOMFactories.js +0 -1
- package/lib/ReactElementValidator.js +6 -4
- package/lib/ReactLink.js +1 -22
- package/lib/ReactNoopUpdateQueue.js +0 -1
- package/lib/ReactTransitionGroup.js +4 -1
- package/lib/ReactVersion.js +1 -1
- package/lib/createClass.js +22 -0
- package/lib/deprecated.js +3 -3
- package/lib/lowPriorityWarning.js +64 -0
- package/lib/traverseAllChildren.js +1 -1
- package/package.json +3 -2
- package/lib/ReactClass.js +0 -722
- package/lib/ReactPureComponent.js +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React (with addons) v15.
|
|
2
|
+
* React (with addons) v15.6.1
|
|
3
3
|
*/
|
|
4
4
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
5
5
|
/**
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
|
-
var ExecutionEnvironment = _dereq_(
|
|
17
|
+
var ExecutionEnvironment = _dereq_(45);
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
|
@@ -102,7 +102,7 @@ function getVendorPrefixedEventName(eventName) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
module.exports = getVendorPrefixedEventName;
|
|
105
|
-
},{"
|
|
105
|
+
},{"45":45}],2:[function(_dereq_,module,exports){
|
|
106
106
|
/**
|
|
107
107
|
* Copyright 2013-present, Facebook, Inc.
|
|
108
108
|
* All rights reserved.
|
|
@@ -174,8 +174,8 @@ module.exports = KeyEscapeUtils;
|
|
|
174
174
|
|
|
175
175
|
'use strict';
|
|
176
176
|
|
|
177
|
-
var ReactLink = _dereq_(
|
|
178
|
-
var ReactStateSetters = _dereq_(
|
|
177
|
+
var ReactLink = _dereq_(19);
|
|
178
|
+
var ReactStateSetters = _dereq_(24);
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* A simple mixin around ReactLink.forState().
|
|
@@ -196,7 +196,7 @@ var LinkedStateMixin = {
|
|
|
196
196
|
};
|
|
197
197
|
|
|
198
198
|
module.exports = LinkedStateMixin;
|
|
199
|
-
},{"
|
|
199
|
+
},{"19":19,"24":24}],4:[function(_dereq_,module,exports){
|
|
200
200
|
/**
|
|
201
201
|
* Copyright 2013-present, Facebook, Inc.
|
|
202
202
|
* All rights reserved.
|
|
@@ -212,7 +212,7 @@ module.exports = LinkedStateMixin;
|
|
|
212
212
|
|
|
213
213
|
var _prodInvariant = _dereq_(39);
|
|
214
214
|
|
|
215
|
-
var invariant = _dereq_(
|
|
215
|
+
var invariant = _dereq_(48);
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* Static poolers. Several custom versions for each potential number of
|
|
@@ -308,7 +308,7 @@ var PooledClass = {
|
|
|
308
308
|
};
|
|
309
309
|
|
|
310
310
|
module.exports = PooledClass;
|
|
311
|
-
},{"39":39,"
|
|
311
|
+
},{"39":39,"48":48}],5:[function(_dereq_,module,exports){
|
|
312
312
|
/**
|
|
313
313
|
* Copyright 2013-present, Facebook, Inc.
|
|
314
314
|
* All rights reserved.
|
|
@@ -321,27 +321,26 @@ module.exports = PooledClass;
|
|
|
321
321
|
|
|
322
322
|
'use strict';
|
|
323
323
|
|
|
324
|
-
var _assign = _dereq_(
|
|
324
|
+
var _assign = _dereq_(51);
|
|
325
325
|
|
|
326
|
-
var
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
var
|
|
330
|
-
var
|
|
331
|
-
var
|
|
332
|
-
var ReactPropTypes = _dereq_(23);
|
|
333
|
-
var ReactVersion = _dereq_(30);
|
|
326
|
+
var ReactBaseClasses = _dereq_(7);
|
|
327
|
+
var ReactChildren = _dereq_(10);
|
|
328
|
+
var ReactDOMFactories = _dereq_(14);
|
|
329
|
+
var ReactElement = _dereq_(15);
|
|
330
|
+
var ReactPropTypes = _dereq_(22);
|
|
331
|
+
var ReactVersion = _dereq_(28);
|
|
334
332
|
|
|
333
|
+
var createReactClass = _dereq_(33);
|
|
335
334
|
var onlyChild = _dereq_(38);
|
|
336
|
-
var warning = _dereq_(49);
|
|
337
335
|
|
|
338
336
|
var createElement = ReactElement.createElement;
|
|
339
337
|
var createFactory = ReactElement.createFactory;
|
|
340
338
|
var cloneElement = ReactElement.cloneElement;
|
|
341
339
|
|
|
342
340
|
if ("development" !== 'production') {
|
|
343
|
-
var
|
|
344
|
-
var
|
|
341
|
+
var lowPriorityWarning = _dereq_(37);
|
|
342
|
+
var canDefineProperty = _dereq_(31);
|
|
343
|
+
var ReactElementValidator = _dereq_(17);
|
|
345
344
|
var didWarnPropTypesDeprecated = false;
|
|
346
345
|
createElement = ReactElementValidator.createElement;
|
|
347
346
|
createFactory = ReactElementValidator.createFactory;
|
|
@@ -349,18 +348,27 @@ if ("development" !== 'production') {
|
|
|
349
348
|
}
|
|
350
349
|
|
|
351
350
|
var __spread = _assign;
|
|
351
|
+
var createMixin = function (mixin) {
|
|
352
|
+
return mixin;
|
|
353
|
+
};
|
|
352
354
|
|
|
353
355
|
if ("development" !== 'production') {
|
|
354
|
-
var
|
|
356
|
+
var warnedForSpread = false;
|
|
357
|
+
var warnedForCreateMixin = false;
|
|
355
358
|
__spread = function () {
|
|
356
|
-
|
|
357
|
-
|
|
359
|
+
lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
|
|
360
|
+
warnedForSpread = true;
|
|
358
361
|
return _assign.apply(null, arguments);
|
|
359
362
|
};
|
|
363
|
+
|
|
364
|
+
createMixin = function (mixin) {
|
|
365
|
+
lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
|
|
366
|
+
warnedForCreateMixin = true;
|
|
367
|
+
return mixin;
|
|
368
|
+
};
|
|
360
369
|
}
|
|
361
370
|
|
|
362
371
|
var React = {
|
|
363
|
-
|
|
364
372
|
// Modern
|
|
365
373
|
|
|
366
374
|
Children: {
|
|
@@ -371,8 +379,8 @@ var React = {
|
|
|
371
379
|
only: onlyChild
|
|
372
380
|
},
|
|
373
381
|
|
|
374
|
-
Component:
|
|
375
|
-
PureComponent:
|
|
382
|
+
Component: ReactBaseClasses.Component,
|
|
383
|
+
PureComponent: ReactBaseClasses.PureComponent,
|
|
376
384
|
|
|
377
385
|
createElement: createElement,
|
|
378
386
|
cloneElement: cloneElement,
|
|
@@ -381,12 +389,9 @@ var React = {
|
|
|
381
389
|
// Classic
|
|
382
390
|
|
|
383
391
|
PropTypes: ReactPropTypes,
|
|
384
|
-
createClass:
|
|
392
|
+
createClass: createReactClass,
|
|
385
393
|
createFactory: createFactory,
|
|
386
|
-
createMixin:
|
|
387
|
-
// Currently a noop. Will be used to validate and trace mixins.
|
|
388
|
-
return mixin;
|
|
389
|
-
},
|
|
394
|
+
createMixin: createMixin,
|
|
390
395
|
|
|
391
396
|
// This looks DOM specific but these are actually isomorphic helpers
|
|
392
397
|
// since they are just generating DOM strings.
|
|
@@ -398,21 +403,44 @@ var React = {
|
|
|
398
403
|
__spread: __spread
|
|
399
404
|
};
|
|
400
405
|
|
|
401
|
-
// TODO: Fix tests so that this deprecation warning doesn't cause failures.
|
|
402
406
|
if ("development" !== 'production') {
|
|
407
|
+
var warnedForCreateClass = false;
|
|
403
408
|
if (canDefineProperty) {
|
|
404
409
|
Object.defineProperty(React, 'PropTypes', {
|
|
405
410
|
get: function () {
|
|
406
|
-
|
|
411
|
+
lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
|
|
407
412
|
didWarnPropTypesDeprecated = true;
|
|
408
413
|
return ReactPropTypes;
|
|
409
414
|
}
|
|
410
415
|
});
|
|
416
|
+
|
|
417
|
+
Object.defineProperty(React, 'createClass', {
|
|
418
|
+
get: function () {
|
|
419
|
+
lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
|
|
420
|
+
warnedForCreateClass = true;
|
|
421
|
+
return createReactClass;
|
|
422
|
+
}
|
|
423
|
+
});
|
|
411
424
|
}
|
|
425
|
+
|
|
426
|
+
// React.DOM factories are deprecated. Wrap these methods so that
|
|
427
|
+
// invocations of the React.DOM namespace and alert users to switch
|
|
428
|
+
// to the `react-dom-factories` package.
|
|
429
|
+
React.DOM = {};
|
|
430
|
+
var warnedForFactories = false;
|
|
431
|
+
Object.keys(ReactDOMFactories).forEach(function (factory) {
|
|
432
|
+
React.DOM[factory] = function () {
|
|
433
|
+
if (!warnedForFactories) {
|
|
434
|
+
lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
|
|
435
|
+
warnedForFactories = true;
|
|
436
|
+
}
|
|
437
|
+
return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
|
|
438
|
+
};
|
|
439
|
+
});
|
|
412
440
|
}
|
|
413
441
|
|
|
414
442
|
module.exports = React;
|
|
415
|
-
},{"10":10,"
|
|
443
|
+
},{"10":10,"14":14,"15":15,"17":17,"22":22,"28":28,"31":31,"33":33,"37":37,"38":38,"51":51,"7":7}],6:[function(_dereq_,module,exports){
|
|
416
444
|
/**
|
|
417
445
|
* Copyright 2013-present, Facebook, Inc.
|
|
418
446
|
* All rights reserved.
|
|
@@ -430,7 +458,7 @@ var ReactDOM;
|
|
|
430
458
|
function getReactDOM() {
|
|
431
459
|
if (!ReactDOM) {
|
|
432
460
|
// This is safe to use because current module only exists in the addons build:
|
|
433
|
-
var ReactWithAddonsUMDEntry = _dereq_(
|
|
461
|
+
var ReactWithAddonsUMDEntry = _dereq_(30);
|
|
434
462
|
// This is injected by the ReactDOM UMD build:
|
|
435
463
|
ReactDOM = ReactWithAddonsUMDEntry.__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
436
464
|
}
|
|
@@ -448,7 +476,150 @@ if ("development" !== 'production') {
|
|
|
448
476
|
return getReactDOM().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactTestUtils;
|
|
449
477
|
};
|
|
450
478
|
}
|
|
451
|
-
},{"
|
|
479
|
+
},{"30":30}],7:[function(_dereq_,module,exports){
|
|
480
|
+
/**
|
|
481
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
482
|
+
* All rights reserved.
|
|
483
|
+
*
|
|
484
|
+
* This source code is licensed under the BSD-style license found in the
|
|
485
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
486
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
487
|
+
*
|
|
488
|
+
*/
|
|
489
|
+
|
|
490
|
+
'use strict';
|
|
491
|
+
|
|
492
|
+
var _prodInvariant = _dereq_(39),
|
|
493
|
+
_assign = _dereq_(51);
|
|
494
|
+
|
|
495
|
+
var ReactNoopUpdateQueue = _dereq_(20);
|
|
496
|
+
|
|
497
|
+
var canDefineProperty = _dereq_(31);
|
|
498
|
+
var emptyObject = _dereq_(47);
|
|
499
|
+
var invariant = _dereq_(48);
|
|
500
|
+
var lowPriorityWarning = _dereq_(37);
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Base class helpers for the updating state of a component.
|
|
504
|
+
*/
|
|
505
|
+
function ReactComponent(props, context, updater) {
|
|
506
|
+
this.props = props;
|
|
507
|
+
this.context = context;
|
|
508
|
+
this.refs = emptyObject;
|
|
509
|
+
// We initialize the default updater but the real one gets injected by the
|
|
510
|
+
// renderer.
|
|
511
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
ReactComponent.prototype.isReactComponent = {};
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Sets a subset of the state. Always use this to mutate
|
|
518
|
+
* state. You should treat `this.state` as immutable.
|
|
519
|
+
*
|
|
520
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
521
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
522
|
+
*
|
|
523
|
+
* There is no guarantee that calls to `setState` will run synchronously,
|
|
524
|
+
* as they may eventually be batched together. You can provide an optional
|
|
525
|
+
* callback that will be executed when the call to setState is actually
|
|
526
|
+
* completed.
|
|
527
|
+
*
|
|
528
|
+
* When a function is provided to setState, it will be called at some point in
|
|
529
|
+
* the future (not synchronously). It will be called with the up to date
|
|
530
|
+
* component arguments (state, props, context). These values can be different
|
|
531
|
+
* from this.* because your function may be called after receiveProps but before
|
|
532
|
+
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
533
|
+
* assigned to this.
|
|
534
|
+
*
|
|
535
|
+
* @param {object|function} partialState Next partial state or function to
|
|
536
|
+
* produce next partial state to be merged with current state.
|
|
537
|
+
* @param {?function} callback Called after state is updated.
|
|
538
|
+
* @final
|
|
539
|
+
* @protected
|
|
540
|
+
*/
|
|
541
|
+
ReactComponent.prototype.setState = function (partialState, callback) {
|
|
542
|
+
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
|
543
|
+
this.updater.enqueueSetState(this, partialState);
|
|
544
|
+
if (callback) {
|
|
545
|
+
this.updater.enqueueCallback(this, callback, 'setState');
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Forces an update. This should only be invoked when it is known with
|
|
551
|
+
* certainty that we are **not** in a DOM transaction.
|
|
552
|
+
*
|
|
553
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
554
|
+
* component's state has changed but `setState` was not called.
|
|
555
|
+
*
|
|
556
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
557
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
558
|
+
*
|
|
559
|
+
* @param {?function} callback Called after update is complete.
|
|
560
|
+
* @final
|
|
561
|
+
* @protected
|
|
562
|
+
*/
|
|
563
|
+
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
564
|
+
this.updater.enqueueForceUpdate(this);
|
|
565
|
+
if (callback) {
|
|
566
|
+
this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
572
|
+
* we would like to deprecate them, we're not going to move them over to this
|
|
573
|
+
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
574
|
+
*/
|
|
575
|
+
if ("development" !== 'production') {
|
|
576
|
+
var deprecatedAPIs = {
|
|
577
|
+
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
578
|
+
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
579
|
+
};
|
|
580
|
+
var defineDeprecationWarning = function (methodName, info) {
|
|
581
|
+
if (canDefineProperty) {
|
|
582
|
+
Object.defineProperty(ReactComponent.prototype, methodName, {
|
|
583
|
+
get: function () {
|
|
584
|
+
lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
585
|
+
return undefined;
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
for (var fnName in deprecatedAPIs) {
|
|
591
|
+
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
592
|
+
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Base class helpers for the updating state of a component.
|
|
599
|
+
*/
|
|
600
|
+
function ReactPureComponent(props, context, updater) {
|
|
601
|
+
// Duplicated from ReactComponent.
|
|
602
|
+
this.props = props;
|
|
603
|
+
this.context = context;
|
|
604
|
+
this.refs = emptyObject;
|
|
605
|
+
// We initialize the default updater but the real one gets injected by the
|
|
606
|
+
// renderer.
|
|
607
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function ComponentDummy() {}
|
|
611
|
+
ComponentDummy.prototype = ReactComponent.prototype;
|
|
612
|
+
ReactPureComponent.prototype = new ComponentDummy();
|
|
613
|
+
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
|
614
|
+
// Avoid an extra prototype jump for these methods.
|
|
615
|
+
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
|
616
|
+
ReactPureComponent.prototype.isPureReactComponent = true;
|
|
617
|
+
|
|
618
|
+
module.exports = {
|
|
619
|
+
Component: ReactComponent,
|
|
620
|
+
PureComponent: ReactPureComponent
|
|
621
|
+
};
|
|
622
|
+
},{"20":20,"31":31,"37":37,"39":39,"47":47,"48":48,"51":51}],8:[function(_dereq_,module,exports){
|
|
452
623
|
/**
|
|
453
624
|
* Copyright 2013-present, Facebook, Inc.
|
|
454
625
|
* All rights reserved.
|
|
@@ -461,7 +632,7 @@ if ("development" !== 'production') {
|
|
|
461
632
|
|
|
462
633
|
'use strict';
|
|
463
634
|
|
|
464
|
-
var _assign = _dereq_(
|
|
635
|
+
var _assign = _dereq_(51);
|
|
465
636
|
|
|
466
637
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
467
638
|
|
|
@@ -470,11 +641,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
470
641
|
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; }
|
|
471
642
|
|
|
472
643
|
var React = _dereq_(5);
|
|
473
|
-
var propTypesFactory = _dereq_(
|
|
644
|
+
var propTypesFactory = _dereq_(53);
|
|
474
645
|
var PropTypes = propTypesFactory(React.isValidElement);
|
|
475
646
|
|
|
476
|
-
var ReactTransitionGroup = _dereq_(
|
|
477
|
-
var ReactCSSTransitionGroupChild = _dereq_(
|
|
647
|
+
var ReactTransitionGroup = _dereq_(27);
|
|
648
|
+
var ReactCSSTransitionGroupChild = _dereq_(9);
|
|
478
649
|
|
|
479
650
|
function createTransitionTimeoutPropValidator(transitionType) {
|
|
480
651
|
var timeoutPropName = 'transition' + transitionType + 'Timeout';
|
|
@@ -485,7 +656,7 @@ function createTransitionTimeoutPropValidator(transitionType) {
|
|
|
485
656
|
if (props[enabledPropName]) {
|
|
486
657
|
// If no timeout duration is provided
|
|
487
658
|
if (props[timeoutPropName] == null) {
|
|
488
|
-
return new Error(timeoutPropName +
|
|
659
|
+
return new Error(timeoutPropName + " wasn't supplied to ReactCSSTransitionGroup: " + "this can cause unreliable animations and won't be supported in " + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
|
|
489
660
|
|
|
490
661
|
// If the duration isn't a number
|
|
491
662
|
} else if (typeof props[timeoutPropName] !== 'number') {
|
|
@@ -555,7 +726,7 @@ ReactCSSTransitionGroup.defaultProps = {
|
|
|
555
726
|
|
|
556
727
|
|
|
557
728
|
module.exports = ReactCSSTransitionGroup;
|
|
558
|
-
},{"
|
|
729
|
+
},{"27":27,"5":5,"51":51,"53":53,"9":9}],9:[function(_dereq_,module,exports){
|
|
559
730
|
/**
|
|
560
731
|
* Copyright 2013-present, Facebook, Inc.
|
|
561
732
|
* All rights reserved.
|
|
@@ -577,11 +748,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
577
748
|
var React = _dereq_(5);
|
|
578
749
|
var ReactAddonsDOMDependencies = _dereq_(6);
|
|
579
750
|
|
|
580
|
-
var propTypesFactory = _dereq_(
|
|
751
|
+
var propTypesFactory = _dereq_(53);
|
|
581
752
|
var PropTypes = propTypesFactory(React.isValidElement);
|
|
582
753
|
|
|
583
|
-
var CSSCore = _dereq_(
|
|
584
|
-
var ReactTransitionEvents = _dereq_(
|
|
754
|
+
var CSSCore = _dereq_(44);
|
|
755
|
+
var ReactTransitionEvents = _dereq_(26);
|
|
585
756
|
|
|
586
757
|
var onlyChild = _dereq_(38);
|
|
587
758
|
|
|
@@ -740,7 +911,7 @@ ReactCSSTransitionGroupChild.propTypes = {
|
|
|
740
911
|
|
|
741
912
|
|
|
742
913
|
module.exports = ReactCSSTransitionGroupChild;
|
|
743
|
-
},{"
|
|
914
|
+
},{"26":26,"38":38,"44":44,"5":5,"53":53,"6":6}],10:[function(_dereq_,module,exports){
|
|
744
915
|
/**
|
|
745
916
|
* Copyright 2013-present, Facebook, Inc.
|
|
746
917
|
* All rights reserved.
|
|
@@ -754,9 +925,9 @@ module.exports = ReactCSSTransitionGroupChild;
|
|
|
754
925
|
'use strict';
|
|
755
926
|
|
|
756
927
|
var PooledClass = _dereq_(4);
|
|
757
|
-
var ReactElement = _dereq_(
|
|
928
|
+
var ReactElement = _dereq_(15);
|
|
758
929
|
|
|
759
|
-
var emptyFunction = _dereq_(
|
|
930
|
+
var emptyFunction = _dereq_(46);
|
|
760
931
|
var traverseAllChildren = _dereq_(41);
|
|
761
932
|
|
|
762
933
|
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
@@ -931,945 +1102,104 @@ var ReactChildren = {
|
|
|
931
1102
|
};
|
|
932
1103
|
|
|
933
1104
|
module.exports = ReactChildren;
|
|
934
|
-
},{"
|
|
1105
|
+
},{"15":15,"4":4,"41":41,"46":46}],11:[function(_dereq_,module,exports){
|
|
935
1106
|
/**
|
|
936
|
-
* Copyright
|
|
1107
|
+
* Copyright 2016-present, Facebook, Inc.
|
|
937
1108
|
* All rights reserved.
|
|
938
1109
|
*
|
|
939
1110
|
* This source code is licensed under the BSD-style license found in the
|
|
940
1111
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
941
1112
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
942
1113
|
*
|
|
1114
|
+
*
|
|
943
1115
|
*/
|
|
944
1116
|
|
|
945
1117
|
'use strict';
|
|
946
1118
|
|
|
947
|
-
var _prodInvariant = _dereq_(39)
|
|
948
|
-
_assign = _dereq_(50);
|
|
949
|
-
|
|
950
|
-
var ReactComponent = _dereq_(11);
|
|
951
|
-
var ReactElement = _dereq_(16);
|
|
952
|
-
var ReactPropTypeLocationNames = _dereq_(22);
|
|
953
|
-
var ReactNoopUpdateQueue = _dereq_(21);
|
|
1119
|
+
var _prodInvariant = _dereq_(39);
|
|
954
1120
|
|
|
955
|
-
var
|
|
956
|
-
var invariant = _dereq_(47);
|
|
957
|
-
var warning = _dereq_(49);
|
|
1121
|
+
var ReactCurrentOwner = _dereq_(13);
|
|
958
1122
|
|
|
959
|
-
var
|
|
1123
|
+
var invariant = _dereq_(48);
|
|
1124
|
+
var warning = _dereq_(50);
|
|
960
1125
|
|
|
961
|
-
|
|
962
|
-
//
|
|
963
|
-
|
|
964
|
-
|
|
1126
|
+
function isNative(fn) {
|
|
1127
|
+
// Based on isNative() from Lodash
|
|
1128
|
+
var funcToString = Function.prototype.toString;
|
|
1129
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1130
|
+
var reIsNative = RegExp('^' + funcToString
|
|
1131
|
+
// Take an example native function source for comparison
|
|
1132
|
+
.call(hasOwnProperty
|
|
1133
|
+
// Strip regex characters so we can use it for regex
|
|
1134
|
+
).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
|
|
1135
|
+
// Remove hasOwnProperty from the template to make it generic
|
|
1136
|
+
).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
1137
|
+
try {
|
|
1138
|
+
var source = funcToString.call(fn);
|
|
1139
|
+
return reIsNative.test(source);
|
|
1140
|
+
} catch (err) {
|
|
1141
|
+
return false;
|
|
1142
|
+
}
|
|
965
1143
|
}
|
|
966
1144
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1145
|
+
var canUseCollections =
|
|
1146
|
+
// Array.from
|
|
1147
|
+
typeof Array.from === 'function' &&
|
|
1148
|
+
// Map
|
|
1149
|
+
typeof Map === 'function' && isNative(Map) &&
|
|
1150
|
+
// Map.prototype.keys
|
|
1151
|
+
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
|
1152
|
+
// Set
|
|
1153
|
+
typeof Set === 'function' && isNative(Set) &&
|
|
1154
|
+
// Set.prototype.keys
|
|
1155
|
+
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
|
973
1156
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
*
|
|
982
|
-
* var MyComponent = React.createClass({
|
|
983
|
-
* render: function() {
|
|
984
|
-
* return <div>Hello World</div>;
|
|
985
|
-
* }
|
|
986
|
-
* });
|
|
987
|
-
*
|
|
988
|
-
* The class specification supports a specific protocol of methods that have
|
|
989
|
-
* special meaning (e.g. `render`). See `ReactClassInterface` for
|
|
990
|
-
* more the comprehensive protocol. Any other properties and methods in the
|
|
991
|
-
* class specification will be available on the prototype.
|
|
992
|
-
*
|
|
993
|
-
* @interface ReactClassInterface
|
|
994
|
-
* @internal
|
|
995
|
-
*/
|
|
996
|
-
var ReactClassInterface = {
|
|
1157
|
+
var setItem;
|
|
1158
|
+
var getItem;
|
|
1159
|
+
var removeItem;
|
|
1160
|
+
var getItemIDs;
|
|
1161
|
+
var addRoot;
|
|
1162
|
+
var removeRoot;
|
|
1163
|
+
var getRootIDs;
|
|
997
1164
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
* @type {array}
|
|
1002
|
-
* @optional
|
|
1003
|
-
*/
|
|
1004
|
-
mixins: 'DEFINE_MANY',
|
|
1165
|
+
if (canUseCollections) {
|
|
1166
|
+
var itemMap = new Map();
|
|
1167
|
+
var rootIDSet = new Set();
|
|
1005
1168
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1169
|
+
setItem = function (id, item) {
|
|
1170
|
+
itemMap.set(id, item);
|
|
1171
|
+
};
|
|
1172
|
+
getItem = function (id) {
|
|
1173
|
+
return itemMap.get(id);
|
|
1174
|
+
};
|
|
1175
|
+
removeItem = function (id) {
|
|
1176
|
+
itemMap['delete'](id);
|
|
1177
|
+
};
|
|
1178
|
+
getItemIDs = function () {
|
|
1179
|
+
return Array.from(itemMap.keys());
|
|
1180
|
+
};
|
|
1014
1181
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1182
|
+
addRoot = function (id) {
|
|
1183
|
+
rootIDSet.add(id);
|
|
1184
|
+
};
|
|
1185
|
+
removeRoot = function (id) {
|
|
1186
|
+
rootIDSet['delete'](id);
|
|
1187
|
+
};
|
|
1188
|
+
getRootIDs = function () {
|
|
1189
|
+
return Array.from(rootIDSet.keys());
|
|
1190
|
+
};
|
|
1191
|
+
} else {
|
|
1192
|
+
var itemByKey = {};
|
|
1193
|
+
var rootByKey = {};
|
|
1022
1194
|
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
* Definition of context types this component sets for its children.
|
|
1033
|
-
*
|
|
1034
|
-
* @type {object}
|
|
1035
|
-
* @optional
|
|
1036
|
-
*/
|
|
1037
|
-
childContextTypes: 'DEFINE_MANY',
|
|
1038
|
-
|
|
1039
|
-
// ==== Definition methods ====
|
|
1040
|
-
|
|
1041
|
-
/**
|
|
1042
|
-
* Invoked when the component is mounted. Values in the mapping will be set on
|
|
1043
|
-
* `this.props` if that prop is not specified (i.e. using an `in` check).
|
|
1044
|
-
*
|
|
1045
|
-
* This method is invoked before `getInitialState` and therefore cannot rely
|
|
1046
|
-
* on `this.state` or use `this.setState`.
|
|
1047
|
-
*
|
|
1048
|
-
* @return {object}
|
|
1049
|
-
* @optional
|
|
1050
|
-
*/
|
|
1051
|
-
getDefaultProps: 'DEFINE_MANY_MERGED',
|
|
1052
|
-
|
|
1053
|
-
/**
|
|
1054
|
-
* Invoked once before the component is mounted. The return value will be used
|
|
1055
|
-
* as the initial value of `this.state`.
|
|
1056
|
-
*
|
|
1057
|
-
* getInitialState: function() {
|
|
1058
|
-
* return {
|
|
1059
|
-
* isOn: false,
|
|
1060
|
-
* fooBaz: new BazFoo()
|
|
1061
|
-
* }
|
|
1062
|
-
* }
|
|
1063
|
-
*
|
|
1064
|
-
* @return {object}
|
|
1065
|
-
* @optional
|
|
1066
|
-
*/
|
|
1067
|
-
getInitialState: 'DEFINE_MANY_MERGED',
|
|
1068
|
-
|
|
1069
|
-
/**
|
|
1070
|
-
* @return {object}
|
|
1071
|
-
* @optional
|
|
1072
|
-
*/
|
|
1073
|
-
getChildContext: 'DEFINE_MANY_MERGED',
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* Uses props from `this.props` and state from `this.state` to render the
|
|
1077
|
-
* structure of the component.
|
|
1078
|
-
*
|
|
1079
|
-
* No guarantees are made about when or how often this method is invoked, so
|
|
1080
|
-
* it must not have side effects.
|
|
1081
|
-
*
|
|
1082
|
-
* render: function() {
|
|
1083
|
-
* var name = this.props.name;
|
|
1084
|
-
* return <div>Hello, {name}!</div>;
|
|
1085
|
-
* }
|
|
1086
|
-
*
|
|
1087
|
-
* @return {ReactComponent}
|
|
1088
|
-
* @required
|
|
1089
|
-
*/
|
|
1090
|
-
render: 'DEFINE_ONCE',
|
|
1091
|
-
|
|
1092
|
-
// ==== Delegate methods ====
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* Invoked when the component is initially created and about to be mounted.
|
|
1096
|
-
* This may have side effects, but any external subscriptions or data created
|
|
1097
|
-
* by this method must be cleaned up in `componentWillUnmount`.
|
|
1098
|
-
*
|
|
1099
|
-
* @optional
|
|
1100
|
-
*/
|
|
1101
|
-
componentWillMount: 'DEFINE_MANY',
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Invoked when the component has been mounted and has a DOM representation.
|
|
1105
|
-
* However, there is no guarantee that the DOM node is in the document.
|
|
1106
|
-
*
|
|
1107
|
-
* Use this as an opportunity to operate on the DOM when the component has
|
|
1108
|
-
* been mounted (initialized and rendered) for the first time.
|
|
1109
|
-
*
|
|
1110
|
-
* @param {DOMElement} rootNode DOM element representing the component.
|
|
1111
|
-
* @optional
|
|
1112
|
-
*/
|
|
1113
|
-
componentDidMount: 'DEFINE_MANY',
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
* Invoked before the component receives new props.
|
|
1117
|
-
*
|
|
1118
|
-
* Use this as an opportunity to react to a prop transition by updating the
|
|
1119
|
-
* state using `this.setState`. Current props are accessed via `this.props`.
|
|
1120
|
-
*
|
|
1121
|
-
* componentWillReceiveProps: function(nextProps, nextContext) {
|
|
1122
|
-
* this.setState({
|
|
1123
|
-
* likesIncreasing: nextProps.likeCount > this.props.likeCount
|
|
1124
|
-
* });
|
|
1125
|
-
* }
|
|
1126
|
-
*
|
|
1127
|
-
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
|
|
1128
|
-
* transition may cause a state change, but the opposite is not true. If you
|
|
1129
|
-
* need it, you are probably looking for `componentWillUpdate`.
|
|
1130
|
-
*
|
|
1131
|
-
* @param {object} nextProps
|
|
1132
|
-
* @optional
|
|
1133
|
-
*/
|
|
1134
|
-
componentWillReceiveProps: 'DEFINE_MANY',
|
|
1135
|
-
|
|
1136
|
-
/**
|
|
1137
|
-
* Invoked while deciding if the component should be updated as a result of
|
|
1138
|
-
* receiving new props, state and/or context.
|
|
1139
|
-
*
|
|
1140
|
-
* Use this as an opportunity to `return false` when you're certain that the
|
|
1141
|
-
* transition to the new props/state/context will not require a component
|
|
1142
|
-
* update.
|
|
1143
|
-
*
|
|
1144
|
-
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
|
|
1145
|
-
* return !equal(nextProps, this.props) ||
|
|
1146
|
-
* !equal(nextState, this.state) ||
|
|
1147
|
-
* !equal(nextContext, this.context);
|
|
1148
|
-
* }
|
|
1149
|
-
*
|
|
1150
|
-
* @param {object} nextProps
|
|
1151
|
-
* @param {?object} nextState
|
|
1152
|
-
* @param {?object} nextContext
|
|
1153
|
-
* @return {boolean} True if the component should update.
|
|
1154
|
-
* @optional
|
|
1155
|
-
*/
|
|
1156
|
-
shouldComponentUpdate: 'DEFINE_ONCE',
|
|
1157
|
-
|
|
1158
|
-
/**
|
|
1159
|
-
* Invoked when the component is about to update due to a transition from
|
|
1160
|
-
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
|
|
1161
|
-
* and `nextContext`.
|
|
1162
|
-
*
|
|
1163
|
-
* Use this as an opportunity to perform preparation before an update occurs.
|
|
1164
|
-
*
|
|
1165
|
-
* NOTE: You **cannot** use `this.setState()` in this method.
|
|
1166
|
-
*
|
|
1167
|
-
* @param {object} nextProps
|
|
1168
|
-
* @param {?object} nextState
|
|
1169
|
-
* @param {?object} nextContext
|
|
1170
|
-
* @param {ReactReconcileTransaction} transaction
|
|
1171
|
-
* @optional
|
|
1172
|
-
*/
|
|
1173
|
-
componentWillUpdate: 'DEFINE_MANY',
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* Invoked when the component's DOM representation has been updated.
|
|
1177
|
-
*
|
|
1178
|
-
* Use this as an opportunity to operate on the DOM when the component has
|
|
1179
|
-
* been updated.
|
|
1180
|
-
*
|
|
1181
|
-
* @param {object} prevProps
|
|
1182
|
-
* @param {?object} prevState
|
|
1183
|
-
* @param {?object} prevContext
|
|
1184
|
-
* @param {DOMElement} rootNode DOM element representing the component.
|
|
1185
|
-
* @optional
|
|
1186
|
-
*/
|
|
1187
|
-
componentDidUpdate: 'DEFINE_MANY',
|
|
1188
|
-
|
|
1189
|
-
/**
|
|
1190
|
-
* Invoked when the component is about to be removed from its parent and have
|
|
1191
|
-
* its DOM representation destroyed.
|
|
1192
|
-
*
|
|
1193
|
-
* Use this as an opportunity to deallocate any external resources.
|
|
1194
|
-
*
|
|
1195
|
-
* NOTE: There is no `componentDidUnmount` since your component will have been
|
|
1196
|
-
* destroyed by that point.
|
|
1197
|
-
*
|
|
1198
|
-
* @optional
|
|
1199
|
-
*/
|
|
1200
|
-
componentWillUnmount: 'DEFINE_MANY',
|
|
1201
|
-
|
|
1202
|
-
// ==== Advanced methods ====
|
|
1203
|
-
|
|
1204
|
-
/**
|
|
1205
|
-
* Updates the component's currently mounted DOM representation.
|
|
1206
|
-
*
|
|
1207
|
-
* By default, this implements React's rendering and reconciliation algorithm.
|
|
1208
|
-
* Sophisticated clients may wish to override this.
|
|
1209
|
-
*
|
|
1210
|
-
* @param {ReactReconcileTransaction} transaction
|
|
1211
|
-
* @internal
|
|
1212
|
-
* @overridable
|
|
1213
|
-
*/
|
|
1214
|
-
updateComponent: 'OVERRIDE_BASE'
|
|
1215
|
-
|
|
1216
|
-
};
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* Mapping from class specification keys to special processing functions.
|
|
1220
|
-
*
|
|
1221
|
-
* Although these are declared like instance properties in the specification
|
|
1222
|
-
* when defining classes using `React.createClass`, they are actually static
|
|
1223
|
-
* and are accessible on the constructor instead of the prototype. Despite
|
|
1224
|
-
* being static, they must be defined outside of the "statics" key under
|
|
1225
|
-
* which all other static methods are defined.
|
|
1226
|
-
*/
|
|
1227
|
-
var RESERVED_SPEC_KEYS = {
|
|
1228
|
-
displayName: function (Constructor, displayName) {
|
|
1229
|
-
Constructor.displayName = displayName;
|
|
1230
|
-
},
|
|
1231
|
-
mixins: function (Constructor, mixins) {
|
|
1232
|
-
if (mixins) {
|
|
1233
|
-
for (var i = 0; i < mixins.length; i++) {
|
|
1234
|
-
mixSpecIntoComponent(Constructor, mixins[i]);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
},
|
|
1238
|
-
childContextTypes: function (Constructor, childContextTypes) {
|
|
1239
|
-
if ("development" !== 'production') {
|
|
1240
|
-
validateTypeDef(Constructor, childContextTypes, 'childContext');
|
|
1241
|
-
}
|
|
1242
|
-
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
|
1243
|
-
},
|
|
1244
|
-
contextTypes: function (Constructor, contextTypes) {
|
|
1245
|
-
if ("development" !== 'production') {
|
|
1246
|
-
validateTypeDef(Constructor, contextTypes, 'context');
|
|
1247
|
-
}
|
|
1248
|
-
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
|
|
1249
|
-
},
|
|
1250
|
-
/**
|
|
1251
|
-
* Special case getDefaultProps which should move into statics but requires
|
|
1252
|
-
* automatic merging.
|
|
1253
|
-
*/
|
|
1254
|
-
getDefaultProps: function (Constructor, getDefaultProps) {
|
|
1255
|
-
if (Constructor.getDefaultProps) {
|
|
1256
|
-
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
|
|
1257
|
-
} else {
|
|
1258
|
-
Constructor.getDefaultProps = getDefaultProps;
|
|
1259
|
-
}
|
|
1260
|
-
},
|
|
1261
|
-
propTypes: function (Constructor, propTypes) {
|
|
1262
|
-
if ("development" !== 'production') {
|
|
1263
|
-
validateTypeDef(Constructor, propTypes, 'prop');
|
|
1264
|
-
}
|
|
1265
|
-
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
|
1266
|
-
},
|
|
1267
|
-
statics: function (Constructor, statics) {
|
|
1268
|
-
mixStaticSpecIntoComponent(Constructor, statics);
|
|
1269
|
-
},
|
|
1270
|
-
autobind: function () {} };
|
|
1271
|
-
|
|
1272
|
-
function validateTypeDef(Constructor, typeDef, location) {
|
|
1273
|
-
for (var propName in typeDef) {
|
|
1274
|
-
if (typeDef.hasOwnProperty(propName)) {
|
|
1275
|
-
// use a warning instead of an invariant so components
|
|
1276
|
-
// don't show up in prod but only in __DEV__
|
|
1277
|
-
"development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
function validateMethodOverride(isAlreadyDefined, name) {
|
|
1283
|
-
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
|
|
1284
|
-
|
|
1285
|
-
// Disallow overriding of base class methods unless explicitly allowed.
|
|
1286
|
-
if (ReactClassMixin.hasOwnProperty(name)) {
|
|
1287
|
-
!(specPolicy === 'OVERRIDE_BASE') ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
// Disallow defining methods more than once unless explicitly allowed.
|
|
1291
|
-
if (isAlreadyDefined) {
|
|
1292
|
-
!(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
/**
|
|
1297
|
-
* Mixin helper which handles policy validation and reserved
|
|
1298
|
-
* specification keys when building React classes.
|
|
1299
|
-
*/
|
|
1300
|
-
function mixSpecIntoComponent(Constructor, spec) {
|
|
1301
|
-
if (!spec) {
|
|
1302
|
-
if ("development" !== 'production') {
|
|
1303
|
-
var typeofSpec = typeof spec;
|
|
1304
|
-
var isMixinValid = typeofSpec === 'object' && spec !== null;
|
|
1305
|
-
|
|
1306
|
-
"development" !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
return;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
!(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
|
|
1313
|
-
!!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
|
|
1314
|
-
|
|
1315
|
-
var proto = Constructor.prototype;
|
|
1316
|
-
var autoBindPairs = proto.__reactAutoBindPairs;
|
|
1317
|
-
|
|
1318
|
-
// By handling mixins before any other properties, we ensure the same
|
|
1319
|
-
// chaining order is applied to methods with DEFINE_MANY policy, whether
|
|
1320
|
-
// mixins are listed before or after these methods in the spec.
|
|
1321
|
-
if (spec.hasOwnProperty(MIXINS_KEY)) {
|
|
1322
|
-
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
for (var name in spec) {
|
|
1326
|
-
if (!spec.hasOwnProperty(name)) {
|
|
1327
|
-
continue;
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
|
-
if (name === MIXINS_KEY) {
|
|
1331
|
-
// We have already handled mixins in a special case above.
|
|
1332
|
-
continue;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
var property = spec[name];
|
|
1336
|
-
var isAlreadyDefined = proto.hasOwnProperty(name);
|
|
1337
|
-
validateMethodOverride(isAlreadyDefined, name);
|
|
1338
|
-
|
|
1339
|
-
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
|
1340
|
-
RESERVED_SPEC_KEYS[name](Constructor, property);
|
|
1341
|
-
} else {
|
|
1342
|
-
// Setup methods on prototype:
|
|
1343
|
-
// The following member methods should not be automatically bound:
|
|
1344
|
-
// 1. Expected ReactClass methods (in the "interface").
|
|
1345
|
-
// 2. Overridden methods (that were mixed in).
|
|
1346
|
-
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
|
1347
|
-
var isFunction = typeof property === 'function';
|
|
1348
|
-
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
|
|
1349
|
-
|
|
1350
|
-
if (shouldAutoBind) {
|
|
1351
|
-
autoBindPairs.push(name, property);
|
|
1352
|
-
proto[name] = property;
|
|
1353
|
-
} else {
|
|
1354
|
-
if (isAlreadyDefined) {
|
|
1355
|
-
var specPolicy = ReactClassInterface[name];
|
|
1356
|
-
|
|
1357
|
-
// These cases should already be caught by validateMethodOverride.
|
|
1358
|
-
!(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
|
|
1359
|
-
|
|
1360
|
-
// For methods which are defined more than once, call the existing
|
|
1361
|
-
// methods before calling the new property, merging if appropriate.
|
|
1362
|
-
if (specPolicy === 'DEFINE_MANY_MERGED') {
|
|
1363
|
-
proto[name] = createMergedResultFunction(proto[name], property);
|
|
1364
|
-
} else if (specPolicy === 'DEFINE_MANY') {
|
|
1365
|
-
proto[name] = createChainedFunction(proto[name], property);
|
|
1366
|
-
}
|
|
1367
|
-
} else {
|
|
1368
|
-
proto[name] = property;
|
|
1369
|
-
if ("development" !== 'production') {
|
|
1370
|
-
// Add verbose displayName to the function, which helps when looking
|
|
1371
|
-
// at profiling tools.
|
|
1372
|
-
if (typeof property === 'function' && spec.displayName) {
|
|
1373
|
-
proto[name].displayName = spec.displayName + '_' + name;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
function mixStaticSpecIntoComponent(Constructor, statics) {
|
|
1383
|
-
if (!statics) {
|
|
1384
|
-
return;
|
|
1385
|
-
}
|
|
1386
|
-
for (var name in statics) {
|
|
1387
|
-
var property = statics[name];
|
|
1388
|
-
if (!statics.hasOwnProperty(name)) {
|
|
1389
|
-
continue;
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
var isReserved = name in RESERVED_SPEC_KEYS;
|
|
1393
|
-
!!isReserved ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0;
|
|
1394
|
-
|
|
1395
|
-
var isInherited = name in Constructor;
|
|
1396
|
-
!!isInherited ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
|
|
1397
|
-
Constructor[name] = property;
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
/**
|
|
1402
|
-
* Merge two objects, but throw if both contain the same key.
|
|
1403
|
-
*
|
|
1404
|
-
* @param {object} one The first object, which is mutated.
|
|
1405
|
-
* @param {object} two The second object
|
|
1406
|
-
* @return {object} one after it has been mutated to contain everything in two.
|
|
1407
|
-
*/
|
|
1408
|
-
function mergeIntoWithNoDuplicateKeys(one, two) {
|
|
1409
|
-
!(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
|
|
1410
|
-
|
|
1411
|
-
for (var key in two) {
|
|
1412
|
-
if (two.hasOwnProperty(key)) {
|
|
1413
|
-
!(one[key] === undefined) ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0;
|
|
1414
|
-
one[key] = two[key];
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
return one;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
/**
|
|
1421
|
-
* Creates a function that invokes two functions and merges their return values.
|
|
1422
|
-
*
|
|
1423
|
-
* @param {function} one Function to invoke first.
|
|
1424
|
-
* @param {function} two Function to invoke second.
|
|
1425
|
-
* @return {function} Function that invokes the two argument functions.
|
|
1426
|
-
* @private
|
|
1427
|
-
*/
|
|
1428
|
-
function createMergedResultFunction(one, two) {
|
|
1429
|
-
return function mergedResult() {
|
|
1430
|
-
var a = one.apply(this, arguments);
|
|
1431
|
-
var b = two.apply(this, arguments);
|
|
1432
|
-
if (a == null) {
|
|
1433
|
-
return b;
|
|
1434
|
-
} else if (b == null) {
|
|
1435
|
-
return a;
|
|
1436
|
-
}
|
|
1437
|
-
var c = {};
|
|
1438
|
-
mergeIntoWithNoDuplicateKeys(c, a);
|
|
1439
|
-
mergeIntoWithNoDuplicateKeys(c, b);
|
|
1440
|
-
return c;
|
|
1441
|
-
};
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
/**
|
|
1445
|
-
* Creates a function that invokes two functions and ignores their return vales.
|
|
1446
|
-
*
|
|
1447
|
-
* @param {function} one Function to invoke first.
|
|
1448
|
-
* @param {function} two Function to invoke second.
|
|
1449
|
-
* @return {function} Function that invokes the two argument functions.
|
|
1450
|
-
* @private
|
|
1451
|
-
*/
|
|
1452
|
-
function createChainedFunction(one, two) {
|
|
1453
|
-
return function chainedFunction() {
|
|
1454
|
-
one.apply(this, arguments);
|
|
1455
|
-
two.apply(this, arguments);
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
/**
|
|
1460
|
-
* Binds a method to the component.
|
|
1461
|
-
*
|
|
1462
|
-
* @param {object} component Component whose method is going to be bound.
|
|
1463
|
-
* @param {function} method Method to be bound.
|
|
1464
|
-
* @return {function} The bound method.
|
|
1465
|
-
*/
|
|
1466
|
-
function bindAutoBindMethod(component, method) {
|
|
1467
|
-
var boundMethod = method.bind(component);
|
|
1468
|
-
if ("development" !== 'production') {
|
|
1469
|
-
boundMethod.__reactBoundContext = component;
|
|
1470
|
-
boundMethod.__reactBoundMethod = method;
|
|
1471
|
-
boundMethod.__reactBoundArguments = null;
|
|
1472
|
-
var componentName = component.constructor.displayName;
|
|
1473
|
-
var _bind = boundMethod.bind;
|
|
1474
|
-
boundMethod.bind = function (newThis) {
|
|
1475
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1476
|
-
args[_key - 1] = arguments[_key];
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
// User is trying to bind() an autobound method; we effectively will
|
|
1480
|
-
// ignore the value of "this" that the user is trying to use, so
|
|
1481
|
-
// let's warn.
|
|
1482
|
-
if (newThis !== component && newThis !== null) {
|
|
1483
|
-
"development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
|
|
1484
|
-
} else if (!args.length) {
|
|
1485
|
-
"development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
|
|
1486
|
-
return boundMethod;
|
|
1487
|
-
}
|
|
1488
|
-
var reboundMethod = _bind.apply(boundMethod, arguments);
|
|
1489
|
-
reboundMethod.__reactBoundContext = component;
|
|
1490
|
-
reboundMethod.__reactBoundMethod = method;
|
|
1491
|
-
reboundMethod.__reactBoundArguments = args;
|
|
1492
|
-
return reboundMethod;
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1495
|
-
return boundMethod;
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
/**
|
|
1499
|
-
* Binds all auto-bound methods in a component.
|
|
1500
|
-
*
|
|
1501
|
-
* @param {object} component Component whose method is going to be bound.
|
|
1502
|
-
*/
|
|
1503
|
-
function bindAutoBindMethods(component) {
|
|
1504
|
-
var pairs = component.__reactAutoBindPairs;
|
|
1505
|
-
for (var i = 0; i < pairs.length; i += 2) {
|
|
1506
|
-
var autoBindKey = pairs[i];
|
|
1507
|
-
var method = pairs[i + 1];
|
|
1508
|
-
component[autoBindKey] = bindAutoBindMethod(component, method);
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Add more to the ReactClass base class. These are all legacy features and
|
|
1514
|
-
* therefore not already part of the modern ReactComponent.
|
|
1515
|
-
*/
|
|
1516
|
-
var ReactClassMixin = {
|
|
1517
|
-
|
|
1518
|
-
/**
|
|
1519
|
-
* TODO: This will be deprecated because state should always keep a consistent
|
|
1520
|
-
* type signature and the only use case for this, is to avoid that.
|
|
1521
|
-
*/
|
|
1522
|
-
replaceState: function (newState, callback) {
|
|
1523
|
-
this.updater.enqueueReplaceState(this, newState);
|
|
1524
|
-
if (callback) {
|
|
1525
|
-
this.updater.enqueueCallback(this, callback, 'replaceState');
|
|
1526
|
-
}
|
|
1527
|
-
},
|
|
1528
|
-
|
|
1529
|
-
/**
|
|
1530
|
-
* Checks whether or not this composite component is mounted.
|
|
1531
|
-
* @return {boolean} True if mounted, false otherwise.
|
|
1532
|
-
* @protected
|
|
1533
|
-
* @final
|
|
1534
|
-
*/
|
|
1535
|
-
isMounted: function () {
|
|
1536
|
-
return this.updater.isMounted(this);
|
|
1537
|
-
}
|
|
1538
|
-
};
|
|
1539
|
-
|
|
1540
|
-
var ReactClassComponent = function () {};
|
|
1541
|
-
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
|
1542
|
-
|
|
1543
|
-
var didWarnDeprecated = false;
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
* Module for creating composite components.
|
|
1547
|
-
*
|
|
1548
|
-
* @class ReactClass
|
|
1549
|
-
*/
|
|
1550
|
-
var ReactClass = {
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* Creates a composite component class given a class specification.
|
|
1554
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
|
|
1555
|
-
*
|
|
1556
|
-
* @param {object} spec Class specification (which must define `render`).
|
|
1557
|
-
* @return {function} Component constructor function.
|
|
1558
|
-
* @public
|
|
1559
|
-
*/
|
|
1560
|
-
createClass: function (spec) {
|
|
1561
|
-
if ("development" !== 'production') {
|
|
1562
|
-
"development" !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
|
|
1563
|
-
didWarnDeprecated = true;
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
// To keep our warnings more understandable, we'll use a little hack here to
|
|
1567
|
-
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
|
|
1568
|
-
// unnecessarily identify a class without displayName as 'Constructor'.
|
|
1569
|
-
var Constructor = identity(function (props, context, updater) {
|
|
1570
|
-
// This constructor gets overridden by mocks. The argument is used
|
|
1571
|
-
// by mocks to assert on what gets mounted.
|
|
1572
|
-
|
|
1573
|
-
if ("development" !== 'production') {
|
|
1574
|
-
"development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
// Wire up auto-binding
|
|
1578
|
-
if (this.__reactAutoBindPairs.length) {
|
|
1579
|
-
bindAutoBindMethods(this);
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
this.props = props;
|
|
1583
|
-
this.context = context;
|
|
1584
|
-
this.refs = emptyObject;
|
|
1585
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
1586
|
-
|
|
1587
|
-
this.state = null;
|
|
1588
|
-
|
|
1589
|
-
// ReactClasses doesn't have constructors. Instead, they use the
|
|
1590
|
-
// getInitialState and componentWillMount methods for initialization.
|
|
1591
|
-
|
|
1592
|
-
var initialState = this.getInitialState ? this.getInitialState() : null;
|
|
1593
|
-
if ("development" !== 'production') {
|
|
1594
|
-
// We allow auto-mocks to proceed as if they're returning null.
|
|
1595
|
-
if (initialState === undefined && this.getInitialState._isMockFunction) {
|
|
1596
|
-
// This is probably bad practice. Consider warning here and
|
|
1597
|
-
// deprecating this convenience.
|
|
1598
|
-
initialState = null;
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
|
|
1602
|
-
|
|
1603
|
-
this.state = initialState;
|
|
1604
|
-
});
|
|
1605
|
-
Constructor.prototype = new ReactClassComponent();
|
|
1606
|
-
Constructor.prototype.constructor = Constructor;
|
|
1607
|
-
Constructor.prototype.__reactAutoBindPairs = [];
|
|
1608
|
-
|
|
1609
|
-
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
|
1610
|
-
|
|
1611
|
-
mixSpecIntoComponent(Constructor, spec);
|
|
1612
|
-
|
|
1613
|
-
// Initialize the defaultProps property after all mixins have been merged.
|
|
1614
|
-
if (Constructor.getDefaultProps) {
|
|
1615
|
-
Constructor.defaultProps = Constructor.getDefaultProps();
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
if ("development" !== 'production') {
|
|
1619
|
-
// This is a tag to indicate that the use of these method names is ok,
|
|
1620
|
-
// since it's used with createClass. If it's not, then it's likely a
|
|
1621
|
-
// mistake so we'll warn you to use the static property, property
|
|
1622
|
-
// initializer or constructor respectively.
|
|
1623
|
-
if (Constructor.getDefaultProps) {
|
|
1624
|
-
Constructor.getDefaultProps.isReactClassApproved = {};
|
|
1625
|
-
}
|
|
1626
|
-
if (Constructor.prototype.getInitialState) {
|
|
1627
|
-
Constructor.prototype.getInitialState.isReactClassApproved = {};
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
!Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
|
|
1632
|
-
|
|
1633
|
-
if ("development" !== 'production') {
|
|
1634
|
-
"development" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
|
|
1635
|
-
"development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
// Reduce time spent doing lookups by setting these on the prototype.
|
|
1639
|
-
for (var methodName in ReactClassInterface) {
|
|
1640
|
-
if (!Constructor.prototype[methodName]) {
|
|
1641
|
-
Constructor.prototype[methodName] = null;
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
return Constructor;
|
|
1646
|
-
},
|
|
1647
|
-
|
|
1648
|
-
injection: {
|
|
1649
|
-
injectMixin: function (mixin) {
|
|
1650
|
-
injectedMixins.push(mixin);
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
module.exports = ReactClass;
|
|
1657
|
-
},{"11":11,"16":16,"21":21,"22":22,"39":39,"46":46,"47":47,"49":49,"50":50}],11:[function(_dereq_,module,exports){
|
|
1658
|
-
/**
|
|
1659
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
1660
|
-
* All rights reserved.
|
|
1661
|
-
*
|
|
1662
|
-
* This source code is licensed under the BSD-style license found in the
|
|
1663
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1664
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1665
|
-
*
|
|
1666
|
-
*/
|
|
1667
|
-
|
|
1668
|
-
'use strict';
|
|
1669
|
-
|
|
1670
|
-
var _prodInvariant = _dereq_(39);
|
|
1671
|
-
|
|
1672
|
-
var ReactNoopUpdateQueue = _dereq_(21);
|
|
1673
|
-
|
|
1674
|
-
var canDefineProperty = _dereq_(33);
|
|
1675
|
-
var emptyObject = _dereq_(46);
|
|
1676
|
-
var invariant = _dereq_(47);
|
|
1677
|
-
var warning = _dereq_(49);
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Base class helpers for the updating state of a component.
|
|
1681
|
-
*/
|
|
1682
|
-
function ReactComponent(props, context, updater) {
|
|
1683
|
-
this.props = props;
|
|
1684
|
-
this.context = context;
|
|
1685
|
-
this.refs = emptyObject;
|
|
1686
|
-
// We initialize the default updater but the real one gets injected by the
|
|
1687
|
-
// renderer.
|
|
1688
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
ReactComponent.prototype.isReactComponent = {};
|
|
1692
|
-
|
|
1693
|
-
/**
|
|
1694
|
-
* Sets a subset of the state. Always use this to mutate
|
|
1695
|
-
* state. You should treat `this.state` as immutable.
|
|
1696
|
-
*
|
|
1697
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
1698
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
1699
|
-
*
|
|
1700
|
-
* There is no guarantee that calls to `setState` will run synchronously,
|
|
1701
|
-
* as they may eventually be batched together. You can provide an optional
|
|
1702
|
-
* callback that will be executed when the call to setState is actually
|
|
1703
|
-
* completed.
|
|
1704
|
-
*
|
|
1705
|
-
* When a function is provided to setState, it will be called at some point in
|
|
1706
|
-
* the future (not synchronously). It will be called with the up to date
|
|
1707
|
-
* component arguments (state, props, context). These values can be different
|
|
1708
|
-
* from this.* because your function may be called after receiveProps but before
|
|
1709
|
-
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
1710
|
-
* assigned to this.
|
|
1711
|
-
*
|
|
1712
|
-
* @param {object|function} partialState Next partial state or function to
|
|
1713
|
-
* produce next partial state to be merged with current state.
|
|
1714
|
-
* @param {?function} callback Called after state is updated.
|
|
1715
|
-
* @final
|
|
1716
|
-
* @protected
|
|
1717
|
-
*/
|
|
1718
|
-
ReactComponent.prototype.setState = function (partialState, callback) {
|
|
1719
|
-
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
|
1720
|
-
this.updater.enqueueSetState(this, partialState);
|
|
1721
|
-
if (callback) {
|
|
1722
|
-
this.updater.enqueueCallback(this, callback, 'setState');
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* Forces an update. This should only be invoked when it is known with
|
|
1728
|
-
* certainty that we are **not** in a DOM transaction.
|
|
1729
|
-
*
|
|
1730
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
1731
|
-
* component's state has changed but `setState` was not called.
|
|
1732
|
-
*
|
|
1733
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
1734
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
1735
|
-
*
|
|
1736
|
-
* @param {?function} callback Called after update is complete.
|
|
1737
|
-
* @final
|
|
1738
|
-
* @protected
|
|
1739
|
-
*/
|
|
1740
|
-
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
1741
|
-
this.updater.enqueueForceUpdate(this);
|
|
1742
|
-
if (callback) {
|
|
1743
|
-
this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
|
1744
|
-
}
|
|
1745
|
-
};
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
1749
|
-
* we would like to deprecate them, we're not going to move them over to this
|
|
1750
|
-
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
1751
|
-
*/
|
|
1752
|
-
if ("development" !== 'production') {
|
|
1753
|
-
var deprecatedAPIs = {
|
|
1754
|
-
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
1755
|
-
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
1756
|
-
};
|
|
1757
|
-
var defineDeprecationWarning = function (methodName, info) {
|
|
1758
|
-
if (canDefineProperty) {
|
|
1759
|
-
Object.defineProperty(ReactComponent.prototype, methodName, {
|
|
1760
|
-
get: function () {
|
|
1761
|
-
"development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
|
|
1762
|
-
return undefined;
|
|
1763
|
-
}
|
|
1764
|
-
});
|
|
1765
|
-
}
|
|
1766
|
-
};
|
|
1767
|
-
for (var fnName in deprecatedAPIs) {
|
|
1768
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
1769
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
module.exports = ReactComponent;
|
|
1775
|
-
},{"21":21,"33":33,"39":39,"46":46,"47":47,"49":49}],12:[function(_dereq_,module,exports){
|
|
1776
|
-
/**
|
|
1777
|
-
* Copyright 2016-present, Facebook, Inc.
|
|
1778
|
-
* All rights reserved.
|
|
1779
|
-
*
|
|
1780
|
-
* This source code is licensed under the BSD-style license found in the
|
|
1781
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1782
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1785
|
-
*/
|
|
1786
|
-
|
|
1787
|
-
'use strict';
|
|
1788
|
-
|
|
1789
|
-
var _prodInvariant = _dereq_(39);
|
|
1790
|
-
|
|
1791
|
-
var ReactCurrentOwner = _dereq_(14);
|
|
1792
|
-
|
|
1793
|
-
var invariant = _dereq_(47);
|
|
1794
|
-
var warning = _dereq_(49);
|
|
1795
|
-
|
|
1796
|
-
function isNative(fn) {
|
|
1797
|
-
// Based on isNative() from Lodash
|
|
1798
|
-
var funcToString = Function.prototype.toString;
|
|
1799
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1800
|
-
var reIsNative = RegExp('^' + funcToString
|
|
1801
|
-
// Take an example native function source for comparison
|
|
1802
|
-
.call(hasOwnProperty)
|
|
1803
|
-
// Strip regex characters so we can use it for regex
|
|
1804
|
-
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
|
1805
|
-
// Remove hasOwnProperty from the template to make it generic
|
|
1806
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
1807
|
-
try {
|
|
1808
|
-
var source = funcToString.call(fn);
|
|
1809
|
-
return reIsNative.test(source);
|
|
1810
|
-
} catch (err) {
|
|
1811
|
-
return false;
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
var canUseCollections =
|
|
1816
|
-
// Array.from
|
|
1817
|
-
typeof Array.from === 'function' &&
|
|
1818
|
-
// Map
|
|
1819
|
-
typeof Map === 'function' && isNative(Map) &&
|
|
1820
|
-
// Map.prototype.keys
|
|
1821
|
-
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
|
1822
|
-
// Set
|
|
1823
|
-
typeof Set === 'function' && isNative(Set) &&
|
|
1824
|
-
// Set.prototype.keys
|
|
1825
|
-
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
|
1826
|
-
|
|
1827
|
-
var setItem;
|
|
1828
|
-
var getItem;
|
|
1829
|
-
var removeItem;
|
|
1830
|
-
var getItemIDs;
|
|
1831
|
-
var addRoot;
|
|
1832
|
-
var removeRoot;
|
|
1833
|
-
var getRootIDs;
|
|
1834
|
-
|
|
1835
|
-
if (canUseCollections) {
|
|
1836
|
-
var itemMap = new Map();
|
|
1837
|
-
var rootIDSet = new Set();
|
|
1838
|
-
|
|
1839
|
-
setItem = function (id, item) {
|
|
1840
|
-
itemMap.set(id, item);
|
|
1841
|
-
};
|
|
1842
|
-
getItem = function (id) {
|
|
1843
|
-
return itemMap.get(id);
|
|
1844
|
-
};
|
|
1845
|
-
removeItem = function (id) {
|
|
1846
|
-
itemMap['delete'](id);
|
|
1847
|
-
};
|
|
1848
|
-
getItemIDs = function () {
|
|
1849
|
-
return Array.from(itemMap.keys());
|
|
1850
|
-
};
|
|
1851
|
-
|
|
1852
|
-
addRoot = function (id) {
|
|
1853
|
-
rootIDSet.add(id);
|
|
1854
|
-
};
|
|
1855
|
-
removeRoot = function (id) {
|
|
1856
|
-
rootIDSet['delete'](id);
|
|
1857
|
-
};
|
|
1858
|
-
getRootIDs = function () {
|
|
1859
|
-
return Array.from(rootIDSet.keys());
|
|
1860
|
-
};
|
|
1861
|
-
} else {
|
|
1862
|
-
var itemByKey = {};
|
|
1863
|
-
var rootByKey = {};
|
|
1864
|
-
|
|
1865
|
-
// Use non-numeric keys to prevent V8 performance issues:
|
|
1866
|
-
// https://github.com/facebook/react/pull/7232
|
|
1867
|
-
var getKeyFromID = function (id) {
|
|
1868
|
-
return '.' + id;
|
|
1869
|
-
};
|
|
1870
|
-
var getIDFromKey = function (key) {
|
|
1871
|
-
return parseInt(key.substr(1), 10);
|
|
1872
|
-
};
|
|
1195
|
+
// Use non-numeric keys to prevent V8 performance issues:
|
|
1196
|
+
// https://github.com/facebook/react/pull/7232
|
|
1197
|
+
var getKeyFromID = function (id) {
|
|
1198
|
+
return '.' + id;
|
|
1199
|
+
};
|
|
1200
|
+
var getIDFromKey = function (key) {
|
|
1201
|
+
return parseInt(key.substr(1), 10);
|
|
1202
|
+
};
|
|
1873
1203
|
|
|
1874
1204
|
setItem = function (id, item) {
|
|
1875
1205
|
var key = getKeyFromID(id);
|
|
@@ -2102,11 +1432,56 @@ var ReactComponentTreeHook = {
|
|
|
2102
1432
|
|
|
2103
1433
|
|
|
2104
1434
|
getRootIDs: getRootIDs,
|
|
2105
|
-
getRegisteredIDs: getItemIDs
|
|
1435
|
+
getRegisteredIDs: getItemIDs,
|
|
1436
|
+
|
|
1437
|
+
pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
|
|
1438
|
+
if (typeof console.reactStack !== 'function') {
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
var stack = [];
|
|
1443
|
+
var currentOwner = ReactCurrentOwner.current;
|
|
1444
|
+
var id = currentOwner && currentOwner._debugID;
|
|
1445
|
+
|
|
1446
|
+
try {
|
|
1447
|
+
if (isCreatingElement) {
|
|
1448
|
+
stack.push({
|
|
1449
|
+
name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
|
|
1450
|
+
fileName: currentSource ? currentSource.fileName : null,
|
|
1451
|
+
lineNumber: currentSource ? currentSource.lineNumber : null
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
while (id) {
|
|
1456
|
+
var element = ReactComponentTreeHook.getElement(id);
|
|
1457
|
+
var parentID = ReactComponentTreeHook.getParentID(id);
|
|
1458
|
+
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
1459
|
+
var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
|
|
1460
|
+
var source = element && element._source;
|
|
1461
|
+
stack.push({
|
|
1462
|
+
name: ownerName,
|
|
1463
|
+
fileName: source ? source.fileName : null,
|
|
1464
|
+
lineNumber: source ? source.lineNumber : null
|
|
1465
|
+
});
|
|
1466
|
+
id = parentID;
|
|
1467
|
+
}
|
|
1468
|
+
} catch (err) {
|
|
1469
|
+
// Internal state is messed up.
|
|
1470
|
+
// Stop building the stack (it's just a nice to have).
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
console.reactStack(stack);
|
|
1474
|
+
},
|
|
1475
|
+
popNonStandardWarningStack: function () {
|
|
1476
|
+
if (typeof console.reactStackEnd !== 'function') {
|
|
1477
|
+
return;
|
|
1478
|
+
}
|
|
1479
|
+
console.reactStackEnd();
|
|
1480
|
+
}
|
|
2106
1481
|
};
|
|
2107
1482
|
|
|
2108
1483
|
module.exports = ReactComponentTreeHook;
|
|
2109
|
-
},{"
|
|
1484
|
+
},{"13":13,"39":39,"48":48,"50":50}],12:[function(_dereq_,module,exports){
|
|
2110
1485
|
/**
|
|
2111
1486
|
* Copyright 2013-present, Facebook, Inc.
|
|
2112
1487
|
* All rights reserved.
|
|
@@ -2154,7 +1529,7 @@ var ReactComponentWithPureRenderMixin = {
|
|
|
2154
1529
|
};
|
|
2155
1530
|
|
|
2156
1531
|
module.exports = ReactComponentWithPureRenderMixin;
|
|
2157
|
-
},{"40":40}],
|
|
1532
|
+
},{"40":40}],13:[function(_dereq_,module,exports){
|
|
2158
1533
|
/**
|
|
2159
1534
|
* Copyright 2013-present, Facebook, Inc.
|
|
2160
1535
|
* All rights reserved.
|
|
@@ -2175,17 +1550,15 @@ module.exports = ReactComponentWithPureRenderMixin;
|
|
|
2175
1550
|
* currently being constructed.
|
|
2176
1551
|
*/
|
|
2177
1552
|
var ReactCurrentOwner = {
|
|
2178
|
-
|
|
2179
1553
|
/**
|
|
2180
1554
|
* @internal
|
|
2181
1555
|
* @type {ReactComponent}
|
|
2182
1556
|
*/
|
|
2183
1557
|
current: null
|
|
2184
|
-
|
|
2185
1558
|
};
|
|
2186
1559
|
|
|
2187
1560
|
module.exports = ReactCurrentOwner;
|
|
2188
|
-
},{}],
|
|
1561
|
+
},{}],14:[function(_dereq_,module,exports){
|
|
2189
1562
|
/**
|
|
2190
1563
|
* Copyright 2013-present, Facebook, Inc.
|
|
2191
1564
|
* All rights reserved.
|
|
@@ -2198,7 +1571,7 @@ module.exports = ReactCurrentOwner;
|
|
|
2198
1571
|
|
|
2199
1572
|
'use strict';
|
|
2200
1573
|
|
|
2201
|
-
var ReactElement = _dereq_(
|
|
1574
|
+
var ReactElement = _dereq_(15);
|
|
2202
1575
|
|
|
2203
1576
|
/**
|
|
2204
1577
|
* Create a factory that creates HTML tag elements.
|
|
@@ -2207,13 +1580,12 @@ var ReactElement = _dereq_(16);
|
|
|
2207
1580
|
*/
|
|
2208
1581
|
var createDOMFactory = ReactElement.createFactory;
|
|
2209
1582
|
if ("development" !== 'production') {
|
|
2210
|
-
var ReactElementValidator = _dereq_(
|
|
1583
|
+
var ReactElementValidator = _dereq_(17);
|
|
2211
1584
|
createDOMFactory = ReactElementValidator.createFactory;
|
|
2212
1585
|
}
|
|
2213
1586
|
|
|
2214
1587
|
/**
|
|
2215
1588
|
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
|
|
2216
|
-
* This is also accessible via `React.DOM`.
|
|
2217
1589
|
*
|
|
2218
1590
|
* @public
|
|
2219
1591
|
*/
|
|
@@ -2355,7 +1727,7 @@ var ReactDOMFactories = {
|
|
|
2355
1727
|
};
|
|
2356
1728
|
|
|
2357
1729
|
module.exports = ReactDOMFactories;
|
|
2358
|
-
},{"
|
|
1730
|
+
},{"15":15,"17":17}],15:[function(_dereq_,module,exports){
|
|
2359
1731
|
/**
|
|
2360
1732
|
* Copyright 2014-present, Facebook, Inc.
|
|
2361
1733
|
* All rights reserved.
|
|
@@ -2368,15 +1740,15 @@ module.exports = ReactDOMFactories;
|
|
|
2368
1740
|
|
|
2369
1741
|
'use strict';
|
|
2370
1742
|
|
|
2371
|
-
var _assign = _dereq_(
|
|
1743
|
+
var _assign = _dereq_(51);
|
|
2372
1744
|
|
|
2373
|
-
var ReactCurrentOwner = _dereq_(
|
|
1745
|
+
var ReactCurrentOwner = _dereq_(13);
|
|
2374
1746
|
|
|
2375
|
-
var warning = _dereq_(
|
|
2376
|
-
var canDefineProperty = _dereq_(
|
|
1747
|
+
var warning = _dereq_(50);
|
|
1748
|
+
var canDefineProperty = _dereq_(31);
|
|
2377
1749
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2378
1750
|
|
|
2379
|
-
var REACT_ELEMENT_TYPE = _dereq_(
|
|
1751
|
+
var REACT_ELEMENT_TYPE = _dereq_(16);
|
|
2380
1752
|
|
|
2381
1753
|
var RESERVED_PROPS = {
|
|
2382
1754
|
key: true,
|
|
@@ -2696,7 +2068,7 @@ ReactElement.isValidElement = function (object) {
|
|
|
2696
2068
|
};
|
|
2697
2069
|
|
|
2698
2070
|
module.exports = ReactElement;
|
|
2699
|
-
},{"
|
|
2071
|
+
},{"13":13,"16":16,"31":31,"50":50,"51":51}],16:[function(_dereq_,module,exports){
|
|
2700
2072
|
/**
|
|
2701
2073
|
* Copyright 2014-present, Facebook, Inc.
|
|
2702
2074
|
* All rights reserved.
|
|
@@ -2716,7 +2088,7 @@ module.exports = ReactElement;
|
|
|
2716
2088
|
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
2717
2089
|
|
|
2718
2090
|
module.exports = REACT_ELEMENT_TYPE;
|
|
2719
|
-
},{}],
|
|
2091
|
+
},{}],17:[function(_dereq_,module,exports){
|
|
2720
2092
|
/**
|
|
2721
2093
|
* Copyright 2014-present, Facebook, Inc.
|
|
2722
2094
|
* All rights reserved.
|
|
@@ -2736,15 +2108,16 @@ module.exports = REACT_ELEMENT_TYPE;
|
|
|
2736
2108
|
|
|
2737
2109
|
'use strict';
|
|
2738
2110
|
|
|
2739
|
-
var ReactCurrentOwner = _dereq_(
|
|
2740
|
-
var ReactComponentTreeHook = _dereq_(
|
|
2741
|
-
var ReactElement = _dereq_(
|
|
2111
|
+
var ReactCurrentOwner = _dereq_(13);
|
|
2112
|
+
var ReactComponentTreeHook = _dereq_(11);
|
|
2113
|
+
var ReactElement = _dereq_(15);
|
|
2742
2114
|
|
|
2743
|
-
var checkReactTypeSpec = _dereq_(
|
|
2115
|
+
var checkReactTypeSpec = _dereq_(32);
|
|
2744
2116
|
|
|
2745
|
-
var canDefineProperty = _dereq_(
|
|
2746
|
-
var getIteratorFn = _dereq_(
|
|
2747
|
-
var warning = _dereq_(
|
|
2117
|
+
var canDefineProperty = _dereq_(31);
|
|
2118
|
+
var getIteratorFn = _dereq_(35);
|
|
2119
|
+
var warning = _dereq_(50);
|
|
2120
|
+
var lowPriorityWarning = _dereq_(37);
|
|
2748
2121
|
|
|
2749
2122
|
function getDeclarationErrorAddendum() {
|
|
2750
2123
|
if (ReactCurrentOwner.current) {
|
|
@@ -2885,7 +2258,6 @@ function validatePropTypes(element) {
|
|
|
2885
2258
|
}
|
|
2886
2259
|
|
|
2887
2260
|
var ReactElementValidator = {
|
|
2888
|
-
|
|
2889
2261
|
createElement: function (type, props, children) {
|
|
2890
2262
|
var validType = typeof type === 'string' || typeof type === 'function';
|
|
2891
2263
|
// We warn in this case but don't throw. We expect the element creation to
|
|
@@ -2894,7 +2266,7 @@ var ReactElementValidator = {
|
|
|
2894
2266
|
if (typeof type !== 'function' && typeof type !== 'string') {
|
|
2895
2267
|
var info = '';
|
|
2896
2268
|
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2897
|
-
info += ' You likely forgot to export your component from the file ' +
|
|
2269
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
|
2898
2270
|
}
|
|
2899
2271
|
|
|
2900
2272
|
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
@@ -2906,7 +2278,10 @@ var ReactElementValidator = {
|
|
|
2906
2278
|
|
|
2907
2279
|
info += ReactComponentTreeHook.getCurrentStackAddendum();
|
|
2908
2280
|
|
|
2281
|
+
var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
|
|
2282
|
+
ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
|
|
2909
2283
|
"development" !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
|
|
2284
|
+
ReactComponentTreeHook.popNonStandardWarningStack();
|
|
2910
2285
|
}
|
|
2911
2286
|
}
|
|
2912
2287
|
|
|
@@ -2944,7 +2319,7 @@ var ReactElementValidator = {
|
|
|
2944
2319
|
Object.defineProperty(validatedFactory, 'type', {
|
|
2945
2320
|
enumerable: false,
|
|
2946
2321
|
get: function () {
|
|
2947
|
-
|
|
2322
|
+
lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
2948
2323
|
Object.defineProperty(this, 'type', {
|
|
2949
2324
|
value: type
|
|
2950
2325
|
});
|
|
@@ -2965,11 +2340,10 @@ var ReactElementValidator = {
|
|
|
2965
2340
|
validatePropTypes(newElement);
|
|
2966
2341
|
return newElement;
|
|
2967
2342
|
}
|
|
2968
|
-
|
|
2969
2343
|
};
|
|
2970
2344
|
|
|
2971
2345
|
module.exports = ReactElementValidator;
|
|
2972
|
-
},{"
|
|
2346
|
+
},{"11":11,"13":13,"15":15,"31":31,"32":32,"35":35,"37":37,"50":50}],18:[function(_dereq_,module,exports){
|
|
2973
2347
|
/**
|
|
2974
2348
|
* Copyright 2015-present, Facebook, Inc.
|
|
2975
2349
|
* All rights reserved.
|
|
@@ -2984,12 +2358,12 @@ module.exports = ReactElementValidator;
|
|
|
2984
2358
|
|
|
2985
2359
|
var _prodInvariant = _dereq_(39);
|
|
2986
2360
|
|
|
2987
|
-
var ReactChildren = _dereq_(
|
|
2988
|
-
var ReactElement = _dereq_(
|
|
2361
|
+
var ReactChildren = _dereq_(10);
|
|
2362
|
+
var ReactElement = _dereq_(15);
|
|
2989
2363
|
|
|
2990
|
-
var emptyFunction = _dereq_(
|
|
2991
|
-
var invariant = _dereq_(
|
|
2992
|
-
var warning = _dereq_(
|
|
2364
|
+
var emptyFunction = _dereq_(46);
|
|
2365
|
+
var invariant = _dereq_(48);
|
|
2366
|
+
var warning = _dereq_(50);
|
|
2993
2367
|
|
|
2994
2368
|
/**
|
|
2995
2369
|
* We used to allow keyed objects to serve as a collection of ReactElements,
|
|
@@ -3038,7 +2412,7 @@ var ReactFragment = {
|
|
|
3038
2412
|
};
|
|
3039
2413
|
|
|
3040
2414
|
module.exports = ReactFragment;
|
|
3041
|
-
},{"
|
|
2415
|
+
},{"10":10,"15":15,"39":39,"46":46,"48":48,"50":50}],19:[function(_dereq_,module,exports){
|
|
3042
2416
|
/**
|
|
3043
2417
|
* Copyright 2013-present, Facebook, Inc.
|
|
3044
2418
|
* All rights reserved.
|
|
@@ -3074,8 +2448,6 @@ module.exports = ReactFragment;
|
|
|
3074
2448
|
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
|
|
3075
2449
|
*/
|
|
3076
2450
|
|
|
3077
|
-
var React = _dereq_(5);
|
|
3078
|
-
|
|
3079
2451
|
/**
|
|
3080
2452
|
* Deprecated: An an easy way to express two-way binding with React.
|
|
3081
2453
|
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
|
|
@@ -3083,33 +2455,14 @@ var React = _dereq_(5);
|
|
|
3083
2455
|
* @param {*} value current value of the link
|
|
3084
2456
|
* @param {function} requestChange callback to request a change
|
|
3085
2457
|
*/
|
|
2458
|
+
|
|
3086
2459
|
function ReactLink(value, requestChange) {
|
|
3087
2460
|
this.value = value;
|
|
3088
2461
|
this.requestChange = requestChange;
|
|
3089
2462
|
}
|
|
3090
2463
|
|
|
3091
|
-
/**
|
|
3092
|
-
* Creates a PropType that enforces the ReactLink API and optionally checks the
|
|
3093
|
-
* type of the value being passed inside the link. Example:
|
|
3094
|
-
*
|
|
3095
|
-
* MyComponent.propTypes = {
|
|
3096
|
-
* tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
|
|
3097
|
-
* }
|
|
3098
|
-
*/
|
|
3099
|
-
function createLinkTypeChecker(linkType) {
|
|
3100
|
-
var shapes = {
|
|
3101
|
-
value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
|
|
3102
|
-
requestChange: React.PropTypes.func.isRequired
|
|
3103
|
-
};
|
|
3104
|
-
return React.PropTypes.shape(shapes);
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
ReactLink.PropTypes = {
|
|
3108
|
-
link: createLinkTypeChecker
|
|
3109
|
-
};
|
|
3110
|
-
|
|
3111
2464
|
module.exports = ReactLink;
|
|
3112
|
-
},{
|
|
2465
|
+
},{}],20:[function(_dereq_,module,exports){
|
|
3113
2466
|
/**
|
|
3114
2467
|
* Copyright 2015-present, Facebook, Inc.
|
|
3115
2468
|
* All rights reserved.
|
|
@@ -3122,7 +2475,7 @@ module.exports = ReactLink;
|
|
|
3122
2475
|
|
|
3123
2476
|
'use strict';
|
|
3124
2477
|
|
|
3125
|
-
var warning = _dereq_(
|
|
2478
|
+
var warning = _dereq_(50);
|
|
3126
2479
|
|
|
3127
2480
|
function warnNoop(publicInstance, callerName) {
|
|
3128
2481
|
if ("development" !== 'production') {
|
|
@@ -3135,7 +2488,6 @@ function warnNoop(publicInstance, callerName) {
|
|
|
3135
2488
|
* This is the abstract API for an update queue.
|
|
3136
2489
|
*/
|
|
3137
2490
|
var ReactNoopUpdateQueue = {
|
|
3138
|
-
|
|
3139
2491
|
/**
|
|
3140
2492
|
* Checks whether or not this composite component is mounted.
|
|
3141
2493
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
@@ -3205,7 +2557,7 @@ var ReactNoopUpdateQueue = {
|
|
|
3205
2557
|
};
|
|
3206
2558
|
|
|
3207
2559
|
module.exports = ReactNoopUpdateQueue;
|
|
3208
|
-
},{"
|
|
2560
|
+
},{"50":50}],21:[function(_dereq_,module,exports){
|
|
3209
2561
|
/**
|
|
3210
2562
|
* Copyright 2013-present, Facebook, Inc.
|
|
3211
2563
|
* All rights reserved.
|
|
@@ -3230,7 +2582,7 @@ if ("development" !== 'production') {
|
|
|
3230
2582
|
}
|
|
3231
2583
|
|
|
3232
2584
|
module.exports = ReactPropTypeLocationNames;
|
|
3233
|
-
},{}],
|
|
2585
|
+
},{}],22:[function(_dereq_,module,exports){
|
|
3234
2586
|
/**
|
|
3235
2587
|
* Copyright 2013-present, Facebook, Inc.
|
|
3236
2588
|
* All rights reserved.
|
|
@@ -3243,13 +2595,13 @@ module.exports = ReactPropTypeLocationNames;
|
|
|
3243
2595
|
|
|
3244
2596
|
'use strict';
|
|
3245
2597
|
|
|
3246
|
-
var _require = _dereq_(
|
|
2598
|
+
var _require = _dereq_(15),
|
|
3247
2599
|
isValidElement = _require.isValidElement;
|
|
3248
2600
|
|
|
3249
|
-
var factory = _dereq_(
|
|
2601
|
+
var factory = _dereq_(53);
|
|
3250
2602
|
|
|
3251
2603
|
module.exports = factory(isValidElement);
|
|
3252
|
-
},{"
|
|
2604
|
+
},{"15":15,"53":53}],23:[function(_dereq_,module,exports){
|
|
3253
2605
|
/**
|
|
3254
2606
|
* Copyright 2013-present, Facebook, Inc.
|
|
3255
2607
|
* All rights reserved.
|
|
@@ -3266,49 +2618,7 @@ module.exports = factory(isValidElement);
|
|
|
3266
2618
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
3267
2619
|
|
|
3268
2620
|
module.exports = ReactPropTypesSecret;
|
|
3269
|
-
},{}],
|
|
3270
|
-
/**
|
|
3271
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3272
|
-
* All rights reserved.
|
|
3273
|
-
*
|
|
3274
|
-
* This source code is licensed under the BSD-style license found in the
|
|
3275
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3276
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3277
|
-
*
|
|
3278
|
-
*/
|
|
3279
|
-
|
|
3280
|
-
'use strict';
|
|
3281
|
-
|
|
3282
|
-
var _assign = _dereq_(50);
|
|
3283
|
-
|
|
3284
|
-
var ReactComponent = _dereq_(11);
|
|
3285
|
-
var ReactNoopUpdateQueue = _dereq_(21);
|
|
3286
|
-
|
|
3287
|
-
var emptyObject = _dereq_(46);
|
|
3288
|
-
|
|
3289
|
-
/**
|
|
3290
|
-
* Base class helpers for the updating state of a component.
|
|
3291
|
-
*/
|
|
3292
|
-
function ReactPureComponent(props, context, updater) {
|
|
3293
|
-
// Duplicated from ReactComponent.
|
|
3294
|
-
this.props = props;
|
|
3295
|
-
this.context = context;
|
|
3296
|
-
this.refs = emptyObject;
|
|
3297
|
-
// We initialize the default updater but the real one gets injected by the
|
|
3298
|
-
// renderer.
|
|
3299
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
function ComponentDummy() {}
|
|
3303
|
-
ComponentDummy.prototype = ReactComponent.prototype;
|
|
3304
|
-
ReactPureComponent.prototype = new ComponentDummy();
|
|
3305
|
-
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
|
3306
|
-
// Avoid an extra prototype jump for these methods.
|
|
3307
|
-
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
|
3308
|
-
ReactPureComponent.prototype.isPureReactComponent = true;
|
|
3309
|
-
|
|
3310
|
-
module.exports = ReactPureComponent;
|
|
3311
|
-
},{"11":11,"21":21,"46":46,"50":50}],26:[function(_dereq_,module,exports){
|
|
2621
|
+
},{}],24:[function(_dereq_,module,exports){
|
|
3312
2622
|
/**
|
|
3313
2623
|
* Copyright 2013-present, Facebook, Inc.
|
|
3314
2624
|
* All rights reserved.
|
|
@@ -3412,7 +2722,7 @@ ReactStateSetters.Mixin = {
|
|
|
3412
2722
|
};
|
|
3413
2723
|
|
|
3414
2724
|
module.exports = ReactStateSetters;
|
|
3415
|
-
},{}],
|
|
2725
|
+
},{}],25:[function(_dereq_,module,exports){
|
|
3416
2726
|
/**
|
|
3417
2727
|
* Copyright 2013-present, Facebook, Inc.
|
|
3418
2728
|
* All rights reserved.
|
|
@@ -3425,7 +2735,7 @@ module.exports = ReactStateSetters;
|
|
|
3425
2735
|
|
|
3426
2736
|
'use strict';
|
|
3427
2737
|
|
|
3428
|
-
var flattenChildren = _dereq_(
|
|
2738
|
+
var flattenChildren = _dereq_(34);
|
|
3429
2739
|
|
|
3430
2740
|
var ReactTransitionChildMapping = {
|
|
3431
2741
|
/**
|
|
@@ -3515,7 +2825,7 @@ var ReactTransitionChildMapping = {
|
|
|
3515
2825
|
};
|
|
3516
2826
|
|
|
3517
2827
|
module.exports = ReactTransitionChildMapping;
|
|
3518
|
-
},{"
|
|
2828
|
+
},{"34":34}],26:[function(_dereq_,module,exports){
|
|
3519
2829
|
/**
|
|
3520
2830
|
* Copyright 2013-present, Facebook, Inc.
|
|
3521
2831
|
* All rights reserved.
|
|
@@ -3528,7 +2838,7 @@ module.exports = ReactTransitionChildMapping;
|
|
|
3528
2838
|
|
|
3529
2839
|
'use strict';
|
|
3530
2840
|
|
|
3531
|
-
var ExecutionEnvironment = _dereq_(
|
|
2841
|
+
var ExecutionEnvironment = _dereq_(45);
|
|
3532
2842
|
|
|
3533
2843
|
var getVendorPrefixedEventName = _dereq_(1);
|
|
3534
2844
|
|
|
@@ -3588,7 +2898,7 @@ var ReactTransitionEvents = {
|
|
|
3588
2898
|
};
|
|
3589
2899
|
|
|
3590
2900
|
module.exports = ReactTransitionEvents;
|
|
3591
|
-
},{"1":1,"
|
|
2901
|
+
},{"1":1,"45":45}],27:[function(_dereq_,module,exports){
|
|
3592
2902
|
/**
|
|
3593
2903
|
* Copyright 2013-present, Facebook, Inc.
|
|
3594
2904
|
* All rights reserved.
|
|
@@ -3601,7 +2911,7 @@ module.exports = ReactTransitionEvents;
|
|
|
3601
2911
|
|
|
3602
2912
|
'use strict';
|
|
3603
2913
|
|
|
3604
|
-
var _assign = _dereq_(
|
|
2914
|
+
var _assign = _dereq_(51);
|
|
3605
2915
|
|
|
3606
2916
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3607
2917
|
|
|
@@ -3610,12 +2920,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
3610
2920
|
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; }
|
|
3611
2921
|
|
|
3612
2922
|
var React = _dereq_(5);
|
|
3613
|
-
var ReactTransitionChildMapping = _dereq_(
|
|
2923
|
+
var ReactTransitionChildMapping = _dereq_(25);
|
|
3614
2924
|
|
|
3615
|
-
var propTypesFactory = _dereq_(
|
|
2925
|
+
var propTypesFactory = _dereq_(53);
|
|
3616
2926
|
var PropTypes = propTypesFactory(React.isValidElement);
|
|
3617
2927
|
|
|
3618
|
-
var emptyFunction = _dereq_(
|
|
2928
|
+
var emptyFunction = _dereq_(46);
|
|
3619
2929
|
|
|
3620
2930
|
/**
|
|
3621
2931
|
* A basis for animations. When children are declaratively added or removed,
|
|
@@ -3786,7 +3096,10 @@ var ReactTransitionGroup = function (_React$Component) {
|
|
|
3786
3096
|
// already been removed. In case you need this behavior you can provide
|
|
3787
3097
|
// a childFactory function to wrap every child, even the ones that are
|
|
3788
3098
|
// leaving.
|
|
3789
|
-
childrenToRender.push(React.cloneElement(this.props.childFactory(child), {
|
|
3099
|
+
childrenToRender.push(React.cloneElement(this.props.childFactory(child), {
|
|
3100
|
+
ref: key,
|
|
3101
|
+
key: key
|
|
3102
|
+
}));
|
|
3790
3103
|
}
|
|
3791
3104
|
}
|
|
3792
3105
|
|
|
@@ -3820,7 +3133,7 @@ ReactTransitionGroup.defaultProps = {
|
|
|
3820
3133
|
|
|
3821
3134
|
|
|
3822
3135
|
module.exports = ReactTransitionGroup;
|
|
3823
|
-
},{"
|
|
3136
|
+
},{"25":25,"46":46,"5":5,"51":51,"53":53}],28:[function(_dereq_,module,exports){
|
|
3824
3137
|
/**
|
|
3825
3138
|
* Copyright 2013-present, Facebook, Inc.
|
|
3826
3139
|
* All rights reserved.
|
|
@@ -3833,8 +3146,8 @@ module.exports = ReactTransitionGroup;
|
|
|
3833
3146
|
|
|
3834
3147
|
'use strict';
|
|
3835
3148
|
|
|
3836
|
-
module.exports = '15.
|
|
3837
|
-
},{}],
|
|
3149
|
+
module.exports = '15.6.1';
|
|
3150
|
+
},{}],29:[function(_dereq_,module,exports){
|
|
3838
3151
|
/**
|
|
3839
3152
|
* Copyright 2013-present, Facebook, Inc.
|
|
3840
3153
|
* All rights reserved.
|
|
@@ -3850,10 +3163,10 @@ module.exports = '15.5.3';
|
|
|
3850
3163
|
var LinkedStateMixin = _dereq_(3);
|
|
3851
3164
|
var React = _dereq_(5);
|
|
3852
3165
|
var ReactAddonsDOMDependencies = _dereq_(6);
|
|
3853
|
-
var ReactComponentWithPureRenderMixin = _dereq_(
|
|
3854
|
-
var ReactCSSTransitionGroup = _dereq_(
|
|
3855
|
-
var ReactFragment = _dereq_(
|
|
3856
|
-
var ReactTransitionGroup = _dereq_(
|
|
3166
|
+
var ReactComponentWithPureRenderMixin = _dereq_(12);
|
|
3167
|
+
var ReactCSSTransitionGroup = _dereq_(8);
|
|
3168
|
+
var ReactFragment = _dereq_(18);
|
|
3169
|
+
var ReactTransitionGroup = _dereq_(27);
|
|
3857
3170
|
|
|
3858
3171
|
var shallowCompare = _dereq_(40);
|
|
3859
3172
|
var update = _dereq_(42);
|
|
@@ -3887,7 +3200,7 @@ if ("development" !== 'production') {
|
|
|
3887
3200
|
}
|
|
3888
3201
|
|
|
3889
3202
|
module.exports = React;
|
|
3890
|
-
},{"
|
|
3203
|
+
},{"12":12,"18":18,"27":27,"3":3,"40":40,"42":42,"5":5,"6":6,"8":8}],30:[function(_dereq_,module,exports){
|
|
3891
3204
|
/**
|
|
3892
3205
|
* Copyright 2013-present, Facebook, Inc.
|
|
3893
3206
|
* All rights reserved.
|
|
@@ -3900,28 +3213,28 @@ module.exports = React;
|
|
|
3900
3213
|
|
|
3901
3214
|
'use strict';
|
|
3902
3215
|
|
|
3903
|
-
var _assign = _dereq_(
|
|
3216
|
+
var _assign = _dereq_(51);
|
|
3904
3217
|
|
|
3905
|
-
var ReactWithAddons = _dereq_(
|
|
3218
|
+
var ReactWithAddons = _dereq_(29);
|
|
3906
3219
|
|
|
3907
3220
|
// `version` will be added here by the React module.
|
|
3908
3221
|
var ReactWithAddonsUMDEntry = _assign(ReactWithAddons, {
|
|
3909
3222
|
__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: null, // Will be injected by ReactDOM UMD build.
|
|
3910
3223
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
|
3911
|
-
ReactCurrentOwner: _dereq_(
|
|
3224
|
+
ReactCurrentOwner: _dereq_(13)
|
|
3912
3225
|
}
|
|
3913
3226
|
});
|
|
3914
3227
|
|
|
3915
3228
|
if ("development" !== 'production') {
|
|
3916
3229
|
_assign(ReactWithAddonsUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
|
|
3917
3230
|
// ReactComponentTreeHook should not be included in production.
|
|
3918
|
-
ReactComponentTreeHook: _dereq_(
|
|
3919
|
-
getNextDebugID: _dereq_(
|
|
3231
|
+
ReactComponentTreeHook: _dereq_(11),
|
|
3232
|
+
getNextDebugID: _dereq_(36)
|
|
3920
3233
|
});
|
|
3921
3234
|
}
|
|
3922
3235
|
|
|
3923
3236
|
module.exports = ReactWithAddonsUMDEntry;
|
|
3924
|
-
},{"
|
|
3237
|
+
},{"11":11,"13":13,"29":29,"36":36,"51":51}],31:[function(_dereq_,module,exports){
|
|
3925
3238
|
/**
|
|
3926
3239
|
* Copyright 2013-present, Facebook, Inc.
|
|
3927
3240
|
* All rights reserved.
|
|
@@ -3947,7 +3260,7 @@ if ("development" !== 'production') {
|
|
|
3947
3260
|
}
|
|
3948
3261
|
|
|
3949
3262
|
module.exports = canDefineProperty;
|
|
3950
|
-
},{}],
|
|
3263
|
+
},{}],32:[function(_dereq_,module,exports){
|
|
3951
3264
|
(function (process){
|
|
3952
3265
|
/**
|
|
3953
3266
|
* Copyright 2013-present, Facebook, Inc.
|
|
@@ -3963,11 +3276,11 @@ module.exports = canDefineProperty;
|
|
|
3963
3276
|
|
|
3964
3277
|
var _prodInvariant = _dereq_(39);
|
|
3965
3278
|
|
|
3966
|
-
var ReactPropTypeLocationNames = _dereq_(
|
|
3967
|
-
var ReactPropTypesSecret = _dereq_(
|
|
3279
|
+
var ReactPropTypeLocationNames = _dereq_(21);
|
|
3280
|
+
var ReactPropTypesSecret = _dereq_(23);
|
|
3968
3281
|
|
|
3969
|
-
var invariant = _dereq_(
|
|
3970
|
-
var warning = _dereq_(
|
|
3282
|
+
var invariant = _dereq_(48);
|
|
3283
|
+
var warning = _dereq_(50);
|
|
3971
3284
|
|
|
3972
3285
|
var ReactComponentTreeHook;
|
|
3973
3286
|
|
|
@@ -3977,7 +3290,7 @@ if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
|
|
3977
3290
|
// https://github.com/facebook/react/issues/7240
|
|
3978
3291
|
// Remove the inline requires when we don't need them anymore:
|
|
3979
3292
|
// https://github.com/facebook/react/pull/7178
|
|
3980
|
-
ReactComponentTreeHook = _dereq_(
|
|
3293
|
+
ReactComponentTreeHook = _dereq_(11);
|
|
3981
3294
|
}
|
|
3982
3295
|
|
|
3983
3296
|
var loggedTypeFailures = {};
|
|
@@ -4019,7 +3332,7 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
|
|
|
4019
3332
|
|
|
4020
3333
|
if ("development" !== 'production') {
|
|
4021
3334
|
if (!ReactComponentTreeHook) {
|
|
4022
|
-
ReactComponentTreeHook = _dereq_(
|
|
3335
|
+
ReactComponentTreeHook = _dereq_(11);
|
|
4023
3336
|
}
|
|
4024
3337
|
if (debugID !== null) {
|
|
4025
3338
|
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
|
|
@@ -4036,7 +3349,30 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
|
|
|
4036
3349
|
|
|
4037
3350
|
module.exports = checkReactTypeSpec;
|
|
4038
3351
|
}).call(this,undefined)
|
|
4039
|
-
},{"
|
|
3352
|
+
},{"11":11,"21":21,"23":23,"39":39,"48":48,"50":50}],33:[function(_dereq_,module,exports){
|
|
3353
|
+
/**
|
|
3354
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3355
|
+
* All rights reserved.
|
|
3356
|
+
*
|
|
3357
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3358
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3359
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3360
|
+
*
|
|
3361
|
+
*/
|
|
3362
|
+
|
|
3363
|
+
'use strict';
|
|
3364
|
+
|
|
3365
|
+
var _require = _dereq_(7),
|
|
3366
|
+
Component = _require.Component;
|
|
3367
|
+
|
|
3368
|
+
var _require2 = _dereq_(15),
|
|
3369
|
+
isValidElement = _require2.isValidElement;
|
|
3370
|
+
|
|
3371
|
+
var ReactNoopUpdateQueue = _dereq_(20);
|
|
3372
|
+
var factory = _dereq_(43);
|
|
3373
|
+
|
|
3374
|
+
module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue);
|
|
3375
|
+
},{"15":15,"20":20,"43":43,"7":7}],34:[function(_dereq_,module,exports){
|
|
4040
3376
|
(function (process){
|
|
4041
3377
|
/**
|
|
4042
3378
|
* Copyright 2013-present, Facebook, Inc.
|
|
@@ -4053,7 +3389,7 @@ module.exports = checkReactTypeSpec;
|
|
|
4053
3389
|
|
|
4054
3390
|
var KeyEscapeUtils = _dereq_(2);
|
|
4055
3391
|
var traverseAllChildren = _dereq_(41);
|
|
4056
|
-
var warning = _dereq_(
|
|
3392
|
+
var warning = _dereq_(50);
|
|
4057
3393
|
|
|
4058
3394
|
var ReactComponentTreeHook;
|
|
4059
3395
|
|
|
@@ -4063,7 +3399,7 @@ if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
|
|
4063
3399
|
// https://github.com/facebook/react/issues/7240
|
|
4064
3400
|
// Remove the inline requires when we don't need them anymore:
|
|
4065
3401
|
// https://github.com/facebook/react/pull/7178
|
|
4066
|
-
ReactComponentTreeHook = _dereq_(
|
|
3402
|
+
ReactComponentTreeHook = _dereq_(11);
|
|
4067
3403
|
}
|
|
4068
3404
|
|
|
4069
3405
|
/**
|
|
@@ -4079,7 +3415,7 @@ function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID
|
|
|
4079
3415
|
var keyUnique = result[name] === undefined;
|
|
4080
3416
|
if ("development" !== 'production') {
|
|
4081
3417
|
if (!ReactComponentTreeHook) {
|
|
4082
|
-
ReactComponentTreeHook = _dereq_(
|
|
3418
|
+
ReactComponentTreeHook = _dereq_(11);
|
|
4083
3419
|
}
|
|
4084
3420
|
if (!keyUnique) {
|
|
4085
3421
|
"development" !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
|
|
@@ -4114,7 +3450,7 @@ function flattenChildren(children, selfDebugID) {
|
|
|
4114
3450
|
|
|
4115
3451
|
module.exports = flattenChildren;
|
|
4116
3452
|
}).call(this,undefined)
|
|
4117
|
-
},{"
|
|
3453
|
+
},{"11":11,"2":2,"41":41,"50":50}],35:[function(_dereq_,module,exports){
|
|
4118
3454
|
/**
|
|
4119
3455
|
* Copyright 2013-present, Facebook, Inc.
|
|
4120
3456
|
* All rights reserved.
|
|
@@ -4154,8 +3490,171 @@ function getIteratorFn(maybeIterable) {
|
|
|
4154
3490
|
}
|
|
4155
3491
|
}
|
|
4156
3492
|
|
|
4157
|
-
module.exports = getIteratorFn;
|
|
4158
|
-
},{}],
|
|
3493
|
+
module.exports = getIteratorFn;
|
|
3494
|
+
},{}],36:[function(_dereq_,module,exports){
|
|
3495
|
+
/**
|
|
3496
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3497
|
+
* All rights reserved.
|
|
3498
|
+
*
|
|
3499
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3500
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3501
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3502
|
+
*
|
|
3503
|
+
*
|
|
3504
|
+
*/
|
|
3505
|
+
|
|
3506
|
+
'use strict';
|
|
3507
|
+
|
|
3508
|
+
var nextDebugID = 1;
|
|
3509
|
+
|
|
3510
|
+
function getNextDebugID() {
|
|
3511
|
+
return nextDebugID++;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
module.exports = getNextDebugID;
|
|
3515
|
+
},{}],37:[function(_dereq_,module,exports){
|
|
3516
|
+
/**
|
|
3517
|
+
* Copyright 2014-2015, Facebook, Inc.
|
|
3518
|
+
* All rights reserved.
|
|
3519
|
+
*
|
|
3520
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3521
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3522
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3523
|
+
*
|
|
3524
|
+
*/
|
|
3525
|
+
|
|
3526
|
+
'use strict';
|
|
3527
|
+
|
|
3528
|
+
/**
|
|
3529
|
+
* Forked from fbjs/warning:
|
|
3530
|
+
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
3531
|
+
*
|
|
3532
|
+
* Only change is we use console.warn instead of console.error,
|
|
3533
|
+
* and do nothing when 'console' is not supported.
|
|
3534
|
+
* This really simplifies the code.
|
|
3535
|
+
* ---
|
|
3536
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
3537
|
+
* This can be used to log issues in development environments in critical
|
|
3538
|
+
* paths. Removing the logging code for production environments will keep the
|
|
3539
|
+
* same logic and follow the same code paths.
|
|
3540
|
+
*/
|
|
3541
|
+
|
|
3542
|
+
var lowPriorityWarning = function () {};
|
|
3543
|
+
|
|
3544
|
+
if ("development" !== 'production') {
|
|
3545
|
+
var printWarning = function (format) {
|
|
3546
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3547
|
+
args[_key - 1] = arguments[_key];
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
var argIndex = 0;
|
|
3551
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
3552
|
+
return args[argIndex++];
|
|
3553
|
+
});
|
|
3554
|
+
if (typeof console !== 'undefined') {
|
|
3555
|
+
console.warn(message);
|
|
3556
|
+
}
|
|
3557
|
+
try {
|
|
3558
|
+
// --- Welcome to debugging React ---
|
|
3559
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
3560
|
+
// to find the callsite that caused this warning to fire.
|
|
3561
|
+
throw new Error(message);
|
|
3562
|
+
} catch (x) {}
|
|
3563
|
+
};
|
|
3564
|
+
|
|
3565
|
+
lowPriorityWarning = function (condition, format) {
|
|
3566
|
+
if (format === undefined) {
|
|
3567
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
3568
|
+
}
|
|
3569
|
+
if (!condition) {
|
|
3570
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
3571
|
+
args[_key2 - 2] = arguments[_key2];
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
printWarning.apply(undefined, [format].concat(args));
|
|
3575
|
+
}
|
|
3576
|
+
};
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
module.exports = lowPriorityWarning;
|
|
3580
|
+
},{}],38:[function(_dereq_,module,exports){
|
|
3581
|
+
/**
|
|
3582
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3583
|
+
* All rights reserved.
|
|
3584
|
+
*
|
|
3585
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3586
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3587
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3588
|
+
*
|
|
3589
|
+
*/
|
|
3590
|
+
'use strict';
|
|
3591
|
+
|
|
3592
|
+
var _prodInvariant = _dereq_(39);
|
|
3593
|
+
|
|
3594
|
+
var ReactElement = _dereq_(15);
|
|
3595
|
+
|
|
3596
|
+
var invariant = _dereq_(48);
|
|
3597
|
+
|
|
3598
|
+
/**
|
|
3599
|
+
* Returns the first child in a collection of children and verifies that there
|
|
3600
|
+
* is only one child in the collection.
|
|
3601
|
+
*
|
|
3602
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
|
|
3603
|
+
*
|
|
3604
|
+
* The current implementation of this function assumes that a single child gets
|
|
3605
|
+
* passed without a wrapper, but the purpose of this helper function is to
|
|
3606
|
+
* abstract away the particular structure of children.
|
|
3607
|
+
*
|
|
3608
|
+
* @param {?object} children Child collection structure.
|
|
3609
|
+
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
3610
|
+
* structure.
|
|
3611
|
+
*/
|
|
3612
|
+
function onlyChild(children) {
|
|
3613
|
+
!ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
|
|
3614
|
+
return children;
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
module.exports = onlyChild;
|
|
3618
|
+
},{"15":15,"39":39,"48":48}],39:[function(_dereq_,module,exports){
|
|
3619
|
+
/**
|
|
3620
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3621
|
+
* All rights reserved.
|
|
3622
|
+
*
|
|
3623
|
+
* This source code is licensed under the BSD-style license found in the
|
|
3624
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
3625
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
3626
|
+
*
|
|
3627
|
+
*
|
|
3628
|
+
*/
|
|
3629
|
+
'use strict';
|
|
3630
|
+
|
|
3631
|
+
/**
|
|
3632
|
+
* WARNING: DO NOT manually require this module.
|
|
3633
|
+
* This is a replacement for `invariant(...)` used by the error code system
|
|
3634
|
+
* and will _only_ be required by the corresponding babel pass.
|
|
3635
|
+
* It always throws.
|
|
3636
|
+
*/
|
|
3637
|
+
|
|
3638
|
+
function reactProdInvariant(code) {
|
|
3639
|
+
var argCount = arguments.length - 1;
|
|
3640
|
+
|
|
3641
|
+
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
|
|
3642
|
+
|
|
3643
|
+
for (var argIdx = 0; argIdx < argCount; argIdx++) {
|
|
3644
|
+
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
|
|
3648
|
+
|
|
3649
|
+
var error = new Error(message);
|
|
3650
|
+
error.name = 'Invariant Violation';
|
|
3651
|
+
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
|
|
3652
|
+
|
|
3653
|
+
throw error;
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
module.exports = reactProdInvariant;
|
|
3657
|
+
},{}],40:[function(_dereq_,module,exports){
|
|
4159
3658
|
/**
|
|
4160
3659
|
* Copyright 2013-present, Facebook, Inc.
|
|
4161
3660
|
* All rights reserved.
|
|
@@ -4164,19 +3663,23 @@ module.exports = getIteratorFn;
|
|
|
4164
3663
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
4165
3664
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
4166
3665
|
*
|
|
4167
|
-
*
|
|
4168
3666
|
*/
|
|
4169
3667
|
|
|
4170
3668
|
'use strict';
|
|
4171
3669
|
|
|
4172
|
-
var
|
|
3670
|
+
var shallowEqual = _dereq_(49);
|
|
4173
3671
|
|
|
4174
|
-
|
|
4175
|
-
|
|
3672
|
+
/**
|
|
3673
|
+
* Does a shallow comparison for props and state.
|
|
3674
|
+
* See ReactComponentWithPureRenderMixin
|
|
3675
|
+
* See also https://facebook.github.io/react/docs/shallow-compare.html
|
|
3676
|
+
*/
|
|
3677
|
+
function shallowCompare(instance, nextProps, nextState) {
|
|
3678
|
+
return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
|
|
4176
3679
|
}
|
|
4177
3680
|
|
|
4178
|
-
module.exports =
|
|
4179
|
-
},{}],
|
|
3681
|
+
module.exports = shallowCompare;
|
|
3682
|
+
},{"49":49}],41:[function(_dereq_,module,exports){
|
|
4180
3683
|
/**
|
|
4181
3684
|
* Copyright 2013-present, Facebook, Inc.
|
|
4182
3685
|
* All rights reserved.
|
|
@@ -4186,74 +3689,285 @@ module.exports = getNextDebugID;
|
|
|
4186
3689
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
4187
3690
|
*
|
|
4188
3691
|
*/
|
|
3692
|
+
|
|
4189
3693
|
'use strict';
|
|
4190
3694
|
|
|
4191
3695
|
var _prodInvariant = _dereq_(39);
|
|
4192
3696
|
|
|
4193
|
-
var
|
|
3697
|
+
var ReactCurrentOwner = _dereq_(13);
|
|
3698
|
+
var REACT_ELEMENT_TYPE = _dereq_(16);
|
|
4194
3699
|
|
|
4195
|
-
var
|
|
3700
|
+
var getIteratorFn = _dereq_(35);
|
|
3701
|
+
var invariant = _dereq_(48);
|
|
3702
|
+
var KeyEscapeUtils = _dereq_(2);
|
|
3703
|
+
var warning = _dereq_(50);
|
|
3704
|
+
|
|
3705
|
+
var SEPARATOR = '.';
|
|
3706
|
+
var SUBSEPARATOR = ':';
|
|
4196
3707
|
|
|
4197
3708
|
/**
|
|
4198
|
-
*
|
|
4199
|
-
*
|
|
3709
|
+
* This is inlined from ReactElement since this file is shared between
|
|
3710
|
+
* isomorphic and renderers. We could extract this to a
|
|
4200
3711
|
*
|
|
4201
|
-
|
|
3712
|
+
*/
|
|
3713
|
+
|
|
3714
|
+
/**
|
|
3715
|
+
* TODO: Test that a single child and an array with one item have the same key
|
|
3716
|
+
* pattern.
|
|
3717
|
+
*/
|
|
3718
|
+
|
|
3719
|
+
var didWarnAboutMaps = false;
|
|
3720
|
+
|
|
3721
|
+
/**
|
|
3722
|
+
* Generate a key string that identifies a component within a set.
|
|
4202
3723
|
*
|
|
4203
|
-
*
|
|
4204
|
-
*
|
|
4205
|
-
*
|
|
3724
|
+
* @param {*} component A component that could contain a manual key.
|
|
3725
|
+
* @param {number} index Index that is used if a manual key is not provided.
|
|
3726
|
+
* @return {string}
|
|
3727
|
+
*/
|
|
3728
|
+
function getComponentKey(component, index) {
|
|
3729
|
+
// Do some typechecking here since we call this blindly. We want to ensure
|
|
3730
|
+
// that we don't block potential future ES APIs.
|
|
3731
|
+
if (component && typeof component === 'object' && component.key != null) {
|
|
3732
|
+
// Explicit key
|
|
3733
|
+
return KeyEscapeUtils.escape(component.key);
|
|
3734
|
+
}
|
|
3735
|
+
// Implicit key determined by the index in the set
|
|
3736
|
+
return index.toString(36);
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
/**
|
|
3740
|
+
* @param {?*} children Children tree container.
|
|
3741
|
+
* @param {!string} nameSoFar Name of the key path so far.
|
|
3742
|
+
* @param {!function} callback Callback to invoke with each child found.
|
|
3743
|
+
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
3744
|
+
* process.
|
|
3745
|
+
* @return {!number} The number of children in this subtree.
|
|
3746
|
+
*/
|
|
3747
|
+
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
3748
|
+
var type = typeof children;
|
|
3749
|
+
|
|
3750
|
+
if (type === 'undefined' || type === 'boolean') {
|
|
3751
|
+
// All of the above are perceived as null.
|
|
3752
|
+
children = null;
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
if (children === null || type === 'string' || type === 'number' ||
|
|
3756
|
+
// The following is inlined from ReactElement. This means we can optimize
|
|
3757
|
+
// some checks. React Fiber also inlines this logic for similar purposes.
|
|
3758
|
+
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
|
|
3759
|
+
callback(traverseContext, children,
|
|
3760
|
+
// If it's the only child, treat the name as if it was wrapped in an array
|
|
3761
|
+
// so that it's consistent if the number of children grows.
|
|
3762
|
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
3763
|
+
return 1;
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
var child;
|
|
3767
|
+
var nextName;
|
|
3768
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
3769
|
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
3770
|
+
|
|
3771
|
+
if (Array.isArray(children)) {
|
|
3772
|
+
for (var i = 0; i < children.length; i++) {
|
|
3773
|
+
child = children[i];
|
|
3774
|
+
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
3775
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
3776
|
+
}
|
|
3777
|
+
} else {
|
|
3778
|
+
var iteratorFn = getIteratorFn(children);
|
|
3779
|
+
if (iteratorFn) {
|
|
3780
|
+
var iterator = iteratorFn.call(children);
|
|
3781
|
+
var step;
|
|
3782
|
+
if (iteratorFn !== children.entries) {
|
|
3783
|
+
var ii = 0;
|
|
3784
|
+
while (!(step = iterator.next()).done) {
|
|
3785
|
+
child = step.value;
|
|
3786
|
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
3787
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
3788
|
+
}
|
|
3789
|
+
} else {
|
|
3790
|
+
if ("development" !== 'production') {
|
|
3791
|
+
var mapsAsChildrenAddendum = '';
|
|
3792
|
+
if (ReactCurrentOwner.current) {
|
|
3793
|
+
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
|
|
3794
|
+
if (mapsAsChildrenOwnerName) {
|
|
3795
|
+
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
|
|
3799
|
+
didWarnAboutMaps = true;
|
|
3800
|
+
}
|
|
3801
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
3802
|
+
while (!(step = iterator.next()).done) {
|
|
3803
|
+
var entry = step.value;
|
|
3804
|
+
if (entry) {
|
|
3805
|
+
child = entry[1];
|
|
3806
|
+
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
|
3807
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
} else if (type === 'object') {
|
|
3812
|
+
var addendum = '';
|
|
3813
|
+
if ("development" !== 'production') {
|
|
3814
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
|
3815
|
+
if (children._isReactElement) {
|
|
3816
|
+
addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
|
|
3817
|
+
}
|
|
3818
|
+
if (ReactCurrentOwner.current) {
|
|
3819
|
+
var name = ReactCurrentOwner.current.getName();
|
|
3820
|
+
if (name) {
|
|
3821
|
+
addendum += ' Check the render method of `' + name + '`.';
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3824
|
+
}
|
|
3825
|
+
var childrenString = String(children);
|
|
3826
|
+
!false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
return subtreeCount;
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
/**
|
|
3834
|
+
* Traverses children that are typically specified as `props.children`, but
|
|
3835
|
+
* might also be specified through attributes:
|
|
4206
3836
|
*
|
|
4207
|
-
*
|
|
4208
|
-
*
|
|
4209
|
-
*
|
|
3837
|
+
* - `traverseAllChildren(this.props.children, ...)`
|
|
3838
|
+
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
3839
|
+
*
|
|
3840
|
+
* The `traverseContext` is an optional argument that is passed through the
|
|
3841
|
+
* entire traversal. It can be used to store accumulations or anything else that
|
|
3842
|
+
* the callback might find relevant.
|
|
3843
|
+
*
|
|
3844
|
+
* @param {?*} children Children tree object.
|
|
3845
|
+
* @param {!function} callback To invoke upon traversing each child.
|
|
3846
|
+
* @param {?*} traverseContext Context for traversal.
|
|
3847
|
+
* @return {!number} The number of children in this subtree.
|
|
4210
3848
|
*/
|
|
4211
|
-
function
|
|
4212
|
-
|
|
4213
|
-
|
|
3849
|
+
function traverseAllChildren(children, callback, traverseContext) {
|
|
3850
|
+
if (children == null) {
|
|
3851
|
+
return 0;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
4214
3855
|
}
|
|
4215
3856
|
|
|
4216
|
-
module.exports =
|
|
4217
|
-
},{"16":16,"39":39,"
|
|
3857
|
+
module.exports = traverseAllChildren;
|
|
3858
|
+
},{"13":13,"16":16,"2":2,"35":35,"39":39,"48":48,"50":50}],42:[function(_dereq_,module,exports){
|
|
4218
3859
|
/**
|
|
4219
|
-
* Copyright
|
|
3860
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
4220
3861
|
* All rights reserved.
|
|
4221
3862
|
*
|
|
4222
3863
|
* This source code is licensed under the BSD-style license found in the
|
|
4223
3864
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
4224
3865
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
4225
3866
|
*
|
|
4226
|
-
*
|
|
4227
3867
|
*/
|
|
3868
|
+
|
|
3869
|
+
/* global hasOwnProperty:true */
|
|
3870
|
+
|
|
4228
3871
|
'use strict';
|
|
4229
3872
|
|
|
3873
|
+
var _prodInvariant = _dereq_(39),
|
|
3874
|
+
_assign = _dereq_(51);
|
|
3875
|
+
|
|
3876
|
+
var invariant = _dereq_(48);
|
|
3877
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
3878
|
+
|
|
3879
|
+
function shallowCopy(x) {
|
|
3880
|
+
if (Array.isArray(x)) {
|
|
3881
|
+
return x.concat();
|
|
3882
|
+
} else if (x && typeof x === 'object') {
|
|
3883
|
+
return _assign(new x.constructor(), x);
|
|
3884
|
+
} else {
|
|
3885
|
+
return x;
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
|
|
3889
|
+
var COMMAND_PUSH = '$push';
|
|
3890
|
+
var COMMAND_UNSHIFT = '$unshift';
|
|
3891
|
+
var COMMAND_SPLICE = '$splice';
|
|
3892
|
+
var COMMAND_SET = '$set';
|
|
3893
|
+
var COMMAND_MERGE = '$merge';
|
|
3894
|
+
var COMMAND_APPLY = '$apply';
|
|
3895
|
+
|
|
3896
|
+
var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
|
|
3897
|
+
|
|
3898
|
+
var ALL_COMMANDS_SET = {};
|
|
3899
|
+
|
|
3900
|
+
ALL_COMMANDS_LIST.forEach(function (command) {
|
|
3901
|
+
ALL_COMMANDS_SET[command] = true;
|
|
3902
|
+
});
|
|
3903
|
+
|
|
3904
|
+
function invariantArrayCase(value, spec, command) {
|
|
3905
|
+
!Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
|
|
3906
|
+
var specValue = spec[command];
|
|
3907
|
+
!Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
|
|
3908
|
+
}
|
|
3909
|
+
|
|
4230
3910
|
/**
|
|
4231
|
-
*
|
|
4232
|
-
*
|
|
4233
|
-
* and will _only_ be required by the corresponding babel pass.
|
|
4234
|
-
* It always throws.
|
|
3911
|
+
* Returns a updated shallow copy of an object without mutating the original.
|
|
3912
|
+
* See https://facebook.github.io/react/docs/update.html for details.
|
|
4235
3913
|
*/
|
|
3914
|
+
function update(value, spec) {
|
|
3915
|
+
!(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
|
|
4236
3916
|
|
|
4237
|
-
|
|
4238
|
-
|
|
3917
|
+
if (hasOwnProperty.call(spec, COMMAND_SET)) {
|
|
3918
|
+
!(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
|
|
3919
|
+
|
|
3920
|
+
return spec[COMMAND_SET];
|
|
3921
|
+
}
|
|
3922
|
+
|
|
3923
|
+
var nextValue = shallowCopy(value);
|
|
3924
|
+
|
|
3925
|
+
if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
|
|
3926
|
+
var mergeObj = spec[COMMAND_MERGE];
|
|
3927
|
+
!(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
|
|
3928
|
+
!(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
|
|
3929
|
+
_assign(nextValue, spec[COMMAND_MERGE]);
|
|
3930
|
+
}
|
|
4239
3931
|
|
|
4240
|
-
|
|
3932
|
+
if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
|
|
3933
|
+
invariantArrayCase(value, spec, COMMAND_PUSH);
|
|
3934
|
+
spec[COMMAND_PUSH].forEach(function (item) {
|
|
3935
|
+
nextValue.push(item);
|
|
3936
|
+
});
|
|
3937
|
+
}
|
|
4241
3938
|
|
|
4242
|
-
|
|
4243
|
-
|
|
3939
|
+
if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
|
|
3940
|
+
invariantArrayCase(value, spec, COMMAND_UNSHIFT);
|
|
3941
|
+
spec[COMMAND_UNSHIFT].forEach(function (item) {
|
|
3942
|
+
nextValue.unshift(item);
|
|
3943
|
+
});
|
|
4244
3944
|
}
|
|
4245
3945
|
|
|
4246
|
-
|
|
3946
|
+
if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
|
|
3947
|
+
!Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
|
|
3948
|
+
!Array.isArray(spec[COMMAND_SPLICE]) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
|
|
3949
|
+
spec[COMMAND_SPLICE].forEach(function (args) {
|
|
3950
|
+
!Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
|
|
3951
|
+
nextValue.splice.apply(nextValue, args);
|
|
3952
|
+
});
|
|
3953
|
+
}
|
|
4247
3954
|
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
3955
|
+
if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
|
|
3956
|
+
!(typeof spec[COMMAND_APPLY] === 'function') ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
|
|
3957
|
+
nextValue = spec[COMMAND_APPLY](nextValue);
|
|
3958
|
+
}
|
|
4251
3959
|
|
|
4252
|
-
|
|
3960
|
+
for (var k in spec) {
|
|
3961
|
+
if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
|
|
3962
|
+
nextValue[k] = update(value[k], spec[k]);
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
|
|
3966
|
+
return nextValue;
|
|
4253
3967
|
}
|
|
4254
3968
|
|
|
4255
|
-
module.exports =
|
|
4256
|
-
},{}],
|
|
3969
|
+
module.exports = update;
|
|
3970
|
+
},{"39":39,"48":48,"51":51}],43:[function(_dereq_,module,exports){
|
|
4257
3971
|
/**
|
|
4258
3972
|
* Copyright 2013-present, Facebook, Inc.
|
|
4259
3973
|
* All rights reserved.
|
|
@@ -4266,307 +3980,868 @@ module.exports = reactProdInvariant;
|
|
|
4266
3980
|
|
|
4267
3981
|
'use strict';
|
|
4268
3982
|
|
|
4269
|
-
var
|
|
4270
|
-
|
|
4271
|
-
/**
|
|
4272
|
-
* Does a shallow comparison for props and state.
|
|
4273
|
-
* See ReactComponentWithPureRenderMixin
|
|
4274
|
-
* See also https://facebook.github.io/react/docs/shallow-compare.html
|
|
4275
|
-
*/
|
|
4276
|
-
function shallowCompare(instance, nextProps, nextState) {
|
|
4277
|
-
return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
|
|
4278
|
-
}
|
|
3983
|
+
var _assign = _dereq_(51);
|
|
4279
3984
|
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
/**
|
|
4283
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
4284
|
-
* All rights reserved.
|
|
4285
|
-
*
|
|
4286
|
-
* This source code is licensed under the BSD-style license found in the
|
|
4287
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
4288
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
4289
|
-
*
|
|
4290
|
-
*/
|
|
3985
|
+
var emptyObject = _dereq_(47);
|
|
3986
|
+
var _invariant = _dereq_(48);
|
|
4291
3987
|
|
|
4292
|
-
'
|
|
3988
|
+
if ("development" !== 'production') {
|
|
3989
|
+
var warning = _dereq_(50);
|
|
3990
|
+
}
|
|
4293
3991
|
|
|
4294
|
-
var
|
|
3992
|
+
var MIXINS_KEY = 'mixins';
|
|
4295
3993
|
|
|
4296
|
-
|
|
4297
|
-
|
|
3994
|
+
// Helper function to allow the creation of anonymous functions which do not
|
|
3995
|
+
// have .name set to the name of the variable being assigned to.
|
|
3996
|
+
function identity(fn) {
|
|
3997
|
+
return fn;
|
|
3998
|
+
}
|
|
4298
3999
|
|
|
4299
|
-
var
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4000
|
+
var ReactPropTypeLocationNames;
|
|
4001
|
+
if ("development" !== 'production') {
|
|
4002
|
+
ReactPropTypeLocationNames = {
|
|
4003
|
+
prop: 'prop',
|
|
4004
|
+
context: 'context',
|
|
4005
|
+
childContext: 'child context'
|
|
4006
|
+
};
|
|
4007
|
+
} else {
|
|
4008
|
+
ReactPropTypeLocationNames = {};
|
|
4009
|
+
}
|
|
4303
4010
|
|
|
4304
|
-
|
|
4305
|
-
|
|
4011
|
+
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
|
|
4012
|
+
/**
|
|
4013
|
+
* Policies that describe methods in `ReactClassInterface`.
|
|
4014
|
+
*/
|
|
4306
4015
|
|
|
4307
|
-
|
|
4308
|
-
* This is inlined from ReactElement since this file is shared between
|
|
4309
|
-
* isomorphic and renderers. We could extract this to a
|
|
4310
|
-
*
|
|
4311
|
-
*/
|
|
4016
|
+
var injectedMixins = [];
|
|
4312
4017
|
|
|
4313
|
-
/**
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4018
|
+
/**
|
|
4019
|
+
* Composite components are higher-level components that compose other composite
|
|
4020
|
+
* or host components.
|
|
4021
|
+
*
|
|
4022
|
+
* To create a new type of `ReactClass`, pass a specification of
|
|
4023
|
+
* your new class to `React.createClass`. The only requirement of your class
|
|
4024
|
+
* specification is that you implement a `render` method.
|
|
4025
|
+
*
|
|
4026
|
+
* var MyComponent = React.createClass({
|
|
4027
|
+
* render: function() {
|
|
4028
|
+
* return <div>Hello World</div>;
|
|
4029
|
+
* }
|
|
4030
|
+
* });
|
|
4031
|
+
*
|
|
4032
|
+
* The class specification supports a specific protocol of methods that have
|
|
4033
|
+
* special meaning (e.g. `render`). See `ReactClassInterface` for
|
|
4034
|
+
* more the comprehensive protocol. Any other properties and methods in the
|
|
4035
|
+
* class specification will be available on the prototype.
|
|
4036
|
+
*
|
|
4037
|
+
* @interface ReactClassInterface
|
|
4038
|
+
* @internal
|
|
4039
|
+
*/
|
|
4040
|
+
var ReactClassInterface = {
|
|
4041
|
+
/**
|
|
4042
|
+
* An array of Mixin objects to include when defining your component.
|
|
4043
|
+
*
|
|
4044
|
+
* @type {array}
|
|
4045
|
+
* @optional
|
|
4046
|
+
*/
|
|
4047
|
+
mixins: 'DEFINE_MANY',
|
|
4048
|
+
|
|
4049
|
+
/**
|
|
4050
|
+
* An object containing properties and methods that should be defined on
|
|
4051
|
+
* the component's constructor instead of its prototype (static methods).
|
|
4052
|
+
*
|
|
4053
|
+
* @type {object}
|
|
4054
|
+
* @optional
|
|
4055
|
+
*/
|
|
4056
|
+
statics: 'DEFINE_MANY',
|
|
4057
|
+
|
|
4058
|
+
/**
|
|
4059
|
+
* Definition of prop types for this component.
|
|
4060
|
+
*
|
|
4061
|
+
* @type {object}
|
|
4062
|
+
* @optional
|
|
4063
|
+
*/
|
|
4064
|
+
propTypes: 'DEFINE_MANY',
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* Definition of context types for this component.
|
|
4068
|
+
*
|
|
4069
|
+
* @type {object}
|
|
4070
|
+
* @optional
|
|
4071
|
+
*/
|
|
4072
|
+
contextTypes: 'DEFINE_MANY',
|
|
4073
|
+
|
|
4074
|
+
/**
|
|
4075
|
+
* Definition of context types this component sets for its children.
|
|
4076
|
+
*
|
|
4077
|
+
* @type {object}
|
|
4078
|
+
* @optional
|
|
4079
|
+
*/
|
|
4080
|
+
childContextTypes: 'DEFINE_MANY',
|
|
4081
|
+
|
|
4082
|
+
// ==== Definition methods ====
|
|
4083
|
+
|
|
4084
|
+
/**
|
|
4085
|
+
* Invoked when the component is mounted. Values in the mapping will be set on
|
|
4086
|
+
* `this.props` if that prop is not specified (i.e. using an `in` check).
|
|
4087
|
+
*
|
|
4088
|
+
* This method is invoked before `getInitialState` and therefore cannot rely
|
|
4089
|
+
* on `this.state` or use `this.setState`.
|
|
4090
|
+
*
|
|
4091
|
+
* @return {object}
|
|
4092
|
+
* @optional
|
|
4093
|
+
*/
|
|
4094
|
+
getDefaultProps: 'DEFINE_MANY_MERGED',
|
|
4095
|
+
|
|
4096
|
+
/**
|
|
4097
|
+
* Invoked once before the component is mounted. The return value will be used
|
|
4098
|
+
* as the initial value of `this.state`.
|
|
4099
|
+
*
|
|
4100
|
+
* getInitialState: function() {
|
|
4101
|
+
* return {
|
|
4102
|
+
* isOn: false,
|
|
4103
|
+
* fooBaz: new BazFoo()
|
|
4104
|
+
* }
|
|
4105
|
+
* }
|
|
4106
|
+
*
|
|
4107
|
+
* @return {object}
|
|
4108
|
+
* @optional
|
|
4109
|
+
*/
|
|
4110
|
+
getInitialState: 'DEFINE_MANY_MERGED',
|
|
4111
|
+
|
|
4112
|
+
/**
|
|
4113
|
+
* @return {object}
|
|
4114
|
+
* @optional
|
|
4115
|
+
*/
|
|
4116
|
+
getChildContext: 'DEFINE_MANY_MERGED',
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* Uses props from `this.props` and state from `this.state` to render the
|
|
4120
|
+
* structure of the component.
|
|
4121
|
+
*
|
|
4122
|
+
* No guarantees are made about when or how often this method is invoked, so
|
|
4123
|
+
* it must not have side effects.
|
|
4124
|
+
*
|
|
4125
|
+
* render: function() {
|
|
4126
|
+
* var name = this.props.name;
|
|
4127
|
+
* return <div>Hello, {name}!</div>;
|
|
4128
|
+
* }
|
|
4129
|
+
*
|
|
4130
|
+
* @return {ReactComponent}
|
|
4131
|
+
* @required
|
|
4132
|
+
*/
|
|
4133
|
+
render: 'DEFINE_ONCE',
|
|
4134
|
+
|
|
4135
|
+
// ==== Delegate methods ====
|
|
4136
|
+
|
|
4137
|
+
/**
|
|
4138
|
+
* Invoked when the component is initially created and about to be mounted.
|
|
4139
|
+
* This may have side effects, but any external subscriptions or data created
|
|
4140
|
+
* by this method must be cleaned up in `componentWillUnmount`.
|
|
4141
|
+
*
|
|
4142
|
+
* @optional
|
|
4143
|
+
*/
|
|
4144
|
+
componentWillMount: 'DEFINE_MANY',
|
|
4145
|
+
|
|
4146
|
+
/**
|
|
4147
|
+
* Invoked when the component has been mounted and has a DOM representation.
|
|
4148
|
+
* However, there is no guarantee that the DOM node is in the document.
|
|
4149
|
+
*
|
|
4150
|
+
* Use this as an opportunity to operate on the DOM when the component has
|
|
4151
|
+
* been mounted (initialized and rendered) for the first time.
|
|
4152
|
+
*
|
|
4153
|
+
* @param {DOMElement} rootNode DOM element representing the component.
|
|
4154
|
+
* @optional
|
|
4155
|
+
*/
|
|
4156
|
+
componentDidMount: 'DEFINE_MANY',
|
|
4157
|
+
|
|
4158
|
+
/**
|
|
4159
|
+
* Invoked before the component receives new props.
|
|
4160
|
+
*
|
|
4161
|
+
* Use this as an opportunity to react to a prop transition by updating the
|
|
4162
|
+
* state using `this.setState`. Current props are accessed via `this.props`.
|
|
4163
|
+
*
|
|
4164
|
+
* componentWillReceiveProps: function(nextProps, nextContext) {
|
|
4165
|
+
* this.setState({
|
|
4166
|
+
* likesIncreasing: nextProps.likeCount > this.props.likeCount
|
|
4167
|
+
* });
|
|
4168
|
+
* }
|
|
4169
|
+
*
|
|
4170
|
+
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
|
|
4171
|
+
* transition may cause a state change, but the opposite is not true. If you
|
|
4172
|
+
* need it, you are probably looking for `componentWillUpdate`.
|
|
4173
|
+
*
|
|
4174
|
+
* @param {object} nextProps
|
|
4175
|
+
* @optional
|
|
4176
|
+
*/
|
|
4177
|
+
componentWillReceiveProps: 'DEFINE_MANY',
|
|
4178
|
+
|
|
4179
|
+
/**
|
|
4180
|
+
* Invoked while deciding if the component should be updated as a result of
|
|
4181
|
+
* receiving new props, state and/or context.
|
|
4182
|
+
*
|
|
4183
|
+
* Use this as an opportunity to `return false` when you're certain that the
|
|
4184
|
+
* transition to the new props/state/context will not require a component
|
|
4185
|
+
* update.
|
|
4186
|
+
*
|
|
4187
|
+
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
|
|
4188
|
+
* return !equal(nextProps, this.props) ||
|
|
4189
|
+
* !equal(nextState, this.state) ||
|
|
4190
|
+
* !equal(nextContext, this.context);
|
|
4191
|
+
* }
|
|
4192
|
+
*
|
|
4193
|
+
* @param {object} nextProps
|
|
4194
|
+
* @param {?object} nextState
|
|
4195
|
+
* @param {?object} nextContext
|
|
4196
|
+
* @return {boolean} True if the component should update.
|
|
4197
|
+
* @optional
|
|
4198
|
+
*/
|
|
4199
|
+
shouldComponentUpdate: 'DEFINE_ONCE',
|
|
4200
|
+
|
|
4201
|
+
/**
|
|
4202
|
+
* Invoked when the component is about to update due to a transition from
|
|
4203
|
+
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
|
|
4204
|
+
* and `nextContext`.
|
|
4205
|
+
*
|
|
4206
|
+
* Use this as an opportunity to perform preparation before an update occurs.
|
|
4207
|
+
*
|
|
4208
|
+
* NOTE: You **cannot** use `this.setState()` in this method.
|
|
4209
|
+
*
|
|
4210
|
+
* @param {object} nextProps
|
|
4211
|
+
* @param {?object} nextState
|
|
4212
|
+
* @param {?object} nextContext
|
|
4213
|
+
* @param {ReactReconcileTransaction} transaction
|
|
4214
|
+
* @optional
|
|
4215
|
+
*/
|
|
4216
|
+
componentWillUpdate: 'DEFINE_MANY',
|
|
4217
|
+
|
|
4218
|
+
/**
|
|
4219
|
+
* Invoked when the component's DOM representation has been updated.
|
|
4220
|
+
*
|
|
4221
|
+
* Use this as an opportunity to operate on the DOM when the component has
|
|
4222
|
+
* been updated.
|
|
4223
|
+
*
|
|
4224
|
+
* @param {object} prevProps
|
|
4225
|
+
* @param {?object} prevState
|
|
4226
|
+
* @param {?object} prevContext
|
|
4227
|
+
* @param {DOMElement} rootNode DOM element representing the component.
|
|
4228
|
+
* @optional
|
|
4229
|
+
*/
|
|
4230
|
+
componentDidUpdate: 'DEFINE_MANY',
|
|
4231
|
+
|
|
4232
|
+
/**
|
|
4233
|
+
* Invoked when the component is about to be removed from its parent and have
|
|
4234
|
+
* its DOM representation destroyed.
|
|
4235
|
+
*
|
|
4236
|
+
* Use this as an opportunity to deallocate any external resources.
|
|
4237
|
+
*
|
|
4238
|
+
* NOTE: There is no `componentDidUnmount` since your component will have been
|
|
4239
|
+
* destroyed by that point.
|
|
4240
|
+
*
|
|
4241
|
+
* @optional
|
|
4242
|
+
*/
|
|
4243
|
+
componentWillUnmount: 'DEFINE_MANY',
|
|
4244
|
+
|
|
4245
|
+
// ==== Advanced methods ====
|
|
4246
|
+
|
|
4247
|
+
/**
|
|
4248
|
+
* Updates the component's currently mounted DOM representation.
|
|
4249
|
+
*
|
|
4250
|
+
* By default, this implements React's rendering and reconciliation algorithm.
|
|
4251
|
+
* Sophisticated clients may wish to override this.
|
|
4252
|
+
*
|
|
4253
|
+
* @param {ReactReconcileTransaction} transaction
|
|
4254
|
+
* @internal
|
|
4255
|
+
* @overridable
|
|
4256
|
+
*/
|
|
4257
|
+
updateComponent: 'OVERRIDE_BASE'
|
|
4258
|
+
};
|
|
4317
4259
|
|
|
4318
|
-
|
|
4260
|
+
/**
|
|
4261
|
+
* Mapping from class specification keys to special processing functions.
|
|
4262
|
+
*
|
|
4263
|
+
* Although these are declared like instance properties in the specification
|
|
4264
|
+
* when defining classes using `React.createClass`, they are actually static
|
|
4265
|
+
* and are accessible on the constructor instead of the prototype. Despite
|
|
4266
|
+
* being static, they must be defined outside of the "statics" key under
|
|
4267
|
+
* which all other static methods are defined.
|
|
4268
|
+
*/
|
|
4269
|
+
var RESERVED_SPEC_KEYS = {
|
|
4270
|
+
displayName: function(Constructor, displayName) {
|
|
4271
|
+
Constructor.displayName = displayName;
|
|
4272
|
+
},
|
|
4273
|
+
mixins: function(Constructor, mixins) {
|
|
4274
|
+
if (mixins) {
|
|
4275
|
+
for (var i = 0; i < mixins.length; i++) {
|
|
4276
|
+
mixSpecIntoComponent(Constructor, mixins[i]);
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
},
|
|
4280
|
+
childContextTypes: function(Constructor, childContextTypes) {
|
|
4281
|
+
if ("development" !== 'production') {
|
|
4282
|
+
validateTypeDef(Constructor, childContextTypes, 'childContext');
|
|
4283
|
+
}
|
|
4284
|
+
Constructor.childContextTypes = _assign(
|
|
4285
|
+
{},
|
|
4286
|
+
Constructor.childContextTypes,
|
|
4287
|
+
childContextTypes
|
|
4288
|
+
);
|
|
4289
|
+
},
|
|
4290
|
+
contextTypes: function(Constructor, contextTypes) {
|
|
4291
|
+
if ("development" !== 'production') {
|
|
4292
|
+
validateTypeDef(Constructor, contextTypes, 'context');
|
|
4293
|
+
}
|
|
4294
|
+
Constructor.contextTypes = _assign(
|
|
4295
|
+
{},
|
|
4296
|
+
Constructor.contextTypes,
|
|
4297
|
+
contextTypes
|
|
4298
|
+
);
|
|
4299
|
+
},
|
|
4300
|
+
/**
|
|
4301
|
+
* Special case getDefaultProps which should move into statics but requires
|
|
4302
|
+
* automatic merging.
|
|
4303
|
+
*/
|
|
4304
|
+
getDefaultProps: function(Constructor, getDefaultProps) {
|
|
4305
|
+
if (Constructor.getDefaultProps) {
|
|
4306
|
+
Constructor.getDefaultProps = createMergedResultFunction(
|
|
4307
|
+
Constructor.getDefaultProps,
|
|
4308
|
+
getDefaultProps
|
|
4309
|
+
);
|
|
4310
|
+
} else {
|
|
4311
|
+
Constructor.getDefaultProps = getDefaultProps;
|
|
4312
|
+
}
|
|
4313
|
+
},
|
|
4314
|
+
propTypes: function(Constructor, propTypes) {
|
|
4315
|
+
if ("development" !== 'production') {
|
|
4316
|
+
validateTypeDef(Constructor, propTypes, 'prop');
|
|
4317
|
+
}
|
|
4318
|
+
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
|
4319
|
+
},
|
|
4320
|
+
statics: function(Constructor, statics) {
|
|
4321
|
+
mixStaticSpecIntoComponent(Constructor, statics);
|
|
4322
|
+
},
|
|
4323
|
+
autobind: function() {}
|
|
4324
|
+
};
|
|
4319
4325
|
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4326
|
+
function validateTypeDef(Constructor, typeDef, location) {
|
|
4327
|
+
for (var propName in typeDef) {
|
|
4328
|
+
if (typeDef.hasOwnProperty(propName)) {
|
|
4329
|
+
// use a warning instead of an _invariant so components
|
|
4330
|
+
// don't show up in prod but only in __DEV__
|
|
4331
|
+
if ("development" !== 'production') {
|
|
4332
|
+
warning(
|
|
4333
|
+
typeof typeDef[propName] === 'function',
|
|
4334
|
+
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
|
|
4335
|
+
'React.PropTypes.',
|
|
4336
|
+
Constructor.displayName || 'ReactClass',
|
|
4337
|
+
ReactPropTypeLocationNames[location],
|
|
4338
|
+
propName
|
|
4339
|
+
);
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4333
4343
|
}
|
|
4334
|
-
// Implicit key determined by the index in the set
|
|
4335
|
-
return index.toString(36);
|
|
4336
|
-
}
|
|
4337
4344
|
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4345
|
+
function validateMethodOverride(isAlreadyDefined, name) {
|
|
4346
|
+
var specPolicy = ReactClassInterface.hasOwnProperty(name)
|
|
4347
|
+
? ReactClassInterface[name]
|
|
4348
|
+
: null;
|
|
4349
|
+
|
|
4350
|
+
// Disallow overriding of base class methods unless explicitly allowed.
|
|
4351
|
+
if (ReactClassMixin.hasOwnProperty(name)) {
|
|
4352
|
+
_invariant(
|
|
4353
|
+
specPolicy === 'OVERRIDE_BASE',
|
|
4354
|
+
'ReactClassInterface: You are attempting to override ' +
|
|
4355
|
+
'`%s` from your class specification. Ensure that your method names ' +
|
|
4356
|
+
'do not overlap with React methods.',
|
|
4357
|
+
name
|
|
4358
|
+
);
|
|
4359
|
+
}
|
|
4348
4360
|
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4361
|
+
// Disallow defining methods more than once unless explicitly allowed.
|
|
4362
|
+
if (isAlreadyDefined) {
|
|
4363
|
+
_invariant(
|
|
4364
|
+
specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
|
|
4365
|
+
'ReactClassInterface: You are attempting to define ' +
|
|
4366
|
+
'`%s` on your component more than once. This conflict may be due ' +
|
|
4367
|
+
'to a mixin.',
|
|
4368
|
+
name
|
|
4369
|
+
);
|
|
4370
|
+
}
|
|
4352
4371
|
}
|
|
4353
4372
|
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
}
|
|
4373
|
+
/**
|
|
4374
|
+
* Mixin helper which handles policy validation and reserved
|
|
4375
|
+
* specification keys when building React classes.
|
|
4376
|
+
*/
|
|
4377
|
+
function mixSpecIntoComponent(Constructor, spec) {
|
|
4378
|
+
if (!spec) {
|
|
4379
|
+
if ("development" !== 'production') {
|
|
4380
|
+
var typeofSpec = typeof spec;
|
|
4381
|
+
var isMixinValid = typeofSpec === 'object' && spec !== null;
|
|
4364
4382
|
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4383
|
+
if ("development" !== 'production') {
|
|
4384
|
+
warning(
|
|
4385
|
+
isMixinValid,
|
|
4386
|
+
"%s: You're attempting to include a mixin that is either null " +
|
|
4387
|
+
'or not an object. Check the mixins included by the component, ' +
|
|
4388
|
+
'as well as any mixins they include themselves. ' +
|
|
4389
|
+
'Expected object but got %s.',
|
|
4390
|
+
Constructor.displayName || 'ReactClass',
|
|
4391
|
+
spec === null ? null : typeofSpec
|
|
4392
|
+
);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4369
4395
|
|
|
4370
|
-
|
|
4371
|
-
for (var i = 0; i < children.length; i++) {
|
|
4372
|
-
child = children[i];
|
|
4373
|
-
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
4374
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
4396
|
+
return;
|
|
4375
4397
|
}
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4398
|
+
|
|
4399
|
+
_invariant(
|
|
4400
|
+
typeof spec !== 'function',
|
|
4401
|
+
"ReactClass: You're attempting to " +
|
|
4402
|
+
'use a component class or function as a mixin. Instead, just use a ' +
|
|
4403
|
+
'regular object.'
|
|
4404
|
+
);
|
|
4405
|
+
_invariant(
|
|
4406
|
+
!isValidElement(spec),
|
|
4407
|
+
"ReactClass: You're attempting to " +
|
|
4408
|
+
'use a component as a mixin. Instead, just use a regular object.'
|
|
4409
|
+
);
|
|
4410
|
+
|
|
4411
|
+
var proto = Constructor.prototype;
|
|
4412
|
+
var autoBindPairs = proto.__reactAutoBindPairs;
|
|
4413
|
+
|
|
4414
|
+
// By handling mixins before any other properties, we ensure the same
|
|
4415
|
+
// chaining order is applied to methods with DEFINE_MANY policy, whether
|
|
4416
|
+
// mixins are listed before or after these methods in the spec.
|
|
4417
|
+
if (spec.hasOwnProperty(MIXINS_KEY)) {
|
|
4418
|
+
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
|
4419
|
+
}
|
|
4420
|
+
|
|
4421
|
+
for (var name in spec) {
|
|
4422
|
+
if (!spec.hasOwnProperty(name)) {
|
|
4423
|
+
continue;
|
|
4424
|
+
}
|
|
4425
|
+
|
|
4426
|
+
if (name === MIXINS_KEY) {
|
|
4427
|
+
// We have already handled mixins in a special case above.
|
|
4428
|
+
continue;
|
|
4429
|
+
}
|
|
4430
|
+
|
|
4431
|
+
var property = spec[name];
|
|
4432
|
+
var isAlreadyDefined = proto.hasOwnProperty(name);
|
|
4433
|
+
validateMethodOverride(isAlreadyDefined, name);
|
|
4434
|
+
|
|
4435
|
+
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
|
4436
|
+
RESERVED_SPEC_KEYS[name](Constructor, property);
|
|
4388
4437
|
} else {
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4438
|
+
// Setup methods on prototype:
|
|
4439
|
+
// The following member methods should not be automatically bound:
|
|
4440
|
+
// 1. Expected ReactClass methods (in the "interface").
|
|
4441
|
+
// 2. Overridden methods (that were mixed in).
|
|
4442
|
+
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
|
4443
|
+
var isFunction = typeof property === 'function';
|
|
4444
|
+
var shouldAutoBind =
|
|
4445
|
+
isFunction &&
|
|
4446
|
+
!isReactClassMethod &&
|
|
4447
|
+
!isAlreadyDefined &&
|
|
4448
|
+
spec.autobind !== false;
|
|
4449
|
+
|
|
4450
|
+
if (shouldAutoBind) {
|
|
4451
|
+
autoBindPairs.push(name, property);
|
|
4452
|
+
proto[name] = property;
|
|
4453
|
+
} else {
|
|
4454
|
+
if (isAlreadyDefined) {
|
|
4455
|
+
var specPolicy = ReactClassInterface[name];
|
|
4456
|
+
|
|
4457
|
+
// These cases should already be caught by validateMethodOverride.
|
|
4458
|
+
_invariant(
|
|
4459
|
+
isReactClassMethod &&
|
|
4460
|
+
(specPolicy === 'DEFINE_MANY_MERGED' ||
|
|
4461
|
+
specPolicy === 'DEFINE_MANY'),
|
|
4462
|
+
'ReactClass: Unexpected spec policy %s for key %s ' +
|
|
4463
|
+
'when mixing in component specs.',
|
|
4464
|
+
specPolicy,
|
|
4465
|
+
name
|
|
4466
|
+
);
|
|
4467
|
+
|
|
4468
|
+
// For methods which are defined more than once, call the existing
|
|
4469
|
+
// methods before calling the new property, merging if appropriate.
|
|
4470
|
+
if (specPolicy === 'DEFINE_MANY_MERGED') {
|
|
4471
|
+
proto[name] = createMergedResultFunction(proto[name], property);
|
|
4472
|
+
} else if (specPolicy === 'DEFINE_MANY') {
|
|
4473
|
+
proto[name] = createChainedFunction(proto[name], property);
|
|
4474
|
+
}
|
|
4475
|
+
} else {
|
|
4476
|
+
proto[name] = property;
|
|
4477
|
+
if ("development" !== 'production') {
|
|
4478
|
+
// Add verbose displayName to the function, which helps when looking
|
|
4479
|
+
// at profiling tools.
|
|
4480
|
+
if (typeof property === 'function' && spec.displayName) {
|
|
4481
|
+
proto[name].displayName = spec.displayName + '_' + name;
|
|
4482
|
+
}
|
|
4395
4483
|
}
|
|
4396
|
-
}
|
|
4397
|
-
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
|
|
4398
|
-
didWarnAboutMaps = true;
|
|
4399
|
-
}
|
|
4400
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
4401
|
-
while (!(step = iterator.next()).done) {
|
|
4402
|
-
var entry = step.value;
|
|
4403
|
-
if (entry) {
|
|
4404
|
-
child = entry[1];
|
|
4405
|
-
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
|
4406
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
4407
4484
|
}
|
|
4408
4485
|
}
|
|
4409
4486
|
}
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
|
|
4490
|
+
function mixStaticSpecIntoComponent(Constructor, statics) {
|
|
4491
|
+
if (!statics) {
|
|
4492
|
+
return;
|
|
4493
|
+
}
|
|
4494
|
+
for (var name in statics) {
|
|
4495
|
+
var property = statics[name];
|
|
4496
|
+
if (!statics.hasOwnProperty(name)) {
|
|
4497
|
+
continue;
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
var isReserved = name in RESERVED_SPEC_KEYS;
|
|
4501
|
+
_invariant(
|
|
4502
|
+
!isReserved,
|
|
4503
|
+
'ReactClass: You are attempting to define a reserved ' +
|
|
4504
|
+
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
|
|
4505
|
+
'as an instance property instead; it will still be accessible on the ' +
|
|
4506
|
+
'constructor.',
|
|
4507
|
+
name
|
|
4508
|
+
);
|
|
4509
|
+
|
|
4510
|
+
var isInherited = name in Constructor;
|
|
4511
|
+
_invariant(
|
|
4512
|
+
!isInherited,
|
|
4513
|
+
'ReactClass: You are attempting to define ' +
|
|
4514
|
+
'`%s` on your component more than once. This conflict may be ' +
|
|
4515
|
+
'due to a mixin.',
|
|
4516
|
+
name
|
|
4517
|
+
);
|
|
4518
|
+
Constructor[name] = property;
|
|
4519
|
+
}
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
/**
|
|
4523
|
+
* Merge two objects, but throw if both contain the same key.
|
|
4524
|
+
*
|
|
4525
|
+
* @param {object} one The first object, which is mutated.
|
|
4526
|
+
* @param {object} two The second object
|
|
4527
|
+
* @return {object} one after it has been mutated to contain everything in two.
|
|
4528
|
+
*/
|
|
4529
|
+
function mergeIntoWithNoDuplicateKeys(one, two) {
|
|
4530
|
+
_invariant(
|
|
4531
|
+
one && two && typeof one === 'object' && typeof two === 'object',
|
|
4532
|
+
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
|
|
4533
|
+
);
|
|
4534
|
+
|
|
4535
|
+
for (var key in two) {
|
|
4536
|
+
if (two.hasOwnProperty(key)) {
|
|
4537
|
+
_invariant(
|
|
4538
|
+
one[key] === undefined,
|
|
4539
|
+
'mergeIntoWithNoDuplicateKeys(): ' +
|
|
4540
|
+
'Tried to merge two objects with the same key: `%s`. This conflict ' +
|
|
4541
|
+
'may be due to a mixin; in particular, this may be caused by two ' +
|
|
4542
|
+
'getInitialState() or getDefaultProps() methods returning objects ' +
|
|
4543
|
+
'with clashing keys.',
|
|
4544
|
+
key
|
|
4545
|
+
);
|
|
4546
|
+
one[key] = two[key];
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
return one;
|
|
4550
|
+
}
|
|
4551
|
+
|
|
4552
|
+
/**
|
|
4553
|
+
* Creates a function that invokes two functions and merges their return values.
|
|
4554
|
+
*
|
|
4555
|
+
* @param {function} one Function to invoke first.
|
|
4556
|
+
* @param {function} two Function to invoke second.
|
|
4557
|
+
* @return {function} Function that invokes the two argument functions.
|
|
4558
|
+
* @private
|
|
4559
|
+
*/
|
|
4560
|
+
function createMergedResultFunction(one, two) {
|
|
4561
|
+
return function mergedResult() {
|
|
4562
|
+
var a = one.apply(this, arguments);
|
|
4563
|
+
var b = two.apply(this, arguments);
|
|
4564
|
+
if (a == null) {
|
|
4565
|
+
return b;
|
|
4566
|
+
} else if (b == null) {
|
|
4567
|
+
return a;
|
|
4568
|
+
}
|
|
4569
|
+
var c = {};
|
|
4570
|
+
mergeIntoWithNoDuplicateKeys(c, a);
|
|
4571
|
+
mergeIntoWithNoDuplicateKeys(c, b);
|
|
4572
|
+
return c;
|
|
4573
|
+
};
|
|
4574
|
+
}
|
|
4575
|
+
|
|
4576
|
+
/**
|
|
4577
|
+
* Creates a function that invokes two functions and ignores their return vales.
|
|
4578
|
+
*
|
|
4579
|
+
* @param {function} one Function to invoke first.
|
|
4580
|
+
* @param {function} two Function to invoke second.
|
|
4581
|
+
* @return {function} Function that invokes the two argument functions.
|
|
4582
|
+
* @private
|
|
4583
|
+
*/
|
|
4584
|
+
function createChainedFunction(one, two) {
|
|
4585
|
+
return function chainedFunction() {
|
|
4586
|
+
one.apply(this, arguments);
|
|
4587
|
+
two.apply(this, arguments);
|
|
4588
|
+
};
|
|
4589
|
+
}
|
|
4590
|
+
|
|
4591
|
+
/**
|
|
4592
|
+
* Binds a method to the component.
|
|
4593
|
+
*
|
|
4594
|
+
* @param {object} component Component whose method is going to be bound.
|
|
4595
|
+
* @param {function} method Method to be bound.
|
|
4596
|
+
* @return {function} The bound method.
|
|
4597
|
+
*/
|
|
4598
|
+
function bindAutoBindMethod(component, method) {
|
|
4599
|
+
var boundMethod = method.bind(component);
|
|
4600
|
+
if ("development" !== 'production') {
|
|
4601
|
+
boundMethod.__reactBoundContext = component;
|
|
4602
|
+
boundMethod.__reactBoundMethod = method;
|
|
4603
|
+
boundMethod.__reactBoundArguments = null;
|
|
4604
|
+
var componentName = component.constructor.displayName;
|
|
4605
|
+
var _bind = boundMethod.bind;
|
|
4606
|
+
boundMethod.bind = function(newThis) {
|
|
4607
|
+
for (
|
|
4608
|
+
var _len = arguments.length,
|
|
4609
|
+
args = Array(_len > 1 ? _len - 1 : 0),
|
|
4610
|
+
_key = 1;
|
|
4611
|
+
_key < _len;
|
|
4612
|
+
_key++
|
|
4613
|
+
) {
|
|
4614
|
+
args[_key - 1] = arguments[_key];
|
|
4416
4615
|
}
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4616
|
+
|
|
4617
|
+
// User is trying to bind() an autobound method; we effectively will
|
|
4618
|
+
// ignore the value of "this" that the user is trying to use, so
|
|
4619
|
+
// let's warn.
|
|
4620
|
+
if (newThis !== component && newThis !== null) {
|
|
4621
|
+
if ("development" !== 'production') {
|
|
4622
|
+
warning(
|
|
4623
|
+
false,
|
|
4624
|
+
'bind(): React component methods may only be bound to the ' +
|
|
4625
|
+
'component instance. See %s',
|
|
4626
|
+
componentName
|
|
4627
|
+
);
|
|
4628
|
+
}
|
|
4629
|
+
} else if (!args.length) {
|
|
4630
|
+
if ("development" !== 'production') {
|
|
4631
|
+
warning(
|
|
4632
|
+
false,
|
|
4633
|
+
'bind(): You are binding a component method to the component. ' +
|
|
4634
|
+
'React does this for you automatically in a high-performance ' +
|
|
4635
|
+
'way, so you can safely remove this call. See %s',
|
|
4636
|
+
componentName
|
|
4637
|
+
);
|
|
4421
4638
|
}
|
|
4639
|
+
return boundMethod;
|
|
4422
4640
|
}
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4641
|
+
var reboundMethod = _bind.apply(boundMethod, arguments);
|
|
4642
|
+
reboundMethod.__reactBoundContext = component;
|
|
4643
|
+
reboundMethod.__reactBoundMethod = method;
|
|
4644
|
+
reboundMethod.__reactBoundArguments = args;
|
|
4645
|
+
return reboundMethod;
|
|
4646
|
+
};
|
|
4426
4647
|
}
|
|
4648
|
+
return boundMethod;
|
|
4427
4649
|
}
|
|
4428
4650
|
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
* the callback might find relevant.
|
|
4442
|
-
*
|
|
4443
|
-
* @param {?*} children Children tree object.
|
|
4444
|
-
* @param {!function} callback To invoke upon traversing each child.
|
|
4445
|
-
* @param {?*} traverseContext Context for traversal.
|
|
4446
|
-
* @return {!number} The number of children in this subtree.
|
|
4447
|
-
*/
|
|
4448
|
-
function traverseAllChildren(children, callback, traverseContext) {
|
|
4449
|
-
if (children == null) {
|
|
4450
|
-
return 0;
|
|
4651
|
+
/**
|
|
4652
|
+
* Binds all auto-bound methods in a component.
|
|
4653
|
+
*
|
|
4654
|
+
* @param {object} component Component whose method is going to be bound.
|
|
4655
|
+
*/
|
|
4656
|
+
function bindAutoBindMethods(component) {
|
|
4657
|
+
var pairs = component.__reactAutoBindPairs;
|
|
4658
|
+
for (var i = 0; i < pairs.length; i += 2) {
|
|
4659
|
+
var autoBindKey = pairs[i];
|
|
4660
|
+
var method = pairs[i + 1];
|
|
4661
|
+
component[autoBindKey] = bindAutoBindMethod(component, method);
|
|
4662
|
+
}
|
|
4451
4663
|
}
|
|
4452
4664
|
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
}
|
|
4458
|
-
/**
|
|
4459
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
4460
|
-
* All rights reserved.
|
|
4461
|
-
*
|
|
4462
|
-
* This source code is licensed under the BSD-style license found in the
|
|
4463
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
4464
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
4465
|
-
*
|
|
4466
|
-
*/
|
|
4467
|
-
|
|
4468
|
-
/* global hasOwnProperty:true */
|
|
4469
|
-
|
|
4470
|
-
'use strict';
|
|
4665
|
+
var IsMountedPreMixin = {
|
|
4666
|
+
componentDidMount: function() {
|
|
4667
|
+
this.__isMounted = true;
|
|
4668
|
+
}
|
|
4669
|
+
};
|
|
4471
4670
|
|
|
4472
|
-
var
|
|
4473
|
-
|
|
4671
|
+
var IsMountedPostMixin = {
|
|
4672
|
+
componentWillUnmount: function() {
|
|
4673
|
+
this.__isMounted = false;
|
|
4674
|
+
}
|
|
4675
|
+
};
|
|
4474
4676
|
|
|
4475
|
-
|
|
4476
|
-
|
|
4677
|
+
/**
|
|
4678
|
+
* Add more to the ReactClass base class. These are all legacy features and
|
|
4679
|
+
* therefore not already part of the modern ReactComponent.
|
|
4680
|
+
*/
|
|
4681
|
+
var ReactClassMixin = {
|
|
4682
|
+
/**
|
|
4683
|
+
* TODO: This will be deprecated because state should always keep a consistent
|
|
4684
|
+
* type signature and the only use case for this, is to avoid that.
|
|
4685
|
+
*/
|
|
4686
|
+
replaceState: function(newState, callback) {
|
|
4687
|
+
this.updater.enqueueReplaceState(this, newState, callback);
|
|
4688
|
+
},
|
|
4689
|
+
|
|
4690
|
+
/**
|
|
4691
|
+
* Checks whether or not this composite component is mounted.
|
|
4692
|
+
* @return {boolean} True if mounted, false otherwise.
|
|
4693
|
+
* @protected
|
|
4694
|
+
* @final
|
|
4695
|
+
*/
|
|
4696
|
+
isMounted: function() {
|
|
4697
|
+
if ("development" !== 'production') {
|
|
4698
|
+
warning(
|
|
4699
|
+
this.__didWarnIsMounted,
|
|
4700
|
+
'%s: isMounted is deprecated. Instead, make sure to clean up ' +
|
|
4701
|
+
'subscriptions and pending requests in componentWillUnmount to ' +
|
|
4702
|
+
'prevent memory leaks.',
|
|
4703
|
+
(this.constructor && this.constructor.displayName) ||
|
|
4704
|
+
this.name ||
|
|
4705
|
+
'Component'
|
|
4706
|
+
);
|
|
4707
|
+
this.__didWarnIsMounted = true;
|
|
4708
|
+
}
|
|
4709
|
+
return !!this.__isMounted;
|
|
4710
|
+
}
|
|
4711
|
+
};
|
|
4477
4712
|
|
|
4478
|
-
function
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
return x;
|
|
4485
|
-
}
|
|
4486
|
-
}
|
|
4713
|
+
var ReactClassComponent = function() {};
|
|
4714
|
+
_assign(
|
|
4715
|
+
ReactClassComponent.prototype,
|
|
4716
|
+
ReactComponent.prototype,
|
|
4717
|
+
ReactClassMixin
|
|
4718
|
+
);
|
|
4487
4719
|
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4720
|
+
/**
|
|
4721
|
+
* Creates a composite component class given a class specification.
|
|
4722
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
|
|
4723
|
+
*
|
|
4724
|
+
* @param {object} spec Class specification (which must define `render`).
|
|
4725
|
+
* @return {function} Component constructor function.
|
|
4726
|
+
* @public
|
|
4727
|
+
*/
|
|
4728
|
+
function createClass(spec) {
|
|
4729
|
+
// To keep our warnings more understandable, we'll use a little hack here to
|
|
4730
|
+
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
|
|
4731
|
+
// unnecessarily identify a class without displayName as 'Constructor'.
|
|
4732
|
+
var Constructor = identity(function(props, context, updater) {
|
|
4733
|
+
// This constructor gets overridden by mocks. The argument is used
|
|
4734
|
+
// by mocks to assert on what gets mounted.
|
|
4494
4735
|
|
|
4495
|
-
|
|
4736
|
+
if ("development" !== 'production') {
|
|
4737
|
+
warning(
|
|
4738
|
+
this instanceof Constructor,
|
|
4739
|
+
'Something is calling a React component directly. Use a factory or ' +
|
|
4740
|
+
'JSX instead. See: https://fb.me/react-legacyfactory'
|
|
4741
|
+
);
|
|
4742
|
+
}
|
|
4496
4743
|
|
|
4497
|
-
|
|
4744
|
+
// Wire up auto-binding
|
|
4745
|
+
if (this.__reactAutoBindPairs.length) {
|
|
4746
|
+
bindAutoBindMethods(this);
|
|
4747
|
+
}
|
|
4498
4748
|
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4749
|
+
this.props = props;
|
|
4750
|
+
this.context = context;
|
|
4751
|
+
this.refs = emptyObject;
|
|
4752
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
4502
4753
|
|
|
4503
|
-
|
|
4504
|
-
!Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
|
|
4505
|
-
var specValue = spec[command];
|
|
4506
|
-
!Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
|
|
4507
|
-
}
|
|
4754
|
+
this.state = null;
|
|
4508
4755
|
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
* See https://facebook.github.io/react/docs/update.html for details.
|
|
4512
|
-
*/
|
|
4513
|
-
function update(value, spec) {
|
|
4514
|
-
!(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
|
|
4756
|
+
// ReactClasses doesn't have constructors. Instead, they use the
|
|
4757
|
+
// getInitialState and componentWillMount methods for initialization.
|
|
4515
4758
|
|
|
4516
|
-
|
|
4517
|
-
|
|
4759
|
+
var initialState = this.getInitialState ? this.getInitialState() : null;
|
|
4760
|
+
if ("development" !== 'production') {
|
|
4761
|
+
// We allow auto-mocks to proceed as if they're returning null.
|
|
4762
|
+
if (
|
|
4763
|
+
initialState === undefined &&
|
|
4764
|
+
this.getInitialState._isMockFunction
|
|
4765
|
+
) {
|
|
4766
|
+
// This is probably bad practice. Consider warning here and
|
|
4767
|
+
// deprecating this convenience.
|
|
4768
|
+
initialState = null;
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
_invariant(
|
|
4772
|
+
typeof initialState === 'object' && !Array.isArray(initialState),
|
|
4773
|
+
'%s.getInitialState(): must return an object or null',
|
|
4774
|
+
Constructor.displayName || 'ReactCompositeComponent'
|
|
4775
|
+
);
|
|
4518
4776
|
|
|
4519
|
-
|
|
4520
|
-
|
|
4777
|
+
this.state = initialState;
|
|
4778
|
+
});
|
|
4779
|
+
Constructor.prototype = new ReactClassComponent();
|
|
4780
|
+
Constructor.prototype.constructor = Constructor;
|
|
4781
|
+
Constructor.prototype.__reactAutoBindPairs = [];
|
|
4521
4782
|
|
|
4522
|
-
|
|
4783
|
+
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
|
4523
4784
|
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
!(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
|
|
4528
|
-
_assign(nextValue, spec[COMMAND_MERGE]);
|
|
4529
|
-
}
|
|
4785
|
+
mixSpecIntoComponent(Constructor, IsMountedPreMixin);
|
|
4786
|
+
mixSpecIntoComponent(Constructor, spec);
|
|
4787
|
+
mixSpecIntoComponent(Constructor, IsMountedPostMixin);
|
|
4530
4788
|
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
});
|
|
4536
|
-
}
|
|
4789
|
+
// Initialize the defaultProps property after all mixins have been merged.
|
|
4790
|
+
if (Constructor.getDefaultProps) {
|
|
4791
|
+
Constructor.defaultProps = Constructor.getDefaultProps();
|
|
4792
|
+
}
|
|
4537
4793
|
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4794
|
+
if ("development" !== 'production') {
|
|
4795
|
+
// This is a tag to indicate that the use of these method names is ok,
|
|
4796
|
+
// since it's used with createClass. If it's not, then it's likely a
|
|
4797
|
+
// mistake so we'll warn you to use the static property, property
|
|
4798
|
+
// initializer or constructor respectively.
|
|
4799
|
+
if (Constructor.getDefaultProps) {
|
|
4800
|
+
Constructor.getDefaultProps.isReactClassApproved = {};
|
|
4801
|
+
}
|
|
4802
|
+
if (Constructor.prototype.getInitialState) {
|
|
4803
|
+
Constructor.prototype.getInitialState.isReactClassApproved = {};
|
|
4804
|
+
}
|
|
4805
|
+
}
|
|
4544
4806
|
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
!Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
|
|
4550
|
-
nextValue.splice.apply(nextValue, args);
|
|
4551
|
-
});
|
|
4552
|
-
}
|
|
4807
|
+
_invariant(
|
|
4808
|
+
Constructor.prototype.render,
|
|
4809
|
+
'createClass(...): Class specification must implement a `render` method.'
|
|
4810
|
+
);
|
|
4553
4811
|
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4812
|
+
if ("development" !== 'production') {
|
|
4813
|
+
warning(
|
|
4814
|
+
!Constructor.prototype.componentShouldUpdate,
|
|
4815
|
+
'%s has a method called ' +
|
|
4816
|
+
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
|
|
4817
|
+
'The name is phrased as a question because the function is ' +
|
|
4818
|
+
'expected to return a value.',
|
|
4819
|
+
spec.displayName || 'A component'
|
|
4820
|
+
);
|
|
4821
|
+
warning(
|
|
4822
|
+
!Constructor.prototype.componentWillRecieveProps,
|
|
4823
|
+
'%s has a method called ' +
|
|
4824
|
+
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
|
|
4825
|
+
spec.displayName || 'A component'
|
|
4826
|
+
);
|
|
4827
|
+
}
|
|
4558
4828
|
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4829
|
+
// Reduce time spent doing lookups by setting these on the prototype.
|
|
4830
|
+
for (var methodName in ReactClassInterface) {
|
|
4831
|
+
if (!Constructor.prototype[methodName]) {
|
|
4832
|
+
Constructor.prototype[methodName] = null;
|
|
4833
|
+
}
|
|
4562
4834
|
}
|
|
4835
|
+
|
|
4836
|
+
return Constructor;
|
|
4563
4837
|
}
|
|
4564
4838
|
|
|
4565
|
-
return
|
|
4839
|
+
return createClass;
|
|
4566
4840
|
}
|
|
4567
4841
|
|
|
4568
|
-
module.exports =
|
|
4569
|
-
|
|
4842
|
+
module.exports = factory;
|
|
4843
|
+
|
|
4844
|
+
},{"47":47,"48":48,"50":50,"51":51}],44:[function(_dereq_,module,exports){
|
|
4570
4845
|
'use strict';
|
|
4571
4846
|
|
|
4572
4847
|
/**
|
|
@@ -4580,7 +4855,7 @@ module.exports = update;
|
|
|
4580
4855
|
* @typechecks
|
|
4581
4856
|
*/
|
|
4582
4857
|
|
|
4583
|
-
var invariant = _dereq_(
|
|
4858
|
+
var invariant = _dereq_(48);
|
|
4584
4859
|
|
|
4585
4860
|
/**
|
|
4586
4861
|
* The CSSCore module specifies the API (and implements most of the methods)
|
|
@@ -4688,7 +4963,7 @@ var CSSCore = {
|
|
|
4688
4963
|
};
|
|
4689
4964
|
|
|
4690
4965
|
module.exports = CSSCore;
|
|
4691
|
-
},{"
|
|
4966
|
+
},{"48":48}],45:[function(_dereq_,module,exports){
|
|
4692
4967
|
/**
|
|
4693
4968
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4694
4969
|
* All rights reserved.
|
|
@@ -4724,7 +4999,7 @@ var ExecutionEnvironment = {
|
|
|
4724
4999
|
};
|
|
4725
5000
|
|
|
4726
5001
|
module.exports = ExecutionEnvironment;
|
|
4727
|
-
},{}],
|
|
5002
|
+
},{}],46:[function(_dereq_,module,exports){
|
|
4728
5003
|
"use strict";
|
|
4729
5004
|
|
|
4730
5005
|
/**
|
|
@@ -4763,7 +5038,7 @@ emptyFunction.thatReturnsArgument = function (arg) {
|
|
|
4763
5038
|
};
|
|
4764
5039
|
|
|
4765
5040
|
module.exports = emptyFunction;
|
|
4766
|
-
},{}],
|
|
5041
|
+
},{}],47:[function(_dereq_,module,exports){
|
|
4767
5042
|
/**
|
|
4768
5043
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4769
5044
|
* All rights reserved.
|
|
@@ -4783,7 +5058,7 @@ if ("development" !== 'production') {
|
|
|
4783
5058
|
}
|
|
4784
5059
|
|
|
4785
5060
|
module.exports = emptyObject;
|
|
4786
|
-
},{}],
|
|
5061
|
+
},{}],48:[function(_dereq_,module,exports){
|
|
4787
5062
|
/**
|
|
4788
5063
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4789
5064
|
* All rights reserved.
|
|
@@ -4839,7 +5114,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
4839
5114
|
}
|
|
4840
5115
|
|
|
4841
5116
|
module.exports = invariant;
|
|
4842
|
-
},{}],
|
|
5117
|
+
},{}],49:[function(_dereq_,module,exports){
|
|
4843
5118
|
/**
|
|
4844
5119
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4845
5120
|
* All rights reserved.
|
|
@@ -4907,7 +5182,7 @@ function shallowEqual(objA, objB) {
|
|
|
4907
5182
|
}
|
|
4908
5183
|
|
|
4909
5184
|
module.exports = shallowEqual;
|
|
4910
|
-
},{}],
|
|
5185
|
+
},{}],50:[function(_dereq_,module,exports){
|
|
4911
5186
|
/**
|
|
4912
5187
|
* Copyright 2014-2015, Facebook, Inc.
|
|
4913
5188
|
* All rights reserved.
|
|
@@ -4920,7 +5195,7 @@ module.exports = shallowEqual;
|
|
|
4920
5195
|
|
|
4921
5196
|
'use strict';
|
|
4922
5197
|
|
|
4923
|
-
var emptyFunction = _dereq_(
|
|
5198
|
+
var emptyFunction = _dereq_(46);
|
|
4924
5199
|
|
|
4925
5200
|
/**
|
|
4926
5201
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
@@ -4974,7 +5249,7 @@ if ("development" !== 'production') {
|
|
|
4974
5249
|
}
|
|
4975
5250
|
|
|
4976
5251
|
module.exports = warning;
|
|
4977
|
-
},{"
|
|
5252
|
+
},{"46":46}],51:[function(_dereq_,module,exports){
|
|
4978
5253
|
/*
|
|
4979
5254
|
object-assign
|
|
4980
5255
|
(c) Sindre Sorhus
|
|
@@ -5066,7 +5341,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
5066
5341
|
return to;
|
|
5067
5342
|
};
|
|
5068
5343
|
|
|
5069
|
-
},{}],
|
|
5344
|
+
},{}],52:[function(_dereq_,module,exports){
|
|
5070
5345
|
/**
|
|
5071
5346
|
* Copyright 2013-present, Facebook, Inc.
|
|
5072
5347
|
* All rights reserved.
|
|
@@ -5078,12 +5353,12 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
5078
5353
|
|
|
5079
5354
|
'use strict';
|
|
5080
5355
|
|
|
5081
|
-
|
|
5082
|
-
var
|
|
5083
|
-
|
|
5084
|
-
var ReactPropTypesSecret = _dereq_(
|
|
5085
|
-
|
|
5086
|
-
|
|
5356
|
+
if ("development" !== 'production') {
|
|
5357
|
+
var invariant = _dereq_(48);
|
|
5358
|
+
var warning = _dereq_(50);
|
|
5359
|
+
var ReactPropTypesSecret = _dereq_(55);
|
|
5360
|
+
var loggedTypeFailures = {};
|
|
5361
|
+
}
|
|
5087
5362
|
|
|
5088
5363
|
/**
|
|
5089
5364
|
* Assert that the values match with the type specs.
|
|
@@ -5112,7 +5387,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
5112
5387
|
} catch (ex) {
|
|
5113
5388
|
error = ex;
|
|
5114
5389
|
}
|
|
5115
|
-
|
|
5390
|
+
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
|
|
5116
5391
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
5117
5392
|
// Only monitor this failure once because there tends to be a lot of the
|
|
5118
5393
|
// same error.
|
|
@@ -5120,7 +5395,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
5120
5395
|
|
|
5121
5396
|
var stack = getStack ? getStack() : '';
|
|
5122
5397
|
|
|
5123
|
-
|
|
5398
|
+
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
|
|
5124
5399
|
}
|
|
5125
5400
|
}
|
|
5126
5401
|
}
|
|
@@ -5129,7 +5404,30 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
5129
5404
|
|
|
5130
5405
|
module.exports = checkPropTypes;
|
|
5131
5406
|
|
|
5132
|
-
},{"
|
|
5407
|
+
},{"48":48,"50":50,"55":55}],53:[function(_dereq_,module,exports){
|
|
5408
|
+
/**
|
|
5409
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
5410
|
+
* All rights reserved.
|
|
5411
|
+
*
|
|
5412
|
+
* This source code is licensed under the BSD-style license found in the
|
|
5413
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
5414
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
5415
|
+
*/
|
|
5416
|
+
|
|
5417
|
+
'use strict';
|
|
5418
|
+
|
|
5419
|
+
// React 15.5 references this module, and assumes PropTypes are still callable in production.
|
|
5420
|
+
// Therefore we re-export development-only version with all the PropTypes checks here.
|
|
5421
|
+
// However if one is migrating to the `prop-types` npm library, they will go through the
|
|
5422
|
+
// `index.js` entry point, and it will branch depending on the environment.
|
|
5423
|
+
var factory = _dereq_(54);
|
|
5424
|
+
module.exports = function(isValidElement) {
|
|
5425
|
+
// It is still allowed in 15.5.
|
|
5426
|
+
var throwOnDirectAccess = false;
|
|
5427
|
+
return factory(isValidElement, throwOnDirectAccess);
|
|
5428
|
+
};
|
|
5429
|
+
|
|
5430
|
+
},{"54":54}],54:[function(_dereq_,module,exports){
|
|
5133
5431
|
/**
|
|
5134
5432
|
* Copyright 2013-present, Facebook, Inc.
|
|
5135
5433
|
* All rights reserved.
|
|
@@ -5141,14 +5439,14 @@ module.exports = checkPropTypes;
|
|
|
5141
5439
|
|
|
5142
5440
|
'use strict';
|
|
5143
5441
|
|
|
5144
|
-
var emptyFunction = _dereq_(
|
|
5145
|
-
var invariant = _dereq_(
|
|
5146
|
-
var warning = _dereq_(
|
|
5442
|
+
var emptyFunction = _dereq_(46);
|
|
5443
|
+
var invariant = _dereq_(48);
|
|
5444
|
+
var warning = _dereq_(50);
|
|
5147
5445
|
|
|
5148
|
-
var ReactPropTypesSecret = _dereq_(
|
|
5149
|
-
var checkPropTypes = _dereq_(
|
|
5446
|
+
var ReactPropTypesSecret = _dereq_(55);
|
|
5447
|
+
var checkPropTypes = _dereq_(52);
|
|
5150
5448
|
|
|
5151
|
-
module.exports = function
|
|
5449
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
5152
5450
|
/* global Symbol */
|
|
5153
5451
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
5154
5452
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
@@ -5223,58 +5521,27 @@ module.exports = function (isValidElement) {
|
|
|
5223
5521
|
|
|
5224
5522
|
var ANONYMOUS = '<<anonymous>>';
|
|
5225
5523
|
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
shape: createShapeTypeChecker
|
|
5248
|
-
};
|
|
5249
|
-
} else {
|
|
5250
|
-
var productionTypeChecker = function () {
|
|
5251
|
-
invariant(false, 'React.PropTypes type checking code is stripped in production.');
|
|
5252
|
-
};
|
|
5253
|
-
productionTypeChecker.isRequired = productionTypeChecker;
|
|
5254
|
-
var getProductionTypeChecker = function () {
|
|
5255
|
-
return productionTypeChecker;
|
|
5256
|
-
};
|
|
5257
|
-
// Keep in sync with development version above
|
|
5258
|
-
ReactPropTypes = {
|
|
5259
|
-
array: productionTypeChecker,
|
|
5260
|
-
bool: productionTypeChecker,
|
|
5261
|
-
func: productionTypeChecker,
|
|
5262
|
-
number: productionTypeChecker,
|
|
5263
|
-
object: productionTypeChecker,
|
|
5264
|
-
string: productionTypeChecker,
|
|
5265
|
-
symbol: productionTypeChecker,
|
|
5266
|
-
|
|
5267
|
-
any: productionTypeChecker,
|
|
5268
|
-
arrayOf: getProductionTypeChecker,
|
|
5269
|
-
element: productionTypeChecker,
|
|
5270
|
-
instanceOf: getProductionTypeChecker,
|
|
5271
|
-
node: productionTypeChecker,
|
|
5272
|
-
objectOf: getProductionTypeChecker,
|
|
5273
|
-
oneOf: getProductionTypeChecker,
|
|
5274
|
-
oneOfType: getProductionTypeChecker,
|
|
5275
|
-
shape: getProductionTypeChecker
|
|
5276
|
-
};
|
|
5277
|
-
}
|
|
5524
|
+
// Important!
|
|
5525
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
5526
|
+
var ReactPropTypes = {
|
|
5527
|
+
array: createPrimitiveTypeChecker('array'),
|
|
5528
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
5529
|
+
func: createPrimitiveTypeChecker('function'),
|
|
5530
|
+
number: createPrimitiveTypeChecker('number'),
|
|
5531
|
+
object: createPrimitiveTypeChecker('object'),
|
|
5532
|
+
string: createPrimitiveTypeChecker('string'),
|
|
5533
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
5534
|
+
|
|
5535
|
+
any: createAnyTypeChecker(),
|
|
5536
|
+
arrayOf: createArrayOfTypeChecker,
|
|
5537
|
+
element: createElementTypeChecker(),
|
|
5538
|
+
instanceOf: createInstanceTypeChecker,
|
|
5539
|
+
node: createNodeChecker(),
|
|
5540
|
+
objectOf: createObjectOfTypeChecker,
|
|
5541
|
+
oneOf: createEnumTypeChecker,
|
|
5542
|
+
oneOfType: createUnionTypeChecker,
|
|
5543
|
+
shape: createShapeTypeChecker
|
|
5544
|
+
};
|
|
5278
5545
|
|
|
5279
5546
|
/**
|
|
5280
5547
|
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
@@ -5311,16 +5578,41 @@ module.exports = function (isValidElement) {
|
|
|
5311
5578
|
function createChainableTypeChecker(validate) {
|
|
5312
5579
|
if ("development" !== 'production') {
|
|
5313
5580
|
var manualPropTypeCallCache = {};
|
|
5581
|
+
var manualPropTypeWarningCount = 0;
|
|
5314
5582
|
}
|
|
5315
5583
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
5316
5584
|
componentName = componentName || ANONYMOUS;
|
|
5317
5585
|
propFullName = propFullName || propName;
|
|
5318
|
-
|
|
5319
|
-
|
|
5586
|
+
|
|
5587
|
+
if (secret !== ReactPropTypesSecret) {
|
|
5588
|
+
if (throwOnDirectAccess) {
|
|
5589
|
+
// New behavior only for users of `prop-types` package
|
|
5590
|
+
invariant(
|
|
5591
|
+
false,
|
|
5592
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
5593
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
5594
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
5595
|
+
);
|
|
5596
|
+
} else if ("development" !== 'production' && typeof console !== 'undefined') {
|
|
5597
|
+
// Old behavior for people using React.PropTypes
|
|
5320
5598
|
var cacheKey = componentName + ':' + propName;
|
|
5321
|
-
if (
|
|
5322
|
-
|
|
5599
|
+
if (
|
|
5600
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
5601
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
5602
|
+
manualPropTypeWarningCount < 3
|
|
5603
|
+
) {
|
|
5604
|
+
warning(
|
|
5605
|
+
false,
|
|
5606
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
5607
|
+
'function for the `%s` prop on `%s`. This is deprecated ' +
|
|
5608
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
5609
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
5610
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
|
|
5611
|
+
propFullName,
|
|
5612
|
+
componentName
|
|
5613
|
+
);
|
|
5323
5614
|
manualPropTypeCallCache[cacheKey] = true;
|
|
5615
|
+
manualPropTypeWarningCount++;
|
|
5324
5616
|
}
|
|
5325
5617
|
}
|
|
5326
5618
|
}
|
|
@@ -5458,6 +5750,20 @@ module.exports = function (isValidElement) {
|
|
|
5458
5750
|
return emptyFunction.thatReturnsNull;
|
|
5459
5751
|
}
|
|
5460
5752
|
|
|
5753
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
5754
|
+
var checker = arrayOfTypeCheckers[i];
|
|
5755
|
+
if (typeof checker !== 'function') {
|
|
5756
|
+
warning(
|
|
5757
|
+
false,
|
|
5758
|
+
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
|
|
5759
|
+
'received %s at index %s.',
|
|
5760
|
+
getPostfixForTypeWarning(checker),
|
|
5761
|
+
i
|
|
5762
|
+
);
|
|
5763
|
+
return emptyFunction.thatReturnsNull;
|
|
5764
|
+
}
|
|
5765
|
+
}
|
|
5766
|
+
|
|
5461
5767
|
function validate(props, propName, componentName, location, propFullName) {
|
|
5462
5768
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
5463
5769
|
var checker = arrayOfTypeCheckers[i];
|
|
@@ -5590,6 +5896,9 @@ module.exports = function (isValidElement) {
|
|
|
5590
5896
|
// This handles more types than `getPropType`. Only used for error messages.
|
|
5591
5897
|
// See `createPrimitiveTypeChecker`.
|
|
5592
5898
|
function getPreciseType(propValue) {
|
|
5899
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
5900
|
+
return '' + propValue;
|
|
5901
|
+
}
|
|
5593
5902
|
var propType = getPropType(propValue);
|
|
5594
5903
|
if (propType === 'object') {
|
|
5595
5904
|
if (propValue instanceof Date) {
|
|
@@ -5601,6 +5910,23 @@ module.exports = function (isValidElement) {
|
|
|
5601
5910
|
return propType;
|
|
5602
5911
|
}
|
|
5603
5912
|
|
|
5913
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
5914
|
+
// For example, "undefined" or "of type array"
|
|
5915
|
+
function getPostfixForTypeWarning(value) {
|
|
5916
|
+
var type = getPreciseType(value);
|
|
5917
|
+
switch (type) {
|
|
5918
|
+
case 'array':
|
|
5919
|
+
case 'object':
|
|
5920
|
+
return 'an ' + type;
|
|
5921
|
+
case 'boolean':
|
|
5922
|
+
case 'date':
|
|
5923
|
+
case 'regexp':
|
|
5924
|
+
return 'a ' + type;
|
|
5925
|
+
default:
|
|
5926
|
+
return type;
|
|
5927
|
+
}
|
|
5928
|
+
}
|
|
5929
|
+
|
|
5604
5930
|
// Returns class name of the object, if any.
|
|
5605
5931
|
function getClassName(propValue) {
|
|
5606
5932
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
@@ -5615,7 +5941,7 @@ module.exports = function (isValidElement) {
|
|
|
5615
5941
|
return ReactPropTypes;
|
|
5616
5942
|
};
|
|
5617
5943
|
|
|
5618
|
-
},{"
|
|
5944
|
+
},{"46":46,"48":48,"50":50,"52":52,"55":55}],55:[function(_dereq_,module,exports){
|
|
5619
5945
|
/**
|
|
5620
5946
|
* Copyright 2013-present, Facebook, Inc.
|
|
5621
5947
|
* All rights reserved.
|
|
@@ -5631,5 +5957,5 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
5631
5957
|
|
|
5632
5958
|
module.exports = ReactPropTypesSecret;
|
|
5633
5959
|
|
|
5634
|
-
},{}]},{},[
|
|
5960
|
+
},{}]},{},[30])(30)
|
|
5635
5961
|
});
|