@bolttech/form-engine 3.0.0-beta.15 → 3.0.0-beta.16
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 +592 -356
- package/package.json +3 -5
- package/src/components/AsFormFieldBuilder/AsFormFieldBuilder.d.ts +5 -3
- package/src/components/FieldWrapper/FieldWrapper.d.ts +4 -2
- package/src/context/FormGroupContext.d.ts +5 -7
- package/src/helpers/helpers.d.ts +4 -8
- package/src/hooks/useForm.d.ts +3 -2
- package/src/types/index.d.ts +1 -3
package/index.esm.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { FormGroup, FormCore } from '@bolttech/form-engine-core';
|
|
3
|
-
import { createContext, useRef,
|
|
4
|
-
import { isNil } from 'lodash';
|
|
3
|
+
import { createContext, useContext, useRef, useMemo, useState, useEffect, useCallback, Suspense, Children } from 'react';
|
|
5
4
|
|
|
6
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
6
|
|
|
8
|
-
var fails$
|
|
7
|
+
var fails$e = function (exec) {
|
|
9
8
|
try {
|
|
10
9
|
return !!exec();
|
|
11
10
|
} catch (error) {
|
|
@@ -13,9 +12,9 @@ var fails$b = function (exec) {
|
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
14
|
|
|
16
|
-
var fails$
|
|
15
|
+
var fails$d = fails$e;
|
|
17
16
|
|
|
18
|
-
var functionBindNative = !fails$
|
|
17
|
+
var functionBindNative = !fails$d(function () {
|
|
19
18
|
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
20
19
|
var test = (function () { /* empty */ }).bind();
|
|
21
20
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
@@ -25,39 +24,39 @@ var functionBindNative = !fails$a(function () {
|
|
|
25
24
|
var NATIVE_BIND$1 = functionBindNative;
|
|
26
25
|
|
|
27
26
|
var FunctionPrototype$1 = Function.prototype;
|
|
28
|
-
var call$
|
|
29
|
-
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);
|
|
30
29
|
|
|
31
30
|
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
32
31
|
return function () {
|
|
33
|
-
return call$
|
|
32
|
+
return call$7.apply(fn, arguments);
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
var uncurryThis$
|
|
36
|
+
var uncurryThis$b = functionUncurryThis;
|
|
38
37
|
|
|
39
|
-
var toString$
|
|
40
|
-
var stringSlice$
|
|
38
|
+
var toString$3 = uncurryThis$b({}.toString);
|
|
39
|
+
var stringSlice$2 = uncurryThis$b(''.slice);
|
|
41
40
|
|
|
42
|
-
var classofRaw = function (it) {
|
|
43
|
-
return stringSlice$
|
|
41
|
+
var classofRaw$1 = function (it) {
|
|
42
|
+
return stringSlice$2(toString$3(it), 8, -1);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
var uncurryThis$
|
|
47
|
-
var fails$
|
|
48
|
-
var classof = classofRaw;
|
|
45
|
+
var uncurryThis$a = functionUncurryThis;
|
|
46
|
+
var fails$c = fails$e;
|
|
47
|
+
var classof$2 = classofRaw$1;
|
|
49
48
|
|
|
50
|
-
var $Object$
|
|
51
|
-
var split = uncurryThis$
|
|
49
|
+
var $Object$4 = Object;
|
|
50
|
+
var split = uncurryThis$a(''.split);
|
|
52
51
|
|
|
53
52
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
54
|
-
var indexedObject = fails$
|
|
53
|
+
var indexedObject = fails$c(function () {
|
|
55
54
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
56
55
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
57
|
-
return !$Object$
|
|
56
|
+
return !$Object$4('z').propertyIsEnumerable(0);
|
|
58
57
|
}) ? function (it) {
|
|
59
|
-
return classof(it) === 'String' ? split(it, '') : $Object$
|
|
60
|
-
} : $Object$
|
|
58
|
+
return classof$2(it) === 'String' ? split(it, '') : $Object$4(it);
|
|
59
|
+
} : $Object$4;
|
|
61
60
|
|
|
62
61
|
// we can't use just `it == null` since of `document.all` special case
|
|
63
62
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
@@ -89,7 +88,7 @@ var check = function (it) {
|
|
|
89
88
|
};
|
|
90
89
|
|
|
91
90
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
92
|
-
var global$
|
|
91
|
+
var global$e =
|
|
93
92
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
94
93
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
95
94
|
check(typeof window == 'object' && window) ||
|
|
@@ -102,20 +101,20 @@ var global$b =
|
|
|
102
101
|
|
|
103
102
|
var sharedStore = {exports: {}};
|
|
104
103
|
|
|
105
|
-
var global$
|
|
104
|
+
var global$d = global$e;
|
|
106
105
|
|
|
107
106
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
108
107
|
var defineProperty$5 = Object.defineProperty;
|
|
109
108
|
|
|
110
109
|
var defineGlobalProperty$3 = function (key, value) {
|
|
111
110
|
try {
|
|
112
|
-
defineProperty$5(global$
|
|
111
|
+
defineProperty$5(global$d, key, { value: value, configurable: true, writable: true });
|
|
113
112
|
} catch (error) {
|
|
114
|
-
global$
|
|
113
|
+
global$d[key] = value;
|
|
115
114
|
} return value;
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
var globalThis$1 = global$
|
|
117
|
+
var globalThis$1 = global$e;
|
|
119
118
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
120
119
|
|
|
121
120
|
var SHARED = '__core-js_shared__';
|
|
@@ -131,24 +130,24 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
131
130
|
|
|
132
131
|
var store$2 = sharedStore.exports;
|
|
133
132
|
|
|
134
|
-
var shared$
|
|
133
|
+
var shared$4 = function (key, value) {
|
|
135
134
|
return store$2[key] || (store$2[key] = value || {});
|
|
136
135
|
};
|
|
137
136
|
|
|
138
137
|
var requireObjectCoercible$1 = requireObjectCoercible$3;
|
|
139
138
|
|
|
140
|
-
var $Object$
|
|
139
|
+
var $Object$3 = Object;
|
|
141
140
|
|
|
142
141
|
// `ToObject` abstract operation
|
|
143
142
|
// https://tc39.es/ecma262/#sec-toobject
|
|
144
143
|
var toObject$3 = function (argument) {
|
|
145
|
-
return $Object$
|
|
144
|
+
return $Object$3(requireObjectCoercible$1(argument));
|
|
146
145
|
};
|
|
147
146
|
|
|
148
|
-
var uncurryThis$
|
|
147
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
149
148
|
var toObject$2 = toObject$3;
|
|
150
149
|
|
|
151
|
-
var hasOwnProperty = uncurryThis$
|
|
150
|
+
var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
|
|
152
151
|
|
|
153
152
|
// `HasOwnProperty` abstract operation
|
|
154
153
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
@@ -157,23 +156,23 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
|
157
156
|
return hasOwnProperty(toObject$2(it), key);
|
|
158
157
|
};
|
|
159
158
|
|
|
160
|
-
var uncurryThis$
|
|
159
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
161
160
|
|
|
162
161
|
var id = 0;
|
|
163
162
|
var postfix = Math.random();
|
|
164
|
-
var toString = uncurryThis$
|
|
163
|
+
var toString$2 = uncurryThis$8(1.0.toString);
|
|
165
164
|
|
|
166
165
|
var uid$2 = function (key) {
|
|
167
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
166
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
|
|
168
167
|
};
|
|
169
168
|
|
|
170
169
|
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
171
170
|
|
|
172
|
-
var global$
|
|
171
|
+
var global$c = global$e;
|
|
173
172
|
var userAgent = engineUserAgent;
|
|
174
173
|
|
|
175
|
-
var process = global$
|
|
176
|
-
var Deno = global$
|
|
174
|
+
var process = global$c.process;
|
|
175
|
+
var Deno = global$c.Deno;
|
|
177
176
|
var versions = process && process.versions || Deno && Deno.version;
|
|
178
177
|
var v8 = versions && versions.v8;
|
|
179
178
|
var match, version;
|
|
@@ -199,19 +198,19 @@ var engineV8Version = version;
|
|
|
199
198
|
|
|
200
199
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
201
200
|
var V8_VERSION = engineV8Version;
|
|
202
|
-
var fails$
|
|
203
|
-
var global$
|
|
201
|
+
var fails$b = fails$e;
|
|
202
|
+
var global$b = global$e;
|
|
204
203
|
|
|
205
|
-
var $String$
|
|
204
|
+
var $String$5 = global$b.String;
|
|
206
205
|
|
|
207
206
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
208
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$
|
|
207
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$b(function () {
|
|
209
208
|
var symbol = Symbol('symbol detection');
|
|
210
209
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
211
210
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
212
211
|
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
213
212
|
// of course, fail.
|
|
214
|
-
return !$String$
|
|
213
|
+
return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
215
214
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
216
215
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
217
216
|
});
|
|
@@ -223,18 +222,18 @@ var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
|
223
222
|
&& !Symbol.sham
|
|
224
223
|
&& typeof Symbol.iterator == 'symbol';
|
|
225
224
|
|
|
226
|
-
var global$
|
|
227
|
-
var shared$
|
|
225
|
+
var global$a = global$e;
|
|
226
|
+
var shared$3 = shared$4;
|
|
228
227
|
var hasOwn$8 = hasOwnProperty_1;
|
|
229
228
|
var uid$1 = uid$2;
|
|
230
229
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
231
230
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
232
231
|
|
|
233
|
-
var Symbol$1 = global$
|
|
234
|
-
var WellKnownSymbolsStore = shared$
|
|
232
|
+
var Symbol$1 = global$a.Symbol;
|
|
233
|
+
var WellKnownSymbolsStore = shared$3('wks');
|
|
235
234
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
236
235
|
|
|
237
|
-
var wellKnownSymbol$
|
|
236
|
+
var wellKnownSymbol$8 = function (name) {
|
|
238
237
|
if (!hasOwn$8(WellKnownSymbolsStore, name)) {
|
|
239
238
|
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
|
|
240
239
|
? Symbol$1[name]
|
|
@@ -248,45 +247,45 @@ var documentAll = typeof document == 'object' && document.all;
|
|
|
248
247
|
// `IsCallable` abstract operation
|
|
249
248
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
250
249
|
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
251
|
-
var isCallable$
|
|
250
|
+
var isCallable$e = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
252
251
|
return typeof argument == 'function' || argument === documentAll;
|
|
253
252
|
} : function (argument) {
|
|
254
253
|
return typeof argument == 'function';
|
|
255
254
|
};
|
|
256
255
|
|
|
257
|
-
var isCallable$
|
|
256
|
+
var isCallable$d = isCallable$e;
|
|
258
257
|
|
|
259
258
|
var isObject$8 = function (it) {
|
|
260
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
259
|
+
return typeof it == 'object' ? it !== null : isCallable$d(it);
|
|
261
260
|
};
|
|
262
261
|
|
|
263
262
|
var isObject$7 = isObject$8;
|
|
264
263
|
|
|
265
|
-
var $String$
|
|
264
|
+
var $String$4 = String;
|
|
266
265
|
var $TypeError$5 = TypeError;
|
|
267
266
|
|
|
268
267
|
// `Assert: Type(argument) is Object`
|
|
269
|
-
var anObject$
|
|
268
|
+
var anObject$5 = function (argument) {
|
|
270
269
|
if (isObject$7(argument)) return argument;
|
|
271
|
-
throw new $TypeError$5($String$
|
|
270
|
+
throw new $TypeError$5($String$4(argument) + ' is not an object');
|
|
272
271
|
};
|
|
273
272
|
|
|
274
273
|
var objectDefineProperties = {};
|
|
275
274
|
|
|
276
|
-
var fails$
|
|
275
|
+
var fails$a = fails$e;
|
|
277
276
|
|
|
278
277
|
// Detect IE8's incomplete defineProperty implementation
|
|
279
|
-
var descriptors = !fails$
|
|
278
|
+
var descriptors = !fails$a(function () {
|
|
280
279
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
281
280
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
282
281
|
});
|
|
283
282
|
|
|
284
283
|
var DESCRIPTORS$9 = descriptors;
|
|
285
|
-
var fails$
|
|
284
|
+
var fails$9 = fails$e;
|
|
286
285
|
|
|
287
286
|
// V8 ~ Chrome 36-
|
|
288
287
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
289
|
-
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$
|
|
288
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$9(function () {
|
|
290
289
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
291
290
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
292
291
|
value: 42,
|
|
@@ -296,10 +295,10 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$6(function () {
|
|
|
296
295
|
|
|
297
296
|
var objectDefineProperty = {};
|
|
298
297
|
|
|
299
|
-
var global$
|
|
298
|
+
var global$9 = global$e;
|
|
300
299
|
var isObject$6 = isObject$8;
|
|
301
300
|
|
|
302
|
-
var document$1 = global$
|
|
301
|
+
var document$1 = global$9.document;
|
|
303
302
|
// typeof document.createElement is 'object' in old IE
|
|
304
303
|
var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
|
|
305
304
|
|
|
@@ -308,11 +307,11 @@ var documentCreateElement$2 = function (it) {
|
|
|
308
307
|
};
|
|
309
308
|
|
|
310
309
|
var DESCRIPTORS$8 = descriptors;
|
|
311
|
-
var fails$
|
|
310
|
+
var fails$8 = fails$e;
|
|
312
311
|
var createElement = documentCreateElement$2;
|
|
313
312
|
|
|
314
313
|
// Thanks to IE8 for its funny defineProperty
|
|
315
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$
|
|
314
|
+
var ie8DomDefine = !DESCRIPTORS$8 && !fails$8(function () {
|
|
316
315
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
317
316
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
318
317
|
get: function () { return 7; }
|
|
@@ -321,59 +320,59 @@ var ie8DomDefine = !DESCRIPTORS$8 && !fails$5(function () {
|
|
|
321
320
|
|
|
322
321
|
var NATIVE_BIND = functionBindNative;
|
|
323
322
|
|
|
324
|
-
var call$
|
|
323
|
+
var call$6 = Function.prototype.call;
|
|
325
324
|
|
|
326
|
-
var functionCall = NATIVE_BIND ? call$
|
|
327
|
-
return call$
|
|
325
|
+
var functionCall = NATIVE_BIND ? call$6.bind(call$6) : function () {
|
|
326
|
+
return call$6.apply(call$6, arguments);
|
|
328
327
|
};
|
|
329
328
|
|
|
330
|
-
var global$
|
|
331
|
-
var isCallable$
|
|
329
|
+
var global$8 = global$e;
|
|
330
|
+
var isCallable$c = isCallable$e;
|
|
332
331
|
|
|
333
332
|
var aFunction = function (argument) {
|
|
334
|
-
return isCallable$
|
|
333
|
+
return isCallable$c(argument) ? argument : undefined;
|
|
335
334
|
};
|
|
336
335
|
|
|
337
336
|
var getBuiltIn$3 = function (namespace, method) {
|
|
338
|
-
return arguments.length < 2 ? aFunction(global$
|
|
337
|
+
return arguments.length < 2 ? aFunction(global$8[namespace]) : global$8[namespace] && global$8[namespace][method];
|
|
339
338
|
};
|
|
340
339
|
|
|
341
|
-
var uncurryThis$
|
|
340
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
342
341
|
|
|
343
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
342
|
+
var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
|
|
344
343
|
|
|
345
344
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
346
|
-
var isCallable$
|
|
345
|
+
var isCallable$b = isCallable$e;
|
|
347
346
|
var isPrototypeOf = objectIsPrototypeOf;
|
|
348
347
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
349
348
|
|
|
350
|
-
var $Object$
|
|
349
|
+
var $Object$2 = Object;
|
|
351
350
|
|
|
352
351
|
var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
|
|
353
352
|
return typeof it == 'symbol';
|
|
354
353
|
} : function (it) {
|
|
355
354
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
356
|
-
return isCallable$
|
|
355
|
+
return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
|
|
357
356
|
};
|
|
358
357
|
|
|
359
|
-
var $String$
|
|
358
|
+
var $String$3 = String;
|
|
360
359
|
|
|
361
360
|
var tryToString$1 = function (argument) {
|
|
362
361
|
try {
|
|
363
|
-
return $String$
|
|
362
|
+
return $String$3(argument);
|
|
364
363
|
} catch (error) {
|
|
365
364
|
return 'Object';
|
|
366
365
|
}
|
|
367
366
|
};
|
|
368
367
|
|
|
369
|
-
var isCallable$
|
|
368
|
+
var isCallable$a = isCallable$e;
|
|
370
369
|
var tryToString = tryToString$1;
|
|
371
370
|
|
|
372
371
|
var $TypeError$4 = TypeError;
|
|
373
372
|
|
|
374
373
|
// `Assert: IsCallable(argument) is true`
|
|
375
374
|
var aCallable$2 = function (argument) {
|
|
376
|
-
if (isCallable$
|
|
375
|
+
if (isCallable$a(argument)) return argument;
|
|
377
376
|
throw new $TypeError$4(tryToString(argument) + ' is not a function');
|
|
378
377
|
};
|
|
379
378
|
|
|
@@ -387,8 +386,8 @@ var getMethod$1 = function (V, P) {
|
|
|
387
386
|
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
388
387
|
};
|
|
389
388
|
|
|
390
|
-
var call$
|
|
391
|
-
var isCallable$
|
|
389
|
+
var call$5 = functionCall;
|
|
390
|
+
var isCallable$9 = isCallable$e;
|
|
392
391
|
var isObject$5 = isObject$8;
|
|
393
392
|
|
|
394
393
|
var $TypeError$3 = TypeError;
|
|
@@ -397,21 +396,21 @@ var $TypeError$3 = TypeError;
|
|
|
397
396
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
398
397
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
399
398
|
var fn, val;
|
|
400
|
-
if (pref === 'string' && isCallable$
|
|
401
|
-
if (isCallable$
|
|
402
|
-
if (pref !== 'string' && isCallable$
|
|
399
|
+
if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$5(fn, input))) return val;
|
|
400
|
+
if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$5(fn, input))) return val;
|
|
401
|
+
if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$5(fn, input))) return val;
|
|
403
402
|
throw new $TypeError$3("Can't convert object to primitive value");
|
|
404
403
|
};
|
|
405
404
|
|
|
406
|
-
var call$
|
|
405
|
+
var call$4 = functionCall;
|
|
407
406
|
var isObject$4 = isObject$8;
|
|
408
407
|
var isSymbol$1 = isSymbol$2;
|
|
409
408
|
var getMethod = getMethod$1;
|
|
410
409
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
411
|
-
var wellKnownSymbol$
|
|
410
|
+
var wellKnownSymbol$7 = wellKnownSymbol$8;
|
|
412
411
|
|
|
413
412
|
var $TypeError$2 = TypeError;
|
|
414
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
413
|
+
var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
|
|
415
414
|
|
|
416
415
|
// `ToPrimitive` abstract operation
|
|
417
416
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
@@ -421,7 +420,7 @@ var toPrimitive$1 = function (input, pref) {
|
|
|
421
420
|
var result;
|
|
422
421
|
if (exoticToPrim) {
|
|
423
422
|
if (pref === undefined) pref = 'default';
|
|
424
|
-
result = call$
|
|
423
|
+
result = call$4(exoticToPrim, input, pref);
|
|
425
424
|
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
426
425
|
throw new $TypeError$2("Can't convert object to primitive value");
|
|
427
426
|
}
|
|
@@ -442,7 +441,7 @@ var toPropertyKey$2 = function (argument) {
|
|
|
442
441
|
var DESCRIPTORS$7 = descriptors;
|
|
443
442
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
444
443
|
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
445
|
-
var anObject$
|
|
444
|
+
var anObject$4 = anObject$5;
|
|
446
445
|
var toPropertyKey$1 = toPropertyKey$2;
|
|
447
446
|
|
|
448
447
|
var $TypeError$1 = TypeError;
|
|
@@ -457,9 +456,9 @@ var WRITABLE = 'writable';
|
|
|
457
456
|
// `Object.defineProperty` method
|
|
458
457
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
459
458
|
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
460
|
-
anObject$
|
|
459
|
+
anObject$4(O);
|
|
461
460
|
P = toPropertyKey$1(P);
|
|
462
|
-
anObject$
|
|
461
|
+
anObject$4(Attributes);
|
|
463
462
|
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
464
463
|
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
465
464
|
if (current && current[WRITABLE]) {
|
|
@@ -472,9 +471,9 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
472
471
|
}
|
|
473
472
|
} return $defineProperty(O, P, Attributes);
|
|
474
473
|
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
475
|
-
anObject$
|
|
474
|
+
anObject$4(O);
|
|
476
475
|
P = toPropertyKey$1(P);
|
|
477
|
-
anObject$
|
|
476
|
+
anObject$4(Attributes);
|
|
478
477
|
if (IE8_DOM_DEFINE$1) try {
|
|
479
478
|
return $defineProperty(O, P, Attributes);
|
|
480
479
|
} catch (error) { /* empty */ }
|
|
@@ -572,13 +571,13 @@ var arrayIncludes = {
|
|
|
572
571
|
|
|
573
572
|
var hiddenKeys$4 = {};
|
|
574
573
|
|
|
575
|
-
var uncurryThis$
|
|
574
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
576
575
|
var hasOwn$7 = hasOwnProperty_1;
|
|
577
576
|
var toIndexedObject$3 = toIndexedObject$5;
|
|
578
|
-
var indexOf = arrayIncludes.indexOf;
|
|
577
|
+
var indexOf$1 = arrayIncludes.indexOf;
|
|
579
578
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
580
579
|
|
|
581
|
-
var push = uncurryThis$
|
|
580
|
+
var push = uncurryThis$6([].push);
|
|
582
581
|
|
|
583
582
|
var objectKeysInternal = function (object, names) {
|
|
584
583
|
var O = toIndexedObject$3(object);
|
|
@@ -588,7 +587,7 @@ var objectKeysInternal = function (object, names) {
|
|
|
588
587
|
for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
|
|
589
588
|
// Don't enum bug & hidden keys
|
|
590
589
|
while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
|
|
591
|
-
~indexOf(result, key) || push(result, key);
|
|
590
|
+
~indexOf$1(result, key) || push(result, key);
|
|
592
591
|
}
|
|
593
592
|
return result;
|
|
594
593
|
};
|
|
@@ -617,7 +616,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
617
616
|
var DESCRIPTORS$6 = descriptors;
|
|
618
617
|
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
619
618
|
var definePropertyModule$3 = objectDefineProperty;
|
|
620
|
-
var anObject$
|
|
619
|
+
var anObject$3 = anObject$5;
|
|
621
620
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
622
621
|
var objectKeys$1 = objectKeys$2;
|
|
623
622
|
|
|
@@ -625,7 +624,7 @@ var objectKeys$1 = objectKeys$2;
|
|
|
625
624
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
626
625
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
627
626
|
objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
628
|
-
anObject$
|
|
627
|
+
anObject$3(O);
|
|
629
628
|
var props = toIndexedObject$2(Properties);
|
|
630
629
|
var keys = objectKeys$1(Properties);
|
|
631
630
|
var length = keys.length;
|
|
@@ -639,17 +638,17 @@ var getBuiltIn$1 = getBuiltIn$3;
|
|
|
639
638
|
|
|
640
639
|
var html$1 = getBuiltIn$1('document', 'documentElement');
|
|
641
640
|
|
|
642
|
-
var shared$
|
|
641
|
+
var shared$2 = shared$4;
|
|
643
642
|
var uid = uid$2;
|
|
644
643
|
|
|
645
|
-
var keys = shared$
|
|
644
|
+
var keys = shared$2('keys');
|
|
646
645
|
|
|
647
646
|
var sharedKey$3 = function (key) {
|
|
648
647
|
return keys[key] || (keys[key] = uid(key));
|
|
649
648
|
};
|
|
650
649
|
|
|
651
650
|
/* global ActiveXObject -- old IE, WSH */
|
|
652
|
-
var anObject$
|
|
651
|
+
var anObject$2 = anObject$5;
|
|
653
652
|
var definePropertiesModule = objectDefineProperties;
|
|
654
653
|
var enumBugKeys$1 = enumBugKeys$3;
|
|
655
654
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
@@ -723,7 +722,7 @@ hiddenKeys$2[IE_PROTO$1] = true;
|
|
|
723
722
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
724
723
|
var result;
|
|
725
724
|
if (O !== null) {
|
|
726
|
-
EmptyConstructor[PROTOTYPE] = anObject$
|
|
725
|
+
EmptyConstructor[PROTOTYPE] = anObject$2(O);
|
|
727
726
|
result = new EmptyConstructor();
|
|
728
727
|
EmptyConstructor[PROTOTYPE] = null;
|
|
729
728
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
@@ -732,11 +731,11 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
732
731
|
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
733
732
|
};
|
|
734
733
|
|
|
735
|
-
var wellKnownSymbol$
|
|
736
|
-
var create$
|
|
734
|
+
var wellKnownSymbol$6 = wellKnownSymbol$8;
|
|
735
|
+
var create$2 = objectCreate;
|
|
737
736
|
var defineProperty$4 = objectDefineProperty.f;
|
|
738
737
|
|
|
739
|
-
var UNSCOPABLES = wellKnownSymbol$
|
|
738
|
+
var UNSCOPABLES = wellKnownSymbol$6('unscopables');
|
|
740
739
|
var ArrayPrototype = Array.prototype;
|
|
741
740
|
|
|
742
741
|
// Array.prototype[@@unscopables]
|
|
@@ -744,7 +743,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
744
743
|
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
745
744
|
defineProperty$4(ArrayPrototype, UNSCOPABLES, {
|
|
746
745
|
configurable: true,
|
|
747
|
-
value: create$
|
|
746
|
+
value: create$2(null)
|
|
748
747
|
});
|
|
749
748
|
}
|
|
750
749
|
|
|
@@ -755,12 +754,12 @@ var addToUnscopables$1 = function (key) {
|
|
|
755
754
|
|
|
756
755
|
var iterators = {};
|
|
757
756
|
|
|
758
|
-
var global$
|
|
759
|
-
var isCallable$
|
|
757
|
+
var global$7 = global$e;
|
|
758
|
+
var isCallable$8 = isCallable$e;
|
|
760
759
|
|
|
761
|
-
var WeakMap$1 = global$
|
|
760
|
+
var WeakMap$1 = global$7.WeakMap;
|
|
762
761
|
|
|
763
|
-
var weakMapBasicDetection = isCallable$
|
|
762
|
+
var weakMapBasicDetection = isCallable$8(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
764
763
|
|
|
765
764
|
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
766
765
|
return {
|
|
@@ -783,17 +782,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
|
|
|
783
782
|
};
|
|
784
783
|
|
|
785
784
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
786
|
-
var global$
|
|
785
|
+
var global$6 = global$e;
|
|
787
786
|
var isObject$3 = isObject$8;
|
|
788
787
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
789
788
|
var hasOwn$6 = hasOwnProperty_1;
|
|
790
|
-
var shared = sharedStore.exports;
|
|
789
|
+
var shared$1 = sharedStore.exports;
|
|
791
790
|
var sharedKey$1 = sharedKey$3;
|
|
792
791
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
793
792
|
|
|
794
793
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
795
|
-
var TypeError$1 = global$
|
|
796
|
-
var WeakMap = global$
|
|
794
|
+
var TypeError$1 = global$6.TypeError;
|
|
795
|
+
var WeakMap = global$6.WeakMap;
|
|
797
796
|
var set, get, has;
|
|
798
797
|
|
|
799
798
|
var enforce = function (it) {
|
|
@@ -809,8 +808,8 @@ var getterFor = function (TYPE) {
|
|
|
809
808
|
};
|
|
810
809
|
};
|
|
811
810
|
|
|
812
|
-
if (NATIVE_WEAK_MAP || shared.state) {
|
|
813
|
-
var store$1 = shared.state || (shared.state = new WeakMap());
|
|
811
|
+
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
812
|
+
var store$1 = shared$1.state || (shared$1.state = new WeakMap());
|
|
814
813
|
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
815
814
|
store$1.get = store$1.get;
|
|
816
815
|
store$1.has = store$1.has;
|
|
@@ -872,7 +871,7 @@ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
|
872
871
|
} : $propertyIsEnumerable;
|
|
873
872
|
|
|
874
873
|
var DESCRIPTORS$4 = descriptors;
|
|
875
|
-
var call$
|
|
874
|
+
var call$3 = functionCall;
|
|
876
875
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
877
876
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
878
877
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
@@ -891,7 +890,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
891
890
|
if (IE8_DOM_DEFINE) try {
|
|
892
891
|
return $getOwnPropertyDescriptor(O, P);
|
|
893
892
|
} catch (error) { /* empty */ }
|
|
894
|
-
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$
|
|
893
|
+
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$3(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
895
894
|
};
|
|
896
895
|
|
|
897
896
|
var makeBuiltIn$2 = {exports: {}};
|
|
@@ -914,14 +913,14 @@ var functionName = {
|
|
|
914
913
|
CONFIGURABLE: CONFIGURABLE
|
|
915
914
|
};
|
|
916
915
|
|
|
917
|
-
var uncurryThis$
|
|
918
|
-
var isCallable$
|
|
916
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
917
|
+
var isCallable$7 = isCallable$e;
|
|
919
918
|
var store = sharedStore.exports;
|
|
920
919
|
|
|
921
|
-
var functionToString = uncurryThis$
|
|
920
|
+
var functionToString = uncurryThis$5(Function.toString);
|
|
922
921
|
|
|
923
922
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
924
|
-
if (!isCallable$
|
|
923
|
+
if (!isCallable$7(store.inspectSource)) {
|
|
925
924
|
store.inspectSource = function (it) {
|
|
926
925
|
return functionToString(it);
|
|
927
926
|
};
|
|
@@ -929,9 +928,9 @@ if (!isCallable$6(store.inspectSource)) {
|
|
|
929
928
|
|
|
930
929
|
var inspectSource$1 = store.inspectSource;
|
|
931
930
|
|
|
932
|
-
var uncurryThis$
|
|
933
|
-
var fails$
|
|
934
|
-
var isCallable$
|
|
931
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
932
|
+
var fails$7 = fails$e;
|
|
933
|
+
var isCallable$6 = isCallable$e;
|
|
935
934
|
var hasOwn$3 = hasOwnProperty_1;
|
|
936
935
|
var DESCRIPTORS$2 = descriptors;
|
|
937
936
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
@@ -939,23 +938,23 @@ var inspectSource = inspectSource$1;
|
|
|
939
938
|
var InternalStateModule$1 = internalState;
|
|
940
939
|
|
|
941
940
|
var enforceInternalState = InternalStateModule$1.enforce;
|
|
942
|
-
var getInternalState$
|
|
943
|
-
var $String$
|
|
941
|
+
var getInternalState$2 = InternalStateModule$1.get;
|
|
942
|
+
var $String$2 = String;
|
|
944
943
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
945
944
|
var defineProperty$3 = Object.defineProperty;
|
|
946
|
-
var stringSlice = uncurryThis$
|
|
947
|
-
var replace = uncurryThis$
|
|
948
|
-
var join = uncurryThis$
|
|
945
|
+
var stringSlice$1 = uncurryThis$4(''.slice);
|
|
946
|
+
var replace$1 = uncurryThis$4(''.replace);
|
|
947
|
+
var join = uncurryThis$4([].join);
|
|
949
948
|
|
|
950
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$
|
|
949
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$7(function () {
|
|
951
950
|
return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
952
951
|
});
|
|
953
952
|
|
|
954
953
|
var TEMPLATE = String(String).split('String');
|
|
955
954
|
|
|
956
955
|
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
957
|
-
if (stringSlice($String$
|
|
958
|
-
name = '[' + replace($String$
|
|
956
|
+
if (stringSlice$1($String$2(name), 0, 7) === 'Symbol(') {
|
|
957
|
+
name = '[' + replace$1($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
959
958
|
}
|
|
960
959
|
if (options && options.getter) name = 'get ' + name;
|
|
961
960
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -981,10 +980,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
981
980
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
982
981
|
// eslint-disable-next-line no-extend-native -- required
|
|
983
982
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
984
|
-
return isCallable$
|
|
983
|
+
return isCallable$6(this) && getInternalState$2(this).source || inspectSource(this);
|
|
985
984
|
}, 'toString');
|
|
986
985
|
|
|
987
|
-
var isCallable$
|
|
986
|
+
var isCallable$5 = isCallable$e;
|
|
988
987
|
var definePropertyModule$1 = objectDefineProperty;
|
|
989
988
|
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
990
989
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
@@ -993,7 +992,7 @@ var defineBuiltIn$3 = function (O, key, value, options) {
|
|
|
993
992
|
if (!options) options = {};
|
|
994
993
|
var simple = options.enumerable;
|
|
995
994
|
var name = options.name !== undefined ? options.name : key;
|
|
996
|
-
if (isCallable$
|
|
995
|
+
if (isCallable$5(value)) makeBuiltIn(value, name, options);
|
|
997
996
|
if (options.global) {
|
|
998
997
|
if (simple) O[key] = value;
|
|
999
998
|
else defineGlobalProperty$1(key, value);
|
|
@@ -1032,16 +1031,16 @@ var objectGetOwnPropertySymbols = {};
|
|
|
1032
1031
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1033
1032
|
|
|
1034
1033
|
var getBuiltIn = getBuiltIn$3;
|
|
1035
|
-
var uncurryThis$
|
|
1034
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
1036
1035
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1037
1036
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1038
|
-
var anObject = anObject$
|
|
1037
|
+
var anObject$1 = anObject$5;
|
|
1039
1038
|
|
|
1040
|
-
var concat$1 = uncurryThis$
|
|
1039
|
+
var concat$1 = uncurryThis$3([].concat);
|
|
1041
1040
|
|
|
1042
1041
|
// all object keys, includes non-enumerable and symbols
|
|
1043
1042
|
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1044
|
-
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
1043
|
+
var keys = getOwnPropertyNamesModule.f(anObject$1(it));
|
|
1045
1044
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1046
1045
|
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
1047
1046
|
};
|
|
@@ -1063,8 +1062,8 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
|
1063
1062
|
}
|
|
1064
1063
|
};
|
|
1065
1064
|
|
|
1066
|
-
var fails$
|
|
1067
|
-
var isCallable$
|
|
1065
|
+
var fails$6 = fails$e;
|
|
1066
|
+
var isCallable$4 = isCallable$e;
|
|
1068
1067
|
|
|
1069
1068
|
var replacement = /#|\.prototype\./;
|
|
1070
1069
|
|
|
@@ -1072,7 +1071,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
1072
1071
|
var value = data[normalize(feature)];
|
|
1073
1072
|
return value === POLYFILL ? true
|
|
1074
1073
|
: value === NATIVE ? false
|
|
1075
|
-
: isCallable$
|
|
1074
|
+
: isCallable$4(detection) ? fails$6(detection)
|
|
1076
1075
|
: !!detection;
|
|
1077
1076
|
};
|
|
1078
1077
|
|
|
@@ -1086,7 +1085,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
1086
1085
|
|
|
1087
1086
|
var isForced_1 = isForced$1;
|
|
1088
1087
|
|
|
1089
|
-
var global$
|
|
1088
|
+
var global$5 = global$e;
|
|
1090
1089
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1091
1090
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
1092
1091
|
var defineBuiltIn$2 = defineBuiltIn$3;
|
|
@@ -1115,11 +1114,11 @@ var _export = function (options, source) {
|
|
|
1115
1114
|
var STATIC = options.stat;
|
|
1116
1115
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1117
1116
|
if (GLOBAL) {
|
|
1118
|
-
target = global$
|
|
1117
|
+
target = global$5;
|
|
1119
1118
|
} else if (STATIC) {
|
|
1120
|
-
target = global$
|
|
1119
|
+
target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1121
1120
|
} else {
|
|
1122
|
-
target = global$
|
|
1121
|
+
target = global$5[TARGET] && global$5[TARGET].prototype;
|
|
1123
1122
|
}
|
|
1124
1123
|
if (target) for (key in source) {
|
|
1125
1124
|
sourceProperty = source[key];
|
|
@@ -1141,9 +1140,9 @@ var _export = function (options, source) {
|
|
|
1141
1140
|
}
|
|
1142
1141
|
};
|
|
1143
1142
|
|
|
1144
|
-
var fails$
|
|
1143
|
+
var fails$5 = fails$e;
|
|
1145
1144
|
|
|
1146
|
-
var correctPrototypeGetter = !fails$
|
|
1145
|
+
var correctPrototypeGetter = !fails$5(function () {
|
|
1147
1146
|
function F() { /* empty */ }
|
|
1148
1147
|
F.prototype.constructor = null;
|
|
1149
1148
|
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
@@ -1151,35 +1150,35 @@ var correctPrototypeGetter = !fails$2(function () {
|
|
|
1151
1150
|
});
|
|
1152
1151
|
|
|
1153
1152
|
var hasOwn$1 = hasOwnProperty_1;
|
|
1154
|
-
var isCallable$
|
|
1153
|
+
var isCallable$3 = isCallable$e;
|
|
1155
1154
|
var toObject$1 = toObject$3;
|
|
1156
1155
|
var sharedKey = sharedKey$3;
|
|
1157
1156
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1158
1157
|
|
|
1159
1158
|
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1160
|
-
var $Object = Object;
|
|
1161
|
-
var ObjectPrototype = $Object.prototype;
|
|
1159
|
+
var $Object$1 = Object;
|
|
1160
|
+
var ObjectPrototype = $Object$1.prototype;
|
|
1162
1161
|
|
|
1163
1162
|
// `Object.getPrototypeOf` method
|
|
1164
1163
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1165
1164
|
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1166
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
|
1165
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1167
1166
|
var object = toObject$1(O);
|
|
1168
1167
|
if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
|
|
1169
1168
|
var constructor = object.constructor;
|
|
1170
|
-
if (isCallable$
|
|
1169
|
+
if (isCallable$3(constructor) && object instanceof constructor) {
|
|
1171
1170
|
return constructor.prototype;
|
|
1172
|
-
} return object instanceof $Object ? ObjectPrototype : null;
|
|
1171
|
+
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1173
1172
|
};
|
|
1174
1173
|
|
|
1175
|
-
var fails$
|
|
1176
|
-
var isCallable$
|
|
1174
|
+
var fails$4 = fails$e;
|
|
1175
|
+
var isCallable$2 = isCallable$e;
|
|
1177
1176
|
var isObject$2 = isObject$8;
|
|
1178
1177
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1179
1178
|
var defineBuiltIn$1 = defineBuiltIn$3;
|
|
1180
|
-
var wellKnownSymbol$
|
|
1179
|
+
var wellKnownSymbol$5 = wellKnownSymbol$8;
|
|
1181
1180
|
|
|
1182
|
-
var ITERATOR$2 = wellKnownSymbol$
|
|
1181
|
+
var ITERATOR$2 = wellKnownSymbol$5('iterator');
|
|
1183
1182
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1184
1183
|
|
|
1185
1184
|
// `%IteratorPrototype%` object
|
|
@@ -1197,7 +1196,7 @@ if ([].keys) {
|
|
|
1197
1196
|
}
|
|
1198
1197
|
}
|
|
1199
1198
|
|
|
1200
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$
|
|
1199
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$4(function () {
|
|
1201
1200
|
var test = {};
|
|
1202
1201
|
// FF44- legacy iterators case
|
|
1203
1202
|
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
@@ -1207,7 +1206,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
|
1207
1206
|
|
|
1208
1207
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1209
1208
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1210
|
-
if (!isCallable$
|
|
1209
|
+
if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
|
|
1211
1210
|
defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1212
1211
|
return this;
|
|
1213
1212
|
});
|
|
@@ -1220,19 +1219,19 @@ var iteratorsCore = {
|
|
|
1220
1219
|
|
|
1221
1220
|
var defineProperty$2 = objectDefineProperty.f;
|
|
1222
1221
|
var hasOwn = hasOwnProperty_1;
|
|
1223
|
-
var wellKnownSymbol$
|
|
1222
|
+
var wellKnownSymbol$4 = wellKnownSymbol$8;
|
|
1224
1223
|
|
|
1225
|
-
var TO_STRING_TAG = wellKnownSymbol$
|
|
1224
|
+
var TO_STRING_TAG$2 = wellKnownSymbol$4('toStringTag');
|
|
1226
1225
|
|
|
1227
1226
|
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1228
1227
|
if (target && !STATIC) target = target.prototype;
|
|
1229
|
-
if (target && !hasOwn(target, TO_STRING_TAG)) {
|
|
1230
|
-
defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
1228
|
+
if (target && !hasOwn(target, TO_STRING_TAG$2)) {
|
|
1229
|
+
defineProperty$2(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1231
1230
|
}
|
|
1232
1231
|
};
|
|
1233
1232
|
|
|
1234
1233
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1235
|
-
var create = objectCreate;
|
|
1234
|
+
var create$1 = objectCreate;
|
|
1236
1235
|
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1237
1236
|
var setToStringTag$2 = setToStringTag$3;
|
|
1238
1237
|
var Iterators$2 = iterators;
|
|
@@ -1241,19 +1240,19 @@ var returnThis$1 = function () { return this; };
|
|
|
1241
1240
|
|
|
1242
1241
|
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1243
1242
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1244
|
-
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1243
|
+
IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1245
1244
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1246
1245
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1247
1246
|
return IteratorConstructor;
|
|
1248
1247
|
};
|
|
1249
1248
|
|
|
1250
|
-
var uncurryThis$
|
|
1249
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1251
1250
|
var aCallable = aCallable$2;
|
|
1252
1251
|
|
|
1253
1252
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1254
1253
|
try {
|
|
1255
1254
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1256
|
-
return uncurryThis$
|
|
1255
|
+
return uncurryThis$2(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1257
1256
|
} catch (error) { /* empty */ }
|
|
1258
1257
|
};
|
|
1259
1258
|
|
|
@@ -1265,12 +1264,12 @@ var isPossiblePrototype$1 = function (argument) {
|
|
|
1265
1264
|
|
|
1266
1265
|
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1267
1266
|
|
|
1268
|
-
var $String = String;
|
|
1267
|
+
var $String$1 = String;
|
|
1269
1268
|
var $TypeError = TypeError;
|
|
1270
1269
|
|
|
1271
1270
|
var aPossiblePrototype$1 = function (argument) {
|
|
1272
1271
|
if (isPossiblePrototype(argument)) return argument;
|
|
1273
|
-
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
|
1272
|
+
throw new $TypeError("Can't set " + $String$1(argument) + ' as a prototype');
|
|
1274
1273
|
};
|
|
1275
1274
|
|
|
1276
1275
|
/* eslint-disable no-proto -- safe */
|
|
@@ -1302,17 +1301,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1302
1301
|
};
|
|
1303
1302
|
}() : undefined);
|
|
1304
1303
|
|
|
1305
|
-
var $$
|
|
1306
|
-
var call$
|
|
1304
|
+
var $$2 = _export;
|
|
1305
|
+
var call$2 = functionCall;
|
|
1307
1306
|
var FunctionName = functionName;
|
|
1308
|
-
var isCallable = isCallable$
|
|
1307
|
+
var isCallable$1 = isCallable$e;
|
|
1309
1308
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1310
1309
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1311
1310
|
var setPrototypeOf = objectSetPrototypeOf;
|
|
1312
1311
|
var setToStringTag$1 = setToStringTag$3;
|
|
1313
1312
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
|
|
1314
1313
|
var defineBuiltIn = defineBuiltIn$3;
|
|
1315
|
-
var wellKnownSymbol$
|
|
1314
|
+
var wellKnownSymbol$3 = wellKnownSymbol$8;
|
|
1316
1315
|
var Iterators$1 = iterators;
|
|
1317
1316
|
var IteratorsCore = iteratorsCore;
|
|
1318
1317
|
|
|
@@ -1320,7 +1319,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
|
1320
1319
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1321
1320
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1322
1321
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1323
|
-
var ITERATOR$1 = wellKnownSymbol$
|
|
1322
|
+
var ITERATOR$1 = wellKnownSymbol$3('iterator');
|
|
1324
1323
|
var KEYS = 'keys';
|
|
1325
1324
|
var VALUES = 'values';
|
|
1326
1325
|
var ENTRIES = 'entries';
|
|
@@ -1360,7 +1359,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1360
1359
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1361
1360
|
if (setPrototypeOf) {
|
|
1362
1361
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1363
|
-
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1362
|
+
} else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1364
1363
|
defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1365
1364
|
}
|
|
1366
1365
|
}
|
|
@@ -1375,7 +1374,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1375
1374
|
createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
|
1376
1375
|
} else {
|
|
1377
1376
|
INCORRECT_VALUES_NAME = true;
|
|
1378
|
-
defaultIterator = function values() { return call$
|
|
1377
|
+
defaultIterator = function values() { return call$2(nativeIterator, this); };
|
|
1379
1378
|
}
|
|
1380
1379
|
}
|
|
1381
1380
|
|
|
@@ -1390,7 +1389,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1390
1389
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1391
1390
|
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
|
1392
1391
|
}
|
|
1393
|
-
} else $$
|
|
1392
|
+
} else $$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1394
1393
|
}
|
|
1395
1394
|
|
|
1396
1395
|
// define iterator
|
|
@@ -1419,7 +1418,7 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
1419
1418
|
|
|
1420
1419
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1421
1420
|
var setInternalState = InternalStateModule.set;
|
|
1422
|
-
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1421
|
+
var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1423
1422
|
|
|
1424
1423
|
// `Array.prototype.entries` method
|
|
1425
1424
|
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
@@ -1441,7 +1440,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1441
1440
|
// `%ArrayIteratorPrototype%.next` method
|
|
1442
1441
|
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1443
1442
|
}, function () {
|
|
1444
|
-
var state = getInternalState(this);
|
|
1443
|
+
var state = getInternalState$1(this);
|
|
1445
1444
|
var target = state.target;
|
|
1446
1445
|
var index = state.index++;
|
|
1447
1446
|
if (!target || index >= target.length) {
|
|
@@ -1513,15 +1512,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1513
1512
|
|
|
1514
1513
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1515
1514
|
|
|
1516
|
-
var global$
|
|
1515
|
+
var global$4 = global$e;
|
|
1517
1516
|
var DOMIterables = domIterables;
|
|
1518
1517
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1519
1518
|
var ArrayIteratorMethods = es_array_iterator;
|
|
1520
1519
|
var createNonEnumerableProperty = createNonEnumerableProperty$4;
|
|
1521
1520
|
var setToStringTag = setToStringTag$3;
|
|
1522
|
-
var wellKnownSymbol = wellKnownSymbol$
|
|
1521
|
+
var wellKnownSymbol$2 = wellKnownSymbol$8;
|
|
1523
1522
|
|
|
1524
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
|
1523
|
+
var ITERATOR = wellKnownSymbol$2('iterator');
|
|
1525
1524
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1526
1525
|
|
|
1527
1526
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
@@ -1545,15 +1544,15 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1545
1544
|
};
|
|
1546
1545
|
|
|
1547
1546
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1548
|
-
handlePrototype(global$
|
|
1547
|
+
handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1549
1548
|
}
|
|
1550
1549
|
|
|
1551
1550
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1552
1551
|
|
|
1553
1552
|
var DESCRIPTORS = descriptors;
|
|
1554
|
-
var uncurryThis = functionUncurryThis;
|
|
1555
|
-
var call = functionCall;
|
|
1556
|
-
var fails = fails$
|
|
1553
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1554
|
+
var call$1 = functionCall;
|
|
1555
|
+
var fails$3 = fails$e;
|
|
1557
1556
|
var objectKeys = objectKeys$2;
|
|
1558
1557
|
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1559
1558
|
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
@@ -1564,11 +1563,11 @@ var IndexedObject = indexedObject;
|
|
|
1564
1563
|
var $assign = Object.assign;
|
|
1565
1564
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1566
1565
|
var defineProperty = Object.defineProperty;
|
|
1567
|
-
var concat = uncurryThis([].concat);
|
|
1566
|
+
var concat = uncurryThis$1([].concat);
|
|
1568
1567
|
|
|
1569
1568
|
// `Object.assign` method
|
|
1570
1569
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1571
|
-
var objectAssign = !$assign || fails(function () {
|
|
1570
|
+
var objectAssign = !$assign || fails$3(function () {
|
|
1572
1571
|
// should have correct order of operations (Edge bug)
|
|
1573
1572
|
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1574
1573
|
enumerable: true,
|
|
@@ -1602,27 +1601,26 @@ var objectAssign = !$assign || fails(function () {
|
|
|
1602
1601
|
var key;
|
|
1603
1602
|
while (length > j) {
|
|
1604
1603
|
key = keys[j++];
|
|
1605
|
-
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1604
|
+
if (!DESCRIPTORS || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1606
1605
|
}
|
|
1607
1606
|
} return T;
|
|
1608
1607
|
} : $assign;
|
|
1609
1608
|
|
|
1610
|
-
var
|
|
1609
|
+
var $$1 = _export;
|
|
1611
1610
|
var assign = objectAssign;
|
|
1612
1611
|
|
|
1613
1612
|
// `Object.assign` method
|
|
1614
1613
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1615
1614
|
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1616
|
-
|
|
1615
|
+
$$1({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1617
1616
|
assign: assign
|
|
1618
1617
|
});
|
|
1619
1618
|
|
|
1620
1619
|
let context;
|
|
1621
1620
|
const FormGroupContext = /*#__PURE__*/createContext({});
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
mappers
|
|
1625
|
-
debugMode: _debugMode = false
|
|
1621
|
+
const IsolatedContext = ({
|
|
1622
|
+
debugMode: _debugMode = false,
|
|
1623
|
+
mappers
|
|
1626
1624
|
}) => {
|
|
1627
1625
|
const formGroupInstance = useRef(new FormGroup());
|
|
1628
1626
|
const addFormWithIndex = index => {
|
|
@@ -1647,9 +1645,6 @@ const FormGroupContextProvider = ({
|
|
|
1647
1645
|
key
|
|
1648
1646
|
});
|
|
1649
1647
|
};
|
|
1650
|
-
const removeField = payload => {
|
|
1651
|
-
formGroupInstance.current.removeField(payload);
|
|
1652
|
-
};
|
|
1653
1648
|
const getForm = ({
|
|
1654
1649
|
key
|
|
1655
1650
|
}) => formGroupInstance.current.getForm({
|
|
@@ -1666,55 +1661,43 @@ const FormGroupContextProvider = ({
|
|
|
1666
1661
|
addForm,
|
|
1667
1662
|
getForm,
|
|
1668
1663
|
removeForm,
|
|
1669
|
-
removeField,
|
|
1670
1664
|
mappers,
|
|
1671
1665
|
formGroupInstance: formGroupInstance.current,
|
|
1672
1666
|
printFormGroupInstance,
|
|
1673
1667
|
submitMultipleFormsByIndex,
|
|
1674
|
-
debugMode: _debugMode
|
|
1668
|
+
debugMode: _debugMode,
|
|
1669
|
+
active: false
|
|
1675
1670
|
};
|
|
1671
|
+
return contextValue;
|
|
1672
|
+
};
|
|
1673
|
+
const FormGroupContextProvider = ({
|
|
1674
|
+
children,
|
|
1675
|
+
mappers,
|
|
1676
|
+
debugMode: _debugMode2 = false
|
|
1677
|
+
}) => {
|
|
1678
|
+
const contextValue = IsolatedContext({
|
|
1679
|
+
mappers,
|
|
1680
|
+
debugMode: _debugMode2
|
|
1681
|
+
});
|
|
1682
|
+
contextValue.debugMode = _debugMode2;
|
|
1683
|
+
contextValue.active = true;
|
|
1676
1684
|
return jsxs(FormGroupContext.Provider, {
|
|
1677
1685
|
value: contextValue,
|
|
1678
|
-
children: [
|
|
1686
|
+
children: [_debugMode2 && jsxs(Fragment, {
|
|
1679
1687
|
children: [jsx("button", {
|
|
1680
|
-
onClick: () => console.log(formGroupInstance),
|
|
1688
|
+
onClick: () => console.log(contextValue.formGroupInstance),
|
|
1681
1689
|
children: "printGroupInstance"
|
|
1682
1690
|
}), jsx("br", {}), jsx("hr", {})]
|
|
1683
1691
|
}), children]
|
|
1684
1692
|
});
|
|
1685
1693
|
};
|
|
1686
|
-
const useFormGroupContext =
|
|
1694
|
+
const useFormGroupContext = props => {
|
|
1687
1695
|
context = useContext(FormGroupContext);
|
|
1688
1696
|
if (Object.keys(context).length === 0) {
|
|
1689
|
-
return {
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
addForm: () => {
|
|
1694
|
-
//simulate context purpose
|
|
1695
|
-
},
|
|
1696
|
-
getForm: () => new FormCore({
|
|
1697
|
-
index: 'empty',
|
|
1698
|
-
mappers: []
|
|
1699
|
-
}),
|
|
1700
|
-
removeForm: () => {
|
|
1701
|
-
//simulate context purpose
|
|
1702
|
-
},
|
|
1703
|
-
removeField: () => {
|
|
1704
|
-
//simulate context purpose
|
|
1705
|
-
},
|
|
1706
|
-
mappers: [],
|
|
1707
|
-
formGroupInstance: new FormGroup(),
|
|
1708
|
-
printFormGroupInstance: () => {
|
|
1709
|
-
//simulate context purpose
|
|
1710
|
-
},
|
|
1711
|
-
submitMultipleFormsByIndex: () => ({
|
|
1712
|
-
erroredFields: [],
|
|
1713
|
-
isValid: false,
|
|
1714
|
-
values: {}
|
|
1715
|
-
}),
|
|
1716
|
-
debugMode: false
|
|
1717
|
-
};
|
|
1697
|
+
return IsolatedContext({
|
|
1698
|
+
debugMode: props.debugMode,
|
|
1699
|
+
mappers: props.mappers
|
|
1700
|
+
});
|
|
1718
1701
|
}
|
|
1719
1702
|
return context;
|
|
1720
1703
|
};
|
|
@@ -1722,12 +1705,11 @@ const useFormGroupContext = () => {
|
|
|
1722
1705
|
const FieldWrapperComponentRender = ({
|
|
1723
1706
|
props,
|
|
1724
1707
|
fieldInstance,
|
|
1725
|
-
children
|
|
1726
|
-
mapper
|
|
1708
|
+
children
|
|
1727
1709
|
}) => {
|
|
1728
1710
|
var _a, _b, _c;
|
|
1729
|
-
const Component = (
|
|
1730
|
-
const Asynccomponent = (
|
|
1711
|
+
const Component = (_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.component;
|
|
1712
|
+
const Asynccomponent = (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _b === void 0 ? void 0 : _b.asynccomponent;
|
|
1731
1713
|
if (Component) return jsx(Component, Object.assign({}, props, {
|
|
1732
1714
|
children: children && children
|
|
1733
1715
|
}));
|
|
@@ -1737,21 +1719,22 @@ const FieldWrapperComponentRender = ({
|
|
|
1737
1719
|
}))
|
|
1738
1720
|
});
|
|
1739
1721
|
return jsx("div", {
|
|
1740
|
-
children: `failed to render field ${fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.name} with
|
|
1722
|
+
children: `failed to render field ${fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.name} with componentName:${(_c = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _c === void 0 ? void 0 : _c.componentName}, please check mappers`
|
|
1741
1723
|
});
|
|
1742
1724
|
};
|
|
1743
1725
|
const FieldWrapper = ({
|
|
1744
1726
|
name,
|
|
1745
1727
|
formIndex,
|
|
1746
1728
|
children,
|
|
1747
|
-
|
|
1748
|
-
|
|
1729
|
+
props,
|
|
1730
|
+
context
|
|
1749
1731
|
}) => {
|
|
1750
1732
|
var _a;
|
|
1733
|
+
const localContext = useFormGroupContext({});
|
|
1751
1734
|
const {
|
|
1752
1735
|
formGroupInstance,
|
|
1753
1736
|
debugMode
|
|
1754
|
-
} =
|
|
1737
|
+
} = useMemo(() => context ? context : localContext, [context, localContext]);
|
|
1755
1738
|
const fieldInstance = (_a = formGroupInstance.getForm({
|
|
1756
1739
|
key: formIndex
|
|
1757
1740
|
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
@@ -1760,7 +1743,7 @@ const FieldWrapper = ({
|
|
|
1760
1743
|
const [valueState, setValueState] = useState(fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue);
|
|
1761
1744
|
const [state, setState] = useState({
|
|
1762
1745
|
visibility: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.visibility) || true,
|
|
1763
|
-
props: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.props) ||
|
|
1746
|
+
props: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.props) || props,
|
|
1764
1747
|
apiResponse: fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.api
|
|
1765
1748
|
});
|
|
1766
1749
|
useEffect(() => {
|
|
@@ -1826,9 +1809,8 @@ const FieldWrapper = ({
|
|
|
1826
1809
|
children: name
|
|
1827
1810
|
}), jsx("br", {}), jsx("hr", {})]
|
|
1828
1811
|
}), jsx(FieldWrapperComponentRender, {
|
|
1829
|
-
props: Object.assign(Object.assign(Object.assign({}, state.props),
|
|
1812
|
+
props: Object.assign(Object.assign(Object.assign({}, mapProps), state.props), mapValue),
|
|
1830
1813
|
fieldInstance: fieldInstance,
|
|
1831
|
-
mapper: mapper,
|
|
1832
1814
|
children: children && children
|
|
1833
1815
|
})]
|
|
1834
1816
|
}) : jsx(Fragment, {});
|
|
@@ -1876,72 +1858,77 @@ const BuildAsFormFieldTree = ({
|
|
|
1876
1858
|
});
|
|
1877
1859
|
};
|
|
1878
1860
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1861
|
+
/******************************************************************************
|
|
1862
|
+
Copyright (c) Microsoft Corporation.
|
|
1863
|
+
|
|
1864
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1865
|
+
purpose with or without fee is hereby granted.
|
|
1866
|
+
|
|
1867
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1868
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1869
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1870
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1871
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1872
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1873
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1874
|
+
***************************************************************************** */
|
|
1875
|
+
|
|
1876
|
+
function __rest(s, e) {
|
|
1877
|
+
var t = {};
|
|
1878
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1879
|
+
t[p] = s[p];
|
|
1880
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1881
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1882
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1883
|
+
t[p[i]] = s[p[i]];
|
|
1884
|
+
}
|
|
1885
|
+
return t;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1889
|
+
var e = new Error(message);
|
|
1890
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1905
1891
|
};
|
|
1906
1892
|
|
|
1907
|
-
const
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1893
|
+
const eventsMapping = {
|
|
1894
|
+
ON_FIELD_CHANGE: 'onChange',
|
|
1895
|
+
ON_FIELD_BLUR: 'onBlur',
|
|
1896
|
+
ON_FIELD_FOCUS: 'onFocus',
|
|
1897
|
+
ON_FIELD_KEYDOWN: 'onKeyDown',
|
|
1898
|
+
ON_FIELD_KEYUP: 'onKeyUp',
|
|
1899
|
+
ON_FIELD_MOUNT: 'onMount',
|
|
1900
|
+
ON_API_FIELD_RESPONSE: 'onApiResponse',
|
|
1901
|
+
ON_FIELD_CLICK: 'onClick'
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
const useForm = _a => {
|
|
1905
|
+
var {
|
|
1906
|
+
id
|
|
1907
|
+
} = _a,
|
|
1908
|
+
rest = __rest(_a, ["id"]);
|
|
1918
1909
|
const {
|
|
1919
1910
|
formGroupInstance
|
|
1920
|
-
} = useFormGroupContext();
|
|
1921
|
-
const
|
|
1911
|
+
} = useFormGroupContext({});
|
|
1912
|
+
const callbackRefs = useRef(rest);
|
|
1913
|
+
useEffect(() => {
|
|
1914
|
+
callbackRefs.current = rest;
|
|
1915
|
+
}, [rest]);
|
|
1922
1916
|
useEffect(() => {
|
|
1923
|
-
|
|
1917
|
+
var _a;
|
|
1918
|
+
const callback = payload => {
|
|
1919
|
+
var _a, _b;
|
|
1920
|
+
const eventMapping = eventsMapping[payload.event];
|
|
1921
|
+
if (eventMapping && callbackRefs.current[eventMapping]) {
|
|
1922
|
+
(_b = (_a = callbackRefs.current)[eventMapping]) === null || _b === void 0 ? void 0 : _b.call(_a, payload);
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
const sub = (_a = formGroupInstance.getForm({
|
|
1924
1926
|
key: id
|
|
1927
|
+
})) === null || _a === void 0 ? void 0 : _a.subscribeFieldEvent({
|
|
1928
|
+
callback
|
|
1925
1929
|
});
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
eventsCallbackMappings: {
|
|
1929
|
-
onApiResponse,
|
|
1930
|
-
onBlur,
|
|
1931
|
-
onChange,
|
|
1932
|
-
onClick,
|
|
1933
|
-
onFocus,
|
|
1934
|
-
onKeyDown,
|
|
1935
|
-
onKeyUp,
|
|
1936
|
-
onMount
|
|
1937
|
-
},
|
|
1938
|
-
formInstance
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
return () => {
|
|
1942
|
-
subscriptions.current.forEach(sub => sub.unsubscribe());
|
|
1943
|
-
};
|
|
1944
|
-
}, [id, onApiResponse, onBlur, onChange, onClick, onFocus, onKeyDown, onKeyUp, onMount]);
|
|
1930
|
+
return () => sub === null || sub === void 0 ? void 0 : sub.unsubscribe();
|
|
1931
|
+
}, []);
|
|
1945
1932
|
return;
|
|
1946
1933
|
};
|
|
1947
1934
|
|
|
@@ -1970,20 +1957,9 @@ const Form = ({
|
|
|
1970
1957
|
getForm,
|
|
1971
1958
|
mappers,
|
|
1972
1959
|
debugMode
|
|
1973
|
-
} = useFormGroupContext();
|
|
1960
|
+
} = useFormGroupContext({});
|
|
1974
1961
|
const [tree, setTree] = useState();
|
|
1975
1962
|
const schemaIndex = useMemo(() => index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange', [index, schema]);
|
|
1976
|
-
useForm({
|
|
1977
|
-
id: index,
|
|
1978
|
-
onApiResponse,
|
|
1979
|
-
onBlur,
|
|
1980
|
-
onChange,
|
|
1981
|
-
onClick,
|
|
1982
|
-
onFocus,
|
|
1983
|
-
onKeyDown,
|
|
1984
|
-
onKeyUp,
|
|
1985
|
-
onMount
|
|
1986
|
-
});
|
|
1987
1963
|
useEffect(() => {
|
|
1988
1964
|
if (schemaIndex === 'defaultChange') {
|
|
1989
1965
|
console.warn('please, add an unique id to the form, otherwise multiple forms will break');
|
|
@@ -2036,6 +2012,17 @@ const Form = ({
|
|
|
2036
2012
|
key: index
|
|
2037
2013
|
}).iVars = iVars;
|
|
2038
2014
|
}, [iVars]);
|
|
2015
|
+
useForm({
|
|
2016
|
+
id: schemaIndex,
|
|
2017
|
+
onApiResponse,
|
|
2018
|
+
onBlur,
|
|
2019
|
+
onChange,
|
|
2020
|
+
onClick,
|
|
2021
|
+
onFocus,
|
|
2022
|
+
onKeyDown,
|
|
2023
|
+
onKeyUp,
|
|
2024
|
+
onMount
|
|
2025
|
+
});
|
|
2039
2026
|
/*
|
|
2040
2027
|
@TODO move this logic inside form-core, add action and method onto form element,
|
|
2041
2028
|
might need a ref of the form to collect all the form parameters when there is a
|
|
@@ -2085,55 +2072,304 @@ const AsFormField = props => {
|
|
|
2085
2072
|
});
|
|
2086
2073
|
};
|
|
2087
2074
|
|
|
2075
|
+
var wellKnownSymbol$1 = wellKnownSymbol$8;
|
|
2076
|
+
|
|
2077
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
|
|
2078
|
+
var test = {};
|
|
2079
|
+
|
|
2080
|
+
test[TO_STRING_TAG$1] = 'z';
|
|
2081
|
+
|
|
2082
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
2083
|
+
|
|
2084
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
2085
|
+
var isCallable = isCallable$e;
|
|
2086
|
+
var classofRaw = classofRaw$1;
|
|
2087
|
+
var wellKnownSymbol = wellKnownSymbol$8;
|
|
2088
|
+
|
|
2089
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
2090
|
+
var $Object = Object;
|
|
2091
|
+
|
|
2092
|
+
// ES3 wrong here
|
|
2093
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
2094
|
+
|
|
2095
|
+
// fallback for IE11 Script Access Denied error
|
|
2096
|
+
var tryGet = function (it, key) {
|
|
2097
|
+
try {
|
|
2098
|
+
return it[key];
|
|
2099
|
+
} catch (error) { /* empty */ }
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
2103
|
+
var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
2104
|
+
var O, tag, result;
|
|
2105
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
2106
|
+
// @@toStringTag case
|
|
2107
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
2108
|
+
// builtinTag case
|
|
2109
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
2110
|
+
// ES3 arguments fallback
|
|
2111
|
+
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2114
|
+
var classof = classof$1;
|
|
2115
|
+
|
|
2116
|
+
var $String = String;
|
|
2117
|
+
|
|
2118
|
+
var toString$1 = function (argument) {
|
|
2119
|
+
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
2120
|
+
return $String(argument);
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
var anObject = anObject$5;
|
|
2124
|
+
|
|
2125
|
+
// `RegExp.prototype.flags` getter implementation
|
|
2126
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
2127
|
+
var regexpFlags$1 = function () {
|
|
2128
|
+
var that = anObject(this);
|
|
2129
|
+
var result = '';
|
|
2130
|
+
if (that.hasIndices) result += 'd';
|
|
2131
|
+
if (that.global) result += 'g';
|
|
2132
|
+
if (that.ignoreCase) result += 'i';
|
|
2133
|
+
if (that.multiline) result += 'm';
|
|
2134
|
+
if (that.dotAll) result += 's';
|
|
2135
|
+
if (that.unicode) result += 'u';
|
|
2136
|
+
if (that.unicodeSets) result += 'v';
|
|
2137
|
+
if (that.sticky) result += 'y';
|
|
2138
|
+
return result;
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
var fails$2 = fails$e;
|
|
2142
|
+
var global$3 = global$e;
|
|
2143
|
+
|
|
2144
|
+
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
2145
|
+
var $RegExp$2 = global$3.RegExp;
|
|
2146
|
+
|
|
2147
|
+
var UNSUPPORTED_Y$1 = fails$2(function () {
|
|
2148
|
+
var re = $RegExp$2('a', 'y');
|
|
2149
|
+
re.lastIndex = 2;
|
|
2150
|
+
return re.exec('abcd') !== null;
|
|
2151
|
+
});
|
|
2152
|
+
|
|
2153
|
+
// UC Browser bug
|
|
2154
|
+
// https://github.com/zloirock/core-js/issues/1008
|
|
2155
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2156
|
+
return !$RegExp$2('a', 'y').sticky;
|
|
2157
|
+
});
|
|
2158
|
+
|
|
2159
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2160
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
2161
|
+
var re = $RegExp$2('^r', 'gy');
|
|
2162
|
+
re.lastIndex = 2;
|
|
2163
|
+
return re.exec('str') !== null;
|
|
2164
|
+
});
|
|
2165
|
+
|
|
2166
|
+
var regexpStickyHelpers = {
|
|
2167
|
+
BROKEN_CARET: BROKEN_CARET,
|
|
2168
|
+
MISSED_STICKY: MISSED_STICKY,
|
|
2169
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
var fails$1 = fails$e;
|
|
2173
|
+
var global$2 = global$e;
|
|
2174
|
+
|
|
2175
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
2176
|
+
var $RegExp$1 = global$2.RegExp;
|
|
2177
|
+
|
|
2178
|
+
var regexpUnsupportedDotAll = fails$1(function () {
|
|
2179
|
+
var re = $RegExp$1('.', 's');
|
|
2180
|
+
return !(re.dotAll && re.test('\n') && re.flags === 's');
|
|
2181
|
+
});
|
|
2182
|
+
|
|
2183
|
+
var fails = fails$e;
|
|
2184
|
+
var global$1 = global$e;
|
|
2185
|
+
|
|
2186
|
+
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
2187
|
+
var $RegExp = global$1.RegExp;
|
|
2188
|
+
|
|
2189
|
+
var regexpUnsupportedNcg = fails(function () {
|
|
2190
|
+
var re = $RegExp('(?<a>b)', 'g');
|
|
2191
|
+
return re.exec('b').groups.a !== 'b' ||
|
|
2192
|
+
'b'.replace(re, '$<a>c') !== 'bc';
|
|
2193
|
+
});
|
|
2194
|
+
|
|
2195
|
+
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2196
|
+
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2197
|
+
var call = functionCall;
|
|
2198
|
+
var uncurryThis = functionUncurryThis;
|
|
2199
|
+
var toString = toString$1;
|
|
2200
|
+
var regexpFlags = regexpFlags$1;
|
|
2201
|
+
var stickyHelpers = regexpStickyHelpers;
|
|
2202
|
+
var shared = shared$4;
|
|
2203
|
+
var create = objectCreate;
|
|
2204
|
+
var getInternalState = internalState.get;
|
|
2205
|
+
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
2206
|
+
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
2207
|
+
|
|
2208
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2209
|
+
var nativeExec = RegExp.prototype.exec;
|
|
2210
|
+
var patchedExec = nativeExec;
|
|
2211
|
+
var charAt = uncurryThis(''.charAt);
|
|
2212
|
+
var indexOf = uncurryThis(''.indexOf);
|
|
2213
|
+
var replace = uncurryThis(''.replace);
|
|
2214
|
+
var stringSlice = uncurryThis(''.slice);
|
|
2215
|
+
|
|
2216
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2217
|
+
var re1 = /a/;
|
|
2218
|
+
var re2 = /b*/g;
|
|
2219
|
+
call(nativeExec, re1, 'a');
|
|
2220
|
+
call(nativeExec, re2, 'a');
|
|
2221
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2222
|
+
})();
|
|
2223
|
+
|
|
2224
|
+
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2225
|
+
|
|
2226
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2227
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2228
|
+
|
|
2229
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2230
|
+
|
|
2231
|
+
if (PATCH) {
|
|
2232
|
+
patchedExec = function exec(string) {
|
|
2233
|
+
var re = this;
|
|
2234
|
+
var state = getInternalState(re);
|
|
2235
|
+
var str = toString(string);
|
|
2236
|
+
var raw = state.raw;
|
|
2237
|
+
var result, reCopy, lastIndex, match, i, object, group;
|
|
2238
|
+
|
|
2239
|
+
if (raw) {
|
|
2240
|
+
raw.lastIndex = re.lastIndex;
|
|
2241
|
+
result = call(patchedExec, raw, str);
|
|
2242
|
+
re.lastIndex = raw.lastIndex;
|
|
2243
|
+
return result;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
var groups = state.groups;
|
|
2247
|
+
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2248
|
+
var flags = call(regexpFlags, re);
|
|
2249
|
+
var source = re.source;
|
|
2250
|
+
var charsAdded = 0;
|
|
2251
|
+
var strCopy = str;
|
|
2252
|
+
|
|
2253
|
+
if (sticky) {
|
|
2254
|
+
flags = replace(flags, 'y', '');
|
|
2255
|
+
if (indexOf(flags, 'g') === -1) {
|
|
2256
|
+
flags += 'g';
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
strCopy = stringSlice(str, re.lastIndex);
|
|
2260
|
+
// Support anchored sticky behavior.
|
|
2261
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
|
2262
|
+
source = '(?: ' + source + ')';
|
|
2263
|
+
strCopy = ' ' + strCopy;
|
|
2264
|
+
charsAdded++;
|
|
2265
|
+
}
|
|
2266
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2267
|
+
// simulate the 'y' flag.
|
|
2268
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
if (NPCG_INCLUDED) {
|
|
2272
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2273
|
+
}
|
|
2274
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2275
|
+
|
|
2276
|
+
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2277
|
+
|
|
2278
|
+
if (sticky) {
|
|
2279
|
+
if (match) {
|
|
2280
|
+
match.input = stringSlice(match.input, charsAdded);
|
|
2281
|
+
match[0] = stringSlice(match[0], charsAdded);
|
|
2282
|
+
match.index = re.lastIndex;
|
|
2283
|
+
re.lastIndex += match[0].length;
|
|
2284
|
+
} else re.lastIndex = 0;
|
|
2285
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2286
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2287
|
+
}
|
|
2288
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2289
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2290
|
+
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2291
|
+
call(nativeReplace, match[0], reCopy, function () {
|
|
2292
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
|
2293
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
|
2294
|
+
}
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
if (match && groups) {
|
|
2299
|
+
match.groups = object = create(null);
|
|
2300
|
+
for (i = 0; i < groups.length; i++) {
|
|
2301
|
+
group = groups[i];
|
|
2302
|
+
object[group[0]] = match[group[1]];
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
return match;
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
var regexpExec = patchedExec;
|
|
2311
|
+
|
|
2312
|
+
var $ = _export;
|
|
2313
|
+
var exec = regexpExec;
|
|
2314
|
+
|
|
2315
|
+
// `RegExp.prototype.exec` method
|
|
2316
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2317
|
+
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
2318
|
+
exec: exec
|
|
2319
|
+
});
|
|
2320
|
+
|
|
2088
2321
|
const AsFormFieldBuilder = props => {
|
|
2089
|
-
const {
|
|
2090
|
-
|
|
2091
|
-
addFormWithIndex,
|
|
2092
|
-
removeField
|
|
2093
|
-
} = useFormGroupContext();
|
|
2094
|
-
const [field, setField] = useState(jsx(Fragment, {}));
|
|
2322
|
+
const context = useFormGroupContext({});
|
|
2323
|
+
const [mounted, setMounted] = useState(false);
|
|
2095
2324
|
useEffect(() => {
|
|
2096
|
-
|
|
2097
|
-
|
|
2325
|
+
var _a;
|
|
2326
|
+
if (!((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2327
|
+
context.addFormWithIndex(props.formIndex);
|
|
2098
2328
|
}
|
|
2099
|
-
const
|
|
2329
|
+
const fieldSchema = Object.assign(Object.assign({}, props), {
|
|
2100
2330
|
component: props.mapper.componentName,
|
|
2101
2331
|
children: undefined
|
|
2102
2332
|
});
|
|
2103
|
-
const formInstance = formGroupInstance.forms.get(props.formIndex);
|
|
2104
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField(
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
this is executed right before the FieldWrapper mounts as expected
|
|
2108
|
-
but has the blinking problem allowing people to see the template
|
|
2109
|
-
format instead of the prop value
|
|
2110
|
-
*/
|
|
2111
|
-
setTimeout(() => {
|
|
2112
|
-
var _a;
|
|
2113
|
-
(_a = formInstance === null || formInstance === void 0 ? void 0 : formInstance.getField({
|
|
2114
|
-
key: props.name
|
|
2115
|
-
})) === null || _a === void 0 ? void 0 : _a.emitEvents({
|
|
2116
|
-
event: 'ON_FIELD_MOUNT'
|
|
2117
|
-
});
|
|
2118
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.refreshTemplates({
|
|
2119
|
-
key: props.name,
|
|
2120
|
-
event: 'ON_FIELDS'
|
|
2121
|
-
});
|
|
2122
|
-
}, 0);
|
|
2123
|
-
const field = jsx(FieldWrapper, {
|
|
2124
|
-
mapper: props.mapper,
|
|
2125
|
-
formIndex: props.formIndex,
|
|
2126
|
-
name: props.name,
|
|
2127
|
-
defaultProps: props.props,
|
|
2128
|
-
children: props.children && props.children
|
|
2333
|
+
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2334
|
+
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2335
|
+
fieldSchema,
|
|
2336
|
+
mapperElement: props.mapper
|
|
2129
2337
|
});
|
|
2130
|
-
|
|
2131
|
-
return () => removeField({
|
|
2132
|
-
|
|
2133
|
-
fieldIndex: props.name
|
|
2338
|
+
setMounted(true);
|
|
2339
|
+
return () => formInstance === null || formInstance === void 0 ? void 0 : formInstance.removeField({
|
|
2340
|
+
key: props.name
|
|
2134
2341
|
});
|
|
2135
2342
|
}, []);
|
|
2136
|
-
|
|
2343
|
+
/**
|
|
2344
|
+
* expensive function to allow both external props and templating work
|
|
2345
|
+
* evaluate if templating will be done onto form-engine or not
|
|
2346
|
+
*/
|
|
2347
|
+
useEffect(() => {
|
|
2348
|
+
var _a;
|
|
2349
|
+
if (!mounted) return;
|
|
2350
|
+
const field = (_a = context.formGroupInstance.forms.get(props.formIndex)) === null || _a === void 0 ? void 0 : _a.fields.get(props.name);
|
|
2351
|
+
const fieldProps = field === null || field === void 0 ? void 0 : field.props;
|
|
2352
|
+
if (props.props) {
|
|
2353
|
+
Object.keys(props.props).forEach(propKey => {
|
|
2354
|
+
var _a, _b;
|
|
2355
|
+
if (typeof ((_a = props.props) === null || _a === void 0 ? void 0 : _a[propKey]) === 'string' &&
|
|
2356
|
+
/**
|
|
2357
|
+
* need to check linting on build, this needs to be casted in order to build..
|
|
2358
|
+
*/
|
|
2359
|
+
/\$/.test((_b = props.props) === null || _b === void 0 ? void 0 : _b[propKey])) {
|
|
2360
|
+
delete props.props[propKey];
|
|
2361
|
+
}
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
field === null || field === void 0 ? void 0 : field.propsSubject$.next(Object.assign(Object.assign({}, fieldProps), props.props));
|
|
2365
|
+
}, [props.props]);
|
|
2366
|
+
return mounted ? jsx(FieldWrapper, {
|
|
2367
|
+
formIndex: props.formIndex,
|
|
2368
|
+
name: props.name,
|
|
2369
|
+
props: props.props,
|
|
2370
|
+
context: !context.active ? context : null,
|
|
2371
|
+
children: props.children && props.children
|
|
2372
|
+
}) : jsx(Fragment, {});
|
|
2137
2373
|
};
|
|
2138
2374
|
|
|
2139
2375
|
export { AsFormField, AsFormFieldBuilder, Form, FormGroupContext, FormGroupContextProvider, useFormGroupContext };
|