@bolttech/form-engine 3.1.0-beta.2 → 3.1.0-beta.20
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 +671 -1278
- package/package.json +3 -4
- package/src/components/AsFormFieldBuilder/AsFormFieldBuilder.type.d.ts +1 -0
- package/src/components/FieldWrapper/FieldWrapper.d.ts +1 -1
- package/src/components/FieldWrapper/FieldWrapper.type.d.ts +6 -2
- package/src/context/FormGroupContext.type.d.ts +3 -3
- package/src/generators/formBuilder.d.ts +8 -25
- package/src/helpers/mapper.d.ts +2 -1
- package/src/types/index.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useRef, useEffect, useState, useMemo, useCallback, Suspense } from 'react';
|
|
3
|
+
import { FormGroup, FormField } 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$b = 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$a = fails$b;
|
|
16
16
|
|
|
17
|
-
var functionBindNative = !fails$
|
|
17
|
+
var functionBindNative = !fails$a(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,39 +24,39 @@ 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$6 = FunctionPrototype$1.call;
|
|
28
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$6, call$6);
|
|
29
29
|
|
|
30
30
|
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
31
31
|
return function () {
|
|
32
|
-
return call$
|
|
32
|
+
return call$6.apply(fn, arguments);
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
var uncurryThis$
|
|
36
|
+
var uncurryThis$a = functionUncurryThis;
|
|
37
37
|
|
|
38
|
-
var toString$
|
|
39
|
-
var stringSlice$
|
|
38
|
+
var toString$1 = uncurryThis$a({}.toString);
|
|
39
|
+
var stringSlice$1 = uncurryThis$a(''.slice);
|
|
40
40
|
|
|
41
|
-
var classofRaw
|
|
42
|
-
return stringSlice$
|
|
41
|
+
var classofRaw = function (it) {
|
|
42
|
+
return stringSlice$1(toString$1(it), 8, -1);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var uncurryThis$
|
|
46
|
-
var fails$
|
|
47
|
-
var classof
|
|
45
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
46
|
+
var fails$9 = fails$b;
|
|
47
|
+
var classof = classofRaw;
|
|
48
48
|
|
|
49
|
-
var $Object$
|
|
50
|
-
var split = uncurryThis$
|
|
49
|
+
var $Object$3 = Object;
|
|
50
|
+
var split = uncurryThis$9(''.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$9(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
|
-
return !$Object$
|
|
56
|
+
return !$Object$3('z').propertyIsEnumerable(0);
|
|
57
57
|
}) ? function (it) {
|
|
58
|
-
return classof
|
|
59
|
-
} : $Object$
|
|
58
|
+
return classof(it) === 'String' ? split(it, '') : $Object$3(it);
|
|
59
|
+
} : $Object$3;
|
|
60
60
|
|
|
61
61
|
// we can't use just `it == null` since of `document.all` special case
|
|
62
62
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
@@ -66,21 +66,21 @@ var isNullOrUndefined$2 = function (it) {
|
|
|
66
66
|
|
|
67
67
|
var isNullOrUndefined$1 = isNullOrUndefined$2;
|
|
68
68
|
|
|
69
|
-
var $TypeError$
|
|
69
|
+
var $TypeError$6 = TypeError;
|
|
70
70
|
|
|
71
71
|
// `RequireObjectCoercible` abstract operation
|
|
72
72
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
73
|
-
var requireObjectCoercible$
|
|
74
|
-
if (isNullOrUndefined$1(it)) throw new $TypeError$
|
|
73
|
+
var requireObjectCoercible$3 = function (it) {
|
|
74
|
+
if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
|
|
75
75
|
return it;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
// toObject with fallback for non-array-like ES3 strings
|
|
79
79
|
var IndexedObject$1 = indexedObject;
|
|
80
|
-
var requireObjectCoercible$
|
|
80
|
+
var requireObjectCoercible$2 = requireObjectCoercible$3;
|
|
81
81
|
|
|
82
82
|
var toIndexedObject$5 = function (it) {
|
|
83
|
-
return IndexedObject$1(requireObjectCoercible$
|
|
83
|
+
return IndexedObject$1(requireObjectCoercible$2(it));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
var check = function (it) {
|
|
@@ -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
|
|
91
|
+
var globalThis_1 =
|
|
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,78 +101,83 @@ var global$e =
|
|
|
101
101
|
|
|
102
102
|
var sharedStore = {exports: {}};
|
|
103
103
|
|
|
104
|
-
var
|
|
104
|
+
var globalThis$c = globalThis_1;
|
|
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(
|
|
111
|
+
defineProperty$5(globalThis$c, key, { value: value, configurable: true, writable: true });
|
|
112
112
|
} catch (error) {
|
|
113
|
-
|
|
113
|
+
globalThis$c[key] = value;
|
|
114
114
|
} return value;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
var globalThis$
|
|
117
|
+
var globalThis$b = globalThis_1;
|
|
118
118
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
119
119
|
|
|
120
120
|
var SHARED = '__core-js_shared__';
|
|
121
|
-
var store$3 = sharedStore.exports = globalThis$
|
|
121
|
+
var store$3 = sharedStore.exports = globalThis$b[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
122
122
|
|
|
123
123
|
(store$3.versions || (store$3.versions = [])).push({
|
|
124
|
-
version: '3.
|
|
124
|
+
version: '3.39.0',
|
|
125
125
|
mode: 'global',
|
|
126
126
|
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
127
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
127
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE',
|
|
128
128
|
source: 'https://github.com/zloirock/core-js'
|
|
129
129
|
});
|
|
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
|
|
|
137
|
-
var requireObjectCoercible$
|
|
137
|
+
var requireObjectCoercible$1 = requireObjectCoercible$3;
|
|
138
138
|
|
|
139
|
-
var $Object$
|
|
139
|
+
var $Object$2 = Object;
|
|
140
140
|
|
|
141
141
|
// `ToObject` abstract operation
|
|
142
142
|
// https://tc39.es/ecma262/#sec-toobject
|
|
143
|
-
var toObject$
|
|
144
|
-
return $Object$
|
|
143
|
+
var toObject$3 = function (argument) {
|
|
144
|
+
return $Object$2(requireObjectCoercible$1(argument));
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
var uncurryThis$
|
|
148
|
-
var toObject$
|
|
147
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
148
|
+
var toObject$2 = toObject$3;
|
|
149
149
|
|
|
150
|
-
var hasOwnProperty = uncurryThis$
|
|
150
|
+
var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
|
|
151
151
|
|
|
152
152
|
// `HasOwnProperty` abstract operation
|
|
153
153
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
154
154
|
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
155
155
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
156
|
-
return hasOwnProperty(toObject$
|
|
156
|
+
return hasOwnProperty(toObject$2(it), key);
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
var uncurryThis$
|
|
159
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
160
160
|
|
|
161
161
|
var id = 0;
|
|
162
162
|
var postfix = Math.random();
|
|
163
|
-
var toString
|
|
163
|
+
var toString = uncurryThis$7(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(++id + postfix, 36);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
var
|
|
169
|
+
var globalThis$a = globalThis_1;
|
|
170
170
|
|
|
171
|
-
var
|
|
172
|
-
var userAgent$
|
|
171
|
+
var navigator = globalThis$a.navigator;
|
|
172
|
+
var userAgent$1 = navigator && navigator.userAgent;
|
|
173
173
|
|
|
174
|
-
var
|
|
175
|
-
|
|
174
|
+
var environmentUserAgent = userAgent$1 ? String(userAgent$1) : '';
|
|
175
|
+
|
|
176
|
+
var globalThis$9 = globalThis_1;
|
|
177
|
+
var userAgent = environmentUserAgent;
|
|
178
|
+
|
|
179
|
+
var process = globalThis$9.process;
|
|
180
|
+
var Deno = globalThis$9.Deno;
|
|
176
181
|
var versions = process && process.versions || Deno && Deno.version;
|
|
177
182
|
var v8 = versions && versions.v8;
|
|
178
183
|
var match, version;
|
|
@@ -186,31 +191,31 @@ if (v8) {
|
|
|
186
191
|
|
|
187
192
|
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
188
193
|
// so check `userAgent` even if `.v8` exists, but 0
|
|
189
|
-
if (!version && userAgent
|
|
190
|
-
match = userAgent
|
|
194
|
+
if (!version && userAgent) {
|
|
195
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
191
196
|
if (!match || match[1] >= 74) {
|
|
192
|
-
match = userAgent
|
|
197
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
193
198
|
if (match) version = +match[1];
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
var
|
|
202
|
+
var environmentV8Version = version;
|
|
198
203
|
|
|
199
204
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
200
|
-
var V8_VERSION =
|
|
201
|
-
var fails$
|
|
202
|
-
var
|
|
205
|
+
var V8_VERSION = environmentV8Version;
|
|
206
|
+
var fails$8 = fails$b;
|
|
207
|
+
var globalThis$8 = globalThis_1;
|
|
203
208
|
|
|
204
|
-
var $String$
|
|
209
|
+
var $String$4 = globalThis$8.String;
|
|
205
210
|
|
|
206
211
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
207
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$
|
|
212
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
|
|
208
213
|
var symbol = Symbol('symbol detection');
|
|
209
214
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
210
215
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
211
216
|
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
212
217
|
// of course, fail.
|
|
213
|
-
return !$String$
|
|
218
|
+
return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
214
219
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
215
220
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
216
221
|
});
|
|
@@ -218,24 +223,24 @@ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$e(func
|
|
|
218
223
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
219
224
|
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
220
225
|
|
|
221
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
var useSymbolAsUid = NATIVE_SYMBOL$1 &&
|
|
227
|
+
!Symbol.sham &&
|
|
228
|
+
typeof Symbol.iterator == 'symbol';
|
|
224
229
|
|
|
225
|
-
var
|
|
226
|
-
var shared$
|
|
227
|
-
var hasOwn$
|
|
230
|
+
var globalThis$7 = globalThis_1;
|
|
231
|
+
var shared$2 = shared$3;
|
|
232
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
228
233
|
var uid$1 = uid$2;
|
|
229
234
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
230
235
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
231
236
|
|
|
232
|
-
var Symbol$1 =
|
|
233
|
-
var WellKnownSymbolsStore = shared$
|
|
237
|
+
var Symbol$1 = globalThis$7.Symbol;
|
|
238
|
+
var WellKnownSymbolsStore = shared$2('wks');
|
|
234
239
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
235
240
|
|
|
236
|
-
var wellKnownSymbol$
|
|
237
|
-
if (!hasOwn$
|
|
238
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$
|
|
241
|
+
var wellKnownSymbol$6 = function (name) {
|
|
242
|
+
if (!hasOwn$8(WellKnownSymbolsStore, name)) {
|
|
243
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
|
|
239
244
|
? Symbol$1[name]
|
|
240
245
|
: createWellKnownSymbol('Symbol.' + name);
|
|
241
246
|
} return WellKnownSymbolsStore[name];
|
|
@@ -247,45 +252,45 @@ var documentAll = typeof document == 'object' && document.all;
|
|
|
247
252
|
// `IsCallable` abstract operation
|
|
248
253
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
249
254
|
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
250
|
-
var isCallable$
|
|
255
|
+
var isCallable$d = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
251
256
|
return typeof argument == 'function' || argument === documentAll;
|
|
252
257
|
} : function (argument) {
|
|
253
258
|
return typeof argument == 'function';
|
|
254
259
|
};
|
|
255
260
|
|
|
256
|
-
var isCallable$
|
|
261
|
+
var isCallable$c = isCallable$d;
|
|
257
262
|
|
|
258
|
-
var isObject$
|
|
259
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
263
|
+
var isObject$8 = function (it) {
|
|
264
|
+
return typeof it == 'object' ? it !== null : isCallable$c(it);
|
|
260
265
|
};
|
|
261
266
|
|
|
262
|
-
var isObject$
|
|
267
|
+
var isObject$7 = isObject$8;
|
|
263
268
|
|
|
264
|
-
var $String$
|
|
265
|
-
var $TypeError$
|
|
269
|
+
var $String$3 = String;
|
|
270
|
+
var $TypeError$5 = TypeError;
|
|
266
271
|
|
|
267
272
|
// `Assert: Type(argument) is Object`
|
|
268
|
-
var anObject$
|
|
269
|
-
if (isObject$
|
|
270
|
-
throw new $TypeError$
|
|
273
|
+
var anObject$4 = function (argument) {
|
|
274
|
+
if (isObject$7(argument)) return argument;
|
|
275
|
+
throw new $TypeError$5($String$3(argument) + ' is not an object');
|
|
271
276
|
};
|
|
272
277
|
|
|
273
278
|
var objectDefineProperties = {};
|
|
274
279
|
|
|
275
|
-
var fails$
|
|
280
|
+
var fails$7 = fails$b;
|
|
276
281
|
|
|
277
282
|
// Detect IE8's incomplete defineProperty implementation
|
|
278
|
-
var descriptors = !fails$
|
|
283
|
+
var descriptors = !fails$7(function () {
|
|
279
284
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
280
285
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
281
286
|
});
|
|
282
287
|
|
|
283
288
|
var DESCRIPTORS$9 = descriptors;
|
|
284
|
-
var fails$
|
|
289
|
+
var fails$6 = fails$b;
|
|
285
290
|
|
|
286
291
|
// V8 ~ Chrome 36-
|
|
287
292
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
288
|
-
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$
|
|
293
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$6(function () {
|
|
289
294
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
290
295
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
291
296
|
value: 42,
|
|
@@ -295,23 +300,23 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$c(function () {
|
|
|
295
300
|
|
|
296
301
|
var objectDefineProperty = {};
|
|
297
302
|
|
|
298
|
-
var
|
|
299
|
-
var isObject$
|
|
303
|
+
var globalThis$6 = globalThis_1;
|
|
304
|
+
var isObject$6 = isObject$8;
|
|
300
305
|
|
|
301
|
-
var document$1 =
|
|
306
|
+
var document$1 = globalThis$6.document;
|
|
302
307
|
// typeof document.createElement is 'object' in old IE
|
|
303
|
-
var EXISTS$1 = isObject$
|
|
308
|
+
var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
|
|
304
309
|
|
|
305
310
|
var documentCreateElement$2 = function (it) {
|
|
306
311
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
307
312
|
};
|
|
308
313
|
|
|
309
314
|
var DESCRIPTORS$8 = descriptors;
|
|
310
|
-
var fails$
|
|
315
|
+
var fails$5 = fails$b;
|
|
311
316
|
var createElement = documentCreateElement$2;
|
|
312
317
|
|
|
313
318
|
// Thanks to IE8 for its funny defineProperty
|
|
314
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$
|
|
319
|
+
var ie8DomDefine = !DESCRIPTORS$8 && !fails$5(function () {
|
|
315
320
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
316
321
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
317
322
|
get: function () { return 7; }
|
|
@@ -320,109 +325,109 @@ var ie8DomDefine = !DESCRIPTORS$8 && !fails$b(function () {
|
|
|
320
325
|
|
|
321
326
|
var NATIVE_BIND = functionBindNative;
|
|
322
327
|
|
|
323
|
-
var call$
|
|
328
|
+
var call$5 = Function.prototype.call;
|
|
324
329
|
|
|
325
|
-
var functionCall = NATIVE_BIND ? call$
|
|
326
|
-
return call$
|
|
330
|
+
var functionCall = NATIVE_BIND ? call$5.bind(call$5) : function () {
|
|
331
|
+
return call$5.apply(call$5, arguments);
|
|
327
332
|
};
|
|
328
333
|
|
|
329
|
-
var
|
|
330
|
-
var isCallable$
|
|
334
|
+
var globalThis$5 = globalThis_1;
|
|
335
|
+
var isCallable$b = isCallable$d;
|
|
331
336
|
|
|
332
337
|
var aFunction = function (argument) {
|
|
333
|
-
return isCallable$
|
|
338
|
+
return isCallable$b(argument) ? argument : undefined;
|
|
334
339
|
};
|
|
335
340
|
|
|
336
341
|
var getBuiltIn$3 = function (namespace, method) {
|
|
337
|
-
return arguments.length < 2 ? aFunction(
|
|
342
|
+
return arguments.length < 2 ? aFunction(globalThis$5[namespace]) : globalThis$5[namespace] && globalThis$5[namespace][method];
|
|
338
343
|
};
|
|
339
344
|
|
|
340
|
-
var uncurryThis$
|
|
345
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
341
346
|
|
|
342
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
347
|
+
var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
|
|
343
348
|
|
|
344
349
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
345
|
-
var isCallable$
|
|
346
|
-
var isPrototypeOf
|
|
350
|
+
var isCallable$a = isCallable$d;
|
|
351
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
347
352
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
348
353
|
|
|
349
|
-
var $Object$
|
|
354
|
+
var $Object$1 = Object;
|
|
350
355
|
|
|
351
356
|
var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
|
|
352
357
|
return typeof it == 'symbol';
|
|
353
358
|
} : function (it) {
|
|
354
359
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
355
|
-
return isCallable$
|
|
360
|
+
return isCallable$a($Symbol) && isPrototypeOf($Symbol.prototype, $Object$1(it));
|
|
356
361
|
};
|
|
357
362
|
|
|
358
|
-
var $String$
|
|
363
|
+
var $String$2 = String;
|
|
359
364
|
|
|
360
|
-
var tryToString$
|
|
365
|
+
var tryToString$1 = function (argument) {
|
|
361
366
|
try {
|
|
362
|
-
return $String$
|
|
367
|
+
return $String$2(argument);
|
|
363
368
|
} catch (error) {
|
|
364
369
|
return 'Object';
|
|
365
370
|
}
|
|
366
371
|
};
|
|
367
372
|
|
|
368
|
-
var isCallable$
|
|
369
|
-
var tryToString
|
|
373
|
+
var isCallable$9 = isCallable$d;
|
|
374
|
+
var tryToString = tryToString$1;
|
|
370
375
|
|
|
371
|
-
var $TypeError$
|
|
376
|
+
var $TypeError$4 = TypeError;
|
|
372
377
|
|
|
373
378
|
// `Assert: IsCallable(argument) is true`
|
|
374
|
-
var aCallable$
|
|
375
|
-
if (isCallable$
|
|
376
|
-
throw new $TypeError$
|
|
379
|
+
var aCallable$2 = function (argument) {
|
|
380
|
+
if (isCallable$9(argument)) return argument;
|
|
381
|
+
throw new $TypeError$4(tryToString(argument) + ' is not a function');
|
|
377
382
|
};
|
|
378
383
|
|
|
379
|
-
var aCallable$
|
|
384
|
+
var aCallable$1 = aCallable$2;
|
|
380
385
|
var isNullOrUndefined = isNullOrUndefined$2;
|
|
381
386
|
|
|
382
387
|
// `GetMethod` abstract operation
|
|
383
388
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
384
389
|
var getMethod$1 = function (V, P) {
|
|
385
390
|
var func = V[P];
|
|
386
|
-
return isNullOrUndefined(func) ? undefined : aCallable$
|
|
391
|
+
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
387
392
|
};
|
|
388
393
|
|
|
389
|
-
var call$
|
|
390
|
-
var isCallable$
|
|
391
|
-
var isObject$
|
|
394
|
+
var call$4 = functionCall;
|
|
395
|
+
var isCallable$8 = isCallable$d;
|
|
396
|
+
var isObject$5 = isObject$8;
|
|
392
397
|
|
|
393
|
-
var $TypeError$
|
|
398
|
+
var $TypeError$3 = TypeError;
|
|
394
399
|
|
|
395
400
|
// `OrdinaryToPrimitive` abstract operation
|
|
396
401
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
397
402
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
398
403
|
var fn, val;
|
|
399
|
-
if (pref === 'string' && isCallable$
|
|
400
|
-
if (isCallable$
|
|
401
|
-
if (pref !== 'string' && isCallable$
|
|
402
|
-
throw new $TypeError$
|
|
404
|
+
if (pref === 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
|
|
405
|
+
if (isCallable$8(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
|
|
406
|
+
if (pref !== 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
|
|
407
|
+
throw new $TypeError$3("Can't convert object to primitive value");
|
|
403
408
|
};
|
|
404
409
|
|
|
405
|
-
var call$
|
|
406
|
-
var isObject$
|
|
410
|
+
var call$3 = functionCall;
|
|
411
|
+
var isObject$4 = isObject$8;
|
|
407
412
|
var isSymbol$1 = isSymbol$2;
|
|
408
413
|
var getMethod = getMethod$1;
|
|
409
414
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
410
|
-
var wellKnownSymbol$
|
|
415
|
+
var wellKnownSymbol$5 = wellKnownSymbol$6;
|
|
411
416
|
|
|
412
|
-
var $TypeError$
|
|
413
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
417
|
+
var $TypeError$2 = TypeError;
|
|
418
|
+
var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
|
|
414
419
|
|
|
415
420
|
// `ToPrimitive` abstract operation
|
|
416
421
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
417
422
|
var toPrimitive$1 = function (input, pref) {
|
|
418
|
-
if (!isObject$
|
|
423
|
+
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
419
424
|
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
420
425
|
var result;
|
|
421
426
|
if (exoticToPrim) {
|
|
422
427
|
if (pref === undefined) pref = 'default';
|
|
423
|
-
result = call$
|
|
424
|
-
if (!isObject$
|
|
425
|
-
throw new $TypeError$
|
|
428
|
+
result = call$3(exoticToPrim, input, pref);
|
|
429
|
+
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
430
|
+
throw new $TypeError$2("Can't convert object to primitive value");
|
|
426
431
|
}
|
|
427
432
|
if (pref === undefined) pref = 'number';
|
|
428
433
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -441,10 +446,10 @@ var toPropertyKey$2 = function (argument) {
|
|
|
441
446
|
var DESCRIPTORS$7 = descriptors;
|
|
442
447
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
443
448
|
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
444
|
-
var anObject$
|
|
449
|
+
var anObject$3 = anObject$4;
|
|
445
450
|
var toPropertyKey$1 = toPropertyKey$2;
|
|
446
451
|
|
|
447
|
-
var $TypeError$
|
|
452
|
+
var $TypeError$1 = TypeError;
|
|
448
453
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
449
454
|
var $defineProperty = Object.defineProperty;
|
|
450
455
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -456,9 +461,9 @@ var WRITABLE = 'writable';
|
|
|
456
461
|
// `Object.defineProperty` method
|
|
457
462
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
458
463
|
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
459
|
-
anObject$
|
|
464
|
+
anObject$3(O);
|
|
460
465
|
P = toPropertyKey$1(P);
|
|
461
|
-
anObject$
|
|
466
|
+
anObject$3(Attributes);
|
|
462
467
|
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
463
468
|
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
464
469
|
if (current && current[WRITABLE]) {
|
|
@@ -471,26 +476,26 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
471
476
|
}
|
|
472
477
|
} return $defineProperty(O, P, Attributes);
|
|
473
478
|
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
474
|
-
anObject$
|
|
479
|
+
anObject$3(O);
|
|
475
480
|
P = toPropertyKey$1(P);
|
|
476
|
-
anObject$
|
|
481
|
+
anObject$3(Attributes);
|
|
477
482
|
if (IE8_DOM_DEFINE$1) try {
|
|
478
483
|
return $defineProperty(O, P, Attributes);
|
|
479
484
|
} catch (error) { /* empty */ }
|
|
480
|
-
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$
|
|
485
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
|
|
481
486
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
482
487
|
return O;
|
|
483
488
|
};
|
|
484
489
|
|
|
485
490
|
var ceil = Math.ceil;
|
|
486
|
-
var floor
|
|
491
|
+
var floor = Math.floor;
|
|
487
492
|
|
|
488
493
|
// `Math.trunc` method
|
|
489
494
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
490
495
|
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
491
496
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
492
497
|
var n = +x;
|
|
493
|
-
return (n > 0 ? floor
|
|
498
|
+
return (n > 0 ? floor : ceil)(n);
|
|
494
499
|
};
|
|
495
500
|
|
|
496
501
|
var trunc = mathTrunc;
|
|
@@ -506,44 +511,44 @@ var toIntegerOrInfinity$2 = function (argument) {
|
|
|
506
511
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
507
512
|
|
|
508
513
|
var max = Math.max;
|
|
509
|
-
var min$
|
|
514
|
+
var min$1 = Math.min;
|
|
510
515
|
|
|
511
516
|
// Helper for a popular repeating case of the spec:
|
|
512
517
|
// Let integer be ? ToInteger(index).
|
|
513
518
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
514
519
|
var toAbsoluteIndex$1 = function (index, length) {
|
|
515
520
|
var integer = toIntegerOrInfinity$1(index);
|
|
516
|
-
return integer < 0 ? max(integer + length, 0) : min$
|
|
521
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
517
522
|
};
|
|
518
523
|
|
|
519
524
|
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
520
525
|
|
|
521
|
-
var min
|
|
526
|
+
var min = Math.min;
|
|
522
527
|
|
|
523
528
|
// `ToLength` abstract operation
|
|
524
529
|
// https://tc39.es/ecma262/#sec-tolength
|
|
525
|
-
var toLength$
|
|
530
|
+
var toLength$1 = function (argument) {
|
|
526
531
|
var len = toIntegerOrInfinity(argument);
|
|
527
|
-
return len > 0 ? min
|
|
532
|
+
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
528
533
|
};
|
|
529
534
|
|
|
530
|
-
var toLength
|
|
535
|
+
var toLength = toLength$1;
|
|
531
536
|
|
|
532
537
|
// `LengthOfArrayLike` abstract operation
|
|
533
538
|
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
534
|
-
var lengthOfArrayLike$
|
|
535
|
-
return toLength
|
|
539
|
+
var lengthOfArrayLike$1 = function (obj) {
|
|
540
|
+
return toLength(obj.length);
|
|
536
541
|
};
|
|
537
542
|
|
|
538
543
|
var toIndexedObject$4 = toIndexedObject$5;
|
|
539
544
|
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
540
|
-
var lengthOfArrayLike
|
|
545
|
+
var lengthOfArrayLike = lengthOfArrayLike$1;
|
|
541
546
|
|
|
542
547
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
543
548
|
var createMethod = function (IS_INCLUDES) {
|
|
544
549
|
return function ($this, el, fromIndex) {
|
|
545
550
|
var O = toIndexedObject$4($this);
|
|
546
|
-
var length = lengthOfArrayLike
|
|
551
|
+
var length = lengthOfArrayLike(O);
|
|
547
552
|
if (length === 0) return !IS_INCLUDES && -1;
|
|
548
553
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
549
554
|
var value;
|
|
@@ -571,23 +576,23 @@ var arrayIncludes = {
|
|
|
571
576
|
|
|
572
577
|
var hiddenKeys$4 = {};
|
|
573
578
|
|
|
574
|
-
var uncurryThis$
|
|
575
|
-
var hasOwn$
|
|
579
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
580
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
576
581
|
var toIndexedObject$3 = toIndexedObject$5;
|
|
577
|
-
var indexOf
|
|
582
|
+
var indexOf = arrayIncludes.indexOf;
|
|
578
583
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
579
584
|
|
|
580
|
-
var push
|
|
585
|
+
var push = uncurryThis$5([].push);
|
|
581
586
|
|
|
582
587
|
var objectKeysInternal = function (object, names) {
|
|
583
588
|
var O = toIndexedObject$3(object);
|
|
584
589
|
var i = 0;
|
|
585
590
|
var result = [];
|
|
586
591
|
var key;
|
|
587
|
-
for (key in O) !hasOwn$
|
|
592
|
+
for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
|
|
588
593
|
// Don't enum bug & hidden keys
|
|
589
|
-
while (names.length > i) if (hasOwn$
|
|
590
|
-
~indexOf
|
|
594
|
+
while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
|
|
595
|
+
~indexOf(result, key) || push(result, key);
|
|
591
596
|
}
|
|
592
597
|
return result;
|
|
593
598
|
};
|
|
@@ -616,7 +621,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
616
621
|
var DESCRIPTORS$6 = descriptors;
|
|
617
622
|
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
618
623
|
var definePropertyModule$3 = objectDefineProperty;
|
|
619
|
-
var anObject$
|
|
624
|
+
var anObject$2 = anObject$4;
|
|
620
625
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
621
626
|
var objectKeys$1 = objectKeys$2;
|
|
622
627
|
|
|
@@ -624,7 +629,7 @@ var objectKeys$1 = objectKeys$2;
|
|
|
624
629
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
625
630
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
626
631
|
objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
627
|
-
anObject$
|
|
632
|
+
anObject$2(O);
|
|
628
633
|
var props = toIndexedObject$2(Properties);
|
|
629
634
|
var keys = objectKeys$1(Properties);
|
|
630
635
|
var length = keys.length;
|
|
@@ -638,17 +643,17 @@ var getBuiltIn$1 = getBuiltIn$3;
|
|
|
638
643
|
|
|
639
644
|
var html$1 = getBuiltIn$1('document', 'documentElement');
|
|
640
645
|
|
|
641
|
-
var shared$
|
|
646
|
+
var shared$1 = shared$3;
|
|
642
647
|
var uid = uid$2;
|
|
643
648
|
|
|
644
|
-
var keys = shared$
|
|
649
|
+
var keys = shared$1('keys');
|
|
645
650
|
|
|
646
651
|
var sharedKey$3 = function (key) {
|
|
647
652
|
return keys[key] || (keys[key] = uid(key));
|
|
648
653
|
};
|
|
649
654
|
|
|
650
655
|
/* global ActiveXObject -- old IE, WSH */
|
|
651
|
-
var anObject$
|
|
656
|
+
var anObject$1 = anObject$4;
|
|
652
657
|
var definePropertiesModule = objectDefineProperties;
|
|
653
658
|
var enumBugKeys$1 = enumBugKeys$3;
|
|
654
659
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
@@ -673,7 +678,8 @@ var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
|
673
678
|
activeXDocument.write(scriptTag(''));
|
|
674
679
|
activeXDocument.close();
|
|
675
680
|
var temp = activeXDocument.parentWindow.Object;
|
|
676
|
-
|
|
681
|
+
// eslint-disable-next-line no-useless-assignment -- avoid memory leak
|
|
682
|
+
activeXDocument = null;
|
|
677
683
|
return temp;
|
|
678
684
|
};
|
|
679
685
|
|
|
@@ -722,7 +728,7 @@ hiddenKeys$2[IE_PROTO$1] = true;
|
|
|
722
728
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
723
729
|
var result;
|
|
724
730
|
if (O !== null) {
|
|
725
|
-
EmptyConstructor[PROTOTYPE] = anObject$
|
|
731
|
+
EmptyConstructor[PROTOTYPE] = anObject$1(O);
|
|
726
732
|
result = new EmptyConstructor();
|
|
727
733
|
EmptyConstructor[PROTOTYPE] = null;
|
|
728
734
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
@@ -731,11 +737,11 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
731
737
|
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
732
738
|
};
|
|
733
739
|
|
|
734
|
-
var wellKnownSymbol$
|
|
735
|
-
var create$
|
|
740
|
+
var wellKnownSymbol$4 = wellKnownSymbol$6;
|
|
741
|
+
var create$1 = objectCreate;
|
|
736
742
|
var defineProperty$4 = objectDefineProperty.f;
|
|
737
743
|
|
|
738
|
-
var UNSCOPABLES = wellKnownSymbol$
|
|
744
|
+
var UNSCOPABLES = wellKnownSymbol$4('unscopables');
|
|
739
745
|
var ArrayPrototype = Array.prototype;
|
|
740
746
|
|
|
741
747
|
// Array.prototype[@@unscopables]
|
|
@@ -743,7 +749,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
743
749
|
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
744
750
|
defineProperty$4(ArrayPrototype, UNSCOPABLES, {
|
|
745
751
|
configurable: true,
|
|
746
|
-
value: create$
|
|
752
|
+
value: create$1(null)
|
|
747
753
|
});
|
|
748
754
|
}
|
|
749
755
|
|
|
@@ -754,12 +760,12 @@ var addToUnscopables$1 = function (key) {
|
|
|
754
760
|
|
|
755
761
|
var iterators = {};
|
|
756
762
|
|
|
757
|
-
var
|
|
758
|
-
var isCallable$
|
|
763
|
+
var globalThis$4 = globalThis_1;
|
|
764
|
+
var isCallable$7 = isCallable$d;
|
|
759
765
|
|
|
760
|
-
var WeakMap$1 =
|
|
766
|
+
var WeakMap$1 = globalThis$4.WeakMap;
|
|
761
767
|
|
|
762
|
-
var weakMapBasicDetection = isCallable$
|
|
768
|
+
var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
763
769
|
|
|
764
770
|
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
765
771
|
return {
|
|
@@ -782,17 +788,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
|
|
|
782
788
|
};
|
|
783
789
|
|
|
784
790
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
785
|
-
var
|
|
786
|
-
var isObject$
|
|
791
|
+
var globalThis$3 = globalThis_1;
|
|
792
|
+
var isObject$3 = isObject$8;
|
|
787
793
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
788
|
-
var hasOwn$
|
|
789
|
-
var shared
|
|
794
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
795
|
+
var shared = sharedStore.exports;
|
|
790
796
|
var sharedKey$1 = sharedKey$3;
|
|
791
797
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
792
798
|
|
|
793
799
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
794
|
-
var TypeError$1 =
|
|
795
|
-
var WeakMap =
|
|
800
|
+
var TypeError$1 = globalThis$3.TypeError;
|
|
801
|
+
var WeakMap = globalThis$3.WeakMap;
|
|
796
802
|
var set, get, has;
|
|
797
803
|
|
|
798
804
|
var enforce = function (it) {
|
|
@@ -802,14 +808,14 @@ var enforce = function (it) {
|
|
|
802
808
|
var getterFor = function (TYPE) {
|
|
803
809
|
return function (it) {
|
|
804
810
|
var state;
|
|
805
|
-
if (!isObject$
|
|
811
|
+
if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
|
|
806
812
|
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
807
813
|
} return state;
|
|
808
814
|
};
|
|
809
815
|
};
|
|
810
816
|
|
|
811
|
-
if (NATIVE_WEAK_MAP || shared
|
|
812
|
-
var store$1 = shared
|
|
817
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
818
|
+
var store$1 = shared.state || (shared.state = new WeakMap());
|
|
813
819
|
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
814
820
|
store$1.get = store$1.get;
|
|
815
821
|
store$1.has = store$1.has;
|
|
@@ -831,16 +837,16 @@ if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
|
831
837
|
var STATE = sharedKey$1('state');
|
|
832
838
|
hiddenKeys$1[STATE] = true;
|
|
833
839
|
set = function (it, metadata) {
|
|
834
|
-
if (hasOwn$
|
|
840
|
+
if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
835
841
|
metadata.facade = it;
|
|
836
842
|
createNonEnumerableProperty$3(it, STATE, metadata);
|
|
837
843
|
return metadata;
|
|
838
844
|
};
|
|
839
845
|
get = function (it) {
|
|
840
|
-
return hasOwn$
|
|
846
|
+
return hasOwn$6(it, STATE) ? it[STATE] : {};
|
|
841
847
|
};
|
|
842
848
|
has = function (it) {
|
|
843
|
-
return hasOwn$
|
|
849
|
+
return hasOwn$6(it, STATE);
|
|
844
850
|
};
|
|
845
851
|
}
|
|
846
852
|
|
|
@@ -858,25 +864,25 @@ var objectPropertyIsEnumerable = {};
|
|
|
858
864
|
|
|
859
865
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
860
866
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
861
|
-
var getOwnPropertyDescriptor$
|
|
867
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
862
868
|
|
|
863
869
|
// Nashorn ~ JDK8 bug
|
|
864
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$
|
|
870
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
865
871
|
|
|
866
872
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
867
873
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
868
874
|
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
869
|
-
var descriptor = getOwnPropertyDescriptor$
|
|
875
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
870
876
|
return !!descriptor && descriptor.enumerable;
|
|
871
877
|
} : $propertyIsEnumerable;
|
|
872
878
|
|
|
873
879
|
var DESCRIPTORS$4 = descriptors;
|
|
874
|
-
var call$
|
|
880
|
+
var call$2 = functionCall;
|
|
875
881
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
876
882
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
877
883
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
878
884
|
var toPropertyKey = toPropertyKey$2;
|
|
879
|
-
var hasOwn$
|
|
885
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
880
886
|
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
881
887
|
|
|
882
888
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -890,19 +896,19 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
890
896
|
if (IE8_DOM_DEFINE) try {
|
|
891
897
|
return $getOwnPropertyDescriptor(O, P);
|
|
892
898
|
} catch (error) { /* empty */ }
|
|
893
|
-
if (hasOwn$
|
|
899
|
+
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
894
900
|
};
|
|
895
901
|
|
|
896
902
|
var makeBuiltIn$2 = {exports: {}};
|
|
897
903
|
|
|
898
904
|
var DESCRIPTORS$3 = descriptors;
|
|
899
|
-
var hasOwn$
|
|
905
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
900
906
|
|
|
901
907
|
var FunctionPrototype = Function.prototype;
|
|
902
908
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
903
909
|
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
|
904
910
|
|
|
905
|
-
var EXISTS = hasOwn$
|
|
911
|
+
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
|
906
912
|
// additional protection from minified / mangled / dropped function names
|
|
907
913
|
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
908
914
|
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
@@ -913,14 +919,14 @@ var functionName = {
|
|
|
913
919
|
CONFIGURABLE: CONFIGURABLE
|
|
914
920
|
};
|
|
915
921
|
|
|
916
|
-
var uncurryThis$
|
|
917
|
-
var isCallable$
|
|
922
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
923
|
+
var isCallable$6 = isCallable$d;
|
|
918
924
|
var store = sharedStore.exports;
|
|
919
925
|
|
|
920
|
-
var functionToString = uncurryThis$
|
|
926
|
+
var functionToString = uncurryThis$4(Function.toString);
|
|
921
927
|
|
|
922
928
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
923
|
-
if (!isCallable$
|
|
929
|
+
if (!isCallable$6(store.inspectSource)) {
|
|
924
930
|
store.inspectSource = function (it) {
|
|
925
931
|
return functionToString(it);
|
|
926
932
|
};
|
|
@@ -928,51 +934,51 @@ if (!isCallable$7(store.inspectSource)) {
|
|
|
928
934
|
|
|
929
935
|
var inspectSource$1 = store.inspectSource;
|
|
930
936
|
|
|
931
|
-
var uncurryThis$
|
|
932
|
-
var fails$
|
|
933
|
-
var isCallable$
|
|
934
|
-
var hasOwn$
|
|
937
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
938
|
+
var fails$4 = fails$b;
|
|
939
|
+
var isCallable$5 = isCallable$d;
|
|
940
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
935
941
|
var DESCRIPTORS$2 = descriptors;
|
|
936
942
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
937
943
|
var inspectSource = inspectSource$1;
|
|
938
944
|
var InternalStateModule$1 = internalState;
|
|
939
945
|
|
|
940
946
|
var enforceInternalState = InternalStateModule$1.enforce;
|
|
941
|
-
var getInternalState$
|
|
942
|
-
var $String$
|
|
947
|
+
var getInternalState$1 = InternalStateModule$1.get;
|
|
948
|
+
var $String$1 = String;
|
|
943
949
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
944
950
|
var defineProperty$3 = Object.defineProperty;
|
|
945
|
-
var stringSlice
|
|
946
|
-
var replace
|
|
947
|
-
var join = uncurryThis$
|
|
951
|
+
var stringSlice = uncurryThis$3(''.slice);
|
|
952
|
+
var replace = uncurryThis$3(''.replace);
|
|
953
|
+
var join = uncurryThis$3([].join);
|
|
948
954
|
|
|
949
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$
|
|
955
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$4(function () {
|
|
950
956
|
return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
951
957
|
});
|
|
952
958
|
|
|
953
959
|
var TEMPLATE = String(String).split('String');
|
|
954
960
|
|
|
955
961
|
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
956
|
-
if (stringSlice
|
|
957
|
-
name = '[' + replace
|
|
962
|
+
if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
|
|
963
|
+
name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
958
964
|
}
|
|
959
965
|
if (options && options.getter) name = 'get ' + name;
|
|
960
966
|
if (options && options.setter) name = 'set ' + name;
|
|
961
|
-
if (!hasOwn$
|
|
967
|
+
if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
962
968
|
if (DESCRIPTORS$2) defineProperty$3(value, 'name', { value: name, configurable: true });
|
|
963
969
|
else value.name = name;
|
|
964
970
|
}
|
|
965
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$
|
|
971
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$3(options, 'arity') && value.length !== options.arity) {
|
|
966
972
|
defineProperty$3(value, 'length', { value: options.arity });
|
|
967
973
|
}
|
|
968
974
|
try {
|
|
969
|
-
if (options && hasOwn$
|
|
975
|
+
if (options && hasOwn$3(options, 'constructor') && options.constructor) {
|
|
970
976
|
if (DESCRIPTORS$2) defineProperty$3(value, 'prototype', { writable: false });
|
|
971
977
|
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
972
978
|
} else if (value.prototype) value.prototype = undefined;
|
|
973
979
|
} catch (error) { /* empty */ }
|
|
974
980
|
var state = enforceInternalState(value);
|
|
975
|
-
if (!hasOwn$
|
|
981
|
+
if (!hasOwn$3(state, 'source')) {
|
|
976
982
|
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
977
983
|
} return value;
|
|
978
984
|
};
|
|
@@ -980,19 +986,19 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
980
986
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
981
987
|
// eslint-disable-next-line no-extend-native -- required
|
|
982
988
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
983
|
-
return isCallable$
|
|
989
|
+
return isCallable$5(this) && getInternalState$1(this).source || inspectSource(this);
|
|
984
990
|
}, 'toString');
|
|
985
991
|
|
|
986
|
-
var isCallable$
|
|
992
|
+
var isCallable$4 = isCallable$d;
|
|
987
993
|
var definePropertyModule$1 = objectDefineProperty;
|
|
988
994
|
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
989
995
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
990
996
|
|
|
991
|
-
var defineBuiltIn$
|
|
997
|
+
var defineBuiltIn$3 = function (O, key, value, options) {
|
|
992
998
|
if (!options) options = {};
|
|
993
999
|
var simple = options.enumerable;
|
|
994
1000
|
var name = options.name !== undefined ? options.name : key;
|
|
995
|
-
if (isCallable$
|
|
1001
|
+
if (isCallable$4(value)) makeBuiltIn(value, name, options);
|
|
996
1002
|
if (options.global) {
|
|
997
1003
|
if (simple) O[key] = value;
|
|
998
1004
|
else defineGlobalProperty$1(key, value);
|
|
@@ -1031,21 +1037,21 @@ var objectGetOwnPropertySymbols = {};
|
|
|
1031
1037
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1032
1038
|
|
|
1033
1039
|
var getBuiltIn = getBuiltIn$3;
|
|
1034
|
-
var uncurryThis$
|
|
1040
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1035
1041
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1036
1042
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1037
|
-
var anObject
|
|
1043
|
+
var anObject = anObject$4;
|
|
1038
1044
|
|
|
1039
|
-
var concat$1 = uncurryThis$
|
|
1045
|
+
var concat$1 = uncurryThis$2([].concat);
|
|
1040
1046
|
|
|
1041
1047
|
// all object keys, includes non-enumerable and symbols
|
|
1042
1048
|
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1043
|
-
var keys = getOwnPropertyNamesModule.f(anObject
|
|
1049
|
+
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
1044
1050
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1045
1051
|
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
1046
1052
|
};
|
|
1047
1053
|
|
|
1048
|
-
var hasOwn$
|
|
1054
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
1049
1055
|
var ownKeys = ownKeys$1;
|
|
1050
1056
|
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1051
1057
|
var definePropertyModule = objectDefineProperty;
|
|
@@ -1056,14 +1062,14 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
|
1056
1062
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1057
1063
|
for (var i = 0; i < keys.length; i++) {
|
|
1058
1064
|
var key = keys[i];
|
|
1059
|
-
if (!hasOwn$
|
|
1065
|
+
if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
|
|
1060
1066
|
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1061
1067
|
}
|
|
1062
1068
|
}
|
|
1063
1069
|
};
|
|
1064
1070
|
|
|
1065
|
-
var fails$
|
|
1066
|
-
var isCallable$
|
|
1071
|
+
var fails$3 = fails$b;
|
|
1072
|
+
var isCallable$3 = isCallable$d;
|
|
1067
1073
|
|
|
1068
1074
|
var replacement = /#|\.prototype\./;
|
|
1069
1075
|
|
|
@@ -1071,7 +1077,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
1071
1077
|
var value = data[normalize(feature)];
|
|
1072
1078
|
return value === POLYFILL ? true
|
|
1073
1079
|
: value === NATIVE ? false
|
|
1074
|
-
: isCallable$
|
|
1080
|
+
: isCallable$3(detection) ? fails$3(detection)
|
|
1075
1081
|
: !!detection;
|
|
1076
1082
|
};
|
|
1077
1083
|
|
|
@@ -1085,10 +1091,10 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
1085
1091
|
|
|
1086
1092
|
var isForced_1 = isForced$1;
|
|
1087
1093
|
|
|
1088
|
-
var
|
|
1089
|
-
var getOwnPropertyDescriptor
|
|
1094
|
+
var globalThis$2 = globalThis_1;
|
|
1095
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1090
1096
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
1091
|
-
var defineBuiltIn$
|
|
1097
|
+
var defineBuiltIn$2 = defineBuiltIn$3;
|
|
1092
1098
|
var defineGlobalProperty = defineGlobalProperty$3;
|
|
1093
1099
|
var copyConstructorProperties = copyConstructorProperties$1;
|
|
1094
1100
|
var isForced = isForced_1;
|
|
@@ -1114,16 +1120,16 @@ var _export = function (options, source) {
|
|
|
1114
1120
|
var STATIC = options.stat;
|
|
1115
1121
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1116
1122
|
if (GLOBAL) {
|
|
1117
|
-
target =
|
|
1123
|
+
target = globalThis$2;
|
|
1118
1124
|
} else if (STATIC) {
|
|
1119
|
-
target =
|
|
1125
|
+
target = globalThis$2[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1120
1126
|
} else {
|
|
1121
|
-
target =
|
|
1127
|
+
target = globalThis$2[TARGET] && globalThis$2[TARGET].prototype;
|
|
1122
1128
|
}
|
|
1123
1129
|
if (target) for (key in source) {
|
|
1124
1130
|
sourceProperty = source[key];
|
|
1125
1131
|
if (options.dontCallGetSet) {
|
|
1126
|
-
descriptor = getOwnPropertyDescriptor
|
|
1132
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1127
1133
|
targetProperty = descriptor && descriptor.value;
|
|
1128
1134
|
} else targetProperty = target[key];
|
|
1129
1135
|
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
@@ -1136,49 +1142,49 @@ var _export = function (options, source) {
|
|
|
1136
1142
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1137
1143
|
createNonEnumerableProperty$2(sourceProperty, 'sham', true);
|
|
1138
1144
|
}
|
|
1139
|
-
defineBuiltIn$
|
|
1145
|
+
defineBuiltIn$2(target, key, sourceProperty, options);
|
|
1140
1146
|
}
|
|
1141
1147
|
};
|
|
1142
1148
|
|
|
1143
|
-
var fails$
|
|
1149
|
+
var fails$2 = fails$b;
|
|
1144
1150
|
|
|
1145
|
-
var correctPrototypeGetter = !fails$
|
|
1151
|
+
var correctPrototypeGetter = !fails$2(function () {
|
|
1146
1152
|
function F() { /* empty */ }
|
|
1147
1153
|
F.prototype.constructor = null;
|
|
1148
1154
|
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1149
1155
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1150
1156
|
});
|
|
1151
1157
|
|
|
1152
|
-
var hasOwn$
|
|
1153
|
-
var isCallable$
|
|
1154
|
-
var toObject$
|
|
1158
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1159
|
+
var isCallable$2 = isCallable$d;
|
|
1160
|
+
var toObject$1 = toObject$3;
|
|
1155
1161
|
var sharedKey = sharedKey$3;
|
|
1156
1162
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1157
1163
|
|
|
1158
1164
|
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1159
|
-
var $Object
|
|
1160
|
-
var ObjectPrototype = $Object
|
|
1165
|
+
var $Object = Object;
|
|
1166
|
+
var ObjectPrototype = $Object.prototype;
|
|
1161
1167
|
|
|
1162
1168
|
// `Object.getPrototypeOf` method
|
|
1163
1169
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1164
1170
|
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1165
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object
|
|
1166
|
-
var object = toObject$
|
|
1167
|
-
if (hasOwn$
|
|
1171
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
|
1172
|
+
var object = toObject$1(O);
|
|
1173
|
+
if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
|
|
1168
1174
|
var constructor = object.constructor;
|
|
1169
|
-
if (isCallable$
|
|
1175
|
+
if (isCallable$2(constructor) && object instanceof constructor) {
|
|
1170
1176
|
return constructor.prototype;
|
|
1171
|
-
} return object instanceof $Object
|
|
1177
|
+
} return object instanceof $Object ? ObjectPrototype : null;
|
|
1172
1178
|
};
|
|
1173
1179
|
|
|
1174
|
-
var fails$
|
|
1175
|
-
var isCallable$
|
|
1176
|
-
var isObject$
|
|
1180
|
+
var fails$1 = fails$b;
|
|
1181
|
+
var isCallable$1 = isCallable$d;
|
|
1182
|
+
var isObject$2 = isObject$8;
|
|
1177
1183
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1178
|
-
var defineBuiltIn$
|
|
1179
|
-
var wellKnownSymbol$
|
|
1184
|
+
var defineBuiltIn$1 = defineBuiltIn$3;
|
|
1185
|
+
var wellKnownSymbol$3 = wellKnownSymbol$6;
|
|
1180
1186
|
|
|
1181
|
-
var ITERATOR$2 = wellKnownSymbol$
|
|
1187
|
+
var ITERATOR$2 = wellKnownSymbol$3('iterator');
|
|
1182
1188
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1183
1189
|
|
|
1184
1190
|
// `%IteratorPrototype%` object
|
|
@@ -1196,7 +1202,7 @@ if ([].keys) {
|
|
|
1196
1202
|
}
|
|
1197
1203
|
}
|
|
1198
1204
|
|
|
1199
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$
|
|
1205
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$1(function () {
|
|
1200
1206
|
var test = {};
|
|
1201
1207
|
// FF44- legacy iterators case
|
|
1202
1208
|
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
@@ -1206,8 +1212,8 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
|
1206
1212
|
|
|
1207
1213
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1208
1214
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1209
|
-
if (!isCallable$
|
|
1210
|
-
defineBuiltIn$
|
|
1215
|
+
if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
|
|
1216
|
+
defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1211
1217
|
return this;
|
|
1212
1218
|
});
|
|
1213
1219
|
}
|
|
@@ -1218,20 +1224,20 @@ var iteratorsCore = {
|
|
|
1218
1224
|
};
|
|
1219
1225
|
|
|
1220
1226
|
var defineProperty$2 = objectDefineProperty.f;
|
|
1221
|
-
var hasOwn
|
|
1222
|
-
var wellKnownSymbol$
|
|
1227
|
+
var hasOwn = hasOwnProperty_1;
|
|
1228
|
+
var wellKnownSymbol$2 = wellKnownSymbol$6;
|
|
1223
1229
|
|
|
1224
|
-
var TO_STRING_TAG
|
|
1230
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
1225
1231
|
|
|
1226
1232
|
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1227
1233
|
if (target && !STATIC) target = target.prototype;
|
|
1228
|
-
if (target && !hasOwn
|
|
1229
|
-
defineProperty$2(target, TO_STRING_TAG
|
|
1234
|
+
if (target && !hasOwn(target, TO_STRING_TAG)) {
|
|
1235
|
+
defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
1230
1236
|
}
|
|
1231
1237
|
};
|
|
1232
1238
|
|
|
1233
1239
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1234
|
-
var create
|
|
1240
|
+
var create = objectCreate;
|
|
1235
1241
|
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1236
1242
|
var setToStringTag$2 = setToStringTag$3;
|
|
1237
1243
|
var Iterators$2 = iterators;
|
|
@@ -1240,42 +1246,42 @@ var returnThis$1 = function () { return this; };
|
|
|
1240
1246
|
|
|
1241
1247
|
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1242
1248
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1243
|
-
IteratorConstructor.prototype = create
|
|
1249
|
+
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1244
1250
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1245
1251
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1246
1252
|
return IteratorConstructor;
|
|
1247
1253
|
};
|
|
1248
1254
|
|
|
1249
|
-
var uncurryThis$
|
|
1250
|
-
var aCallable
|
|
1255
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1256
|
+
var aCallable = aCallable$2;
|
|
1251
1257
|
|
|
1252
1258
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1253
1259
|
try {
|
|
1254
1260
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1255
|
-
return uncurryThis$
|
|
1261
|
+
return uncurryThis$1(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1256
1262
|
} catch (error) { /* empty */ }
|
|
1257
1263
|
};
|
|
1258
1264
|
|
|
1259
|
-
var isObject$
|
|
1265
|
+
var isObject$1 = isObject$8;
|
|
1260
1266
|
|
|
1261
1267
|
var isPossiblePrototype$1 = function (argument) {
|
|
1262
|
-
return isObject$
|
|
1268
|
+
return isObject$1(argument) || argument === null;
|
|
1263
1269
|
};
|
|
1264
1270
|
|
|
1265
1271
|
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1266
1272
|
|
|
1267
|
-
var $String
|
|
1268
|
-
var $TypeError
|
|
1273
|
+
var $String = String;
|
|
1274
|
+
var $TypeError = TypeError;
|
|
1269
1275
|
|
|
1270
1276
|
var aPossiblePrototype$1 = function (argument) {
|
|
1271
1277
|
if (isPossiblePrototype(argument)) return argument;
|
|
1272
|
-
throw new $TypeError
|
|
1278
|
+
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
|
1273
1279
|
};
|
|
1274
1280
|
|
|
1275
1281
|
/* eslint-disable no-proto -- safe */
|
|
1276
1282
|
var uncurryThisAccessor = functionUncurryThisAccessor;
|
|
1277
|
-
var isObject
|
|
1278
|
-
var requireObjectCoercible
|
|
1283
|
+
var isObject = isObject$8;
|
|
1284
|
+
var requireObjectCoercible = requireObjectCoercible$3;
|
|
1279
1285
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1280
1286
|
|
|
1281
1287
|
// `Object.setPrototypeOf` method
|
|
@@ -1292,34 +1298,34 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1292
1298
|
CORRECT_SETTER = test instanceof Array;
|
|
1293
1299
|
} catch (error) { /* empty */ }
|
|
1294
1300
|
return function setPrototypeOf(O, proto) {
|
|
1295
|
-
requireObjectCoercible
|
|
1301
|
+
requireObjectCoercible(O);
|
|
1296
1302
|
aPossiblePrototype(proto);
|
|
1297
|
-
if (!isObject
|
|
1303
|
+
if (!isObject(O)) return O;
|
|
1298
1304
|
if (CORRECT_SETTER) setter(O, proto);
|
|
1299
1305
|
else O.__proto__ = proto;
|
|
1300
1306
|
return O;
|
|
1301
1307
|
};
|
|
1302
1308
|
}() : undefined);
|
|
1303
1309
|
|
|
1304
|
-
var $$
|
|
1305
|
-
var call$
|
|
1310
|
+
var $$1 = _export;
|
|
1311
|
+
var call$1 = functionCall;
|
|
1306
1312
|
var FunctionName = functionName;
|
|
1307
|
-
var isCallable
|
|
1313
|
+
var isCallable = isCallable$d;
|
|
1308
1314
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1309
1315
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1310
1316
|
var setPrototypeOf = objectSetPrototypeOf;
|
|
1311
1317
|
var setToStringTag$1 = setToStringTag$3;
|
|
1312
1318
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
|
|
1313
|
-
var defineBuiltIn
|
|
1314
|
-
var wellKnownSymbol$
|
|
1319
|
+
var defineBuiltIn = defineBuiltIn$3;
|
|
1320
|
+
var wellKnownSymbol$1 = wellKnownSymbol$6;
|
|
1315
1321
|
var Iterators$1 = iterators;
|
|
1316
1322
|
var IteratorsCore = iteratorsCore;
|
|
1317
1323
|
|
|
1318
|
-
var PROPER_FUNCTION_NAME
|
|
1324
|
+
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1319
1325
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1320
1326
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1321
1327
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1322
|
-
var ITERATOR$1 = wellKnownSymbol$
|
|
1328
|
+
var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
|
1323
1329
|
var KEYS = 'keys';
|
|
1324
1330
|
var VALUES = 'values';
|
|
1325
1331
|
var ENTRIES = 'entries';
|
|
@@ -1359,8 +1365,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1359
1365
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1360
1366
|
if (setPrototypeOf) {
|
|
1361
1367
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1362
|
-
} else if (!isCallable
|
|
1363
|
-
defineBuiltIn
|
|
1368
|
+
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1369
|
+
defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1364
1370
|
}
|
|
1365
1371
|
}
|
|
1366
1372
|
// Set @@toStringTag to native iterators
|
|
@@ -1369,12 +1375,12 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1369
1375
|
}
|
|
1370
1376
|
|
|
1371
1377
|
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1372
|
-
if (PROPER_FUNCTION_NAME
|
|
1378
|
+
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1373
1379
|
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1374
1380
|
createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
|
1375
1381
|
} else {
|
|
1376
1382
|
INCORRECT_VALUES_NAME = true;
|
|
1377
|
-
defaultIterator = function values() { return call$
|
|
1383
|
+
defaultIterator = function values() { return call$1(nativeIterator, this); };
|
|
1378
1384
|
}
|
|
1379
1385
|
}
|
|
1380
1386
|
|
|
@@ -1387,14 +1393,14 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1387
1393
|
};
|
|
1388
1394
|
if (FORCED) for (KEY in methods) {
|
|
1389
1395
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1390
|
-
defineBuiltIn
|
|
1396
|
+
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
|
1391
1397
|
}
|
|
1392
|
-
} else $$
|
|
1398
|
+
} else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1393
1399
|
}
|
|
1394
1400
|
|
|
1395
1401
|
// define iterator
|
|
1396
1402
|
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1397
|
-
defineBuiltIn
|
|
1403
|
+
defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1398
1404
|
}
|
|
1399
1405
|
Iterators$1[NAME] = defaultIterator;
|
|
1400
1406
|
|
|
@@ -1418,7 +1424,7 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
1418
1424
|
|
|
1419
1425
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1420
1426
|
var setInternalState = InternalStateModule.set;
|
|
1421
|
-
var getInternalState
|
|
1427
|
+
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1422
1428
|
|
|
1423
1429
|
// `Array.prototype.entries` method
|
|
1424
1430
|
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
@@ -1440,11 +1446,11 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1440
1446
|
// `%ArrayIteratorPrototype%.next` method
|
|
1441
1447
|
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1442
1448
|
}, function () {
|
|
1443
|
-
var state = getInternalState
|
|
1449
|
+
var state = getInternalState(this);
|
|
1444
1450
|
var target = state.target;
|
|
1445
1451
|
var index = state.index++;
|
|
1446
1452
|
if (!target || index >= target.length) {
|
|
1447
|
-
state.target =
|
|
1453
|
+
state.target = null;
|
|
1448
1454
|
return createIterResultObject(undefined, true);
|
|
1449
1455
|
}
|
|
1450
1456
|
switch (state.kind) {
|
|
@@ -1468,73 +1474,6 @@ if (DESCRIPTORS$1 && values.name !== 'values') try {
|
|
|
1468
1474
|
defineProperty$1(values, 'name', { value: 'values' });
|
|
1469
1475
|
} catch (error) { /* empty */ }
|
|
1470
1476
|
|
|
1471
|
-
var DESCRIPTORS = descriptors;
|
|
1472
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
1473
|
-
var call$2 = functionCall;
|
|
1474
|
-
var fails$6 = fails$h;
|
|
1475
|
-
var objectKeys = objectKeys$2;
|
|
1476
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1477
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1478
|
-
var toObject$1 = toObject$4;
|
|
1479
|
-
var IndexedObject = indexedObject;
|
|
1480
|
-
|
|
1481
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1482
|
-
var $assign = Object.assign;
|
|
1483
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1484
|
-
var defineProperty = Object.defineProperty;
|
|
1485
|
-
var concat = uncurryThis$5([].concat);
|
|
1486
|
-
|
|
1487
|
-
// `Object.assign` method
|
|
1488
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1489
|
-
var objectAssign = !$assign || fails$6(function () {
|
|
1490
|
-
// should have correct order of operations (Edge bug)
|
|
1491
|
-
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1492
|
-
enumerable: true,
|
|
1493
|
-
get: function () {
|
|
1494
|
-
defineProperty(this, 'b', {
|
|
1495
|
-
value: 3,
|
|
1496
|
-
enumerable: false
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
}), { b: 2 })).b !== 1) return true;
|
|
1500
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1501
|
-
var A = {};
|
|
1502
|
-
var B = {};
|
|
1503
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
1504
|
-
var symbol = Symbol('assign detection');
|
|
1505
|
-
var alphabet = 'abcdefghijklmnopqrst';
|
|
1506
|
-
A[symbol] = 7;
|
|
1507
|
-
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1508
|
-
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
|
1509
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1510
|
-
var T = toObject$1(target);
|
|
1511
|
-
var argumentsLength = arguments.length;
|
|
1512
|
-
var index = 1;
|
|
1513
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1514
|
-
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1515
|
-
while (argumentsLength > index) {
|
|
1516
|
-
var S = IndexedObject(arguments[index++]);
|
|
1517
|
-
var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
|
1518
|
-
var length = keys.length;
|
|
1519
|
-
var j = 0;
|
|
1520
|
-
var key;
|
|
1521
|
-
while (length > j) {
|
|
1522
|
-
key = keys[j++];
|
|
1523
|
-
if (!DESCRIPTORS || call$2(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1524
|
-
}
|
|
1525
|
-
} return T;
|
|
1526
|
-
} : $assign;
|
|
1527
|
-
|
|
1528
|
-
var $$3 = _export;
|
|
1529
|
-
var assign = objectAssign;
|
|
1530
|
-
|
|
1531
|
-
// `Object.assign` method
|
|
1532
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1533
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1534
|
-
$$3({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1535
|
-
assign: assign
|
|
1536
|
-
});
|
|
1537
|
-
|
|
1538
1477
|
// iterable DOM collections
|
|
1539
1478
|
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1540
1479
|
var domIterables = {
|
|
@@ -1579,15 +1518,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1579
1518
|
|
|
1580
1519
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1581
1520
|
|
|
1582
|
-
var
|
|
1521
|
+
var globalThis$1 = globalThis_1;
|
|
1583
1522
|
var DOMIterables = domIterables;
|
|
1584
1523
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1585
1524
|
var ArrayIteratorMethods = es_array_iterator;
|
|
1586
1525
|
var createNonEnumerableProperty = createNonEnumerableProperty$4;
|
|
1587
1526
|
var setToStringTag = setToStringTag$3;
|
|
1588
|
-
var wellKnownSymbol
|
|
1527
|
+
var wellKnownSymbol = wellKnownSymbol$6;
|
|
1589
1528
|
|
|
1590
|
-
var ITERATOR = wellKnownSymbol
|
|
1529
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
1591
1530
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1592
1531
|
|
|
1593
1532
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
@@ -1611,382 +1550,103 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1611
1550
|
};
|
|
1612
1551
|
|
|
1613
1552
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1614
|
-
handlePrototype(
|
|
1553
|
+
handlePrototype(globalThis$1[COLLECTION_NAME] && globalThis$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1615
1554
|
}
|
|
1616
1555
|
|
|
1617
1556
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1618
1557
|
|
|
1619
|
-
var
|
|
1620
|
-
|
|
1621
|
-
var
|
|
1622
|
-
|
|
1623
|
-
var
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
var
|
|
1628
|
-
|
|
1629
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
1630
|
-
var test$1 = {};
|
|
1631
|
-
|
|
1632
|
-
test$1[TO_STRING_TAG$1] = 'z';
|
|
1633
|
-
|
|
1634
|
-
var toStringTagSupport = String(test$1) === '[object z]';
|
|
1635
|
-
|
|
1636
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1637
|
-
var isCallable = isCallable$e;
|
|
1638
|
-
var classofRaw$1 = classofRaw$2;
|
|
1639
|
-
var wellKnownSymbol$2 = wellKnownSymbol$a;
|
|
1640
|
-
|
|
1641
|
-
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
1642
|
-
var $Object = Object;
|
|
1643
|
-
|
|
1644
|
-
// ES3 wrong here
|
|
1645
|
-
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
|
|
1646
|
-
|
|
1647
|
-
// fallback for IE11 Script Access Denied error
|
|
1648
|
-
var tryGet = function (it, key) {
|
|
1649
|
-
try {
|
|
1650
|
-
return it[key];
|
|
1651
|
-
} catch (error) { /* empty */ }
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1655
|
-
var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
1656
|
-
var O, tag, result;
|
|
1657
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1658
|
-
// @@toStringTag case
|
|
1659
|
-
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1660
|
-
// builtinTag case
|
|
1661
|
-
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1662
|
-
// ES3 arguments fallback
|
|
1663
|
-
: (result = classofRaw$1(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1664
|
-
};
|
|
1665
|
-
|
|
1666
|
-
var classof$1 = classof$2;
|
|
1667
|
-
|
|
1668
|
-
var $String = String;
|
|
1669
|
-
|
|
1670
|
-
var toString$3 = function (argument) {
|
|
1671
|
-
if (classof$1(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1672
|
-
return $String(argument);
|
|
1673
|
-
};
|
|
1674
|
-
|
|
1675
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
1676
|
-
|
|
1677
|
-
var arraySlice$1 = uncurryThis$4([].slice);
|
|
1678
|
-
|
|
1679
|
-
var arraySlice = arraySlice$1;
|
|
1680
|
-
|
|
1681
|
-
var floor = Math.floor;
|
|
1682
|
-
|
|
1683
|
-
var sort = function (array, comparefn) {
|
|
1684
|
-
var length = array.length;
|
|
1685
|
-
|
|
1686
|
-
if (length < 8) {
|
|
1687
|
-
// insertion sort
|
|
1688
|
-
var i = 1;
|
|
1689
|
-
var element, j;
|
|
1690
|
-
|
|
1691
|
-
while (i < length) {
|
|
1692
|
-
j = i;
|
|
1693
|
-
element = array[i];
|
|
1694
|
-
while (j && comparefn(array[j - 1], element) > 0) {
|
|
1695
|
-
array[j] = array[--j];
|
|
1696
|
-
}
|
|
1697
|
-
if (j !== i++) array[j] = element;
|
|
1698
|
-
}
|
|
1699
|
-
} else {
|
|
1700
|
-
// merge sort
|
|
1701
|
-
var middle = floor(length / 2);
|
|
1702
|
-
var left = sort(arraySlice(array, 0, middle), comparefn);
|
|
1703
|
-
var right = sort(arraySlice(array, middle), comparefn);
|
|
1704
|
-
var llength = left.length;
|
|
1705
|
-
var rlength = right.length;
|
|
1706
|
-
var lindex = 0;
|
|
1707
|
-
var rindex = 0;
|
|
1708
|
-
|
|
1709
|
-
while (lindex < llength || rindex < rlength) {
|
|
1710
|
-
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
1711
|
-
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
1712
|
-
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
return array;
|
|
1717
|
-
};
|
|
1718
|
-
|
|
1719
|
-
var arraySort = sort;
|
|
1720
|
-
|
|
1721
|
-
var fails$5 = fails$h;
|
|
1722
|
-
|
|
1723
|
-
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
1724
|
-
var method = [][METHOD_NAME];
|
|
1725
|
-
return !!method && fails$5(function () {
|
|
1726
|
-
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1727
|
-
method.call(null, argument || function () { return 1; }, 1);
|
|
1728
|
-
});
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
var userAgent$1 = engineUserAgent;
|
|
1732
|
-
|
|
1733
|
-
var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
|
1734
|
-
|
|
1735
|
-
var engineFfVersion = !!firefox && +firefox[1];
|
|
1736
|
-
|
|
1737
|
-
var UA = engineUserAgent;
|
|
1738
|
-
|
|
1739
|
-
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
|
1740
|
-
|
|
1741
|
-
var userAgent = engineUserAgent;
|
|
1742
|
-
|
|
1743
|
-
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
|
1558
|
+
var DESCRIPTORS = descriptors;
|
|
1559
|
+
var uncurryThis = functionUncurryThis;
|
|
1560
|
+
var call = functionCall;
|
|
1561
|
+
var fails = fails$b;
|
|
1562
|
+
var objectKeys = objectKeys$2;
|
|
1563
|
+
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1564
|
+
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1565
|
+
var toObject = toObject$3;
|
|
1566
|
+
var IndexedObject = indexedObject;
|
|
1744
1567
|
|
|
1745
|
-
|
|
1568
|
+
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1569
|
+
var $assign = Object.assign;
|
|
1570
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1571
|
+
var defineProperty = Object.defineProperty;
|
|
1572
|
+
var concat = uncurryThis([].concat);
|
|
1746
1573
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
var
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
var IE_OR_EDGE = engineIsIeOrEdge;
|
|
1759
|
-
var V8 = engineV8Version;
|
|
1760
|
-
var WEBKIT = engineWebkitVersion;
|
|
1761
|
-
|
|
1762
|
-
var test = [];
|
|
1763
|
-
var nativeSort = uncurryThis$3(test.sort);
|
|
1764
|
-
var push = uncurryThis$3(test.push);
|
|
1765
|
-
|
|
1766
|
-
// IE8-
|
|
1767
|
-
var FAILS_ON_UNDEFINED = fails$4(function () {
|
|
1768
|
-
test.sort(undefined);
|
|
1769
|
-
});
|
|
1770
|
-
// V8 bug
|
|
1771
|
-
var FAILS_ON_NULL = fails$4(function () {
|
|
1772
|
-
test.sort(null);
|
|
1773
|
-
});
|
|
1774
|
-
// Old WebKit
|
|
1775
|
-
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
1776
|
-
|
|
1777
|
-
var STABLE_SORT = !fails$4(function () {
|
|
1778
|
-
// feature detection can be too slow, so check engines versions
|
|
1779
|
-
if (V8) return V8 < 70;
|
|
1780
|
-
if (FF && FF > 3) return;
|
|
1781
|
-
if (IE_OR_EDGE) return true;
|
|
1782
|
-
if (WEBKIT) return WEBKIT < 603;
|
|
1783
|
-
|
|
1784
|
-
var result = '';
|
|
1785
|
-
var code, chr, value, index;
|
|
1786
|
-
|
|
1787
|
-
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
1788
|
-
for (code = 65; code < 76; code++) {
|
|
1789
|
-
chr = String.fromCharCode(code);
|
|
1790
|
-
|
|
1791
|
-
switch (code) {
|
|
1792
|
-
case 66: case 69: case 70: case 72: value = 3; break;
|
|
1793
|
-
case 68: case 71: value = 4; break;
|
|
1794
|
-
default: value = 2;
|
|
1574
|
+
// `Object.assign` method
|
|
1575
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1576
|
+
var objectAssign = !$assign || fails(function () {
|
|
1577
|
+
// should have correct order of operations (Edge bug)
|
|
1578
|
+
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1579
|
+
enumerable: true,
|
|
1580
|
+
get: function () {
|
|
1581
|
+
defineProperty(this, 'b', {
|
|
1582
|
+
value: 3,
|
|
1583
|
+
enumerable: false
|
|
1584
|
+
});
|
|
1795
1585
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1586
|
+
}), { b: 2 })).b !== 1) return true;
|
|
1587
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1588
|
+
var A = {};
|
|
1589
|
+
var B = {};
|
|
1590
|
+
// eslint-disable-next-line es/no-symbol -- safe
|
|
1591
|
+
var symbol = Symbol('assign detection');
|
|
1592
|
+
var alphabet = 'abcdefghijklmnopqrst';
|
|
1593
|
+
A[symbol] = 7;
|
|
1594
|
+
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1595
|
+
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
|
1596
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1597
|
+
var T = toObject(target);
|
|
1598
|
+
var argumentsLength = arguments.length;
|
|
1599
|
+
var index = 1;
|
|
1600
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1601
|
+
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1602
|
+
while (argumentsLength > index) {
|
|
1603
|
+
var S = IndexedObject(arguments[index++]);
|
|
1604
|
+
var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
|
1605
|
+
var length = keys.length;
|
|
1606
|
+
var j = 0;
|
|
1607
|
+
var key;
|
|
1608
|
+
while (length > j) {
|
|
1609
|
+
key = keys[j++];
|
|
1610
|
+
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1799
1611
|
}
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
test.sort(function (a, b) { return b.v - a.v; });
|
|
1612
|
+
} return T;
|
|
1613
|
+
} : $assign;
|
|
1803
1614
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
1807
|
-
}
|
|
1615
|
+
var $ = _export;
|
|
1616
|
+
var assign = objectAssign;
|
|
1808
1617
|
|
|
1809
|
-
|
|
1618
|
+
// `Object.assign` method
|
|
1619
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1620
|
+
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1621
|
+
$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1622
|
+
assign: assign
|
|
1810
1623
|
});
|
|
1811
1624
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1625
|
+
const BuildSchemaAsFields = ({
|
|
1626
|
+
components,
|
|
1627
|
+
mappers,
|
|
1628
|
+
formIndex,
|
|
1629
|
+
mountedForm
|
|
1630
|
+
}) => {
|
|
1631
|
+
return components && components.map(component => {
|
|
1632
|
+
const mapper = mappers === null || mappers === void 0 ? void 0 : mappers.find(el => el.componentName === component.component);
|
|
1633
|
+
return mapper ? jsx(AsFormFieldBuilder, Object.assign({
|
|
1634
|
+
formIndex: formIndex,
|
|
1635
|
+
mapper: mapper,
|
|
1636
|
+
formMounted: mountedForm
|
|
1637
|
+
}, component, {
|
|
1638
|
+
children: component.children && component.children.length > 0 && jsx(BuildSchemaAsFields, {
|
|
1639
|
+
formIndex: formIndex,
|
|
1640
|
+
mappers: mappers,
|
|
1641
|
+
components: component.children,
|
|
1642
|
+
mountedForm: mountedForm
|
|
1643
|
+
})
|
|
1644
|
+
}), component.name) : jsx("div", {
|
|
1645
|
+
children: `component mapper not found for ${component.component} from field name ${component.name} on form ${formIndex}`
|
|
1646
|
+
}, component.name);
|
|
1647
|
+
});
|
|
1821
1648
|
};
|
|
1822
1649
|
|
|
1823
|
-
// `Array.prototype.sort` method
|
|
1824
|
-
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
1825
|
-
$$2({ target: 'Array', proto: true, forced: FORCED }, {
|
|
1826
|
-
sort: function sort(comparefn) {
|
|
1827
|
-
if (comparefn !== undefined) aCallable(comparefn);
|
|
1828
|
-
|
|
1829
|
-
var array = toObject(this);
|
|
1830
|
-
|
|
1831
|
-
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
|
1832
|
-
|
|
1833
|
-
var items = [];
|
|
1834
|
-
var arrayLength = lengthOfArrayLike(array);
|
|
1835
|
-
var itemsLength, index;
|
|
1836
|
-
|
|
1837
|
-
for (index = 0; index < arrayLength; index++) {
|
|
1838
|
-
if (index in array) push(items, array[index]);
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
internalSort(items, getSortCompare(comparefn));
|
|
1842
|
-
|
|
1843
|
-
itemsLength = lengthOfArrayLike(items);
|
|
1844
|
-
index = 0;
|
|
1845
|
-
|
|
1846
|
-
while (index < itemsLength) array[index] = items[index++];
|
|
1847
|
-
while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
|
1848
|
-
|
|
1849
|
-
return array;
|
|
1850
|
-
}
|
|
1851
|
-
});
|
|
1852
|
-
|
|
1853
|
-
var anObject$1 = anObject$6;
|
|
1854
|
-
|
|
1855
|
-
// `RegExp.prototype.flags` getter implementation
|
|
1856
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1857
|
-
var regexpFlags$1 = function () {
|
|
1858
|
-
var that = anObject$1(this);
|
|
1859
|
-
var result = '';
|
|
1860
|
-
if (that.hasIndices) result += 'd';
|
|
1861
|
-
if (that.global) result += 'g';
|
|
1862
|
-
if (that.ignoreCase) result += 'i';
|
|
1863
|
-
if (that.multiline) result += 'm';
|
|
1864
|
-
if (that.dotAll) result += 's';
|
|
1865
|
-
if (that.unicode) result += 'u';
|
|
1866
|
-
if (that.unicodeSets) result += 'v';
|
|
1867
|
-
if (that.sticky) result += 'y';
|
|
1868
|
-
return result;
|
|
1869
|
-
};
|
|
1870
|
-
|
|
1871
|
-
var call$1 = functionCall;
|
|
1872
|
-
var hasOwn = hasOwnProperty_1;
|
|
1873
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
1874
|
-
var regExpFlags = regexpFlags$1;
|
|
1875
|
-
|
|
1876
|
-
var RegExpPrototype$1 = RegExp.prototype;
|
|
1877
|
-
|
|
1878
|
-
var regexpGetFlags = function (R) {
|
|
1879
|
-
var flags = R.flags;
|
|
1880
|
-
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
|
|
1881
|
-
? call$1(regExpFlags, R) : flags;
|
|
1882
|
-
};
|
|
1883
|
-
|
|
1884
|
-
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
1885
|
-
var defineBuiltIn = defineBuiltIn$4;
|
|
1886
|
-
var anObject = anObject$6;
|
|
1887
|
-
var $toString = toString$3;
|
|
1888
|
-
var fails$3 = fails$h;
|
|
1889
|
-
var getRegExpFlags = regexpGetFlags;
|
|
1890
|
-
|
|
1891
|
-
var TO_STRING = 'toString';
|
|
1892
|
-
var RegExpPrototype = RegExp.prototype;
|
|
1893
|
-
var nativeToString = RegExpPrototype[TO_STRING];
|
|
1894
|
-
|
|
1895
|
-
var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
1896
|
-
// FF44- RegExp#toString has a wrong name
|
|
1897
|
-
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
|
|
1898
|
-
|
|
1899
|
-
// `RegExp.prototype.toString` method
|
|
1900
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
1901
|
-
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
1902
|
-
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
|
|
1903
|
-
var R = anObject(this);
|
|
1904
|
-
var pattern = $toString(R.source);
|
|
1905
|
-
var flags = $toString(getRegExpFlags(R));
|
|
1906
|
-
return '/' + pattern + '/' + flags;
|
|
1907
|
-
}, { unsafe: true });
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
var classofRaw = classofRaw$2;
|
|
1911
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
1912
|
-
|
|
1913
|
-
var functionUncurryThisClause = function (fn) {
|
|
1914
|
-
// Nashorn bug:
|
|
1915
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
1916
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
1917
|
-
if (classofRaw(fn) === 'Function') return uncurryThis$2(fn);
|
|
1918
|
-
};
|
|
1919
|
-
|
|
1920
|
-
var isObject = isObject$9;
|
|
1921
|
-
var classof = classofRaw$2;
|
|
1922
|
-
var wellKnownSymbol$1 = wellKnownSymbol$a;
|
|
1923
|
-
|
|
1924
|
-
var MATCH$1 = wellKnownSymbol$1('match');
|
|
1925
|
-
|
|
1926
|
-
// `IsRegExp` abstract operation
|
|
1927
|
-
// https://tc39.es/ecma262/#sec-isregexp
|
|
1928
|
-
var isRegexp = function (it) {
|
|
1929
|
-
var isRegExp;
|
|
1930
|
-
return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
|
|
1931
|
-
};
|
|
1932
|
-
|
|
1933
|
-
var isRegExp = isRegexp;
|
|
1934
|
-
|
|
1935
|
-
var $TypeError = TypeError;
|
|
1936
|
-
|
|
1937
|
-
var notARegexp = function (it) {
|
|
1938
|
-
if (isRegExp(it)) {
|
|
1939
|
-
throw new $TypeError("The method doesn't accept regular expressions");
|
|
1940
|
-
} return it;
|
|
1941
|
-
};
|
|
1942
|
-
|
|
1943
|
-
var wellKnownSymbol = wellKnownSymbol$a;
|
|
1944
|
-
|
|
1945
|
-
var MATCH = wellKnownSymbol('match');
|
|
1946
|
-
|
|
1947
|
-
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
1948
|
-
var regexp = /./;
|
|
1949
|
-
try {
|
|
1950
|
-
'/./'[METHOD_NAME](regexp);
|
|
1951
|
-
} catch (error1) {
|
|
1952
|
-
try {
|
|
1953
|
-
regexp[MATCH] = false;
|
|
1954
|
-
return '/./'[METHOD_NAME](regexp);
|
|
1955
|
-
} catch (error2) { /* empty */ }
|
|
1956
|
-
} return false;
|
|
1957
|
-
};
|
|
1958
|
-
|
|
1959
|
-
var $$1 = _export;
|
|
1960
|
-
var uncurryThis$1 = functionUncurryThisClause;
|
|
1961
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1962
|
-
var toLength = toLength$2;
|
|
1963
|
-
var toString$1 = toString$3;
|
|
1964
|
-
var notARegExp = notARegexp;
|
|
1965
|
-
var requireObjectCoercible = requireObjectCoercible$4;
|
|
1966
|
-
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
1967
|
-
|
|
1968
|
-
var stringSlice$1 = uncurryThis$1(''.slice);
|
|
1969
|
-
var min = Math.min;
|
|
1970
|
-
|
|
1971
|
-
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
|
1972
|
-
// https://github.com/zloirock/core-js/pull/702
|
|
1973
|
-
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
1974
|
-
var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
|
|
1975
|
-
return descriptor && !descriptor.writable;
|
|
1976
|
-
}();
|
|
1977
|
-
|
|
1978
|
-
// `String.prototype.startsWith` method
|
|
1979
|
-
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
1980
|
-
$$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
1981
|
-
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
1982
|
-
var that = toString$1(requireObjectCoercible(this));
|
|
1983
|
-
notARegExp(searchString);
|
|
1984
|
-
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
1985
|
-
var search = toString$1(searchString);
|
|
1986
|
-
return stringSlice$1(that, index, index + search.length) === search;
|
|
1987
|
-
}
|
|
1988
|
-
});
|
|
1989
|
-
|
|
1990
1650
|
const FormGroupContext = /*#__PURE__*/createContext({});
|
|
1991
1651
|
/**
|
|
1992
1652
|
* context interface to be used isolated or with the context provider
|
|
@@ -2002,6 +1662,7 @@ const IsolatedContext = ({
|
|
|
2002
1662
|
const formGroupInstance = useRef(new FormGroup({
|
|
2003
1663
|
config
|
|
2004
1664
|
}));
|
|
1665
|
+
const formGroupContextMountRef = useRef(false);
|
|
2005
1666
|
const addFormWithIndex = index => {
|
|
2006
1667
|
formGroupInstance.current.createFormWithIndex({
|
|
2007
1668
|
index,
|
|
@@ -2010,11 +1671,11 @@ const IsolatedContext = ({
|
|
|
2010
1671
|
};
|
|
2011
1672
|
const addForm = ({
|
|
2012
1673
|
key,
|
|
2013
|
-
|
|
1674
|
+
params
|
|
2014
1675
|
}) => {
|
|
2015
1676
|
formGroupInstance.current.addForm({
|
|
2016
1677
|
key,
|
|
2017
|
-
|
|
1678
|
+
params
|
|
2018
1679
|
});
|
|
2019
1680
|
};
|
|
2020
1681
|
const removeForm = ({
|
|
@@ -2032,9 +1693,23 @@ const IsolatedContext = ({
|
|
|
2032
1693
|
const printFormGroupInstance = () => {
|
|
2033
1694
|
console.log(formGroupInstance.current.printFormGroupInstance());
|
|
2034
1695
|
};
|
|
2035
|
-
function submitMultipleFormsByIndex(indexes) {
|
|
2036
|
-
return formGroupInstance.current.submitMultipleFormsByIndex(indexes);
|
|
1696
|
+
function submitMultipleFormsByIndex(indexes, callback) {
|
|
1697
|
+
return formGroupInstance.current.submitMultipleFormsByIndex(indexes, callback);
|
|
2037
1698
|
}
|
|
1699
|
+
useEffect(() => {
|
|
1700
|
+
return () => {
|
|
1701
|
+
if (formGroupContextMountRef.current) {
|
|
1702
|
+
// strictMode made me do this, Beato Carlo Acutis please forgive me
|
|
1703
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1704
|
+
formGroupInstance.current.destroy();
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
}, []);
|
|
1708
|
+
useEffect(() => {
|
|
1709
|
+
return () => {
|
|
1710
|
+
formGroupContextMountRef.current = true;
|
|
1711
|
+
};
|
|
1712
|
+
}, []);
|
|
2038
1713
|
return {
|
|
2039
1714
|
addFormWithIndex,
|
|
2040
1715
|
addForm,
|
|
@@ -2095,252 +1770,6 @@ const useFormGroupContext = props => {
|
|
|
2095
1770
|
return context;
|
|
2096
1771
|
};
|
|
2097
1772
|
|
|
2098
|
-
/**
|
|
2099
|
-
* Renders the React element defined on the mappers configuration
|
|
2100
|
-
*
|
|
2101
|
-
* @param param component props, field instance and children to render
|
|
2102
|
-
* @returns
|
|
2103
|
-
*/
|
|
2104
|
-
const FieldWrapperComponentRender = ({
|
|
2105
|
-
props,
|
|
2106
|
-
fieldInstance,
|
|
2107
|
-
children
|
|
2108
|
-
}) => {
|
|
2109
|
-
var _a, _b, _c;
|
|
2110
|
-
const Component = (_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.component;
|
|
2111
|
-
const Asynccomponent = (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _b === void 0 ? void 0 : _b.asynccomponent;
|
|
2112
|
-
if (Component) return jsx(Component, Object.assign({}, props, {
|
|
2113
|
-
children: children && children
|
|
2114
|
-
}));
|
|
2115
|
-
if (Asynccomponent) return jsx(Suspense, {
|
|
2116
|
-
children: jsx(Asynccomponent, Object.assign({}, props, {
|
|
2117
|
-
children: children && children
|
|
2118
|
-
}))
|
|
2119
|
-
});
|
|
2120
|
-
return jsx("div", {
|
|
2121
|
-
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`
|
|
2122
|
-
});
|
|
2123
|
-
};
|
|
2124
|
-
/**
|
|
2125
|
-
* Base field Wrapper to render the component with the necessary configurations from the schema
|
|
2126
|
-
* and mapper configuration
|
|
2127
|
-
*
|
|
2128
|
-
* @param {TFieldWrapperProps} param FieldWrapper params
|
|
2129
|
-
* @returns {ReactElement}
|
|
2130
|
-
*/
|
|
2131
|
-
const FieldWrapper = ({
|
|
2132
|
-
name,
|
|
2133
|
-
formIndex,
|
|
2134
|
-
children,
|
|
2135
|
-
props,
|
|
2136
|
-
context
|
|
2137
|
-
}) => {
|
|
2138
|
-
var _a, _b, _c;
|
|
2139
|
-
const localContext = useFormGroupContext({});
|
|
2140
|
-
/**
|
|
2141
|
-
* picks the right context prioritizing the context passed as prop
|
|
2142
|
-
*/
|
|
2143
|
-
const {
|
|
2144
|
-
formGroupInstance,
|
|
2145
|
-
debugMode
|
|
2146
|
-
} = useMemo(() => context ? context : localContext, [context, localContext]);
|
|
2147
|
-
const fieldInstance = useRef((_a = formGroupInstance.getForm({
|
|
2148
|
-
key: formIndex
|
|
2149
|
-
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2150
|
-
key: name
|
|
2151
|
-
})).current;
|
|
2152
|
-
const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {});
|
|
2153
|
-
const [state, setState] = useState({
|
|
2154
|
-
visibility: fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.visibility,
|
|
2155
|
-
props: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.props) || props
|
|
2156
|
-
});
|
|
2157
|
-
/**
|
|
2158
|
-
* handles the mounting and unmounting logic onto the field instance
|
|
2159
|
-
*/
|
|
2160
|
-
useEffect(() => {
|
|
2161
|
-
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mountField({
|
|
2162
|
-
valueSubscription: value => {
|
|
2163
|
-
setValueState(value);
|
|
2164
|
-
},
|
|
2165
|
-
propsSubscription: ({
|
|
2166
|
-
visibility,
|
|
2167
|
-
props,
|
|
2168
|
-
errors
|
|
2169
|
-
}) => {
|
|
2170
|
-
setState(prev => Object.assign(Object.assign({}, prev), {
|
|
2171
|
-
visibility,
|
|
2172
|
-
props,
|
|
2173
|
-
errors
|
|
2174
|
-
}));
|
|
2175
|
-
}
|
|
2176
|
-
});
|
|
2177
|
-
return () => {
|
|
2178
|
-
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.destroyField();
|
|
2179
|
-
};
|
|
2180
|
-
}, []);
|
|
2181
|
-
/**
|
|
2182
|
-
* handles the value change onto the field instance
|
|
2183
|
-
*/
|
|
2184
|
-
const handleChange = useCallback(event => {
|
|
2185
|
-
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitValue({
|
|
2186
|
-
value: event,
|
|
2187
|
-
event: 'ON_FIELD_CHANGE'
|
|
2188
|
-
});
|
|
2189
|
-
}, []);
|
|
2190
|
-
/**
|
|
2191
|
-
* handles the event emission onto the field instance
|
|
2192
|
-
*/
|
|
2193
|
-
const handleEvent = useCallback(event => {
|
|
2194
|
-
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitEvents({
|
|
2195
|
-
event
|
|
2196
|
-
});
|
|
2197
|
-
}, []);
|
|
2198
|
-
/**
|
|
2199
|
-
* handles the mappers configuration to bind the event submission callback
|
|
2200
|
-
* to the corresponding prop defined on the mappers
|
|
2201
|
-
*/
|
|
2202
|
-
const mapProps = useMemo(() => {
|
|
2203
|
-
var _a;
|
|
2204
|
-
const events = (_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.events;
|
|
2205
|
-
const props = {};
|
|
2206
|
-
if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
|
|
2207
|
-
if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
|
|
2208
|
-
if (events === null || events === void 0 ? void 0 : events.onFocus) props[events.onFocus] = () => handleEvent('ON_FIELD_FOCUS');
|
|
2209
|
-
if (events === null || events === void 0 ? void 0 : events.onClick) props[events.onClick] = () => handleEvent('ON_FIELD_CLICK');
|
|
2210
|
-
if (events === null || events === void 0 ? void 0 : events.onSubmit) props[events.onSubmit] = () => handleEvent('ON_FORM_SUBMIT');
|
|
2211
|
-
if (events === null || events === void 0 ? void 0 : events.onKeyUp) props[events.onKeyUp] = () => handleEvent('ON_FIELD_KEYUP');
|
|
2212
|
-
if (events === null || events === void 0 ? void 0 : events.onKeyDown) props[events.onKeyDown] = () => handleEvent('ON_FIELD_KEYDOWN');
|
|
2213
|
-
return props;
|
|
2214
|
-
}, []);
|
|
2215
|
-
return (state === null || state === void 0 ? void 0 : state.visibility) ? jsxs(Fragment, {
|
|
2216
|
-
children: [debugMode && jsxs("div", {
|
|
2217
|
-
style: {
|
|
2218
|
-
width: '100%',
|
|
2219
|
-
display: 'flex',
|
|
2220
|
-
flexDirection: 'column'
|
|
2221
|
-
},
|
|
2222
|
-
children: [jsxs("b", {
|
|
2223
|
-
style: {
|
|
2224
|
-
padding: '0px',
|
|
2225
|
-
margin: '0px'
|
|
2226
|
-
},
|
|
2227
|
-
children: ["name:", name]
|
|
2228
|
-
}), jsxs("b", {
|
|
2229
|
-
style: {
|
|
2230
|
-
padding: '0px',
|
|
2231
|
-
margin: '0px'
|
|
2232
|
-
},
|
|
2233
|
-
children: ["order:", (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _b === void 0 ? void 0 : _b.order]
|
|
2234
|
-
}), jsxs("b", {
|
|
2235
|
-
style: {
|
|
2236
|
-
padding: '0px',
|
|
2237
|
-
margin: '0px'
|
|
2238
|
-
},
|
|
2239
|
-
children: ["path:", fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.path]
|
|
2240
|
-
}), jsx("br", {}), jsx("hr", {})]
|
|
2241
|
-
}), jsx(FieldWrapperComponentRender, {
|
|
2242
|
-
props: Object.assign(Object.assign(Object.assign(Object.assign({}, mapProps), state.props), state.errors), valueState),
|
|
2243
|
-
fieldInstance: fieldInstance,
|
|
2244
|
-
children: children ? children : ((_c = state === null || state === void 0 ? void 0 : state.props) === null || _c === void 0 ? void 0 : _c.children) ? state === null || state === void 0 ? void 0 : state.props.children : null
|
|
2245
|
-
})]
|
|
2246
|
-
}) : jsx(Fragment, {});
|
|
2247
|
-
};
|
|
2248
|
-
|
|
2249
|
-
/**
|
|
2250
|
-
* recursive function to transform form fields from a form instance into
|
|
2251
|
-
* a react component tree
|
|
2252
|
-
*
|
|
2253
|
-
* @param {Map<string,IFormField>} param.fields form instance field Map
|
|
2254
|
-
* @param {string} param.prevPath previous field path to track the tree branch creation
|
|
2255
|
-
* @param {string} param.formIndex form index to aid field identification onto the FieldWrapper
|
|
2256
|
-
* @returns {ReactNode}
|
|
2257
|
-
*/
|
|
2258
|
-
const BuildTree = ({
|
|
2259
|
-
fields,
|
|
2260
|
-
prevPath,
|
|
2261
|
-
formIndex
|
|
2262
|
-
}) => {
|
|
2263
|
-
return Array.from(fields).sort(([, field], [, field2]) => {
|
|
2264
|
-
var _a, _b;
|
|
2265
|
-
return (((_a = field.originalSchema) === null || _a === void 0 ? void 0 : _a.order) || 0) - (((_b = field2.originalSchema) === null || _b === void 0 ? void 0 : _b.order) || 0);
|
|
2266
|
-
}).filter(([, value]) => {
|
|
2267
|
-
return value.path === prevPath;
|
|
2268
|
-
}).map(([, value]) => {
|
|
2269
|
-
const fieldName = value.name;
|
|
2270
|
-
const children = BuildTree({
|
|
2271
|
-
fields,
|
|
2272
|
-
prevPath: `${prevPath ? `${prevPath}.` : ``}${value.name}`,
|
|
2273
|
-
formIndex
|
|
2274
|
-
});
|
|
2275
|
-
const lenght = Children.count(children);
|
|
2276
|
-
return jsx(FieldWrapper, {
|
|
2277
|
-
name: fieldName,
|
|
2278
|
-
formIndex: formIndex,
|
|
2279
|
-
children: lenght > 0 ? children : null
|
|
2280
|
-
}, fieldName);
|
|
2281
|
-
});
|
|
2282
|
-
};
|
|
2283
|
-
/**
|
|
2284
|
-
* function to transform AsFormField elements onto a JSON schema
|
|
2285
|
-
*
|
|
2286
|
-
* @param param.children ReactNode children elements
|
|
2287
|
-
* @returns {IComponentSchema[] | null | undefined}
|
|
2288
|
-
*/
|
|
2289
|
-
const BuildAsFormFieldTree = ({
|
|
2290
|
-
children
|
|
2291
|
-
}) => {
|
|
2292
|
-
return Children.map(children, (child, index) => {
|
|
2293
|
-
var _a, _b, _c, _d, _e;
|
|
2294
|
-
let struct;
|
|
2295
|
-
if (!String((_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.name).startsWith('AsFormField')) {
|
|
2296
|
-
if (typeof child.type === 'function' || typeof child.type === 'object') {
|
|
2297
|
-
const props = Object.assign({}, child.props);
|
|
2298
|
-
delete props.children;
|
|
2299
|
-
struct = {
|
|
2300
|
-
component: ((_b = child === null || child === void 0 ? void 0 : child.type) === null || _b === void 0 ? void 0 : _b.name) || 'customForwardRef',
|
|
2301
|
-
name: `adapter-${Math.floor(Math.random() * Date.now()).toString(16)}`,
|
|
2302
|
-
mapper: {
|
|
2303
|
-
component: child.type,
|
|
2304
|
-
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
|
|
2305
|
-
},
|
|
2306
|
-
props
|
|
2307
|
-
};
|
|
2308
|
-
} else if (typeof child.type === 'string' || typeof child === 'string') {
|
|
2309
|
-
throw new Error(`Only function components works inside a Form as React Nodes,\n
|
|
2310
|
-
if you want something like this to work: <div>hi</div>\n
|
|
2311
|
-
wrap it onto a function component\n
|
|
2312
|
-
const CustomTextNode = (props:{text:string}) => <div>props</div>\n
|
|
2313
|
-
and use it like <CustomTextNode text="hi"/>`);
|
|
2314
|
-
} else {
|
|
2315
|
-
throw {
|
|
2316
|
-
message: `Unknown error occured, please check the child that was tried to render below`,
|
|
2317
|
-
component: child
|
|
2318
|
-
};
|
|
2319
|
-
}
|
|
2320
|
-
} else {
|
|
2321
|
-
if (((_d = child === null || child === void 0 ? void 0 : child.type) === null || _d === void 0 ? void 0 : _d.name) === 'AsFormField') {
|
|
2322
|
-
struct = Object.assign({}, child.props);
|
|
2323
|
-
} else {
|
|
2324
|
-
if (!child.type.defaultProps.component) throw new Error(`set defaultProps component name\n
|
|
2325
|
-
ex: AsFormFieldInput.defaultProps = {
|
|
2326
|
-
component = 'input'
|
|
2327
|
-
}`);
|
|
2328
|
-
struct = Object.assign(Object.assign({}, child.props), child.type.defaultProps);
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
if (struct && (struct === null || struct === void 0 ? void 0 : struct.children)) {
|
|
2332
|
-
delete struct.children;
|
|
2333
|
-
}
|
|
2334
|
-
struct.order = index;
|
|
2335
|
-
const childElements = BuildAsFormFieldTree({
|
|
2336
|
-
children: (_e = child.props) === null || _e === void 0 ? void 0 : _e.children
|
|
2337
|
-
});
|
|
2338
|
-
return Object.assign(Object.assign({}, struct), childElements && {
|
|
2339
|
-
children: childElements
|
|
2340
|
-
});
|
|
2341
|
-
});
|
|
2342
|
-
};
|
|
2343
|
-
|
|
2344
1773
|
/******************************************************************************
|
|
2345
1774
|
Copyright (c) Microsoft Corporation.
|
|
2346
1775
|
|
|
@@ -2383,8 +1812,10 @@ const eventsMapping = {
|
|
|
2383
1812
|
ON_FIELD_KEYDOWN: 'onKeyDown',
|
|
2384
1813
|
ON_FIELD_KEYUP: 'onKeyUp',
|
|
2385
1814
|
ON_FIELD_MOUNT: 'onMount',
|
|
1815
|
+
ON_API_FIELD_REQUEST: 'onApiRequest',
|
|
2386
1816
|
ON_API_FIELD_RESPONSE: 'onApiResponse',
|
|
2387
|
-
ON_FIELD_CLICK: 'onClick'
|
|
1817
|
+
ON_FIELD_CLICK: 'onClick',
|
|
1818
|
+
ON_FIELD_CLEARED: 'onFieldCleared'
|
|
2388
1819
|
};
|
|
2389
1820
|
|
|
2390
1821
|
/**
|
|
@@ -2516,97 +1947,58 @@ function Form({
|
|
|
2516
1947
|
children
|
|
2517
1948
|
}) {
|
|
2518
1949
|
const {
|
|
2519
|
-
addForm,
|
|
2520
|
-
removeForm,
|
|
2521
1950
|
getForm,
|
|
2522
1951
|
mappers,
|
|
2523
1952
|
debugMode,
|
|
2524
1953
|
formGroupInstance
|
|
2525
1954
|
} = useFormGroupContext({});
|
|
2526
|
-
const schemaIndex =
|
|
2527
|
-
const [
|
|
2528
|
-
const
|
|
2529
|
-
schema: Object.assign(Object.assign({}, schema), {
|
|
2530
|
-
index: schemaIndex
|
|
2531
|
-
}),
|
|
2532
|
-
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2533
|
-
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
2534
|
-
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2535
|
-
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2536
|
-
index: schemaIndex,
|
|
2537
|
-
mappers,
|
|
2538
|
-
config: config || formGroupInstance.config
|
|
2539
|
-
}));
|
|
2540
|
-
if (schemaIndex === 'defaultChange' || schemaIndex === 'defaultChange-ssr') {
|
|
2541
|
-
console.warn('please, add an unique id to the form, otherwise multiple forms will break');
|
|
2542
|
-
}
|
|
2543
|
-
if (!formGroupInstance.forms.has(schemaIndex)) addForm({
|
|
2544
|
-
key: schemaIndex,
|
|
2545
|
-
formInstance: formInstance.current
|
|
2546
|
-
});
|
|
1955
|
+
const schemaIndex = useRef(index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange').current;
|
|
1956
|
+
const [mounted, setMounted] = useState(false);
|
|
1957
|
+
const mountedRef = useRef(false);
|
|
2547
1958
|
/**
|
|
2548
|
-
*
|
|
2549
|
-
* and JSON schema onto FieldWrappers, refreshes when
|
|
2550
|
-
* the react tree changes it's children
|
|
1959
|
+
* effect to create the form instance and notify the recursive generated fields of it's mounted status
|
|
2551
1960
|
*/
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
1961
|
+
useEffect(() => {
|
|
1962
|
+
if (mountedRef.current) return;
|
|
1963
|
+
formGroupInstance.addForm({
|
|
1964
|
+
key: schemaIndex,
|
|
1965
|
+
params: {
|
|
1966
|
+
schema,
|
|
1967
|
+
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
1968
|
+
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
1969
|
+
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
1970
|
+
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
1971
|
+
index: schemaIndex,
|
|
1972
|
+
mappers,
|
|
1973
|
+
config: config || formGroupInstance.config
|
|
1974
|
+
}
|
|
2556
1975
|
});
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
key: schemaIndex
|
|
2562
|
-
})) === null || _b === void 0 ? void 0 : _b.fields;
|
|
2563
|
-
if (fields) {
|
|
2564
|
-
const buildTree = BuildTree({
|
|
2565
|
-
fields,
|
|
2566
|
-
formIndex: schemaIndex
|
|
2567
|
-
});
|
|
2568
|
-
return buildTree;
|
|
2569
|
-
}
|
|
2570
|
-
}, [children, getForm]);
|
|
1976
|
+
setMounted(true);
|
|
1977
|
+
mountedRef.current = true;
|
|
1978
|
+
// }
|
|
1979
|
+
}, []);
|
|
2571
1980
|
/**
|
|
2572
1981
|
* iVars change tracker to update iVars onto form instance
|
|
2573
1982
|
*/
|
|
2574
1983
|
useEffect(() => {
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
1984
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
1985
|
+
console.log('failed to add iVars due to no form instance');
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
if (iVars && mounted) formGroupInstance.forms.get(schemaIndex).iVars = iVars;
|
|
1989
|
+
// if (iVars) formInstance.current.iVars = iVars;
|
|
1990
|
+
}, [iVars, mounted]);
|
|
2579
1991
|
/**
|
|
2580
1992
|
* initialValues setter for async initialValues
|
|
2581
1993
|
*/
|
|
2582
1994
|
useEffect(() => {
|
|
2583
|
-
if (
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
}, [initialValues]);
|
|
2587
|
-
/**
|
|
2588
|
-
* logic to mount and manage form removal
|
|
2589
|
-
*/
|
|
2590
|
-
useEffect(() => {
|
|
2591
|
-
setRender(true);
|
|
2592
|
-
let subMounted;
|
|
2593
|
-
if (onFormMount) {
|
|
2594
|
-
subMounted = formInstance.current.subscribeOnMount(onFormMount);
|
|
1995
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
1996
|
+
console.log('failed to add initialValues due to no form instance');
|
|
1997
|
+
return;
|
|
2595
1998
|
}
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
the management of multiple forms needs to be planned
|
|
2600
|
-
*/
|
|
2601
|
-
return () => {
|
|
2602
|
-
subMounted === null || subMounted === void 0 ? void 0 : subMounted.unsubscribe();
|
|
2603
|
-
if (render) {
|
|
2604
|
-
removeForm({
|
|
2605
|
-
key: schemaIndex
|
|
2606
|
-
});
|
|
2607
|
-
}
|
|
2608
|
-
};
|
|
2609
|
-
}, []);
|
|
1999
|
+
if (initialValues && mounted) formGroupInstance.forms.get(schemaIndex).initialValues = initialValues;
|
|
2000
|
+
// if (initialValues) formInstance.current.initialValues = initialValues;
|
|
2001
|
+
}, [initialValues, mounted]);
|
|
2610
2002
|
/**
|
|
2611
2003
|
* hook usage to keep event bindings updated on callback functions passed as props
|
|
2612
2004
|
*/
|
|
@@ -2624,7 +2016,7 @@ function Form({
|
|
|
2624
2016
|
onFormMount,
|
|
2625
2017
|
onData,
|
|
2626
2018
|
onValid
|
|
2627
|
-
}
|
|
2019
|
+
});
|
|
2628
2020
|
/*
|
|
2629
2021
|
@TODO move this logic inside form-core, add action and method onto form element,
|
|
2630
2022
|
might need a ref of the form to collect all the form parameters when there is a
|
|
@@ -2671,7 +2063,12 @@ function Form({
|
|
|
2671
2063
|
}), jsx("br", {}), jsx("hr", {})]
|
|
2672
2064
|
}), jsx("form", {
|
|
2673
2065
|
onSubmit: handleSubmit,
|
|
2674
|
-
children:
|
|
2066
|
+
children: jsx(BuildSchemaAsFields, {
|
|
2067
|
+
formIndex: schemaIndex,
|
|
2068
|
+
mappers: mappers,
|
|
2069
|
+
components: schema === null || schema === void 0 ? void 0 : schema.components,
|
|
2070
|
+
mountedForm: mounted
|
|
2071
|
+
})
|
|
2675
2072
|
})]
|
|
2676
2073
|
});
|
|
2677
2074
|
}
|
|
@@ -2689,185 +2086,184 @@ const AsFormField = props => {
|
|
|
2689
2086
|
return props.children;
|
|
2690
2087
|
};
|
|
2691
2088
|
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
return
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
2719
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
2720
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2089
|
+
/**
|
|
2090
|
+
* Renders the React element defined on the mappers configuration
|
|
2091
|
+
*
|
|
2092
|
+
* @param param component props, field instance and children to render
|
|
2093
|
+
* @returns
|
|
2094
|
+
*/
|
|
2095
|
+
const FieldWrapperComponentRender = ({
|
|
2096
|
+
props,
|
|
2097
|
+
fieldInstance,
|
|
2098
|
+
children,
|
|
2099
|
+
mapper
|
|
2100
|
+
}) => {
|
|
2101
|
+
var _a, _b, _c;
|
|
2102
|
+
const Component = (mapper === null || mapper === void 0 ? void 0 : mapper.component) || ((_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.component);
|
|
2103
|
+
const Asynccomponent = (mapper === null || mapper === void 0 ? void 0 : mapper.asynccomponent) || ((_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _b === void 0 ? void 0 : _b.asynccomponent);
|
|
2104
|
+
if (Component) return jsx(Component, Object.assign({}, props, {
|
|
2105
|
+
children: children && children
|
|
2106
|
+
}));
|
|
2107
|
+
if (Asynccomponent) return jsx(Suspense, {
|
|
2108
|
+
children: jsx(Asynccomponent, Object.assign({}, props, {
|
|
2109
|
+
children: children && children
|
|
2110
|
+
}))
|
|
2111
|
+
});
|
|
2112
|
+
return jsx("div", {
|
|
2113
|
+
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`
|
|
2114
|
+
});
|
|
2721
2115
|
};
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
var
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
var indexOf = uncurryThis(''.indexOf);
|
|
2764
|
-
var replace = uncurryThis(''.replace);
|
|
2765
|
-
var stringSlice = uncurryThis(''.slice);
|
|
2766
|
-
|
|
2767
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2768
|
-
var re1 = /a/;
|
|
2769
|
-
var re2 = /b*/g;
|
|
2770
|
-
call(nativeExec, re1, 'a');
|
|
2771
|
-
call(nativeExec, re2, 'a');
|
|
2772
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2773
|
-
})();
|
|
2774
|
-
|
|
2775
|
-
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2776
|
-
|
|
2777
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2778
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2779
|
-
|
|
2780
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2781
|
-
|
|
2782
|
-
if (PATCH) {
|
|
2783
|
-
patchedExec = function exec(string) {
|
|
2784
|
-
var re = this;
|
|
2785
|
-
var state = getInternalState(re);
|
|
2786
|
-
var str = toString(string);
|
|
2787
|
-
var raw = state.raw;
|
|
2788
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
2789
|
-
|
|
2790
|
-
if (raw) {
|
|
2791
|
-
raw.lastIndex = re.lastIndex;
|
|
2792
|
-
result = call(patchedExec, raw, str);
|
|
2793
|
-
re.lastIndex = raw.lastIndex;
|
|
2794
|
-
return result;
|
|
2795
|
-
}
|
|
2796
|
-
|
|
2797
|
-
var groups = state.groups;
|
|
2798
|
-
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2799
|
-
var flags = call(regexpFlags, re);
|
|
2800
|
-
var source = re.source;
|
|
2801
|
-
var charsAdded = 0;
|
|
2802
|
-
var strCopy = str;
|
|
2803
|
-
|
|
2804
|
-
if (sticky) {
|
|
2805
|
-
flags = replace(flags, 'y', '');
|
|
2806
|
-
if (indexOf(flags, 'g') === -1) {
|
|
2807
|
-
flags += 'g';
|
|
2808
|
-
}
|
|
2809
|
-
|
|
2810
|
-
strCopy = stringSlice(str, re.lastIndex);
|
|
2811
|
-
// Support anchored sticky behavior.
|
|
2812
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
|
2813
|
-
source = '(?: ' + source + ')';
|
|
2814
|
-
strCopy = ' ' + strCopy;
|
|
2815
|
-
charsAdded++;
|
|
2816
|
-
}
|
|
2817
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2818
|
-
// simulate the 'y' flag.
|
|
2819
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
if (NPCG_INCLUDED) {
|
|
2823
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2824
|
-
}
|
|
2825
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2826
|
-
|
|
2827
|
-
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2828
|
-
|
|
2829
|
-
if (sticky) {
|
|
2830
|
-
if (match) {
|
|
2831
|
-
match.input = stringSlice(match.input, charsAdded);
|
|
2832
|
-
match[0] = stringSlice(match[0], charsAdded);
|
|
2833
|
-
match.index = re.lastIndex;
|
|
2834
|
-
re.lastIndex += match[0].length;
|
|
2835
|
-
} else re.lastIndex = 0;
|
|
2836
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2837
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2838
|
-
}
|
|
2839
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2840
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2841
|
-
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2842
|
-
call(nativeReplace, match[0], reCopy, function () {
|
|
2843
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
2844
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
2845
|
-
}
|
|
2846
|
-
});
|
|
2116
|
+
/**
|
|
2117
|
+
* Base field Wrapper to render the component with the necessary configurations from the schema
|
|
2118
|
+
* and mapper configuration
|
|
2119
|
+
*
|
|
2120
|
+
* @param {TFieldWrapperProps} param FieldWrapper params
|
|
2121
|
+
* @returns {ReactElement}
|
|
2122
|
+
*/
|
|
2123
|
+
const FieldWrapper = ({
|
|
2124
|
+
name,
|
|
2125
|
+
formIndex,
|
|
2126
|
+
children,
|
|
2127
|
+
props,
|
|
2128
|
+
context,
|
|
2129
|
+
mounted,
|
|
2130
|
+
mapper,
|
|
2131
|
+
visibility
|
|
2132
|
+
}) => {
|
|
2133
|
+
var _a, _b, _c;
|
|
2134
|
+
const localContext = useFormGroupContext({});
|
|
2135
|
+
/**
|
|
2136
|
+
* picks the right context prioritizing the context passed as prop
|
|
2137
|
+
*/
|
|
2138
|
+
const {
|
|
2139
|
+
formGroupInstance,
|
|
2140
|
+
debugMode
|
|
2141
|
+
} = useMemo(() => context ? context : localContext, [context, localContext]);
|
|
2142
|
+
const fieldInstance = useMemo(() => {
|
|
2143
|
+
var _a;
|
|
2144
|
+
return (_a = formGroupInstance.getForm({
|
|
2145
|
+
key: formIndex
|
|
2146
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2147
|
+
key: name
|
|
2148
|
+
});
|
|
2149
|
+
}, [mounted]);
|
|
2150
|
+
/**
|
|
2151
|
+
* props with templates stripped until the field ins't ready on the instance
|
|
2152
|
+
*/
|
|
2153
|
+
const filteredProps = useMemo(() => {
|
|
2154
|
+
let returnProps = {};
|
|
2155
|
+
if (props) {
|
|
2156
|
+
returnProps = FormField.filterProps(props);
|
|
2847
2157
|
}
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2158
|
+
if (fieldInstance) fieldInstance.props = returnProps;
|
|
2159
|
+
return returnProps;
|
|
2160
|
+
}, [props]);
|
|
2161
|
+
const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {
|
|
2162
|
+
[((_a = mapper === null || mapper === void 0 ? void 0 : mapper.events) === null || _a === void 0 ? void 0 : _a.setValue) || 'value']: ''
|
|
2163
|
+
});
|
|
2164
|
+
const [state, setState] = useState({
|
|
2165
|
+
visibility: typeof visibility === 'boolean' ? visibility : true,
|
|
2166
|
+
props: filteredProps
|
|
2167
|
+
});
|
|
2168
|
+
/**
|
|
2169
|
+
* handles the mounting and unmounting logic onto the field instance
|
|
2170
|
+
*/
|
|
2171
|
+
useEffect(() => {
|
|
2172
|
+
if (!fieldInstance || (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mounted)) return;
|
|
2173
|
+
fieldInstance.mountField({
|
|
2174
|
+
valueSubscription: value => {
|
|
2175
|
+
setValueState(value);
|
|
2176
|
+
},
|
|
2177
|
+
propsSubscription: ({
|
|
2178
|
+
visibility,
|
|
2179
|
+
props,
|
|
2180
|
+
errors
|
|
2181
|
+
}) => {
|
|
2182
|
+
setState(prev => Object.assign(Object.assign({}, prev), {
|
|
2183
|
+
visibility,
|
|
2184
|
+
props,
|
|
2185
|
+
errors
|
|
2186
|
+
}));
|
|
2854
2187
|
}
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2188
|
+
});
|
|
2189
|
+
}, [fieldInstance]);
|
|
2190
|
+
/**
|
|
2191
|
+
* recycle effect to remove the field Subscriptions due to memory leaks
|
|
2192
|
+
*/
|
|
2193
|
+
useEffect(() => {
|
|
2194
|
+
return () => {
|
|
2195
|
+
(fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mounted) && (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.destroyField());
|
|
2196
|
+
};
|
|
2197
|
+
}, []);
|
|
2198
|
+
/**
|
|
2199
|
+
* handles the value change onto the field instance
|
|
2200
|
+
*/
|
|
2201
|
+
const handleChange = useCallback(event => {
|
|
2202
|
+
if (!mounted) return;
|
|
2203
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitValue({
|
|
2204
|
+
value: event,
|
|
2205
|
+
event: 'ON_FIELD_CHANGE'
|
|
2206
|
+
});
|
|
2207
|
+
}, [mounted]);
|
|
2208
|
+
/**
|
|
2209
|
+
* handles the event emission onto the field instance
|
|
2210
|
+
*/
|
|
2211
|
+
const handleEvent = useCallback(event => {
|
|
2212
|
+
if (!mounted) return;
|
|
2213
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitEvents({
|
|
2214
|
+
event
|
|
2215
|
+
});
|
|
2216
|
+
}, [mounted]);
|
|
2217
|
+
/**
|
|
2218
|
+
* handles the mappers configuration to bind the event submission callback
|
|
2219
|
+
* to the corresponding prop defined on the mappers
|
|
2220
|
+
*/
|
|
2221
|
+
const mapProps = useMemo(() => {
|
|
2222
|
+
const events = mapper === null || mapper === void 0 ? void 0 : mapper.events;
|
|
2223
|
+
const props = {};
|
|
2224
|
+
if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
|
|
2225
|
+
if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
|
|
2226
|
+
if (events === null || events === void 0 ? void 0 : events.onFocus) props[events.onFocus] = () => handleEvent('ON_FIELD_FOCUS');
|
|
2227
|
+
if (events === null || events === void 0 ? void 0 : events.onClick) props[events.onClick] = () => handleEvent('ON_FIELD_CLICK');
|
|
2228
|
+
if (events === null || events === void 0 ? void 0 : events.onSubmit) props[events.onSubmit] = () => handleEvent('ON_FORM_SUBMIT');
|
|
2229
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyUp) props[events.onKeyUp] = () => handleEvent('ON_FIELD_KEYUP');
|
|
2230
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyDown) props[events.onKeyDown] = () => handleEvent('ON_FIELD_KEYDOWN');
|
|
2231
|
+
return props;
|
|
2232
|
+
}, [mounted]);
|
|
2233
|
+
return state.visibility ? jsxs(Fragment, {
|
|
2234
|
+
children: [debugMode && jsxs("div", {
|
|
2235
|
+
style: {
|
|
2236
|
+
width: '100%',
|
|
2237
|
+
display: 'flex',
|
|
2238
|
+
flexDirection: 'column'
|
|
2239
|
+
},
|
|
2240
|
+
children: [jsxs("b", {
|
|
2241
|
+
style: {
|
|
2242
|
+
padding: '0px',
|
|
2243
|
+
margin: '0px'
|
|
2244
|
+
},
|
|
2245
|
+
children: ["name:", name]
|
|
2246
|
+
}), jsxs("b", {
|
|
2247
|
+
style: {
|
|
2248
|
+
padding: '0px',
|
|
2249
|
+
margin: '0px'
|
|
2250
|
+
},
|
|
2251
|
+
children: ["order:", (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _b === void 0 ? void 0 : _b.order]
|
|
2252
|
+
}), jsxs("b", {
|
|
2253
|
+
style: {
|
|
2254
|
+
padding: '0px',
|
|
2255
|
+
margin: '0px'
|
|
2256
|
+
},
|
|
2257
|
+
children: ["path:", fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.path]
|
|
2258
|
+
}), jsx("br", {}), jsx("hr", {})]
|
|
2259
|
+
}), jsx(FieldWrapperComponentRender, {
|
|
2260
|
+
props: Object.assign(Object.assign(Object.assign(Object.assign({}, mapProps), state.props), state.errors), valueState),
|
|
2261
|
+
fieldInstance: fieldInstance,
|
|
2262
|
+
mapper: mapper,
|
|
2263
|
+
children: children ? children : ((_c = state === null || state === void 0 ? void 0 : state.props) === null || _c === void 0 ? void 0 : _c.children) ? state === null || state === void 0 ? void 0 : state.props.children : null
|
|
2264
|
+
})]
|
|
2265
|
+
}) : jsx(Fragment, {});
|
|
2266
|
+
};
|
|
2871
2267
|
|
|
2872
2268
|
/**
|
|
2873
2269
|
* Component Wrapper to render form fields without the Form component, gets additional formId and mapper since
|
|
@@ -2877,65 +2273,54 @@ $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
|
2877
2273
|
* @returns {ReactElement}
|
|
2878
2274
|
*/
|
|
2879
2275
|
const AsFormFieldBuilder = props => {
|
|
2880
|
-
var _a;
|
|
2881
2276
|
const context = useFormGroupContext({});
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2887
|
-
const fieldSchema = Object.assign(Object.assign(Object.assign({}, props), {
|
|
2888
|
-
name: fieldName
|
|
2889
|
-
}), {
|
|
2890
|
-
component: props.mapper.componentName,
|
|
2891
|
-
children: undefined
|
|
2892
|
-
});
|
|
2893
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2894
|
-
fieldSchema,
|
|
2895
|
-
mapperElement: props.mapper
|
|
2896
|
-
});
|
|
2897
|
-
const field = formInstance === null || formInstance === void 0 ? void 0 : formInstance.getField({
|
|
2898
|
-
key: fieldName
|
|
2899
|
-
});
|
|
2900
|
-
if (typeof (props === null || props === void 0 ? void 0 : props.visibility) !== 'undefined' && field) {
|
|
2901
|
-
field.visibility = props.visibility;
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2277
|
+
/**
|
|
2278
|
+
* state to track the field instance creation process
|
|
2279
|
+
*/
|
|
2280
|
+
const [mounted, setMounted] = useState(false);
|
|
2281
|
+
const mountedRef = useRef(false);
|
|
2904
2282
|
/**
|
|
2905
2283
|
* initializer to create or add a form instance to the formGroup by it's formId
|
|
2906
2284
|
* and add the field to the form instance
|
|
2907
2285
|
* Also has the logic to remove it once this element is removed
|
|
2908
2286
|
*/
|
|
2909
2287
|
useEffect(() => {
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2288
|
+
var _a;
|
|
2289
|
+
if (mountedRef.current) return;
|
|
2290
|
+
if (typeof props.formMounted === 'undefined' && !((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2291
|
+
context.addFormWithIndex(props.formIndex);
|
|
2292
|
+
}
|
|
2293
|
+
if (props.formMounted || typeof props.formMounted === 'undefined') {
|
|
2294
|
+
const fieldSchema = Object.assign(Object.assign({}, props), {
|
|
2295
|
+
component: props.mapper.componentName,
|
|
2296
|
+
children: undefined
|
|
2914
2297
|
});
|
|
2915
|
-
|
|
2916
|
-
|
|
2298
|
+
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2299
|
+
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2300
|
+
fieldSchema,
|
|
2301
|
+
mapperElement: props.mapper
|
|
2302
|
+
});
|
|
2303
|
+
setMounted(true);
|
|
2304
|
+
mountedRef.current = true;
|
|
2305
|
+
}
|
|
2306
|
+
}, [props.formMounted]);
|
|
2917
2307
|
/**
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2308
|
+
* recycle effect to remove the field from the form instance when the field leaves the vDOM
|
|
2309
|
+
* and the subscriptions
|
|
2920
2310
|
*/
|
|
2921
2311
|
useEffect(() => {
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
*/
|
|
2932
|
-
/\$/.test((_b = props.props) === null || _b === void 0 ? void 0 : _b[propKey])) {
|
|
2933
|
-
delete props.props[propKey];
|
|
2934
|
-
}
|
|
2312
|
+
return () => {
|
|
2313
|
+
var _a, _b;
|
|
2314
|
+
if ((_b = (_a = context.getForm({
|
|
2315
|
+
key: props.formIndex
|
|
2316
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2317
|
+
key: props.name
|
|
2318
|
+
})) === null || _b === void 0 ? void 0 : _b.mounted) context.formGroupInstance.removeField({
|
|
2319
|
+
formIndex: props.formIndex,
|
|
2320
|
+
fieldIndex: props.name
|
|
2935
2321
|
});
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
|
-
}, [props.props, fieldName]);
|
|
2322
|
+
};
|
|
2323
|
+
}, []);
|
|
2939
2324
|
/**
|
|
2940
2325
|
* allows to control field selected value on each event
|
|
2941
2326
|
*/
|
|
@@ -2954,9 +2339,12 @@ const AsFormFieldBuilder = props => {
|
|
|
2954
2339
|
}, [props.onSelected]);
|
|
2955
2340
|
return jsx(FieldWrapper, {
|
|
2956
2341
|
formIndex: props.formIndex,
|
|
2957
|
-
name:
|
|
2342
|
+
name: props.name,
|
|
2958
2343
|
props: props.props,
|
|
2959
2344
|
context: !context.active ? context : null,
|
|
2345
|
+
mounted: mounted,
|
|
2346
|
+
mapper: props.mapper,
|
|
2347
|
+
visibility: props.visibility,
|
|
2960
2348
|
children: props.children && props.children
|
|
2961
2349
|
});
|
|
2962
2350
|
};
|
|
@@ -3030,6 +2418,11 @@ const checkedChangeEvent = event => {
|
|
|
3030
2418
|
const valueChangeEvent = event => {
|
|
3031
2419
|
return event.target.value;
|
|
3032
2420
|
};
|
|
2421
|
+
const numberInputChangeEvent = number => {
|
|
2422
|
+
if (number) {
|
|
2423
|
+
return Number(number);
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
3033
2426
|
const datepickerChangeEvent = event => event;
|
|
3034
2427
|
const dropdownChangeEvent = (event, opts) => {
|
|
3035
2428
|
if (typeof event === 'object' && event !== null && 'value' in event && 'id' in event) {
|
|
@@ -3053,4 +2446,4 @@ const dropdownChangeEvent = (event, opts) => {
|
|
|
3053
2446
|
}
|
|
3054
2447
|
};
|
|
3055
2448
|
|
|
3056
|
-
export { AsFormField, AsFormFieldBuilder, Form, FormGroupContext, FormGroupContextProvider, checkedChangeEvent, datepickerChangeEvent, defaultChangeEvent, dropdownChangeEvent, useForm, useFormGroup, useFormGroupContext, valueChangeEvent };
|
|
2449
|
+
export { AsFormField, AsFormFieldBuilder, Form, FormGroupContext, FormGroupContextProvider, checkedChangeEvent, datepickerChangeEvent, defaultChangeEvent, dropdownChangeEvent, numberInputChangeEvent, useForm, useFormGroup, useFormGroupContext, valueChangeEvent };
|