react 16.2.0 → 16.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react.development.js +129 -77
- package/cjs/react.production.min.js +14 -13
- package/package.json +1 -1
- package/umd/react.development.js +129 -77
- package/umd/react.production.min.js +14 -14
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.3.0-alpha.3
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -24,7 +24,7 @@ var checkPropTypes = require('prop-types/checkPropTypes');
|
|
|
24
24
|
|
|
25
25
|
// TODO: this is special because it gets imported during build.
|
|
26
26
|
|
|
27
|
-
var ReactVersion = '16.
|
|
27
|
+
var ReactVersion = '16.3.0-alpha.3';
|
|
28
28
|
|
|
29
29
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
30
30
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -35,6 +35,11 @@ var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
|
|
|
35
35
|
var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
|
|
36
36
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
|
|
37
37
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
|
38
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc;
|
|
39
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd;
|
|
40
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace;
|
|
41
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf;
|
|
42
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0;
|
|
38
43
|
|
|
39
44
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
40
45
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
@@ -114,8 +119,8 @@ var didWarnStateUpdateForUnmountedComponent = {};
|
|
|
114
119
|
|
|
115
120
|
function warnNoop(publicInstance, callerName) {
|
|
116
121
|
{
|
|
117
|
-
var
|
|
118
|
-
var componentName =
|
|
122
|
+
var _constructor = publicInstance.constructor;
|
|
123
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
119
124
|
var warningKey = componentName + '.' + callerName;
|
|
120
125
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
121
126
|
return;
|
|
@@ -280,46 +285,36 @@ Component.prototype.forceUpdate = function (callback) {
|
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
287
|
|
|
288
|
+
function ComponentDummy() {}
|
|
289
|
+
ComponentDummy.prototype = Component.prototype;
|
|
290
|
+
|
|
283
291
|
/**
|
|
284
|
-
*
|
|
292
|
+
* Convenience component with default shallow equality check for sCU.
|
|
285
293
|
*/
|
|
286
294
|
function PureComponent(props, context, updater) {
|
|
287
|
-
// Duplicated from Component.
|
|
288
295
|
this.props = props;
|
|
289
296
|
this.context = context;
|
|
290
297
|
this.refs = emptyObject;
|
|
291
|
-
// We initialize the default updater but the real one gets injected by the
|
|
292
|
-
// renderer.
|
|
293
298
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
function ComponentDummy() {}
|
|
297
|
-
ComponentDummy.prototype = Component.prototype;
|
|
298
301
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
299
302
|
pureComponentPrototype.constructor = PureComponent;
|
|
300
303
|
// Avoid an extra prototype jump for these methods.
|
|
301
304
|
_assign(pureComponentPrototype, Component.prototype);
|
|
302
305
|
pureComponentPrototype.isPureReactComponent = true;
|
|
303
306
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
// an immutable object with a single mutable value
|
|
308
|
+
function createRef() {
|
|
309
|
+
var refObject = {
|
|
310
|
+
current: null
|
|
311
|
+
};
|
|
312
|
+
{
|
|
313
|
+
Object.seal(refObject);
|
|
314
|
+
}
|
|
315
|
+
return refObject;
|
|
312
316
|
}
|
|
313
317
|
|
|
314
|
-
var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
|
|
315
|
-
asyncComponentPrototype.constructor = AsyncComponent;
|
|
316
|
-
// Avoid an extra prototype jump for these methods.
|
|
317
|
-
_assign(asyncComponentPrototype, Component.prototype);
|
|
318
|
-
asyncComponentPrototype.unstable_isAsyncReactComponent = true;
|
|
319
|
-
asyncComponentPrototype.render = function () {
|
|
320
|
-
return this.props.children;
|
|
321
|
-
};
|
|
322
|
-
|
|
323
318
|
/**
|
|
324
319
|
* Keeps track of the current owner.
|
|
325
320
|
*
|
|
@@ -343,8 +338,8 @@ var RESERVED_PROPS = {
|
|
|
343
338
|
__source: true
|
|
344
339
|
};
|
|
345
340
|
|
|
346
|
-
var specialPropKeyWarningShown;
|
|
347
|
-
var specialPropRefWarningShown;
|
|
341
|
+
var specialPropKeyWarningShown = void 0;
|
|
342
|
+
var specialPropRefWarningShown = void 0;
|
|
348
343
|
|
|
349
344
|
function hasValidRef(config) {
|
|
350
345
|
{
|
|
@@ -420,7 +415,7 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
420
415
|
*/
|
|
421
416
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
422
417
|
var element = {
|
|
423
|
-
// This tag
|
|
418
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
424
419
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
425
420
|
|
|
426
421
|
// Built-in properties that belong on the element
|
|
@@ -479,7 +474,7 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
479
474
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
480
475
|
*/
|
|
481
476
|
function createElement(type, config, children) {
|
|
482
|
-
var propName;
|
|
477
|
+
var propName = void 0;
|
|
483
478
|
|
|
484
479
|
// Reserved names are extracted
|
|
485
480
|
var props = {};
|
|
@@ -567,7 +562,7 @@ function cloneAndReplaceKey(oldElement, newKey) {
|
|
|
567
562
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
568
563
|
*/
|
|
569
564
|
function cloneElement(element, config, children) {
|
|
570
|
-
var propName;
|
|
565
|
+
var propName = void 0;
|
|
571
566
|
|
|
572
567
|
// Original props are copied
|
|
573
568
|
var props = _assign({}, element.props);
|
|
@@ -596,7 +591,7 @@ function cloneElement(element, config, children) {
|
|
|
596
591
|
}
|
|
597
592
|
|
|
598
593
|
// Remaining properties override existing props
|
|
599
|
-
var defaultProps;
|
|
594
|
+
var defaultProps = void 0;
|
|
600
595
|
if (element.type && element.type.defaultProps) {
|
|
601
596
|
defaultProps = element.type.defaultProps;
|
|
602
597
|
}
|
|
@@ -750,8 +745,6 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
750
745
|
case 'object':
|
|
751
746
|
switch (children.$$typeof) {
|
|
752
747
|
case REACT_ELEMENT_TYPE:
|
|
753
|
-
case REACT_CALL_TYPE:
|
|
754
|
-
case REACT_RETURN_TYPE:
|
|
755
748
|
case REACT_PORTAL_TYPE:
|
|
756
749
|
invokeCallback = true;
|
|
757
750
|
}
|
|
@@ -766,8 +759,8 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
766
759
|
return 1;
|
|
767
760
|
}
|
|
768
761
|
|
|
769
|
-
var child;
|
|
770
|
-
var nextName;
|
|
762
|
+
var child = void 0;
|
|
763
|
+
var nextName = void 0;
|
|
771
764
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
772
765
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
773
766
|
|
|
@@ -789,7 +782,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
789
782
|
}
|
|
790
783
|
|
|
791
784
|
var iterator = iteratorFn.call(children);
|
|
792
|
-
var step;
|
|
785
|
+
var step = void 0;
|
|
793
786
|
var ii = 0;
|
|
794
787
|
while (!(step = iterator.next()).done) {
|
|
795
788
|
child = step.value;
|
|
@@ -976,6 +969,50 @@ function onlyChild(children) {
|
|
|
976
969
|
return children;
|
|
977
970
|
}
|
|
978
971
|
|
|
972
|
+
function createContext(defaultValue, calculateChangedBits) {
|
|
973
|
+
if (calculateChangedBits === undefined) {
|
|
974
|
+
calculateChangedBits = null;
|
|
975
|
+
} else {
|
|
976
|
+
{
|
|
977
|
+
warning(calculateChangedBits === null || typeof calculateChangedBits === 'function', 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
var context = {
|
|
982
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
983
|
+
_calculateChangedBits: calculateChangedBits,
|
|
984
|
+
_defaultValue: defaultValue,
|
|
985
|
+
_currentValue: defaultValue,
|
|
986
|
+
_changedBits: 0,
|
|
987
|
+
// These are circular
|
|
988
|
+
Provider: null,
|
|
989
|
+
Consumer: null
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
context.Provider = {
|
|
993
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
|
994
|
+
context: context
|
|
995
|
+
};
|
|
996
|
+
context.Consumer = context;
|
|
997
|
+
|
|
998
|
+
{
|
|
999
|
+
context._currentRenderer = null;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return context;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
function forwardRef(render) {
|
|
1006
|
+
{
|
|
1007
|
+
warning(typeof render === 'function', 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
return {
|
|
1011
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1012
|
+
render: render
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
|
|
979
1016
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
980
1017
|
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
981
1018
|
};
|
|
@@ -983,11 +1020,21 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
983
1020
|
function getComponentName(fiber) {
|
|
984
1021
|
var type = fiber.type;
|
|
985
1022
|
|
|
1023
|
+
if (typeof type === 'function') {
|
|
1024
|
+
return type.displayName || type.name;
|
|
1025
|
+
}
|
|
986
1026
|
if (typeof type === 'string') {
|
|
987
1027
|
return type;
|
|
988
1028
|
}
|
|
989
|
-
|
|
990
|
-
|
|
1029
|
+
switch (type) {
|
|
1030
|
+
case REACT_FRAGMENT_TYPE:
|
|
1031
|
+
return 'ReactFragment';
|
|
1032
|
+
case REACT_PORTAL_TYPE:
|
|
1033
|
+
return 'ReactPortal';
|
|
1034
|
+
case REACT_CALL_TYPE:
|
|
1035
|
+
return 'ReactCall';
|
|
1036
|
+
case REACT_RETURN_TYPE:
|
|
1037
|
+
return 'ReactReturn';
|
|
991
1038
|
}
|
|
992
1039
|
return null;
|
|
993
1040
|
}
|
|
@@ -999,12 +1046,20 @@ function getComponentName(fiber) {
|
|
|
999
1046
|
* that support it.
|
|
1000
1047
|
*/
|
|
1001
1048
|
|
|
1049
|
+
var currentlyValidatingElement = void 0;
|
|
1050
|
+
var propTypesMisspellWarningShown = void 0;
|
|
1051
|
+
|
|
1052
|
+
var getDisplayName = function () {};
|
|
1053
|
+
var getStackAddendum = function () {};
|
|
1054
|
+
|
|
1055
|
+
var VALID_FRAGMENT_PROPS = void 0;
|
|
1056
|
+
|
|
1002
1057
|
{
|
|
1003
|
-
|
|
1058
|
+
currentlyValidatingElement = null;
|
|
1004
1059
|
|
|
1005
|
-
|
|
1060
|
+
propTypesMisspellWarningShown = false;
|
|
1006
1061
|
|
|
1007
|
-
|
|
1062
|
+
getDisplayName = function (element) {
|
|
1008
1063
|
if (element == null) {
|
|
1009
1064
|
return '#empty';
|
|
1010
1065
|
} else if (typeof element === 'string' || typeof element === 'number') {
|
|
@@ -1018,7 +1073,7 @@ function getComponentName(fiber) {
|
|
|
1018
1073
|
}
|
|
1019
1074
|
};
|
|
1020
1075
|
|
|
1021
|
-
|
|
1076
|
+
getStackAddendum = function () {
|
|
1022
1077
|
var stack = '';
|
|
1023
1078
|
if (currentlyValidatingElement) {
|
|
1024
1079
|
var name = getDisplayName(currentlyValidatingElement);
|
|
@@ -1029,7 +1084,7 @@ function getComponentName(fiber) {
|
|
|
1029
1084
|
return stack;
|
|
1030
1085
|
};
|
|
1031
1086
|
|
|
1032
|
-
|
|
1087
|
+
VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
|
|
1033
1088
|
}
|
|
1034
1089
|
|
|
1035
1090
|
function getDeclarationErrorAddendum() {
|
|
@@ -1142,7 +1197,7 @@ function validateChildKeys(node, parentType) {
|
|
|
1142
1197
|
// but now we print a separate warning for them later.
|
|
1143
1198
|
if (iteratorFn !== node.entries) {
|
|
1144
1199
|
var iterator = iteratorFn.call(node);
|
|
1145
|
-
var step;
|
|
1200
|
+
var step = void 0;
|
|
1146
1201
|
while (!(step = iterator.next()).done) {
|
|
1147
1202
|
if (isValidElement(step.value)) {
|
|
1148
1203
|
validateExplicitKey(step.value, parentType);
|
|
@@ -1186,31 +1241,12 @@ function validatePropTypes(element) {
|
|
|
1186
1241
|
function validateFragmentProps(fragment) {
|
|
1187
1242
|
currentlyValidatingElement = fragment;
|
|
1188
1243
|
|
|
1189
|
-
var
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
var key = _step.value;
|
|
1196
|
-
|
|
1197
|
-
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
|
1198
|
-
warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
|
1199
|
-
break;
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
} catch (err) {
|
|
1203
|
-
_didIteratorError = true;
|
|
1204
|
-
_iteratorError = err;
|
|
1205
|
-
} finally {
|
|
1206
|
-
try {
|
|
1207
|
-
if (!_iteratorNormalCompletion && _iterator['return']) {
|
|
1208
|
-
_iterator['return']();
|
|
1209
|
-
}
|
|
1210
|
-
} finally {
|
|
1211
|
-
if (_didIteratorError) {
|
|
1212
|
-
throw _iteratorError;
|
|
1213
|
-
}
|
|
1244
|
+
var keys = Object.keys(fragment.props);
|
|
1245
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1246
|
+
var key = keys[i];
|
|
1247
|
+
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
|
1248
|
+
warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
|
1249
|
+
break;
|
|
1214
1250
|
}
|
|
1215
1251
|
}
|
|
1216
1252
|
|
|
@@ -1222,7 +1258,10 @@ function validateFragmentProps(fragment) {
|
|
|
1222
1258
|
}
|
|
1223
1259
|
|
|
1224
1260
|
function createElementWithValidation(type, props, children) {
|
|
1225
|
-
var validType = typeof type === 'string' || typeof type === 'function' ||
|
|
1261
|
+
var validType = typeof type === 'string' || typeof type === 'function' ||
|
|
1262
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1263
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
1264
|
+
|
|
1226
1265
|
// We warn in this case but don't throw. We expect the element creation to
|
|
1227
1266
|
// succeed and there will likely be errors in render.
|
|
1228
1267
|
if (!validType) {
|
|
@@ -1240,7 +1279,16 @@ function createElementWithValidation(type, props, children) {
|
|
|
1240
1279
|
|
|
1241
1280
|
info += getStackAddendum() || '';
|
|
1242
1281
|
|
|
1243
|
-
|
|
1282
|
+
var typeString = void 0;
|
|
1283
|
+
if (type === null) {
|
|
1284
|
+
typeString = 'null';
|
|
1285
|
+
} else if (Array.isArray(type)) {
|
|
1286
|
+
typeString = 'array';
|
|
1287
|
+
} else {
|
|
1288
|
+
typeString = typeof type;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
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', typeString, info);
|
|
1244
1292
|
}
|
|
1245
1293
|
|
|
1246
1294
|
var element = createElement.apply(this, arguments);
|
|
@@ -1262,7 +1310,7 @@ function createElementWithValidation(type, props, children) {
|
|
|
1262
1310
|
}
|
|
1263
1311
|
}
|
|
1264
1312
|
|
|
1265
|
-
if (
|
|
1313
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1266
1314
|
validateFragmentProps(element);
|
|
1267
1315
|
} else {
|
|
1268
1316
|
validatePropTypes(element);
|
|
@@ -1273,9 +1321,8 @@ function createElementWithValidation(type, props, children) {
|
|
|
1273
1321
|
|
|
1274
1322
|
function createFactoryWithValidation(type) {
|
|
1275
1323
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1276
|
-
// Legacy hook TODO: Warn if this is accessed
|
|
1277
1324
|
validatedFactory.type = type;
|
|
1278
|
-
|
|
1325
|
+
// Legacy hook: remove it
|
|
1279
1326
|
{
|
|
1280
1327
|
Object.defineProperty(validatedFactory, 'type', {
|
|
1281
1328
|
enumerable: false,
|
|
@@ -1310,11 +1357,16 @@ var React = {
|
|
|
1310
1357
|
only: onlyChild
|
|
1311
1358
|
},
|
|
1312
1359
|
|
|
1360
|
+
createRef: createRef,
|
|
1313
1361
|
Component: Component,
|
|
1314
1362
|
PureComponent: PureComponent,
|
|
1315
|
-
|
|
1363
|
+
|
|
1364
|
+
createContext: createContext,
|
|
1365
|
+
forwardRef: forwardRef,
|
|
1316
1366
|
|
|
1317
1367
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
1368
|
+
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
1369
|
+
unstable_AsyncMode: REACT_ASYNC_MODE_TYPE,
|
|
1318
1370
|
|
|
1319
1371
|
createElement: createElementWithValidation,
|
|
1320
1372
|
cloneElement: cloneElementWithValidation,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.3.0-alpha.3
|
|
2
2
|
* react.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var m=require("object-assign"),n=require("fbjs/lib/emptyObject"),p=require("fbjs/lib/emptyFunction"),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
d=a.
|
|
21
|
-
|
|
10
|
+
'use strict';var m=require("object-assign"),n=require("fbjs/lib/emptyObject"),p=require("fbjs/lib/emptyFunction"),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.portal"):60106,u=q?Symbol["for"]("react.fragment"):60107,v=q?Symbol["for"]("react.strict_mode"):60108,w=q?Symbol["for"]("react.provider"):60109,x=q?Symbol["for"]("react.context"):60110,y=q?Symbol["for"]("react.async_mode"):60111,z=q?Symbol["for"]("react.forward_ref"):60112,A="function"===
|
|
11
|
+
typeof Symbol&&Symbol.iterator;function B(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}
|
|
12
|
+
var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function D(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||C}D.prototype.isReactComponent={};D.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?B("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};D.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function E(){}
|
|
13
|
+
E.prototype=D.prototype;function F(a,b,e){this.props=a;this.context=b;this.refs=n;this.updater=e||C}var G=F.prototype=new E;G.constructor=F;m(G,D.prototype);G.isPureReactComponent=!0;var H={current:null},I=Object.prototype.hasOwnProperty,J={key:!0,ref:!0,__self:!0,__source:!0};
|
|
14
|
+
function K(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)I.call(b,c)&&!J.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var k=Array(f),l=0;l<f;l++)k[l]=arguments[l+2];d.children=k}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:r,type:a,key:g,ref:h,props:d,_owner:H.current}}
|
|
15
|
+
function L(a){return"object"===typeof a&&null!==a&&a.$$typeof===r}function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g,N=[];function O(a,b,e,c){if(N.length){var d=N.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}function P(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>N.length&&N.push(a)}
|
|
16
|
+
function Q(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:g=!0}}if(g)return e(c,a,""===b?"."+R(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+R(d,h);g+=Q(d,f,e,c)}else if(null===a||"undefined"===typeof a?f=null:(f=A&&a[A]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),
|
|
17
|
+
h=0;!(d=a.next()).done;)d=d.value,f=b+R(d,h++),g+=Q(d,f,e,c);else"object"===d&&(e=""+a,B("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function R(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function S(a,b){a.func.call(a.context,b,a.count++)}
|
|
18
|
+
function T(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?U(a,c,e,p.thatReturnsArgument):null!=a&&(L(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(M,"$\x26/")+"/")+e,a={$$typeof:r,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function U(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(M,"$\x26/")+"/");b=O(b,g,c,d);null==a||Q(a,"",T,b);P(b)}
|
|
19
|
+
var V={Children:{map:function(a,b,e){if(null==a)return a;var c=[];U(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=O(null,null,b,e);null==a||Q(a,"",S,b);P(b)},count:function(a){return null==a?0:Q(a,"",p.thatReturnsNull,null)},toArray:function(a){var b=[];U(a,b,null,p.thatReturnsArgument);return b},only:function(a){L(a)?void 0:B("143");return a}},createRef:function(){return{current:null}},Component:D,PureComponent:F,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:x,
|
|
20
|
+
_calculateChangedBits:b,_defaultValue:a,_currentValue:a,_changedBits:0,Provider:null,Consumer:null};a.Provider={$$typeof:w,context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:z,render:a}},Fragment:u,StrictMode:v,unstable_AsyncMode:y,createElement:K,cloneElement:function(a,b,e){var c=void 0,d=m({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,f=H.current);void 0!==b.key&&(g=""+b.key);var k=void 0;a.type&&a.type.defaultProps&&(k=a.type.defaultProps);for(c in b)I.call(b,
|
|
21
|
+
c)&&!J.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==k?k[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){k=Array(c);for(var l=0;l<c;l++)k[l]=arguments[l+2];d.children=k}return{$$typeof:r,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=K.bind(null,a);b.type=a;return b},isValidElement:L,version:"16.3.0-alpha.3",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:H,assign:m}},W=Object.freeze({default:V}),X=W&&V||W;
|
|
22
|
+
module.exports=X["default"]?X["default"]:X;
|
package/package.json
CHANGED
package/umd/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.3.0-alpha.3
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -108,7 +108,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
108
108
|
|
|
109
109
|
// TODO: this is special because it gets imported during build.
|
|
110
110
|
|
|
111
|
-
var ReactVersion = '16.
|
|
111
|
+
var ReactVersion = '16.3.0-alpha.3';
|
|
112
112
|
|
|
113
113
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
114
114
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -119,6 +119,11 @@ var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
|
|
|
119
119
|
var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
|
|
120
120
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
|
|
121
121
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
|
122
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc;
|
|
123
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd;
|
|
124
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace;
|
|
125
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf;
|
|
126
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0;
|
|
122
127
|
|
|
123
128
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
124
129
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
@@ -368,8 +373,8 @@ var didWarnStateUpdateForUnmountedComponent = {};
|
|
|
368
373
|
|
|
369
374
|
function warnNoop(publicInstance, callerName) {
|
|
370
375
|
{
|
|
371
|
-
var
|
|
372
|
-
var componentName =
|
|
376
|
+
var _constructor = publicInstance.constructor;
|
|
377
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
373
378
|
var warningKey = componentName + '.' + callerName;
|
|
374
379
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
375
380
|
return;
|
|
@@ -534,46 +539,36 @@ Component.prototype.forceUpdate = function (callback) {
|
|
|
534
539
|
}
|
|
535
540
|
}
|
|
536
541
|
|
|
542
|
+
function ComponentDummy() {}
|
|
543
|
+
ComponentDummy.prototype = Component.prototype;
|
|
544
|
+
|
|
537
545
|
/**
|
|
538
|
-
*
|
|
546
|
+
* Convenience component with default shallow equality check for sCU.
|
|
539
547
|
*/
|
|
540
548
|
function PureComponent(props, context, updater) {
|
|
541
|
-
// Duplicated from Component.
|
|
542
549
|
this.props = props;
|
|
543
550
|
this.context = context;
|
|
544
551
|
this.refs = emptyObject_1;
|
|
545
|
-
// We initialize the default updater but the real one gets injected by the
|
|
546
|
-
// renderer.
|
|
547
552
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
548
553
|
}
|
|
549
554
|
|
|
550
|
-
function ComponentDummy() {}
|
|
551
|
-
ComponentDummy.prototype = Component.prototype;
|
|
552
555
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
553
556
|
pureComponentPrototype.constructor = PureComponent;
|
|
554
557
|
// Avoid an extra prototype jump for these methods.
|
|
555
558
|
objectAssign(pureComponentPrototype, Component.prototype);
|
|
556
559
|
pureComponentPrototype.isPureReactComponent = true;
|
|
557
560
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
// an immutable object with a single mutable value
|
|
562
|
+
function createRef() {
|
|
563
|
+
var refObject = {
|
|
564
|
+
current: null
|
|
565
|
+
};
|
|
566
|
+
{
|
|
567
|
+
Object.seal(refObject);
|
|
568
|
+
}
|
|
569
|
+
return refObject;
|
|
566
570
|
}
|
|
567
571
|
|
|
568
|
-
var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
|
|
569
|
-
asyncComponentPrototype.constructor = AsyncComponent;
|
|
570
|
-
// Avoid an extra prototype jump for these methods.
|
|
571
|
-
objectAssign(asyncComponentPrototype, Component.prototype);
|
|
572
|
-
asyncComponentPrototype.unstable_isAsyncReactComponent = true;
|
|
573
|
-
asyncComponentPrototype.render = function () {
|
|
574
|
-
return this.props.children;
|
|
575
|
-
};
|
|
576
|
-
|
|
577
572
|
/**
|
|
578
573
|
* Keeps track of the current owner.
|
|
579
574
|
*
|
|
@@ -597,8 +592,8 @@ var RESERVED_PROPS = {
|
|
|
597
592
|
__source: true
|
|
598
593
|
};
|
|
599
594
|
|
|
600
|
-
var specialPropKeyWarningShown;
|
|
601
|
-
var specialPropRefWarningShown;
|
|
595
|
+
var specialPropKeyWarningShown = void 0;
|
|
596
|
+
var specialPropRefWarningShown = void 0;
|
|
602
597
|
|
|
603
598
|
function hasValidRef(config) {
|
|
604
599
|
{
|
|
@@ -674,7 +669,7 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
674
669
|
*/
|
|
675
670
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
676
671
|
var element = {
|
|
677
|
-
// This tag
|
|
672
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
678
673
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
679
674
|
|
|
680
675
|
// Built-in properties that belong on the element
|
|
@@ -733,7 +728,7 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
733
728
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
734
729
|
*/
|
|
735
730
|
function createElement(type, config, children) {
|
|
736
|
-
var propName;
|
|
731
|
+
var propName = void 0;
|
|
737
732
|
|
|
738
733
|
// Reserved names are extracted
|
|
739
734
|
var props = {};
|
|
@@ -821,7 +816,7 @@ function cloneAndReplaceKey(oldElement, newKey) {
|
|
|
821
816
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
822
817
|
*/
|
|
823
818
|
function cloneElement(element, config, children) {
|
|
824
|
-
var propName;
|
|
819
|
+
var propName = void 0;
|
|
825
820
|
|
|
826
821
|
// Original props are copied
|
|
827
822
|
var props = objectAssign({}, element.props);
|
|
@@ -850,7 +845,7 @@ function cloneElement(element, config, children) {
|
|
|
850
845
|
}
|
|
851
846
|
|
|
852
847
|
// Remaining properties override existing props
|
|
853
|
-
var defaultProps;
|
|
848
|
+
var defaultProps = void 0;
|
|
854
849
|
if (element.type && element.type.defaultProps) {
|
|
855
850
|
defaultProps = element.type.defaultProps;
|
|
856
851
|
}
|
|
@@ -1004,8 +999,6 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1004
999
|
case 'object':
|
|
1005
1000
|
switch (children.$$typeof) {
|
|
1006
1001
|
case REACT_ELEMENT_TYPE:
|
|
1007
|
-
case REACT_CALL_TYPE:
|
|
1008
|
-
case REACT_RETURN_TYPE:
|
|
1009
1002
|
case REACT_PORTAL_TYPE:
|
|
1010
1003
|
invokeCallback = true;
|
|
1011
1004
|
}
|
|
@@ -1020,8 +1013,8 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1020
1013
|
return 1;
|
|
1021
1014
|
}
|
|
1022
1015
|
|
|
1023
|
-
var child;
|
|
1024
|
-
var nextName;
|
|
1016
|
+
var child = void 0;
|
|
1017
|
+
var nextName = void 0;
|
|
1025
1018
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1026
1019
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1027
1020
|
|
|
@@ -1043,7 +1036,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1043
1036
|
}
|
|
1044
1037
|
|
|
1045
1038
|
var iterator = iteratorFn.call(children);
|
|
1046
|
-
var step;
|
|
1039
|
+
var step = void 0;
|
|
1047
1040
|
var ii = 0;
|
|
1048
1041
|
while (!(step = iterator.next()).done) {
|
|
1049
1042
|
child = step.value;
|
|
@@ -1230,6 +1223,50 @@ function onlyChild(children) {
|
|
|
1230
1223
|
return children;
|
|
1231
1224
|
}
|
|
1232
1225
|
|
|
1226
|
+
function createContext(defaultValue, calculateChangedBits) {
|
|
1227
|
+
if (calculateChangedBits === undefined) {
|
|
1228
|
+
calculateChangedBits = null;
|
|
1229
|
+
} else {
|
|
1230
|
+
{
|
|
1231
|
+
warning_1(calculateChangedBits === null || typeof calculateChangedBits === 'function', 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
var context = {
|
|
1236
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1237
|
+
_calculateChangedBits: calculateChangedBits,
|
|
1238
|
+
_defaultValue: defaultValue,
|
|
1239
|
+
_currentValue: defaultValue,
|
|
1240
|
+
_changedBits: 0,
|
|
1241
|
+
// These are circular
|
|
1242
|
+
Provider: null,
|
|
1243
|
+
Consumer: null
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
context.Provider = {
|
|
1247
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
|
1248
|
+
context: context
|
|
1249
|
+
};
|
|
1250
|
+
context.Consumer = context;
|
|
1251
|
+
|
|
1252
|
+
{
|
|
1253
|
+
context._currentRenderer = null;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
return context;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function forwardRef(render) {
|
|
1260
|
+
{
|
|
1261
|
+
warning_1(typeof render === 'function', 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
return {
|
|
1265
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1266
|
+
render: render
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1233
1270
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
1234
1271
|
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
1235
1272
|
};
|
|
@@ -1237,11 +1274,21 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
1237
1274
|
function getComponentName(fiber) {
|
|
1238
1275
|
var type = fiber.type;
|
|
1239
1276
|
|
|
1277
|
+
if (typeof type === 'function') {
|
|
1278
|
+
return type.displayName || type.name;
|
|
1279
|
+
}
|
|
1240
1280
|
if (typeof type === 'string') {
|
|
1241
1281
|
return type;
|
|
1242
1282
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1283
|
+
switch (type) {
|
|
1284
|
+
case REACT_FRAGMENT_TYPE:
|
|
1285
|
+
return 'ReactFragment';
|
|
1286
|
+
case REACT_PORTAL_TYPE:
|
|
1287
|
+
return 'ReactPortal';
|
|
1288
|
+
case REACT_CALL_TYPE:
|
|
1289
|
+
return 'ReactCall';
|
|
1290
|
+
case REACT_RETURN_TYPE:
|
|
1291
|
+
return 'ReactReturn';
|
|
1245
1292
|
}
|
|
1246
1293
|
return null;
|
|
1247
1294
|
}
|
|
@@ -1326,12 +1373,20 @@ var checkPropTypes_1 = checkPropTypes;
|
|
|
1326
1373
|
* that support it.
|
|
1327
1374
|
*/
|
|
1328
1375
|
|
|
1376
|
+
var currentlyValidatingElement = void 0;
|
|
1377
|
+
var propTypesMisspellWarningShown = void 0;
|
|
1378
|
+
|
|
1379
|
+
var getDisplayName = function () {};
|
|
1380
|
+
var getStackAddendum = function () {};
|
|
1381
|
+
|
|
1382
|
+
var VALID_FRAGMENT_PROPS = void 0;
|
|
1383
|
+
|
|
1329
1384
|
{
|
|
1330
|
-
|
|
1385
|
+
currentlyValidatingElement = null;
|
|
1331
1386
|
|
|
1332
|
-
|
|
1387
|
+
propTypesMisspellWarningShown = false;
|
|
1333
1388
|
|
|
1334
|
-
|
|
1389
|
+
getDisplayName = function (element) {
|
|
1335
1390
|
if (element == null) {
|
|
1336
1391
|
return '#empty';
|
|
1337
1392
|
} else if (typeof element === 'string' || typeof element === 'number') {
|
|
@@ -1345,7 +1400,7 @@ var checkPropTypes_1 = checkPropTypes;
|
|
|
1345
1400
|
}
|
|
1346
1401
|
};
|
|
1347
1402
|
|
|
1348
|
-
|
|
1403
|
+
getStackAddendum = function () {
|
|
1349
1404
|
var stack = '';
|
|
1350
1405
|
if (currentlyValidatingElement) {
|
|
1351
1406
|
var name = getDisplayName(currentlyValidatingElement);
|
|
@@ -1356,7 +1411,7 @@ var checkPropTypes_1 = checkPropTypes;
|
|
|
1356
1411
|
return stack;
|
|
1357
1412
|
};
|
|
1358
1413
|
|
|
1359
|
-
|
|
1414
|
+
VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
|
|
1360
1415
|
}
|
|
1361
1416
|
|
|
1362
1417
|
function getDeclarationErrorAddendum() {
|
|
@@ -1469,7 +1524,7 @@ function validateChildKeys(node, parentType) {
|
|
|
1469
1524
|
// but now we print a separate warning for them later.
|
|
1470
1525
|
if (iteratorFn !== node.entries) {
|
|
1471
1526
|
var iterator = iteratorFn.call(node);
|
|
1472
|
-
var step;
|
|
1527
|
+
var step = void 0;
|
|
1473
1528
|
while (!(step = iterator.next()).done) {
|
|
1474
1529
|
if (isValidElement(step.value)) {
|
|
1475
1530
|
validateExplicitKey(step.value, parentType);
|
|
@@ -1513,31 +1568,12 @@ function validatePropTypes(element) {
|
|
|
1513
1568
|
function validateFragmentProps(fragment) {
|
|
1514
1569
|
currentlyValidatingElement = fragment;
|
|
1515
1570
|
|
|
1516
|
-
var
|
|
1517
|
-
var
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
var key = _step.value;
|
|
1523
|
-
|
|
1524
|
-
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
|
1525
|
-
warning_1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
|
1526
|
-
break;
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
} catch (err) {
|
|
1530
|
-
_didIteratorError = true;
|
|
1531
|
-
_iteratorError = err;
|
|
1532
|
-
} finally {
|
|
1533
|
-
try {
|
|
1534
|
-
if (!_iteratorNormalCompletion && _iterator['return']) {
|
|
1535
|
-
_iterator['return']();
|
|
1536
|
-
}
|
|
1537
|
-
} finally {
|
|
1538
|
-
if (_didIteratorError) {
|
|
1539
|
-
throw _iteratorError;
|
|
1540
|
-
}
|
|
1571
|
+
var keys = Object.keys(fragment.props);
|
|
1572
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1573
|
+
var key = keys[i];
|
|
1574
|
+
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
|
1575
|
+
warning_1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
|
1576
|
+
break;
|
|
1541
1577
|
}
|
|
1542
1578
|
}
|
|
1543
1579
|
|
|
@@ -1549,7 +1585,10 @@ function validateFragmentProps(fragment) {
|
|
|
1549
1585
|
}
|
|
1550
1586
|
|
|
1551
1587
|
function createElementWithValidation(type, props, children) {
|
|
1552
|
-
var validType = typeof type === 'string' || typeof type === 'function' ||
|
|
1588
|
+
var validType = typeof type === 'string' || typeof type === 'function' ||
|
|
1589
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1590
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
1591
|
+
|
|
1553
1592
|
// We warn in this case but don't throw. We expect the element creation to
|
|
1554
1593
|
// succeed and there will likely be errors in render.
|
|
1555
1594
|
if (!validType) {
|
|
@@ -1567,7 +1606,16 @@ function createElementWithValidation(type, props, children) {
|
|
|
1567
1606
|
|
|
1568
1607
|
info += getStackAddendum() || '';
|
|
1569
1608
|
|
|
1570
|
-
|
|
1609
|
+
var typeString = void 0;
|
|
1610
|
+
if (type === null) {
|
|
1611
|
+
typeString = 'null';
|
|
1612
|
+
} else if (Array.isArray(type)) {
|
|
1613
|
+
typeString = 'array';
|
|
1614
|
+
} else {
|
|
1615
|
+
typeString = typeof type;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
warning_1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1571
1619
|
}
|
|
1572
1620
|
|
|
1573
1621
|
var element = createElement.apply(this, arguments);
|
|
@@ -1589,7 +1637,7 @@ function createElementWithValidation(type, props, children) {
|
|
|
1589
1637
|
}
|
|
1590
1638
|
}
|
|
1591
1639
|
|
|
1592
|
-
if (
|
|
1640
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1593
1641
|
validateFragmentProps(element);
|
|
1594
1642
|
} else {
|
|
1595
1643
|
validatePropTypes(element);
|
|
@@ -1600,9 +1648,8 @@ function createElementWithValidation(type, props, children) {
|
|
|
1600
1648
|
|
|
1601
1649
|
function createFactoryWithValidation(type) {
|
|
1602
1650
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1603
|
-
// Legacy hook TODO: Warn if this is accessed
|
|
1604
1651
|
validatedFactory.type = type;
|
|
1605
|
-
|
|
1652
|
+
// Legacy hook: remove it
|
|
1606
1653
|
{
|
|
1607
1654
|
Object.defineProperty(validatedFactory, 'type', {
|
|
1608
1655
|
enumerable: false,
|
|
@@ -1637,11 +1684,16 @@ var React = {
|
|
|
1637
1684
|
only: onlyChild
|
|
1638
1685
|
},
|
|
1639
1686
|
|
|
1687
|
+
createRef: createRef,
|
|
1640
1688
|
Component: Component,
|
|
1641
1689
|
PureComponent: PureComponent,
|
|
1642
|
-
|
|
1690
|
+
|
|
1691
|
+
createContext: createContext,
|
|
1692
|
+
forwardRef: forwardRef,
|
|
1643
1693
|
|
|
1644
1694
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
1695
|
+
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
1696
|
+
unstable_AsyncMode: REACT_ASYNC_MODE_TYPE,
|
|
1645
1697
|
|
|
1646
1698
|
createElement: createElementWithValidation,
|
|
1647
1699
|
cloneElement: cloneElementWithValidation,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.3.0-alpha.3
|
|
2
2
|
* react.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';(function(q,
|
|
10
|
-
b.name="Invariant Violation";b.framesToPop=1;throw b;}function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?q("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};p.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};
|
|
19
|
-
|
|
20
|
-
cloneElement:function(a,b,
|
|
21
|
-
G.bind(null,a);b.type=a;return b},isValidElement:
|
|
9
|
+
'use strict';(function(q,h){"object"===typeof exports&&"undefined"!==typeof module?module.exports=h():"function"===typeof define&&define.amd?define(h):q.React=h()})(this,function(){function q(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");
|
|
10
|
+
b.name="Invariant Violation";b.framesToPop=1;throw b;}function h(a){return function(){return a}}function p(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||E}function F(){}function v(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||E}function G(a,b,e){var c=void 0,f={},k=null,d=null;if(null!=b)for(c in void 0!==b.ref&&(d=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,c)&&!I.hasOwnProperty(c)&&(f[c]=b[c]);var g=arguments.length-2;if(1===g)f.children=e;else if(1<g){for(var l=
|
|
11
|
+
Array(g),m=0;m<g;m++)l[m]=arguments[m+2];f.children=l}if(a&&a.defaultProps)for(c in g=a.defaultProps,g)void 0===f[c]&&(f[c]=g[c]);return{$$typeof:r,type:a,key:k,ref:d,props:f,_owner:w.current}}function x(a){return"object"===typeof a&&null!==a&&a.$$typeof===r}function O(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}function J(a,b,e,c){if(u.length){var f=u.pop();f.result=a;f.keyPrefix=b;f.func=e;f.context=c;f.count=0;return f}return{result:a,keyPrefix:b,
|
|
12
|
+
func:e,context:c,count:0}}function K(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>u.length&&u.push(a)}function t(a,b,e,c){var f=typeof a;if("undefined"===f||"boolean"===f)a=null;var k=!1;if(null===a)k=!0;else switch(f){case "string":case "number":k=!0;break;case "object":switch(a.$$typeof){case r:case P:k=!0}}if(k)return e(c,a,""===b?"."+y(a,0):b),1;k=0;b=""===b?".":b+":";if(Array.isArray(a))for(var d=0;d<a.length;d++){f=a[d];var g=b+y(f,d);k+=t(f,g,e,c)}else if(null===
|
|
13
|
+
a||"undefined"===typeof a?g=null:(g=L&&a[L]||a["@@iterator"],g="function"===typeof g?g:null),"function"===typeof g)for(a=g.call(a),d=0;!(f=a.next()).done;)f=f.value,g=b+y(f,d++),k+=t(f,g,e,c);else"object"===f&&(e=""+a,q("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return k}function y(a,b){return"object"===typeof a&&null!==a&&null!=a.key?O(a.key):b.toString(36)}function Q(a,b,e){a.func.call(a.context,b,a.count++)}function R(a,b,e){var c=a.result,f=a.keyPrefix;
|
|
14
|
+
a=a.func.call(a.context,b,a.count++);Array.isArray(a)?z(a,c,e,A.thatReturnsArgument):null!=a&&(x(a)&&(b=f+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(M,"$\x26/")+"/")+e,a={$$typeof:r,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function z(a,b,e,c,f){var d="";null!=e&&(d=(""+e).replace(M,"$\x26/")+"/");b=J(b,d,c,f);null==a||t(a,"",R,b);K(b)}var N=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,B=function(){try{if(!Object.assign)return!1;
|
|
15
|
+
var a=new String("abc");a[5]="de";if("5"===Object.getOwnPropertyNames(a)[0])return!1;var b={};for(a=0;10>a;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var e={};"abcdefghijklmnopqrst".split("").forEach(function(a){e[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},e)).join("")?!1:!0}catch(c){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
16
|
+
var e=Object(a);for(var c,f=1;f<arguments.length;f++){var d=Object(arguments[f]);for(var h in d)S.call(d,h)&&(e[h]=d[h]);if(N){c=N(d);for(var g=0;g<c.length;g++)T.call(d,c[g])&&(e[c[g]]=d[c[g]])}}return e},d="function"===typeof Symbol&&Symbol["for"],r=d?Symbol["for"]("react.element"):60103,P=d?Symbol["for"]("react.portal"):60106,n=d?Symbol["for"]("react.fragment"):60107,C=d?Symbol["for"]("react.strict_mode"):60108,U=d?Symbol["for"]("react.provider"):60109,V=d?Symbol["for"]("react.context"):60110,
|
|
17
|
+
W=d?Symbol["for"]("react.async_mode"):60111,X=d?Symbol["for"]("react.forward_ref"):60112,L="function"===typeof Symbol&&Symbol.iterator,D={};d=function(){};d.thatReturns=h;d.thatReturnsFalse=h(!1);d.thatReturnsTrue=h(!0);d.thatReturnsNull=h(null);d.thatReturnsThis=function(){return this};d.thatReturnsArgument=function(a){return a};var A=d,E={isMounted:function(a){return!1},enqueueForceUpdate:function(a,b,e){},enqueueReplaceState:function(a,b,e,c){},enqueueSetState:function(a,b,e,c){}};p.prototype.isReactComponent=
|
|
18
|
+
{};p.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?q("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};p.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};F.prototype=p.prototype;d=v.prototype=new F;d.constructor=v;B(d,p.prototype);d.isPureReactComponent=!0;var w={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0},M=/\/+/g,u=[];n={Children:{map:function(a,b,e){if(null==
|
|
19
|
+
a)return a;var c=[];z(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=J(null,null,b,e);null==a||t(a,"",Q,b);K(b)},count:function(a,b){return null==a?0:t(a,"",A.thatReturnsNull,null)},toArray:function(a){var b=[];z(a,b,null,A.thatReturnsArgument);return b},only:function(a){x(a)?void 0:q("143");return a}},createRef:function(){return{current:null}},Component:p,PureComponent:v,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:V,_calculateChangedBits:b,_defaultValue:a,
|
|
20
|
+
_currentValue:a,_changedBits:0,Provider:null,Consumer:null};a.Provider={$$typeof:U,context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:X,render:a}},Fragment:n,StrictMode:C,unstable_AsyncMode:W,createElement:G,cloneElement:function(a,b,e){var c=void 0,d=B({},a.props),k=a.key,h=a.ref,g=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,g=w.current);void 0!==b.key&&(k=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)H.call(b,c)&&!I.hasOwnProperty(c)&&
|
|
21
|
+
(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:r,type:a.type,key:k,ref:h,props:d,_owner:g}},createFactory:function(a){var b=G.bind(null,a);b.type=a;return b},isValidElement:x,version:"16.3.0-alpha.3",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:w,assign:B}};n=(C=Object.freeze({default:n}))&&n||C;return n["default"]?n["default"]:n});
|