@pie-element/charting 10.0.1-esmbeta.0 → 10.0.1-esmbeta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/package.json +1 -1
- package/controller/package.json +1 -1
- package/esm/configure.js +2195 -248
- package/esm/configure.js.map +1 -1
- package/package.json +2 -2
package/esm/configure.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
3
1
|
import { ModelUpdatedEvent, InsertImageEvent, DeleteImageEvent, InsertSoundEvent, DeleteSoundEvent } from '@pie-framework/pie-configure-events';
|
|
4
2
|
import { Chart, chartTypes, ConfigureChartPanel } from '@pie-lib/charting';
|
|
5
3
|
import { AlertDialog, layout, InputContainer, settings } from '@pie-lib/config-ui';
|
|
@@ -61,99 +59,2163 @@ function getAugmentedNamespace(n) {
|
|
|
61
59
|
return a;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
var
|
|
62
|
+
var react = {exports: {}};
|
|
63
|
+
|
|
64
|
+
var react_production_min = {};
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
object-assign
|
|
68
|
+
(c) Sindre Sorhus
|
|
69
|
+
@license MIT
|
|
70
|
+
*/
|
|
71
|
+
/* eslint-disable no-unused-vars */
|
|
72
|
+
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
|
|
73
|
+
var hasOwnProperty$d = Object.prototype.hasOwnProperty;
|
|
74
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
75
|
+
|
|
76
|
+
function toObject(val) {
|
|
77
|
+
if (val === null || val === undefined) {
|
|
78
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return Object(val);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function shouldUseNative() {
|
|
85
|
+
try {
|
|
86
|
+
if (!Object.assign) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
91
|
+
|
|
92
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
93
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
94
|
+
test1[5] = 'de';
|
|
95
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
100
|
+
var test2 = {};
|
|
101
|
+
for (var i = 0; i < 10; i++) {
|
|
102
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
103
|
+
}
|
|
104
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
105
|
+
return test2[n];
|
|
106
|
+
});
|
|
107
|
+
if (order2.join('') !== '0123456789') {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
112
|
+
var test3 = {};
|
|
113
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
114
|
+
test3[letter] = letter;
|
|
115
|
+
});
|
|
116
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
117
|
+
'abcdefghijklmnopqrst') {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return true;
|
|
122
|
+
} catch (err) {
|
|
123
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
129
|
+
var from;
|
|
130
|
+
var to = toObject(target);
|
|
131
|
+
var symbols;
|
|
132
|
+
|
|
133
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
134
|
+
from = Object(arguments[s]);
|
|
135
|
+
|
|
136
|
+
for (var key in from) {
|
|
137
|
+
if (hasOwnProperty$d.call(from, key)) {
|
|
138
|
+
to[key] = from[key];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (getOwnPropertySymbols$1) {
|
|
143
|
+
symbols = getOwnPropertySymbols$1(from);
|
|
144
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
145
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
146
|
+
to[symbols[i]] = from[symbols[i]];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return to;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/** @license React v16.14.0
|
|
156
|
+
* react.production.min.js
|
|
157
|
+
*
|
|
158
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the MIT license found in the
|
|
161
|
+
* LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/
|
|
163
|
+
var l$1=objectAssign,n$2="function"===typeof Symbol&&Symbol.for,p$1=n$2?Symbol.for("react.element"):60103,q$1=n$2?Symbol.for("react.portal"):60106,r$2=n$2?Symbol.for("react.fragment"):60107,t$1=n$2?Symbol.for("react.strict_mode"):60108,u$1=n$2?Symbol.for("react.profiler"):60114,v$2=n$2?Symbol.for("react.provider"):60109,w$2=n$2?Symbol.for("react.context"):60110,x$1=n$2?Symbol.for("react.forward_ref"):60112,y$2=n$2?Symbol.for("react.suspense"):60113,z$1=n$2?Symbol.for("react.memo"):60115,A$1=n$2?Symbol.for("react.lazy"):
|
|
164
|
+
60116,B="function"===typeof Symbol&&Symbol.iterator;function C$1(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
165
|
+
var D={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E$1={};function F$1(a,b,c){this.props=a;this.context=b;this.refs=E$1;this.updater=c||D;}F$1.prototype.isReactComponent={};F$1.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(C$1(85));this.updater.enqueueSetState(this,a,b,"setState");};F$1.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
|
|
166
|
+
function G$1(){}G$1.prototype=F$1.prototype;function H$1(a,b,c){this.props=a;this.context=b;this.refs=E$1;this.updater=c||D;}var I$1=H$1.prototype=new G$1;I$1.constructor=H$1;l$1(I$1,F$1.prototype);I$1.isPureReactComponent=!0;var J$1={current:null},K$1=Object.prototype.hasOwnProperty,L$1={key:!0,ref:!0,__self:!0,__source:!0};
|
|
167
|
+
function M$1(a,b,c){var e,d={},g=null,k=null;if(null!=b)for(e in void 0!==b.ref&&(k=b.ref),void 0!==b.key&&(g=""+b.key),b)K$1.call(b,e)&&!L$1.hasOwnProperty(e)&&(d[e]=b[e]);var f=arguments.length-2;if(1===f)d.children=c;else if(1<f){for(var h=Array(f),m=0;m<f;m++)h[m]=arguments[m+2];d.children=h;}if(a&&a.defaultProps)for(e in f=a.defaultProps,f)void 0===d[e]&&(d[e]=f[e]);return {$$typeof:p$1,type:a,key:g,ref:k,props:d,_owner:J$1.current}}
|
|
168
|
+
function N$1(a,b){return {$$typeof:p$1,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O$1(a){return "object"===typeof a&&null!==a&&a.$$typeof===p$1}function escape(a){var b={"=":"=0",":":"=2"};return "$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var P$1=/\/+/g,Q$1=[];function R$1(a,b,c,e){if(Q$1.length){var d=Q$1.pop();d.result=a;d.keyPrefix=b;d.func=c;d.context=e;d.count=0;return d}return {result:a,keyPrefix:b,func:c,context:e,count:0}}
|
|
169
|
+
function S$1(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>Q$1.length&&Q$1.push(a);}
|
|
170
|
+
function T$1(a,b,c,e){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 p$1:case q$1:g=!0;}}if(g)return c(e,a,""===b?"."+U$1(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;k<a.length;k++){d=a[k];var f=b+U$1(d,k);g+=T$1(d,f,c,e);}else if(null===a||"object"!==typeof a?f=null:(f=B&&a[B]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),k=
|
|
171
|
+
0;!(d=a.next()).done;)d=d.value,f=b+U$1(d,k++),g+=T$1(d,f,c,e);else if("object"===d)throw c=""+a,Error(C$1(31,"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c,""));return g}function V$1(a,b,c){return null==a?0:T$1(a,"",b,c)}function U$1(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function W$1(a,b){a.func.call(a.context,b,a.count++);}
|
|
172
|
+
function aa$1(a,b,c){var e=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?X$1(a,e,c,function(a){return a}):null!=a&&(O$1(a)&&(a=N$1(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(P$1,"$&/")+"/")+c)),e.push(a));}function X$1(a,b,c,e,d){var g="";null!=c&&(g=(""+c).replace(P$1,"$&/")+"/");b=R$1(b,g,e,d);V$1(a,aa$1,b);S$1(b);}var Y$1={current:null};function Z$1(){var a=Y$1.current;if(null===a)throw Error(C$1(321));return a}
|
|
173
|
+
var ba$1={ReactCurrentDispatcher:Y$1,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:J$1,IsSomeRendererActing:{current:!1},assign:l$1};react_production_min.Children={map:function(a,b,c){if(null==a)return a;var e=[];X$1(a,e,null,b,c);return e},forEach:function(a,b,c){if(null==a)return a;b=R$1(null,null,b,c);V$1(a,W$1,b);S$1(b);},count:function(a){return V$1(a,function(){return null},null)},toArray:function(a){var b=[];X$1(a,b,null,function(a){return a});return b},only:function(a){if(!O$1(a))throw Error(C$1(143));return a}};
|
|
174
|
+
react_production_min.Component=F$1;react_production_min.Fragment=r$2;react_production_min.Profiler=u$1;react_production_min.PureComponent=H$1;react_production_min.StrictMode=t$1;react_production_min.Suspense=y$2;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ba$1;
|
|
175
|
+
react_production_min.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(C$1(267,a));var e=l$1({},a.props),d=a.key,g=a.ref,k=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,k=J$1.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(h in b)K$1.call(b,h)&&!L$1.hasOwnProperty(h)&&(e[h]=void 0===b[h]&&void 0!==f?f[h]:b[h]);}var h=arguments.length-2;if(1===h)e.children=c;else if(1<h){f=Array(h);for(var m=0;m<h;m++)f[m]=arguments[m+2];e.children=f;}return {$$typeof:p$1,type:a.type,
|
|
176
|
+
key:d,ref:g,props:e,_owner:k}};react_production_min.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:w$2,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v$2,_context:a};return a.Consumer=a};react_production_min.createElement=M$1;react_production_min.createFactory=function(a){var b=M$1.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};react_production_min.forwardRef=function(a){return {$$typeof:x$1,render:a}};react_production_min.isValidElement=O$1;
|
|
177
|
+
react_production_min.lazy=function(a){return {$$typeof:A$1,_ctor:a,_status:-1,_result:null}};react_production_min.memo=function(a,b){return {$$typeof:z$1,type:a,compare:void 0===b?null:b}};react_production_min.useCallback=function(a,b){return Z$1().useCallback(a,b)};react_production_min.useContext=function(a,b){return Z$1().useContext(a,b)};react_production_min.useDebugValue=function(){};react_production_min.useEffect=function(a,b){return Z$1().useEffect(a,b)};react_production_min.useImperativeHandle=function(a,b,c){return Z$1().useImperativeHandle(a,b,c)};
|
|
178
|
+
react_production_min.useLayoutEffect=function(a,b){return Z$1().useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return Z$1().useMemo(a,b)};react_production_min.useReducer=function(a,b,c){return Z$1().useReducer(a,b,c)};react_production_min.useRef=function(a){return Z$1().useRef(a)};react_production_min.useState=function(a){return Z$1().useState(a)};react_production_min.version="16.14.0";
|
|
179
|
+
|
|
180
|
+
var react_development = {};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the MIT license found in the
|
|
186
|
+
* LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
190
|
+
|
|
191
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
192
|
+
|
|
193
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the MIT license found in the
|
|
199
|
+
* LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
var printWarning$2 = function() {};
|
|
203
|
+
|
|
204
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
205
|
+
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
206
|
+
var loggedTypeFailures = {};
|
|
207
|
+
var has$1 = has$2;
|
|
208
|
+
|
|
209
|
+
printWarning$2 = function(text) {
|
|
210
|
+
var message = 'Warning: ' + text;
|
|
211
|
+
if (typeof console !== 'undefined') {
|
|
212
|
+
console.error(message);
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
// --- Welcome to debugging React ---
|
|
216
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
217
|
+
// to find the callsite that caused this warning to fire.
|
|
218
|
+
throw new Error(message);
|
|
219
|
+
} catch (x) { /**/ }
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Assert that the values match with the type specs.
|
|
225
|
+
* Error messages are memorized and will only be shown once.
|
|
226
|
+
*
|
|
227
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
228
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
229
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
230
|
+
* @param {string} componentName Name of the component for error messages.
|
|
231
|
+
* @param {?Function} getStack Returns the component stack.
|
|
232
|
+
* @private
|
|
233
|
+
*/
|
|
234
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
235
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
236
|
+
for (var typeSpecName in typeSpecs) {
|
|
237
|
+
if (has$1(typeSpecs, typeSpecName)) {
|
|
238
|
+
var error;
|
|
239
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
240
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
241
|
+
// After these have been cleaned up, we'll let them throw.
|
|
242
|
+
try {
|
|
243
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
244
|
+
// behavior as without this statement except with a better message.
|
|
245
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
246
|
+
var err = Error(
|
|
247
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
248
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
249
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
250
|
+
);
|
|
251
|
+
err.name = 'Invariant Violation';
|
|
252
|
+
throw err;
|
|
253
|
+
}
|
|
254
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
255
|
+
} catch (ex) {
|
|
256
|
+
error = ex;
|
|
257
|
+
}
|
|
258
|
+
if (error && !(error instanceof Error)) {
|
|
259
|
+
printWarning$2(
|
|
260
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
261
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
262
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
263
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
264
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
265
|
+
'shape all require an argument).'
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
269
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
270
|
+
// same error.
|
|
271
|
+
loggedTypeFailures[error.message] = true;
|
|
272
|
+
|
|
273
|
+
var stack = getStack ? getStack() : '';
|
|
274
|
+
|
|
275
|
+
printWarning$2(
|
|
276
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Resets warning cache when testing.
|
|
286
|
+
*
|
|
287
|
+
* @private
|
|
288
|
+
*/
|
|
289
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
290
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
291
|
+
loggedTypeFailures = {};
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
296
|
+
|
|
297
|
+
/** @license React v16.14.0
|
|
298
|
+
* react.development.js
|
|
299
|
+
*
|
|
300
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the MIT license found in the
|
|
303
|
+
* LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
if (process.env.NODE_ENV !== "production") {
|
|
309
|
+
(function() {
|
|
310
|
+
|
|
311
|
+
var _assign = objectAssign;
|
|
312
|
+
var checkPropTypes = checkPropTypes_1;
|
|
313
|
+
|
|
314
|
+
var ReactVersion = '16.14.0';
|
|
315
|
+
|
|
316
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
317
|
+
// nor polyfill, then a plain number is used for performance.
|
|
318
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
319
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
320
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
321
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
322
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
323
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
324
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
325
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
326
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
327
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
328
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
329
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
330
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
331
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
332
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
333
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
334
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
335
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
336
|
+
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
337
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
338
|
+
function getIteratorFn(maybeIterable) {
|
|
339
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
344
|
+
|
|
345
|
+
if (typeof maybeIterator === 'function') {
|
|
346
|
+
return maybeIterator;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Keeps track of the current dispatcher.
|
|
354
|
+
*/
|
|
355
|
+
var ReactCurrentDispatcher = {
|
|
356
|
+
/**
|
|
357
|
+
* @internal
|
|
358
|
+
* @type {ReactComponent}
|
|
359
|
+
*/
|
|
360
|
+
current: null
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Keeps track of the current batch's configuration such as how long an update
|
|
365
|
+
* should suspend for if it needs to.
|
|
366
|
+
*/
|
|
367
|
+
var ReactCurrentBatchConfig = {
|
|
368
|
+
suspense: null
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Keeps track of the current owner.
|
|
373
|
+
*
|
|
374
|
+
* The current owner is the component who should own any components that are
|
|
375
|
+
* currently being constructed.
|
|
376
|
+
*/
|
|
377
|
+
var ReactCurrentOwner = {
|
|
378
|
+
/**
|
|
379
|
+
* @internal
|
|
380
|
+
* @type {ReactComponent}
|
|
381
|
+
*/
|
|
382
|
+
current: null
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
386
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
387
|
+
var sourceInfo = '';
|
|
388
|
+
|
|
389
|
+
if (source) {
|
|
390
|
+
var path = source.fileName;
|
|
391
|
+
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
392
|
+
|
|
393
|
+
{
|
|
394
|
+
// In DEV, include code for a common special case:
|
|
395
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
396
|
+
if (/^index\./.test(fileName)) {
|
|
397
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
398
|
+
|
|
399
|
+
if (match) {
|
|
400
|
+
var pathBeforeSlash = match[1];
|
|
401
|
+
|
|
402
|
+
if (pathBeforeSlash) {
|
|
403
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
404
|
+
fileName = folderName + '/' + fileName;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
411
|
+
} else if (ownerName) {
|
|
412
|
+
sourceInfo = ' (created by ' + ownerName + ')';
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
var Resolved = 1;
|
|
419
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
420
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
424
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
425
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function getComponentName(type) {
|
|
429
|
+
if (type == null) {
|
|
430
|
+
// Host root, text node or just invalid type.
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
{
|
|
435
|
+
if (typeof type.tag === 'number') {
|
|
436
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (typeof type === 'function') {
|
|
441
|
+
return type.displayName || type.name || null;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (typeof type === 'string') {
|
|
445
|
+
return type;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
switch (type) {
|
|
449
|
+
case REACT_FRAGMENT_TYPE:
|
|
450
|
+
return 'Fragment';
|
|
451
|
+
|
|
452
|
+
case REACT_PORTAL_TYPE:
|
|
453
|
+
return 'Portal';
|
|
454
|
+
|
|
455
|
+
case REACT_PROFILER_TYPE:
|
|
456
|
+
return "Profiler";
|
|
457
|
+
|
|
458
|
+
case REACT_STRICT_MODE_TYPE:
|
|
459
|
+
return 'StrictMode';
|
|
460
|
+
|
|
461
|
+
case REACT_SUSPENSE_TYPE:
|
|
462
|
+
return 'Suspense';
|
|
463
|
+
|
|
464
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
465
|
+
return 'SuspenseList';
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (typeof type === 'object') {
|
|
469
|
+
switch (type.$$typeof) {
|
|
470
|
+
case REACT_CONTEXT_TYPE:
|
|
471
|
+
return 'Context.Consumer';
|
|
472
|
+
|
|
473
|
+
case REACT_PROVIDER_TYPE:
|
|
474
|
+
return 'Context.Provider';
|
|
475
|
+
|
|
476
|
+
case REACT_FORWARD_REF_TYPE:
|
|
477
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
478
|
+
|
|
479
|
+
case REACT_MEMO_TYPE:
|
|
480
|
+
return getComponentName(type.type);
|
|
481
|
+
|
|
482
|
+
case REACT_BLOCK_TYPE:
|
|
483
|
+
return getComponentName(type.render);
|
|
484
|
+
|
|
485
|
+
case REACT_LAZY_TYPE:
|
|
486
|
+
{
|
|
487
|
+
var thenable = type;
|
|
488
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
489
|
+
|
|
490
|
+
if (resolvedThenable) {
|
|
491
|
+
return getComponentName(resolvedThenable);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
var ReactDebugCurrentFrame = {};
|
|
503
|
+
var currentlyValidatingElement = null;
|
|
504
|
+
function setCurrentlyValidatingElement(element) {
|
|
505
|
+
{
|
|
506
|
+
currentlyValidatingElement = element;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
{
|
|
511
|
+
// Stack implementation injected by the current renderer.
|
|
512
|
+
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
513
|
+
|
|
514
|
+
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
515
|
+
var stack = ''; // Add an extra top frame while an element is being validated
|
|
516
|
+
|
|
517
|
+
if (currentlyValidatingElement) {
|
|
518
|
+
var name = getComponentName(currentlyValidatingElement.type);
|
|
519
|
+
var owner = currentlyValidatingElement._owner;
|
|
520
|
+
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
521
|
+
} // Delegate to the injected renderer-specific implementation
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
525
|
+
|
|
526
|
+
if (impl) {
|
|
527
|
+
stack += impl() || '';
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return stack;
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Used by act() to track whether you're inside an act() scope.
|
|
536
|
+
*/
|
|
537
|
+
var IsSomeRendererActing = {
|
|
538
|
+
current: false
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
var ReactSharedInternals = {
|
|
542
|
+
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
543
|
+
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
544
|
+
ReactCurrentOwner: ReactCurrentOwner,
|
|
545
|
+
IsSomeRendererActing: IsSomeRendererActing,
|
|
546
|
+
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
547
|
+
assign: _assign
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
{
|
|
551
|
+
_assign(ReactSharedInternals, {
|
|
552
|
+
// These should not be included in production.
|
|
553
|
+
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
554
|
+
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
555
|
+
// TODO: remove in React 17.0.
|
|
556
|
+
ReactComponentTreeHook: {}
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// by calls to these methods by a Babel plugin.
|
|
561
|
+
//
|
|
562
|
+
// In PROD (or in packages without access to React internals),
|
|
563
|
+
// they are left as they are instead.
|
|
564
|
+
|
|
565
|
+
function warn(format) {
|
|
566
|
+
{
|
|
567
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
568
|
+
args[_key - 1] = arguments[_key];
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
printWarning('warn', format, args);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function error(format) {
|
|
575
|
+
{
|
|
576
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
577
|
+
args[_key2 - 1] = arguments[_key2];
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
printWarning('error', format, args);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function printWarning(level, format, args) {
|
|
585
|
+
// When changing this logic, you might want to also
|
|
586
|
+
// update consoleWithStackDev.www.js as well.
|
|
587
|
+
{
|
|
588
|
+
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
|
|
589
|
+
|
|
590
|
+
if (!hasExistingStack) {
|
|
591
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
592
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
593
|
+
|
|
594
|
+
if (stack !== '') {
|
|
595
|
+
format += '%s';
|
|
596
|
+
args = args.concat([stack]);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
var argsWithFormat = args.map(function (item) {
|
|
601
|
+
return '' + item;
|
|
602
|
+
}); // Careful: RN currently depends on this prefix
|
|
603
|
+
|
|
604
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
605
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
606
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
607
|
+
|
|
608
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
609
|
+
|
|
610
|
+
try {
|
|
611
|
+
// --- Welcome to debugging React ---
|
|
612
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
613
|
+
// to find the callsite that caused this warning to fire.
|
|
614
|
+
var argIndex = 0;
|
|
615
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
616
|
+
return args[argIndex++];
|
|
617
|
+
});
|
|
618
|
+
throw new Error(message);
|
|
619
|
+
} catch (x) {}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
var didWarnStateUpdateForUnmountedComponent = {};
|
|
624
|
+
|
|
625
|
+
function warnNoop(publicInstance, callerName) {
|
|
626
|
+
{
|
|
627
|
+
var _constructor = publicInstance.constructor;
|
|
628
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
629
|
+
var warningKey = componentName + "." + callerName;
|
|
630
|
+
|
|
631
|
+
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
636
|
+
|
|
637
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* This is the abstract API for an update queue.
|
|
642
|
+
*/
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
var ReactNoopUpdateQueue = {
|
|
646
|
+
/**
|
|
647
|
+
* Checks whether or not this composite component is mounted.
|
|
648
|
+
* @param {ReactClass} publicInstance The instance we want to test.
|
|
649
|
+
* @return {boolean} True if mounted, false otherwise.
|
|
650
|
+
* @protected
|
|
651
|
+
* @final
|
|
652
|
+
*/
|
|
653
|
+
isMounted: function (publicInstance) {
|
|
654
|
+
return false;
|
|
655
|
+
},
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Forces an update. This should only be invoked when it is known with
|
|
659
|
+
* certainty that we are **not** in a DOM transaction.
|
|
660
|
+
*
|
|
661
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
662
|
+
* component's state has changed but `setState` was not called.
|
|
663
|
+
*
|
|
664
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
665
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
666
|
+
*
|
|
667
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
668
|
+
* @param {?function} callback Called after component is updated.
|
|
669
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
670
|
+
* @internal
|
|
671
|
+
*/
|
|
672
|
+
enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
|
673
|
+
warnNoop(publicInstance, 'forceUpdate');
|
|
674
|
+
},
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
678
|
+
* You should treat `this.state` as immutable.
|
|
679
|
+
*
|
|
680
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
681
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
682
|
+
*
|
|
683
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
684
|
+
* @param {object} completeState Next state.
|
|
685
|
+
* @param {?function} callback Called after component is updated.
|
|
686
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
687
|
+
* @internal
|
|
688
|
+
*/
|
|
689
|
+
enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
|
690
|
+
warnNoop(publicInstance, 'replaceState');
|
|
691
|
+
},
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Sets a subset of the state. This only exists because _pendingState is
|
|
695
|
+
* internal. This provides a merging strategy that is not available to deep
|
|
696
|
+
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
697
|
+
* during the merge.
|
|
698
|
+
*
|
|
699
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
700
|
+
* @param {object} partialState Next partial state to be merged with state.
|
|
701
|
+
* @param {?function} callback Called after component is updated.
|
|
702
|
+
* @param {?string} Name of the calling function in the public API.
|
|
703
|
+
* @internal
|
|
704
|
+
*/
|
|
705
|
+
enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
|
706
|
+
warnNoop(publicInstance, 'setState');
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
var emptyObject = {};
|
|
711
|
+
|
|
712
|
+
{
|
|
713
|
+
Object.freeze(emptyObject);
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Base class helpers for the updating state of a component.
|
|
717
|
+
*/
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
function Component(props, context, updater) {
|
|
721
|
+
this.props = props;
|
|
722
|
+
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
723
|
+
|
|
724
|
+
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
|
|
725
|
+
// renderer.
|
|
726
|
+
|
|
727
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
Component.prototype.isReactComponent = {};
|
|
731
|
+
/**
|
|
732
|
+
* Sets a subset of the state. Always use this to mutate
|
|
733
|
+
* state. You should treat `this.state` as immutable.
|
|
734
|
+
*
|
|
735
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
736
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
737
|
+
*
|
|
738
|
+
* There is no guarantee that calls to `setState` will run synchronously,
|
|
739
|
+
* as they may eventually be batched together. You can provide an optional
|
|
740
|
+
* callback that will be executed when the call to setState is actually
|
|
741
|
+
* completed.
|
|
742
|
+
*
|
|
743
|
+
* When a function is provided to setState, it will be called at some point in
|
|
744
|
+
* the future (not synchronously). It will be called with the up to date
|
|
745
|
+
* component arguments (state, props, context). These values can be different
|
|
746
|
+
* from this.* because your function may be called after receiveProps but before
|
|
747
|
+
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
748
|
+
* assigned to this.
|
|
749
|
+
*
|
|
750
|
+
* @param {object|function} partialState Next partial state or function to
|
|
751
|
+
* produce next partial state to be merged with current state.
|
|
752
|
+
* @param {?function} callback Called after state is updated.
|
|
753
|
+
* @final
|
|
754
|
+
* @protected
|
|
755
|
+
*/
|
|
756
|
+
|
|
757
|
+
Component.prototype.setState = function (partialState, callback) {
|
|
758
|
+
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
759
|
+
{
|
|
760
|
+
throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Forces an update. This should only be invoked when it is known with
|
|
768
|
+
* certainty that we are **not** in a DOM transaction.
|
|
769
|
+
*
|
|
770
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
771
|
+
* component's state has changed but `setState` was not called.
|
|
772
|
+
*
|
|
773
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
774
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
775
|
+
*
|
|
776
|
+
* @param {?function} callback Called after update is complete.
|
|
777
|
+
* @final
|
|
778
|
+
* @protected
|
|
779
|
+
*/
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
Component.prototype.forceUpdate = function (callback) {
|
|
783
|
+
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
787
|
+
* we would like to deprecate them, we're not going to move them over to this
|
|
788
|
+
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
{
|
|
793
|
+
var deprecatedAPIs = {
|
|
794
|
+
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
795
|
+
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
var defineDeprecationWarning = function (methodName, info) {
|
|
799
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
800
|
+
get: function () {
|
|
801
|
+
warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
802
|
+
|
|
803
|
+
return undefined;
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
for (var fnName in deprecatedAPIs) {
|
|
809
|
+
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
810
|
+
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function ComponentDummy() {}
|
|
816
|
+
|
|
817
|
+
ComponentDummy.prototype = Component.prototype;
|
|
818
|
+
/**
|
|
819
|
+
* Convenience component with default shallow equality check for sCU.
|
|
820
|
+
*/
|
|
821
|
+
|
|
822
|
+
function PureComponent(props, context, updater) {
|
|
823
|
+
this.props = props;
|
|
824
|
+
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
825
|
+
|
|
826
|
+
this.refs = emptyObject;
|
|
827
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
831
|
+
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
832
|
+
|
|
833
|
+
_assign(pureComponentPrototype, Component.prototype);
|
|
834
|
+
|
|
835
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
836
|
+
|
|
837
|
+
// an immutable object with a single mutable value
|
|
838
|
+
function createRef() {
|
|
839
|
+
var refObject = {
|
|
840
|
+
current: null
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
{
|
|
844
|
+
Object.seal(refObject);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
return refObject;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
851
|
+
var RESERVED_PROPS = {
|
|
852
|
+
key: true,
|
|
853
|
+
ref: true,
|
|
854
|
+
__self: true,
|
|
855
|
+
__source: true
|
|
856
|
+
};
|
|
857
|
+
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
858
|
+
|
|
859
|
+
{
|
|
860
|
+
didWarnAboutStringRefs = {};
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function hasValidRef(config) {
|
|
864
|
+
{
|
|
865
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
866
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
867
|
+
|
|
868
|
+
if (getter && getter.isReactWarning) {
|
|
869
|
+
return false;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
return config.ref !== undefined;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
function hasValidKey(config) {
|
|
878
|
+
{
|
|
879
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
880
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
881
|
+
|
|
882
|
+
if (getter && getter.isReactWarning) {
|
|
883
|
+
return false;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
return config.key !== undefined;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
892
|
+
var warnAboutAccessingKey = function () {
|
|
893
|
+
{
|
|
894
|
+
if (!specialPropKeyWarningShown) {
|
|
895
|
+
specialPropKeyWarningShown = true;
|
|
896
|
+
|
|
897
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
903
|
+
Object.defineProperty(props, 'key', {
|
|
904
|
+
get: warnAboutAccessingKey,
|
|
905
|
+
configurable: true
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
910
|
+
var warnAboutAccessingRef = function () {
|
|
911
|
+
{
|
|
912
|
+
if (!specialPropRefWarningShown) {
|
|
913
|
+
specialPropRefWarningShown = true;
|
|
914
|
+
|
|
915
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
921
|
+
Object.defineProperty(props, 'ref', {
|
|
922
|
+
get: warnAboutAccessingRef,
|
|
923
|
+
configurable: true
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
928
|
+
{
|
|
929
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
930
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
931
|
+
|
|
932
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
933
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
934
|
+
|
|
935
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
942
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
943
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
944
|
+
* if something is a React Element.
|
|
945
|
+
*
|
|
946
|
+
* @param {*} type
|
|
947
|
+
* @param {*} props
|
|
948
|
+
* @param {*} key
|
|
949
|
+
* @param {string|object} ref
|
|
950
|
+
* @param {*} owner
|
|
951
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
952
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
953
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
954
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
955
|
+
* change in behavior.
|
|
956
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
957
|
+
* indicating filename, line number, and/or other information.
|
|
958
|
+
* @internal
|
|
959
|
+
*/
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
963
|
+
var element = {
|
|
964
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
965
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
966
|
+
// Built-in properties that belong on the element
|
|
967
|
+
type: type,
|
|
968
|
+
key: key,
|
|
969
|
+
ref: ref,
|
|
970
|
+
props: props,
|
|
971
|
+
// Record the component responsible for creating this element.
|
|
972
|
+
_owner: owner
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
{
|
|
976
|
+
// The validation flag is currently mutative. We put it on
|
|
977
|
+
// an external backing store so that we can freeze the whole object.
|
|
978
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
979
|
+
// commonly used development environments.
|
|
980
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
981
|
+
// the validation flag non-enumerable (where possible, which should
|
|
982
|
+
// include every environment we run tests in), so the test framework
|
|
983
|
+
// ignores it.
|
|
984
|
+
|
|
985
|
+
Object.defineProperty(element._store, 'validated', {
|
|
986
|
+
configurable: false,
|
|
987
|
+
enumerable: false,
|
|
988
|
+
writable: true,
|
|
989
|
+
value: false
|
|
990
|
+
}); // self and source are DEV only properties.
|
|
991
|
+
|
|
992
|
+
Object.defineProperty(element, '_self', {
|
|
993
|
+
configurable: false,
|
|
994
|
+
enumerable: false,
|
|
995
|
+
writable: false,
|
|
996
|
+
value: self
|
|
997
|
+
}); // Two elements created in two different places should be considered
|
|
998
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
999
|
+
|
|
1000
|
+
Object.defineProperty(element, '_source', {
|
|
1001
|
+
configurable: false,
|
|
1002
|
+
enumerable: false,
|
|
1003
|
+
writable: false,
|
|
1004
|
+
value: source
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
if (Object.freeze) {
|
|
1008
|
+
Object.freeze(element.props);
|
|
1009
|
+
Object.freeze(element);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return element;
|
|
1014
|
+
};
|
|
1015
|
+
/**
|
|
1016
|
+
* Create and return a new ReactElement of the given type.
|
|
1017
|
+
* See https://reactjs.org/docs/react-api.html#createelement
|
|
1018
|
+
*/
|
|
1019
|
+
|
|
1020
|
+
function createElement(type, config, children) {
|
|
1021
|
+
var propName; // Reserved names are extracted
|
|
1022
|
+
|
|
1023
|
+
var props = {};
|
|
1024
|
+
var key = null;
|
|
1025
|
+
var ref = null;
|
|
1026
|
+
var self = null;
|
|
1027
|
+
var source = null;
|
|
1028
|
+
|
|
1029
|
+
if (config != null) {
|
|
1030
|
+
if (hasValidRef(config)) {
|
|
1031
|
+
ref = config.ref;
|
|
1032
|
+
|
|
1033
|
+
{
|
|
1034
|
+
warnIfStringRefCannotBeAutoConverted(config);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
if (hasValidKey(config)) {
|
|
1039
|
+
key = '' + config.key;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
self = config.__self === undefined ? null : config.__self;
|
|
1043
|
+
source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
|
|
1044
|
+
|
|
1045
|
+
for (propName in config) {
|
|
1046
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
1047
|
+
props[propName] = config[propName];
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
} // Children can be more than one argument, and those are transferred onto
|
|
1051
|
+
// the newly allocated props object.
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
var childrenLength = arguments.length - 2;
|
|
1055
|
+
|
|
1056
|
+
if (childrenLength === 1) {
|
|
1057
|
+
props.children = children;
|
|
1058
|
+
} else if (childrenLength > 1) {
|
|
1059
|
+
var childArray = Array(childrenLength);
|
|
1060
|
+
|
|
1061
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
1062
|
+
childArray[i] = arguments[i + 2];
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
{
|
|
1066
|
+
if (Object.freeze) {
|
|
1067
|
+
Object.freeze(childArray);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
props.children = childArray;
|
|
1072
|
+
} // Resolve default props
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
if (type && type.defaultProps) {
|
|
1076
|
+
var defaultProps = type.defaultProps;
|
|
1077
|
+
|
|
1078
|
+
for (propName in defaultProps) {
|
|
1079
|
+
if (props[propName] === undefined) {
|
|
1080
|
+
props[propName] = defaultProps[propName];
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
{
|
|
1086
|
+
if (key || ref) {
|
|
1087
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
1088
|
+
|
|
1089
|
+
if (key) {
|
|
1090
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
if (ref) {
|
|
1094
|
+
defineRefPropWarningGetter(props, displayName);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1100
|
+
}
|
|
1101
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
1102
|
+
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
1103
|
+
return newElement;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Clone and return a new ReactElement using element as the starting point.
|
|
1107
|
+
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
1108
|
+
*/
|
|
1109
|
+
|
|
1110
|
+
function cloneElement(element, config, children) {
|
|
1111
|
+
if (!!(element === null || element === undefined)) {
|
|
1112
|
+
{
|
|
1113
|
+
throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
var propName; // Original props are copied
|
|
1118
|
+
|
|
1119
|
+
var props = _assign({}, element.props); // Reserved names are extracted
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
var key = element.key;
|
|
1123
|
+
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
1124
|
+
|
|
1125
|
+
var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
|
|
1126
|
+
// transpiler, and the original source is probably a better indicator of the
|
|
1127
|
+
// true owner.
|
|
1128
|
+
|
|
1129
|
+
var source = element._source; // Owner will be preserved, unless ref is overridden
|
|
1130
|
+
|
|
1131
|
+
var owner = element._owner;
|
|
1132
|
+
|
|
1133
|
+
if (config != null) {
|
|
1134
|
+
if (hasValidRef(config)) {
|
|
1135
|
+
// Silently steal the ref from the parent.
|
|
1136
|
+
ref = config.ref;
|
|
1137
|
+
owner = ReactCurrentOwner.current;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
if (hasValidKey(config)) {
|
|
1141
|
+
key = '' + config.key;
|
|
1142
|
+
} // Remaining properties override existing props
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
var defaultProps;
|
|
1146
|
+
|
|
1147
|
+
if (element.type && element.type.defaultProps) {
|
|
1148
|
+
defaultProps = element.type.defaultProps;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
for (propName in config) {
|
|
1152
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
1153
|
+
if (config[propName] === undefined && defaultProps !== undefined) {
|
|
1154
|
+
// Resolve default props
|
|
1155
|
+
props[propName] = defaultProps[propName];
|
|
1156
|
+
} else {
|
|
1157
|
+
props[propName] = config[propName];
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
} // Children can be more than one argument, and those are transferred onto
|
|
1162
|
+
// the newly allocated props object.
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
var childrenLength = arguments.length - 2;
|
|
1166
|
+
|
|
1167
|
+
if (childrenLength === 1) {
|
|
1168
|
+
props.children = children;
|
|
1169
|
+
} else if (childrenLength > 1) {
|
|
1170
|
+
var childArray = Array(childrenLength);
|
|
1171
|
+
|
|
1172
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
1173
|
+
childArray[i] = arguments[i + 2];
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
props.children = childArray;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Verifies the object is a ReactElement.
|
|
1183
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1184
|
+
* @param {?object} object
|
|
1185
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
1186
|
+
* @final
|
|
1187
|
+
*/
|
|
1188
|
+
|
|
1189
|
+
function isValidElement(object) {
|
|
1190
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
var SEPARATOR = '.';
|
|
1194
|
+
var SUBSEPARATOR = ':';
|
|
1195
|
+
/**
|
|
1196
|
+
* Escape and wrap key so it is safe to use as a reactid
|
|
1197
|
+
*
|
|
1198
|
+
* @param {string} key to be escaped.
|
|
1199
|
+
* @return {string} the escaped key.
|
|
1200
|
+
*/
|
|
1201
|
+
|
|
1202
|
+
function escape(key) {
|
|
1203
|
+
var escapeRegex = /[=:]/g;
|
|
1204
|
+
var escaperLookup = {
|
|
1205
|
+
'=': '=0',
|
|
1206
|
+
':': '=2'
|
|
1207
|
+
};
|
|
1208
|
+
var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
|
1209
|
+
return escaperLookup[match];
|
|
1210
|
+
});
|
|
1211
|
+
return '$' + escapedString;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* TODO: Test that a single child and an array with one item have the same key
|
|
1215
|
+
* pattern.
|
|
1216
|
+
*/
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
var didWarnAboutMaps = false;
|
|
1220
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
1221
|
+
|
|
1222
|
+
function escapeUserProvidedKey(text) {
|
|
1223
|
+
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
var POOL_SIZE = 10;
|
|
1227
|
+
var traverseContextPool = [];
|
|
1228
|
+
|
|
1229
|
+
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
1230
|
+
if (traverseContextPool.length) {
|
|
1231
|
+
var traverseContext = traverseContextPool.pop();
|
|
1232
|
+
traverseContext.result = mapResult;
|
|
1233
|
+
traverseContext.keyPrefix = keyPrefix;
|
|
1234
|
+
traverseContext.func = mapFunction;
|
|
1235
|
+
traverseContext.context = mapContext;
|
|
1236
|
+
traverseContext.count = 0;
|
|
1237
|
+
return traverseContext;
|
|
1238
|
+
} else {
|
|
1239
|
+
return {
|
|
1240
|
+
result: mapResult,
|
|
1241
|
+
keyPrefix: keyPrefix,
|
|
1242
|
+
func: mapFunction,
|
|
1243
|
+
context: mapContext,
|
|
1244
|
+
count: 0
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function releaseTraverseContext(traverseContext) {
|
|
1250
|
+
traverseContext.result = null;
|
|
1251
|
+
traverseContext.keyPrefix = null;
|
|
1252
|
+
traverseContext.func = null;
|
|
1253
|
+
traverseContext.context = null;
|
|
1254
|
+
traverseContext.count = 0;
|
|
1255
|
+
|
|
1256
|
+
if (traverseContextPool.length < POOL_SIZE) {
|
|
1257
|
+
traverseContextPool.push(traverseContext);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* @param {?*} children Children tree container.
|
|
1262
|
+
* @param {!string} nameSoFar Name of the key path so far.
|
|
1263
|
+
* @param {!function} callback Callback to invoke with each child found.
|
|
1264
|
+
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
1265
|
+
* process.
|
|
1266
|
+
* @return {!number} The number of children in this subtree.
|
|
1267
|
+
*/
|
|
1268
|
+
|
|
1269
|
+
|
|
1270
|
+
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
1271
|
+
var type = typeof children;
|
|
1272
|
+
|
|
1273
|
+
if (type === 'undefined' || type === 'boolean') {
|
|
1274
|
+
// All of the above are perceived as null.
|
|
1275
|
+
children = null;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
var invokeCallback = false;
|
|
1279
|
+
|
|
1280
|
+
if (children === null) {
|
|
1281
|
+
invokeCallback = true;
|
|
1282
|
+
} else {
|
|
1283
|
+
switch (type) {
|
|
1284
|
+
case 'string':
|
|
1285
|
+
case 'number':
|
|
1286
|
+
invokeCallback = true;
|
|
1287
|
+
break;
|
|
1288
|
+
|
|
1289
|
+
case 'object':
|
|
1290
|
+
switch (children.$$typeof) {
|
|
1291
|
+
case REACT_ELEMENT_TYPE:
|
|
1292
|
+
case REACT_PORTAL_TYPE:
|
|
1293
|
+
invokeCallback = true;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
if (invokeCallback) {
|
|
1300
|
+
callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
|
|
1301
|
+
// so that it's consistent if the number of children grows.
|
|
1302
|
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
1303
|
+
return 1;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
var child;
|
|
1307
|
+
var nextName;
|
|
1308
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1309
|
+
|
|
1310
|
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1311
|
+
|
|
1312
|
+
if (Array.isArray(children)) {
|
|
1313
|
+
for (var i = 0; i < children.length; i++) {
|
|
1314
|
+
child = children[i];
|
|
1315
|
+
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
1316
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
1317
|
+
}
|
|
1318
|
+
} else {
|
|
1319
|
+
var iteratorFn = getIteratorFn(children);
|
|
1320
|
+
|
|
1321
|
+
if (typeof iteratorFn === 'function') {
|
|
1322
|
+
|
|
1323
|
+
{
|
|
1324
|
+
// Warn about using Maps as children
|
|
1325
|
+
if (iteratorFn === children.entries) {
|
|
1326
|
+
if (!didWarnAboutMaps) {
|
|
1327
|
+
warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
didWarnAboutMaps = true;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
var iterator = iteratorFn.call(children);
|
|
1335
|
+
var step;
|
|
1336
|
+
var ii = 0;
|
|
1337
|
+
|
|
1338
|
+
while (!(step = iterator.next()).done) {
|
|
1339
|
+
child = step.value;
|
|
1340
|
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
1341
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
1342
|
+
}
|
|
1343
|
+
} else if (type === 'object') {
|
|
1344
|
+
var addendum = '';
|
|
1345
|
+
|
|
1346
|
+
{
|
|
1347
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
var childrenString = '' + children;
|
|
1351
|
+
|
|
1352
|
+
{
|
|
1353
|
+
{
|
|
1354
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum );
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
return subtreeCount;
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* Traverses children that are typically specified as `props.children`, but
|
|
1364
|
+
* might also be specified through attributes:
|
|
1365
|
+
*
|
|
1366
|
+
* - `traverseAllChildren(this.props.children, ...)`
|
|
1367
|
+
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
1368
|
+
*
|
|
1369
|
+
* The `traverseContext` is an optional argument that is passed through the
|
|
1370
|
+
* entire traversal. It can be used to store accumulations or anything else that
|
|
1371
|
+
* the callback might find relevant.
|
|
1372
|
+
*
|
|
1373
|
+
* @param {?*} children Children tree object.
|
|
1374
|
+
* @param {!function} callback To invoke upon traversing each child.
|
|
1375
|
+
* @param {?*} traverseContext Context for traversal.
|
|
1376
|
+
* @return {!number} The number of children in this subtree.
|
|
1377
|
+
*/
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
function traverseAllChildren(children, callback, traverseContext) {
|
|
1381
|
+
if (children == null) {
|
|
1382
|
+
return 0;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Generate a key string that identifies a component within a set.
|
|
1389
|
+
*
|
|
1390
|
+
* @param {*} component A component that could contain a manual key.
|
|
1391
|
+
* @param {number} index Index that is used if a manual key is not provided.
|
|
1392
|
+
* @return {string}
|
|
1393
|
+
*/
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
function getComponentKey(component, index) {
|
|
1397
|
+
// Do some typechecking here since we call this blindly. We want to ensure
|
|
1398
|
+
// that we don't block potential future ES APIs.
|
|
1399
|
+
if (typeof component === 'object' && component !== null && component.key != null) {
|
|
1400
|
+
// Explicit key
|
|
1401
|
+
return escape(component.key);
|
|
1402
|
+
} // Implicit key determined by the index in the set
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
return index.toString(36);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
function forEachSingleChild(bookKeeping, child, name) {
|
|
1409
|
+
var func = bookKeeping.func,
|
|
1410
|
+
context = bookKeeping.context;
|
|
1411
|
+
func.call(context, child, bookKeeping.count++);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Iterates through children that are typically specified as `props.children`.
|
|
1415
|
+
*
|
|
1416
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
1417
|
+
*
|
|
1418
|
+
* The provided forEachFunc(child, index) will be called for each
|
|
1419
|
+
* leaf child.
|
|
1420
|
+
*
|
|
1421
|
+
* @param {?*} children Children tree container.
|
|
1422
|
+
* @param {function(*, int)} forEachFunc
|
|
1423
|
+
* @param {*} forEachContext Context for forEachContext.
|
|
1424
|
+
*/
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1428
|
+
if (children == null) {
|
|
1429
|
+
return children;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
|
1433
|
+
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
1434
|
+
releaseTraverseContext(traverseContext);
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
1438
|
+
var result = bookKeeping.result,
|
|
1439
|
+
keyPrefix = bookKeeping.keyPrefix,
|
|
1440
|
+
func = bookKeeping.func,
|
|
1441
|
+
context = bookKeeping.context;
|
|
1442
|
+
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
1443
|
+
|
|
1444
|
+
if (Array.isArray(mappedChild)) {
|
|
1445
|
+
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
|
1446
|
+
return c;
|
|
1447
|
+
});
|
|
1448
|
+
} else if (mappedChild != null) {
|
|
1449
|
+
if (isValidElement(mappedChild)) {
|
|
1450
|
+
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1451
|
+
// traverseAllChildren used to do for objects as children
|
|
1452
|
+
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
result.push(mappedChild);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
1460
|
+
var escapedPrefix = '';
|
|
1461
|
+
|
|
1462
|
+
if (prefix != null) {
|
|
1463
|
+
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
|
1467
|
+
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
1468
|
+
releaseTraverseContext(traverseContext);
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Maps children that are typically specified as `props.children`.
|
|
1472
|
+
*
|
|
1473
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1474
|
+
*
|
|
1475
|
+
* The provided mapFunction(child, key, index) will be called for each
|
|
1476
|
+
* leaf child.
|
|
1477
|
+
*
|
|
1478
|
+
* @param {?*} children Children tree container.
|
|
1479
|
+
* @param {function(*, int)} func The map function.
|
|
1480
|
+
* @param {*} context Context for mapFunction.
|
|
1481
|
+
* @return {object} Object containing the ordered map of results.
|
|
1482
|
+
*/
|
|
65
1483
|
|
|
66
|
-
var reactDom_production_min = {};
|
|
67
1484
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*/
|
|
73
|
-
/* eslint-disable no-unused-vars */
|
|
74
|
-
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
|
|
75
|
-
var hasOwnProperty$d = Object.prototype.hasOwnProperty;
|
|
76
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1485
|
+
function mapChildren(children, func, context) {
|
|
1486
|
+
if (children == null) {
|
|
1487
|
+
return children;
|
|
1488
|
+
}
|
|
77
1489
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1490
|
+
var result = [];
|
|
1491
|
+
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
1492
|
+
return result;
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Count the number of children that are typically specified as
|
|
1496
|
+
* `props.children`.
|
|
1497
|
+
*
|
|
1498
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
|
1499
|
+
*
|
|
1500
|
+
* @param {?*} children Children tree container.
|
|
1501
|
+
* @return {number} The number of children.
|
|
1502
|
+
*/
|
|
82
1503
|
|
|
83
|
-
|
|
1504
|
+
|
|
1505
|
+
function countChildren(children) {
|
|
1506
|
+
return traverseAllChildren(children, function () {
|
|
1507
|
+
return null;
|
|
1508
|
+
}, null);
|
|
84
1509
|
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Flatten a children object (typically specified as `props.children`) and
|
|
1512
|
+
* return an array with appropriately re-keyed children.
|
|
1513
|
+
*
|
|
1514
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
|
1515
|
+
*/
|
|
85
1516
|
|
|
86
|
-
function shouldUseNative() {
|
|
87
|
-
try {
|
|
88
|
-
if (!Object.assign) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
1517
|
|
|
92
|
-
|
|
1518
|
+
function toArray(children) {
|
|
1519
|
+
var result = [];
|
|
1520
|
+
mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
|
1521
|
+
return child;
|
|
1522
|
+
});
|
|
1523
|
+
return result;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Returns the first child in a collection of children and verifies that there
|
|
1527
|
+
* is only one child in the collection.
|
|
1528
|
+
*
|
|
1529
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
|
1530
|
+
*
|
|
1531
|
+
* The current implementation of this function assumes that a single child gets
|
|
1532
|
+
* passed without a wrapper, but the purpose of this helper function is to
|
|
1533
|
+
* abstract away the particular structure of children.
|
|
1534
|
+
*
|
|
1535
|
+
* @param {?object} children Child collection structure.
|
|
1536
|
+
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
1537
|
+
* structure.
|
|
1538
|
+
*/
|
|
93
1539
|
|
|
94
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
95
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
96
|
-
test1[5] = 'de';
|
|
97
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
1540
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return test2[n];
|
|
108
|
-
});
|
|
109
|
-
if (order2.join('') !== '0123456789') {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
1541
|
+
function onlyChild(children) {
|
|
1542
|
+
if (!isValidElement(children)) {
|
|
1543
|
+
{
|
|
1544
|
+
throw Error( "React.Children.only expected to receive a single React element child." );
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
112
1547
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
116
|
-
test3[letter] = letter;
|
|
117
|
-
});
|
|
118
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
119
|
-
'abcdefghijklmnopqrst') {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
1548
|
+
return children;
|
|
1549
|
+
}
|
|
122
1550
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1551
|
+
function createContext(defaultValue, calculateChangedBits) {
|
|
1552
|
+
if (calculateChangedBits === undefined) {
|
|
1553
|
+
calculateChangedBits = null;
|
|
1554
|
+
} else {
|
|
1555
|
+
{
|
|
1556
|
+
if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
|
1557
|
+
error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
var context = {
|
|
1563
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1564
|
+
_calculateChangedBits: calculateChangedBits,
|
|
1565
|
+
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1566
|
+
// some renderers as primary and others as secondary. We only expect
|
|
1567
|
+
// there to be two concurrent renderers at most: React Native (primary) and
|
|
1568
|
+
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
1569
|
+
// Secondary renderers store their context values on separate fields.
|
|
1570
|
+
_currentValue: defaultValue,
|
|
1571
|
+
_currentValue2: defaultValue,
|
|
1572
|
+
// Used to track how many concurrent renderers this context currently
|
|
1573
|
+
// supports within in a single renderer. Such as parallel server rendering.
|
|
1574
|
+
_threadCount: 0,
|
|
1575
|
+
// These are circular
|
|
1576
|
+
Provider: null,
|
|
1577
|
+
Consumer: null
|
|
1578
|
+
};
|
|
1579
|
+
context.Provider = {
|
|
1580
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
|
1581
|
+
_context: context
|
|
1582
|
+
};
|
|
1583
|
+
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1584
|
+
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1585
|
+
|
|
1586
|
+
{
|
|
1587
|
+
// A separate object, but proxies back to the original context object for
|
|
1588
|
+
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
1589
|
+
// warn for the incorrect usage of Context as a Consumer.
|
|
1590
|
+
var Consumer = {
|
|
1591
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1592
|
+
_context: context,
|
|
1593
|
+
_calculateChangedBits: context._calculateChangedBits
|
|
1594
|
+
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1595
|
+
|
|
1596
|
+
Object.defineProperties(Consumer, {
|
|
1597
|
+
Provider: {
|
|
1598
|
+
get: function () {
|
|
1599
|
+
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1600
|
+
hasWarnedAboutUsingConsumerProvider = true;
|
|
1601
|
+
|
|
1602
|
+
error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
return context.Provider;
|
|
1606
|
+
},
|
|
1607
|
+
set: function (_Provider) {
|
|
1608
|
+
context.Provider = _Provider;
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
_currentValue: {
|
|
1612
|
+
get: function () {
|
|
1613
|
+
return context._currentValue;
|
|
1614
|
+
},
|
|
1615
|
+
set: function (_currentValue) {
|
|
1616
|
+
context._currentValue = _currentValue;
|
|
1617
|
+
}
|
|
1618
|
+
},
|
|
1619
|
+
_currentValue2: {
|
|
1620
|
+
get: function () {
|
|
1621
|
+
return context._currentValue2;
|
|
1622
|
+
},
|
|
1623
|
+
set: function (_currentValue2) {
|
|
1624
|
+
context._currentValue2 = _currentValue2;
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
_threadCount: {
|
|
1628
|
+
get: function () {
|
|
1629
|
+
return context._threadCount;
|
|
1630
|
+
},
|
|
1631
|
+
set: function (_threadCount) {
|
|
1632
|
+
context._threadCount = _threadCount;
|
|
1633
|
+
}
|
|
1634
|
+
},
|
|
1635
|
+
Consumer: {
|
|
1636
|
+
get: function () {
|
|
1637
|
+
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1638
|
+
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1639
|
+
|
|
1640
|
+
error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
return context.Consumer;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1647
|
+
|
|
1648
|
+
context.Consumer = Consumer;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
{
|
|
1652
|
+
context._currentRenderer = null;
|
|
1653
|
+
context._currentRenderer2 = null;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
return context;
|
|
128
1657
|
}
|
|
129
1658
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
1659
|
+
function lazy(ctor) {
|
|
1660
|
+
var lazyType = {
|
|
1661
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1662
|
+
_ctor: ctor,
|
|
1663
|
+
// React uses these fields to store the result.
|
|
1664
|
+
_status: -1,
|
|
1665
|
+
_result: null
|
|
1666
|
+
};
|
|
134
1667
|
|
|
135
|
-
|
|
136
|
-
|
|
1668
|
+
{
|
|
1669
|
+
// In production, this would just set it on the object.
|
|
1670
|
+
var defaultProps;
|
|
1671
|
+
var propTypes;
|
|
1672
|
+
Object.defineProperties(lazyType, {
|
|
1673
|
+
defaultProps: {
|
|
1674
|
+
configurable: true,
|
|
1675
|
+
get: function () {
|
|
1676
|
+
return defaultProps;
|
|
1677
|
+
},
|
|
1678
|
+
set: function (newDefaultProps) {
|
|
1679
|
+
error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
137
1680
|
|
|
138
|
-
|
|
139
|
-
if (hasOwnProperty$d.call(from, key)) {
|
|
140
|
-
to[key] = from[key];
|
|
141
|
-
}
|
|
142
|
-
}
|
|
1681
|
+
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
143
1682
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1683
|
+
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1684
|
+
enumerable: true
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1688
|
+
propTypes: {
|
|
1689
|
+
configurable: true,
|
|
1690
|
+
get: function () {
|
|
1691
|
+
return propTypes;
|
|
1692
|
+
},
|
|
1693
|
+
set: function (newPropTypes) {
|
|
1694
|
+
error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
153
1695
|
|
|
154
|
-
|
|
1696
|
+
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1697
|
+
|
|
1698
|
+
Object.defineProperty(lazyType, 'propTypes', {
|
|
1699
|
+
enumerable: true
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
return lazyType;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
function forwardRef(render) {
|
|
1710
|
+
{
|
|
1711
|
+
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1712
|
+
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
1713
|
+
} else if (typeof render !== 'function') {
|
|
1714
|
+
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1715
|
+
} else {
|
|
1716
|
+
if (render.length !== 0 && render.length !== 2) {
|
|
1717
|
+
error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
if (render != null) {
|
|
1722
|
+
if (render.defaultProps != null || render.propTypes != null) {
|
|
1723
|
+
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
return {
|
|
1729
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1730
|
+
render: render
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
function isValidElementType(type) {
|
|
1735
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1736
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
function memo(type, compare) {
|
|
1740
|
+
{
|
|
1741
|
+
if (!isValidElementType(type)) {
|
|
1742
|
+
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
return {
|
|
1747
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1748
|
+
type: type,
|
|
1749
|
+
compare: compare === undefined ? null : compare
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
function resolveDispatcher() {
|
|
1754
|
+
var dispatcher = ReactCurrentDispatcher.current;
|
|
1755
|
+
|
|
1756
|
+
if (!(dispatcher !== null)) {
|
|
1757
|
+
{
|
|
1758
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
return dispatcher;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
function useContext(Context, unstable_observedBits) {
|
|
1766
|
+
var dispatcher = resolveDispatcher();
|
|
1767
|
+
|
|
1768
|
+
{
|
|
1769
|
+
if (unstable_observedBits !== undefined) {
|
|
1770
|
+
error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');
|
|
1771
|
+
} // TODO: add a more generic warning for invalid values.
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
if (Context._context !== undefined) {
|
|
1775
|
+
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1776
|
+
// and nobody should be using this in existing code.
|
|
1777
|
+
|
|
1778
|
+
if (realContext.Consumer === Context) {
|
|
1779
|
+
error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
1780
|
+
} else if (realContext.Provider === Context) {
|
|
1781
|
+
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
return dispatcher.useContext(Context, unstable_observedBits);
|
|
1787
|
+
}
|
|
1788
|
+
function useState(initialState) {
|
|
1789
|
+
var dispatcher = resolveDispatcher();
|
|
1790
|
+
return dispatcher.useState(initialState);
|
|
1791
|
+
}
|
|
1792
|
+
function useReducer(reducer, initialArg, init) {
|
|
1793
|
+
var dispatcher = resolveDispatcher();
|
|
1794
|
+
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1795
|
+
}
|
|
1796
|
+
function useRef(initialValue) {
|
|
1797
|
+
var dispatcher = resolveDispatcher();
|
|
1798
|
+
return dispatcher.useRef(initialValue);
|
|
1799
|
+
}
|
|
1800
|
+
function useEffect(create, deps) {
|
|
1801
|
+
var dispatcher = resolveDispatcher();
|
|
1802
|
+
return dispatcher.useEffect(create, deps);
|
|
1803
|
+
}
|
|
1804
|
+
function useLayoutEffect(create, deps) {
|
|
1805
|
+
var dispatcher = resolveDispatcher();
|
|
1806
|
+
return dispatcher.useLayoutEffect(create, deps);
|
|
1807
|
+
}
|
|
1808
|
+
function useCallback(callback, deps) {
|
|
1809
|
+
var dispatcher = resolveDispatcher();
|
|
1810
|
+
return dispatcher.useCallback(callback, deps);
|
|
1811
|
+
}
|
|
1812
|
+
function useMemo(create, deps) {
|
|
1813
|
+
var dispatcher = resolveDispatcher();
|
|
1814
|
+
return dispatcher.useMemo(create, deps);
|
|
1815
|
+
}
|
|
1816
|
+
function useImperativeHandle(ref, create, deps) {
|
|
1817
|
+
var dispatcher = resolveDispatcher();
|
|
1818
|
+
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1819
|
+
}
|
|
1820
|
+
function useDebugValue(value, formatterFn) {
|
|
1821
|
+
{
|
|
1822
|
+
var dispatcher = resolveDispatcher();
|
|
1823
|
+
return dispatcher.useDebugValue(value, formatterFn);
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
var propTypesMisspellWarningShown;
|
|
1828
|
+
|
|
1829
|
+
{
|
|
1830
|
+
propTypesMisspellWarningShown = false;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
function getDeclarationErrorAddendum() {
|
|
1834
|
+
if (ReactCurrentOwner.current) {
|
|
1835
|
+
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
1836
|
+
|
|
1837
|
+
if (name) {
|
|
1838
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
return '';
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1846
|
+
if (source !== undefined) {
|
|
1847
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1848
|
+
var lineNumber = source.lineNumber;
|
|
1849
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
return '';
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1856
|
+
if (elementProps !== null && elementProps !== undefined) {
|
|
1857
|
+
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
return '';
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1864
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
1865
|
+
* updates.
|
|
1866
|
+
*/
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
var ownerHasKeyUseWarning = {};
|
|
1870
|
+
|
|
1871
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1872
|
+
var info = getDeclarationErrorAddendum();
|
|
1873
|
+
|
|
1874
|
+
if (!info) {
|
|
1875
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1876
|
+
|
|
1877
|
+
if (parentName) {
|
|
1878
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
return info;
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1886
|
+
* This element is in an array. The array could grow and shrink or be
|
|
1887
|
+
* reordered. All children that haven't already been validated are required to
|
|
1888
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1889
|
+
* will only be shown once.
|
|
1890
|
+
*
|
|
1891
|
+
* @internal
|
|
1892
|
+
* @param {ReactElement} element Element that requires a key.
|
|
1893
|
+
* @param {*} parentType element's parent's type.
|
|
1894
|
+
*/
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
function validateExplicitKey(element, parentType) {
|
|
1898
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
element._store.validated = true;
|
|
1903
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1904
|
+
|
|
1905
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1906
|
+
return;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1910
|
+
// property, it may be the creator of the child that's responsible for
|
|
1911
|
+
// assigning it a key.
|
|
1912
|
+
|
|
1913
|
+
var childOwner = '';
|
|
1914
|
+
|
|
1915
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1916
|
+
// Give the component that originally created this child.
|
|
1917
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
setCurrentlyValidatingElement(element);
|
|
1921
|
+
|
|
1922
|
+
{
|
|
1923
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
setCurrentlyValidatingElement(null);
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Ensure that every element either is passed in a static location, in an
|
|
1930
|
+
* array with an explicit keys property defined, or in an object literal
|
|
1931
|
+
* with valid key property.
|
|
1932
|
+
*
|
|
1933
|
+
* @internal
|
|
1934
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
1935
|
+
* @param {*} parentType node's parent's type.
|
|
1936
|
+
*/
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
function validateChildKeys(node, parentType) {
|
|
1940
|
+
if (typeof node !== 'object') {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
if (Array.isArray(node)) {
|
|
1945
|
+
for (var i = 0; i < node.length; i++) {
|
|
1946
|
+
var child = node[i];
|
|
1947
|
+
|
|
1948
|
+
if (isValidElement(child)) {
|
|
1949
|
+
validateExplicitKey(child, parentType);
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
} else if (isValidElement(node)) {
|
|
1953
|
+
// This element was passed in a valid location.
|
|
1954
|
+
if (node._store) {
|
|
1955
|
+
node._store.validated = true;
|
|
1956
|
+
}
|
|
1957
|
+
} else if (node) {
|
|
1958
|
+
var iteratorFn = getIteratorFn(node);
|
|
1959
|
+
|
|
1960
|
+
if (typeof iteratorFn === 'function') {
|
|
1961
|
+
// Entry iterators used to provide implicit keys,
|
|
1962
|
+
// but now we print a separate warning for them later.
|
|
1963
|
+
if (iteratorFn !== node.entries) {
|
|
1964
|
+
var iterator = iteratorFn.call(node);
|
|
1965
|
+
var step;
|
|
1966
|
+
|
|
1967
|
+
while (!(step = iterator.next()).done) {
|
|
1968
|
+
if (isValidElement(step.value)) {
|
|
1969
|
+
validateExplicitKey(step.value, parentType);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
1978
|
+
* provided by the type.
|
|
1979
|
+
*
|
|
1980
|
+
* @param {ReactElement} element
|
|
1981
|
+
*/
|
|
1982
|
+
|
|
1983
|
+
|
|
1984
|
+
function validatePropTypes(element) {
|
|
1985
|
+
{
|
|
1986
|
+
var type = element.type;
|
|
1987
|
+
|
|
1988
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
var name = getComponentName(type);
|
|
1993
|
+
var propTypes;
|
|
1994
|
+
|
|
1995
|
+
if (typeof type === 'function') {
|
|
1996
|
+
propTypes = type.propTypes;
|
|
1997
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1998
|
+
// Inner props are checked in the reconciler.
|
|
1999
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2000
|
+
propTypes = type.propTypes;
|
|
2001
|
+
} else {
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
if (propTypes) {
|
|
2006
|
+
setCurrentlyValidatingElement(element);
|
|
2007
|
+
checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
|
2008
|
+
setCurrentlyValidatingElement(null);
|
|
2009
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2010
|
+
propTypesMisspellWarningShown = true;
|
|
2011
|
+
|
|
2012
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
2016
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
/**
|
|
2021
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
2022
|
+
* @param {ReactElement} fragment
|
|
2023
|
+
*/
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
function validateFragmentProps(fragment) {
|
|
2027
|
+
{
|
|
2028
|
+
setCurrentlyValidatingElement(fragment);
|
|
2029
|
+
var keys = Object.keys(fragment.props);
|
|
2030
|
+
|
|
2031
|
+
for (var i = 0; i < keys.length; i++) {
|
|
2032
|
+
var key = keys[i];
|
|
2033
|
+
|
|
2034
|
+
if (key !== 'children' && key !== 'key') {
|
|
2035
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2036
|
+
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
if (fragment.ref !== null) {
|
|
2042
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
setCurrentlyValidatingElement(null);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
function createElementWithValidation(type, props, children) {
|
|
2049
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2050
|
+
// succeed and there will likely be errors in render.
|
|
2051
|
+
|
|
2052
|
+
if (!validType) {
|
|
2053
|
+
var info = '';
|
|
2054
|
+
|
|
2055
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2056
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
2060
|
+
|
|
2061
|
+
if (sourceInfo) {
|
|
2062
|
+
info += sourceInfo;
|
|
2063
|
+
} else {
|
|
2064
|
+
info += getDeclarationErrorAddendum();
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
var typeString;
|
|
2068
|
+
|
|
2069
|
+
if (type === null) {
|
|
2070
|
+
typeString = 'null';
|
|
2071
|
+
} else if (Array.isArray(type)) {
|
|
2072
|
+
typeString = 'array';
|
|
2073
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2074
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2075
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2076
|
+
} else {
|
|
2077
|
+
typeString = typeof type;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
{
|
|
2081
|
+
error('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);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
2086
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2087
|
+
|
|
2088
|
+
if (element == null) {
|
|
2089
|
+
return element;
|
|
2090
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
2091
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2092
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
2093
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
2094
|
+
// fixed, the key warnings will appear.)
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
if (validType) {
|
|
2098
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
2099
|
+
validateChildKeys(arguments[i], type);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
2104
|
+
validateFragmentProps(element);
|
|
2105
|
+
} else {
|
|
2106
|
+
validatePropTypes(element);
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
return element;
|
|
2110
|
+
}
|
|
2111
|
+
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2112
|
+
function createFactoryWithValidation(type) {
|
|
2113
|
+
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
2114
|
+
validatedFactory.type = type;
|
|
2115
|
+
|
|
2116
|
+
{
|
|
2117
|
+
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
2118
|
+
didWarnAboutDeprecatedCreateFactory = true;
|
|
2119
|
+
|
|
2120
|
+
warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
|
2121
|
+
} // Legacy hook: remove it
|
|
2122
|
+
|
|
2123
|
+
|
|
2124
|
+
Object.defineProperty(validatedFactory, 'type', {
|
|
2125
|
+
enumerable: false,
|
|
2126
|
+
get: function () {
|
|
2127
|
+
warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
2128
|
+
|
|
2129
|
+
Object.defineProperty(this, 'type', {
|
|
2130
|
+
value: type
|
|
2131
|
+
});
|
|
2132
|
+
return type;
|
|
2133
|
+
}
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
return validatedFactory;
|
|
2138
|
+
}
|
|
2139
|
+
function cloneElementWithValidation(element, props, children) {
|
|
2140
|
+
var newElement = cloneElement.apply(this, arguments);
|
|
2141
|
+
|
|
2142
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
2143
|
+
validateChildKeys(arguments[i], newElement.type);
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
validatePropTypes(newElement);
|
|
2147
|
+
return newElement;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
{
|
|
2151
|
+
|
|
2152
|
+
try {
|
|
2153
|
+
var frozenObject = Object.freeze({});
|
|
2154
|
+
var testMap = new Map([[frozenObject, null]]);
|
|
2155
|
+
var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
|
|
2156
|
+
// https://github.com/rollup/rollup/issues/1771
|
|
2157
|
+
// TODO: we can remove these if Rollup fixes the bug.
|
|
2158
|
+
|
|
2159
|
+
testMap.set(0, 0);
|
|
2160
|
+
testSet.add(0);
|
|
2161
|
+
} catch (e) {
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
var createElement$1 = createElementWithValidation ;
|
|
2166
|
+
var cloneElement$1 = cloneElementWithValidation ;
|
|
2167
|
+
var createFactory = createFactoryWithValidation ;
|
|
2168
|
+
var Children = {
|
|
2169
|
+
map: mapChildren,
|
|
2170
|
+
forEach: forEachChildren,
|
|
2171
|
+
count: countChildren,
|
|
2172
|
+
toArray: toArray,
|
|
2173
|
+
only: onlyChild
|
|
155
2174
|
};
|
|
156
2175
|
|
|
2176
|
+
react_development.Children = Children;
|
|
2177
|
+
react_development.Component = Component;
|
|
2178
|
+
react_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
2179
|
+
react_development.Profiler = REACT_PROFILER_TYPE;
|
|
2180
|
+
react_development.PureComponent = PureComponent;
|
|
2181
|
+
react_development.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2182
|
+
react_development.Suspense = REACT_SUSPENSE_TYPE;
|
|
2183
|
+
react_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2184
|
+
react_development.cloneElement = cloneElement$1;
|
|
2185
|
+
react_development.createContext = createContext;
|
|
2186
|
+
react_development.createElement = createElement$1;
|
|
2187
|
+
react_development.createFactory = createFactory;
|
|
2188
|
+
react_development.createRef = createRef;
|
|
2189
|
+
react_development.forwardRef = forwardRef;
|
|
2190
|
+
react_development.isValidElement = isValidElement;
|
|
2191
|
+
react_development.lazy = lazy;
|
|
2192
|
+
react_development.memo = memo;
|
|
2193
|
+
react_development.useCallback = useCallback;
|
|
2194
|
+
react_development.useContext = useContext;
|
|
2195
|
+
react_development.useDebugValue = useDebugValue;
|
|
2196
|
+
react_development.useEffect = useEffect;
|
|
2197
|
+
react_development.useImperativeHandle = useImperativeHandle;
|
|
2198
|
+
react_development.useLayoutEffect = useLayoutEffect;
|
|
2199
|
+
react_development.useMemo = useMemo;
|
|
2200
|
+
react_development.useReducer = useReducer;
|
|
2201
|
+
react_development.useRef = useRef;
|
|
2202
|
+
react_development.useState = useState;
|
|
2203
|
+
react_development.version = ReactVersion;
|
|
2204
|
+
})();
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2208
|
+
react.exports = react_production_min;
|
|
2209
|
+
} else {
|
|
2210
|
+
react.exports = react_development;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
var React = react.exports;
|
|
2214
|
+
|
|
2215
|
+
var reactDom = {exports: {}};
|
|
2216
|
+
|
|
2217
|
+
var reactDom_production_min = {};
|
|
2218
|
+
|
|
157
2219
|
var scheduler = {exports: {}};
|
|
158
2220
|
|
|
159
2221
|
var scheduler_production_min = {};
|
|
@@ -1054,7 +3116,7 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1054
3116
|
* This source code is licensed under the MIT license found in the
|
|
1055
3117
|
* LICENSE file in the root directory of this source tree.
|
|
1056
3118
|
*/
|
|
1057
|
-
var aa=
|
|
3119
|
+
var aa=react.exports,n$1=objectAssign,r$1=scheduler.exports;function u(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!aa)throw Error(u(227));
|
|
1058
3120
|
function ba(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l);}catch(m){this.onError(m);}}var da=!1,ea=null,fa=!1,ha=null,ia={onError:function(a){da=!0;ea=a;}};function ja(a,b,c,d,e,f,g,h,k){da=!1;ea=null;ba.apply(ia,arguments);}function ka(a,b,c,d,e,f,g,h,k){ja.apply(this,arguments);if(da){if(da){var l=ea;da=!1;ea=null;}else throw Error(u(198));fa||(fa=!0,ha=l);}}var la=null,ma=null,na=null;
|
|
1059
3121
|
function oa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=na(c);ka(d,b,void 0,a);a.currentTarget=null;}var pa=null,qa={};
|
|
1060
3122
|
function ra(){if(pa)for(var a in qa){var b=qa[a],c=pa.indexOf(a);if(!(-1<c))throw Error(u(96,a));if(!sa[c]){if(!b.extractEvents)throw Error(u(97,a));sa[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;if(ta.hasOwnProperty(h))throw Error(u(99,h));ta[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ua(k[e],g,h);e=!0;}else f.registrationName?(ua(f.registrationName,g,h),e=!0):e=!1;if(!e)throw Error(u(98,d,a));}}}}
|
|
@@ -1337,121 +3399,6 @@ reactDom_production_min.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if
|
|
|
1337
3399
|
|
|
1338
3400
|
var reactDom_development = {};
|
|
1339
3401
|
|
|
1340
|
-
/**
|
|
1341
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1342
|
-
*
|
|
1343
|
-
* This source code is licensed under the MIT license found in the
|
|
1344
|
-
* LICENSE file in the root directory of this source tree.
|
|
1345
|
-
*/
|
|
1346
|
-
|
|
1347
|
-
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
1348
|
-
|
|
1349
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
1350
|
-
|
|
1351
|
-
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1352
|
-
|
|
1353
|
-
/**
|
|
1354
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1355
|
-
*
|
|
1356
|
-
* This source code is licensed under the MIT license found in the
|
|
1357
|
-
* LICENSE file in the root directory of this source tree.
|
|
1358
|
-
*/
|
|
1359
|
-
|
|
1360
|
-
var printWarning$2 = function() {};
|
|
1361
|
-
|
|
1362
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1363
|
-
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
1364
|
-
var loggedTypeFailures = {};
|
|
1365
|
-
var has$1 = has$2;
|
|
1366
|
-
|
|
1367
|
-
printWarning$2 = function(text) {
|
|
1368
|
-
var message = 'Warning: ' + text;
|
|
1369
|
-
if (typeof console !== 'undefined') {
|
|
1370
|
-
console.error(message);
|
|
1371
|
-
}
|
|
1372
|
-
try {
|
|
1373
|
-
// --- Welcome to debugging React ---
|
|
1374
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
1375
|
-
// to find the callsite that caused this warning to fire.
|
|
1376
|
-
throw new Error(message);
|
|
1377
|
-
} catch (x) { /**/ }
|
|
1378
|
-
};
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
/**
|
|
1382
|
-
* Assert that the values match with the type specs.
|
|
1383
|
-
* Error messages are memorized and will only be shown once.
|
|
1384
|
-
*
|
|
1385
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
1386
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
1387
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
1388
|
-
* @param {string} componentName Name of the component for error messages.
|
|
1389
|
-
* @param {?Function} getStack Returns the component stack.
|
|
1390
|
-
* @private
|
|
1391
|
-
*/
|
|
1392
|
-
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
1393
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1394
|
-
for (var typeSpecName in typeSpecs) {
|
|
1395
|
-
if (has$1(typeSpecs, typeSpecName)) {
|
|
1396
|
-
var error;
|
|
1397
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
1398
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
1399
|
-
// After these have been cleaned up, we'll let them throw.
|
|
1400
|
-
try {
|
|
1401
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
1402
|
-
// behavior as without this statement except with a better message.
|
|
1403
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
1404
|
-
var err = Error(
|
|
1405
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
1406
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
1407
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
1408
|
-
);
|
|
1409
|
-
err.name = 'Invariant Violation';
|
|
1410
|
-
throw err;
|
|
1411
|
-
}
|
|
1412
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
1413
|
-
} catch (ex) {
|
|
1414
|
-
error = ex;
|
|
1415
|
-
}
|
|
1416
|
-
if (error && !(error instanceof Error)) {
|
|
1417
|
-
printWarning$2(
|
|
1418
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
1419
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
1420
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
1421
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
1422
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
1423
|
-
'shape all require an argument).'
|
|
1424
|
-
);
|
|
1425
|
-
}
|
|
1426
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
1427
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
1428
|
-
// same error.
|
|
1429
|
-
loggedTypeFailures[error.message] = true;
|
|
1430
|
-
|
|
1431
|
-
var stack = getStack ? getStack() : '';
|
|
1432
|
-
|
|
1433
|
-
printWarning$2(
|
|
1434
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
1435
|
-
);
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Resets warning cache when testing.
|
|
1444
|
-
*
|
|
1445
|
-
* @private
|
|
1446
|
-
*/
|
|
1447
|
-
checkPropTypes$1.resetWarningCache = function() {
|
|
1448
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1449
|
-
loggedTypeFailures = {};
|
|
1450
|
-
}
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
|
-
var checkPropTypes_1 = checkPropTypes$1;
|
|
1454
|
-
|
|
1455
3402
|
var tracing = {exports: {}};
|
|
1456
3403
|
|
|
1457
3404
|
var schedulerTracing_production_min = {};
|
|
@@ -1838,7 +3785,7 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1838
3785
|
if (process.env.NODE_ENV !== "production") {
|
|
1839
3786
|
(function() {
|
|
1840
3787
|
|
|
1841
|
-
var React =
|
|
3788
|
+
var React = react.exports;
|
|
1842
3789
|
var _assign = objectAssign;
|
|
1843
3790
|
var Scheduler = scheduler.exports;
|
|
1844
3791
|
var checkPropTypes = checkPropTypes_1;
|
|
@@ -34561,7 +36508,7 @@ var _getPrototypeOf2$3 = _interopRequireDefault$s(getPrototypeOf$1.exports);
|
|
|
34561
36508
|
|
|
34562
36509
|
var _inherits2$7 = _interopRequireDefault$s(inherits.exports);
|
|
34563
36510
|
|
|
34564
|
-
var _react$j = _interopRequireDefault$s(
|
|
36511
|
+
var _react$j = _interopRequireDefault$s(react.exports);
|
|
34565
36512
|
|
|
34566
36513
|
var _propTypes$c = _interopRequireDefault$s(propTypes.exports);
|
|
34567
36514
|
|
|
@@ -35065,7 +37012,7 @@ var _inherits2$6 = _interopRequireDefault$p(inherits.exports);
|
|
|
35065
37012
|
|
|
35066
37013
|
var _objectWithoutProperties2$9 = _interopRequireDefault$p(objectWithoutProperties.exports);
|
|
35067
37014
|
|
|
35068
|
-
var _react$i = _interopRequireDefault$p(
|
|
37015
|
+
var _react$i = _interopRequireDefault$p(react.exports);
|
|
35069
37016
|
|
|
35070
37017
|
var _propTypes$b = _interopRequireDefault$p(propTypes.exports);
|
|
35071
37018
|
|
|
@@ -35456,7 +37403,7 @@ var _getPrototypeOf2$1 = _interopRequireDefault$o(getPrototypeOf$1.exports);
|
|
|
35456
37403
|
|
|
35457
37404
|
var _inherits2$5 = _interopRequireDefault$o(inherits.exports);
|
|
35458
37405
|
|
|
35459
|
-
var _react$h = _interopRequireDefault$o(
|
|
37406
|
+
var _react$h = _interopRequireDefault$o(react.exports);
|
|
35460
37407
|
|
|
35461
37408
|
var _propTypes$a = _interopRequireDefault$o(propTypes.exports);
|
|
35462
37409
|
|
|
@@ -35805,7 +37752,7 @@ var _defineProperty2$6 = _interopRequireDefault$m(defineProperty$3.exports);
|
|
|
35805
37752
|
|
|
35806
37753
|
var _objectWithoutProperties2$7 = _interopRequireDefault$m(objectWithoutProperties.exports);
|
|
35807
37754
|
|
|
35808
|
-
var _react$g = _interopRequireDefault$m(
|
|
37755
|
+
var _react$g = _interopRequireDefault$m(react.exports);
|
|
35809
37756
|
|
|
35810
37757
|
var _propTypes$9 = _interopRequireDefault$m(propTypes.exports);
|
|
35811
37758
|
|
|
@@ -36185,7 +38132,7 @@ Object.defineProperty(FormControlContext$1, "__esModule", {
|
|
|
36185
38132
|
});
|
|
36186
38133
|
FormControlContext$1.default = void 0;
|
|
36187
38134
|
|
|
36188
|
-
var _react$f = _interopRequireDefault$l(
|
|
38135
|
+
var _react$f = _interopRequireDefault$l(react.exports);
|
|
36189
38136
|
|
|
36190
38137
|
/**
|
|
36191
38138
|
* @ignore - internal component.
|
|
@@ -36204,7 +38151,7 @@ withFormControlContext$1.default = withFormControlContext;
|
|
|
36204
38151
|
|
|
36205
38152
|
var _extends2$7 = _interopRequireDefault$k(_extends$1.exports);
|
|
36206
38153
|
|
|
36207
|
-
var _react$e = _interopRequireDefault$k(
|
|
38154
|
+
var _react$e = _interopRequireDefault$k(react.exports);
|
|
36208
38155
|
|
|
36209
38156
|
var _hoistNonReactStatics = _interopRequireDefault$k(hoistNonReactStatics_cjs);
|
|
36210
38157
|
|
|
@@ -36292,7 +38239,7 @@ var _getPrototypeOf3$3 = _interopRequireDefault$i(getPrototypeOf$1.exports);
|
|
|
36292
38239
|
|
|
36293
38240
|
var _inherits2$4 = _interopRequireDefault$i(inherits.exports);
|
|
36294
38241
|
|
|
36295
|
-
var _react$d = _interopRequireDefault$i(
|
|
38242
|
+
var _react$d = _interopRequireDefault$i(react.exports);
|
|
36296
38243
|
|
|
36297
38244
|
var _propTypes$8 = _interopRequireDefault$i(propTypes.exports);
|
|
36298
38245
|
|
|
@@ -36760,7 +38707,7 @@ ChildMapping.mergeChildMappings = mergeChildMappings;
|
|
|
36760
38707
|
ChildMapping.getInitialChildMapping = getInitialChildMapping;
|
|
36761
38708
|
ChildMapping.getNextChildMapping = getNextChildMapping;
|
|
36762
38709
|
|
|
36763
|
-
var _react$c =
|
|
38710
|
+
var _react$c = react.exports;
|
|
36764
38711
|
|
|
36765
38712
|
/**
|
|
36766
38713
|
* Given `this.props.children`, return an object mapping key to child.
|
|
@@ -36910,7 +38857,7 @@ exports.default = void 0;
|
|
|
36910
38857
|
|
|
36911
38858
|
var _propTypes = _interopRequireDefault(propTypes.exports);
|
|
36912
38859
|
|
|
36913
|
-
var _react = _interopRequireDefault(
|
|
38860
|
+
var _react = _interopRequireDefault(react.exports);
|
|
36914
38861
|
|
|
36915
38862
|
var _reactLifecyclesCompat = require$$3;
|
|
36916
38863
|
|
|
@@ -37151,7 +39098,7 @@ Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$
|
|
|
37151
39098
|
|
|
37152
39099
|
var PropTypes = _interopRequireWildcard(propTypes.exports);
|
|
37153
39100
|
|
|
37154
|
-
var _react$b = _interopRequireDefault$f(
|
|
39101
|
+
var _react$b = _interopRequireDefault$f(react.exports);
|
|
37155
39102
|
|
|
37156
39103
|
var _reactDom$2 = _interopRequireDefault$f(reactDom.exports);
|
|
37157
39104
|
|
|
@@ -37777,7 +39724,7 @@ var _getPrototypeOf3$2 = _interopRequireDefault$e(getPrototypeOf$1.exports);
|
|
|
37777
39724
|
|
|
37778
39725
|
var _inherits2$3 = _interopRequireDefault$e(inherits.exports);
|
|
37779
39726
|
|
|
37780
|
-
var _react$a = _interopRequireDefault$e(
|
|
39727
|
+
var _react$a = _interopRequireDefault$e(react.exports);
|
|
37781
39728
|
|
|
37782
39729
|
var _propTypes$6 = _interopRequireDefault$e(propTypes.exports);
|
|
37783
39730
|
|
|
@@ -37926,7 +39873,7 @@ var _inherits2$2 = _interopRequireDefault$d(inherits.exports);
|
|
|
37926
39873
|
|
|
37927
39874
|
var _assertThisInitialized2$1 = _interopRequireDefault$d(assertThisInitialized.exports);
|
|
37928
39875
|
|
|
37929
|
-
var _react$9 = _interopRequireDefault$d(
|
|
39876
|
+
var _react$9 = _interopRequireDefault$d(react.exports);
|
|
37930
39877
|
|
|
37931
39878
|
var _propTypes$5 = _interopRequireDefault$d(propTypes.exports);
|
|
37932
39879
|
|
|
@@ -38342,7 +40289,7 @@ var _inherits2$1 = _interopRequireDefault$c(inherits.exports);
|
|
|
38342
40289
|
|
|
38343
40290
|
var _assertThisInitialized2 = _interopRequireDefault$c(assertThisInitialized.exports);
|
|
38344
40291
|
|
|
38345
|
-
var _react$8 = _interopRequireDefault$c(
|
|
40292
|
+
var _react$8 = _interopRequireDefault$c(react.exports);
|
|
38346
40293
|
|
|
38347
40294
|
var _propTypes$4 = _interopRequireDefault$c(propTypes.exports);
|
|
38348
40295
|
|
|
@@ -38890,7 +40837,7 @@ var _defineProperty2$3 = _interopRequireDefault$b(defineProperty$3.exports);
|
|
|
38890
40837
|
|
|
38891
40838
|
var _objectWithoutProperties2$3 = _interopRequireDefault$b(objectWithoutProperties.exports);
|
|
38892
40839
|
|
|
38893
|
-
var _react$7 = _interopRequireDefault$b(
|
|
40840
|
+
var _react$7 = _interopRequireDefault$b(react.exports);
|
|
38894
40841
|
|
|
38895
40842
|
var _propTypes$3 = _interopRequireDefault$b(propTypes.exports);
|
|
38896
40843
|
|
|
@@ -39100,7 +41047,7 @@ var _getPrototypeOf2 = _interopRequireDefault$a(getPrototypeOf$1.exports);
|
|
|
39100
41047
|
|
|
39101
41048
|
var _inherits2 = _interopRequireDefault$a(inherits.exports);
|
|
39102
41049
|
|
|
39103
|
-
var _react$6 = _interopRequireDefault$a(
|
|
41050
|
+
var _react$6 = _interopRequireDefault$a(react.exports);
|
|
39104
41051
|
|
|
39105
41052
|
var _propTypes$2 = _interopRequireDefault$a(propTypes.exports);
|
|
39106
41053
|
|
|
@@ -39493,7 +41440,7 @@ shouldUpdate$1.default = void 0;
|
|
|
39493
41440
|
|
|
39494
41441
|
var _inheritsLoose2 = _interopRequireDefault$7(inheritsLoose.exports);
|
|
39495
41442
|
|
|
39496
|
-
var _react$5 =
|
|
41443
|
+
var _react$5 = react.exports;
|
|
39497
41444
|
|
|
39498
41445
|
var _setDisplayName$1 = _interopRequireDefault$7(setDisplayName$1);
|
|
39499
41446
|
|
|
@@ -39655,7 +41602,7 @@ var _defineProperty2$1 = _interopRequireDefault$4(defineProperty$3.exports);
|
|
|
39655
41602
|
|
|
39656
41603
|
var _objectWithoutProperties2$1 = _interopRequireDefault$4(objectWithoutProperties.exports);
|
|
39657
41604
|
|
|
39658
|
-
var _react$4 = _interopRequireDefault$4(
|
|
41605
|
+
var _react$4 = _interopRequireDefault$4(react.exports);
|
|
39659
41606
|
|
|
39660
41607
|
var _propTypes$1 = _interopRequireDefault$4(propTypes.exports);
|
|
39661
41608
|
|
|
@@ -39849,7 +41796,7 @@ Object.defineProperty(CheckBoxOutlineBlank$1, "__esModule", {
|
|
|
39849
41796
|
});
|
|
39850
41797
|
CheckBoxOutlineBlank$1.default = void 0;
|
|
39851
41798
|
|
|
39852
|
-
var _react$3 = _interopRequireDefault$3(
|
|
41799
|
+
var _react$3 = _interopRequireDefault$3(react.exports);
|
|
39853
41800
|
|
|
39854
41801
|
var _pure$2 = _interopRequireDefault$3(pure$1);
|
|
39855
41802
|
|
|
@@ -39880,7 +41827,7 @@ Object.defineProperty(CheckBox$1, "__esModule", {
|
|
|
39880
41827
|
});
|
|
39881
41828
|
CheckBox$1.default = void 0;
|
|
39882
41829
|
|
|
39883
|
-
var _react$2 = _interopRequireDefault$2(
|
|
41830
|
+
var _react$2 = _interopRequireDefault$2(react.exports);
|
|
39884
41831
|
|
|
39885
41832
|
var _pure$1 = _interopRequireDefault$2(pure$1);
|
|
39886
41833
|
|
|
@@ -39911,7 +41858,7 @@ Object.defineProperty(IndeterminateCheckBox$1, "__esModule", {
|
|
|
39911
41858
|
});
|
|
39912
41859
|
IndeterminateCheckBox$1.default = void 0;
|
|
39913
41860
|
|
|
39914
|
-
var _react$1 = _interopRequireDefault$1(
|
|
41861
|
+
var _react$1 = _interopRequireDefault$1(react.exports);
|
|
39915
41862
|
|
|
39916
41863
|
var _pure = _interopRequireDefault$1(pure$1);
|
|
39917
41864
|
|
|
@@ -39946,7 +41893,7 @@ var _defineProperty2 = _interopRequireDefault(defineProperty$3.exports);
|
|
|
39946
41893
|
|
|
39947
41894
|
var _objectWithoutProperties2 = _interopRequireDefault(objectWithoutProperties.exports);
|
|
39948
41895
|
|
|
39949
|
-
var _react = _interopRequireDefault(
|
|
41896
|
+
var _react = _interopRequireDefault(react.exports);
|
|
39950
41897
|
|
|
39951
41898
|
var _propTypes = _interopRequireDefault(propTypes.exports);
|
|
39952
41899
|
|
|
@@ -40194,7 +42141,7 @@ const restoreCorrectAnswer = (correctAnswer, data) => {
|
|
|
40194
42141
|
return correctResponseDefinition;
|
|
40195
42142
|
};
|
|
40196
42143
|
|
|
40197
|
-
class ChartingConfig extends
|
|
42144
|
+
class ChartingConfig extends react.exports.Component {
|
|
40198
42145
|
constructor(props) {
|
|
40199
42146
|
super(props);
|
|
40200
42147
|
|
|
@@ -40275,17 +42222,17 @@ class ChartingConfig extends React.Component {
|
|
|
40275
42222
|
domain = {},
|
|
40276
42223
|
range = {}
|
|
40277
42224
|
} = model || {};
|
|
40278
|
-
return /*#__PURE__*/
|
|
42225
|
+
return /*#__PURE__*/react.exports.createElement("div", null, /*#__PURE__*/react.exports.createElement("div", {
|
|
40279
42226
|
className: classes.title
|
|
40280
|
-
}, "Define Initial Chart Attributes"), /*#__PURE__*/
|
|
42227
|
+
}, "Define Initial Chart Attributes"), /*#__PURE__*/react.exports.createElement("div", {
|
|
40281
42228
|
className: classes.container
|
|
40282
|
-
}, /*#__PURE__*/
|
|
42229
|
+
}, /*#__PURE__*/react.exports.createElement("div", {
|
|
40283
42230
|
className: classes.column,
|
|
40284
42231
|
key: "graph"
|
|
40285
|
-
}, /*#__PURE__*/
|
|
42232
|
+
}, /*#__PURE__*/react.exports.createElement(Typography, {
|
|
40286
42233
|
component: "div",
|
|
40287
42234
|
type: "body1"
|
|
40288
|
-
}, /*#__PURE__*/
|
|
42235
|
+
}, /*#__PURE__*/react.exports.createElement("span", null, "Use the tools below to set up the chart as it will initially appear to students.")), /*#__PURE__*/react.exports.createElement(Chart, {
|
|
40289
42236
|
defineChart: true,
|
|
40290
42237
|
chartingOptions: chartingOptions,
|
|
40291
42238
|
showPixelGuides: showPixelGuides,
|
|
@@ -40311,13 +42258,13 @@ class ChartingConfig extends React.Component {
|
|
|
40311
42258
|
titlePlaceholder: titlePlaceholder == null ? void 0 : titlePlaceholder.label,
|
|
40312
42259
|
mathMlOptions: mathMlOptions,
|
|
40313
42260
|
labelsCharactersLimit: labelsCharactersLimit
|
|
40314
|
-
}), model.changeAddCategoryEnabled && /*#__PURE__*/
|
|
42261
|
+
}), model.changeAddCategoryEnabled && /*#__PURE__*/react.exports.createElement("div", null, /*#__PURE__*/react.exports.createElement(Checkbox, {
|
|
40315
42262
|
className: classes.customColor,
|
|
40316
42263
|
checked: model.addCategoryEnabled,
|
|
40317
42264
|
onChange: e => {
|
|
40318
42265
|
this.changeAddRemoveEnabled(e.target.checked);
|
|
40319
42266
|
}
|
|
40320
|
-
}), chartingOptions == null ? void 0 : (_chartingOptions$addC = chartingOptions.addCategory) == null ? void 0 : _chartingOptions$addC.authoringLabel), /*#__PURE__*/
|
|
42267
|
+
}), chartingOptions == null ? void 0 : (_chartingOptions$addC = chartingOptions.addCategory) == null ? void 0 : _chartingOptions$addC.authoringLabel), /*#__PURE__*/react.exports.createElement(AlertDialog, {
|
|
40321
42268
|
open: dialog.open,
|
|
40322
42269
|
title: dialog.title,
|
|
40323
42270
|
text: dialog.text,
|
|
@@ -43824,7 +45771,7 @@ const getUpdatedCategories = (nextProps, prevProps, prevState) => {
|
|
|
43824
45771
|
nextCategories = updateCorrectResponseData(nextCorrectAnswerDataCopy, nextData);
|
|
43825
45772
|
return nextCategories;
|
|
43826
45773
|
};
|
|
43827
|
-
class CorrectResponse extends
|
|
45774
|
+
class CorrectResponse extends react.exports.Component {
|
|
43828
45775
|
constructor(props) {
|
|
43829
45776
|
super(props);
|
|
43830
45777
|
|
|
@@ -43893,20 +45840,20 @@ class CorrectResponse extends React.Component {
|
|
|
43893
45840
|
identicalError,
|
|
43894
45841
|
categoriesError
|
|
43895
45842
|
} = correctAnswerErrors || {};
|
|
43896
|
-
return /*#__PURE__*/
|
|
45843
|
+
return /*#__PURE__*/react.exports.createElement("div", null, /*#__PURE__*/react.exports.createElement("div", {
|
|
43897
45844
|
className: classes.title
|
|
43898
|
-
}, "Define Correct Response"), /*#__PURE__*/
|
|
45845
|
+
}, "Define Correct Response"), /*#__PURE__*/react.exports.createElement("div", {
|
|
43899
45846
|
className: classes.container
|
|
43900
|
-
}, /*#__PURE__*/
|
|
45847
|
+
}, /*#__PURE__*/react.exports.createElement("div", {
|
|
43901
45848
|
className: classes.column,
|
|
43902
45849
|
key: "graph"
|
|
43903
|
-
}, /*#__PURE__*/
|
|
45850
|
+
}, /*#__PURE__*/react.exports.createElement(Typography, {
|
|
43904
45851
|
component: "div",
|
|
43905
45852
|
type: "body1"
|
|
43906
|
-
}, /*#__PURE__*/
|
|
45853
|
+
}, /*#__PURE__*/react.exports.createElement("span", null, "Use the tools below to define the correct answer.")), /*#__PURE__*/react.exports.createElement("div", {
|
|
43907
45854
|
key: `correct-response-graph-${model.correctAnswer.name}`,
|
|
43908
45855
|
className: identicalError || categoriesError ? classes.chartError : ''
|
|
43909
|
-
}, /*#__PURE__*/
|
|
45856
|
+
}, /*#__PURE__*/react.exports.createElement(Chart, {
|
|
43910
45857
|
chartType: model.chartType,
|
|
43911
45858
|
size: model.graph,
|
|
43912
45859
|
domain: domain,
|
|
@@ -43920,11 +45867,11 @@ class CorrectResponse extends React.Component {
|
|
|
43920
45867
|
error: error,
|
|
43921
45868
|
mathMlOptions: mathMlOptions,
|
|
43922
45869
|
labelsPlaceholders: labelsPlaceholders
|
|
43923
|
-
})), (identicalError || categoriesError) && /*#__PURE__*/
|
|
45870
|
+
})), (identicalError || categoriesError) && /*#__PURE__*/react.exports.createElement(Typography, {
|
|
43924
45871
|
component: "div",
|
|
43925
45872
|
type: "body1",
|
|
43926
45873
|
className: classes.errorText
|
|
43927
|
-
}, /*#__PURE__*/
|
|
45874
|
+
}, /*#__PURE__*/react.exports.createElement("span", null, identicalError || categoriesError)))));
|
|
43928
45875
|
}
|
|
43929
45876
|
|
|
43930
45877
|
}
|
|
@@ -44043,7 +45990,7 @@ const styles = theme => ({
|
|
|
44043
45990
|
});
|
|
44044
45991
|
|
|
44045
45992
|
const charts = [chartTypes.Bar(), chartTypes.Histogram(), chartTypes.LineDot(), chartTypes.LineCross(), chartTypes.DotPlot(), chartTypes.LinePlot()];
|
|
44046
|
-
class Configure extends
|
|
45993
|
+
class Configure extends React.Component {
|
|
44047
45994
|
constructor(props) {
|
|
44048
45995
|
super(props);
|
|
44049
45996
|
|
|
@@ -44192,11 +46139,11 @@ class Configure extends React__default.Component {
|
|
|
44192
46139
|
|
|
44193
46140
|
const getPluginProps = (props = {}) => _extends$2({}, baseInputConfiguration, props);
|
|
44194
46141
|
|
|
44195
|
-
return /*#__PURE__*/
|
|
46142
|
+
return /*#__PURE__*/React.createElement(layout.ConfigLayout, {
|
|
44196
46143
|
extraCSSRules: extraCSSRules,
|
|
44197
46144
|
dimensions: contentDimensions,
|
|
44198
46145
|
hideSettings: settingsPanelDisabled,
|
|
44199
|
-
settings: /*#__PURE__*/
|
|
46146
|
+
settings: /*#__PURE__*/React.createElement(Panel, {
|
|
44200
46147
|
model: model,
|
|
44201
46148
|
configuration: configuration,
|
|
44202
46149
|
onChangeModel: onModelChanged,
|
|
@@ -44206,14 +46153,14 @@ class Configure extends React__default.Component {
|
|
|
44206
46153
|
Properties: panelProperties
|
|
44207
46154
|
}
|
|
44208
46155
|
})
|
|
44209
|
-
}, /*#__PURE__*/
|
|
46156
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
44210
46157
|
component: "div",
|
|
44211
46158
|
type: "body1",
|
|
44212
46159
|
className: classes.description
|
|
44213
|
-
}, (instruction == null ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/
|
|
46160
|
+
}, (instruction == null ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/React.createElement(InputContainer, {
|
|
44214
46161
|
label: teacherInstructions.label,
|
|
44215
46162
|
className: classes.promptHolder
|
|
44216
|
-
}, /*#__PURE__*/
|
|
46163
|
+
}, /*#__PURE__*/React.createElement(EditableHtml, {
|
|
44217
46164
|
className: classes.prompt,
|
|
44218
46165
|
markup: model.teacherInstructions || '',
|
|
44219
46166
|
onChange: this.onTeacherInstructionsChange,
|
|
@@ -44231,12 +46178,12 @@ class Configure extends React__default.Component {
|
|
|
44231
46178
|
language: 'special'
|
|
44232
46179
|
}],
|
|
44233
46180
|
mathMlOptions: mathMlOptions
|
|
44234
|
-
}), teacherInstructionsError && /*#__PURE__*/
|
|
46181
|
+
}), teacherInstructionsError && /*#__PURE__*/React.createElement("div", {
|
|
44235
46182
|
className: classes.errorText
|
|
44236
|
-
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/
|
|
46183
|
+
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/React.createElement(InputContainer, {
|
|
44237
46184
|
label: prompt.label,
|
|
44238
46185
|
className: classes.promptHolder
|
|
44239
|
-
}, /*#__PURE__*/
|
|
46186
|
+
}, /*#__PURE__*/React.createElement(EditableHtml, {
|
|
44240
46187
|
className: classes.prompt,
|
|
44241
46188
|
markup: model.prompt,
|
|
44242
46189
|
onChange: this.onPromptChange,
|
|
@@ -44255,9 +46202,9 @@ class Configure extends React__default.Component {
|
|
|
44255
46202
|
language: 'special'
|
|
44256
46203
|
}],
|
|
44257
46204
|
mathMlOptions: mathMlOptions
|
|
44258
|
-
}), promptError && /*#__PURE__*/
|
|
46205
|
+
}), promptError && /*#__PURE__*/React.createElement("div", {
|
|
44259
46206
|
className: classes.errorText
|
|
44260
|
-
}, promptError)), /*#__PURE__*/
|
|
46207
|
+
}, promptError)), /*#__PURE__*/React.createElement(ConfigureChartPanel, {
|
|
44261
46208
|
model: model,
|
|
44262
46209
|
onChange: this.onConfigChange,
|
|
44263
46210
|
gridValues: gridValues,
|
|
@@ -44267,7 +46214,7 @@ class Configure extends React__default.Component {
|
|
|
44267
46214
|
studentNewCategoryDefaultLabel: studentNewCategoryDefaultLabel,
|
|
44268
46215
|
availableChartTypes: availableChartTypes,
|
|
44269
46216
|
chartTypeLabel: chartTypeLabel
|
|
44270
|
-
}), /*#__PURE__*/
|
|
46217
|
+
}), /*#__PURE__*/React.createElement(ChartingConfig$1, {
|
|
44271
46218
|
model: model,
|
|
44272
46219
|
onChange: onModelChanged,
|
|
44273
46220
|
charts: charts,
|
|
@@ -44278,7 +46225,7 @@ class Configure extends React__default.Component {
|
|
|
44278
46225
|
chartingOptions: chartingOptions,
|
|
44279
46226
|
mathMlOptions: mathMlOptions,
|
|
44280
46227
|
labelsCharactersLimit: labelsCharactersLimit
|
|
44281
|
-
}), /*#__PURE__*/
|
|
46228
|
+
}), /*#__PURE__*/React.createElement(CorrectResponse$1, {
|
|
44282
46229
|
config: graph,
|
|
44283
46230
|
model: model,
|
|
44284
46231
|
onChange: onModelChanged,
|
|
@@ -44288,10 +46235,10 @@ class Configure extends React__default.Component {
|
|
|
44288
46235
|
studentNewCategoryDefaultLabel: studentNewCategoryDefaultLabel,
|
|
44289
46236
|
mathMlOptions: mathMlOptions,
|
|
44290
46237
|
labelsPlaceholders: labelsPlaceholders
|
|
44291
|
-
}), rationaleEnabled && /*#__PURE__*/
|
|
46238
|
+
}), rationaleEnabled && /*#__PURE__*/React.createElement(InputContainer, {
|
|
44292
46239
|
label: rationale.label || 'Rationale',
|
|
44293
46240
|
className: classes.promptHolder
|
|
44294
|
-
}, /*#__PURE__*/
|
|
46241
|
+
}, /*#__PURE__*/React.createElement(EditableHtml, {
|
|
44295
46242
|
className: classes.prompt,
|
|
44296
46243
|
markup: model.rationale || '',
|
|
44297
46244
|
onChange: this.onRationaleChange,
|
|
@@ -44308,7 +46255,7 @@ class Configure extends React__default.Component {
|
|
|
44308
46255
|
language: 'special'
|
|
44309
46256
|
}],
|
|
44310
46257
|
mathMlOptions: mathMlOptions
|
|
44311
|
-
}), rationaleError && /*#__PURE__*/
|
|
46258
|
+
}), rationaleError && /*#__PURE__*/React.createElement("div", {
|
|
44312
46259
|
className: classes.errorText
|
|
44313
46260
|
}, rationaleError)));
|
|
44314
46261
|
}
|
|
@@ -44638,7 +46585,7 @@ class GraphLinesConfigure extends HTMLElement {
|
|
|
44638
46585
|
|
|
44639
46586
|
_render() {
|
|
44640
46587
|
if (this._model) {
|
|
44641
|
-
const el = /*#__PURE__*/
|
|
46588
|
+
const el = /*#__PURE__*/React.createElement(Configure$1, {
|
|
44642
46589
|
onModelChanged: this.onModelChanged.bind(this),
|
|
44643
46590
|
onConfigurationChanged: this.onConfigurationChanged.bind(this),
|
|
44644
46591
|
model: this._model,
|