@bolttech/form-engine 3.1.0-beta.5 → 3.1.0-beta.7
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/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createContext, useContext, useRef, useMemo, useState, useEffect, useCallback, Suspense } from 'react';
|
|
3
|
+
import { FormGroup, FormField, FormCore } from '@bolttech/form-engine-core';
|
|
4
4
|
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
6
|
|
|
7
|
-
var fails$
|
|
7
|
+
var fails$e = function (exec) {
|
|
8
8
|
try {
|
|
9
9
|
return !!exec();
|
|
10
10
|
} catch (error) {
|
|
@@ -12,9 +12,9 @@ var fails$h = function (exec) {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
var fails$
|
|
15
|
+
var fails$d = fails$e;
|
|
16
16
|
|
|
17
|
-
var functionBindNative = !fails$
|
|
17
|
+
var functionBindNative = !fails$d(function () {
|
|
18
18
|
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
19
19
|
var test = (function () { /* empty */ }).bind();
|
|
20
20
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
@@ -24,33 +24,33 @@ var functionBindNative = !fails$g(function () {
|
|
|
24
24
|
var NATIVE_BIND$1 = functionBindNative;
|
|
25
25
|
|
|
26
26
|
var FunctionPrototype$1 = Function.prototype;
|
|
27
|
-
var call$
|
|
28
|
-
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$
|
|
27
|
+
var call$7 = FunctionPrototype$1.call;
|
|
28
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$7, call$7);
|
|
29
29
|
|
|
30
30
|
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
31
31
|
return function () {
|
|
32
|
-
return call$
|
|
32
|
+
return call$7.apply(fn, arguments);
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
var uncurryThis$
|
|
36
|
+
var uncurryThis$e = functionUncurryThis;
|
|
37
37
|
|
|
38
|
-
var toString$
|
|
39
|
-
var stringSlice$
|
|
38
|
+
var toString$4 = uncurryThis$e({}.toString);
|
|
39
|
+
var stringSlice$2 = uncurryThis$e(''.slice);
|
|
40
40
|
|
|
41
41
|
var classofRaw$2 = function (it) {
|
|
42
|
-
return stringSlice$
|
|
42
|
+
return stringSlice$2(toString$4(it), 8, -1);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var uncurryThis$
|
|
46
|
-
var fails$
|
|
45
|
+
var uncurryThis$d = functionUncurryThis;
|
|
46
|
+
var fails$c = fails$e;
|
|
47
47
|
var classof$3 = classofRaw$2;
|
|
48
48
|
|
|
49
49
|
var $Object$4 = Object;
|
|
50
|
-
var split = uncurryThis$
|
|
50
|
+
var split = uncurryThis$d(''.split);
|
|
51
51
|
|
|
52
52
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
53
|
-
var indexedObject = fails$
|
|
53
|
+
var indexedObject = fails$c(function () {
|
|
54
54
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
55
55
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
56
56
|
return !$Object$4('z').propertyIsEnumerable(0);
|
|
@@ -88,7 +88,7 @@ var check = function (it) {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
91
|
-
var global$
|
|
91
|
+
var global$b =
|
|
92
92
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
93
93
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
94
94
|
check(typeof window == 'object' && window) ||
|
|
@@ -101,20 +101,20 @@ var global$e =
|
|
|
101
101
|
|
|
102
102
|
var sharedStore = {exports: {}};
|
|
103
103
|
|
|
104
|
-
var global$
|
|
104
|
+
var global$a = global$b;
|
|
105
105
|
|
|
106
106
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
107
107
|
var defineProperty$5 = Object.defineProperty;
|
|
108
108
|
|
|
109
109
|
var defineGlobalProperty$3 = function (key, value) {
|
|
110
110
|
try {
|
|
111
|
-
defineProperty$5(global$
|
|
111
|
+
defineProperty$5(global$a, key, { value: value, configurable: true, writable: true });
|
|
112
112
|
} catch (error) {
|
|
113
|
-
global$
|
|
113
|
+
global$a[key] = value;
|
|
114
114
|
} return value;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
var globalThis$1 = global$
|
|
117
|
+
var globalThis$1 = global$b;
|
|
118
118
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
119
119
|
|
|
120
120
|
var SHARED = '__core-js_shared__';
|
|
@@ -130,7 +130,7 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
130
130
|
|
|
131
131
|
var store$2 = sharedStore.exports;
|
|
132
132
|
|
|
133
|
-
var shared$
|
|
133
|
+
var shared$3 = function (key, value) {
|
|
134
134
|
return store$2[key] || (store$2[key] = value || {});
|
|
135
135
|
};
|
|
136
136
|
|
|
@@ -144,10 +144,10 @@ var toObject$4 = function (argument) {
|
|
|
144
144
|
return $Object$3(requireObjectCoercible$2(argument));
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
var uncurryThis$
|
|
147
|
+
var uncurryThis$c = functionUncurryThis;
|
|
148
148
|
var toObject$3 = toObject$4;
|
|
149
149
|
|
|
150
|
-
var hasOwnProperty = uncurryThis$
|
|
150
|
+
var hasOwnProperty = uncurryThis$c({}.hasOwnProperty);
|
|
151
151
|
|
|
152
152
|
// `HasOwnProperty` abstract operation
|
|
153
153
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
@@ -156,23 +156,23 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
|
156
156
|
return hasOwnProperty(toObject$3(it), key);
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
var uncurryThis$
|
|
159
|
+
var uncurryThis$b = functionUncurryThis;
|
|
160
160
|
|
|
161
161
|
var id = 0;
|
|
162
162
|
var postfix = Math.random();
|
|
163
|
-
var toString$
|
|
163
|
+
var toString$3 = uncurryThis$b(1.0.toString);
|
|
164
164
|
|
|
165
165
|
var uid$2 = function (key) {
|
|
166
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$
|
|
166
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
170
170
|
|
|
171
|
-
var global$
|
|
171
|
+
var global$9 = global$b;
|
|
172
172
|
var userAgent$2 = engineUserAgent;
|
|
173
173
|
|
|
174
|
-
var process = global$
|
|
175
|
-
var Deno = global$
|
|
174
|
+
var process = global$9.process;
|
|
175
|
+
var Deno = global$9.Deno;
|
|
176
176
|
var versions = process && process.versions || Deno && Deno.version;
|
|
177
177
|
var v8 = versions && versions.v8;
|
|
178
178
|
var match, version;
|
|
@@ -198,13 +198,13 @@ var engineV8Version = version;
|
|
|
198
198
|
|
|
199
199
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
200
200
|
var V8_VERSION = engineV8Version;
|
|
201
|
-
var fails$
|
|
202
|
-
var global$
|
|
201
|
+
var fails$b = fails$e;
|
|
202
|
+
var global$8 = global$b;
|
|
203
203
|
|
|
204
|
-
var $String$5 = global$
|
|
204
|
+
var $String$5 = global$8.String;
|
|
205
205
|
|
|
206
206
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
207
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$
|
|
207
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$b(function () {
|
|
208
208
|
var symbol = Symbol('symbol detection');
|
|
209
209
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
210
210
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -222,15 +222,15 @@ var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
|
222
222
|
&& !Symbol.sham
|
|
223
223
|
&& typeof Symbol.iterator == 'symbol';
|
|
224
224
|
|
|
225
|
-
var global$
|
|
226
|
-
var shared$
|
|
225
|
+
var global$7 = global$b;
|
|
226
|
+
var shared$2 = shared$3;
|
|
227
227
|
var hasOwn$9 = hasOwnProperty_1;
|
|
228
228
|
var uid$1 = uid$2;
|
|
229
229
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
230
230
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
231
231
|
|
|
232
|
-
var Symbol$1 = global$
|
|
233
|
-
var WellKnownSymbolsStore = shared$
|
|
232
|
+
var Symbol$1 = global$7.Symbol;
|
|
233
|
+
var WellKnownSymbolsStore = shared$2('wks');
|
|
234
234
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
235
235
|
|
|
236
236
|
var wellKnownSymbol$a = function (name) {
|
|
@@ -272,20 +272,20 @@ var anObject$6 = function (argument) {
|
|
|
272
272
|
|
|
273
273
|
var objectDefineProperties = {};
|
|
274
274
|
|
|
275
|
-
var fails$
|
|
275
|
+
var fails$a = fails$e;
|
|
276
276
|
|
|
277
277
|
// Detect IE8's incomplete defineProperty implementation
|
|
278
|
-
var descriptors = !fails$
|
|
278
|
+
var descriptors = !fails$a(function () {
|
|
279
279
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
280
280
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
281
281
|
});
|
|
282
282
|
|
|
283
283
|
var DESCRIPTORS$9 = descriptors;
|
|
284
|
-
var fails$
|
|
284
|
+
var fails$9 = fails$e;
|
|
285
285
|
|
|
286
286
|
// V8 ~ Chrome 36-
|
|
287
287
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
288
|
-
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$
|
|
288
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$9(function () {
|
|
289
289
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
290
290
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
291
291
|
value: 42,
|
|
@@ -295,10 +295,10 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$c(function () {
|
|
|
295
295
|
|
|
296
296
|
var objectDefineProperty = {};
|
|
297
297
|
|
|
298
|
-
var global$
|
|
298
|
+
var global$6 = global$b;
|
|
299
299
|
var isObject$7 = isObject$9;
|
|
300
300
|
|
|
301
|
-
var document$1 = global$
|
|
301
|
+
var document$1 = global$6.document;
|
|
302
302
|
// typeof document.createElement is 'object' in old IE
|
|
303
303
|
var EXISTS$1 = isObject$7(document$1) && isObject$7(document$1.createElement);
|
|
304
304
|
|
|
@@ -307,11 +307,11 @@ var documentCreateElement$2 = function (it) {
|
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
var DESCRIPTORS$8 = descriptors;
|
|
310
|
-
var fails$
|
|
310
|
+
var fails$8 = fails$e;
|
|
311
311
|
var createElement = documentCreateElement$2;
|
|
312
312
|
|
|
313
313
|
// Thanks to IE8 for its funny defineProperty
|
|
314
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$
|
|
314
|
+
var ie8DomDefine = !DESCRIPTORS$8 && !fails$8(function () {
|
|
315
315
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
316
316
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
317
317
|
get: function () { return 7; }
|
|
@@ -320,13 +320,13 @@ var ie8DomDefine = !DESCRIPTORS$8 && !fails$b(function () {
|
|
|
320
320
|
|
|
321
321
|
var NATIVE_BIND = functionBindNative;
|
|
322
322
|
|
|
323
|
-
var call$
|
|
323
|
+
var call$6 = Function.prototype.call;
|
|
324
324
|
|
|
325
|
-
var functionCall = NATIVE_BIND ? call$
|
|
326
|
-
return call$
|
|
325
|
+
var functionCall = NATIVE_BIND ? call$6.bind(call$6) : function () {
|
|
326
|
+
return call$6.apply(call$6, arguments);
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
var global$
|
|
329
|
+
var global$5 = global$b;
|
|
330
330
|
var isCallable$c = isCallable$e;
|
|
331
331
|
|
|
332
332
|
var aFunction = function (argument) {
|
|
@@ -334,12 +334,12 @@ var aFunction = function (argument) {
|
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
var getBuiltIn$3 = function (namespace, method) {
|
|
337
|
-
return arguments.length < 2 ? aFunction(global$
|
|
337
|
+
return arguments.length < 2 ? aFunction(global$5[namespace]) : global$5[namespace] && global$5[namespace][method];
|
|
338
338
|
};
|
|
339
339
|
|
|
340
|
-
var uncurryThis$
|
|
340
|
+
var uncurryThis$a = functionUncurryThis;
|
|
341
341
|
|
|
342
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
342
|
+
var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
|
|
343
343
|
|
|
344
344
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
345
345
|
var isCallable$b = isCallable$e;
|
|
@@ -386,7 +386,7 @@ var getMethod$1 = function (V, P) {
|
|
|
386
386
|
return isNullOrUndefined(func) ? undefined : aCallable$2(func);
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
-
var call$
|
|
389
|
+
var call$5 = functionCall;
|
|
390
390
|
var isCallable$9 = isCallable$e;
|
|
391
391
|
var isObject$6 = isObject$9;
|
|
392
392
|
|
|
@@ -396,13 +396,13 @@ var $TypeError$5 = TypeError;
|
|
|
396
396
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
397
397
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
398
398
|
var fn, val;
|
|
399
|
-
if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$
|
|
400
|
-
if (isCallable$9(fn = input.valueOf) && !isObject$6(val = call$
|
|
401
|
-
if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$
|
|
399
|
+
if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$5(fn, input))) return val;
|
|
400
|
+
if (isCallable$9(fn = input.valueOf) && !isObject$6(val = call$5(fn, input))) return val;
|
|
401
|
+
if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$5(fn, input))) return val;
|
|
402
402
|
throw new $TypeError$5("Can't convert object to primitive value");
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
-
var call$
|
|
405
|
+
var call$4 = functionCall;
|
|
406
406
|
var isObject$5 = isObject$9;
|
|
407
407
|
var isSymbol$1 = isSymbol$2;
|
|
408
408
|
var getMethod = getMethod$1;
|
|
@@ -420,7 +420,7 @@ var toPrimitive$1 = function (input, pref) {
|
|
|
420
420
|
var result;
|
|
421
421
|
if (exoticToPrim) {
|
|
422
422
|
if (pref === undefined) pref = 'default';
|
|
423
|
-
result = call$
|
|
423
|
+
result = call$4(exoticToPrim, input, pref);
|
|
424
424
|
if (!isObject$5(result) || isSymbol$1(result)) return result;
|
|
425
425
|
throw new $TypeError$4("Can't convert object to primitive value");
|
|
426
426
|
}
|
|
@@ -571,13 +571,13 @@ var arrayIncludes = {
|
|
|
571
571
|
|
|
572
572
|
var hiddenKeys$4 = {};
|
|
573
573
|
|
|
574
|
-
var uncurryThis$
|
|
574
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
575
575
|
var hasOwn$8 = hasOwnProperty_1;
|
|
576
576
|
var toIndexedObject$3 = toIndexedObject$5;
|
|
577
|
-
var indexOf
|
|
577
|
+
var indexOf = arrayIncludes.indexOf;
|
|
578
578
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
579
579
|
|
|
580
|
-
var push$1 = uncurryThis$
|
|
580
|
+
var push$1 = uncurryThis$9([].push);
|
|
581
581
|
|
|
582
582
|
var objectKeysInternal = function (object, names) {
|
|
583
583
|
var O = toIndexedObject$3(object);
|
|
@@ -587,7 +587,7 @@ var objectKeysInternal = function (object, names) {
|
|
|
587
587
|
for (key in O) !hasOwn$8(hiddenKeys$3, key) && hasOwn$8(O, key) && push$1(result, key);
|
|
588
588
|
// Don't enum bug & hidden keys
|
|
589
589
|
while (names.length > i) if (hasOwn$8(O, key = names[i++])) {
|
|
590
|
-
~indexOf
|
|
590
|
+
~indexOf(result, key) || push$1(result, key);
|
|
591
591
|
}
|
|
592
592
|
return result;
|
|
593
593
|
};
|
|
@@ -638,10 +638,10 @@ var getBuiltIn$1 = getBuiltIn$3;
|
|
|
638
638
|
|
|
639
639
|
var html$1 = getBuiltIn$1('document', 'documentElement');
|
|
640
640
|
|
|
641
|
-
var shared$
|
|
641
|
+
var shared$1 = shared$3;
|
|
642
642
|
var uid = uid$2;
|
|
643
643
|
|
|
644
|
-
var keys = shared$
|
|
644
|
+
var keys = shared$1('keys');
|
|
645
645
|
|
|
646
646
|
var sharedKey$3 = function (key) {
|
|
647
647
|
return keys[key] || (keys[key] = uid(key));
|
|
@@ -732,7 +732,7 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
732
732
|
};
|
|
733
733
|
|
|
734
734
|
var wellKnownSymbol$8 = wellKnownSymbol$a;
|
|
735
|
-
var create$
|
|
735
|
+
var create$1 = objectCreate;
|
|
736
736
|
var defineProperty$4 = objectDefineProperty.f;
|
|
737
737
|
|
|
738
738
|
var UNSCOPABLES = wellKnownSymbol$8('unscopables');
|
|
@@ -743,7 +743,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
743
743
|
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
744
744
|
defineProperty$4(ArrayPrototype, UNSCOPABLES, {
|
|
745
745
|
configurable: true,
|
|
746
|
-
value: create$
|
|
746
|
+
value: create$1(null)
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
|
|
@@ -754,10 +754,10 @@ var addToUnscopables$1 = function (key) {
|
|
|
754
754
|
|
|
755
755
|
var iterators = {};
|
|
756
756
|
|
|
757
|
-
var global$
|
|
757
|
+
var global$4 = global$b;
|
|
758
758
|
var isCallable$8 = isCallable$e;
|
|
759
759
|
|
|
760
|
-
var WeakMap$1 = global$
|
|
760
|
+
var WeakMap$1 = global$4.WeakMap;
|
|
761
761
|
|
|
762
762
|
var weakMapBasicDetection = isCallable$8(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
763
763
|
|
|
@@ -782,17 +782,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
|
|
|
782
782
|
};
|
|
783
783
|
|
|
784
784
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
785
|
-
var global$
|
|
785
|
+
var global$3 = global$b;
|
|
786
786
|
var isObject$4 = isObject$9;
|
|
787
787
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
788
788
|
var hasOwn$7 = hasOwnProperty_1;
|
|
789
|
-
var shared
|
|
789
|
+
var shared = sharedStore.exports;
|
|
790
790
|
var sharedKey$1 = sharedKey$3;
|
|
791
791
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
792
792
|
|
|
793
793
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
794
|
-
var TypeError$1 = global$
|
|
795
|
-
var WeakMap = global$
|
|
794
|
+
var TypeError$1 = global$3.TypeError;
|
|
795
|
+
var WeakMap = global$3.WeakMap;
|
|
796
796
|
var set, get, has;
|
|
797
797
|
|
|
798
798
|
var enforce = function (it) {
|
|
@@ -808,8 +808,8 @@ var getterFor = function (TYPE) {
|
|
|
808
808
|
};
|
|
809
809
|
};
|
|
810
810
|
|
|
811
|
-
if (NATIVE_WEAK_MAP || shared
|
|
812
|
-
var store$1 = shared
|
|
811
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
812
|
+
var store$1 = shared.state || (shared.state = new WeakMap());
|
|
813
813
|
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
814
814
|
store$1.get = store$1.get;
|
|
815
815
|
store$1.has = store$1.has;
|
|
@@ -871,7 +871,7 @@ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
|
871
871
|
} : $propertyIsEnumerable;
|
|
872
872
|
|
|
873
873
|
var DESCRIPTORS$4 = descriptors;
|
|
874
|
-
var call$
|
|
874
|
+
var call$3 = functionCall;
|
|
875
875
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
876
876
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
877
877
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
@@ -890,7 +890,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
890
890
|
if (IE8_DOM_DEFINE) try {
|
|
891
891
|
return $getOwnPropertyDescriptor(O, P);
|
|
892
892
|
} catch (error) { /* empty */ }
|
|
893
|
-
if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call$
|
|
893
|
+
if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call$3(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
894
894
|
};
|
|
895
895
|
|
|
896
896
|
var makeBuiltIn$2 = {exports: {}};
|
|
@@ -913,11 +913,11 @@ var functionName = {
|
|
|
913
913
|
CONFIGURABLE: CONFIGURABLE
|
|
914
914
|
};
|
|
915
915
|
|
|
916
|
-
var uncurryThis$
|
|
916
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
917
917
|
var isCallable$7 = isCallable$e;
|
|
918
918
|
var store = sharedStore.exports;
|
|
919
919
|
|
|
920
|
-
var functionToString = uncurryThis$
|
|
920
|
+
var functionToString = uncurryThis$8(Function.toString);
|
|
921
921
|
|
|
922
922
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
923
923
|
if (!isCallable$7(store.inspectSource)) {
|
|
@@ -928,8 +928,8 @@ if (!isCallable$7(store.inspectSource)) {
|
|
|
928
928
|
|
|
929
929
|
var inspectSource$1 = store.inspectSource;
|
|
930
930
|
|
|
931
|
-
var uncurryThis$
|
|
932
|
-
var fails$
|
|
931
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
932
|
+
var fails$7 = fails$e;
|
|
933
933
|
var isCallable$6 = isCallable$e;
|
|
934
934
|
var hasOwn$4 = hasOwnProperty_1;
|
|
935
935
|
var DESCRIPTORS$2 = descriptors;
|
|
@@ -938,23 +938,23 @@ var inspectSource = inspectSource$1;
|
|
|
938
938
|
var InternalStateModule$1 = internalState;
|
|
939
939
|
|
|
940
940
|
var enforceInternalState = InternalStateModule$1.enforce;
|
|
941
|
-
var getInternalState$
|
|
941
|
+
var getInternalState$1 = InternalStateModule$1.get;
|
|
942
942
|
var $String$2 = String;
|
|
943
943
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
944
944
|
var defineProperty$3 = Object.defineProperty;
|
|
945
|
-
var stringSlice$
|
|
946
|
-
var replace
|
|
947
|
-
var join = uncurryThis$
|
|
945
|
+
var stringSlice$1 = uncurryThis$7(''.slice);
|
|
946
|
+
var replace = uncurryThis$7(''.replace);
|
|
947
|
+
var join = uncurryThis$7([].join);
|
|
948
948
|
|
|
949
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$
|
|
949
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$7(function () {
|
|
950
950
|
return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
951
951
|
});
|
|
952
952
|
|
|
953
953
|
var TEMPLATE = String(String).split('String');
|
|
954
954
|
|
|
955
955
|
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
956
|
-
if (stringSlice$
|
|
957
|
-
name = '[' + replace
|
|
956
|
+
if (stringSlice$1($String$2(name), 0, 7) === 'Symbol(') {
|
|
957
|
+
name = '[' + replace($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
958
958
|
}
|
|
959
959
|
if (options && options.getter) name = 'get ' + name;
|
|
960
960
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -980,7 +980,7 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
980
980
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
981
981
|
// eslint-disable-next-line no-extend-native -- required
|
|
982
982
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
983
|
-
return isCallable$6(this) && getInternalState$
|
|
983
|
+
return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
|
|
984
984
|
}, 'toString');
|
|
985
985
|
|
|
986
986
|
var isCallable$5 = isCallable$e;
|
|
@@ -1031,12 +1031,12 @@ var objectGetOwnPropertySymbols = {};
|
|
|
1031
1031
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1032
1032
|
|
|
1033
1033
|
var getBuiltIn = getBuiltIn$3;
|
|
1034
|
-
var uncurryThis$
|
|
1034
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
1035
1035
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1036
1036
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1037
1037
|
var anObject$2 = anObject$6;
|
|
1038
1038
|
|
|
1039
|
-
var concat$1 = uncurryThis$
|
|
1039
|
+
var concat$1 = uncurryThis$6([].concat);
|
|
1040
1040
|
|
|
1041
1041
|
// all object keys, includes non-enumerable and symbols
|
|
1042
1042
|
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -1062,7 +1062,7 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
};
|
|
1064
1064
|
|
|
1065
|
-
var fails$
|
|
1065
|
+
var fails$6 = fails$e;
|
|
1066
1066
|
var isCallable$4 = isCallable$e;
|
|
1067
1067
|
|
|
1068
1068
|
var replacement = /#|\.prototype\./;
|
|
@@ -1071,7 +1071,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
1071
1071
|
var value = data[normalize(feature)];
|
|
1072
1072
|
return value === POLYFILL ? true
|
|
1073
1073
|
: value === NATIVE ? false
|
|
1074
|
-
: isCallable$4(detection) ? fails$
|
|
1074
|
+
: isCallable$4(detection) ? fails$6(detection)
|
|
1075
1075
|
: !!detection;
|
|
1076
1076
|
};
|
|
1077
1077
|
|
|
@@ -1085,7 +1085,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
1085
1085
|
|
|
1086
1086
|
var isForced_1 = isForced$1;
|
|
1087
1087
|
|
|
1088
|
-
var global$
|
|
1088
|
+
var global$2 = global$b;
|
|
1089
1089
|
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
1090
1090
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
1091
1091
|
var defineBuiltIn$3 = defineBuiltIn$4;
|
|
@@ -1114,11 +1114,11 @@ var _export = function (options, source) {
|
|
|
1114
1114
|
var STATIC = options.stat;
|
|
1115
1115
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1116
1116
|
if (GLOBAL) {
|
|
1117
|
-
target = global$
|
|
1117
|
+
target = global$2;
|
|
1118
1118
|
} else if (STATIC) {
|
|
1119
|
-
target = global$
|
|
1119
|
+
target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1120
1120
|
} else {
|
|
1121
|
-
target = global$
|
|
1121
|
+
target = global$2[TARGET] && global$2[TARGET].prototype;
|
|
1122
1122
|
}
|
|
1123
1123
|
if (target) for (key in source) {
|
|
1124
1124
|
sourceProperty = source[key];
|
|
@@ -1140,9 +1140,9 @@ var _export = function (options, source) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
};
|
|
1142
1142
|
|
|
1143
|
-
var fails$
|
|
1143
|
+
var fails$5 = fails$e;
|
|
1144
1144
|
|
|
1145
|
-
var correctPrototypeGetter = !fails$
|
|
1145
|
+
var correctPrototypeGetter = !fails$5(function () {
|
|
1146
1146
|
function F() { /* empty */ }
|
|
1147
1147
|
F.prototype.constructor = null;
|
|
1148
1148
|
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
@@ -1171,7 +1171,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
|
|
|
1171
1171
|
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1172
1172
|
};
|
|
1173
1173
|
|
|
1174
|
-
var fails$
|
|
1174
|
+
var fails$4 = fails$e;
|
|
1175
1175
|
var isCallable$2 = isCallable$e;
|
|
1176
1176
|
var isObject$3 = isObject$9;
|
|
1177
1177
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
@@ -1196,7 +1196,7 @@ if ([].keys) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$
|
|
1199
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$4(function () {
|
|
1200
1200
|
var test = {};
|
|
1201
1201
|
// FF44- legacy iterators case
|
|
1202
1202
|
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
@@ -1231,7 +1231,7 @@ var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
|
1231
1231
|
};
|
|
1232
1232
|
|
|
1233
1233
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1234
|
-
var create
|
|
1234
|
+
var create = objectCreate;
|
|
1235
1235
|
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1236
1236
|
var setToStringTag$2 = setToStringTag$3;
|
|
1237
1237
|
var Iterators$2 = iterators;
|
|
@@ -1240,19 +1240,19 @@ var returnThis$1 = function () { return this; };
|
|
|
1240
1240
|
|
|
1241
1241
|
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1242
1242
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1243
|
-
IteratorConstructor.prototype = create
|
|
1243
|
+
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1244
1244
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1245
1245
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1246
1246
|
return IteratorConstructor;
|
|
1247
1247
|
};
|
|
1248
1248
|
|
|
1249
|
-
var uncurryThis$
|
|
1249
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
1250
1250
|
var aCallable$1 = aCallable$3;
|
|
1251
1251
|
|
|
1252
1252
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1253
1253
|
try {
|
|
1254
1254
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1255
|
-
return uncurryThis$
|
|
1255
|
+
return uncurryThis$5(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1256
1256
|
} catch (error) { /* empty */ }
|
|
1257
1257
|
};
|
|
1258
1258
|
|
|
@@ -1301,8 +1301,8 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1301
1301
|
};
|
|
1302
1302
|
}() : undefined);
|
|
1303
1303
|
|
|
1304
|
-
var $$
|
|
1305
|
-
var call$
|
|
1304
|
+
var $$3 = _export;
|
|
1305
|
+
var call$2 = functionCall;
|
|
1306
1306
|
var FunctionName = functionName;
|
|
1307
1307
|
var isCallable$1 = isCallable$e;
|
|
1308
1308
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
@@ -1374,7 +1374,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1374
1374
|
createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
|
1375
1375
|
} else {
|
|
1376
1376
|
INCORRECT_VALUES_NAME = true;
|
|
1377
|
-
defaultIterator = function values() { return call$
|
|
1377
|
+
defaultIterator = function values() { return call$2(nativeIterator, this); };
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
@@ -1389,7 +1389,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1389
1389
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1390
1390
|
defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
|
|
1391
1391
|
}
|
|
1392
|
-
} else $$
|
|
1392
|
+
} else $$3({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1393
1393
|
}
|
|
1394
1394
|
|
|
1395
1395
|
// define iterator
|
|
@@ -1418,7 +1418,7 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
1418
1418
|
|
|
1419
1419
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1420
1420
|
var setInternalState = InternalStateModule.set;
|
|
1421
|
-
var getInternalState
|
|
1421
|
+
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1422
1422
|
|
|
1423
1423
|
// `Array.prototype.entries` method
|
|
1424
1424
|
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
@@ -1440,7 +1440,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1440
1440
|
// `%ArrayIteratorPrototype%.next` method
|
|
1441
1441
|
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1442
1442
|
}, function () {
|
|
1443
|
-
var state = getInternalState
|
|
1443
|
+
var state = getInternalState(this);
|
|
1444
1444
|
var target = state.target;
|
|
1445
1445
|
var index = state.index++;
|
|
1446
1446
|
if (!target || index >= target.length) {
|
|
@@ -1512,7 +1512,7 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1512
1512
|
|
|
1513
1513
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1514
1514
|
|
|
1515
|
-
var global$
|
|
1515
|
+
var global$1 = global$b;
|
|
1516
1516
|
var DOMIterables = domIterables;
|
|
1517
1517
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1518
1518
|
var ArrayIteratorMethods = es_array_iterator;
|
|
@@ -1544,7 +1544,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1544
1544
|
};
|
|
1545
1545
|
|
|
1546
1546
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1547
|
-
handlePrototype(global$
|
|
1547
|
+
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
1550
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
@@ -1600,14 +1600,14 @@ var classof$1 = classof$2;
|
|
|
1600
1600
|
|
|
1601
1601
|
var $String = String;
|
|
1602
1602
|
|
|
1603
|
-
var toString$
|
|
1603
|
+
var toString$2 = function (argument) {
|
|
1604
1604
|
if (classof$1(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1605
1605
|
return $String(argument);
|
|
1606
1606
|
};
|
|
1607
1607
|
|
|
1608
|
-
var uncurryThis$
|
|
1608
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
1609
1609
|
|
|
1610
|
-
var arraySlice$1 = uncurryThis$
|
|
1610
|
+
var arraySlice$1 = uncurryThis$4([].slice);
|
|
1611
1611
|
|
|
1612
1612
|
var arraySlice = arraySlice$1;
|
|
1613
1613
|
|
|
@@ -1651,11 +1651,11 @@ var sort = function (array, comparefn) {
|
|
|
1651
1651
|
|
|
1652
1652
|
var arraySort = sort;
|
|
1653
1653
|
|
|
1654
|
-
var fails$
|
|
1654
|
+
var fails$3 = fails$e;
|
|
1655
1655
|
|
|
1656
1656
|
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
1657
1657
|
var method = [][METHOD_NAME];
|
|
1658
|
-
return !!method && fails$
|
|
1658
|
+
return !!method && fails$3(function () {
|
|
1659
1659
|
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1660
1660
|
method.call(null, argument || function () { return 1; }, 1);
|
|
1661
1661
|
});
|
|
@@ -1677,14 +1677,14 @@ var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
|
|
1677
1677
|
|
|
1678
1678
|
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
1679
1679
|
|
|
1680
|
-
var $$
|
|
1681
|
-
var uncurryThis$
|
|
1680
|
+
var $$2 = _export;
|
|
1681
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
1682
1682
|
var aCallable = aCallable$3;
|
|
1683
1683
|
var toObject$1 = toObject$4;
|
|
1684
1684
|
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
1685
1685
|
var deletePropertyOrThrow = deletePropertyOrThrow$1;
|
|
1686
|
-
var toString$
|
|
1687
|
-
var fails$
|
|
1686
|
+
var toString$1 = toString$2;
|
|
1687
|
+
var fails$2 = fails$e;
|
|
1688
1688
|
var internalSort = arraySort;
|
|
1689
1689
|
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
1690
1690
|
var FF = engineFfVersion;
|
|
@@ -1693,21 +1693,21 @@ var V8 = engineV8Version;
|
|
|
1693
1693
|
var WEBKIT = engineWebkitVersion;
|
|
1694
1694
|
|
|
1695
1695
|
var test = [];
|
|
1696
|
-
var nativeSort = uncurryThis$
|
|
1697
|
-
var push = uncurryThis$
|
|
1696
|
+
var nativeSort = uncurryThis$3(test.sort);
|
|
1697
|
+
var push = uncurryThis$3(test.push);
|
|
1698
1698
|
|
|
1699
1699
|
// IE8-
|
|
1700
|
-
var FAILS_ON_UNDEFINED = fails$
|
|
1700
|
+
var FAILS_ON_UNDEFINED = fails$2(function () {
|
|
1701
1701
|
test.sort(undefined);
|
|
1702
1702
|
});
|
|
1703
1703
|
// V8 bug
|
|
1704
|
-
var FAILS_ON_NULL = fails$
|
|
1704
|
+
var FAILS_ON_NULL = fails$2(function () {
|
|
1705
1705
|
test.sort(null);
|
|
1706
1706
|
});
|
|
1707
1707
|
// Old WebKit
|
|
1708
1708
|
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
1709
1709
|
|
|
1710
|
-
var STABLE_SORT = !fails$
|
|
1710
|
+
var STABLE_SORT = !fails$2(function () {
|
|
1711
1711
|
// feature detection can be too slow, so check engines versions
|
|
1712
1712
|
if (V8) return V8 < 70;
|
|
1713
1713
|
if (FF && FF > 3) return;
|
|
@@ -1749,13 +1749,13 @@ var getSortCompare = function (comparefn) {
|
|
|
1749
1749
|
if (y === undefined) return -1;
|
|
1750
1750
|
if (x === undefined) return 1;
|
|
1751
1751
|
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
1752
|
-
return toString$
|
|
1752
|
+
return toString$1(x) > toString$1(y) ? 1 : -1;
|
|
1753
1753
|
};
|
|
1754
1754
|
};
|
|
1755
1755
|
|
|
1756
1756
|
// `Array.prototype.sort` method
|
|
1757
1757
|
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
1758
|
-
$$
|
|
1758
|
+
$$2({ target: 'Array', proto: true, forced: FORCED }, {
|
|
1759
1759
|
sort: function sort(comparefn) {
|
|
1760
1760
|
if (comparefn !== undefined) aCallable(comparefn);
|
|
1761
1761
|
|
|
@@ -1784,9 +1784,9 @@ $$3({ target: 'Array', proto: true, forced: FORCED }, {
|
|
|
1784
1784
|
});
|
|
1785
1785
|
|
|
1786
1786
|
var DESCRIPTORS = descriptors;
|
|
1787
|
-
var uncurryThis$
|
|
1788
|
-
var call$
|
|
1789
|
-
var fails$
|
|
1787
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1788
|
+
var call$1 = functionCall;
|
|
1789
|
+
var fails$1 = fails$e;
|
|
1790
1790
|
var objectKeys = objectKeys$2;
|
|
1791
1791
|
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1792
1792
|
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
@@ -1797,11 +1797,11 @@ var IndexedObject = indexedObject;
|
|
|
1797
1797
|
var $assign = Object.assign;
|
|
1798
1798
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1799
1799
|
var defineProperty = Object.defineProperty;
|
|
1800
|
-
var concat = uncurryThis$
|
|
1800
|
+
var concat = uncurryThis$2([].concat);
|
|
1801
1801
|
|
|
1802
1802
|
// `Object.assign` method
|
|
1803
1803
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1804
|
-
var objectAssign = !$assign || fails$
|
|
1804
|
+
var objectAssign = !$assign || fails$1(function () {
|
|
1805
1805
|
// should have correct order of operations (Edge bug)
|
|
1806
1806
|
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1807
1807
|
enumerable: true,
|
|
@@ -1835,18 +1835,18 @@ var objectAssign = !$assign || fails$4(function () {
|
|
|
1835
1835
|
var key;
|
|
1836
1836
|
while (length > j) {
|
|
1837
1837
|
key = keys[j++];
|
|
1838
|
-
if (!DESCRIPTORS || call$
|
|
1838
|
+
if (!DESCRIPTORS || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1839
1839
|
}
|
|
1840
1840
|
} return T;
|
|
1841
1841
|
} : $assign;
|
|
1842
1842
|
|
|
1843
|
-
var $$
|
|
1843
|
+
var $$1 = _export;
|
|
1844
1844
|
var assign = objectAssign;
|
|
1845
1845
|
|
|
1846
1846
|
// `Object.assign` method
|
|
1847
1847
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1848
1848
|
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1849
|
-
$$
|
|
1849
|
+
$$1({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1850
1850
|
assign: assign
|
|
1851
1851
|
});
|
|
1852
1852
|
|
|
@@ -1854,7 +1854,7 @@ var anObject$1 = anObject$6;
|
|
|
1854
1854
|
|
|
1855
1855
|
// `RegExp.prototype.flags` getter implementation
|
|
1856
1856
|
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1857
|
-
var regexpFlags
|
|
1857
|
+
var regexpFlags = function () {
|
|
1858
1858
|
var that = anObject$1(this);
|
|
1859
1859
|
var result = '';
|
|
1860
1860
|
if (that.hasIndices) result += 'd';
|
|
@@ -1868,31 +1868,31 @@ var regexpFlags$1 = function () {
|
|
|
1868
1868
|
return result;
|
|
1869
1869
|
};
|
|
1870
1870
|
|
|
1871
|
-
var call
|
|
1871
|
+
var call = functionCall;
|
|
1872
1872
|
var hasOwn = hasOwnProperty_1;
|
|
1873
1873
|
var isPrototypeOf = objectIsPrototypeOf;
|
|
1874
|
-
var regExpFlags = regexpFlags
|
|
1874
|
+
var regExpFlags = regexpFlags;
|
|
1875
1875
|
|
|
1876
1876
|
var RegExpPrototype$1 = RegExp.prototype;
|
|
1877
1877
|
|
|
1878
1878
|
var regexpGetFlags = function (R) {
|
|
1879
1879
|
var flags = R.flags;
|
|
1880
1880
|
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
|
|
1881
|
-
? call
|
|
1881
|
+
? call(regExpFlags, R) : flags;
|
|
1882
1882
|
};
|
|
1883
1883
|
|
|
1884
1884
|
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
1885
1885
|
var defineBuiltIn = defineBuiltIn$4;
|
|
1886
1886
|
var anObject = anObject$6;
|
|
1887
|
-
var $toString = toString$
|
|
1888
|
-
var fails
|
|
1887
|
+
var $toString = toString$2;
|
|
1888
|
+
var fails = fails$e;
|
|
1889
1889
|
var getRegExpFlags = regexpGetFlags;
|
|
1890
1890
|
|
|
1891
1891
|
var TO_STRING = 'toString';
|
|
1892
1892
|
var RegExpPrototype = RegExp.prototype;
|
|
1893
1893
|
var nativeToString = RegExpPrototype[TO_STRING];
|
|
1894
1894
|
|
|
1895
|
-
var NOT_GENERIC = fails
|
|
1895
|
+
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
1896
1896
|
// FF44- RegExp#toString has a wrong name
|
|
1897
1897
|
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
|
|
1898
1898
|
|
|
@@ -1908,13 +1908,13 @@ if (NOT_GENERIC || INCORRECT_NAME) {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
|
|
1910
1910
|
var classofRaw = classofRaw$2;
|
|
1911
|
-
var uncurryThis$
|
|
1911
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1912
1912
|
|
|
1913
1913
|
var functionUncurryThisClause = function (fn) {
|
|
1914
1914
|
// Nashorn bug:
|
|
1915
1915
|
// https://github.com/zloirock/core-js/issues/1128
|
|
1916
1916
|
// https://github.com/zloirock/core-js/issues/1130
|
|
1917
|
-
if (classofRaw(fn) === 'Function') return uncurryThis$
|
|
1917
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$1(fn);
|
|
1918
1918
|
};
|
|
1919
1919
|
|
|
1920
1920
|
var isObject = isObject$9;
|
|
@@ -1956,16 +1956,16 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
|
1956
1956
|
} return false;
|
|
1957
1957
|
};
|
|
1958
1958
|
|
|
1959
|
-
var
|
|
1960
|
-
var uncurryThis
|
|
1959
|
+
var $ = _export;
|
|
1960
|
+
var uncurryThis = functionUncurryThisClause;
|
|
1961
1961
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1962
1962
|
var toLength = toLength$2;
|
|
1963
|
-
var toString
|
|
1963
|
+
var toString = toString$2;
|
|
1964
1964
|
var notARegExp = notARegexp;
|
|
1965
1965
|
var requireObjectCoercible = requireObjectCoercible$4;
|
|
1966
1966
|
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
1967
1967
|
|
|
1968
|
-
var stringSlice
|
|
1968
|
+
var stringSlice = uncurryThis(''.slice);
|
|
1969
1969
|
var min = Math.min;
|
|
1970
1970
|
|
|
1971
1971
|
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
|
@@ -1977,196 +1977,16 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
|
1977
1977
|
|
|
1978
1978
|
// `String.prototype.startsWith` method
|
|
1979
1979
|
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
1980
|
-
|
|
1980
|
+
$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
1981
1981
|
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
1982
|
-
var that = toString
|
|
1982
|
+
var that = toString(requireObjectCoercible(this));
|
|
1983
1983
|
notARegExp(searchString);
|
|
1984
1984
|
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
1985
|
-
var search = toString
|
|
1986
|
-
return stringSlice
|
|
1985
|
+
var search = toString(searchString);
|
|
1986
|
+
return stringSlice(that, index, index + search.length) === search;
|
|
1987
1987
|
}
|
|
1988
1988
|
});
|
|
1989
1989
|
|
|
1990
|
-
var fails$2 = fails$h;
|
|
1991
|
-
var global$3 = global$e;
|
|
1992
|
-
|
|
1993
|
-
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1994
|
-
var $RegExp$2 = global$3.RegExp;
|
|
1995
|
-
|
|
1996
|
-
var UNSUPPORTED_Y$1 = fails$2(function () {
|
|
1997
|
-
var re = $RegExp$2('a', 'y');
|
|
1998
|
-
re.lastIndex = 2;
|
|
1999
|
-
return re.exec('abcd') !== null;
|
|
2000
|
-
});
|
|
2001
|
-
|
|
2002
|
-
// UC Browser bug
|
|
2003
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
2004
|
-
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2005
|
-
return !$RegExp$2('a', 'y').sticky;
|
|
2006
|
-
});
|
|
2007
|
-
|
|
2008
|
-
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2009
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
2010
|
-
var re = $RegExp$2('^r', 'gy');
|
|
2011
|
-
re.lastIndex = 2;
|
|
2012
|
-
return re.exec('str') !== null;
|
|
2013
|
-
});
|
|
2014
|
-
|
|
2015
|
-
var regexpStickyHelpers = {
|
|
2016
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
2017
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
2018
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2019
|
-
};
|
|
2020
|
-
|
|
2021
|
-
var fails$1 = fails$h;
|
|
2022
|
-
var global$2 = global$e;
|
|
2023
|
-
|
|
2024
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
2025
|
-
var $RegExp$1 = global$2.RegExp;
|
|
2026
|
-
|
|
2027
|
-
var regexpUnsupportedDotAll = fails$1(function () {
|
|
2028
|
-
var re = $RegExp$1('.', 's');
|
|
2029
|
-
return !(re.dotAll && re.test('\n') && re.flags === 's');
|
|
2030
|
-
});
|
|
2031
|
-
|
|
2032
|
-
var fails = fails$h;
|
|
2033
|
-
var global$1 = global$e;
|
|
2034
|
-
|
|
2035
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
2036
|
-
var $RegExp = global$1.RegExp;
|
|
2037
|
-
|
|
2038
|
-
var regexpUnsupportedNcg = fails(function () {
|
|
2039
|
-
var re = $RegExp('(?<a>b)', 'g');
|
|
2040
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
2041
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
2042
|
-
});
|
|
2043
|
-
|
|
2044
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2045
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2046
|
-
var call = functionCall;
|
|
2047
|
-
var uncurryThis = functionUncurryThis;
|
|
2048
|
-
var toString = toString$3;
|
|
2049
|
-
var regexpFlags = regexpFlags$1;
|
|
2050
|
-
var stickyHelpers = regexpStickyHelpers;
|
|
2051
|
-
var shared = shared$4;
|
|
2052
|
-
var create = objectCreate;
|
|
2053
|
-
var getInternalState = internalState.get;
|
|
2054
|
-
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
2055
|
-
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
2056
|
-
|
|
2057
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2058
|
-
var nativeExec = RegExp.prototype.exec;
|
|
2059
|
-
var patchedExec = nativeExec;
|
|
2060
|
-
var charAt = uncurryThis(''.charAt);
|
|
2061
|
-
var indexOf = uncurryThis(''.indexOf);
|
|
2062
|
-
var replace = uncurryThis(''.replace);
|
|
2063
|
-
var stringSlice = uncurryThis(''.slice);
|
|
2064
|
-
|
|
2065
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2066
|
-
var re1 = /a/;
|
|
2067
|
-
var re2 = /b*/g;
|
|
2068
|
-
call(nativeExec, re1, 'a');
|
|
2069
|
-
call(nativeExec, re2, 'a');
|
|
2070
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2071
|
-
})();
|
|
2072
|
-
|
|
2073
|
-
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2074
|
-
|
|
2075
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2076
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2077
|
-
|
|
2078
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2079
|
-
|
|
2080
|
-
if (PATCH) {
|
|
2081
|
-
patchedExec = function exec(string) {
|
|
2082
|
-
var re = this;
|
|
2083
|
-
var state = getInternalState(re);
|
|
2084
|
-
var str = toString(string);
|
|
2085
|
-
var raw = state.raw;
|
|
2086
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
2087
|
-
|
|
2088
|
-
if (raw) {
|
|
2089
|
-
raw.lastIndex = re.lastIndex;
|
|
2090
|
-
result = call(patchedExec, raw, str);
|
|
2091
|
-
re.lastIndex = raw.lastIndex;
|
|
2092
|
-
return result;
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
var groups = state.groups;
|
|
2096
|
-
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2097
|
-
var flags = call(regexpFlags, re);
|
|
2098
|
-
var source = re.source;
|
|
2099
|
-
var charsAdded = 0;
|
|
2100
|
-
var strCopy = str;
|
|
2101
|
-
|
|
2102
|
-
if (sticky) {
|
|
2103
|
-
flags = replace(flags, 'y', '');
|
|
2104
|
-
if (indexOf(flags, 'g') === -1) {
|
|
2105
|
-
flags += 'g';
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
strCopy = stringSlice(str, re.lastIndex);
|
|
2109
|
-
// Support anchored sticky behavior.
|
|
2110
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
|
2111
|
-
source = '(?: ' + source + ')';
|
|
2112
|
-
strCopy = ' ' + strCopy;
|
|
2113
|
-
charsAdded++;
|
|
2114
|
-
}
|
|
2115
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2116
|
-
// simulate the 'y' flag.
|
|
2117
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
if (NPCG_INCLUDED) {
|
|
2121
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2122
|
-
}
|
|
2123
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2124
|
-
|
|
2125
|
-
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2126
|
-
|
|
2127
|
-
if (sticky) {
|
|
2128
|
-
if (match) {
|
|
2129
|
-
match.input = stringSlice(match.input, charsAdded);
|
|
2130
|
-
match[0] = stringSlice(match[0], charsAdded);
|
|
2131
|
-
match.index = re.lastIndex;
|
|
2132
|
-
re.lastIndex += match[0].length;
|
|
2133
|
-
} else re.lastIndex = 0;
|
|
2134
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2135
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2136
|
-
}
|
|
2137
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2138
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2139
|
-
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2140
|
-
call(nativeReplace, match[0], reCopy, function () {
|
|
2141
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
2142
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
2143
|
-
}
|
|
2144
|
-
});
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
if (match && groups) {
|
|
2148
|
-
match.groups = object = create(null);
|
|
2149
|
-
for (i = 0; i < groups.length; i++) {
|
|
2150
|
-
group = groups[i];
|
|
2151
|
-
object[group[0]] = match[group[1]];
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
return match;
|
|
2156
|
-
};
|
|
2157
|
-
}
|
|
2158
|
-
|
|
2159
|
-
var regexpExec = patchedExec;
|
|
2160
|
-
|
|
2161
|
-
var $ = _export;
|
|
2162
|
-
var exec = regexpExec;
|
|
2163
|
-
|
|
2164
|
-
// `RegExp.prototype.exec` method
|
|
2165
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2166
|
-
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
2167
|
-
exec: exec
|
|
2168
|
-
});
|
|
2169
|
-
|
|
2170
1990
|
const FormGroupContext = /*#__PURE__*/createContext({});
|
|
2171
1991
|
/**
|
|
2172
1992
|
* context interface to be used isolated or with the context provider
|
|
@@ -2215,6 +2035,11 @@ const IsolatedContext = ({
|
|
|
2215
2035
|
function submitMultipleFormsByIndex(indexes) {
|
|
2216
2036
|
return formGroupInstance.current.submitMultipleFormsByIndex(indexes);
|
|
2217
2037
|
}
|
|
2038
|
+
// useEffect(() => {
|
|
2039
|
+
// return () => {
|
|
2040
|
+
// formGroupInstance.current.destroy();
|
|
2041
|
+
// };
|
|
2042
|
+
// }, []);
|
|
2218
2043
|
return {
|
|
2219
2044
|
addFormWithIndex,
|
|
2220
2045
|
addForm,
|
|
@@ -2339,35 +2164,25 @@ const FieldWrapper = ({
|
|
|
2339
2164
|
const filteredProps = useMemo(() => {
|
|
2340
2165
|
let returnProps = {};
|
|
2341
2166
|
if (props) {
|
|
2342
|
-
returnProps =
|
|
2343
|
-
Object.keys(returnProps).forEach(propKey => {
|
|
2344
|
-
if (typeof (returnProps === null || returnProps === void 0 ? void 0 : returnProps[propKey]) === 'string' &&
|
|
2345
|
-
/**
|
|
2346
|
-
* need to check linting on build, this needs to be casted in order to build..
|
|
2347
|
-
*/
|
|
2348
|
-
/\$/.test(returnProps === null || returnProps === void 0 ? void 0 : returnProps[propKey])) {
|
|
2349
|
-
delete returnProps[propKey];
|
|
2350
|
-
}
|
|
2351
|
-
});
|
|
2352
|
-
if (mounted) {
|
|
2353
|
-
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.propsSubject$.next(Object.assign(Object.assign({}, fieldInstance.props), returnProps));
|
|
2354
|
-
}
|
|
2167
|
+
returnProps = FormField.filterProps(props);
|
|
2355
2168
|
}
|
|
2169
|
+
if (fieldInstance) fieldInstance.props = returnProps;
|
|
2356
2170
|
return returnProps;
|
|
2357
2171
|
}, [props]);
|
|
2358
2172
|
const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {
|
|
2359
2173
|
[((_a = mapper === null || mapper === void 0 ? void 0 : mapper.events) === null || _a === void 0 ? void 0 : _a.setValue) || 'value']: ''
|
|
2360
2174
|
});
|
|
2361
2175
|
const [state, setState] = useState({
|
|
2362
|
-
visibility: visibility,
|
|
2363
|
-
props:
|
|
2176
|
+
visibility: typeof visibility === 'boolean' ? visibility : true,
|
|
2177
|
+
props: filteredProps
|
|
2364
2178
|
});
|
|
2179
|
+
const mountedRef = useRef(false);
|
|
2365
2180
|
/**
|
|
2366
2181
|
* handles the mounting and unmounting logic onto the field instance
|
|
2367
2182
|
*/
|
|
2368
2183
|
useEffect(() => {
|
|
2369
|
-
if (!
|
|
2370
|
-
fieldInstance
|
|
2184
|
+
if (!fieldInstance || mountedRef.current) return;
|
|
2185
|
+
fieldInstance.mountField({
|
|
2371
2186
|
valueSubscription: value => {
|
|
2372
2187
|
setValueState(value);
|
|
2373
2188
|
},
|
|
@@ -2383,10 +2198,13 @@ const FieldWrapper = ({
|
|
|
2383
2198
|
}));
|
|
2384
2199
|
}
|
|
2385
2200
|
});
|
|
2201
|
+
mountedRef.current = true;
|
|
2202
|
+
}, [fieldInstance]);
|
|
2203
|
+
useEffect(() => {
|
|
2386
2204
|
return () => {
|
|
2387
|
-
|
|
2205
|
+
mountedRef.current && (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.destroyField());
|
|
2388
2206
|
};
|
|
2389
|
-
}, [
|
|
2207
|
+
}, []);
|
|
2390
2208
|
/**
|
|
2391
2209
|
* handles the value change onto the field instance
|
|
2392
2210
|
*/
|
|
@@ -2457,101 +2275,28 @@ const FieldWrapper = ({
|
|
|
2457
2275
|
}) : jsx(Fragment, {});
|
|
2458
2276
|
};
|
|
2459
2277
|
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
* @param {string} param.prevPath previous field path to track the tree branch creation
|
|
2466
|
-
* @param {string} param.formIndex form index to aid field identification onto the FieldWrapper
|
|
2467
|
-
* @returns {ReactNode}
|
|
2468
|
-
*/
|
|
2469
|
-
const BuildTree = ({
|
|
2470
|
-
fields,
|
|
2471
|
-
prevPath,
|
|
2472
|
-
formIndex
|
|
2278
|
+
const BuildSchemaAsFields = ({
|
|
2279
|
+
components,
|
|
2280
|
+
mappers,
|
|
2281
|
+
formIndex,
|
|
2282
|
+
mountedForm
|
|
2473
2283
|
}) => {
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
return
|
|
2477
|
-
}).filter(([, value]) => {
|
|
2478
|
-
return value.path === prevPath;
|
|
2479
|
-
}).map(([, value]) => {
|
|
2480
|
-
const fieldName = value.name;
|
|
2481
|
-
const children = BuildTree({
|
|
2482
|
-
fields,
|
|
2483
|
-
prevPath: `${prevPath ? `${prevPath}.` : ``}${value.name}`,
|
|
2484
|
-
formIndex
|
|
2485
|
-
});
|
|
2486
|
-
const lenght = Children.count(children);
|
|
2487
|
-
return jsx(FieldWrapper, {
|
|
2488
|
-
name: fieldName,
|
|
2284
|
+
return components && components.map(component => {
|
|
2285
|
+
const mapper = mappers === null || mappers === void 0 ? void 0 : mappers.find(el => el.componentName === component.component);
|
|
2286
|
+
return mapper ? jsx(AsFormFieldBuilder, Object.assign({
|
|
2489
2287
|
formIndex: formIndex,
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
},
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
*/
|
|
2503
|
-
const BuildAsFormFieldTree = ({
|
|
2504
|
-
children
|
|
2505
|
-
}) => {
|
|
2506
|
-
return Children.map(children, (child, index) => {
|
|
2507
|
-
var _a, _b, _c, _d, _e;
|
|
2508
|
-
let struct;
|
|
2509
|
-
if (!String((_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.name).startsWith('AsFormField')) {
|
|
2510
|
-
if (typeof child.type === 'function' || typeof child.type === 'object') {
|
|
2511
|
-
const props = Object.assign({}, child.props);
|
|
2512
|
-
delete props.children;
|
|
2513
|
-
struct = {
|
|
2514
|
-
component: ((_b = child === null || child === void 0 ? void 0 : child.type) === null || _b === void 0 ? void 0 : _b.name) || 'customForwardRef',
|
|
2515
|
-
name: `adapter-${Math.floor(Math.random() * Date.now()).toString(16)}`,
|
|
2516
|
-
mapper: {
|
|
2517
|
-
component: child.type,
|
|
2518
|
-
componentName: typeof child.type !== 'string' ? (_c = child === null || child === void 0 ? void 0 : child.type) === null || _c === void 0 ? void 0 : _c.name : child.type
|
|
2519
|
-
},
|
|
2520
|
-
props
|
|
2521
|
-
};
|
|
2522
|
-
} else if (typeof child.type === 'string' || typeof child === 'string') {
|
|
2523
|
-
throw new Error(`Only function components works inside a Form as React Nodes,\n
|
|
2524
|
-
if you want something like this to work: <div>hi</div>\n
|
|
2525
|
-
wrap it onto a function component\n
|
|
2526
|
-
const CustomTextNode = (props:{text:string}) => <div>props</div>\n
|
|
2527
|
-
and use it like <CustomTextNode text="hi"/>`);
|
|
2528
|
-
} else {
|
|
2529
|
-
throw {
|
|
2530
|
-
message: `Unknown error occured, please check the child that was tried to render below`,
|
|
2531
|
-
component: child
|
|
2532
|
-
};
|
|
2533
|
-
}
|
|
2534
|
-
} else {
|
|
2535
|
-
if (((_d = child === null || child === void 0 ? void 0 : child.type) === null || _d === void 0 ? void 0 : _d.name) === 'AsFormField') {
|
|
2536
|
-
struct = Object.assign({}, child.props);
|
|
2537
|
-
} else {
|
|
2538
|
-
if (!child.type.defaultProps.component) throw new Error(`set defaultProps component name\n
|
|
2539
|
-
ex: AsFormFieldInput.defaultProps = {
|
|
2540
|
-
component = 'input'
|
|
2541
|
-
}`);
|
|
2542
|
-
struct = Object.assign(Object.assign({}, child.props), child.type.defaultProps);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
if (struct && (struct === null || struct === void 0 ? void 0 : struct.children)) {
|
|
2546
|
-
delete struct.children;
|
|
2547
|
-
}
|
|
2548
|
-
struct.order = index;
|
|
2549
|
-
const childElements = BuildAsFormFieldTree({
|
|
2550
|
-
children: (_e = child.props) === null || _e === void 0 ? void 0 : _e.children
|
|
2551
|
-
});
|
|
2552
|
-
return Object.assign(Object.assign({}, struct), childElements && {
|
|
2553
|
-
children: childElements
|
|
2554
|
-
});
|
|
2288
|
+
mapper: mapper,
|
|
2289
|
+
formMounted: mountedForm
|
|
2290
|
+
}, component, {
|
|
2291
|
+
children: component.children && component.children.length > 0 && jsx(BuildSchemaAsFields, {
|
|
2292
|
+
formIndex: formIndex,
|
|
2293
|
+
mappers: mappers,
|
|
2294
|
+
components: component.children,
|
|
2295
|
+
mountedForm: mountedForm
|
|
2296
|
+
})
|
|
2297
|
+
}), component.name) : jsx("div", {
|
|
2298
|
+
children: `component mapper not found for ${component.component} from field name ${component.name} on form ${formIndex}`
|
|
2299
|
+
}, component.name);
|
|
2555
2300
|
});
|
|
2556
2301
|
};
|
|
2557
2302
|
|
|
@@ -2730,92 +2475,72 @@ function Form({
|
|
|
2730
2475
|
children
|
|
2731
2476
|
}) {
|
|
2732
2477
|
const {
|
|
2733
|
-
addForm,
|
|
2734
|
-
removeForm,
|
|
2735
2478
|
getForm,
|
|
2736
2479
|
mappers,
|
|
2737
2480
|
debugMode,
|
|
2738
2481
|
formGroupInstance
|
|
2739
2482
|
} = useFormGroupContext({});
|
|
2740
|
-
const
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2483
|
+
const schemaIndex = useRef(index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange').current;
|
|
2484
|
+
const [mounted, setMounted] = useState(false);
|
|
2485
|
+
const mountedRef = useRef(false);
|
|
2486
|
+
// const formInstance = useRef(
|
|
2487
|
+
// new FormCore({
|
|
2488
|
+
// schema,
|
|
2489
|
+
// initialValues: initialValues || schema?.initialValues,
|
|
2490
|
+
// iVars: iVars || schema?.iVars,
|
|
2491
|
+
// action: action || schema?.action,
|
|
2492
|
+
// method: method || schema?.method,
|
|
2493
|
+
// index: schemaIndex,
|
|
2494
|
+
// mappers,
|
|
2495
|
+
// config: config || formGroupInstance.config,
|
|
2496
|
+
// })
|
|
2497
|
+
// );
|
|
2745
2498
|
useEffect(() => {
|
|
2746
|
-
if (
|
|
2747
|
-
|
|
2748
|
-
}
|
|
2749
|
-
const formInstance = new FormCore({
|
|
2750
|
-
schema,
|
|
2751
|
-
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2752
|
-
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
2753
|
-
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2754
|
-
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2755
|
-
index: schemaIndex,
|
|
2756
|
-
mappers,
|
|
2757
|
-
config: config || formGroupInstance.config
|
|
2758
|
-
});
|
|
2759
|
-
addForm({
|
|
2499
|
+
if (mountedRef.current) return;
|
|
2500
|
+
formGroupInstance.addForm({
|
|
2760
2501
|
key: schemaIndex,
|
|
2761
|
-
formInstance
|
|
2502
|
+
formInstance: new FormCore({
|
|
2503
|
+
schema,
|
|
2504
|
+
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2505
|
+
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
2506
|
+
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2507
|
+
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2508
|
+
index: schemaIndex,
|
|
2509
|
+
mappers,
|
|
2510
|
+
config: config || formGroupInstance.config
|
|
2511
|
+
})
|
|
2762
2512
|
});
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
}
|
|
2767
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.mounted();
|
|
2768
|
-
/*
|
|
2769
|
-
@TODO check if form instance is killed each time it is unmounted
|
|
2770
|
-
the management of multiple forms needs to be planned
|
|
2771
|
-
*/
|
|
2772
|
-
return () => {
|
|
2773
|
-
subMounted === null || subMounted === void 0 ? void 0 : subMounted.unsubscribe();
|
|
2774
|
-
removeForm({
|
|
2775
|
-
key: schemaIndex
|
|
2776
|
-
});
|
|
2777
|
-
};
|
|
2513
|
+
setMounted(true);
|
|
2514
|
+
mountedRef.current = true;
|
|
2515
|
+
// }
|
|
2778
2516
|
}, []);
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
useEffect(() => {
|
|
2785
|
-
var _a;
|
|
2786
|
-
const schema = BuildAsFormFieldTree({
|
|
2787
|
-
children
|
|
2788
|
-
});
|
|
2789
|
-
schema && getForm({
|
|
2790
|
-
key: index
|
|
2791
|
-
}).refreshFields(schema);
|
|
2792
|
-
const fields = (_a = getForm({
|
|
2793
|
-
key: index
|
|
2794
|
-
})) === null || _a === void 0 ? void 0 : _a.fields;
|
|
2795
|
-
if (fields) {
|
|
2796
|
-
const buildTree = BuildTree({
|
|
2797
|
-
fields,
|
|
2798
|
-
formIndex: index
|
|
2799
|
-
});
|
|
2800
|
-
setTree(buildTree);
|
|
2801
|
-
}
|
|
2802
|
-
}, [children]);
|
|
2517
|
+
// useEffect(() => {
|
|
2518
|
+
// return () => {
|
|
2519
|
+
// formGroupInstance.getForm({ key: schemaIndex })?.destroy();
|
|
2520
|
+
// };
|
|
2521
|
+
// }, []);
|
|
2803
2522
|
/**
|
|
2804
2523
|
* iVars change tracker to update iVars onto form instance
|
|
2805
2524
|
*/
|
|
2806
2525
|
useEffect(() => {
|
|
2807
|
-
if (
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2526
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
2527
|
+
console.log('failed to add iVars due to no form instance');
|
|
2528
|
+
return;
|
|
2529
|
+
}
|
|
2530
|
+
if (iVars && mounted) formGroupInstance.forms.get(schemaIndex).iVars = iVars;
|
|
2531
|
+
// if (iVars) formInstance.current.iVars = iVars;
|
|
2532
|
+
}, [iVars, mounted]);
|
|
2811
2533
|
/**
|
|
2812
2534
|
* initialValues setter for async initialValues
|
|
2813
2535
|
*/
|
|
2814
2536
|
useEffect(() => {
|
|
2815
|
-
if (
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2537
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
2538
|
+
console.log('failed to add initialValues due to no form instance');
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
if (initialValues && mounted) formGroupInstance.forms.get(schemaIndex).initialValues = initialValues;
|
|
2542
|
+
// if (initialValues) formInstance.current.initialValues = initialValues;
|
|
2543
|
+
}, [initialValues, mounted]);
|
|
2819
2544
|
/**
|
|
2820
2545
|
* hook usage to keep event bindings updated on callback functions passed as props
|
|
2821
2546
|
*/
|
|
@@ -2880,12 +2605,11 @@ function Form({
|
|
|
2880
2605
|
}), jsx("br", {}), jsx("hr", {})]
|
|
2881
2606
|
}), jsx("form", {
|
|
2882
2607
|
onSubmit: handleSubmit,
|
|
2883
|
-
children:
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
formIndex: schemaIndex
|
|
2608
|
+
children: jsx(BuildSchemaAsFields, {
|
|
2609
|
+
formIndex: schemaIndex,
|
|
2610
|
+
mappers: mappers,
|
|
2611
|
+
components: schema === null || schema === void 0 ? void 0 : schema.components,
|
|
2612
|
+
mountedForm: mounted
|
|
2889
2613
|
})
|
|
2890
2614
|
})]
|
|
2891
2615
|
});
|
|
@@ -2917,6 +2641,7 @@ const AsFormFieldBuilder = props => {
|
|
|
2917
2641
|
* state to track the field instance creation process
|
|
2918
2642
|
*/
|
|
2919
2643
|
const [mounted, setMounted] = useState(false);
|
|
2644
|
+
const mountedRef = useRef(false);
|
|
2920
2645
|
/**
|
|
2921
2646
|
* initializer to create or add a form instance to the formGroup by it's formId
|
|
2922
2647
|
* and add the field to the form instance
|
|
@@ -2924,22 +2649,36 @@ const AsFormFieldBuilder = props => {
|
|
|
2924
2649
|
*/
|
|
2925
2650
|
useEffect(() => {
|
|
2926
2651
|
var _a;
|
|
2927
|
-
if (
|
|
2652
|
+
if (mountedRef.current) return;
|
|
2653
|
+
if (typeof props.formMounted === 'undefined' && !((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2928
2654
|
context.addFormWithIndex(props.formIndex);
|
|
2929
2655
|
}
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
}
|
|
2656
|
+
if (props.formMounted || typeof props.formMounted === 'undefined') {
|
|
2657
|
+
const fieldSchema = Object.assign(Object.assign({}, props), {
|
|
2658
|
+
component: props.mapper.componentName,
|
|
2659
|
+
children: undefined
|
|
2660
|
+
});
|
|
2661
|
+
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2662
|
+
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2663
|
+
fieldSchema,
|
|
2664
|
+
mapperElement: props.mapper
|
|
2665
|
+
});
|
|
2666
|
+
setMounted(true);
|
|
2667
|
+
mountedRef.current = true;
|
|
2668
|
+
}
|
|
2669
|
+
}, [props.formMounted]);
|
|
2670
|
+
useEffect(() => {
|
|
2671
|
+
return () => {
|
|
2672
|
+
var _a, _b;
|
|
2673
|
+
if ((_b = (_a = context.getForm({
|
|
2674
|
+
key: props.formIndex
|
|
2675
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2676
|
+
key: props.name
|
|
2677
|
+
})) === null || _b === void 0 ? void 0 : _b.mounted) context.formGroupInstance.removeField({
|
|
2678
|
+
formIndex: props.formIndex,
|
|
2679
|
+
fieldIndex: props.name
|
|
2680
|
+
});
|
|
2681
|
+
};
|
|
2943
2682
|
}, []);
|
|
2944
2683
|
/**
|
|
2945
2684
|
* allows to control field selected value on each event
|
|
@@ -2964,7 +2703,7 @@ const AsFormFieldBuilder = props => {
|
|
|
2964
2703
|
context: !context.active ? context : null,
|
|
2965
2704
|
mounted: mounted,
|
|
2966
2705
|
mapper: props.mapper,
|
|
2967
|
-
visibility: props.visibility
|
|
2706
|
+
visibility: props.visibility,
|
|
2968
2707
|
children: props.children && props.children
|
|
2969
2708
|
});
|
|
2970
2709
|
};
|