react-rails 1.10.0 → 1.11.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +5 -2
- data/lib/assets/react-source/development-with-addons/react-server.js +2064 -1704
- data/lib/assets/react-source/development-with-addons/react.js +2101 -1741
- data/lib/assets/react-source/development/react-server.js +104 -78
- data/lib/assets/react-source/development/react.js +96 -63
- data/lib/assets/react-source/production-with-addons/react-server.js +11 -6
- data/lib/assets/react-source/production-with-addons/react.js +11 -6
- data/lib/assets/react-source/production/react-server.js +11 -6
- data/lib/assets/react-source/production/react.js +11 -6
- data/lib/react/rails/controller_renderer.rb +10 -3
- data/lib/react/rails/version.rb +1 -1
- data/lib/react/server_rendering.rb +2 -2
- data/lib/react/server_rendering/sprockets_renderer.rb +1 -1
- data/lib/react/server_rendering/yaml_manifest_container.rb +9 -3
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5be5071bf0476f2792eff912d657e0bf93ead10e
|
4
|
+
data.tar.gz: 2c77127d9a17d3ba653086034c61a087714f0476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fab516013ce7f24199968b2ed3f6183998921fa97632afb2ea4beff96fcb4bf85a8c8371d383cb60d0a866501dc770f39d6a8ae00906603a11d5520a4d1f521
|
7
|
+
data.tar.gz: 79d8ca952f890e00e8116939ba4136229c470c34ba5424bf9ca7eae052c3dbf67c7646fa3e3fdc4126e29241de25abc257ffd01c93375c293098bdd374012107
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,18 @@
|
|
8
8
|
|
9
9
|
#### Bug Fixes
|
10
10
|
|
11
|
+
## 1.11.0 (April 4, 2017)
|
12
|
+
|
13
|
+
#### New Features
|
14
|
+
|
15
|
+
- Support `prerender: false` when rendering in a controller #680
|
16
|
+
- Update React to `15.4.2` #681
|
17
|
+
|
18
|
+
#### Bug Fixes
|
19
|
+
|
20
|
+
- Fix joining asset path in YamlManifestContainer #679
|
21
|
+
- Remove `coffee-script-source` from dependencies. #667 If you have a version conflict, you should specify the proper version yourself.
|
22
|
+
|
11
23
|
## 1.10.0 (October 6, 2016)
|
12
24
|
|
13
25
|
#### Breaking Changes
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ in your Ruby on Rails (3.2+) application. `react-rails` can:
|
|
19
19
|
- [Generate components](#component-generator) with a Rails generator
|
20
20
|
- [Be extended](#extending-react-rails) with custom renderers, transformers and view helpers
|
21
21
|
|
22
|
-
Just getting started with React? Make sure to check out the [Getting Started]
|
22
|
+
Just getting started with React? Make sure to check out the [Getting Started][React Getting Started] guide. Also, see [Related Projects](#related-projects) below.
|
23
23
|
|
24
24
|
## Installation
|
25
25
|
|
@@ -224,7 +224,7 @@ end
|
|
224
224
|
|
225
225
|
This custom renderer behaves the same as a normal view renderer and accepts the usual arguments - `content_type`, `layout`, `location` and `status`.
|
226
226
|
By default, your current layout will be used and the component, rather than a view, will be rendered in place of `yield`. Custom data-* attributes
|
227
|
-
can be passed like `data: {remote: true}`.
|
227
|
+
can be passed like `data: {remote: true}`. Prerendering is set to `true` by default, but can be turned off like any other option: `prerender: false`.
|
228
228
|
|
229
229
|
### Component generator
|
230
230
|
|
@@ -390,8 +390,11 @@ Any subclass of `ExecJSRenderer` may use those hooks (for example, `SprocketsRen
|
|
390
390
|
- [Ruby Hyperloop](http://ruby-hyperloop.io/): Use Ruby to build reactive user interfaces with React.
|
391
391
|
- [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) is a simple live-reloader for `react-rails`.
|
392
392
|
- [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering.
|
393
|
+
- [The Free React on Rails Course](https://learnetto.com/users/hrishio/courses/the-free-react-on-rails-5-course) A free video course which teaches the basics of React and how to get started using it in Rails with `react-rails`.
|
393
394
|
|
394
395
|
## Development
|
395
396
|
|
396
397
|
- Run tests with `rake test` or `appraisal rake test`
|
397
398
|
- Update React assets with `rake react:update`
|
399
|
+
|
400
|
+
[React Getting Started]: https://facebook.github.io/react/docs/getting-started.html
|
@@ -45,7 +45,7 @@
|
|
45
45
|
/***/ function(module, exports, __webpack_require__) {
|
46
46
|
|
47
47
|
/* WEBPACK VAR INJECTION */(function(global) {var React = __webpack_require__(1);
|
48
|
-
var ReactDOMServer = __webpack_require__(
|
48
|
+
var ReactDOMServer = __webpack_require__(199);
|
49
49
|
|
50
50
|
React.addons = __webpack_require__(178);
|
51
51
|
|
@@ -346,8 +346,15 @@
|
|
346
346
|
/* 4 */
|
347
347
|
/***/ function(module, exports) {
|
348
348
|
|
349
|
+
/*
|
350
|
+
object-assign
|
351
|
+
(c) Sindre Sorhus
|
352
|
+
@license MIT
|
353
|
+
*/
|
354
|
+
|
349
355
|
'use strict';
|
350
356
|
/* eslint-disable no-unused-vars */
|
357
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
351
358
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
352
359
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
353
360
|
|
@@ -368,7 +375,7 @@
|
|
368
375
|
// Detect buggy property enumeration order in older V8 versions.
|
369
376
|
|
370
377
|
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
371
|
-
var test1 = new String('abc'); // eslint-disable-line
|
378
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
372
379
|
test1[5] = 'de';
|
373
380
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
374
381
|
return false;
|
@@ -397,7 +404,7 @@
|
|
397
404
|
}
|
398
405
|
|
399
406
|
return true;
|
400
|
-
} catch (
|
407
|
+
} catch (err) {
|
401
408
|
// We don't expect any of the above to throw, but better to be safe.
|
402
409
|
return false;
|
403
410
|
}
|
@@ -417,8 +424,8 @@
|
|
417
424
|
}
|
418
425
|
}
|
419
426
|
|
420
|
-
if (
|
421
|
-
symbols =
|
427
|
+
if (getOwnPropertySymbols) {
|
428
|
+
symbols = getOwnPropertySymbols(from);
|
422
429
|
for (var i = 0; i < symbols.length; i++) {
|
423
430
|
if (propIsEnumerable.call(from, symbols[i])) {
|
424
431
|
to[symbols[i]] = from[symbols[i]];
|
@@ -698,17 +705,6 @@
|
|
698
705
|
}
|
699
706
|
};
|
700
707
|
|
701
|
-
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
702
|
-
var Klass = this;
|
703
|
-
if (Klass.instancePool.length) {
|
704
|
-
var instance = Klass.instancePool.pop();
|
705
|
-
Klass.call(instance, a1, a2, a3, a4, a5);
|
706
|
-
return instance;
|
707
|
-
} else {
|
708
|
-
return new Klass(a1, a2, a3, a4, a5);
|
709
|
-
}
|
710
|
-
};
|
711
|
-
|
712
708
|
var standardReleaser = function (instance) {
|
713
709
|
var Klass = this;
|
714
710
|
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
@@ -748,8 +744,7 @@
|
|
748
744
|
oneArgumentPooler: oneArgumentPooler,
|
749
745
|
twoArgumentPooler: twoArgumentPooler,
|
750
746
|
threeArgumentPooler: threeArgumentPooler,
|
751
|
-
fourArgumentPooler: fourArgumentPooler
|
752
|
-
fiveArgumentPooler: fiveArgumentPooler
|
747
|
+
fourArgumentPooler: fourArgumentPooler
|
753
748
|
};
|
754
749
|
|
755
750
|
module.exports = PooledClass;
|
@@ -825,12 +820,18 @@
|
|
825
820
|
* will remain to ensure logic does not differ in production.
|
826
821
|
*/
|
827
822
|
|
828
|
-
function
|
829
|
-
|
823
|
+
var validateFormat = function validateFormat(format) {};
|
824
|
+
|
825
|
+
if (process.env.NODE_ENV !== 'production') {
|
826
|
+
validateFormat = function validateFormat(format) {
|
830
827
|
if (format === undefined) {
|
831
828
|
throw new Error('invariant requires an error message argument');
|
832
829
|
}
|
833
|
-
}
|
830
|
+
};
|
831
|
+
}
|
832
|
+
|
833
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
834
|
+
validateFormat(format);
|
834
835
|
|
835
836
|
if (!condition) {
|
836
837
|
var error;
|
@@ -3083,7 +3084,14 @@
|
|
3083
3084
|
// We warn in this case but don't throw. We expect the element creation to
|
3084
3085
|
// succeed and there will likely be errors in render.
|
3085
3086
|
if (!validType) {
|
3086
|
-
|
3087
|
+
if (typeof type !== 'function' && typeof type !== 'string') {
|
3088
|
+
var info = '';
|
3089
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
3090
|
+
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
|
3091
|
+
}
|
3092
|
+
info += getDeclarationErrorAddendum();
|
3093
|
+
process.env.NODE_ENV !== '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;
|
3094
|
+
}
|
3087
3095
|
}
|
3088
3096
|
|
3089
3097
|
var element = ReactElement.createElement.apply(this, arguments);
|
@@ -4054,7 +4062,7 @@
|
|
4054
4062
|
|
4055
4063
|
'use strict';
|
4056
4064
|
|
4057
|
-
module.exports = '15.4.
|
4065
|
+
module.exports = '15.4.2';
|
4058
4066
|
|
4059
4067
|
/***/ },
|
4060
4068
|
/* 31 */
|
@@ -4244,6 +4252,13 @@
|
|
4244
4252
|
|
4245
4253
|
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
4246
4254
|
|
4255
|
+
/**
|
4256
|
+
* Check if a given node should be cached.
|
4257
|
+
*/
|
4258
|
+
function shouldPrecacheNode(node, nodeID) {
|
4259
|
+
return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
|
4260
|
+
}
|
4261
|
+
|
4247
4262
|
/**
|
4248
4263
|
* Drill down (through composites and empty components) until we get a host or
|
4249
4264
|
* host text component.
|
@@ -4309,7 +4324,7 @@
|
|
4309
4324
|
}
|
4310
4325
|
// We assume the child nodes are in the same order as the child instances.
|
4311
4326
|
for (; childNode !== null; childNode = childNode.nextSibling) {
|
4312
|
-
if (
|
4327
|
+
if (shouldPrecacheNode(childNode, childID)) {
|
4313
4328
|
precacheNode(childInst, childNode);
|
4314
4329
|
continue outer;
|
4315
4330
|
}
|
@@ -6550,17 +6565,6 @@
|
|
6550
6565
|
}
|
6551
6566
|
};
|
6552
6567
|
|
6553
|
-
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
6554
|
-
var Klass = this;
|
6555
|
-
if (Klass.instancePool.length) {
|
6556
|
-
var instance = Klass.instancePool.pop();
|
6557
|
-
Klass.call(instance, a1, a2, a3, a4, a5);
|
6558
|
-
return instance;
|
6559
|
-
} else {
|
6560
|
-
return new Klass(a1, a2, a3, a4, a5);
|
6561
|
-
}
|
6562
|
-
};
|
6563
|
-
|
6564
6568
|
var standardReleaser = function (instance) {
|
6565
6569
|
var Klass = this;
|
6566
6570
|
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
@@ -6600,8 +6604,7 @@
|
|
6600
6604
|
oneArgumentPooler: oneArgumentPooler,
|
6601
6605
|
twoArgumentPooler: twoArgumentPooler,
|
6602
6606
|
threeArgumentPooler: threeArgumentPooler,
|
6603
|
-
fourArgumentPooler: fourArgumentPooler
|
6604
|
-
fiveArgumentPooler: fiveArgumentPooler
|
6607
|
+
fourArgumentPooler: fourArgumentPooler
|
6605
6608
|
};
|
6606
6609
|
|
6607
6610
|
module.exports = PooledClass;
|
@@ -11419,12 +11422,18 @@
|
|
11419
11422
|
} else {
|
11420
11423
|
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
11421
11424
|
var childrenToUse = contentToUse != null ? null : props.children;
|
11425
|
+
// TODO: Validate that text is allowed as a child of this node
|
11422
11426
|
if (contentToUse != null) {
|
11423
|
-
//
|
11424
|
-
|
11425
|
-
|
11427
|
+
// Avoid setting textContent when the text is empty. In IE11 setting
|
11428
|
+
// textContent on a text area will cause the placeholder to not
|
11429
|
+
// show within the textarea until it has been focused and blurred again.
|
11430
|
+
// https://github.com/facebook/react/issues/6731#issuecomment-254874553
|
11431
|
+
if (contentToUse !== '') {
|
11432
|
+
if (process.env.NODE_ENV !== 'production') {
|
11433
|
+
setAndValidateContentChildDev.call(this, contentToUse);
|
11434
|
+
}
|
11435
|
+
DOMLazyTree.queueText(lazyTree, contentToUse);
|
11426
11436
|
}
|
11427
|
-
DOMLazyTree.queueText(lazyTree, contentToUse);
|
11428
11437
|
} else if (childrenToUse != null) {
|
11429
11438
|
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
11430
11439
|
for (var i = 0; i < mountImages.length; i++) {
|
@@ -13344,7 +13353,17 @@
|
|
13344
13353
|
}
|
13345
13354
|
} else {
|
13346
13355
|
if (props.value == null && props.defaultValue != null) {
|
13347
|
-
|
13356
|
+
// In Chrome, assigning defaultValue to certain input types triggers input validation.
|
13357
|
+
// For number inputs, the display value loses trailing decimal points. For email inputs,
|
13358
|
+
// Chrome raises "The specified value <x> is not a valid email address".
|
13359
|
+
//
|
13360
|
+
// Here we check to see if the defaultValue has actually changed, avoiding these problems
|
13361
|
+
// when the user is inputting text
|
13362
|
+
//
|
13363
|
+
// https://github.com/facebook/react/issues/7253
|
13364
|
+
if (node.defaultValue !== '' + props.defaultValue) {
|
13365
|
+
node.defaultValue = '' + props.defaultValue;
|
13366
|
+
}
|
13348
13367
|
}
|
13349
13368
|
if (props.checked == null && props.defaultChecked != null) {
|
13350
13369
|
node.defaultChecked = !!props.defaultChecked;
|
@@ -14091,9 +14110,15 @@
|
|
14091
14110
|
// This is in postMount because we need access to the DOM node, which is not
|
14092
14111
|
// available until after the component has mounted.
|
14093
14112
|
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
14113
|
+
var textContent = node.textContent;
|
14094
14114
|
|
14095
|
-
//
|
14096
|
-
|
14115
|
+
// Only set node.value if textContent is equal to the expected
|
14116
|
+
// initial value. In IE10/IE11 there is a bug where the placeholder attribute
|
14117
|
+
// will populate textContent as well.
|
14118
|
+
// https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
|
14119
|
+
if (textContent === inst._wrapperState.initialValue) {
|
14120
|
+
node.value = textContent;
|
14121
|
+
}
|
14097
14122
|
}
|
14098
14123
|
};
|
14099
14124
|
|
@@ -14895,7 +14920,17 @@
|
|
14895
14920
|
instance = ReactEmptyComponent.create(instantiateReactComponent);
|
14896
14921
|
} else if (typeof node === 'object') {
|
14897
14922
|
var element = node;
|
14898
|
-
|
14923
|
+
var type = element.type;
|
14924
|
+
if (typeof type !== 'function' && typeof type !== 'string') {
|
14925
|
+
var info = '';
|
14926
|
+
if (process.env.NODE_ENV !== 'production') {
|
14927
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
14928
|
+
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
|
14929
|
+
}
|
14930
|
+
}
|
14931
|
+
info += getDeclarationErrorAddendum(element._owner);
|
14932
|
+
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element 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) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
|
14933
|
+
}
|
14899
14934
|
|
14900
14935
|
// Special case string values
|
14901
14936
|
if (typeof element.type === 'string') {
|
@@ -15185,7 +15220,7 @@
|
|
15185
15220
|
// Since plain JS classes are defined without any special initialization
|
15186
15221
|
// logic, we can not catch common errors early. Therefore, we have to
|
15187
15222
|
// catch them here, at initialization time, instead.
|
15188
|
-
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
15223
|
+
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
15189
15224
|
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
15190
15225
|
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
15191
15226
|
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
@@ -16189,14 +16224,11 @@
|
|
16189
16224
|
|
16190
16225
|
'use strict';
|
16191
16226
|
|
16192
|
-
var _prodInvariant = __webpack_require__(35)
|
16193
|
-
_assign = __webpack_require__(4);
|
16227
|
+
var _prodInvariant = __webpack_require__(35);
|
16194
16228
|
|
16195
16229
|
var invariant = __webpack_require__(8);
|
16196
16230
|
|
16197
16231
|
var genericComponentClass = null;
|
16198
|
-
// This registry keeps track of wrapper classes around host tags.
|
16199
|
-
var tagToComponentClass = {};
|
16200
16232
|
var textComponentClass = null;
|
16201
16233
|
|
16202
16234
|
var ReactHostComponentInjection = {
|
@@ -16209,11 +16241,6 @@
|
|
16209
16241
|
// rendered as props.
|
16210
16242
|
injectTextComponentClass: function (componentClass) {
|
16211
16243
|
textComponentClass = componentClass;
|
16212
|
-
},
|
16213
|
-
// This accepts a keyed object with classes as values. Each key represents a
|
16214
|
-
// tag. That particular tag will use this class instead of the generic one.
|
16215
|
-
injectComponentClasses: function (componentClasses) {
|
16216
|
-
_assign(tagToComponentClass, componentClasses);
|
16217
16244
|
}
|
16218
16245
|
};
|
16219
16246
|
|
@@ -18253,10 +18280,10 @@
|
|
18253
18280
|
*/
|
18254
18281
|
|
18255
18282
|
function getUnboundedScrollPosition(scrollable) {
|
18256
|
-
if (scrollable
|
18283
|
+
if (scrollable.Window && scrollable instanceof scrollable.Window) {
|
18257
18284
|
return {
|
18258
|
-
x:
|
18259
|
-
y:
|
18285
|
+
x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
|
18286
|
+
y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
|
18260
18287
|
};
|
18261
18288
|
}
|
18262
18289
|
return {
|
@@ -19005,7 +19032,9 @@
|
|
19005
19032
|
* @return {boolean} Whether or not the object is a DOM node.
|
19006
19033
|
*/
|
19007
19034
|
function isNode(object) {
|
19008
|
-
|
19035
|
+
var doc = object ? object.ownerDocument || object : document;
|
19036
|
+
var defaultView = doc.defaultView || window;
|
19037
|
+
return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
19009
19038
|
}
|
19010
19039
|
|
19011
19040
|
module.exports = isNode;
|
@@ -19035,15 +19064,19 @@
|
|
19035
19064
|
*
|
19036
19065
|
* The activeElement will be null only if the document or document body is not
|
19037
19066
|
* yet defined.
|
19067
|
+
*
|
19068
|
+
* @param {?DOMDocument} doc Defaults to current document.
|
19069
|
+
* @return {?DOMElement}
|
19038
19070
|
*/
|
19039
|
-
function getActiveElement() /*?DOMElement*/{
|
19040
|
-
|
19071
|
+
function getActiveElement(doc) /*?DOMElement*/{
|
19072
|
+
doc = doc || (typeof document !== 'undefined' ? document : undefined);
|
19073
|
+
if (typeof doc === 'undefined') {
|
19041
19074
|
return null;
|
19042
19075
|
}
|
19043
19076
|
try {
|
19044
|
-
return
|
19077
|
+
return doc.activeElement || doc.body;
|
19045
19078
|
} catch (e) {
|
19046
|
-
return
|
19079
|
+
return doc.body;
|
19047
19080
|
}
|
19048
19081
|
}
|
19049
19082
|
|
@@ -21068,7 +21101,7 @@
|
|
21068
21101
|
|
21069
21102
|
'use strict';
|
21070
21103
|
|
21071
|
-
module.exports = '15.4.
|
21104
|
+
module.exports = '15.4.2';
|
21072
21105
|
|
21073
21106
|
/***/ },
|
21074
21107
|
/* 172 */
|
@@ -21458,15 +21491,15 @@
|
|
21458
21491
|
|
21459
21492
|
/* WEBPACK VAR INJECTION */(function(process) {var addons = {};
|
21460
21493
|
addons.TransitionGroup = __webpack_require__(179);
|
21461
|
-
addons.CSSTransitionGroup = __webpack_require__(
|
21494
|
+
addons.CSSTransitionGroup = __webpack_require__(183);
|
21462
21495
|
addons.LinkedStateMixin = __webpack_require__(193);
|
21463
|
-
addons.createFragment = __webpack_require__(
|
21464
|
-
addons.update = __webpack_require__(
|
21465
|
-
addons.PureRenderMixin = __webpack_require__(
|
21496
|
+
addons.createFragment = __webpack_require__(194);
|
21497
|
+
addons.update = __webpack_require__(195);
|
21498
|
+
addons.PureRenderMixin = __webpack_require__(196);
|
21466
21499
|
|
21467
21500
|
if (process.env.NODE_ENV !== "production") {
|
21468
|
-
addons.TestUtils = __webpack_require__(
|
21469
|
-
addons.Perf = __webpack_require__(
|
21501
|
+
addons.TestUtils = __webpack_require__(197);
|
21502
|
+
addons.Perf = __webpack_require__(198);
|
21470
21503
|
}
|
21471
21504
|
|
21472
21505
|
module.exports = addons;
|
@@ -21483,7 +21516,7 @@
|
|
21483
21516
|
/* 180 */
|
21484
21517
|
/***/ function(module, exports, __webpack_require__) {
|
21485
21518
|
|
21486
|
-
|
21519
|
+
/**
|
21487
21520
|
* Copyright 2013-present, Facebook, Inc.
|
21488
21521
|
* All rights reserved.
|
21489
21522
|
*
|
@@ -21504,8 +21537,7 @@
|
|
21504
21537
|
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; }
|
21505
21538
|
|
21506
21539
|
var React = __webpack_require__(2);
|
21507
|
-
var
|
21508
|
-
var ReactTransitionChildMapping = __webpack_require__(186);
|
21540
|
+
var ReactTransitionChildMapping = __webpack_require__(181);
|
21509
21541
|
|
21510
21542
|
var emptyFunction = __webpack_require__(12);
|
21511
21543
|
|
@@ -21548,12 +21580,7 @@
|
|
21548
21580
|
|
21549
21581
|
delete _this.currentlyTransitioningKeys[key];
|
21550
21582
|
|
21551
|
-
var currentChildMapping;
|
21552
|
-
if (process.env.NODE_ENV !== 'production') {
|
21553
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
21554
|
-
} else {
|
21555
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21556
|
-
}
|
21583
|
+
var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21557
21584
|
|
21558
21585
|
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
21559
21586
|
// This was removed before it had fully appeared. Remove it.
|
@@ -21577,12 +21604,7 @@
|
|
21577
21604
|
|
21578
21605
|
delete _this.currentlyTransitioningKeys[key];
|
21579
21606
|
|
21580
|
-
var currentChildMapping;
|
21581
|
-
if (process.env.NODE_ENV !== 'production') {
|
21582
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
21583
|
-
} else {
|
21584
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21585
|
-
}
|
21607
|
+
var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21586
21608
|
|
21587
21609
|
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
21588
21610
|
// This was removed before it had fully entered. Remove it.
|
@@ -21609,12 +21631,7 @@
|
|
21609
21631
|
|
21610
21632
|
delete _this.currentlyTransitioningKeys[key];
|
21611
21633
|
|
21612
|
-
var currentChildMapping;
|
21613
|
-
if (process.env.NODE_ENV !== 'production') {
|
21614
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
21615
|
-
} else {
|
21616
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21617
|
-
}
|
21634
|
+
var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
21618
21635
|
|
21619
21636
|
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
|
21620
21637
|
// This entered again before it fully left. Add it again.
|
@@ -21645,12 +21662,7 @@
|
|
21645
21662
|
};
|
21646
21663
|
|
21647
21664
|
ReactTransitionGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
21648
|
-
var nextChildMapping;
|
21649
|
-
if (process.env.NODE_ENV !== 'production') {
|
21650
|
-
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(this)._debugID);
|
21651
|
-
} else {
|
21652
|
-
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
|
21653
|
-
}
|
21665
|
+
var nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
|
21654
21666
|
var prevChildMapping = this.state.children;
|
21655
21667
|
|
21656
21668
|
this.setState({
|
@@ -21732,7 +21744,6 @@
|
|
21732
21744
|
|
21733
21745
|
|
21734
21746
|
module.exports = ReactTransitionGroup;
|
21735
|
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
21736
21747
|
|
21737
21748
|
/***/ },
|
21738
21749
|
/* 181 */
|
@@ -21750,29 +21761,96 @@
|
|
21750
21761
|
|
21751
21762
|
'use strict';
|
21752
21763
|
|
21753
|
-
var
|
21754
|
-
var ReactInstanceMap = __webpack_require__(116);
|
21764
|
+
var flattenChildren = __webpack_require__(182);
|
21755
21765
|
|
21756
|
-
|
21757
|
-
|
21758
|
-
|
21766
|
+
var ReactTransitionChildMapping = {
|
21767
|
+
/**
|
21768
|
+
* Given `this.props.children`, return an object mapping key to child. Just
|
21769
|
+
* simple syntactic sugar around flattenChildren().
|
21770
|
+
*
|
21771
|
+
* @param {*} children `this.props.children`
|
21772
|
+
* @param {number=} selfDebugID Optional debugID of the current internal instance.
|
21773
|
+
* @return {object} Mapping of key to child
|
21774
|
+
*/
|
21775
|
+
getChildMapping: function (children, selfDebugID) {
|
21776
|
+
if (!children) {
|
21777
|
+
return children;
|
21778
|
+
}
|
21759
21779
|
|
21760
|
-
|
21761
|
-
|
21762
|
-
|
21780
|
+
if (process.env.NODE_ENV !== 'production') {
|
21781
|
+
return flattenChildren(children, selfDebugID);
|
21782
|
+
}
|
21763
21783
|
|
21764
|
-
|
21765
|
-
|
21766
|
-
var ReactTestUtils = __webpack_require__(183);
|
21784
|
+
return flattenChildren(children);
|
21785
|
+
},
|
21767
21786
|
|
21768
|
-
|
21769
|
-
|
21770
|
-
|
21787
|
+
/**
|
21788
|
+
* When you're adding or removing children some may be added or removed in the
|
21789
|
+
* same render pass. We want to show *both* since we want to simultaneously
|
21790
|
+
* animate elements in and out. This function takes a previous set of keys
|
21791
|
+
* and a new set of keys and merges them with its best guess of the correct
|
21792
|
+
* ordering. In the future we may expose some of the utilities in
|
21793
|
+
* ReactMultiChild to make this easy, but for now React itself does not
|
21794
|
+
* directly have this concept of the union of prevChildren and nextChildren
|
21795
|
+
* so we implement it here.
|
21796
|
+
*
|
21797
|
+
* @param {object} prev prev children as returned from
|
21798
|
+
* `ReactTransitionChildMapping.getChildMapping()`.
|
21799
|
+
* @param {object} next next children as returned from
|
21800
|
+
* `ReactTransitionChildMapping.getChildMapping()`.
|
21801
|
+
* @return {object} a key set that contains all keys in `prev` and all keys
|
21802
|
+
* in `next` in a reasonable order.
|
21803
|
+
*/
|
21804
|
+
mergeChildMappings: function (prev, next) {
|
21805
|
+
prev = prev || {};
|
21806
|
+
next = next || {};
|
21771
21807
|
|
21772
|
-
|
21773
|
-
|
21774
|
-
|
21775
|
-
|
21808
|
+
function getValueForKey(key) {
|
21809
|
+
if (next.hasOwnProperty(key)) {
|
21810
|
+
return next[key];
|
21811
|
+
} else {
|
21812
|
+
return prev[key];
|
21813
|
+
}
|
21814
|
+
}
|
21815
|
+
|
21816
|
+
// For each key of `next`, the list of keys to insert before that key in
|
21817
|
+
// the combined list
|
21818
|
+
var nextKeysPending = {};
|
21819
|
+
|
21820
|
+
var pendingKeys = [];
|
21821
|
+
for (var prevKey in prev) {
|
21822
|
+
if (next.hasOwnProperty(prevKey)) {
|
21823
|
+
if (pendingKeys.length) {
|
21824
|
+
nextKeysPending[prevKey] = pendingKeys;
|
21825
|
+
pendingKeys = [];
|
21826
|
+
}
|
21827
|
+
} else {
|
21828
|
+
pendingKeys.push(prevKey);
|
21829
|
+
}
|
21830
|
+
}
|
21831
|
+
|
21832
|
+
var i;
|
21833
|
+
var childMapping = {};
|
21834
|
+
for (var nextKey in next) {
|
21835
|
+
if (nextKeysPending.hasOwnProperty(nextKey)) {
|
21836
|
+
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
21837
|
+
var pendingNextKey = nextKeysPending[nextKey][i];
|
21838
|
+
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
21839
|
+
}
|
21840
|
+
}
|
21841
|
+
childMapping[nextKey] = getValueForKey(nextKey);
|
21842
|
+
}
|
21843
|
+
|
21844
|
+
// Finally, add the keys which didn't appear before any key in `next`
|
21845
|
+
for (i = 0; i < pendingKeys.length; i++) {
|
21846
|
+
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
21847
|
+
}
|
21848
|
+
|
21849
|
+
return childMapping;
|
21850
|
+
}
|
21851
|
+
};
|
21852
|
+
|
21853
|
+
module.exports = ReactTransitionChildMapping;
|
21776
21854
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
21777
21855
|
|
21778
21856
|
/***/ },
|
@@ -21780,7 +21858,7 @@
|
|
21780
21858
|
/***/ function(module, exports, __webpack_require__) {
|
21781
21859
|
|
21782
21860
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
21783
|
-
* Copyright
|
21861
|
+
* Copyright 2013-present, Facebook, Inc.
|
21784
21862
|
* All rights reserved.
|
21785
21863
|
*
|
21786
21864
|
* This source code is licensed under the BSD-style license found in the
|
@@ -21792,1010 +21870,906 @@
|
|
21792
21870
|
|
21793
21871
|
'use strict';
|
21794
21872
|
|
21795
|
-
var
|
21796
|
-
|
21797
|
-
var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
21798
|
-
|
21799
|
-
var ReactDebugTool = __webpack_require__(63);
|
21873
|
+
var KeyEscapeUtils = __webpack_require__(17);
|
21874
|
+
var traverseAllChildren = __webpack_require__(15);
|
21800
21875
|
var warning = __webpack_require__(11);
|
21801
|
-
var alreadyWarned = false;
|
21802
21876
|
|
21803
|
-
|
21804
|
-
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
21805
|
-
|
21806
|
-
var n = Math.pow(10, base);
|
21807
|
-
return Math.floor(val * n) / n;
|
21808
|
-
}
|
21877
|
+
var ReactComponentTreeHook;
|
21809
21878
|
|
21810
|
-
|
21811
|
-
|
21812
|
-
|
21813
|
-
|
21879
|
+
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
|
21880
|
+
// Temporary hack.
|
21881
|
+
// Inline requires don't work well with Jest:
|
21882
|
+
// https://github.com/facebook/react/issues/7240
|
21883
|
+
// Remove the inline requires when we don't need them anymore:
|
21884
|
+
// https://github.com/facebook/react/pull/7178
|
21885
|
+
ReactComponentTreeHook = __webpack_require__(26);
|
21814
21886
|
}
|
21815
21887
|
|
21816
|
-
|
21817
|
-
|
21818
|
-
|
21819
|
-
|
21820
|
-
|
21821
|
-
|
21822
|
-
|
21888
|
+
/**
|
21889
|
+
* @param {function} traverseContext Context passed through traversal.
|
21890
|
+
* @param {?ReactComponent} child React child component.
|
21891
|
+
* @param {!string} name String name of key path to child.
|
21892
|
+
* @param {number=} selfDebugID Optional debugID of the current internal instance.
|
21893
|
+
*/
|
21894
|
+
function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
|
21895
|
+
// We found a component instance.
|
21896
|
+
if (traverseContext && typeof traverseContext === 'object') {
|
21897
|
+
var result = traverseContext;
|
21898
|
+
var keyUnique = result[name] === undefined;
|
21899
|
+
if (process.env.NODE_ENV !== 'production') {
|
21900
|
+
if (!ReactComponentTreeHook) {
|
21901
|
+
ReactComponentTreeHook = __webpack_require__(26);
|
21902
|
+
}
|
21903
|
+
if (!keyUnique) {
|
21904
|
+
process.env.NODE_ENV !== '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;
|
21905
|
+
}
|
21906
|
+
}
|
21907
|
+
if (keyUnique && child != null) {
|
21908
|
+
result[name] = child;
|
21909
|
+
}
|
21823
21910
|
}
|
21824
21911
|
}
|
21825
21912
|
|
21826
|
-
|
21827
|
-
|
21828
|
-
|
21829
|
-
|
21913
|
+
/**
|
21914
|
+
* Flattens children that are typically specified as `props.children`. Any null
|
21915
|
+
* children will not be included in the resulting object.
|
21916
|
+
* @return {!object} flattened children keyed by name.
|
21917
|
+
*/
|
21918
|
+
function flattenChildren(children, selfDebugID) {
|
21919
|
+
if (children == null) {
|
21920
|
+
return children;
|
21830
21921
|
}
|
21922
|
+
var result = {};
|
21831
21923
|
|
21832
|
-
|
21924
|
+
if (process.env.NODE_ENV !== 'production') {
|
21925
|
+
traverseAllChildren(children, function (traverseContext, child, name) {
|
21926
|
+
return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
|
21927
|
+
}, result);
|
21928
|
+
} else {
|
21929
|
+
traverseAllChildren(children, flattenSingleChildIntoContext, result);
|
21930
|
+
}
|
21931
|
+
return result;
|
21833
21932
|
}
|
21834
21933
|
|
21835
|
-
|
21836
|
-
|
21934
|
+
module.exports = flattenChildren;
|
21935
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
21837
21936
|
|
21838
|
-
|
21839
|
-
|
21840
|
-
|
21841
|
-
}
|
21937
|
+
/***/ },
|
21938
|
+
/* 183 */
|
21939
|
+
/***/ function(module, exports, __webpack_require__) {
|
21842
21940
|
|
21843
|
-
|
21844
|
-
var affectedIDs = {};
|
21941
|
+
module.exports = __webpack_require__(184);
|
21845
21942
|
|
21846
|
-
|
21847
|
-
|
21943
|
+
/***/ },
|
21944
|
+
/* 184 */
|
21945
|
+
/***/ function(module, exports, __webpack_require__) {
|
21848
21946
|
|
21849
|
-
|
21850
|
-
|
21851
|
-
|
21852
|
-
|
21853
|
-
|
21854
|
-
|
21855
|
-
|
21856
|
-
|
21857
|
-
|
21858
|
-
totalDuration: 0
|
21859
|
-
};
|
21860
|
-
}
|
21861
|
-
if (!stats.durations[timerType]) {
|
21862
|
-
stats.durations[timerType] = 0;
|
21863
|
-
}
|
21864
|
-
if (!stats.counts[timerType]) {
|
21865
|
-
stats.counts[timerType] = 0;
|
21866
|
-
}
|
21867
|
-
affectedIDs[key][instanceID] = true;
|
21868
|
-
applyUpdate(stats);
|
21869
|
-
}
|
21947
|
+
/**
|
21948
|
+
* Copyright 2013-present, Facebook, Inc.
|
21949
|
+
* All rights reserved.
|
21950
|
+
*
|
21951
|
+
* This source code is licensed under the BSD-style license found in the
|
21952
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
21953
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
21954
|
+
*
|
21955
|
+
*/
|
21870
21956
|
|
21871
|
-
|
21872
|
-
var measurements = flush.measurements,
|
21873
|
-
treeSnapshot = flush.treeSnapshot;
|
21957
|
+
'use strict';
|
21874
21958
|
|
21875
|
-
|
21876
|
-
var duration = measurement.duration,
|
21877
|
-
instanceID = measurement.instanceID,
|
21878
|
-
timerType = measurement.timerType;
|
21959
|
+
var _assign = __webpack_require__(4);
|
21879
21960
|
|
21880
|
-
|
21881
|
-
stats.totalDuration += duration;
|
21882
|
-
stats.durations[timerType] += duration;
|
21883
|
-
stats.counts[timerType]++;
|
21884
|
-
});
|
21885
|
-
});
|
21886
|
-
});
|
21961
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
21887
21962
|
|
21888
|
-
|
21889
|
-
return _extends({}, aggregatedStats[key], {
|
21890
|
-
instanceCount: Object.keys(affectedIDs[key]).length
|
21891
|
-
});
|
21892
|
-
}).sort(function (a, b) {
|
21893
|
-
return b.totalDuration - a.totalDuration;
|
21894
|
-
});
|
21895
|
-
}
|
21963
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
21896
21964
|
|
21897
|
-
function
|
21898
|
-
var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
|
21965
|
+
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; }
|
21899
21966
|
|
21900
|
-
|
21901
|
-
warnInProduction();
|
21902
|
-
return [];
|
21903
|
-
}
|
21967
|
+
var React = __webpack_require__(2);
|
21904
21968
|
|
21905
|
-
|
21906
|
-
|
21969
|
+
var ReactTransitionGroup = __webpack_require__(180);
|
21970
|
+
var ReactCSSTransitionGroupChild = __webpack_require__(185);
|
21907
21971
|
|
21908
|
-
|
21909
|
-
|
21910
|
-
|
21911
|
-
ownerID = _treeSnapshot$instanc.ownerID;
|
21972
|
+
function createTransitionTimeoutPropValidator(transitionType) {
|
21973
|
+
var timeoutPropName = 'transition' + transitionType + 'Timeout';
|
21974
|
+
var enabledPropName = 'transition' + transitionType;
|
21912
21975
|
|
21913
|
-
|
21914
|
-
|
21915
|
-
|
21916
|
-
|
21917
|
-
|
21918
|
-
|
21919
|
-
|
21920
|
-
|
21921
|
-
|
21922
|
-
|
21923
|
-
}
|
21976
|
+
return function (props) {
|
21977
|
+
// If the transition is enabled
|
21978
|
+
if (props[enabledPropName]) {
|
21979
|
+
// If no timeout duration is provided
|
21980
|
+
if (props[timeoutPropName] == null) {
|
21981
|
+
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.');
|
21982
|
+
|
21983
|
+
// If the duration isn't a number
|
21984
|
+
} else if (typeof props[timeoutPropName] !== 'number') {
|
21985
|
+
return new Error(timeoutPropName + ' must be a number (in milliseconds)');
|
21986
|
+
}
|
21924
21987
|
}
|
21925
|
-
|
21926
|
-
|
21927
|
-
}
|
21988
|
+
};
|
21989
|
+
}
|
21928
21990
|
|
21929
|
-
|
21930
|
-
|
21931
|
-
|
21991
|
+
/**
|
21992
|
+
* An easy way to perform CSS transitions and animations when a React component
|
21993
|
+
* enters or leaves the DOM.
|
21994
|
+
* See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
|
21995
|
+
*/
|
21932
21996
|
|
21933
|
-
|
21934
|
-
|
21935
|
-
timerType = measurement.timerType;
|
21997
|
+
var ReactCSSTransitionGroup = function (_React$Component) {
|
21998
|
+
_inherits(ReactCSSTransitionGroup, _React$Component);
|
21936
21999
|
|
21937
|
-
|
21938
|
-
|
21939
|
-
}
|
21940
|
-
isCompositeByID[instanceID] = true;
|
21941
|
-
});
|
21942
|
-
});
|
22000
|
+
function ReactCSSTransitionGroup() {
|
22001
|
+
var _temp, _this, _ret;
|
21943
22002
|
|
21944
|
-
|
21945
|
-
var measurements = flush.measurements,
|
21946
|
-
treeSnapshot = flush.treeSnapshot;
|
22003
|
+
_classCallCheck(this, ReactCSSTransitionGroup);
|
21947
22004
|
|
21948
|
-
|
21949
|
-
|
21950
|
-
|
21951
|
-
timerType = measurement.timerType;
|
22005
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
22006
|
+
args[_key] = arguments[_key];
|
22007
|
+
}
|
21952
22008
|
|
21953
|
-
|
21954
|
-
|
21955
|
-
|
21956
|
-
|
21957
|
-
|
21958
|
-
|
21959
|
-
|
21960
|
-
|
21961
|
-
|
21962
|
-
|
21963
|
-
|
21964
|
-
|
21965
|
-
|
21966
|
-
|
21967
|
-
|
21968
|
-
nextParentID = treeSnapshot[nextParentID].parentID;
|
21969
|
-
}
|
21970
|
-
});
|
21971
|
-
});
|
22009
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._wrapChild = function (child) {
|
22010
|
+
// We need to provide this childFactory so that
|
22011
|
+
// ReactCSSTransitionGroupChild can receive updates to name, enter, and
|
22012
|
+
// leave while it is leaving.
|
22013
|
+
return React.createElement(ReactCSSTransitionGroupChild, {
|
22014
|
+
name: _this.props.transitionName,
|
22015
|
+
appear: _this.props.transitionAppear,
|
22016
|
+
enter: _this.props.transitionEnter,
|
22017
|
+
leave: _this.props.transitionLeave,
|
22018
|
+
appearTimeout: _this.props.transitionAppearTimeout,
|
22019
|
+
enterTimeout: _this.props.transitionEnterTimeout,
|
22020
|
+
leaveTimeout: _this.props.transitionLeaveTimeout
|
22021
|
+
}, child);
|
22022
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
22023
|
+
}
|
21972
22024
|
|
21973
|
-
|
21974
|
-
return
|
21975
|
-
|
21976
|
-
});
|
21977
|
-
}).sort(function (a, b) {
|
21978
|
-
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
21979
|
-
});
|
21980
|
-
}
|
22025
|
+
ReactCSSTransitionGroup.prototype.render = function render() {
|
22026
|
+
return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
|
22027
|
+
};
|
21981
22028
|
|
21982
|
-
|
21983
|
-
|
22029
|
+
return ReactCSSTransitionGroup;
|
22030
|
+
}(React.Component);
|
21984
22031
|
|
21985
|
-
|
21986
|
-
|
21987
|
-
|
21988
|
-
}
|
22032
|
+
ReactCSSTransitionGroup.displayName = 'ReactCSSTransitionGroup';
|
22033
|
+
ReactCSSTransitionGroup.propTypes = {
|
22034
|
+
transitionName: ReactCSSTransitionGroupChild.propTypes.name,
|
21989
22035
|
|
21990
|
-
|
21991
|
-
|
22036
|
+
transitionAppear: React.PropTypes.bool,
|
22037
|
+
transitionEnter: React.PropTypes.bool,
|
22038
|
+
transitionLeave: React.PropTypes.bool,
|
22039
|
+
transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
|
22040
|
+
transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
|
22041
|
+
transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
|
22042
|
+
};
|
22043
|
+
ReactCSSTransitionGroup.defaultProps = {
|
22044
|
+
transitionAppear: false,
|
22045
|
+
transitionEnter: true,
|
22046
|
+
transitionLeave: true
|
22047
|
+
};
|
21992
22048
|
|
21993
|
-
function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
|
21994
|
-
var _treeSnapshot$instanc2 = treeSnapshot[instanceID],
|
21995
|
-
displayName = _treeSnapshot$instanc2.displayName,
|
21996
|
-
ownerID = _treeSnapshot$instanc2.ownerID;
|
21997
22049
|
|
21998
|
-
|
21999
|
-
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
22000
|
-
var stats = aggregatedStats[key];
|
22001
|
-
if (!stats) {
|
22002
|
-
affectedIDs[key] = {};
|
22003
|
-
stats = aggregatedStats[key] = {
|
22004
|
-
key: key,
|
22005
|
-
instanceCount: 0,
|
22006
|
-
inclusiveRenderDuration: 0,
|
22007
|
-
renderCount: 0
|
22008
|
-
};
|
22009
|
-
}
|
22010
|
-
affectedIDs[key][instanceID] = true;
|
22011
|
-
applyUpdate(stats);
|
22012
|
-
}
|
22050
|
+
module.exports = ReactCSSTransitionGroup;
|
22013
22051
|
|
22014
|
-
|
22015
|
-
|
22016
|
-
|
22017
|
-
operations = flush.operations;
|
22052
|
+
/***/ },
|
22053
|
+
/* 185 */
|
22054
|
+
/***/ function(module, exports, __webpack_require__) {
|
22018
22055
|
|
22019
|
-
|
22056
|
+
/**
|
22057
|
+
* Copyright 2013-present, Facebook, Inc.
|
22058
|
+
* All rights reserved.
|
22059
|
+
*
|
22060
|
+
* This source code is licensed under the BSD-style license found in the
|
22061
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
22062
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
22063
|
+
*
|
22064
|
+
*/
|
22020
22065
|
|
22021
|
-
|
22022
|
-
// Mark all components in their parent tree as definitely not wasted.
|
22023
|
-
operations.forEach(function (operation) {
|
22024
|
-
var instanceID = operation.instanceID;
|
22066
|
+
'use strict';
|
22025
22067
|
|
22026
|
-
|
22027
|
-
|
22028
|
-
isDefinitelyNotWastedByID[nextParentID] = true;
|
22029
|
-
nextParentID = treeSnapshot[nextParentID].parentID;
|
22030
|
-
}
|
22031
|
-
});
|
22068
|
+
var React = __webpack_require__(2);
|
22069
|
+
var ReactAddonsDOMDependencies = __webpack_require__(186);
|
22032
22070
|
|
22033
|
-
|
22034
|
-
|
22035
|
-
var renderedCompositeIDs = {};
|
22036
|
-
measurements.forEach(function (measurement) {
|
22037
|
-
var instanceID = measurement.instanceID,
|
22038
|
-
timerType = measurement.timerType;
|
22071
|
+
var CSSCore = __webpack_require__(191);
|
22072
|
+
var ReactTransitionEvents = __webpack_require__(192);
|
22039
22073
|
|
22040
|
-
|
22041
|
-
return;
|
22042
|
-
}
|
22043
|
-
renderedCompositeIDs[instanceID] = true;
|
22044
|
-
});
|
22074
|
+
var onlyChild = __webpack_require__(31);
|
22045
22075
|
|
22046
|
-
|
22047
|
-
var duration = measurement.duration,
|
22048
|
-
instanceID = measurement.instanceID,
|
22049
|
-
timerType = measurement.timerType;
|
22076
|
+
var TICK = 17;
|
22050
22077
|
|
22051
|
-
|
22052
|
-
|
22078
|
+
var ReactCSSTransitionGroupChild = React.createClass({
|
22079
|
+
displayName: 'ReactCSSTransitionGroupChild',
|
22080
|
+
|
22081
|
+
propTypes: {
|
22082
|
+
name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
|
22083
|
+
enter: React.PropTypes.string,
|
22084
|
+
leave: React.PropTypes.string,
|
22085
|
+
active: React.PropTypes.string
|
22086
|
+
}), React.PropTypes.shape({
|
22087
|
+
enter: React.PropTypes.string,
|
22088
|
+
enterActive: React.PropTypes.string,
|
22089
|
+
leave: React.PropTypes.string,
|
22090
|
+
leaveActive: React.PropTypes.string,
|
22091
|
+
appear: React.PropTypes.string,
|
22092
|
+
appearActive: React.PropTypes.string
|
22093
|
+
})]).isRequired,
|
22094
|
+
|
22095
|
+
// Once we require timeouts to be specified, we can remove the
|
22096
|
+
// boolean flags (appear etc.) and just accept a number
|
22097
|
+
// or a bool for the timeout flags (appearTimeout etc.)
|
22098
|
+
appear: React.PropTypes.bool,
|
22099
|
+
enter: React.PropTypes.bool,
|
22100
|
+
leave: React.PropTypes.bool,
|
22101
|
+
appearTimeout: React.PropTypes.number,
|
22102
|
+
enterTimeout: React.PropTypes.number,
|
22103
|
+
leaveTimeout: React.PropTypes.number
|
22104
|
+
},
|
22105
|
+
|
22106
|
+
transition: function (animationType, finishCallback, userSpecifiedDelay) {
|
22107
|
+
var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
|
22108
|
+
|
22109
|
+
if (!node) {
|
22110
|
+
if (finishCallback) {
|
22111
|
+
finishCallback();
|
22053
22112
|
}
|
22113
|
+
return;
|
22114
|
+
}
|
22054
22115
|
|
22055
|
-
|
22056
|
-
|
22057
|
-
|
22116
|
+
var className = this.props.name[animationType] || this.props.name + '-' + animationType;
|
22117
|
+
var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
|
22118
|
+
var timeout = null;
|
22058
22119
|
|
22059
|
-
|
22120
|
+
var endListener = function (e) {
|
22121
|
+
if (e && e.target !== node) {
|
22060
22122
|
return;
|
22061
22123
|
}
|
22062
22124
|
|
22063
|
-
|
22064
|
-
updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
|
22065
|
-
stats.renderCount++;
|
22066
|
-
});
|
22125
|
+
clearTimeout(timeout);
|
22067
22126
|
|
22068
|
-
|
22069
|
-
|
22070
|
-
// Any parents rendered during this batch are considered wasted
|
22071
|
-
// unless we previously marked them as dirty.
|
22072
|
-
var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
|
22073
|
-
if (isWasted) {
|
22074
|
-
updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
|
22075
|
-
stats.inclusiveRenderDuration += duration;
|
22076
|
-
});
|
22077
|
-
}
|
22078
|
-
nextParentID = treeSnapshot[nextParentID].parentID;
|
22079
|
-
}
|
22080
|
-
});
|
22081
|
-
});
|
22127
|
+
CSSCore.removeClass(node, className);
|
22128
|
+
CSSCore.removeClass(node, activeClassName);
|
22082
22129
|
|
22083
|
-
|
22084
|
-
return _extends({}, aggregatedStats[key], {
|
22085
|
-
instanceCount: Object.keys(affectedIDs[key]).length
|
22086
|
-
});
|
22087
|
-
}).sort(function (a, b) {
|
22088
|
-
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
22089
|
-
});
|
22090
|
-
}
|
22130
|
+
ReactTransitionEvents.removeEndEventListener(node, endListener);
|
22091
22131
|
|
22092
|
-
|
22093
|
-
|
22132
|
+
// Usually this optional callback is used for informing an owner of
|
22133
|
+
// a leave animation and telling it to remove the child.
|
22134
|
+
if (finishCallback) {
|
22135
|
+
finishCallback();
|
22136
|
+
}
|
22137
|
+
};
|
22094
22138
|
|
22095
|
-
|
22096
|
-
warnInProduction();
|
22097
|
-
return [];
|
22098
|
-
}
|
22139
|
+
CSSCore.addClass(node, className);
|
22099
22140
|
|
22100
|
-
|
22101
|
-
|
22102
|
-
var operations = flush.operations,
|
22103
|
-
treeSnapshot = flush.treeSnapshot;
|
22141
|
+
// Need to do this to actually trigger a transition.
|
22142
|
+
this.queueClassAndNode(activeClassName, node);
|
22104
22143
|
|
22105
|
-
|
22106
|
-
|
22107
|
-
|
22108
|
-
|
22109
|
-
|
22110
|
-
|
22111
|
-
|
22144
|
+
// If the user specified a timeout delay.
|
22145
|
+
if (userSpecifiedDelay) {
|
22146
|
+
// Clean-up the animation after the specified delay
|
22147
|
+
timeout = setTimeout(endListener, userSpecifiedDelay);
|
22148
|
+
this.transitionTimeouts.push(timeout);
|
22149
|
+
} else {
|
22150
|
+
// DEPRECATED: this listener will be removed in a future version of react
|
22151
|
+
ReactTransitionEvents.addEndEventListener(node, endListener);
|
22152
|
+
}
|
22153
|
+
},
|
22112
22154
|
|
22113
|
-
|
22114
|
-
|
22155
|
+
queueClassAndNode: function (className, node) {
|
22156
|
+
this.classNameAndNodeQueue.push({
|
22157
|
+
className: className,
|
22158
|
+
node: node
|
22159
|
+
});
|
22115
22160
|
|
22116
|
-
|
22117
|
-
|
22118
|
-
|
22119
|
-
|
22120
|
-
|
22121
|
-
|
22122
|
-
|
22161
|
+
if (!this.timeout) {
|
22162
|
+
this.timeout = setTimeout(this.flushClassNameAndNodeQueue, TICK);
|
22163
|
+
}
|
22164
|
+
},
|
22165
|
+
|
22166
|
+
flushClassNameAndNodeQueue: function () {
|
22167
|
+
if (this.isMounted()) {
|
22168
|
+
this.classNameAndNodeQueue.forEach(function (obj) {
|
22169
|
+
CSSCore.addClass(obj.node, obj.className);
|
22123
22170
|
});
|
22124
|
-
}
|
22125
|
-
|
22126
|
-
|
22127
|
-
|
22171
|
+
}
|
22172
|
+
this.classNameAndNodeQueue.length = 0;
|
22173
|
+
this.timeout = null;
|
22174
|
+
},
|
22128
22175
|
|
22129
|
-
|
22130
|
-
|
22131
|
-
|
22132
|
-
|
22133
|
-
}
|
22176
|
+
componentWillMount: function () {
|
22177
|
+
this.classNameAndNodeQueue = [];
|
22178
|
+
this.transitionTimeouts = [];
|
22179
|
+
},
|
22134
22180
|
|
22135
|
-
|
22136
|
-
|
22137
|
-
|
22138
|
-
|
22139
|
-
|
22181
|
+
componentWillUnmount: function () {
|
22182
|
+
if (this.timeout) {
|
22183
|
+
clearTimeout(this.timeout);
|
22184
|
+
}
|
22185
|
+
this.transitionTimeouts.forEach(function (timeout) {
|
22186
|
+
clearTimeout(timeout);
|
22187
|
+
});
|
22140
22188
|
|
22141
|
-
|
22142
|
-
|
22143
|
-
return {
|
22144
|
-
'Component': key,
|
22145
|
-
'Total time (ms)': roundFloat(totalDuration),
|
22146
|
-
'Instance count': instanceCount,
|
22147
|
-
'Total render time (ms)': roundFloat(renderDuration),
|
22148
|
-
'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
|
22149
|
-
'Render count': renderCount,
|
22150
|
-
'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
|
22151
|
-
};
|
22152
|
-
});
|
22153
|
-
consoleTable(table);
|
22154
|
-
}
|
22189
|
+
this.classNameAndNodeQueue.length = 0;
|
22190
|
+
},
|
22155
22191
|
|
22156
|
-
|
22157
|
-
|
22158
|
-
|
22159
|
-
|
22160
|
-
|
22192
|
+
componentWillAppear: function (done) {
|
22193
|
+
if (this.props.appear) {
|
22194
|
+
this.transition('appear', done, this.props.appearTimeout);
|
22195
|
+
} else {
|
22196
|
+
done();
|
22197
|
+
}
|
22198
|
+
},
|
22161
22199
|
|
22162
|
-
|
22163
|
-
|
22164
|
-
|
22165
|
-
|
22166
|
-
|
22167
|
-
|
22200
|
+
componentWillEnter: function (done) {
|
22201
|
+
if (this.props.enter) {
|
22202
|
+
this.transition('enter', done, this.props.enterTimeout);
|
22203
|
+
} else {
|
22204
|
+
done();
|
22205
|
+
}
|
22206
|
+
},
|
22168
22207
|
|
22169
|
-
|
22170
|
-
|
22171
|
-
'
|
22172
|
-
|
22173
|
-
|
22174
|
-
}
|
22175
|
-
}
|
22176
|
-
consoleTable(table);
|
22177
|
-
}
|
22208
|
+
componentWillLeave: function (done) {
|
22209
|
+
if (this.props.leave) {
|
22210
|
+
this.transition('leave', done, this.props.leaveTimeout);
|
22211
|
+
} else {
|
22212
|
+
done();
|
22213
|
+
}
|
22214
|
+
},
|
22178
22215
|
|
22179
|
-
|
22180
|
-
|
22181
|
-
warnInProduction();
|
22182
|
-
return;
|
22216
|
+
render: function () {
|
22217
|
+
return onlyChild(this.props.children);
|
22183
22218
|
}
|
22219
|
+
});
|
22184
22220
|
|
22185
|
-
|
22186
|
-
var table = stats.map(function (item) {
|
22187
|
-
var key = item.key,
|
22188
|
-
instanceCount = item.instanceCount,
|
22189
|
-
inclusiveRenderDuration = item.inclusiveRenderDuration,
|
22190
|
-
renderCount = item.renderCount;
|
22221
|
+
module.exports = ReactCSSTransitionGroupChild;
|
22191
22222
|
|
22192
|
-
|
22193
|
-
|
22194
|
-
|
22195
|
-
'Instance count': instanceCount,
|
22196
|
-
'Render count': renderCount
|
22197
|
-
};
|
22198
|
-
});
|
22199
|
-
consoleTable(table);
|
22200
|
-
}
|
22201
|
-
|
22202
|
-
function printOperations(flushHistory) {
|
22203
|
-
if (!(process.env.NODE_ENV !== 'production')) {
|
22204
|
-
warnInProduction();
|
22205
|
-
return;
|
22206
|
-
}
|
22207
|
-
|
22208
|
-
var stats = getOperations(flushHistory);
|
22209
|
-
var table = stats.map(function (stat) {
|
22210
|
-
return {
|
22211
|
-
'Owner > Node': stat.key,
|
22212
|
-
'Operation': stat.type,
|
22213
|
-
'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
|
22214
|
-
'Flush index': stat.flushIndex,
|
22215
|
-
'Owner Component ID': stat.ownerID,
|
22216
|
-
'DOM Component ID': stat.instanceID
|
22217
|
-
};
|
22218
|
-
});
|
22219
|
-
consoleTable(table);
|
22220
|
-
}
|
22221
|
-
|
22222
|
-
var warnedAboutPrintDOM = false;
|
22223
|
-
function printDOM(measurements) {
|
22224
|
-
process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
|
22225
|
-
warnedAboutPrintDOM = true;
|
22226
|
-
return printOperations(measurements);
|
22227
|
-
}
|
22223
|
+
/***/ },
|
22224
|
+
/* 186 */
|
22225
|
+
/***/ function(module, exports, __webpack_require__) {
|
22228
22226
|
|
22229
|
-
|
22230
|
-
|
22231
|
-
|
22232
|
-
|
22233
|
-
|
22234
|
-
|
22227
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
22228
|
+
* Copyright 2013-present, Facebook, Inc.
|
22229
|
+
* All rights reserved.
|
22230
|
+
*
|
22231
|
+
* This source code is licensed under the BSD-style license found in the
|
22232
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
22233
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
22234
|
+
*
|
22235
|
+
*/
|
22235
22236
|
|
22236
|
-
|
22237
|
-
if (!(process.env.NODE_ENV !== 'production')) {
|
22238
|
-
warnInProduction();
|
22239
|
-
return;
|
22240
|
-
}
|
22237
|
+
'use strict';
|
22241
22238
|
|
22242
|
-
|
22243
|
-
}
|
22239
|
+
var ReactDOM = __webpack_require__(33);
|
22244
22240
|
|
22245
|
-
function
|
22246
|
-
|
22247
|
-
|
22248
|
-
return;
|
22249
|
-
}
|
22241
|
+
exports.getReactDOM = function () {
|
22242
|
+
return ReactDOM;
|
22243
|
+
};
|
22250
22244
|
|
22251
|
-
|
22252
|
-
|
22245
|
+
if (process.env.NODE_ENV !== 'production') {
|
22246
|
+
var ReactPerf;
|
22247
|
+
var ReactTestUtils;
|
22253
22248
|
|
22254
|
-
|
22255
|
-
|
22256
|
-
|
22257
|
-
|
22258
|
-
|
22249
|
+
exports.getReactPerf = function () {
|
22250
|
+
if (!ReactPerf) {
|
22251
|
+
ReactPerf = __webpack_require__(187);
|
22252
|
+
}
|
22253
|
+
return ReactPerf;
|
22254
|
+
};
|
22259
22255
|
|
22260
|
-
|
22256
|
+
exports.getReactTestUtils = function () {
|
22257
|
+
if (!ReactTestUtils) {
|
22258
|
+
ReactTestUtils = __webpack_require__(188);
|
22259
|
+
}
|
22260
|
+
return ReactTestUtils;
|
22261
|
+
};
|
22261
22262
|
}
|
22262
|
-
|
22263
|
-
var ReactPerfAnalysis = {
|
22264
|
-
getLastMeasurements: getLastMeasurements,
|
22265
|
-
getExclusive: getExclusive,
|
22266
|
-
getInclusive: getInclusive,
|
22267
|
-
getWasted: getWasted,
|
22268
|
-
getOperations: getOperations,
|
22269
|
-
printExclusive: printExclusive,
|
22270
|
-
printInclusive: printInclusive,
|
22271
|
-
printWasted: printWasted,
|
22272
|
-
printOperations: printOperations,
|
22273
|
-
start: start,
|
22274
|
-
stop: stop,
|
22275
|
-
isRunning: isRunning,
|
22276
|
-
// Deprecated:
|
22277
|
-
printDOM: printDOM,
|
22278
|
-
getMeasurementsSummaryMap: getMeasurementsSummaryMap
|
22279
|
-
};
|
22280
|
-
|
22281
|
-
module.exports = ReactPerfAnalysis;
|
22282
22263
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
22283
22264
|
|
22284
22265
|
/***/ },
|
22285
|
-
/*
|
22266
|
+
/* 187 */
|
22286
22267
|
/***/ function(module, exports, __webpack_require__) {
|
22287
22268
|
|
22288
22269
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
22289
|
-
* Copyright
|
22270
|
+
* Copyright 2016-present, Facebook, Inc.
|
22290
22271
|
* All rights reserved.
|
22291
22272
|
*
|
22292
22273
|
* This source code is licensed under the BSD-style license found in the
|
22293
22274
|
* LICENSE file in the root directory of this source tree. An additional grant
|
22294
22275
|
* of patent rights can be found in the PATENTS file in the same directory.
|
22295
22276
|
*
|
22277
|
+
*
|
22296
22278
|
*/
|
22297
22279
|
|
22298
22280
|
'use strict';
|
22299
22281
|
|
22300
|
-
var
|
22301
|
-
_assign = __webpack_require__(4);
|
22282
|
+
var _assign = __webpack_require__(4);
|
22302
22283
|
|
22303
|
-
var
|
22304
|
-
var EventPluginHub = __webpack_require__(42);
|
22305
|
-
var EventPluginRegistry = __webpack_require__(43);
|
22306
|
-
var EventPropagators = __webpack_require__(41);
|
22307
|
-
var React = __webpack_require__(2);
|
22308
|
-
var ReactDOM = __webpack_require__(33);
|
22309
|
-
var ReactDOMComponentTree = __webpack_require__(34);
|
22310
|
-
var ReactBrowserEventEmitter = __webpack_require__(105);
|
22311
|
-
var ReactInstanceMap = __webpack_require__(116);
|
22312
|
-
var ReactUpdates = __webpack_require__(56);
|
22313
|
-
var SyntheticEvent = __webpack_require__(53);
|
22314
|
-
var ReactShallowRenderer = __webpack_require__(185);
|
22284
|
+
var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
22315
22285
|
|
22316
|
-
var
|
22317
|
-
var
|
22286
|
+
var ReactDebugTool = __webpack_require__(63);
|
22287
|
+
var warning = __webpack_require__(11);
|
22288
|
+
var alreadyWarned = false;
|
22318
22289
|
|
22319
|
-
|
22290
|
+
function roundFloat(val) {
|
22291
|
+
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
22320
22292
|
|
22321
|
-
|
22293
|
+
var n = Math.pow(10, base);
|
22294
|
+
return Math.floor(val * n) / n;
|
22295
|
+
}
|
22322
22296
|
|
22323
|
-
|
22324
|
-
|
22325
|
-
|
22297
|
+
// Flow type definition of console.table is too strict right now, see
|
22298
|
+
// https://github.com/facebook/flow/pull/2353 for updates
|
22299
|
+
function consoleTable(table) {
|
22300
|
+
console.table(table);
|
22301
|
+
}
|
22326
22302
|
|
22327
|
-
function
|
22328
|
-
if (
|
22329
|
-
return
|
22303
|
+
function warnInProduction() {
|
22304
|
+
if (alreadyWarned) {
|
22305
|
+
return;
|
22330
22306
|
}
|
22331
|
-
|
22332
|
-
|
22333
|
-
|
22334
|
-
if (ReactTestUtils.isDOMComponent(publicInst)) {
|
22335
|
-
var renderedChildren = inst._renderedChildren;
|
22336
|
-
var key;
|
22337
|
-
for (key in renderedChildren) {
|
22338
|
-
if (!renderedChildren.hasOwnProperty(key)) {
|
22339
|
-
continue;
|
22340
|
-
}
|
22341
|
-
ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
|
22342
|
-
}
|
22343
|
-
} else if (React.isValidElement(currentElement) && typeof currentElement.type === 'function') {
|
22344
|
-
ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
|
22307
|
+
alreadyWarned = true;
|
22308
|
+
if (typeof console !== 'undefined') {
|
22309
|
+
console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.');
|
22345
22310
|
}
|
22346
|
-
return ret;
|
22347
22311
|
}
|
22348
22312
|
|
22349
|
-
|
22350
|
-
|
22351
|
-
|
22352
|
-
|
22353
|
-
|
22354
|
-
* Todo: Support the entire DOM.scry query syntax. For now, these simple
|
22355
|
-
* utilities will suffice for testing purposes.
|
22356
|
-
* @lends ReactTestUtils
|
22357
|
-
*/
|
22358
|
-
var ReactTestUtils = {
|
22359
|
-
renderIntoDocument: function (element) {
|
22360
|
-
var div = document.createElement('div');
|
22361
|
-
// None of our tests actually require attaching the container to the
|
22362
|
-
// DOM, and doing so creates a mess that we rely on test isolation to
|
22363
|
-
// clean up, so we're going to stop honoring the name of this method
|
22364
|
-
// (and probably rename it eventually) if no problems arise.
|
22365
|
-
// document.documentElement.appendChild(div);
|
22366
|
-
return ReactDOM.render(element, div);
|
22367
|
-
},
|
22313
|
+
function getLastMeasurements() {
|
22314
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22315
|
+
warnInProduction();
|
22316
|
+
return [];
|
22317
|
+
}
|
22368
22318
|
|
22369
|
-
|
22370
|
-
|
22371
|
-
},
|
22319
|
+
return ReactDebugTool.getFlushHistory();
|
22320
|
+
}
|
22372
22321
|
|
22373
|
-
|
22374
|
-
|
22375
|
-
},
|
22322
|
+
function getExclusive() {
|
22323
|
+
var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
|
22376
22324
|
|
22377
|
-
|
22378
|
-
|
22379
|
-
|
22325
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22326
|
+
warnInProduction();
|
22327
|
+
return [];
|
22328
|
+
}
|
22380
22329
|
|
22381
|
-
|
22382
|
-
|
22383
|
-
},
|
22330
|
+
var aggregatedStats = {};
|
22331
|
+
var affectedIDs = {};
|
22384
22332
|
|
22385
|
-
|
22386
|
-
|
22387
|
-
// Accessing inst.setState warns; just return false as that'll be what
|
22388
|
-
// this returns when we have DOM nodes as refs directly
|
22389
|
-
return false;
|
22390
|
-
}
|
22391
|
-
return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
|
22392
|
-
},
|
22333
|
+
function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
|
22334
|
+
var displayName = treeSnapshot[instanceID].displayName;
|
22393
22335
|
|
22394
|
-
|
22395
|
-
|
22396
|
-
|
22336
|
+
var key = displayName;
|
22337
|
+
var stats = aggregatedStats[key];
|
22338
|
+
if (!stats) {
|
22339
|
+
affectedIDs[key] = {};
|
22340
|
+
stats = aggregatedStats[key] = {
|
22341
|
+
key: key,
|
22342
|
+
instanceCount: 0,
|
22343
|
+
counts: {},
|
22344
|
+
durations: {},
|
22345
|
+
totalDuration: 0
|
22346
|
+
};
|
22397
22347
|
}
|
22398
|
-
|
22399
|
-
|
22348
|
+
if (!stats.durations[timerType]) {
|
22349
|
+
stats.durations[timerType] = 0;
|
22350
|
+
}
|
22351
|
+
if (!stats.counts[timerType]) {
|
22352
|
+
stats.counts[timerType] = 0;
|
22353
|
+
}
|
22354
|
+
affectedIDs[key][instanceID] = true;
|
22355
|
+
applyUpdate(stats);
|
22356
|
+
}
|
22400
22357
|
|
22401
|
-
|
22402
|
-
|
22358
|
+
flushHistory.forEach(function (flush) {
|
22359
|
+
var measurements = flush.measurements,
|
22360
|
+
treeSnapshot = flush.treeSnapshot;
|
22403
22361
|
|
22404
|
-
|
22405
|
-
|
22406
|
-
|
22407
|
-
|
22408
|
-
// We check the prototype of the type that will get mounted, not the
|
22409
|
-
// instance itself. This is a future proof way of duck typing.
|
22410
|
-
var prototype = inst.type.prototype;
|
22411
|
-
return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
|
22412
|
-
},
|
22362
|
+
measurements.forEach(function (measurement) {
|
22363
|
+
var duration = measurement.duration,
|
22364
|
+
instanceID = measurement.instanceID,
|
22365
|
+
timerType = measurement.timerType;
|
22413
22366
|
|
22414
|
-
|
22415
|
-
|
22416
|
-
|
22367
|
+
updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
|
22368
|
+
stats.totalDuration += duration;
|
22369
|
+
stats.durations[timerType] += duration;
|
22370
|
+
stats.counts[timerType]++;
|
22371
|
+
});
|
22372
|
+
});
|
22373
|
+
});
|
22417
22374
|
|
22418
|
-
|
22419
|
-
|
22375
|
+
return Object.keys(aggregatedStats).map(function (key) {
|
22376
|
+
return _extends({}, aggregatedStats[key], {
|
22377
|
+
instanceCount: Object.keys(affectedIDs[key]).length
|
22378
|
+
});
|
22379
|
+
}).sort(function (a, b) {
|
22380
|
+
return b.totalDuration - a.totalDuration;
|
22381
|
+
});
|
22382
|
+
}
|
22420
22383
|
|
22421
|
-
|
22422
|
-
|
22423
|
-
return null;
|
22424
|
-
}
|
22425
|
-
var internalInstance = ReactInstanceMap.get(inst);
|
22426
|
-
return internalInstance._renderedComponent.getPublicInstance();
|
22427
|
-
},
|
22384
|
+
function getInclusive() {
|
22385
|
+
var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
|
22428
22386
|
|
22429
|
-
|
22430
|
-
|
22431
|
-
|
22432
|
-
|
22433
|
-
!ReactTestUtils.isCompositeComponent(inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
|
22434
|
-
return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
|
22435
|
-
},
|
22387
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22388
|
+
warnInProduction();
|
22389
|
+
return [];
|
22390
|
+
}
|
22436
22391
|
|
22437
|
-
|
22438
|
-
|
22439
|
-
* components with the class name matching `className`.
|
22440
|
-
* @return {array} an array of all the matches.
|
22441
|
-
*/
|
22442
|
-
scryRenderedDOMComponentsWithClass: function (root, classNames) {
|
22443
|
-
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22444
|
-
if (ReactTestUtils.isDOMComponent(inst)) {
|
22445
|
-
var className = inst.className;
|
22446
|
-
if (typeof className !== 'string') {
|
22447
|
-
// SVG, probably.
|
22448
|
-
className = inst.getAttribute('class') || '';
|
22449
|
-
}
|
22450
|
-
var classList = className.split(/\s+/);
|
22392
|
+
var aggregatedStats = {};
|
22393
|
+
var affectedIDs = {};
|
22451
22394
|
|
22452
|
-
|
22453
|
-
|
22454
|
-
|
22455
|
-
|
22456
|
-
return classNames.every(function (name) {
|
22457
|
-
return classList.indexOf(name) !== -1;
|
22458
|
-
});
|
22459
|
-
}
|
22460
|
-
return false;
|
22461
|
-
});
|
22462
|
-
},
|
22395
|
+
function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
|
22396
|
+
var _treeSnapshot$instanc = treeSnapshot[instanceID],
|
22397
|
+
displayName = _treeSnapshot$instanc.displayName,
|
22398
|
+
ownerID = _treeSnapshot$instanc.ownerID;
|
22463
22399
|
|
22464
|
-
|
22465
|
-
|
22466
|
-
|
22467
|
-
|
22468
|
-
|
22469
|
-
|
22470
|
-
|
22471
|
-
|
22472
|
-
|
22473
|
-
|
22400
|
+
var owner = treeSnapshot[ownerID];
|
22401
|
+
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
22402
|
+
var stats = aggregatedStats[key];
|
22403
|
+
if (!stats) {
|
22404
|
+
affectedIDs[key] = {};
|
22405
|
+
stats = aggregatedStats[key] = {
|
22406
|
+
key: key,
|
22407
|
+
instanceCount: 0,
|
22408
|
+
inclusiveRenderDuration: 0,
|
22409
|
+
renderCount: 0
|
22410
|
+
};
|
22474
22411
|
}
|
22475
|
-
|
22476
|
-
|
22412
|
+
affectedIDs[key][instanceID] = true;
|
22413
|
+
applyUpdate(stats);
|
22414
|
+
}
|
22477
22415
|
|
22478
|
-
|
22479
|
-
|
22480
|
-
|
22481
|
-
* @return {array} an array of all the matches.
|
22482
|
-
*/
|
22483
|
-
scryRenderedDOMComponentsWithTag: function (root, tagName) {
|
22484
|
-
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22485
|
-
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
|
22486
|
-
});
|
22487
|
-
},
|
22416
|
+
var isCompositeByID = {};
|
22417
|
+
flushHistory.forEach(function (flush) {
|
22418
|
+
var measurements = flush.measurements;
|
22488
22419
|
|
22489
|
-
|
22490
|
-
|
22491
|
-
|
22492
|
-
* number of matches besides one.
|
22493
|
-
* @return {!ReactDOMComponent} The one match.
|
22494
|
-
*/
|
22495
|
-
findRenderedDOMComponentWithTag: function (root, tagName) {
|
22496
|
-
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
|
22497
|
-
if (all.length !== 1) {
|
22498
|
-
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
|
22499
|
-
}
|
22500
|
-
return all[0];
|
22501
|
-
},
|
22420
|
+
measurements.forEach(function (measurement) {
|
22421
|
+
var instanceID = measurement.instanceID,
|
22422
|
+
timerType = measurement.timerType;
|
22502
22423
|
|
22503
|
-
|
22504
|
-
|
22505
|
-
|
22506
|
-
|
22507
|
-
scryRenderedComponentsWithType: function (root, componentType) {
|
22508
|
-
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22509
|
-
return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
|
22424
|
+
if (timerType !== 'render') {
|
22425
|
+
return;
|
22426
|
+
}
|
22427
|
+
isCompositeByID[instanceID] = true;
|
22510
22428
|
});
|
22511
|
-
}
|
22429
|
+
});
|
22512
22430
|
|
22513
|
-
|
22514
|
-
|
22515
|
-
|
22516
|
-
* number of matches besides one.
|
22517
|
-
* @return {!ReactComponent} The one match.
|
22518
|
-
*/
|
22519
|
-
findRenderedComponentWithType: function (root, componentType) {
|
22520
|
-
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
|
22521
|
-
if (all.length !== 1) {
|
22522
|
-
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
|
22523
|
-
}
|
22524
|
-
return all[0];
|
22525
|
-
},
|
22431
|
+
flushHistory.forEach(function (flush) {
|
22432
|
+
var measurements = flush.measurements,
|
22433
|
+
treeSnapshot = flush.treeSnapshot;
|
22526
22434
|
|
22527
|
-
|
22528
|
-
|
22529
|
-
|
22530
|
-
|
22531
|
-
* <div> containing any provided children.
|
22532
|
-
*
|
22533
|
-
* @param {object} module the mock function object exported from a
|
22534
|
-
* module that defines the component to be mocked
|
22535
|
-
* @param {?string} mockTagName optional dummy root tag name to return
|
22536
|
-
* from render method (overrides
|
22537
|
-
* module.mockTagName if provided)
|
22538
|
-
* @return {object} the ReactTestUtils object (for chaining)
|
22539
|
-
*/
|
22540
|
-
mockComponent: function (module, mockTagName) {
|
22541
|
-
mockTagName = mockTagName || module.mockTagName || 'div';
|
22435
|
+
measurements.forEach(function (measurement) {
|
22436
|
+
var duration = measurement.duration,
|
22437
|
+
instanceID = measurement.instanceID,
|
22438
|
+
timerType = measurement.timerType;
|
22542
22439
|
|
22543
|
-
|
22544
|
-
|
22440
|
+
if (timerType !== 'render') {
|
22441
|
+
return;
|
22442
|
+
}
|
22443
|
+
updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
|
22444
|
+
stats.renderCount++;
|
22445
|
+
});
|
22446
|
+
var nextParentID = instanceID;
|
22447
|
+
while (nextParentID) {
|
22448
|
+
// As we traverse parents, only count inclusive time towards composites.
|
22449
|
+
// We know something is a composite if its render() was called.
|
22450
|
+
if (isCompositeByID[nextParentID]) {
|
22451
|
+
updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
|
22452
|
+
stats.inclusiveRenderDuration += duration;
|
22453
|
+
});
|
22454
|
+
}
|
22455
|
+
nextParentID = treeSnapshot[nextParentID].parentID;
|
22456
|
+
}
|
22545
22457
|
});
|
22458
|
+
});
|
22546
22459
|
|
22547
|
-
|
22548
|
-
|
22549
|
-
|
22550
|
-
|
22551
|
-
|
22552
|
-
|
22553
|
-
|
22554
|
-
|
22555
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
22556
|
-
*/
|
22557
|
-
simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
|
22558
|
-
fakeNativeEvent.target = node;
|
22559
|
-
ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
22560
|
-
},
|
22460
|
+
return Object.keys(aggregatedStats).map(function (key) {
|
22461
|
+
return _extends({}, aggregatedStats[key], {
|
22462
|
+
instanceCount: Object.keys(affectedIDs[key]).length
|
22463
|
+
});
|
22464
|
+
}).sort(function (a, b) {
|
22465
|
+
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
22466
|
+
});
|
22467
|
+
}
|
22561
22468
|
|
22562
|
-
|
22563
|
-
|
22564
|
-
* on the `ReactDOMComponent` `comp`.
|
22565
|
-
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
|
22566
|
-
* @param {!ReactDOMComponent} comp
|
22567
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
22568
|
-
*/
|
22569
|
-
simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
|
22570
|
-
ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
22571
|
-
},
|
22469
|
+
function getWasted() {
|
22470
|
+
var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
|
22572
22471
|
|
22573
|
-
|
22574
|
-
|
22575
|
-
|
22576
|
-
|
22577
|
-
},
|
22472
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22473
|
+
warnInProduction();
|
22474
|
+
return [];
|
22475
|
+
}
|
22578
22476
|
|
22579
|
-
|
22580
|
-
|
22581
|
-
},
|
22477
|
+
var aggregatedStats = {};
|
22478
|
+
var affectedIDs = {};
|
22582
22479
|
|
22583
|
-
|
22584
|
-
|
22585
|
-
|
22480
|
+
function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
|
22481
|
+
var _treeSnapshot$instanc2 = treeSnapshot[instanceID],
|
22482
|
+
displayName = _treeSnapshot$instanc2.displayName,
|
22483
|
+
ownerID = _treeSnapshot$instanc2.ownerID;
|
22586
22484
|
|
22587
|
-
|
22588
|
-
|
22589
|
-
|
22590
|
-
|
22591
|
-
|
22592
|
-
|
22593
|
-
|
22594
|
-
|
22595
|
-
|
22596
|
-
|
22597
|
-
|
22598
|
-
!!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;
|
22599
|
-
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
22600
|
-
node = findDOMNode(domComponentOrNode);
|
22601
|
-
} else if (domComponentOrNode.tagName) {
|
22602
|
-
node = domComponentOrNode;
|
22485
|
+
var owner = treeSnapshot[ownerID];
|
22486
|
+
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
22487
|
+
var stats = aggregatedStats[key];
|
22488
|
+
if (!stats) {
|
22489
|
+
affectedIDs[key] = {};
|
22490
|
+
stats = aggregatedStats[key] = {
|
22491
|
+
key: key,
|
22492
|
+
instanceCount: 0,
|
22493
|
+
inclusiveRenderDuration: 0,
|
22494
|
+
renderCount: 0
|
22495
|
+
};
|
22603
22496
|
}
|
22497
|
+
affectedIDs[key][instanceID] = true;
|
22498
|
+
applyUpdate(stats);
|
22499
|
+
}
|
22604
22500
|
|
22605
|
-
|
22501
|
+
flushHistory.forEach(function (flush) {
|
22502
|
+
var measurements = flush.measurements,
|
22503
|
+
treeSnapshot = flush.treeSnapshot,
|
22504
|
+
operations = flush.operations;
|
22606
22505
|
|
22607
|
-
var
|
22608
|
-
fakeNativeEvent.target = node;
|
22609
|
-
fakeNativeEvent.type = eventType.toLowerCase();
|
22506
|
+
var isDefinitelyNotWastedByID = {};
|
22610
22507
|
|
22611
|
-
//
|
22612
|
-
//
|
22613
|
-
|
22614
|
-
|
22615
|
-
// sure it's marked and won't warn when setting additional properties.
|
22616
|
-
event.persist();
|
22617
|
-
_assign(event, eventData);
|
22508
|
+
// Find host components associated with an operation in this batch.
|
22509
|
+
// Mark all components in their parent tree as definitely not wasted.
|
22510
|
+
operations.forEach(function (operation) {
|
22511
|
+
var instanceID = operation.instanceID;
|
22618
22512
|
|
22619
|
-
|
22620
|
-
|
22621
|
-
|
22622
|
-
|
22623
|
-
|
22513
|
+
var nextParentID = instanceID;
|
22514
|
+
while (nextParentID) {
|
22515
|
+
isDefinitelyNotWastedByID[nextParentID] = true;
|
22516
|
+
nextParentID = treeSnapshot[nextParentID].parentID;
|
22517
|
+
}
|
22518
|
+
});
|
22624
22519
|
|
22625
|
-
|
22626
|
-
|
22627
|
-
|
22520
|
+
// Find composite components that rendered in this batch.
|
22521
|
+
// These are potential candidates for being wasted renders.
|
22522
|
+
var renderedCompositeIDs = {};
|
22523
|
+
measurements.forEach(function (measurement) {
|
22524
|
+
var instanceID = measurement.instanceID,
|
22525
|
+
timerType = measurement.timerType;
|
22526
|
+
|
22527
|
+
if (timerType !== 'render') {
|
22528
|
+
return;
|
22529
|
+
}
|
22530
|
+
renderedCompositeIDs[instanceID] = true;
|
22628
22531
|
});
|
22629
|
-
|
22532
|
+
|
22533
|
+
measurements.forEach(function (measurement) {
|
22534
|
+
var duration = measurement.duration,
|
22535
|
+
instanceID = measurement.instanceID,
|
22536
|
+
timerType = measurement.timerType;
|
22537
|
+
|
22538
|
+
if (timerType !== 'render') {
|
22539
|
+
return;
|
22540
|
+
}
|
22541
|
+
|
22542
|
+
// If there was a DOM update below this component, or it has just been
|
22543
|
+
// mounted, its render() is not considered wasted.
|
22544
|
+
var updateCount = treeSnapshot[instanceID].updateCount;
|
22545
|
+
|
22546
|
+
if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
|
22547
|
+
return;
|
22548
|
+
}
|
22549
|
+
|
22550
|
+
// We consider this render() wasted.
|
22551
|
+
updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
|
22552
|
+
stats.renderCount++;
|
22553
|
+
});
|
22554
|
+
|
22555
|
+
var nextParentID = instanceID;
|
22556
|
+
while (nextParentID) {
|
22557
|
+
// Any parents rendered during this batch are considered wasted
|
22558
|
+
// unless we previously marked them as dirty.
|
22559
|
+
var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
|
22560
|
+
if (isWasted) {
|
22561
|
+
updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
|
22562
|
+
stats.inclusiveRenderDuration += duration;
|
22563
|
+
});
|
22564
|
+
}
|
22565
|
+
nextParentID = treeSnapshot[nextParentID].parentID;
|
22566
|
+
}
|
22567
|
+
});
|
22568
|
+
});
|
22569
|
+
|
22570
|
+
return Object.keys(aggregatedStats).map(function (key) {
|
22571
|
+
return _extends({}, aggregatedStats[key], {
|
22572
|
+
instanceCount: Object.keys(affectedIDs[key]).length
|
22573
|
+
});
|
22574
|
+
}).sort(function (a, b) {
|
22575
|
+
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
22576
|
+
});
|
22630
22577
|
}
|
22631
22578
|
|
22632
|
-
function
|
22633
|
-
|
22579
|
+
function getOperations() {
|
22580
|
+
var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
|
22634
22581
|
|
22635
|
-
|
22636
|
-
|
22637
|
-
|
22638
|
-
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
22639
|
-
* @param {?object} eventData Fake event data to use in SyntheticEvent.
|
22640
|
-
*/
|
22641
|
-
ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
|
22582
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22583
|
+
warnInProduction();
|
22584
|
+
return [];
|
22642
22585
|
}
|
22586
|
+
|
22587
|
+
var stats = [];
|
22588
|
+
flushHistory.forEach(function (flush, flushIndex) {
|
22589
|
+
var operations = flush.operations,
|
22590
|
+
treeSnapshot = flush.treeSnapshot;
|
22591
|
+
|
22592
|
+
operations.forEach(function (operation) {
|
22593
|
+
var instanceID = operation.instanceID,
|
22594
|
+
type = operation.type,
|
22595
|
+
payload = operation.payload;
|
22596
|
+
var _treeSnapshot$instanc3 = treeSnapshot[instanceID],
|
22597
|
+
displayName = _treeSnapshot$instanc3.displayName,
|
22598
|
+
ownerID = _treeSnapshot$instanc3.ownerID;
|
22599
|
+
|
22600
|
+
var owner = treeSnapshot[ownerID];
|
22601
|
+
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
22602
|
+
|
22603
|
+
stats.push({
|
22604
|
+
flushIndex: flushIndex,
|
22605
|
+
instanceID: instanceID,
|
22606
|
+
key: key,
|
22607
|
+
type: type,
|
22608
|
+
ownerID: ownerID,
|
22609
|
+
payload: payload
|
22610
|
+
});
|
22611
|
+
});
|
22612
|
+
});
|
22613
|
+
return stats;
|
22643
22614
|
}
|
22644
22615
|
|
22645
|
-
|
22646
|
-
|
22647
|
-
|
22648
|
-
|
22649
|
-
|
22650
|
-
};
|
22651
|
-
var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
|
22652
|
-
EventPluginHub.injection.injectEventPluginsByName = function () {
|
22653
|
-
oldInjectEventPlugins.apply(this, arguments);
|
22654
|
-
buildSimulators();
|
22655
|
-
};
|
22616
|
+
function printExclusive(flushHistory) {
|
22617
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22618
|
+
warnInProduction();
|
22619
|
+
return;
|
22620
|
+
}
|
22656
22621
|
|
22657
|
-
|
22622
|
+
var stats = getExclusive(flushHistory);
|
22623
|
+
var table = stats.map(function (item) {
|
22624
|
+
var key = item.key,
|
22625
|
+
instanceCount = item.instanceCount,
|
22626
|
+
totalDuration = item.totalDuration;
|
22658
22627
|
|
22659
|
-
|
22660
|
-
|
22661
|
-
|
22662
|
-
|
22663
|
-
|
22664
|
-
|
22665
|
-
|
22666
|
-
|
22667
|
-
|
22668
|
-
|
22669
|
-
|
22670
|
-
|
22671
|
-
|
22672
|
-
|
22673
|
-
*/
|
22628
|
+
var renderCount = item.counts.render || 0;
|
22629
|
+
var renderDuration = item.durations.render || 0;
|
22630
|
+
return {
|
22631
|
+
'Component': key,
|
22632
|
+
'Total time (ms)': roundFloat(totalDuration),
|
22633
|
+
'Instance count': instanceCount,
|
22634
|
+
'Total render time (ms)': roundFloat(renderDuration),
|
22635
|
+
'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
|
22636
|
+
'Render count': renderCount,
|
22637
|
+
'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
|
22638
|
+
};
|
22639
|
+
});
|
22640
|
+
consoleTable(table);
|
22641
|
+
}
|
22674
22642
|
|
22675
|
-
function
|
22676
|
-
|
22677
|
-
|
22678
|
-
|
22679
|
-
|
22680
|
-
|
22681
|
-
|
22682
|
-
|
22683
|
-
|
22684
|
-
|
22685
|
-
|
22643
|
+
function printInclusive(flushHistory) {
|
22644
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22645
|
+
warnInProduction();
|
22646
|
+
return;
|
22647
|
+
}
|
22648
|
+
|
22649
|
+
var stats = getInclusive(flushHistory);
|
22650
|
+
var table = stats.map(function (item) {
|
22651
|
+
var key = item.key,
|
22652
|
+
instanceCount = item.instanceCount,
|
22653
|
+
inclusiveRenderDuration = item.inclusiveRenderDuration,
|
22654
|
+
renderCount = item.renderCount;
|
22655
|
+
|
22656
|
+
return {
|
22657
|
+
'Owner > Component': key,
|
22658
|
+
'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
|
22659
|
+
'Instance count': instanceCount,
|
22660
|
+
'Render count': renderCount
|
22661
|
+
};
|
22662
|
+
});
|
22663
|
+
consoleTable(table);
|
22686
22664
|
}
|
22687
22665
|
|
22688
|
-
|
22689
|
-
|
22690
|
-
|
22691
|
-
|
22692
|
-
|
22693
|
-
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
|
22694
|
-
*/
|
22695
|
-
ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
|
22696
|
-
});
|
22666
|
+
function printWasted(flushHistory) {
|
22667
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22668
|
+
warnInProduction();
|
22669
|
+
return;
|
22670
|
+
}
|
22697
22671
|
|
22698
|
-
|
22699
|
-
|
22672
|
+
var stats = getWasted(flushHistory);
|
22673
|
+
var table = stats.map(function (item) {
|
22674
|
+
var key = item.key,
|
22675
|
+
instanceCount = item.instanceCount,
|
22676
|
+
inclusiveRenderDuration = item.inclusiveRenderDuration,
|
22677
|
+
renderCount = item.renderCount;
|
22700
22678
|
|
22701
|
-
|
22702
|
-
|
22703
|
-
|
22679
|
+
return {
|
22680
|
+
'Owner > Component': key,
|
22681
|
+
'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
|
22682
|
+
'Instance count': instanceCount,
|
22683
|
+
'Render count': renderCount
|
22684
|
+
};
|
22685
|
+
});
|
22686
|
+
consoleTable(table);
|
22687
|
+
}
|
22704
22688
|
|
22705
|
-
|
22706
|
-
|
22707
|
-
|
22708
|
-
|
22709
|
-
|
22710
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
22711
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
22712
|
-
*
|
22713
|
-
*/
|
22689
|
+
function printOperations(flushHistory) {
|
22690
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22691
|
+
warnInProduction();
|
22692
|
+
return;
|
22693
|
+
}
|
22714
22694
|
|
22715
|
-
|
22695
|
+
var stats = getOperations(flushHistory);
|
22696
|
+
var table = stats.map(function (stat) {
|
22697
|
+
return {
|
22698
|
+
'Owner > Node': stat.key,
|
22699
|
+
'Operation': stat.type,
|
22700
|
+
'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
|
22701
|
+
'Flush index': stat.flushIndex,
|
22702
|
+
'Owner Component ID': stat.ownerID,
|
22703
|
+
'DOM Component ID': stat.instanceID
|
22704
|
+
};
|
22705
|
+
});
|
22706
|
+
consoleTable(table);
|
22707
|
+
}
|
22716
22708
|
|
22717
|
-
|
22718
|
-
|
22719
|
-
|
22720
|
-
|
22721
|
-
|
22722
|
-
|
22723
|
-
topAnimationIteration: null,
|
22724
|
-
topAnimationStart: null,
|
22725
|
-
topBlur: null,
|
22726
|
-
topCanPlay: null,
|
22727
|
-
topCanPlayThrough: null,
|
22728
|
-
topChange: null,
|
22729
|
-
topClick: null,
|
22730
|
-
topCompositionEnd: null,
|
22731
|
-
topCompositionStart: null,
|
22732
|
-
topCompositionUpdate: null,
|
22733
|
-
topContextMenu: null,
|
22734
|
-
topCopy: null,
|
22735
|
-
topCut: null,
|
22736
|
-
topDoubleClick: null,
|
22737
|
-
topDrag: null,
|
22738
|
-
topDragEnd: null,
|
22739
|
-
topDragEnter: null,
|
22740
|
-
topDragExit: null,
|
22741
|
-
topDragLeave: null,
|
22742
|
-
topDragOver: null,
|
22743
|
-
topDragStart: null,
|
22744
|
-
topDrop: null,
|
22745
|
-
topDurationChange: null,
|
22746
|
-
topEmptied: null,
|
22747
|
-
topEncrypted: null,
|
22748
|
-
topEnded: null,
|
22749
|
-
topError: null,
|
22750
|
-
topFocus: null,
|
22751
|
-
topInput: null,
|
22752
|
-
topInvalid: null,
|
22753
|
-
topKeyDown: null,
|
22754
|
-
topKeyPress: null,
|
22755
|
-
topKeyUp: null,
|
22756
|
-
topLoad: null,
|
22757
|
-
topLoadedData: null,
|
22758
|
-
topLoadedMetadata: null,
|
22759
|
-
topLoadStart: null,
|
22760
|
-
topMouseDown: null,
|
22761
|
-
topMouseMove: null,
|
22762
|
-
topMouseOut: null,
|
22763
|
-
topMouseOver: null,
|
22764
|
-
topMouseUp: null,
|
22765
|
-
topPaste: null,
|
22766
|
-
topPause: null,
|
22767
|
-
topPlay: null,
|
22768
|
-
topPlaying: null,
|
22769
|
-
topProgress: null,
|
22770
|
-
topRateChange: null,
|
22771
|
-
topReset: null,
|
22772
|
-
topScroll: null,
|
22773
|
-
topSeeked: null,
|
22774
|
-
topSeeking: null,
|
22775
|
-
topSelectionChange: null,
|
22776
|
-
topStalled: null,
|
22777
|
-
topSubmit: null,
|
22778
|
-
topSuspend: null,
|
22779
|
-
topTextInput: null,
|
22780
|
-
topTimeUpdate: null,
|
22781
|
-
topTouchCancel: null,
|
22782
|
-
topTouchEnd: null,
|
22783
|
-
topTouchMove: null,
|
22784
|
-
topTouchStart: null,
|
22785
|
-
topTransitionEnd: null,
|
22786
|
-
topVolumeChange: null,
|
22787
|
-
topWaiting: null,
|
22788
|
-
topWheel: null
|
22789
|
-
};
|
22709
|
+
var warnedAboutPrintDOM = false;
|
22710
|
+
function printDOM(measurements) {
|
22711
|
+
process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
|
22712
|
+
warnedAboutPrintDOM = true;
|
22713
|
+
return printOperations(measurements);
|
22714
|
+
}
|
22790
22715
|
|
22791
|
-
var
|
22792
|
-
|
22716
|
+
var warnedAboutGetMeasurementsSummaryMap = false;
|
22717
|
+
function getMeasurementsSummaryMap(measurements) {
|
22718
|
+
process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
|
22719
|
+
warnedAboutGetMeasurementsSummaryMap = true;
|
22720
|
+
return getWasted(measurements);
|
22721
|
+
}
|
22722
|
+
|
22723
|
+
function start() {
|
22724
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22725
|
+
warnInProduction();
|
22726
|
+
return;
|
22727
|
+
}
|
22728
|
+
|
22729
|
+
ReactDebugTool.beginProfiling();
|
22730
|
+
}
|
22731
|
+
|
22732
|
+
function stop() {
|
22733
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22734
|
+
warnInProduction();
|
22735
|
+
return;
|
22736
|
+
}
|
22737
|
+
|
22738
|
+
ReactDebugTool.endProfiling();
|
22739
|
+
}
|
22740
|
+
|
22741
|
+
function isRunning() {
|
22742
|
+
if (!(process.env.NODE_ENV !== 'production')) {
|
22743
|
+
warnInProduction();
|
22744
|
+
return false;
|
22745
|
+
}
|
22746
|
+
|
22747
|
+
return ReactDebugTool.isProfiling();
|
22748
|
+
}
|
22749
|
+
|
22750
|
+
var ReactPerfAnalysis = {
|
22751
|
+
getLastMeasurements: getLastMeasurements,
|
22752
|
+
getExclusive: getExclusive,
|
22753
|
+
getInclusive: getInclusive,
|
22754
|
+
getWasted: getWasted,
|
22755
|
+
getOperations: getOperations,
|
22756
|
+
printExclusive: printExclusive,
|
22757
|
+
printInclusive: printInclusive,
|
22758
|
+
printWasted: printWasted,
|
22759
|
+
printOperations: printOperations,
|
22760
|
+
start: start,
|
22761
|
+
stop: stop,
|
22762
|
+
isRunning: isRunning,
|
22763
|
+
// Deprecated:
|
22764
|
+
printDOM: printDOM,
|
22765
|
+
getMeasurementsSummaryMap: getMeasurementsSummaryMap
|
22793
22766
|
};
|
22794
22767
|
|
22795
|
-
module.exports =
|
22768
|
+
module.exports = ReactPerfAnalysis;
|
22769
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
22796
22770
|
|
22797
22771
|
/***/ },
|
22798
|
-
/*
|
22772
|
+
/* 188 */
|
22799
22773
|
/***/ function(module, exports, __webpack_require__) {
|
22800
22774
|
|
22801
22775
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -22813,325 +22787,407 @@
|
|
22813
22787
|
var _prodInvariant = __webpack_require__(35),
|
22814
22788
|
_assign = __webpack_require__(4);
|
22815
22789
|
|
22816
|
-
|
22817
|
-
|
22790
|
+
var EventConstants = __webpack_require__(189);
|
22791
|
+
var EventPluginHub = __webpack_require__(42);
|
22792
|
+
var EventPluginRegistry = __webpack_require__(43);
|
22793
|
+
var EventPropagators = __webpack_require__(41);
|
22818
22794
|
var React = __webpack_require__(2);
|
22819
|
-
var
|
22820
|
-
var
|
22821
|
-
var
|
22795
|
+
var ReactDOM = __webpack_require__(33);
|
22796
|
+
var ReactDOMComponentTree = __webpack_require__(34);
|
22797
|
+
var ReactBrowserEventEmitter = __webpack_require__(105);
|
22798
|
+
var ReactInstanceMap = __webpack_require__(116);
|
22822
22799
|
var ReactUpdates = __webpack_require__(56);
|
22800
|
+
var SyntheticEvent = __webpack_require__(53);
|
22801
|
+
var ReactShallowRenderer = __webpack_require__(190);
|
22823
22802
|
|
22824
|
-
var
|
22825
|
-
var getNextDebugID = __webpack_require__(127);
|
22803
|
+
var findDOMNode = __webpack_require__(172);
|
22826
22804
|
var invariant = __webpack_require__(8);
|
22827
22805
|
|
22828
|
-
var
|
22829
|
-
function NoopInternalComponent(element) {
|
22830
|
-
_classCallCheck(this, NoopInternalComponent);
|
22806
|
+
var topLevelTypes = EventConstants.topLevelTypes;
|
22831
22807
|
|
22832
|
-
|
22833
|
-
this._currentElement = element;
|
22808
|
+
function Event(suffix) {}
|
22834
22809
|
|
22835
|
-
|
22836
|
-
|
22810
|
+
/**
|
22811
|
+
* @class ReactTestUtils
|
22812
|
+
*/
|
22813
|
+
|
22814
|
+
function findAllInRenderedTreeInternal(inst, test) {
|
22815
|
+
if (!inst || !inst.getPublicInstance) {
|
22816
|
+
return [];
|
22817
|
+
}
|
22818
|
+
var publicInst = inst.getPublicInstance();
|
22819
|
+
var ret = test(publicInst) ? [publicInst] : [];
|
22820
|
+
var currentElement = inst._currentElement;
|
22821
|
+
if (ReactTestUtils.isDOMComponent(publicInst)) {
|
22822
|
+
var renderedChildren = inst._renderedChildren;
|
22823
|
+
var key;
|
22824
|
+
for (key in renderedChildren) {
|
22825
|
+
if (!renderedChildren.hasOwnProperty(key)) {
|
22826
|
+
continue;
|
22827
|
+
}
|
22828
|
+
ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
|
22837
22829
|
}
|
22830
|
+
} else if (React.isValidElement(currentElement) && typeof currentElement.type === 'function') {
|
22831
|
+
ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
|
22838
22832
|
}
|
22833
|
+
return ret;
|
22834
|
+
}
|
22839
22835
|
|
22840
|
-
|
22841
|
-
|
22842
|
-
|
22843
|
-
|
22844
|
-
|
22845
|
-
|
22846
|
-
|
22847
|
-
|
22848
|
-
|
22849
|
-
|
22850
|
-
|
22851
|
-
|
22852
|
-
|
22853
|
-
|
22854
|
-
|
22855
|
-
|
22856
|
-
|
22857
|
-
|
22858
|
-
|
22859
|
-
|
22860
|
-
var ShallowComponentWrapper = function (element) {
|
22861
|
-
// TODO: Consolidate with instantiateReactComponent
|
22862
|
-
if (process.env.NODE_ENV !== 'production') {
|
22863
|
-
this._debugID = getNextDebugID();
|
22864
|
-
}
|
22836
|
+
/**
|
22837
|
+
* Utilities for making it easy to test React components.
|
22838
|
+
*
|
22839
|
+
* See https://facebook.github.io/react/docs/test-utils.html
|
22840
|
+
*
|
22841
|
+
* Todo: Support the entire DOM.scry query syntax. For now, these simple
|
22842
|
+
* utilities will suffice for testing purposes.
|
22843
|
+
* @lends ReactTestUtils
|
22844
|
+
*/
|
22845
|
+
var ReactTestUtils = {
|
22846
|
+
renderIntoDocument: function (element) {
|
22847
|
+
var div = document.createElement('div');
|
22848
|
+
// None of our tests actually require attaching the container to the
|
22849
|
+
// DOM, and doing so creates a mess that we rely on test isolation to
|
22850
|
+
// clean up, so we're going to stop honoring the name of this method
|
22851
|
+
// (and probably rename it eventually) if no problems arise.
|
22852
|
+
// document.documentElement.appendChild(div);
|
22853
|
+
return ReactDOM.render(element, div);
|
22854
|
+
},
|
22865
22855
|
|
22866
|
-
|
22867
|
-
|
22868
|
-
_assign(ShallowComponentWrapper.prototype, ReactCompositeComponent, {
|
22869
|
-
_constructComponent: ReactCompositeComponent._constructComponentWithoutOwner,
|
22870
|
-
_instantiateReactComponent: function (element) {
|
22871
|
-
return new NoopInternalComponent(element);
|
22856
|
+
isElement: function (element) {
|
22857
|
+
return React.isValidElement(element);
|
22872
22858
|
},
|
22873
|
-
_replaceNodeWithMarkup: function () {},
|
22874
|
-
_renderValidatedComponent: ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext
|
22875
|
-
});
|
22876
22859
|
|
22877
|
-
|
22878
|
-
|
22879
|
-
|
22880
|
-
ReactUpdates.ReactReconcileTransaction.release(transaction);
|
22881
|
-
}
|
22860
|
+
isElementOfType: function (inst, convenienceConstructor) {
|
22861
|
+
return React.isValidElement(inst) && inst.type === convenienceConstructor;
|
22862
|
+
},
|
22882
22863
|
|
22883
|
-
|
22884
|
-
|
22885
|
-
|
22864
|
+
isDOMComponent: function (inst) {
|
22865
|
+
return !!(inst && inst.nodeType === 1 && inst.tagName);
|
22866
|
+
},
|
22886
22867
|
|
22887
|
-
|
22888
|
-
|
22868
|
+
isDOMComponentElement: function (inst) {
|
22869
|
+
return !!(inst && React.isValidElement(inst) && !!inst.tagName);
|
22870
|
+
},
|
22889
22871
|
|
22890
|
-
|
22891
|
-
|
22892
|
-
|
22872
|
+
isCompositeComponent: function (inst) {
|
22873
|
+
if (ReactTestUtils.isDOMComponent(inst)) {
|
22874
|
+
// Accessing inst.setState warns; just return false as that'll be what
|
22875
|
+
// this returns when we have DOM nodes as refs directly
|
22876
|
+
return false;
|
22877
|
+
}
|
22878
|
+
return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
|
22879
|
+
},
|
22893
22880
|
|
22894
|
-
|
22895
|
-
|
22896
|
-
|
22897
|
-
|
22898
|
-
|
22881
|
+
isCompositeComponentWithType: function (inst, type) {
|
22882
|
+
if (!ReactTestUtils.isCompositeComponent(inst)) {
|
22883
|
+
return false;
|
22884
|
+
}
|
22885
|
+
var internalInstance = ReactInstanceMap.get(inst);
|
22886
|
+
var constructor = internalInstance._currentElement.type;
|
22899
22887
|
|
22900
|
-
|
22901
|
-
|
22888
|
+
return constructor === type;
|
22889
|
+
},
|
22902
22890
|
|
22903
|
-
|
22904
|
-
|
22891
|
+
isCompositeComponentElement: function (inst) {
|
22892
|
+
if (!React.isValidElement(inst)) {
|
22893
|
+
return false;
|
22905
22894
|
}
|
22906
|
-
|
22895
|
+
// We check the prototype of the type that will get mounted, not the
|
22896
|
+
// instance itself. This is a future proof way of duck typing.
|
22897
|
+
var prototype = inst.type.prototype;
|
22898
|
+
return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
|
22899
|
+
},
|
22907
22900
|
|
22908
|
-
|
22909
|
-
|
22901
|
+
isCompositeComponentElementWithType: function (inst, type) {
|
22902
|
+
var internalInstance = ReactInstanceMap.get(inst);
|
22903
|
+
var constructor = internalInstance._currentElement.type;
|
22910
22904
|
|
22911
|
-
|
22912
|
-
|
22913
|
-
};
|
22905
|
+
return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
|
22906
|
+
},
|
22914
22907
|
|
22915
|
-
|
22916
|
-
if (
|
22917
|
-
|
22908
|
+
getRenderedChildOfCompositeComponent: function (inst) {
|
22909
|
+
if (!ReactTestUtils.isCompositeComponent(inst)) {
|
22910
|
+
return null;
|
22918
22911
|
}
|
22919
|
-
|
22912
|
+
var internalInstance = ReactInstanceMap.get(inst);
|
22913
|
+
return internalInstance._renderedComponent.getPublicInstance();
|
22914
|
+
},
|
22920
22915
|
|
22921
|
-
|
22922
|
-
if (
|
22923
|
-
|
22924
|
-
} else {
|
22925
|
-
var instance = new ShallowComponentWrapper(element);
|
22926
|
-
ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
|
22927
|
-
this._instance = instance;
|
22916
|
+
findAllInRenderedTree: function (inst, test) {
|
22917
|
+
if (!inst) {
|
22918
|
+
return [];
|
22928
22919
|
}
|
22929
|
-
|
22930
|
-
|
22931
|
-
|
22932
|
-
}();
|
22933
|
-
|
22934
|
-
module.exports = ReactShallowRenderer;
|
22935
|
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
22920
|
+
!ReactTestUtils.isCompositeComponent(inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
|
22921
|
+
return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
|
22922
|
+
},
|
22936
22923
|
|
22937
|
-
|
22938
|
-
|
22939
|
-
|
22924
|
+
/**
|
22925
|
+
* Finds all instance of components in the rendered tree that are DOM
|
22926
|
+
* components with the class name matching `className`.
|
22927
|
+
* @return {array} an array of all the matches.
|
22928
|
+
*/
|
22929
|
+
scryRenderedDOMComponentsWithClass: function (root, classNames) {
|
22930
|
+
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22931
|
+
if (ReactTestUtils.isDOMComponent(inst)) {
|
22932
|
+
var className = inst.className;
|
22933
|
+
if (typeof className !== 'string') {
|
22934
|
+
// SVG, probably.
|
22935
|
+
className = inst.getAttribute('class') || '';
|
22936
|
+
}
|
22937
|
+
var classList = className.split(/\s+/);
|
22940
22938
|
|
22941
|
-
|
22942
|
-
|
22943
|
-
|
22944
|
-
|
22945
|
-
|
22946
|
-
|
22947
|
-
|
22948
|
-
|
22949
|
-
|
22939
|
+
if (!Array.isArray(classNames)) {
|
22940
|
+
!(classNames !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : _prodInvariant('11') : void 0;
|
22941
|
+
classNames = classNames.split(/\s+/);
|
22942
|
+
}
|
22943
|
+
return classNames.every(function (name) {
|
22944
|
+
return classList.indexOf(name) !== -1;
|
22945
|
+
});
|
22946
|
+
}
|
22947
|
+
return false;
|
22948
|
+
});
|
22949
|
+
},
|
22950
22950
|
|
22951
|
-
|
22951
|
+
/**
|
22952
|
+
* Like scryRenderedDOMComponentsWithClass but expects there to be one result,
|
22953
|
+
* and returns that one result, or throws exception if there is any other
|
22954
|
+
* number of matches besides one.
|
22955
|
+
* @return {!ReactDOMComponent} The one match.
|
22956
|
+
*/
|
22957
|
+
findRenderedDOMComponentWithClass: function (root, className) {
|
22958
|
+
var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
|
22959
|
+
if (all.length !== 1) {
|
22960
|
+
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
|
22961
|
+
}
|
22962
|
+
return all[0];
|
22963
|
+
},
|
22952
22964
|
|
22953
|
-
|
22965
|
+
/**
|
22966
|
+
* Finds all instance of components in the rendered tree that are DOM
|
22967
|
+
* components with the tag name matching `tagName`.
|
22968
|
+
* @return {array} an array of all the matches.
|
22969
|
+
*/
|
22970
|
+
scryRenderedDOMComponentsWithTag: function (root, tagName) {
|
22971
|
+
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22972
|
+
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
|
22973
|
+
});
|
22974
|
+
},
|
22954
22975
|
|
22955
|
-
var ReactTransitionChildMapping = {
|
22956
22976
|
/**
|
22957
|
-
*
|
22958
|
-
*
|
22959
|
-
*
|
22960
|
-
* @
|
22961
|
-
* @param {number=} selfDebugID Optional debugID of the current internal instance.
|
22962
|
-
* @return {object} Mapping of key to child
|
22977
|
+
* Like scryRenderedDOMComponentsWithTag but expects there to be one result,
|
22978
|
+
* and returns that one result, or throws exception if there is any other
|
22979
|
+
* number of matches besides one.
|
22980
|
+
* @return {!ReactDOMComponent} The one match.
|
22963
22981
|
*/
|
22964
|
-
|
22965
|
-
|
22966
|
-
|
22982
|
+
findRenderedDOMComponentWithTag: function (root, tagName) {
|
22983
|
+
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
|
22984
|
+
if (all.length !== 1) {
|
22985
|
+
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
|
22967
22986
|
}
|
22987
|
+
return all[0];
|
22988
|
+
},
|
22968
22989
|
|
22969
|
-
|
22970
|
-
|
22971
|
-
|
22990
|
+
/**
|
22991
|
+
* Finds all instances of components with type equal to `componentType`.
|
22992
|
+
* @return {array} an array of all the matches.
|
22993
|
+
*/
|
22994
|
+
scryRenderedComponentsWithType: function (root, componentType) {
|
22995
|
+
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
22996
|
+
return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
|
22997
|
+
});
|
22998
|
+
},
|
22972
22999
|
|
22973
|
-
|
23000
|
+
/**
|
23001
|
+
* Same as `scryRenderedComponentsWithType` but expects there to be one result
|
23002
|
+
* and returns that one result, or throws exception if there is any other
|
23003
|
+
* number of matches besides one.
|
23004
|
+
* @return {!ReactComponent} The one match.
|
23005
|
+
*/
|
23006
|
+
findRenderedComponentWithType: function (root, componentType) {
|
23007
|
+
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
|
23008
|
+
if (all.length !== 1) {
|
23009
|
+
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
|
23010
|
+
}
|
23011
|
+
return all[0];
|
22974
23012
|
},
|
22975
23013
|
|
22976
23014
|
/**
|
22977
|
-
*
|
22978
|
-
*
|
22979
|
-
*
|
22980
|
-
*
|
22981
|
-
* ordering. In the future we may expose some of the utilities in
|
22982
|
-
* ReactMultiChild to make this easy, but for now React itself does not
|
22983
|
-
* directly have this concept of the union of prevChildren and nextChildren
|
22984
|
-
* so we implement it here.
|
23015
|
+
* Pass a mocked component module to this method to augment it with
|
23016
|
+
* useful methods that allow it to be used as a dummy React component.
|
23017
|
+
* Instead of rendering as usual, the component will become a simple
|
23018
|
+
* <div> containing any provided children.
|
22985
23019
|
*
|
22986
|
-
* @param {object}
|
22987
|
-
*
|
22988
|
-
* @param {
|
22989
|
-
*
|
22990
|
-
*
|
22991
|
-
*
|
23020
|
+
* @param {object} module the mock function object exported from a
|
23021
|
+
* module that defines the component to be mocked
|
23022
|
+
* @param {?string} mockTagName optional dummy root tag name to return
|
23023
|
+
* from render method (overrides
|
23024
|
+
* module.mockTagName if provided)
|
23025
|
+
* @return {object} the ReactTestUtils object (for chaining)
|
22992
23026
|
*/
|
22993
|
-
|
22994
|
-
|
22995
|
-
next = next || {};
|
22996
|
-
|
22997
|
-
function getValueForKey(key) {
|
22998
|
-
if (next.hasOwnProperty(key)) {
|
22999
|
-
return next[key];
|
23000
|
-
} else {
|
23001
|
-
return prev[key];
|
23002
|
-
}
|
23003
|
-
}
|
23027
|
+
mockComponent: function (module, mockTagName) {
|
23028
|
+
mockTagName = mockTagName || module.mockTagName || 'div';
|
23004
23029
|
|
23005
|
-
|
23006
|
-
|
23007
|
-
|
23030
|
+
module.prototype.render.mockImplementation(function () {
|
23031
|
+
return React.createElement(mockTagName, null, this.props.children);
|
23032
|
+
});
|
23008
23033
|
|
23009
|
-
|
23010
|
-
|
23011
|
-
if (next.hasOwnProperty(prevKey)) {
|
23012
|
-
if (pendingKeys.length) {
|
23013
|
-
nextKeysPending[prevKey] = pendingKeys;
|
23014
|
-
pendingKeys = [];
|
23015
|
-
}
|
23016
|
-
} else {
|
23017
|
-
pendingKeys.push(prevKey);
|
23018
|
-
}
|
23019
|
-
}
|
23034
|
+
return this;
|
23035
|
+
},
|
23020
23036
|
|
23021
|
-
|
23022
|
-
|
23023
|
-
|
23024
|
-
|
23025
|
-
|
23026
|
-
|
23027
|
-
|
23028
|
-
|
23029
|
-
|
23030
|
-
|
23031
|
-
|
23037
|
+
/**
|
23038
|
+
* Simulates a top level event being dispatched from a raw event that occurred
|
23039
|
+
* on an `Element` node.
|
23040
|
+
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
|
23041
|
+
* @param {!Element} node The dom to simulate an event occurring on.
|
23042
|
+
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
23043
|
+
*/
|
23044
|
+
simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
|
23045
|
+
fakeNativeEvent.target = node;
|
23046
|
+
ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
23047
|
+
},
|
23032
23048
|
|
23033
|
-
|
23034
|
-
|
23035
|
-
|
23036
|
-
|
23049
|
+
/**
|
23050
|
+
* Simulates a top level event being dispatched from a raw event that occurred
|
23051
|
+
* on the `ReactDOMComponent` `comp`.
|
23052
|
+
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
|
23053
|
+
* @param {!ReactDOMComponent} comp
|
23054
|
+
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
23055
|
+
*/
|
23056
|
+
simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
|
23057
|
+
ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
23058
|
+
},
|
23037
23059
|
|
23038
|
-
|
23039
|
-
|
23040
|
-
|
23060
|
+
nativeTouchData: function (x, y) {
|
23061
|
+
return {
|
23062
|
+
touches: [{ pageX: x, pageY: y }]
|
23063
|
+
};
|
23064
|
+
},
|
23041
23065
|
|
23042
|
-
|
23043
|
-
|
23066
|
+
createRenderer: function () {
|
23067
|
+
return new ReactShallowRenderer();
|
23068
|
+
},
|
23044
23069
|
|
23045
|
-
|
23046
|
-
|
23047
|
-
|
23070
|
+
Simulate: null,
|
23071
|
+
SimulateNative: {}
|
23072
|
+
};
|
23048
23073
|
|
23049
|
-
|
23050
|
-
*
|
23051
|
-
* All rights reserved.
|
23052
|
-
*
|
23053
|
-
* This source code is licensed under the BSD-style license found in the
|
23054
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
23055
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
23074
|
+
/**
|
23075
|
+
* Exports:
|
23056
23076
|
*
|
23057
|
-
*
|
23077
|
+
* - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
|
23078
|
+
* - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
|
23079
|
+
* - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
|
23080
|
+
* - ... (All keys from event plugin `eventTypes` objects)
|
23058
23081
|
*/
|
23082
|
+
function makeSimulator(eventType) {
|
23083
|
+
return function (domComponentOrNode, eventData) {
|
23084
|
+
var node;
|
23085
|
+
!!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;
|
23086
|
+
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
23087
|
+
node = findDOMNode(domComponentOrNode);
|
23088
|
+
} else if (domComponentOrNode.tagName) {
|
23089
|
+
node = domComponentOrNode;
|
23090
|
+
}
|
23059
23091
|
|
23060
|
-
|
23092
|
+
var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
|
23061
23093
|
|
23062
|
-
|
23063
|
-
|
23064
|
-
|
23094
|
+
var fakeNativeEvent = new Event();
|
23095
|
+
fakeNativeEvent.target = node;
|
23096
|
+
fakeNativeEvent.type = eventType.toLowerCase();
|
23065
23097
|
|
23066
|
-
|
23098
|
+
// We don't use SyntheticEvent.getPooled in order to not have to worry about
|
23099
|
+
// properly destroying any properties assigned from `eventData` upon release
|
23100
|
+
var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
|
23101
|
+
// Since we aren't using pooling, always persist the event. This will make
|
23102
|
+
// sure it's marked and won't warn when setting additional properties.
|
23103
|
+
event.persist();
|
23104
|
+
_assign(event, eventData);
|
23067
23105
|
|
23068
|
-
|
23069
|
-
|
23070
|
-
|
23071
|
-
|
23072
|
-
|
23073
|
-
|
23074
|
-
|
23106
|
+
if (dispatchConfig.phasedRegistrationNames) {
|
23107
|
+
EventPropagators.accumulateTwoPhaseDispatches(event);
|
23108
|
+
} else {
|
23109
|
+
EventPropagators.accumulateDirectDispatches(event);
|
23110
|
+
}
|
23111
|
+
|
23112
|
+
ReactUpdates.batchedUpdates(function () {
|
23113
|
+
EventPluginHub.enqueueEvents(event);
|
23114
|
+
EventPluginHub.processEventQueue(true);
|
23115
|
+
});
|
23116
|
+
};
|
23075
23117
|
}
|
23076
23118
|
|
23077
|
-
|
23078
|
-
|
23079
|
-
|
23080
|
-
|
23081
|
-
|
23082
|
-
|
23083
|
-
|
23084
|
-
|
23085
|
-
|
23086
|
-
|
23087
|
-
var keyUnique = result[name] === undefined;
|
23088
|
-
if (process.env.NODE_ENV !== 'production') {
|
23089
|
-
if (!ReactComponentTreeHook) {
|
23090
|
-
ReactComponentTreeHook = __webpack_require__(26);
|
23091
|
-
}
|
23092
|
-
if (!keyUnique) {
|
23093
|
-
process.env.NODE_ENV !== '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;
|
23094
|
-
}
|
23095
|
-
}
|
23096
|
-
if (keyUnique && child != null) {
|
23097
|
-
result[name] = child;
|
23098
|
-
}
|
23119
|
+
function buildSimulators() {
|
23120
|
+
ReactTestUtils.Simulate = {};
|
23121
|
+
|
23122
|
+
var eventType;
|
23123
|
+
for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
|
23124
|
+
/**
|
23125
|
+
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
23126
|
+
* @param {?object} eventData Fake event data to use in SyntheticEvent.
|
23127
|
+
*/
|
23128
|
+
ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
|
23099
23129
|
}
|
23100
23130
|
}
|
23101
23131
|
|
23132
|
+
// Rebuild ReactTestUtils.Simulate whenever event plugins are injected
|
23133
|
+
var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
|
23134
|
+
EventPluginHub.injection.injectEventPluginOrder = function () {
|
23135
|
+
oldInjectEventPluginOrder.apply(this, arguments);
|
23136
|
+
buildSimulators();
|
23137
|
+
};
|
23138
|
+
var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
|
23139
|
+
EventPluginHub.injection.injectEventPluginsByName = function () {
|
23140
|
+
oldInjectEventPlugins.apply(this, arguments);
|
23141
|
+
buildSimulators();
|
23142
|
+
};
|
23143
|
+
|
23144
|
+
buildSimulators();
|
23145
|
+
|
23102
23146
|
/**
|
23103
|
-
*
|
23104
|
-
*
|
23105
|
-
*
|
23147
|
+
* Exports:
|
23148
|
+
*
|
23149
|
+
* - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
|
23150
|
+
* - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
|
23151
|
+
* - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
|
23152
|
+
* - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
|
23153
|
+
* - ... (All keys from `EventConstants.topLevelTypes`)
|
23154
|
+
*
|
23155
|
+
* Note: Top level event types are a subset of the entire set of handler types
|
23156
|
+
* (which include a broader set of "synthetic" events). For example, onDragDone
|
23157
|
+
* is a synthetic event. Except when testing an event plugin or React's event
|
23158
|
+
* handling code specifically, you probably want to use ReactTestUtils.Simulate
|
23159
|
+
* to dispatch synthetic events.
|
23106
23160
|
*/
|
23107
|
-
function flattenChildren(children, selfDebugID) {
|
23108
|
-
if (children == null) {
|
23109
|
-
return children;
|
23110
|
-
}
|
23111
|
-
var result = {};
|
23112
23161
|
|
23113
|
-
|
23114
|
-
|
23115
|
-
|
23116
|
-
|
23117
|
-
|
23118
|
-
|
23119
|
-
|
23120
|
-
|
23162
|
+
function makeNativeSimulator(eventType) {
|
23163
|
+
return function (domComponentOrNode, nativeEventData) {
|
23164
|
+
var fakeNativeEvent = new Event(eventType);
|
23165
|
+
_assign(fakeNativeEvent, nativeEventData);
|
23166
|
+
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
23167
|
+
ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
|
23168
|
+
} else if (domComponentOrNode.tagName) {
|
23169
|
+
// Will allow on actual dom nodes.
|
23170
|
+
ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
|
23171
|
+
}
|
23172
|
+
};
|
23121
23173
|
}
|
23122
23174
|
|
23123
|
-
|
23124
|
-
|
23125
|
-
|
23126
|
-
|
23127
|
-
|
23128
|
-
|
23175
|
+
Object.keys(topLevelTypes).forEach(function (eventType) {
|
23176
|
+
// Event type is stored as 'topClick' - we transform that to 'click'
|
23177
|
+
var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
|
23178
|
+
/**
|
23179
|
+
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
23180
|
+
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
|
23181
|
+
*/
|
23182
|
+
ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
|
23183
|
+
});
|
23129
23184
|
|
23130
|
-
module.exports =
|
23185
|
+
module.exports = ReactTestUtils;
|
23186
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
23131
23187
|
|
23132
23188
|
/***/ },
|
23133
23189
|
/* 189 */
|
23134
|
-
/***/ function(module, exports
|
23190
|
+
/***/ function(module, exports) {
|
23135
23191
|
|
23136
23192
|
/**
|
23137
23193
|
* Copyright 2013-present, Facebook, Inc.
|
@@ -23145,104 +23201,91 @@
|
|
23145
23201
|
|
23146
23202
|
'use strict';
|
23147
23203
|
|
23148
|
-
var _assign = __webpack_require__(4);
|
23149
|
-
|
23150
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
23151
|
-
|
23152
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
23153
|
-
|
23154
|
-
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; }
|
23155
|
-
|
23156
|
-
var React = __webpack_require__(2);
|
23157
|
-
|
23158
|
-
var ReactTransitionGroup = __webpack_require__(180);
|
23159
|
-
var ReactCSSTransitionGroupChild = __webpack_require__(190);
|
23160
|
-
|
23161
|
-
function createTransitionTimeoutPropValidator(transitionType) {
|
23162
|
-
var timeoutPropName = 'transition' + transitionType + 'Timeout';
|
23163
|
-
var enabledPropName = 'transition' + transitionType;
|
23164
|
-
|
23165
|
-
return function (props) {
|
23166
|
-
// If the transition is enabled
|
23167
|
-
if (props[enabledPropName]) {
|
23168
|
-
// If no timeout duration is provided
|
23169
|
-
if (props[timeoutPropName] == null) {
|
23170
|
-
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.');
|
23171
|
-
|
23172
|
-
// If the duration isn't a number
|
23173
|
-
} else if (typeof props[timeoutPropName] !== 'number') {
|
23174
|
-
return new Error(timeoutPropName + ' must be a number (in milliseconds)');
|
23175
|
-
}
|
23176
|
-
}
|
23177
|
-
};
|
23178
|
-
}
|
23179
|
-
|
23180
23204
|
/**
|
23181
|
-
*
|
23182
|
-
* enters or leaves the DOM.
|
23183
|
-
* See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
|
23205
|
+
* Types of raw signals from the browser caught at the top level.
|
23184
23206
|
*/
|
23185
|
-
|
23186
|
-
|
23187
|
-
|
23188
|
-
|
23189
|
-
|
23190
|
-
|
23191
|
-
|
23192
|
-
|
23193
|
-
|
23194
|
-
|
23195
|
-
|
23196
|
-
|
23197
|
-
|
23198
|
-
|
23199
|
-
|
23200
|
-
|
23201
|
-
|
23202
|
-
|
23203
|
-
|
23204
|
-
|
23205
|
-
|
23206
|
-
|
23207
|
-
|
23208
|
-
|
23209
|
-
|
23210
|
-
|
23211
|
-
|
23212
|
-
|
23213
|
-
|
23214
|
-
|
23215
|
-
|
23216
|
-
|
23217
|
-
|
23218
|
-
|
23219
|
-
|
23220
|
-
|
23221
|
-
|
23222
|
-
|
23223
|
-
|
23224
|
-
|
23225
|
-
|
23226
|
-
|
23227
|
-
|
23228
|
-
|
23229
|
-
|
23230
|
-
|
23231
|
-
|
23232
|
-
|
23233
|
-
|
23234
|
-
|
23235
|
-
|
23207
|
+
var topLevelTypes = {
|
23208
|
+
topAbort: null,
|
23209
|
+
topAnimationEnd: null,
|
23210
|
+
topAnimationIteration: null,
|
23211
|
+
topAnimationStart: null,
|
23212
|
+
topBlur: null,
|
23213
|
+
topCanPlay: null,
|
23214
|
+
topCanPlayThrough: null,
|
23215
|
+
topChange: null,
|
23216
|
+
topClick: null,
|
23217
|
+
topCompositionEnd: null,
|
23218
|
+
topCompositionStart: null,
|
23219
|
+
topCompositionUpdate: null,
|
23220
|
+
topContextMenu: null,
|
23221
|
+
topCopy: null,
|
23222
|
+
topCut: null,
|
23223
|
+
topDoubleClick: null,
|
23224
|
+
topDrag: null,
|
23225
|
+
topDragEnd: null,
|
23226
|
+
topDragEnter: null,
|
23227
|
+
topDragExit: null,
|
23228
|
+
topDragLeave: null,
|
23229
|
+
topDragOver: null,
|
23230
|
+
topDragStart: null,
|
23231
|
+
topDrop: null,
|
23232
|
+
topDurationChange: null,
|
23233
|
+
topEmptied: null,
|
23234
|
+
topEncrypted: null,
|
23235
|
+
topEnded: null,
|
23236
|
+
topError: null,
|
23237
|
+
topFocus: null,
|
23238
|
+
topInput: null,
|
23239
|
+
topInvalid: null,
|
23240
|
+
topKeyDown: null,
|
23241
|
+
topKeyPress: null,
|
23242
|
+
topKeyUp: null,
|
23243
|
+
topLoad: null,
|
23244
|
+
topLoadedData: null,
|
23245
|
+
topLoadedMetadata: null,
|
23246
|
+
topLoadStart: null,
|
23247
|
+
topMouseDown: null,
|
23248
|
+
topMouseMove: null,
|
23249
|
+
topMouseOut: null,
|
23250
|
+
topMouseOver: null,
|
23251
|
+
topMouseUp: null,
|
23252
|
+
topPaste: null,
|
23253
|
+
topPause: null,
|
23254
|
+
topPlay: null,
|
23255
|
+
topPlaying: null,
|
23256
|
+
topProgress: null,
|
23257
|
+
topRateChange: null,
|
23258
|
+
topReset: null,
|
23259
|
+
topScroll: null,
|
23260
|
+
topSeeked: null,
|
23261
|
+
topSeeking: null,
|
23262
|
+
topSelectionChange: null,
|
23263
|
+
topStalled: null,
|
23264
|
+
topSubmit: null,
|
23265
|
+
topSuspend: null,
|
23266
|
+
topTextInput: null,
|
23267
|
+
topTimeUpdate: null,
|
23268
|
+
topTouchCancel: null,
|
23269
|
+
topTouchEnd: null,
|
23270
|
+
topTouchMove: null,
|
23271
|
+
topTouchStart: null,
|
23272
|
+
topTransitionEnd: null,
|
23273
|
+
topVolumeChange: null,
|
23274
|
+
topWaiting: null,
|
23275
|
+
topWheel: null
|
23236
23276
|
};
|
23237
23277
|
|
23278
|
+
var EventConstants = {
|
23279
|
+
topLevelTypes: topLevelTypes
|
23280
|
+
};
|
23238
23281
|
|
23239
|
-
module.exports =
|
23282
|
+
module.exports = EventConstants;
|
23240
23283
|
|
23241
23284
|
/***/ },
|
23242
23285
|
/* 190 */
|
23243
23286
|
/***/ function(module, exports, __webpack_require__) {
|
23244
23287
|
|
23245
|
-
/**
|
23288
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
23246
23289
|
* Copyright 2013-present, Facebook, Inc.
|
23247
23290
|
* All rights reserved.
|
23248
23291
|
*
|
@@ -23254,160 +23297,129 @@
|
|
23254
23297
|
|
23255
23298
|
'use strict';
|
23256
23299
|
|
23257
|
-
var
|
23258
|
-
|
23259
|
-
|
23260
|
-
var CSSCore = __webpack_require__(191);
|
23261
|
-
var ReactTransitionEvents = __webpack_require__(192);
|
23262
|
-
|
23263
|
-
var onlyChild = __webpack_require__(31);
|
23264
|
-
|
23265
|
-
var TICK = 17;
|
23266
|
-
|
23267
|
-
var ReactCSSTransitionGroupChild = React.createClass({
|
23268
|
-
displayName: 'ReactCSSTransitionGroupChild',
|
23300
|
+
var _prodInvariant = __webpack_require__(35),
|
23301
|
+
_assign = __webpack_require__(4);
|
23269
23302
|
|
23270
|
-
|
23271
|
-
name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
|
23272
|
-
enter: React.PropTypes.string,
|
23273
|
-
leave: React.PropTypes.string,
|
23274
|
-
active: React.PropTypes.string
|
23275
|
-
}), React.PropTypes.shape({
|
23276
|
-
enter: React.PropTypes.string,
|
23277
|
-
enterActive: React.PropTypes.string,
|
23278
|
-
leave: React.PropTypes.string,
|
23279
|
-
leaveActive: React.PropTypes.string,
|
23280
|
-
appear: React.PropTypes.string,
|
23281
|
-
appearActive: React.PropTypes.string
|
23282
|
-
})]).isRequired,
|
23303
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
23283
23304
|
|
23284
|
-
|
23285
|
-
|
23286
|
-
|
23287
|
-
|
23288
|
-
|
23289
|
-
leave: React.PropTypes.bool,
|
23290
|
-
appearTimeout: React.PropTypes.number,
|
23291
|
-
enterTimeout: React.PropTypes.number,
|
23292
|
-
leaveTimeout: React.PropTypes.number
|
23293
|
-
},
|
23305
|
+
var React = __webpack_require__(2);
|
23306
|
+
var ReactDefaultInjection = __webpack_require__(38);
|
23307
|
+
var ReactCompositeComponent = __webpack_require__(119);
|
23308
|
+
var ReactReconciler = __webpack_require__(59);
|
23309
|
+
var ReactUpdates = __webpack_require__(56);
|
23294
23310
|
|
23295
|
-
|
23296
|
-
|
23311
|
+
var emptyObject = __webpack_require__(20);
|
23312
|
+
var getNextDebugID = __webpack_require__(127);
|
23313
|
+
var invariant = __webpack_require__(8);
|
23297
23314
|
|
23298
|
-
|
23299
|
-
|
23300
|
-
|
23301
|
-
}
|
23302
|
-
return;
|
23303
|
-
}
|
23315
|
+
var NoopInternalComponent = function () {
|
23316
|
+
function NoopInternalComponent(element) {
|
23317
|
+
_classCallCheck(this, NoopInternalComponent);
|
23304
23318
|
|
23305
|
-
|
23306
|
-
|
23307
|
-
var timeout = null;
|
23319
|
+
this._renderedOutput = element;
|
23320
|
+
this._currentElement = element;
|
23308
23321
|
|
23309
|
-
|
23310
|
-
|
23311
|
-
|
23312
|
-
|
23322
|
+
if (process.env.NODE_ENV !== 'production') {
|
23323
|
+
this._debugID = getNextDebugID();
|
23324
|
+
}
|
23325
|
+
}
|
23313
23326
|
|
23314
|
-
|
23327
|
+
NoopInternalComponent.prototype.mountComponent = function mountComponent() {};
|
23315
23328
|
|
23316
|
-
|
23317
|
-
|
23329
|
+
NoopInternalComponent.prototype.receiveComponent = function receiveComponent(element) {
|
23330
|
+
this._renderedOutput = element;
|
23331
|
+
this._currentElement = element;
|
23332
|
+
};
|
23318
23333
|
|
23319
|
-
|
23334
|
+
NoopInternalComponent.prototype.unmountComponent = function unmountComponent() {};
|
23320
23335
|
|
23321
|
-
|
23322
|
-
|
23323
|
-
|
23324
|
-
finishCallback();
|
23325
|
-
}
|
23326
|
-
};
|
23336
|
+
NoopInternalComponent.prototype.getHostNode = function getHostNode() {
|
23337
|
+
return undefined;
|
23338
|
+
};
|
23327
23339
|
|
23328
|
-
|
23340
|
+
NoopInternalComponent.prototype.getPublicInstance = function getPublicInstance() {
|
23341
|
+
return null;
|
23342
|
+
};
|
23329
23343
|
|
23330
|
-
|
23331
|
-
|
23344
|
+
return NoopInternalComponent;
|
23345
|
+
}();
|
23332
23346
|
|
23333
|
-
|
23334
|
-
|
23335
|
-
|
23336
|
-
|
23337
|
-
|
23338
|
-
|
23339
|
-
|
23340
|
-
|
23341
|
-
|
23347
|
+
var ShallowComponentWrapper = function (element) {
|
23348
|
+
// TODO: Consolidate with instantiateReactComponent
|
23349
|
+
if (process.env.NODE_ENV !== 'production') {
|
23350
|
+
this._debugID = getNextDebugID();
|
23351
|
+
}
|
23352
|
+
|
23353
|
+
this.construct(element);
|
23354
|
+
};
|
23355
|
+
_assign(ShallowComponentWrapper.prototype, ReactCompositeComponent, {
|
23356
|
+
_constructComponent: ReactCompositeComponent._constructComponentWithoutOwner,
|
23357
|
+
_instantiateReactComponent: function (element) {
|
23358
|
+
return new NoopInternalComponent(element);
|
23342
23359
|
},
|
23360
|
+
_replaceNodeWithMarkup: function () {},
|
23361
|
+
_renderValidatedComponent: ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext
|
23362
|
+
});
|
23343
23363
|
|
23344
|
-
|
23345
|
-
|
23346
|
-
|
23347
|
-
|
23348
|
-
|
23364
|
+
function _batchedRender(renderer, element, context) {
|
23365
|
+
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
|
23366
|
+
renderer._render(element, transaction, context);
|
23367
|
+
ReactUpdates.ReactReconcileTransaction.release(transaction);
|
23368
|
+
}
|
23349
23369
|
|
23350
|
-
|
23351
|
-
|
23352
|
-
|
23353
|
-
},
|
23370
|
+
var ReactShallowRenderer = function () {
|
23371
|
+
function ReactShallowRenderer() {
|
23372
|
+
_classCallCheck(this, ReactShallowRenderer);
|
23354
23373
|
|
23355
|
-
|
23356
|
-
|
23357
|
-
this.classNameAndNodeQueue.forEach(function (obj) {
|
23358
|
-
CSSCore.addClass(obj.node, obj.className);
|
23359
|
-
});
|
23360
|
-
}
|
23361
|
-
this.classNameAndNodeQueue.length = 0;
|
23362
|
-
this.timeout = null;
|
23363
|
-
},
|
23374
|
+
this._instance = null;
|
23375
|
+
}
|
23364
23376
|
|
23365
|
-
|
23366
|
-
this.
|
23367
|
-
|
23368
|
-
},
|
23377
|
+
ReactShallowRenderer.prototype.getMountedInstance = function getMountedInstance() {
|
23378
|
+
return this._instance ? this._instance._instance : null;
|
23379
|
+
};
|
23369
23380
|
|
23370
|
-
|
23371
|
-
|
23372
|
-
|
23373
|
-
|
23374
|
-
|
23375
|
-
clearTimeout(timeout);
|
23376
|
-
});
|
23381
|
+
ReactShallowRenderer.prototype.render = function render(element, context) {
|
23382
|
+
// Ensure we've done the default injections. This might not be true in the
|
23383
|
+
// case of a simple test that only requires React and the TestUtils in
|
23384
|
+
// conjunction with an inline-requires transform.
|
23385
|
+
ReactDefaultInjection.inject();
|
23377
23386
|
|
23378
|
-
|
23379
|
-
|
23387
|
+
!React.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : _prodInvariant('12', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
|
23388
|
+
!(typeof element.type !== 'string') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : _prodInvariant('13', element.type) : void 0;
|
23380
23389
|
|
23381
|
-
|
23382
|
-
|
23383
|
-
this.transition('appear', done, this.props.appearTimeout);
|
23384
|
-
} else {
|
23385
|
-
done();
|
23390
|
+
if (!context) {
|
23391
|
+
context = emptyObject;
|
23386
23392
|
}
|
23387
|
-
|
23393
|
+
ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
|
23388
23394
|
|
23389
|
-
|
23390
|
-
|
23391
|
-
|
23392
|
-
|
23393
|
-
|
23395
|
+
return this.getRenderOutput();
|
23396
|
+
};
|
23397
|
+
|
23398
|
+
ReactShallowRenderer.prototype.getRenderOutput = function getRenderOutput() {
|
23399
|
+
return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
|
23400
|
+
};
|
23401
|
+
|
23402
|
+
ReactShallowRenderer.prototype.unmount = function unmount() {
|
23403
|
+
if (this._instance) {
|
23404
|
+
ReactReconciler.unmountComponent(this._instance, false);
|
23394
23405
|
}
|
23395
|
-
}
|
23406
|
+
};
|
23396
23407
|
|
23397
|
-
|
23398
|
-
if (this.
|
23399
|
-
this.
|
23408
|
+
ReactShallowRenderer.prototype._render = function _render(element, transaction, context) {
|
23409
|
+
if (this._instance) {
|
23410
|
+
ReactReconciler.receiveComponent(this._instance, element, transaction, context);
|
23400
23411
|
} else {
|
23401
|
-
|
23412
|
+
var instance = new ShallowComponentWrapper(element);
|
23413
|
+
ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
|
23414
|
+
this._instance = instance;
|
23402
23415
|
}
|
23403
|
-
}
|
23416
|
+
};
|
23404
23417
|
|
23405
|
-
|
23406
|
-
|
23407
|
-
}
|
23408
|
-
});
|
23418
|
+
return ReactShallowRenderer;
|
23419
|
+
}();
|
23409
23420
|
|
23410
|
-
module.exports =
|
23421
|
+
module.exports = ReactShallowRenderer;
|
23422
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
23411
23423
|
|
23412
23424
|
/***/ },
|
23413
23425
|
/* 191 */
|
@@ -23615,52 +23627,7 @@
|
|
23615
23627
|
|
23616
23628
|
/***/ },
|
23617
23629
|
/* 193 */
|
23618
|
-
/***/ function(module, exports
|
23619
|
-
|
23620
|
-
module.exports = __webpack_require__(194);
|
23621
|
-
|
23622
|
-
/***/ },
|
23623
|
-
/* 194 */
|
23624
|
-
/***/ function(module, exports, __webpack_require__) {
|
23625
|
-
|
23626
|
-
/**
|
23627
|
-
* Copyright 2013-present, Facebook, Inc.
|
23628
|
-
* All rights reserved.
|
23629
|
-
*
|
23630
|
-
* This source code is licensed under the BSD-style license found in the
|
23631
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
23632
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
23633
|
-
*
|
23634
|
-
*/
|
23635
|
-
|
23636
|
-
'use strict';
|
23637
|
-
|
23638
|
-
var ReactLink = __webpack_require__(195);
|
23639
|
-
var ReactStateSetters = __webpack_require__(196);
|
23640
|
-
|
23641
|
-
/**
|
23642
|
-
* A simple mixin around ReactLink.forState().
|
23643
|
-
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
|
23644
|
-
*/
|
23645
|
-
var LinkedStateMixin = {
|
23646
|
-
/**
|
23647
|
-
* Create a ReactLink that's linked to part of this component's state. The
|
23648
|
-
* ReactLink will have the current value of this.state[key] and will call
|
23649
|
-
* setState() when a change is requested.
|
23650
|
-
*
|
23651
|
-
* @param {string} key state key to update.
|
23652
|
-
* @return {ReactLink} ReactLink instance linking to the state.
|
23653
|
-
*/
|
23654
|
-
linkState: function (key) {
|
23655
|
-
return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
|
23656
|
-
}
|
23657
|
-
};
|
23658
|
-
|
23659
|
-
module.exports = LinkedStateMixin;
|
23660
|
-
|
23661
|
-
/***/ },
|
23662
|
-
/* 195 */
|
23663
|
-
/***/ function(module, exports, __webpack_require__) {
|
23630
|
+
/***/ function(module, exports) {
|
23664
23631
|
|
23665
23632
|
/**
|
23666
23633
|
* Copyright 2013-present, Facebook, Inc.
|
@@ -23669,7 +23636,6 @@
|
|
23669
23636
|
* This source code is licensed under the BSD-style license found in the
|
23670
23637
|
* LICENSE file in the root directory of this source tree. An additional grant
|
23671
23638
|
* of patent rights can be found in the PATENTS file in the same directory.
|
23672
|
-
*
|
23673
23639
|
*/
|
23674
23640
|
|
23675
23641
|
'use strict';
|
@@ -23697,8 +23663,6 @@
|
|
23697
23663
|
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
|
23698
23664
|
*/
|
23699
23665
|
|
23700
|
-
var React = __webpack_require__(2);
|
23701
|
-
|
23702
23666
|
/**
|
23703
23667
|
* Deprecated: An an easy way to express two-way binding with React.
|
23704
23668
|
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
|
@@ -23721,33 +23685,17 @@
|
|
23721
23685
|
*/
|
23722
23686
|
function createLinkTypeChecker(linkType) {
|
23723
23687
|
var shapes = {
|
23724
|
-
value: linkType === undefined ?
|
23725
|
-
|
23688
|
+
value: linkType === undefined ?
|
23689
|
+
React.PropTypes.any.isRequired :
|
23690
|
+
linkType.isRequired,
|
23691
|
+
requestChange: React.PropTypes.func.isRequired,
|
23726
23692
|
};
|
23727
23693
|
return React.PropTypes.shape(shapes);
|
23728
|
-
}
|
23729
|
-
|
23730
|
-
ReactLink.PropTypes = {
|
23731
|
-
link: createLinkTypeChecker
|
23732
|
-
};
|
23733
|
-
|
23734
|
-
module.exports = ReactLink;
|
23735
|
-
|
23736
|
-
/***/ },
|
23737
|
-
/* 196 */
|
23738
|
-
/***/ function(module, exports) {
|
23739
|
-
|
23740
|
-
/**
|
23741
|
-
* Copyright 2013-present, Facebook, Inc.
|
23742
|
-
* All rights reserved.
|
23743
|
-
*
|
23744
|
-
* This source code is licensed under the BSD-style license found in the
|
23745
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
23746
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
23747
|
-
*
|
23748
|
-
*/
|
23694
|
+
}
|
23749
23695
|
|
23750
|
-
|
23696
|
+
ReactLink.PropTypes = {
|
23697
|
+
link: createLinkTypeChecker,
|
23698
|
+
};
|
23751
23699
|
|
23752
23700
|
var ReactStateSetters = {
|
23753
23701
|
/**
|
@@ -23760,8 +23708,8 @@
|
|
23760
23708
|
* @return {function} callback that when invoked uses funcReturningState to
|
23761
23709
|
* determined the object literal to setState.
|
23762
23710
|
*/
|
23763
|
-
createStateSetter: function
|
23764
|
-
return function
|
23711
|
+
createStateSetter: function(component, funcReturningState) {
|
23712
|
+
return function(a, b, c, d, e, f) {
|
23765
23713
|
var partialState = funcReturningState.call(component, a, b, c, d, e, f);
|
23766
23714
|
if (partialState) {
|
23767
23715
|
component.setState(partialState);
|
@@ -23780,11 +23728,11 @@
|
|
23780
23728
|
* @return {function} callback of 1 argument which calls setState() with
|
23781
23729
|
* the provided keyName and callback argument.
|
23782
23730
|
*/
|
23783
|
-
createStateKeySetter: function
|
23731
|
+
createStateKeySetter: function(component, key) {
|
23784
23732
|
// Memoize the setters.
|
23785
23733
|
var cache = component.__keySetters || (component.__keySetters = {});
|
23786
23734
|
return cache[key] || (cache[key] = createStateKeySetter(component, key));
|
23787
|
-
}
|
23735
|
+
},
|
23788
23736
|
};
|
23789
23737
|
|
23790
23738
|
function createStateKeySetter(component, key) {
|
@@ -23798,137 +23746,520 @@
|
|
23798
23746
|
};
|
23799
23747
|
}
|
23800
23748
|
|
23801
|
-
ReactStateSetters.Mixin = {
|
23802
|
-
/**
|
23803
|
-
* Returns a function that calls the provided function, and uses the result
|
23804
|
-
* of that to set the component's state.
|
23805
|
-
*
|
23806
|
-
* For example, these statements are equivalent:
|
23807
|
-
*
|
23808
|
-
* this.setState({x: 1});
|
23809
|
-
* this.createStateSetter(function(xValue) {
|
23810
|
-
* return {x: xValue};
|
23811
|
-
* })(1);
|
23812
|
-
*
|
23813
|
-
* @param {function} funcReturningState Returned callback uses this to
|
23814
|
-
* determine how to update state.
|
23815
|
-
* @return {function} callback that when invoked uses funcReturningState to
|
23816
|
-
* determined the object literal to setState.
|
23817
|
-
*/
|
23818
|
-
createStateSetter: function
|
23819
|
-
return ReactStateSetters.createStateSetter(this, funcReturningState);
|
23820
|
-
},
|
23749
|
+
ReactStateSetters.Mixin = {
|
23750
|
+
/**
|
23751
|
+
* Returns a function that calls the provided function, and uses the result
|
23752
|
+
* of that to set the component's state.
|
23753
|
+
*
|
23754
|
+
* For example, these statements are equivalent:
|
23755
|
+
*
|
23756
|
+
* this.setState({x: 1});
|
23757
|
+
* this.createStateSetter(function(xValue) {
|
23758
|
+
* return {x: xValue};
|
23759
|
+
* })(1);
|
23760
|
+
*
|
23761
|
+
* @param {function} funcReturningState Returned callback uses this to
|
23762
|
+
* determine how to update state.
|
23763
|
+
* @return {function} callback that when invoked uses funcReturningState to
|
23764
|
+
* determined the object literal to setState.
|
23765
|
+
*/
|
23766
|
+
createStateSetter: function(funcReturningState) {
|
23767
|
+
return ReactStateSetters.createStateSetter(this, funcReturningState);
|
23768
|
+
},
|
23769
|
+
|
23770
|
+
/**
|
23771
|
+
* Returns a single-argument callback that can be used to update a single
|
23772
|
+
* key in the component's state.
|
23773
|
+
*
|
23774
|
+
* For example, these statements are equivalent:
|
23775
|
+
*
|
23776
|
+
* this.setState({x: 1});
|
23777
|
+
* this.createStateKeySetter('x')(1);
|
23778
|
+
*
|
23779
|
+
* Note: this is memoized function, which makes it inexpensive to call.
|
23780
|
+
*
|
23781
|
+
* @param {string} key The key in the state that you should update.
|
23782
|
+
* @return {function} callback of 1 argument which calls setState() with
|
23783
|
+
* the provided keyName and callback argument.
|
23784
|
+
*/
|
23785
|
+
createStateKeySetter: function(key) {
|
23786
|
+
return ReactStateSetters.createStateKeySetter(this, key);
|
23787
|
+
},
|
23788
|
+
};
|
23789
|
+
|
23790
|
+
/**
|
23791
|
+
* A simple mixin around ReactLink.forState().
|
23792
|
+
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
|
23793
|
+
*/
|
23794
|
+
var LinkedStateMixin = {
|
23795
|
+
/**
|
23796
|
+
* Create a ReactLink that's linked to part of this component's state. The
|
23797
|
+
* ReactLink will have the current value of this.state[key] and will call
|
23798
|
+
* setState() when a change is requested.
|
23799
|
+
*
|
23800
|
+
* @param {string} key state key to update.
|
23801
|
+
* @return {ReactLink} ReactLink instance linking to the state.
|
23802
|
+
*/
|
23803
|
+
linkState: function(key) {
|
23804
|
+
return new ReactLink(
|
23805
|
+
this.state[key],
|
23806
|
+
ReactStateSetters.createStateKeySetter(this, key)
|
23807
|
+
);
|
23808
|
+
},
|
23809
|
+
};
|
23810
|
+
|
23811
|
+
module.exports = LinkedStateMixin;
|
23812
|
+
|
23813
|
+
|
23814
|
+
/***/ },
|
23815
|
+
/* 194 */
|
23816
|
+
/***/ function(module, exports, __webpack_require__) {
|
23817
|
+
|
23818
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
23819
|
+
* Copyright 2015-present, Facebook, Inc.
|
23820
|
+
* All rights reserved.
|
23821
|
+
*
|
23822
|
+
* This source code is licensed under the BSD-style license found in the
|
23823
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
23824
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
23825
|
+
*
|
23826
|
+
* @providesModule createReactFragment
|
23827
|
+
*/
|
23828
|
+
|
23829
|
+
'use strict';
|
23830
|
+
|
23831
|
+
var React = __webpack_require__(1);
|
23832
|
+
|
23833
|
+
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
|
23834
|
+
Symbol.for &&
|
23835
|
+
Symbol.for('react.element')) ||
|
23836
|
+
0xeac7;
|
23837
|
+
|
23838
|
+
function makeEmptyFunction(arg) {
|
23839
|
+
return function () {
|
23840
|
+
return arg;
|
23841
|
+
};
|
23842
|
+
}
|
23843
|
+
var emptyFunction = function emptyFunction() {};
|
23844
|
+
emptyFunction.thatReturns = makeEmptyFunction;
|
23845
|
+
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
23846
|
+
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
23847
|
+
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
23848
|
+
emptyFunction.thatReturnsThis = function () {
|
23849
|
+
return this;
|
23850
|
+
};
|
23851
|
+
emptyFunction.thatReturnsArgument = function (arg) {
|
23852
|
+
return arg;
|
23853
|
+
};
|
23854
|
+
|
23855
|
+
var validateFormat = function validateFormat(format) {};
|
23856
|
+
|
23857
|
+
if (process.env.NODE_ENV !== 'production') {
|
23858
|
+
validateFormat = function validateFormat(format) {
|
23859
|
+
if (format === undefined) {
|
23860
|
+
throw new Error('invariant requires an error message argument');
|
23861
|
+
}
|
23862
|
+
};
|
23863
|
+
}
|
23864
|
+
|
23865
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
23866
|
+
validateFormat(format);
|
23867
|
+
|
23868
|
+
if (!condition) {
|
23869
|
+
var error;
|
23870
|
+
if (format === undefined) {
|
23871
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
23872
|
+
} else {
|
23873
|
+
var args = [a, b, c, d, e, f];
|
23874
|
+
var argIndex = 0;
|
23875
|
+
error = new Error(format.replace(/%s/g, function () {
|
23876
|
+
return args[argIndex++];
|
23877
|
+
}));
|
23878
|
+
error.name = 'Invariant Violation';
|
23879
|
+
}
|
23880
|
+
|
23881
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
23882
|
+
throw error;
|
23883
|
+
}
|
23884
|
+
}
|
23885
|
+
|
23886
|
+
var warning = emptyFunction;
|
23887
|
+
|
23888
|
+
if (process.env.NODE_ENV !== 'production') {
|
23889
|
+
(function () {
|
23890
|
+
var printWarning = function printWarning(format) {
|
23891
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
23892
|
+
args[_key - 1] = arguments[_key];
|
23893
|
+
}
|
23894
|
+
|
23895
|
+
var argIndex = 0;
|
23896
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
23897
|
+
return args[argIndex++];
|
23898
|
+
});
|
23899
|
+
if (typeof console !== 'undefined') {
|
23900
|
+
console.error(message);
|
23901
|
+
}
|
23902
|
+
try {
|
23903
|
+
// --- Welcome to debugging React ---
|
23904
|
+
// This error was thrown as a convenience so that you can use this stack
|
23905
|
+
// to find the callsite that caused this warning to fire.
|
23906
|
+
throw new Error(message);
|
23907
|
+
} catch (x) {}
|
23908
|
+
};
|
23909
|
+
|
23910
|
+
warning = function warning(condition, format) {
|
23911
|
+
if (format === undefined) {
|
23912
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
23913
|
+
}
|
23914
|
+
|
23915
|
+
if (format.indexOf('Failed Composite propType: ') === 0) {
|
23916
|
+
return; // Ignore CompositeComponent proptype check.
|
23917
|
+
}
|
23918
|
+
|
23919
|
+
if (!condition) {
|
23920
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
23921
|
+
args[_key2 - 2] = arguments[_key2];
|
23922
|
+
}
|
23923
|
+
|
23924
|
+
printWarning.apply(undefined, [format].concat(args));
|
23925
|
+
}
|
23926
|
+
};
|
23927
|
+
})();
|
23928
|
+
}
|
23929
|
+
|
23930
|
+
var SEPARATOR = '.';
|
23931
|
+
var SUBSEPARATOR = ':';
|
23932
|
+
|
23933
|
+
var didWarnAboutMaps = false;
|
23934
|
+
|
23935
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
23936
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
23937
|
+
|
23938
|
+
function getIteratorFn(maybeIterable) {
|
23939
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
23940
|
+
if (typeof iteratorFn === 'function') {
|
23941
|
+
return iteratorFn;
|
23942
|
+
}
|
23943
|
+
}
|
23944
|
+
|
23945
|
+
function escape(key) {
|
23946
|
+
var escapeRegex = /[=:]/g;
|
23947
|
+
var escaperLookup = {
|
23948
|
+
'=': '=0',
|
23949
|
+
':': '=2'
|
23950
|
+
};
|
23951
|
+
var escapedString = ('' + key).replace(escapeRegex, function(match) {
|
23952
|
+
return escaperLookup[match];
|
23953
|
+
});
|
23954
|
+
|
23955
|
+
return '$' + escapedString;
|
23956
|
+
}
|
23957
|
+
|
23958
|
+
function getComponentKey(component, index) {
|
23959
|
+
// Do some typechecking here since we call this blindly. We want to ensure
|
23960
|
+
// that we don't block potential future ES APIs.
|
23961
|
+
if (component && typeof component === 'object' && component.key != null) {
|
23962
|
+
// Explicit key
|
23963
|
+
return escape(component.key);
|
23964
|
+
}
|
23965
|
+
// Implicit key determined by the index in the set
|
23966
|
+
return index.toString(36);
|
23967
|
+
}
|
23968
|
+
|
23969
|
+
function traverseAllChildrenImpl(
|
23970
|
+
children,
|
23971
|
+
nameSoFar,
|
23972
|
+
callback,
|
23973
|
+
traverseContext
|
23974
|
+
) {
|
23975
|
+
var type = typeof children;
|
23976
|
+
|
23977
|
+
if (type === 'undefined' || type === 'boolean') {
|
23978
|
+
// All of the above are perceived as null.
|
23979
|
+
children = null;
|
23980
|
+
}
|
23981
|
+
|
23982
|
+
if (
|
23983
|
+
children === null ||
|
23984
|
+
type === 'string' ||
|
23985
|
+
type === 'number' ||
|
23986
|
+
// The following is inlined from ReactElement. This means we can optimize
|
23987
|
+
// some checks. React Fiber also inlines this logic for similar purposes.
|
23988
|
+
(type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE)
|
23989
|
+
) {
|
23990
|
+
callback(
|
23991
|
+
traverseContext,
|
23992
|
+
children,
|
23993
|
+
// If it's the only child, treat the name as if it was wrapped in an array
|
23994
|
+
// so that it's consistent if the number of children grows.
|
23995
|
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar
|
23996
|
+
);
|
23997
|
+
return 1;
|
23998
|
+
}
|
23999
|
+
|
24000
|
+
var child;
|
24001
|
+
var nextName;
|
24002
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
24003
|
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
24004
|
+
|
24005
|
+
if (Array.isArray(children)) {
|
24006
|
+
for (var i = 0; i < children.length; i++) {
|
24007
|
+
child = children[i];
|
24008
|
+
nextName = nextNamePrefix + getComponentKey(child, i);
|
24009
|
+
subtreeCount += traverseAllChildrenImpl(
|
24010
|
+
child,
|
24011
|
+
nextName,
|
24012
|
+
callback,
|
24013
|
+
traverseContext
|
24014
|
+
);
|
24015
|
+
}
|
24016
|
+
} else {
|
24017
|
+
var iteratorFn = getIteratorFn(children);
|
24018
|
+
if (iteratorFn) {
|
24019
|
+
if (process.env.NODE_ENV !== "production") {
|
24020
|
+
// Warn about using Maps as children
|
24021
|
+
if (iteratorFn === children.entries) {
|
24022
|
+
warning(
|
24023
|
+
didWarnAboutMaps,
|
24024
|
+
'Using Maps as children is unsupported and will likely yield ' +
|
24025
|
+
'unexpected results. Convert it to a sequence/iterable of keyed ' +
|
24026
|
+
'ReactElements instead.'
|
24027
|
+
);
|
24028
|
+
didWarnAboutMaps = true;
|
24029
|
+
}
|
24030
|
+
}
|
24031
|
+
|
24032
|
+
var iterator = iteratorFn.call(children);
|
24033
|
+
var step;
|
24034
|
+
var ii = 0;
|
24035
|
+
while (!(step = iterator.next()).done) {
|
24036
|
+
child = step.value;
|
24037
|
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
24038
|
+
subtreeCount += traverseAllChildrenImpl(
|
24039
|
+
child,
|
24040
|
+
nextName,
|
24041
|
+
callback,
|
24042
|
+
traverseContext
|
24043
|
+
);
|
24044
|
+
}
|
24045
|
+
} else if (type === 'object') {
|
24046
|
+
var addendum = '';
|
24047
|
+
if (process.env.NODE_ENV !== "production") {
|
24048
|
+
addendum = ' If you meant to render a collection of children, use an array ' +
|
24049
|
+
'instead or wrap the object using createFragment(object) from the ' +
|
24050
|
+
'React add-ons.';
|
24051
|
+
}
|
24052
|
+
var childrenString = '' + children;
|
24053
|
+
invariant(
|
24054
|
+
false,
|
24055
|
+
'Objects are not valid as a React child (found: %s).%s',
|
24056
|
+
childrenString === '[object Object]'
|
24057
|
+
? 'object with keys {' + Object.keys(children).join(', ') + '}'
|
24058
|
+
: childrenString,
|
24059
|
+
addendum
|
24060
|
+
);
|
24061
|
+
}
|
24062
|
+
}
|
24063
|
+
|
24064
|
+
return subtreeCount;
|
24065
|
+
}
|
24066
|
+
|
24067
|
+
function traverseAllChildren(children, callback, traverseContext) {
|
24068
|
+
if (children == null) {
|
24069
|
+
return 0;
|
24070
|
+
}
|
24071
|
+
|
24072
|
+
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
24073
|
+
}
|
24074
|
+
|
24075
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
24076
|
+
function escapeUserProvidedKey(text) {
|
24077
|
+
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
24078
|
+
}
|
23821
24079
|
|
23822
|
-
|
23823
|
-
|
23824
|
-
|
23825
|
-
|
23826
|
-
|
23827
|
-
|
23828
|
-
|
23829
|
-
|
23830
|
-
*
|
23831
|
-
* Note: this is memoized function, which makes it inexpensive to call.
|
23832
|
-
*
|
23833
|
-
* @param {string} key The key in the state that you should update.
|
23834
|
-
* @return {function} callback of 1 argument which calls setState() with
|
23835
|
-
* the provided keyName and callback argument.
|
23836
|
-
*/
|
23837
|
-
createStateKeySetter: function (key) {
|
23838
|
-
return ReactStateSetters.createStateKeySetter(this, key);
|
23839
|
-
}
|
24080
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
24081
|
+
return React.cloneElement(
|
24082
|
+
oldElement,
|
24083
|
+
{ key: newKey },
|
24084
|
+
oldElement.props !== undefined
|
24085
|
+
? oldElement.props.children
|
24086
|
+
: undefined
|
24087
|
+
);
|
23840
24088
|
};
|
23841
24089
|
|
23842
|
-
|
23843
|
-
|
23844
|
-
/***/ },
|
23845
|
-
/* 197 */
|
23846
|
-
/***/ function(module, exports, __webpack_require__) {
|
24090
|
+
var DEFAULT_POOL_SIZE = 10;
|
24091
|
+
var DEFAULT_POOLER = oneArgumentPooler;
|
23847
24092
|
|
23848
|
-
|
24093
|
+
var oneArgumentPooler = function(copyFieldsFrom) {
|
24094
|
+
var Klass = this;
|
24095
|
+
if (Klass.instancePool.length) {
|
24096
|
+
var instance = Klass.instancePool.pop();
|
24097
|
+
Klass.call(instance, copyFieldsFrom);
|
24098
|
+
return instance;
|
24099
|
+
} else {
|
24100
|
+
return new Klass(copyFieldsFrom);
|
24101
|
+
}
|
24102
|
+
};
|
23849
24103
|
|
23850
|
-
|
23851
|
-
|
23852
|
-
|
24104
|
+
var addPoolingTo = function addPoolingTo(
|
24105
|
+
CopyConstructor,
|
24106
|
+
pooler
|
24107
|
+
) {
|
24108
|
+
// Casting as any so that flow ignores the actual implementation and trusts
|
24109
|
+
// it to match the type we declared
|
24110
|
+
var NewKlass = CopyConstructor;
|
24111
|
+
NewKlass.instancePool = [];
|
24112
|
+
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
24113
|
+
if (!NewKlass.poolSize) {
|
24114
|
+
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
24115
|
+
}
|
24116
|
+
NewKlass.release = standardReleaser;
|
24117
|
+
return NewKlass;
|
24118
|
+
};
|
23853
24119
|
|
23854
|
-
|
23855
|
-
|
23856
|
-
|
23857
|
-
|
23858
|
-
|
23859
|
-
|
23860
|
-
|
23861
|
-
|
23862
|
-
|
24120
|
+
var standardReleaser = function standardReleaser(instance) {
|
24121
|
+
var Klass = this;
|
24122
|
+
invariant(
|
24123
|
+
instance instanceof Klass,
|
24124
|
+
'Trying to release an instance into a pool of a different type.'
|
24125
|
+
);
|
24126
|
+
instance.destructor();
|
24127
|
+
if (Klass.instancePool.length < Klass.poolSize) {
|
24128
|
+
Klass.instancePool.push(instance);
|
24129
|
+
}
|
24130
|
+
};
|
23863
24131
|
|
23864
|
-
|
24132
|
+
var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) {
|
24133
|
+
var Klass = this;
|
24134
|
+
if (Klass.instancePool.length) {
|
24135
|
+
var instance = Klass.instancePool.pop();
|
24136
|
+
Klass.call(instance, a1, a2, a3, a4);
|
24137
|
+
return instance;
|
24138
|
+
} else {
|
24139
|
+
return new Klass(a1, a2, a3, a4);
|
24140
|
+
}
|
24141
|
+
};
|
23865
24142
|
|
23866
|
-
|
24143
|
+
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
24144
|
+
this.result = mapResult;
|
24145
|
+
this.keyPrefix = keyPrefix;
|
24146
|
+
this.func = mapFunction;
|
24147
|
+
this.context = mapContext;
|
24148
|
+
this.count = 0;
|
24149
|
+
}
|
24150
|
+
MapBookKeeping.prototype.destructor = function() {
|
24151
|
+
this.result = null;
|
24152
|
+
this.keyPrefix = null;
|
24153
|
+
this.func = null;
|
24154
|
+
this.context = null;
|
24155
|
+
this.count = 0;
|
24156
|
+
};
|
24157
|
+
addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
23867
24158
|
|
23868
|
-
|
23869
|
-
|
24159
|
+
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
24160
|
+
var result = bookKeeping.result;
|
24161
|
+
var keyPrefix = bookKeeping.keyPrefix;
|
24162
|
+
var func = bookKeeping.func;
|
24163
|
+
var context = bookKeeping.context;
|
23870
24164
|
|
23871
|
-
|
23872
|
-
|
23873
|
-
|
24165
|
+
var mappedChild = func.call(context, child, bookKeeping.count++);
|
24166
|
+
if (Array.isArray(mappedChild)) {
|
24167
|
+
mapIntoWithKeyPrefixInternal(
|
24168
|
+
mappedChild,
|
24169
|
+
result,
|
24170
|
+
childKey,
|
24171
|
+
emptyFunction.thatReturnsArgument
|
24172
|
+
);
|
24173
|
+
} else if (mappedChild != null) {
|
24174
|
+
if (React.isValidElement(mappedChild)) {
|
24175
|
+
mappedChild = cloneAndReplaceKey(
|
24176
|
+
mappedChild,
|
24177
|
+
// Keep both the (mapped) and old keys if they differ, just as
|
24178
|
+
// traverseAllChildren used to do for objects as children
|
24179
|
+
keyPrefix +
|
24180
|
+
(mappedChild.key && (!child || child.key !== mappedChild.key)
|
24181
|
+
? escapeUserProvidedKey(mappedChild.key) + '/'
|
24182
|
+
: '') +
|
24183
|
+
childKey
|
24184
|
+
);
|
24185
|
+
}
|
24186
|
+
result.push(mappedChild);
|
24187
|
+
}
|
24188
|
+
}
|
23874
24189
|
|
23875
|
-
|
23876
|
-
|
23877
|
-
|
23878
|
-
|
23879
|
-
|
23880
|
-
|
23881
|
-
|
24190
|
+
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
24191
|
+
var escapedPrefix = '';
|
24192
|
+
if (prefix != null) {
|
24193
|
+
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
24194
|
+
}
|
24195
|
+
var traverseContext = MapBookKeeping.getPooled(
|
24196
|
+
array,
|
24197
|
+
escapedPrefix,
|
24198
|
+
func,
|
24199
|
+
context
|
24200
|
+
);
|
24201
|
+
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
24202
|
+
MapBookKeeping.release(traverseContext);
|
24203
|
+
}
|
23882
24204
|
|
23883
24205
|
var numericPropertyRegex = /^\d+$/;
|
23884
24206
|
|
23885
24207
|
var warnedAboutNumeric = false;
|
23886
24208
|
|
23887
|
-
|
23888
|
-
|
23889
|
-
|
23890
|
-
|
23891
|
-
|
23892
|
-
|
23893
|
-
|
23894
|
-
|
23895
|
-
|
23896
|
-
|
23897
|
-
|
23898
|
-
|
23899
|
-
|
23900
|
-
|
23901
|
-
|
23902
|
-
|
23903
|
-
|
24209
|
+
function createReactFragment(object) {
|
24210
|
+
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
24211
|
+
warning(
|
24212
|
+
false,
|
24213
|
+
'React.addons.createFragment only accepts a single object. Got: %s',
|
24214
|
+
object
|
24215
|
+
);
|
24216
|
+
return object;
|
24217
|
+
}
|
24218
|
+
if (React.isValidElement(object)) {
|
24219
|
+
warning(
|
24220
|
+
false,
|
24221
|
+
'React.addons.createFragment does not accept a ReactElement ' +
|
24222
|
+
'without a wrapper object.'
|
24223
|
+
);
|
24224
|
+
return object;
|
24225
|
+
}
|
23904
24226
|
|
23905
|
-
|
24227
|
+
invariant(
|
24228
|
+
object.nodeType !== 1,
|
24229
|
+
'React.addons.createFragment(...): Encountered an invalid child; DOM ' +
|
24230
|
+
'elements are not valid children of React components.'
|
24231
|
+
);
|
23906
24232
|
|
23907
|
-
|
23908
|
-
if (process.env.NODE_ENV !== 'production') {
|
23909
|
-
if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
|
23910
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
|
23911
|
-
warnedAboutNumeric = true;
|
23912
|
-
}
|
23913
|
-
}
|
23914
|
-
ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
|
23915
|
-
}
|
24233
|
+
var result = [];
|
23916
24234
|
|
23917
|
-
|
24235
|
+
for (var key in object) {
|
24236
|
+
if (process.env.NODE_ENV !== "production") {
|
24237
|
+
if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
|
24238
|
+
warning(
|
24239
|
+
false,
|
24240
|
+
'React.addons.createFragment(...): Child objects should have ' +
|
24241
|
+
'non-numeric keys so ordering is preserved.'
|
24242
|
+
);
|
24243
|
+
warnedAboutNumeric = true;
|
24244
|
+
}
|
24245
|
+
}
|
24246
|
+
mapIntoWithKeyPrefixInternal(
|
24247
|
+
object[key],
|
24248
|
+
result,
|
24249
|
+
key,
|
24250
|
+
emptyFunction.thatReturnsArgument
|
24251
|
+
);
|
23918
24252
|
}
|
23919
|
-
};
|
23920
24253
|
|
23921
|
-
|
23922
|
-
|
24254
|
+
return result;
|
24255
|
+
}
|
23923
24256
|
|
23924
|
-
|
23925
|
-
/* 199 */
|
23926
|
-
/***/ function(module, exports, __webpack_require__) {
|
24257
|
+
module.exports = createReactFragment;
|
23927
24258
|
|
23928
|
-
|
24259
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
23929
24260
|
|
23930
24261
|
/***/ },
|
23931
|
-
/*
|
24262
|
+
/* 195 */
|
23932
24263
|
/***/ function(module, exports, __webpack_require__) {
|
23933
24264
|
|
23934
24265
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -23939,23 +24270,50 @@
|
|
23939
24270
|
* LICENSE file in the root directory of this source tree. An additional grant
|
23940
24271
|
* of patent rights can be found in the PATENTS file in the same directory.
|
23941
24272
|
*
|
24273
|
+
* @providesModule update
|
23942
24274
|
*/
|
23943
24275
|
|
23944
|
-
|
24276
|
+
/* global hasOwnProperty:true */
|
23945
24277
|
|
23946
24278
|
'use strict';
|
23947
24279
|
|
23948
|
-
var
|
23949
|
-
|
24280
|
+
var NODE_ENV = process.env.NODE_ENV;
|
24281
|
+
|
24282
|
+
var invariant = function(condition, format, a, b, c, d, e, f) {
|
24283
|
+
if (NODE_ENV !== 'production') {
|
24284
|
+
if (format === undefined) {
|
24285
|
+
throw new Error('invariant requires an error message argument');
|
24286
|
+
}
|
24287
|
+
}
|
24288
|
+
|
24289
|
+
if (!condition) {
|
24290
|
+
var error;
|
24291
|
+
if (format === undefined) {
|
24292
|
+
error = new Error(
|
24293
|
+
'Minified exception occurred; use the non-minified dev environment ' +
|
24294
|
+
'for the full error message and additional helpful warnings.'
|
24295
|
+
);
|
24296
|
+
} else {
|
24297
|
+
var args = [a, b, c, d, e, f];
|
24298
|
+
var argIndex = 0;
|
24299
|
+
error = new Error(
|
24300
|
+
format.replace(/%s/g, function() { return args[argIndex++]; })
|
24301
|
+
);
|
24302
|
+
error.name = 'Invariant Violation';
|
24303
|
+
}
|
24304
|
+
|
24305
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
24306
|
+
throw error;
|
24307
|
+
}
|
24308
|
+
};
|
23950
24309
|
|
23951
|
-
var invariant = __webpack_require__(8);
|
23952
24310
|
var hasOwnProperty = {}.hasOwnProperty;
|
23953
24311
|
|
23954
24312
|
function shallowCopy(x) {
|
23955
24313
|
if (Array.isArray(x)) {
|
23956
24314
|
return x.concat();
|
23957
24315
|
} else if (x && typeof x === 'object') {
|
23958
|
-
return
|
24316
|
+
return Object.assign(new x.constructor(), x);
|
23959
24317
|
} else {
|
23960
24318
|
return x;
|
23961
24319
|
}
|
@@ -23968,18 +24326,36 @@
|
|
23968
24326
|
var COMMAND_MERGE = '$merge';
|
23969
24327
|
var COMMAND_APPLY = '$apply';
|
23970
24328
|
|
23971
|
-
var ALL_COMMANDS_LIST = [
|
24329
|
+
var ALL_COMMANDS_LIST = [
|
24330
|
+
COMMAND_PUSH,
|
24331
|
+
COMMAND_UNSHIFT,
|
24332
|
+
COMMAND_SPLICE,
|
24333
|
+
COMMAND_SET,
|
24334
|
+
COMMAND_MERGE,
|
24335
|
+
COMMAND_APPLY,
|
24336
|
+
];
|
23972
24337
|
|
23973
24338
|
var ALL_COMMANDS_SET = {};
|
23974
24339
|
|
23975
|
-
ALL_COMMANDS_LIST.forEach(function
|
24340
|
+
ALL_COMMANDS_LIST.forEach(function(command) {
|
23976
24341
|
ALL_COMMANDS_SET[command] = true;
|
23977
24342
|
});
|
23978
24343
|
|
23979
24344
|
function invariantArrayCase(value, spec, command) {
|
23980
|
-
|
24345
|
+
invariant(
|
24346
|
+
Array.isArray(value),
|
24347
|
+
'update(): expected target of %s to be an array; got %s.',
|
24348
|
+
command,
|
24349
|
+
value
|
24350
|
+
);
|
23981
24351
|
var specValue = spec[command];
|
23982
|
-
|
24352
|
+
invariant(
|
24353
|
+
Array.isArray(specValue),
|
24354
|
+
'update(): expected spec of %s to be an array; got %s. ' +
|
24355
|
+
'Did you forget to wrap your parameter in an array?',
|
24356
|
+
command,
|
24357
|
+
specValue
|
24358
|
+
);
|
23983
24359
|
}
|
23984
24360
|
|
23985
24361
|
/**
|
@@ -23987,10 +24363,20 @@
|
|
23987
24363
|
* See https://facebook.github.io/react/docs/update.html for details.
|
23988
24364
|
*/
|
23989
24365
|
function update(value, spec) {
|
23990
|
-
|
24366
|
+
invariant(
|
24367
|
+
typeof spec === 'object',
|
24368
|
+
'update(): You provided a key path to update() that did not contain one ' +
|
24369
|
+
'of %s. Did you forget to include {%s: ...}?',
|
24370
|
+
ALL_COMMANDS_LIST.join(', '),
|
24371
|
+
COMMAND_SET
|
24372
|
+
);
|
23991
24373
|
|
23992
24374
|
if (hasOwnProperty.call(spec, COMMAND_SET)) {
|
23993
|
-
|
24375
|
+
invariant(
|
24376
|
+
Object.keys(spec).length === 1,
|
24377
|
+
'Cannot have more than one key in an object with %s',
|
24378
|
+
COMMAND_SET
|
24379
|
+
);
|
23994
24380
|
|
23995
24381
|
return spec[COMMAND_SET];
|
23996
24382
|
}
|
@@ -23999,36 +24385,68 @@
|
|
23999
24385
|
|
24000
24386
|
if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
|
24001
24387
|
var mergeObj = spec[COMMAND_MERGE];
|
24002
|
-
|
24003
|
-
|
24004
|
-
|
24388
|
+
invariant(
|
24389
|
+
mergeObj && typeof mergeObj === 'object',
|
24390
|
+
'update(): %s expects a spec of type \'object\'; got %s',
|
24391
|
+
COMMAND_MERGE,
|
24392
|
+
mergeObj
|
24393
|
+
);
|
24394
|
+
invariant(
|
24395
|
+
nextValue && typeof nextValue === 'object',
|
24396
|
+
'update(): %s expects a target of type \'object\'; got %s',
|
24397
|
+
COMMAND_MERGE,
|
24398
|
+
nextValue
|
24399
|
+
);
|
24400
|
+
Object.assign(nextValue, spec[COMMAND_MERGE]);
|
24005
24401
|
}
|
24006
24402
|
|
24007
24403
|
if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
|
24008
24404
|
invariantArrayCase(value, spec, COMMAND_PUSH);
|
24009
|
-
spec[COMMAND_PUSH].forEach(function
|
24405
|
+
spec[COMMAND_PUSH].forEach(function(item) {
|
24010
24406
|
nextValue.push(item);
|
24011
24407
|
});
|
24012
24408
|
}
|
24013
24409
|
|
24014
24410
|
if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
|
24015
24411
|
invariantArrayCase(value, spec, COMMAND_UNSHIFT);
|
24016
|
-
spec[COMMAND_UNSHIFT].forEach(function
|
24412
|
+
spec[COMMAND_UNSHIFT].forEach(function(item) {
|
24017
24413
|
nextValue.unshift(item);
|
24018
24414
|
});
|
24019
24415
|
}
|
24020
24416
|
|
24021
24417
|
if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
|
24022
|
-
|
24023
|
-
|
24024
|
-
|
24025
|
-
|
24418
|
+
invariant(
|
24419
|
+
Array.isArray(value),
|
24420
|
+
'Expected %s target to be an array; got %s',
|
24421
|
+
COMMAND_SPLICE,
|
24422
|
+
value
|
24423
|
+
);
|
24424
|
+
invariant(
|
24425
|
+
Array.isArray(spec[COMMAND_SPLICE]),
|
24426
|
+
'update(): expected spec of %s to be an array of arrays; got %s. ' +
|
24427
|
+
'Did you forget to wrap your parameters in an array?',
|
24428
|
+
COMMAND_SPLICE,
|
24429
|
+
spec[COMMAND_SPLICE]
|
24430
|
+
);
|
24431
|
+
spec[COMMAND_SPLICE].forEach(function(args) {
|
24432
|
+
invariant(
|
24433
|
+
Array.isArray(args),
|
24434
|
+
'update(): expected spec of %s to be an array of arrays; got %s. ' +
|
24435
|
+
'Did you forget to wrap your parameters in an array?',
|
24436
|
+
COMMAND_SPLICE,
|
24437
|
+
spec[COMMAND_SPLICE]
|
24438
|
+
);
|
24026
24439
|
nextValue.splice.apply(nextValue, args);
|
24027
24440
|
});
|
24028
24441
|
}
|
24029
24442
|
|
24030
24443
|
if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
|
24031
|
-
|
24444
|
+
invariant(
|
24445
|
+
typeof spec[COMMAND_APPLY] === 'function',
|
24446
|
+
'update(): expected spec of %s to be a function; got %s.',
|
24447
|
+
COMMAND_APPLY,
|
24448
|
+
spec[COMMAND_APPLY]
|
24449
|
+
);
|
24032
24450
|
nextValue = spec[COMMAND_APPLY](nextValue);
|
24033
24451
|
}
|
24034
24452
|
|
@@ -24042,72 +24460,15 @@
|
|
24042
24460
|
}
|
24043
24461
|
|
24044
24462
|
module.exports = update;
|
24045
|
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
24046
|
-
|
24047
|
-
/***/ },
|
24048
|
-
/* 201 */
|
24049
|
-
/***/ function(module, exports, __webpack_require__) {
|
24050
|
-
|
24051
|
-
module.exports = __webpack_require__(202);
|
24052
|
-
|
24053
|
-
/***/ },
|
24054
|
-
/* 202 */
|
24055
|
-
/***/ function(module, exports, __webpack_require__) {
|
24056
|
-
|
24057
|
-
/**
|
24058
|
-
* Copyright 2013-present, Facebook, Inc.
|
24059
|
-
* All rights reserved.
|
24060
|
-
*
|
24061
|
-
* This source code is licensed under the BSD-style license found in the
|
24062
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
24063
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
24064
|
-
*
|
24065
|
-
*/
|
24066
|
-
|
24067
|
-
'use strict';
|
24068
|
-
|
24069
|
-
var shallowCompare = __webpack_require__(203);
|
24070
24463
|
|
24071
|
-
|
24072
|
-
* If your React component's render function is "pure", e.g. it will render the
|
24073
|
-
* same result given the same props and state, provide this mixin for a
|
24074
|
-
* considerable performance boost.
|
24075
|
-
*
|
24076
|
-
* Most React components have pure render functions.
|
24077
|
-
*
|
24078
|
-
* Example:
|
24079
|
-
*
|
24080
|
-
* var ReactComponentWithPureRenderMixin =
|
24081
|
-
* require('ReactComponentWithPureRenderMixin');
|
24082
|
-
* React.createClass({
|
24083
|
-
* mixins: [ReactComponentWithPureRenderMixin],
|
24084
|
-
*
|
24085
|
-
* render: function() {
|
24086
|
-
* return <div className={this.props.className}>foo</div>;
|
24087
|
-
* }
|
24088
|
-
* });
|
24089
|
-
*
|
24090
|
-
* Note: This only checks shallow equality for props and state. If these contain
|
24091
|
-
* complex data structures this mixin may have false-negatives for deeper
|
24092
|
-
* differences. Only mixin to components which have simple props and state, or
|
24093
|
-
* use `forceUpdate()` when you know deep data structures have changed.
|
24094
|
-
*
|
24095
|
-
* See https://facebook.github.io/react/docs/pure-render-mixin.html
|
24096
|
-
*/
|
24097
|
-
var ReactComponentWithPureRenderMixin = {
|
24098
|
-
shouldComponentUpdate: function (nextProps, nextState) {
|
24099
|
-
return shallowCompare(this, nextProps, nextState);
|
24100
|
-
}
|
24101
|
-
};
|
24102
|
-
|
24103
|
-
module.exports = ReactComponentWithPureRenderMixin;
|
24464
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
24104
24465
|
|
24105
24466
|
/***/ },
|
24106
|
-
/*
|
24467
|
+
/* 196 */
|
24107
24468
|
/***/ function(module, exports, __webpack_require__) {
|
24108
24469
|
|
24109
24470
|
/**
|
24110
|
-
* Copyright
|
24471
|
+
* Copyright 2015-present, Facebook, Inc.
|
24111
24472
|
* All rights reserved.
|
24112
24473
|
*
|
24113
24474
|
* This source code is licensed under the BSD-style license found in the
|
@@ -24120,40 +24481,39 @@
|
|
24120
24481
|
|
24121
24482
|
var shallowEqual = __webpack_require__(123);
|
24122
24483
|
|
24123
|
-
|
24124
|
-
|
24125
|
-
|
24126
|
-
|
24127
|
-
|
24128
|
-
|
24129
|
-
|
24130
|
-
}
|
24484
|
+
module.exports = {
|
24485
|
+
shouldComponentUpdate: function(nextProps, nextState) {
|
24486
|
+
return (
|
24487
|
+
!shallowEqual(this.props, nextProps) ||
|
24488
|
+
!shallowEqual(this.state, nextState)
|
24489
|
+
);
|
24490
|
+
},
|
24491
|
+
};
|
24131
24492
|
|
24132
|
-
module.exports = shallowCompare;
|
24133
24493
|
|
24134
24494
|
/***/ },
|
24135
|
-
/*
|
24495
|
+
/* 197 */
|
24136
24496
|
/***/ function(module, exports, __webpack_require__) {
|
24137
24497
|
|
24138
|
-
module.exports = __webpack_require__(
|
24498
|
+
module.exports = __webpack_require__(188);
|
24139
24499
|
|
24140
24500
|
/***/ },
|
24141
|
-
/*
|
24501
|
+
/* 198 */
|
24142
24502
|
/***/ function(module, exports, __webpack_require__) {
|
24143
24503
|
|
24144
|
-
module.exports = __webpack_require__(
|
24504
|
+
module.exports = __webpack_require__(187);
|
24145
24505
|
|
24146
24506
|
/***/ },
|
24147
|
-
/*
|
24507
|
+
/* 199 */
|
24148
24508
|
/***/ function(module, exports, __webpack_require__) {
|
24149
24509
|
|
24150
24510
|
'use strict';
|
24151
24511
|
|
24152
|
-
module.exports = __webpack_require__(
|
24512
|
+
module.exports = __webpack_require__(200);
|
24153
24513
|
|
24154
24514
|
|
24155
24515
|
/***/ },
|
24156
|
-
/*
|
24516
|
+
/* 200 */
|
24157
24517
|
/***/ function(module, exports, __webpack_require__) {
|
24158
24518
|
|
24159
24519
|
/**
|
@@ -24169,7 +24529,7 @@
|
|
24169
24529
|
'use strict';
|
24170
24530
|
|
24171
24531
|
var ReactDefaultInjection = __webpack_require__(38);
|
24172
|
-
var ReactServerRendering = __webpack_require__(
|
24532
|
+
var ReactServerRendering = __webpack_require__(201);
|
24173
24533
|
var ReactVersion = __webpack_require__(171);
|
24174
24534
|
|
24175
24535
|
ReactDefaultInjection.inject();
|
@@ -24183,7 +24543,7 @@
|
|
24183
24543
|
module.exports = ReactDOMServer;
|
24184
24544
|
|
24185
24545
|
/***/ },
|
24186
|
-
/*
|
24546
|
+
/* 201 */
|
24187
24547
|
/***/ function(module, exports, __webpack_require__) {
|
24188
24548
|
|
24189
24549
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -24205,7 +24565,7 @@
|
|
24205
24565
|
var ReactInstrumentation = __webpack_require__(62);
|
24206
24566
|
var ReactMarkupChecksum = __webpack_require__(169);
|
24207
24567
|
var ReactReconciler = __webpack_require__(59);
|
24208
|
-
var ReactServerBatchingStrategy = __webpack_require__(
|
24568
|
+
var ReactServerBatchingStrategy = __webpack_require__(202);
|
24209
24569
|
var ReactServerRenderingTransaction = __webpack_require__(133);
|
24210
24570
|
var ReactUpdates = __webpack_require__(56);
|
24211
24571
|
|
@@ -24278,7 +24638,7 @@
|
|
24278
24638
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
24279
24639
|
|
24280
24640
|
/***/ },
|
24281
|
-
/*
|
24641
|
+
/* 202 */
|
24282
24642
|
/***/ function(module, exports) {
|
24283
24643
|
|
24284
24644
|
/**
|