@kne/react-form-antd 4.0.0-alpha.0 → 4.0.0-alpha.2

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.
@@ -29,1157 +29,6 @@ function _objectWithoutPropertiesLoose(r, e) {
29
29
  return t;
30
30
  }
31
31
 
32
- function createCommonjsModule(fn) {
33
- var module = { exports: {} };
34
- return fn(module, module.exports), module.exports;
35
- }
36
-
37
- /** @license React v16.13.1
38
- * react-is.production.min.js
39
- *
40
- * Copyright (c) Facebook, Inc. and its affiliates.
41
- *
42
- * This source code is licensed under the MIT license found in the
43
- * LICENSE file in the root directory of this source tree.
44
- */
45
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
46
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
47
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
48
- var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
49
- var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
50
- var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
51
-
52
- var reactIs_production_min = {
53
- AsyncMode: AsyncMode,
54
- ConcurrentMode: ConcurrentMode,
55
- ContextConsumer: ContextConsumer,
56
- ContextProvider: ContextProvider,
57
- Element: Element,
58
- ForwardRef: ForwardRef,
59
- Fragment: Fragment,
60
- Lazy: Lazy,
61
- Memo: Memo,
62
- Portal: Portal,
63
- Profiler: Profiler,
64
- StrictMode: StrictMode,
65
- Suspense: Suspense,
66
- isAsyncMode: isAsyncMode,
67
- isConcurrentMode: isConcurrentMode,
68
- isContextConsumer: isContextConsumer,
69
- isContextProvider: isContextProvider,
70
- isElement: isElement,
71
- isForwardRef: isForwardRef,
72
- isFragment: isFragment,
73
- isLazy: isLazy,
74
- isMemo: isMemo,
75
- isPortal: isPortal,
76
- isProfiler: isProfiler,
77
- isStrictMode: isStrictMode,
78
- isSuspense: isSuspense,
79
- isValidElementType: isValidElementType,
80
- typeOf: typeOf
81
- };
82
-
83
- /** @license React v16.13.1
84
- * react-is.development.js
85
- *
86
- * Copyright (c) Facebook, Inc. and its affiliates.
87
- *
88
- * This source code is licensed under the MIT license found in the
89
- * LICENSE file in the root directory of this source tree.
90
- */
91
-
92
- var reactIs_development = createCommonjsModule(function (module, exports) {
93
-
94
-
95
-
96
- if (process.env.NODE_ENV !== "production") {
97
- (function() {
98
-
99
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
100
- // nor polyfill, then a plain number is used for performance.
101
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
102
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
103
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
104
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
105
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
106
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
107
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
108
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
109
- // (unstable) APIs that have been removed. Can we remove the symbols?
110
-
111
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
112
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
113
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
114
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
115
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
116
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
117
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
118
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
119
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
120
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
121
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
122
-
123
- function isValidElementType(type) {
124
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
125
- 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);
126
- }
127
-
128
- function typeOf(object) {
129
- if (typeof object === 'object' && object !== null) {
130
- var $$typeof = object.$$typeof;
131
-
132
- switch ($$typeof) {
133
- case REACT_ELEMENT_TYPE:
134
- var type = object.type;
135
-
136
- switch (type) {
137
- case REACT_ASYNC_MODE_TYPE:
138
- case REACT_CONCURRENT_MODE_TYPE:
139
- case REACT_FRAGMENT_TYPE:
140
- case REACT_PROFILER_TYPE:
141
- case REACT_STRICT_MODE_TYPE:
142
- case REACT_SUSPENSE_TYPE:
143
- return type;
144
-
145
- default:
146
- var $$typeofType = type && type.$$typeof;
147
-
148
- switch ($$typeofType) {
149
- case REACT_CONTEXT_TYPE:
150
- case REACT_FORWARD_REF_TYPE:
151
- case REACT_LAZY_TYPE:
152
- case REACT_MEMO_TYPE:
153
- case REACT_PROVIDER_TYPE:
154
- return $$typeofType;
155
-
156
- default:
157
- return $$typeof;
158
- }
159
-
160
- }
161
-
162
- case REACT_PORTAL_TYPE:
163
- return $$typeof;
164
- }
165
- }
166
-
167
- return undefined;
168
- } // AsyncMode is deprecated along with isAsyncMode
169
-
170
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
171
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
172
- var ContextConsumer = REACT_CONTEXT_TYPE;
173
- var ContextProvider = REACT_PROVIDER_TYPE;
174
- var Element = REACT_ELEMENT_TYPE;
175
- var ForwardRef = REACT_FORWARD_REF_TYPE;
176
- var Fragment = REACT_FRAGMENT_TYPE;
177
- var Lazy = REACT_LAZY_TYPE;
178
- var Memo = REACT_MEMO_TYPE;
179
- var Portal = REACT_PORTAL_TYPE;
180
- var Profiler = REACT_PROFILER_TYPE;
181
- var StrictMode = REACT_STRICT_MODE_TYPE;
182
- var Suspense = REACT_SUSPENSE_TYPE;
183
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
184
-
185
- function isAsyncMode(object) {
186
- {
187
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
188
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
189
-
190
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
191
- }
192
- }
193
-
194
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
195
- }
196
- function isConcurrentMode(object) {
197
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
198
- }
199
- function isContextConsumer(object) {
200
- return typeOf(object) === REACT_CONTEXT_TYPE;
201
- }
202
- function isContextProvider(object) {
203
- return typeOf(object) === REACT_PROVIDER_TYPE;
204
- }
205
- function isElement(object) {
206
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
207
- }
208
- function isForwardRef(object) {
209
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
210
- }
211
- function isFragment(object) {
212
- return typeOf(object) === REACT_FRAGMENT_TYPE;
213
- }
214
- function isLazy(object) {
215
- return typeOf(object) === REACT_LAZY_TYPE;
216
- }
217
- function isMemo(object) {
218
- return typeOf(object) === REACT_MEMO_TYPE;
219
- }
220
- function isPortal(object) {
221
- return typeOf(object) === REACT_PORTAL_TYPE;
222
- }
223
- function isProfiler(object) {
224
- return typeOf(object) === REACT_PROFILER_TYPE;
225
- }
226
- function isStrictMode(object) {
227
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
228
- }
229
- function isSuspense(object) {
230
- return typeOf(object) === REACT_SUSPENSE_TYPE;
231
- }
232
-
233
- exports.AsyncMode = AsyncMode;
234
- exports.ConcurrentMode = ConcurrentMode;
235
- exports.ContextConsumer = ContextConsumer;
236
- exports.ContextProvider = ContextProvider;
237
- exports.Element = Element;
238
- exports.ForwardRef = ForwardRef;
239
- exports.Fragment = Fragment;
240
- exports.Lazy = Lazy;
241
- exports.Memo = Memo;
242
- exports.Portal = Portal;
243
- exports.Profiler = Profiler;
244
- exports.StrictMode = StrictMode;
245
- exports.Suspense = Suspense;
246
- exports.isAsyncMode = isAsyncMode;
247
- exports.isConcurrentMode = isConcurrentMode;
248
- exports.isContextConsumer = isContextConsumer;
249
- exports.isContextProvider = isContextProvider;
250
- exports.isElement = isElement;
251
- exports.isForwardRef = isForwardRef;
252
- exports.isFragment = isFragment;
253
- exports.isLazy = isLazy;
254
- exports.isMemo = isMemo;
255
- exports.isPortal = isPortal;
256
- exports.isProfiler = isProfiler;
257
- exports.isStrictMode = isStrictMode;
258
- exports.isSuspense = isSuspense;
259
- exports.isValidElementType = isValidElementType;
260
- exports.typeOf = typeOf;
261
- })();
262
- }
263
- });
264
-
265
- var reactIs = createCommonjsModule(function (module) {
266
-
267
- if (process.env.NODE_ENV === 'production') {
268
- module.exports = reactIs_production_min;
269
- } else {
270
- module.exports = reactIs_development;
271
- }
272
- });
273
-
274
- /*
275
- object-assign
276
- (c) Sindre Sorhus
277
- @license MIT
278
- */
279
- /* eslint-disable no-unused-vars */
280
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
281
- var hasOwnProperty = Object.prototype.hasOwnProperty;
282
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
283
-
284
- function toObject(val) {
285
- if (val === null || val === undefined) {
286
- throw new TypeError('Object.assign cannot be called with null or undefined');
287
- }
288
-
289
- return Object(val);
290
- }
291
-
292
- function shouldUseNative() {
293
- try {
294
- if (!Object.assign) {
295
- return false;
296
- }
297
-
298
- // Detect buggy property enumeration order in older V8 versions.
299
-
300
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
301
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
302
- test1[5] = 'de';
303
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
304
- return false;
305
- }
306
-
307
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
308
- var test2 = {};
309
- for (var i = 0; i < 10; i++) {
310
- test2['_' + String.fromCharCode(i)] = i;
311
- }
312
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
313
- return test2[n];
314
- });
315
- if (order2.join('') !== '0123456789') {
316
- return false;
317
- }
318
-
319
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
320
- var test3 = {};
321
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
322
- test3[letter] = letter;
323
- });
324
- if (Object.keys(Object.assign({}, test3)).join('') !==
325
- 'abcdefghijklmnopqrst') {
326
- return false;
327
- }
328
-
329
- return true;
330
- } catch (err) {
331
- // We don't expect any of the above to throw, but better to be safe.
332
- return false;
333
- }
334
- }
335
-
336
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
337
- var from;
338
- var to = toObject(target);
339
- var symbols;
340
-
341
- for (var s = 1; s < arguments.length; s++) {
342
- from = Object(arguments[s]);
343
-
344
- for (var key in from) {
345
- if (hasOwnProperty.call(from, key)) {
346
- to[key] = from[key];
347
- }
348
- }
349
-
350
- if (getOwnPropertySymbols) {
351
- symbols = getOwnPropertySymbols(from);
352
- for (var i = 0; i < symbols.length; i++) {
353
- if (propIsEnumerable.call(from, symbols[i])) {
354
- to[symbols[i]] = from[symbols[i]];
355
- }
356
- }
357
- }
358
- }
359
-
360
- return to;
361
- };
362
-
363
- /**
364
- * Copyright (c) 2013-present, Facebook, Inc.
365
- *
366
- * This source code is licensed under the MIT license found in the
367
- * LICENSE file in the root directory of this source tree.
368
- */
369
-
370
- var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
371
-
372
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
373
-
374
- var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
375
-
376
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
377
-
378
- var has$1 = has$2;
379
-
380
- /**
381
- * Copyright (c) 2013-present, Facebook, Inc.
382
- *
383
- * This source code is licensed under the MIT license found in the
384
- * LICENSE file in the root directory of this source tree.
385
- */
386
-
387
- var printWarning$1 = function() {};
388
-
389
- if (process.env.NODE_ENV !== 'production') {
390
- var ReactPropTypesSecret = ReactPropTypesSecret$1;
391
- var loggedTypeFailures = {};
392
- var has = has$1;
393
-
394
- printWarning$1 = function(text) {
395
- var message = 'Warning: ' + text;
396
- if (typeof console !== 'undefined') {
397
- console.error(message);
398
- }
399
- try {
400
- // --- Welcome to debugging React ---
401
- // This error was thrown as a convenience so that you can use this stack
402
- // to find the callsite that caused this warning to fire.
403
- throw new Error(message);
404
- } catch (x) { /**/ }
405
- };
406
- }
407
-
408
- /**
409
- * Assert that the values match with the type specs.
410
- * Error messages are memorized and will only be shown once.
411
- *
412
- * @param {object} typeSpecs Map of name to a ReactPropType
413
- * @param {object} values Runtime values that need to be type-checked
414
- * @param {string} location e.g. "prop", "context", "child context"
415
- * @param {string} componentName Name of the component for error messages.
416
- * @param {?Function} getStack Returns the component stack.
417
- * @private
418
- */
419
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
420
- if (process.env.NODE_ENV !== 'production') {
421
- for (var typeSpecName in typeSpecs) {
422
- if (has(typeSpecs, typeSpecName)) {
423
- var error;
424
- // Prop type validation may throw. In case they do, we don't want to
425
- // fail the render phase where it didn't fail before. So we log it.
426
- // After these have been cleaned up, we'll let them throw.
427
- try {
428
- // This is intentionally an invariant that gets caught. It's the same
429
- // behavior as without this statement except with a better message.
430
- if (typeof typeSpecs[typeSpecName] !== 'function') {
431
- var err = Error(
432
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
433
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
434
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
435
- );
436
- err.name = 'Invariant Violation';
437
- throw err;
438
- }
439
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
440
- } catch (ex) {
441
- error = ex;
442
- }
443
- if (error && !(error instanceof Error)) {
444
- printWarning$1(
445
- (componentName || 'React class') + ': type specification of ' +
446
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
447
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
448
- 'You may have forgotten to pass an argument to the type checker ' +
449
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
450
- 'shape all require an argument).'
451
- );
452
- }
453
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
454
- // Only monitor this failure once because there tends to be a lot of the
455
- // same error.
456
- loggedTypeFailures[error.message] = true;
457
-
458
- var stack = getStack ? getStack() : '';
459
-
460
- printWarning$1(
461
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
462
- );
463
- }
464
- }
465
- }
466
- }
467
- }
468
-
469
- /**
470
- * Resets warning cache when testing.
471
- *
472
- * @private
473
- */
474
- checkPropTypes$1.resetWarningCache = function() {
475
- if (process.env.NODE_ENV !== 'production') {
476
- loggedTypeFailures = {};
477
- }
478
- };
479
-
480
- var checkPropTypes_1 = checkPropTypes$1;
481
-
482
- var checkPropTypes = checkPropTypes_1;
483
-
484
- /**
485
- * Copyright (c) 2013-present, Facebook, Inc.
486
- *
487
- * This source code is licensed under the MIT license found in the
488
- * LICENSE file in the root directory of this source tree.
489
- */
490
-
491
-
492
-
493
-
494
-
495
-
496
-
497
-
498
- var printWarning = function() {};
499
-
500
- if (process.env.NODE_ENV !== 'production') {
501
- printWarning = function(text) {
502
- var message = 'Warning: ' + text;
503
- if (typeof console !== 'undefined') {
504
- console.error(message);
505
- }
506
- try {
507
- // --- Welcome to debugging React ---
508
- // This error was thrown as a convenience so that you can use this stack
509
- // to find the callsite that caused this warning to fire.
510
- throw new Error(message);
511
- } catch (x) {}
512
- };
513
- }
514
-
515
- function emptyFunctionThatReturnsNull() {
516
- return null;
517
- }
518
-
519
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
520
- /* global Symbol */
521
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
522
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
523
-
524
- /**
525
- * Returns the iterator method function contained on the iterable object.
526
- *
527
- * Be sure to invoke the function with the iterable as context:
528
- *
529
- * var iteratorFn = getIteratorFn(myIterable);
530
- * if (iteratorFn) {
531
- * var iterator = iteratorFn.call(myIterable);
532
- * ...
533
- * }
534
- *
535
- * @param {?object} maybeIterable
536
- * @return {?function}
537
- */
538
- function getIteratorFn(maybeIterable) {
539
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
540
- if (typeof iteratorFn === 'function') {
541
- return iteratorFn;
542
- }
543
- }
544
-
545
- /**
546
- * Collection of methods that allow declaration and validation of props that are
547
- * supplied to React components. Example usage:
548
- *
549
- * var Props = require('ReactPropTypes');
550
- * var MyArticle = React.createClass({
551
- * propTypes: {
552
- * // An optional string prop named "description".
553
- * description: Props.string,
554
- *
555
- * // A required enum prop named "category".
556
- * category: Props.oneOf(['News','Photos']).isRequired,
557
- *
558
- * // A prop named "dialog" that requires an instance of Dialog.
559
- * dialog: Props.instanceOf(Dialog).isRequired
560
- * },
561
- * render: function() { ... }
562
- * });
563
- *
564
- * A more formal specification of how these methods are used:
565
- *
566
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
567
- * decl := ReactPropTypes.{type}(.isRequired)?
568
- *
569
- * Each and every declaration produces a function with the same signature. This
570
- * allows the creation of custom validation functions. For example:
571
- *
572
- * var MyLink = React.createClass({
573
- * propTypes: {
574
- * // An optional string or URI prop named "href".
575
- * href: function(props, propName, componentName) {
576
- * var propValue = props[propName];
577
- * if (propValue != null && typeof propValue !== 'string' &&
578
- * !(propValue instanceof URI)) {
579
- * return new Error(
580
- * 'Expected a string or an URI for ' + propName + ' in ' +
581
- * componentName
582
- * );
583
- * }
584
- * }
585
- * },
586
- * render: function() {...}
587
- * });
588
- *
589
- * @internal
590
- */
591
-
592
- var ANONYMOUS = '<<anonymous>>';
593
-
594
- // Important!
595
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
596
- var ReactPropTypes = {
597
- array: createPrimitiveTypeChecker('array'),
598
- bigint: createPrimitiveTypeChecker('bigint'),
599
- bool: createPrimitiveTypeChecker('boolean'),
600
- func: createPrimitiveTypeChecker('function'),
601
- number: createPrimitiveTypeChecker('number'),
602
- object: createPrimitiveTypeChecker('object'),
603
- string: createPrimitiveTypeChecker('string'),
604
- symbol: createPrimitiveTypeChecker('symbol'),
605
-
606
- any: createAnyTypeChecker(),
607
- arrayOf: createArrayOfTypeChecker,
608
- element: createElementTypeChecker(),
609
- elementType: createElementTypeTypeChecker(),
610
- instanceOf: createInstanceTypeChecker,
611
- node: createNodeChecker(),
612
- objectOf: createObjectOfTypeChecker,
613
- oneOf: createEnumTypeChecker,
614
- oneOfType: createUnionTypeChecker,
615
- shape: createShapeTypeChecker,
616
- exact: createStrictShapeTypeChecker,
617
- };
618
-
619
- /**
620
- * inlined Object.is polyfill to avoid requiring consumers ship their own
621
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
622
- */
623
- /*eslint-disable no-self-compare*/
624
- function is(x, y) {
625
- // SameValue algorithm
626
- if (x === y) {
627
- // Steps 1-5, 7-10
628
- // Steps 6.b-6.e: +0 != -0
629
- return x !== 0 || 1 / x === 1 / y;
630
- } else {
631
- // Step 6.a: NaN == NaN
632
- return x !== x && y !== y;
633
- }
634
- }
635
- /*eslint-enable no-self-compare*/
636
-
637
- /**
638
- * We use an Error-like object for backward compatibility as people may call
639
- * PropTypes directly and inspect their output. However, we don't use real
640
- * Errors anymore. We don't inspect their stack anyway, and creating them
641
- * is prohibitively expensive if they are created too often, such as what
642
- * happens in oneOfType() for any type before the one that matched.
643
- */
644
- function PropTypeError(message, data) {
645
- this.message = message;
646
- this.data = data && typeof data === 'object' ? data: {};
647
- this.stack = '';
648
- }
649
- // Make `instanceof Error` still work for returned errors.
650
- PropTypeError.prototype = Error.prototype;
651
-
652
- function createChainableTypeChecker(validate) {
653
- if (process.env.NODE_ENV !== 'production') {
654
- var manualPropTypeCallCache = {};
655
- var manualPropTypeWarningCount = 0;
656
- }
657
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
658
- componentName = componentName || ANONYMOUS;
659
- propFullName = propFullName || propName;
660
-
661
- if (secret !== ReactPropTypesSecret$1) {
662
- if (throwOnDirectAccess) {
663
- // New behavior only for users of `prop-types` package
664
- var err = new Error(
665
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
666
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
667
- 'Read more at http://fb.me/use-check-prop-types'
668
- );
669
- err.name = 'Invariant Violation';
670
- throw err;
671
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
672
- // Old behavior for people using React.PropTypes
673
- var cacheKey = componentName + ':' + propName;
674
- if (
675
- !manualPropTypeCallCache[cacheKey] &&
676
- // Avoid spamming the console because they are often not actionable except for lib authors
677
- manualPropTypeWarningCount < 3
678
- ) {
679
- printWarning(
680
- 'You are manually calling a React.PropTypes validation ' +
681
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
682
- 'and will throw in the standalone `prop-types` package. ' +
683
- 'You may be seeing this warning due to a third-party PropTypes ' +
684
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
685
- );
686
- manualPropTypeCallCache[cacheKey] = true;
687
- manualPropTypeWarningCount++;
688
- }
689
- }
690
- }
691
- if (props[propName] == null) {
692
- if (isRequired) {
693
- if (props[propName] === null) {
694
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
695
- }
696
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
697
- }
698
- return null;
699
- } else {
700
- return validate(props, propName, componentName, location, propFullName);
701
- }
702
- }
703
-
704
- var chainedCheckType = checkType.bind(null, false);
705
- chainedCheckType.isRequired = checkType.bind(null, true);
706
-
707
- return chainedCheckType;
708
- }
709
-
710
- function createPrimitiveTypeChecker(expectedType) {
711
- function validate(props, propName, componentName, location, propFullName, secret) {
712
- var propValue = props[propName];
713
- var propType = getPropType(propValue);
714
- if (propType !== expectedType) {
715
- // `propValue` being instance of, say, date/regexp, pass the 'object'
716
- // check, but we can offer a more precise error message here rather than
717
- // 'of type `object`'.
718
- var preciseType = getPreciseType(propValue);
719
-
720
- return new PropTypeError(
721
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
722
- {expectedType: expectedType}
723
- );
724
- }
725
- return null;
726
- }
727
- return createChainableTypeChecker(validate);
728
- }
729
-
730
- function createAnyTypeChecker() {
731
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
732
- }
733
-
734
- function createArrayOfTypeChecker(typeChecker) {
735
- function validate(props, propName, componentName, location, propFullName) {
736
- if (typeof typeChecker !== 'function') {
737
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
738
- }
739
- var propValue = props[propName];
740
- if (!Array.isArray(propValue)) {
741
- var propType = getPropType(propValue);
742
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
743
- }
744
- for (var i = 0; i < propValue.length; i++) {
745
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
746
- if (error instanceof Error) {
747
- return error;
748
- }
749
- }
750
- return null;
751
- }
752
- return createChainableTypeChecker(validate);
753
- }
754
-
755
- function createElementTypeChecker() {
756
- function validate(props, propName, componentName, location, propFullName) {
757
- var propValue = props[propName];
758
- if (!isValidElement(propValue)) {
759
- var propType = getPropType(propValue);
760
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
761
- }
762
- return null;
763
- }
764
- return createChainableTypeChecker(validate);
765
- }
766
-
767
- function createElementTypeTypeChecker() {
768
- function validate(props, propName, componentName, location, propFullName) {
769
- var propValue = props[propName];
770
- if (!reactIs.isValidElementType(propValue)) {
771
- var propType = getPropType(propValue);
772
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
773
- }
774
- return null;
775
- }
776
- return createChainableTypeChecker(validate);
777
- }
778
-
779
- function createInstanceTypeChecker(expectedClass) {
780
- function validate(props, propName, componentName, location, propFullName) {
781
- if (!(props[propName] instanceof expectedClass)) {
782
- var expectedClassName = expectedClass.name || ANONYMOUS;
783
- var actualClassName = getClassName(props[propName]);
784
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
785
- }
786
- return null;
787
- }
788
- return createChainableTypeChecker(validate);
789
- }
790
-
791
- function createEnumTypeChecker(expectedValues) {
792
- if (!Array.isArray(expectedValues)) {
793
- if (process.env.NODE_ENV !== 'production') {
794
- if (arguments.length > 1) {
795
- printWarning(
796
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
797
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
798
- );
799
- } else {
800
- printWarning('Invalid argument supplied to oneOf, expected an array.');
801
- }
802
- }
803
- return emptyFunctionThatReturnsNull;
804
- }
805
-
806
- function validate(props, propName, componentName, location, propFullName) {
807
- var propValue = props[propName];
808
- for (var i = 0; i < expectedValues.length; i++) {
809
- if (is(propValue, expectedValues[i])) {
810
- return null;
811
- }
812
- }
813
-
814
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
815
- var type = getPreciseType(value);
816
- if (type === 'symbol') {
817
- return String(value);
818
- }
819
- return value;
820
- });
821
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
822
- }
823
- return createChainableTypeChecker(validate);
824
- }
825
-
826
- function createObjectOfTypeChecker(typeChecker) {
827
- function validate(props, propName, componentName, location, propFullName) {
828
- if (typeof typeChecker !== 'function') {
829
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
830
- }
831
- var propValue = props[propName];
832
- var propType = getPropType(propValue);
833
- if (propType !== 'object') {
834
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
835
- }
836
- for (var key in propValue) {
837
- if (has$1(propValue, key)) {
838
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
839
- if (error instanceof Error) {
840
- return error;
841
- }
842
- }
843
- }
844
- return null;
845
- }
846
- return createChainableTypeChecker(validate);
847
- }
848
-
849
- function createUnionTypeChecker(arrayOfTypeCheckers) {
850
- if (!Array.isArray(arrayOfTypeCheckers)) {
851
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
852
- return emptyFunctionThatReturnsNull;
853
- }
854
-
855
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
856
- var checker = arrayOfTypeCheckers[i];
857
- if (typeof checker !== 'function') {
858
- printWarning(
859
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
860
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
861
- );
862
- return emptyFunctionThatReturnsNull;
863
- }
864
- }
865
-
866
- function validate(props, propName, componentName, location, propFullName) {
867
- var expectedTypes = [];
868
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
869
- var checker = arrayOfTypeCheckers[i];
870
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
871
- if (checkerResult == null) {
872
- return null;
873
- }
874
- if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) {
875
- expectedTypes.push(checkerResult.data.expectedType);
876
- }
877
- }
878
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
879
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
880
- }
881
- return createChainableTypeChecker(validate);
882
- }
883
-
884
- function createNodeChecker() {
885
- function validate(props, propName, componentName, location, propFullName) {
886
- if (!isNode(props[propName])) {
887
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
888
- }
889
- return null;
890
- }
891
- return createChainableTypeChecker(validate);
892
- }
893
-
894
- function invalidValidatorError(componentName, location, propFullName, key, type) {
895
- return new PropTypeError(
896
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
897
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
898
- );
899
- }
900
-
901
- function createShapeTypeChecker(shapeTypes) {
902
- function validate(props, propName, componentName, location, propFullName) {
903
- var propValue = props[propName];
904
- var propType = getPropType(propValue);
905
- if (propType !== 'object') {
906
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
907
- }
908
- for (var key in shapeTypes) {
909
- var checker = shapeTypes[key];
910
- if (typeof checker !== 'function') {
911
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
912
- }
913
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
914
- if (error) {
915
- return error;
916
- }
917
- }
918
- return null;
919
- }
920
- return createChainableTypeChecker(validate);
921
- }
922
-
923
- function createStrictShapeTypeChecker(shapeTypes) {
924
- function validate(props, propName, componentName, location, propFullName) {
925
- var propValue = props[propName];
926
- var propType = getPropType(propValue);
927
- if (propType !== 'object') {
928
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
929
- }
930
- // We need to check all keys in case some are required but missing from props.
931
- var allKeys = objectAssign({}, props[propName], shapeTypes);
932
- for (var key in allKeys) {
933
- var checker = shapeTypes[key];
934
- if (has$1(shapeTypes, key) && typeof checker !== 'function') {
935
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
936
- }
937
- if (!checker) {
938
- return new PropTypeError(
939
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
940
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
941
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
942
- );
943
- }
944
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
945
- if (error) {
946
- return error;
947
- }
948
- }
949
- return null;
950
- }
951
-
952
- return createChainableTypeChecker(validate);
953
- }
954
-
955
- function isNode(propValue) {
956
- switch (typeof propValue) {
957
- case 'number':
958
- case 'string':
959
- case 'undefined':
960
- return true;
961
- case 'boolean':
962
- return !propValue;
963
- case 'object':
964
- if (Array.isArray(propValue)) {
965
- return propValue.every(isNode);
966
- }
967
- if (propValue === null || isValidElement(propValue)) {
968
- return true;
969
- }
970
-
971
- var iteratorFn = getIteratorFn(propValue);
972
- if (iteratorFn) {
973
- var iterator = iteratorFn.call(propValue);
974
- var step;
975
- if (iteratorFn !== propValue.entries) {
976
- while (!(step = iterator.next()).done) {
977
- if (!isNode(step.value)) {
978
- return false;
979
- }
980
- }
981
- } else {
982
- // Iterator will provide entry [k,v] tuples rather than values.
983
- while (!(step = iterator.next()).done) {
984
- var entry = step.value;
985
- if (entry) {
986
- if (!isNode(entry[1])) {
987
- return false;
988
- }
989
- }
990
- }
991
- }
992
- } else {
993
- return false;
994
- }
995
-
996
- return true;
997
- default:
998
- return false;
999
- }
1000
- }
1001
-
1002
- function isSymbol(propType, propValue) {
1003
- // Native Symbol.
1004
- if (propType === 'symbol') {
1005
- return true;
1006
- }
1007
-
1008
- // falsy value can't be a Symbol
1009
- if (!propValue) {
1010
- return false;
1011
- }
1012
-
1013
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1014
- if (propValue['@@toStringTag'] === 'Symbol') {
1015
- return true;
1016
- }
1017
-
1018
- // Fallback for non-spec compliant Symbols which are polyfilled.
1019
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1020
- return true;
1021
- }
1022
-
1023
- return false;
1024
- }
1025
-
1026
- // Equivalent of `typeof` but with special handling for array and regexp.
1027
- function getPropType(propValue) {
1028
- var propType = typeof propValue;
1029
- if (Array.isArray(propValue)) {
1030
- return 'array';
1031
- }
1032
- if (propValue instanceof RegExp) {
1033
- // Old webkits (at least until Android 4.0) return 'function' rather than
1034
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1035
- // passes PropTypes.object.
1036
- return 'object';
1037
- }
1038
- if (isSymbol(propType, propValue)) {
1039
- return 'symbol';
1040
- }
1041
- return propType;
1042
- }
1043
-
1044
- // This handles more types than `getPropType`. Only used for error messages.
1045
- // See `createPrimitiveTypeChecker`.
1046
- function getPreciseType(propValue) {
1047
- if (typeof propValue === 'undefined' || propValue === null) {
1048
- return '' + propValue;
1049
- }
1050
- var propType = getPropType(propValue);
1051
- if (propType === 'object') {
1052
- if (propValue instanceof Date) {
1053
- return 'date';
1054
- } else if (propValue instanceof RegExp) {
1055
- return 'regexp';
1056
- }
1057
- }
1058
- return propType;
1059
- }
1060
-
1061
- // Returns a string that is postfixed to a warning about an invalid type.
1062
- // For example, "undefined" or "of type array"
1063
- function getPostfixForTypeWarning(value) {
1064
- var type = getPreciseType(value);
1065
- switch (type) {
1066
- case 'array':
1067
- case 'object':
1068
- return 'an ' + type;
1069
- case 'boolean':
1070
- case 'date':
1071
- case 'regexp':
1072
- return 'a ' + type;
1073
- default:
1074
- return type;
1075
- }
1076
- }
1077
-
1078
- // Returns class name of the object, if any.
1079
- function getClassName(propValue) {
1080
- if (!propValue.constructor || !propValue.constructor.name) {
1081
- return ANONYMOUS;
1082
- }
1083
- return propValue.constructor.name;
1084
- }
1085
-
1086
- ReactPropTypes.checkPropTypes = checkPropTypes;
1087
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1088
- ReactPropTypes.PropTypes = ReactPropTypes;
1089
-
1090
- return ReactPropTypes;
1091
- };
1092
-
1093
- /**
1094
- * Copyright (c) 2013-present, Facebook, Inc.
1095
- *
1096
- * This source code is licensed under the MIT license found in the
1097
- * LICENSE file in the root directory of this source tree.
1098
- */
1099
-
1100
-
1101
-
1102
- function emptyFunction() {}
1103
- function emptyFunctionWithReset() {}
1104
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1105
-
1106
- var factoryWithThrowingShims = function() {
1107
- function shim(props, propName, componentName, location, propFullName, secret) {
1108
- if (secret === ReactPropTypesSecret$1) {
1109
- // It is still safe when called from React.
1110
- return;
1111
- }
1112
- var err = new Error(
1113
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1114
- 'Use PropTypes.checkPropTypes() to call them. ' +
1115
- 'Read more at http://fb.me/use-check-prop-types'
1116
- );
1117
- err.name = 'Invariant Violation';
1118
- throw err;
1119
- } shim.isRequired = shim;
1120
- function getShim() {
1121
- return shim;
1122
- } // Important!
1123
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1124
- var ReactPropTypes = {
1125
- array: shim,
1126
- bigint: shim,
1127
- bool: shim,
1128
- func: shim,
1129
- number: shim,
1130
- object: shim,
1131
- string: shim,
1132
- symbol: shim,
1133
-
1134
- any: shim,
1135
- arrayOf: getShim,
1136
- element: shim,
1137
- elementType: shim,
1138
- instanceOf: getShim,
1139
- node: shim,
1140
- objectOf: getShim,
1141
- oneOf: getShim,
1142
- oneOfType: getShim,
1143
- shape: getShim,
1144
- exact: getShim,
1145
-
1146
- checkPropTypes: emptyFunctionWithReset,
1147
- resetWarningCache: emptyFunction
1148
- };
1149
-
1150
- ReactPropTypes.PropTypes = ReactPropTypes;
1151
-
1152
- return ReactPropTypes;
1153
- };
1154
-
1155
- var require$$1 = factoryWithTypeCheckers;
1156
-
1157
- var require$$2 = factoryWithThrowingShims;
1158
-
1159
- /**
1160
- * Copyright (c) 2013-present, Facebook, Inc.
1161
- *
1162
- * This source code is licensed under the MIT license found in the
1163
- * LICENSE file in the root directory of this source tree.
1164
- */
1165
-
1166
- var propTypes = createCommonjsModule(function (module) {
1167
- if (process.env.NODE_ENV !== 'production') {
1168
- var ReactIs = reactIs;
1169
-
1170
- // By explicitly using `prop-types` you are opting into new development behavior.
1171
- // http://fb.me/prop-types-in-prod
1172
- var throwOnDirectAccess = true;
1173
- module.exports = require$$1(ReactIs.isElement, throwOnDirectAccess);
1174
- } else {
1175
- // By explicitly using `prop-types` you are opting into new production behavior.
1176
- // http://fb.me/prop-types-in-prod
1177
- module.exports = require$$2();
1178
- }
1179
- });
1180
-
1181
- var PropTypes = propTypes;
1182
-
1183
32
  const globalParams = {
1184
33
  type: 'default',
1185
34
  size: 'middle',
@@ -1214,9 +63,11 @@ const Form = forwardRef((originProps, ref) => {
1214
63
  const {
1215
64
  className,
1216
65
  cache,
1217
- enterSubmit,
1218
- scrollToError,
1219
- scrollProps,
66
+ enterSubmit = false,
67
+ scrollToError = true,
68
+ scrollProps = {
69
+ block: 'center'
70
+ },
1220
71
  children
1221
72
  } = originProps,
1222
73
  props = _objectWithoutPropertiesLoose(originProps, _excluded$4);
@@ -1254,25 +105,6 @@ const Form = forwardRef((originProps, ref) => {
1254
105
  scrollProps: scrollProps
1255
106
  }) : null, enterSubmit ? /*#__PURE__*/React.createElement(EnterSubmit, null, maxLabel) : maxLabel)));
1256
107
  });
1257
- Form.defaultProps = {
1258
- scrollToError: true,
1259
- enterSubmit: false,
1260
- scrollProps: {
1261
- block: 'center'
1262
- }
1263
- };
1264
- Form.propTypes = {
1265
- className: PropTypes.string,
1266
- type: PropTypes.oneOf(['inline', 'default', 'inner']),
1267
- size: PropTypes.oneOf(['small', 'middle', 'large']),
1268
- enterSubmit: PropTypes.bool,
1269
- scrollToError: PropTypes.bool,
1270
- scrollProps: PropTypes.shape({
1271
- block: PropTypes.oneOf(['start', 'center', 'end', 'nearest']),
1272
- behavior: PropTypes.oneOf(['auto', 'smooth']),
1273
- inline: PropTypes.oneOf(['start', 'center', 'end', 'nearest'])
1274
- })
1275
- };
1276
108
 
1277
109
  const {
1278
110
  useOnChange: useOnChange$b
@@ -1660,13 +492,13 @@ const ResetButton = props => {
1660
492
  return /*#__PURE__*/React.createElement(Button, _extends({}, resetProps, props));
1661
493
  };
1662
494
 
1663
- const _excluded$1 = ["realTime", "realtime", "disabled"],
495
+ const _excluded$1 = ["type", "realtime", "disabled"],
1664
496
  _excluded2 = ["isPass", "isLoading"];
1665
497
  const SubmitButton = _ref => {
1666
498
  let {
1667
- realTime,
499
+ type = 'primary',
1668
500
  realtime,
1669
- disabled
501
+ disabled = false
1670
502
  } = _ref,
1671
503
  props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1672
504
  const _useSubmit = useSubmit(props),
@@ -1675,19 +507,12 @@ const SubmitButton = _ref => {
1675
507
  isLoading
1676
508
  } = _useSubmit,
1677
509
  submitProps = _objectWithoutPropertiesLoose(_useSubmit, _excluded2);
1678
- if (typeof realTime === 'boolean') {
1679
- console.error(`warning: realTime参数已废弃,请使用realtime,后续版本可能回删除realTime的支持`);
1680
- }
1681
- // 如果传入 realtime 优先使用该属性
1682
510
  return /*#__PURE__*/React.createElement(Button, _extends({
511
+ type: type,
1683
512
  loading: isLoading,
1684
- disabled: disabled || ((typeof realtime === 'boolean' ? realtime : realTime) ? !isPass : false)
513
+ disabled: disabled || (realtime ? !isPass : false)
1685
514
  }, props, submitProps));
1686
515
  };
1687
- SubmitButton.defaultProps = {
1688
- type: 'primary',
1689
- disabled: false
1690
- };
1691
516
 
1692
517
  const _excluded = ["onClick"];
1693
518
  const {