@bolttech/form-engine 3.1.0-beta.1 → 3.1.0-beta.10
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 +624 -1296
- 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/generators/formBuilder.d.ts +8 -25
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, FormCore, 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 global$
|
|
91
|
+
var global$b =
|
|
92
92
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
93
93
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
94
94
|
check(typeof window == 'object' && window) ||
|
|
@@ -101,20 +101,20 @@ var global$e =
|
|
|
101
101
|
|
|
102
102
|
var sharedStore = {exports: {}};
|
|
103
103
|
|
|
104
|
-
var global$
|
|
104
|
+
var global$a = global$b;
|
|
105
105
|
|
|
106
106
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
107
107
|
var defineProperty$5 = Object.defineProperty;
|
|
108
108
|
|
|
109
109
|
var defineGlobalProperty$3 = function (key, value) {
|
|
110
110
|
try {
|
|
111
|
-
defineProperty$5(global$
|
|
111
|
+
defineProperty$5(global$a, key, { value: value, configurable: true, writable: true });
|
|
112
112
|
} catch (error) {
|
|
113
|
-
global$
|
|
113
|
+
global$a[key] = value;
|
|
114
114
|
} return value;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
var globalThis$1 = global$
|
|
117
|
+
var globalThis$1 = global$b;
|
|
118
118
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
119
119
|
|
|
120
120
|
var SHARED = '__core-js_shared__';
|
|
@@ -130,49 +130,49 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
130
130
|
|
|
131
131
|
var store$2 = sharedStore.exports;
|
|
132
132
|
|
|
133
|
-
var shared$
|
|
133
|
+
var shared$3 = function (key, value) {
|
|
134
134
|
return store$2[key] || (store$2[key] = value || {});
|
|
135
135
|
};
|
|
136
136
|
|
|
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
169
|
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
170
170
|
|
|
171
|
-
var global$
|
|
172
|
-
var userAgent
|
|
171
|
+
var global$9 = global$b;
|
|
172
|
+
var userAgent = engineUserAgent;
|
|
173
173
|
|
|
174
|
-
var process = global$
|
|
175
|
-
var Deno = global$
|
|
174
|
+
var process = global$9.process;
|
|
175
|
+
var Deno = global$9.Deno;
|
|
176
176
|
var versions = process && process.versions || Deno && Deno.version;
|
|
177
177
|
var v8 = versions && versions.v8;
|
|
178
178
|
var match, version;
|
|
@@ -186,10 +186,10 @@ if (v8) {
|
|
|
186
186
|
|
|
187
187
|
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
188
188
|
// so check `userAgent` even if `.v8` exists, but 0
|
|
189
|
-
if (!version && userAgent
|
|
190
|
-
match = userAgent
|
|
189
|
+
if (!version && userAgent) {
|
|
190
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
191
191
|
if (!match || match[1] >= 74) {
|
|
192
|
-
match = userAgent
|
|
192
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
193
193
|
if (match) version = +match[1];
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -198,19 +198,19 @@ var engineV8Version = version;
|
|
|
198
198
|
|
|
199
199
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
200
200
|
var V8_VERSION = engineV8Version;
|
|
201
|
-
var fails$
|
|
202
|
-
var global$
|
|
201
|
+
var fails$8 = fails$b;
|
|
202
|
+
var global$8 = global$b;
|
|
203
203
|
|
|
204
|
-
var $String$
|
|
204
|
+
var $String$4 = global$8.String;
|
|
205
205
|
|
|
206
206
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
207
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$
|
|
207
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
|
|
208
208
|
var symbol = Symbol('symbol detection');
|
|
209
209
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
210
210
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
211
211
|
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
212
212
|
// of course, fail.
|
|
213
|
-
return !$String$
|
|
213
|
+
return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
214
214
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
215
215
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
216
216
|
});
|
|
@@ -222,20 +222,20 @@ var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
|
222
222
|
&& !Symbol.sham
|
|
223
223
|
&& typeof Symbol.iterator == 'symbol';
|
|
224
224
|
|
|
225
|
-
var global$
|
|
226
|
-
var shared$
|
|
227
|
-
var hasOwn$
|
|
225
|
+
var global$7 = global$b;
|
|
226
|
+
var shared$2 = shared$3;
|
|
227
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
228
228
|
var uid$1 = uid$2;
|
|
229
229
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
230
230
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
231
231
|
|
|
232
|
-
var Symbol$1 = global$
|
|
233
|
-
var WellKnownSymbolsStore = shared$
|
|
232
|
+
var Symbol$1 = global$7.Symbol;
|
|
233
|
+
var WellKnownSymbolsStore = shared$2('wks');
|
|
234
234
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
235
235
|
|
|
236
|
-
var wellKnownSymbol$
|
|
237
|
-
if (!hasOwn$
|
|
238
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$
|
|
236
|
+
var wellKnownSymbol$6 = function (name) {
|
|
237
|
+
if (!hasOwn$8(WellKnownSymbolsStore, name)) {
|
|
238
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
|
|
239
239
|
? Symbol$1[name]
|
|
240
240
|
: createWellKnownSymbol('Symbol.' + name);
|
|
241
241
|
} return WellKnownSymbolsStore[name];
|
|
@@ -247,45 +247,45 @@ var documentAll = typeof document == 'object' && document.all;
|
|
|
247
247
|
// `IsCallable` abstract operation
|
|
248
248
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
249
249
|
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
250
|
-
var isCallable$
|
|
250
|
+
var isCallable$d = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
251
251
|
return typeof argument == 'function' || argument === documentAll;
|
|
252
252
|
} : function (argument) {
|
|
253
253
|
return typeof argument == 'function';
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
-
var isCallable$
|
|
256
|
+
var isCallable$c = isCallable$d;
|
|
257
257
|
|
|
258
|
-
var isObject$
|
|
259
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
258
|
+
var isObject$8 = function (it) {
|
|
259
|
+
return typeof it == 'object' ? it !== null : isCallable$c(it);
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
-
var isObject$
|
|
262
|
+
var isObject$7 = isObject$8;
|
|
263
263
|
|
|
264
|
-
var $String$
|
|
265
|
-
var $TypeError$
|
|
264
|
+
var $String$3 = String;
|
|
265
|
+
var $TypeError$5 = TypeError;
|
|
266
266
|
|
|
267
267
|
// `Assert: Type(argument) is Object`
|
|
268
|
-
var anObject$
|
|
269
|
-
if (isObject$
|
|
270
|
-
throw new $TypeError$
|
|
268
|
+
var anObject$4 = function (argument) {
|
|
269
|
+
if (isObject$7(argument)) return argument;
|
|
270
|
+
throw new $TypeError$5($String$3(argument) + ' is not an object');
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
var objectDefineProperties = {};
|
|
274
274
|
|
|
275
|
-
var fails$
|
|
275
|
+
var fails$7 = fails$b;
|
|
276
276
|
|
|
277
277
|
// Detect IE8's incomplete defineProperty implementation
|
|
278
|
-
var descriptors = !fails$
|
|
278
|
+
var descriptors = !fails$7(function () {
|
|
279
279
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
280
280
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
281
281
|
});
|
|
282
282
|
|
|
283
283
|
var DESCRIPTORS$9 = descriptors;
|
|
284
|
-
var fails$
|
|
284
|
+
var fails$6 = fails$b;
|
|
285
285
|
|
|
286
286
|
// V8 ~ Chrome 36-
|
|
287
287
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
288
|
-
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$
|
|
288
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$6(function () {
|
|
289
289
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
290
290
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
291
291
|
value: 42,
|
|
@@ -295,23 +295,23 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$c(function () {
|
|
|
295
295
|
|
|
296
296
|
var objectDefineProperty = {};
|
|
297
297
|
|
|
298
|
-
var global$
|
|
299
|
-
var isObject$
|
|
298
|
+
var global$6 = global$b;
|
|
299
|
+
var isObject$6 = isObject$8;
|
|
300
300
|
|
|
301
|
-
var document$1 = global$
|
|
301
|
+
var document$1 = global$6.document;
|
|
302
302
|
// typeof document.createElement is 'object' in old IE
|
|
303
|
-
var EXISTS$1 = isObject$
|
|
303
|
+
var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
|
|
304
304
|
|
|
305
305
|
var documentCreateElement$2 = function (it) {
|
|
306
306
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
var DESCRIPTORS$8 = descriptors;
|
|
310
|
-
var fails$
|
|
310
|
+
var fails$5 = fails$b;
|
|
311
311
|
var createElement = documentCreateElement$2;
|
|
312
312
|
|
|
313
313
|
// Thanks to IE8 for its funny defineProperty
|
|
314
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$
|
|
314
|
+
var ie8DomDefine = !DESCRIPTORS$8 && !fails$5(function () {
|
|
315
315
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
316
316
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
317
317
|
get: function () { return 7; }
|
|
@@ -320,109 +320,109 @@ var ie8DomDefine = !DESCRIPTORS$8 && !fails$b(function () {
|
|
|
320
320
|
|
|
321
321
|
var NATIVE_BIND = functionBindNative;
|
|
322
322
|
|
|
323
|
-
var call$
|
|
323
|
+
var call$5 = Function.prototype.call;
|
|
324
324
|
|
|
325
|
-
var functionCall = NATIVE_BIND ? call$
|
|
326
|
-
return call$
|
|
325
|
+
var functionCall = NATIVE_BIND ? call$5.bind(call$5) : function () {
|
|
326
|
+
return call$5.apply(call$5, arguments);
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
var global$
|
|
330
|
-
var isCallable$
|
|
329
|
+
var global$5 = global$b;
|
|
330
|
+
var isCallable$b = isCallable$d;
|
|
331
331
|
|
|
332
332
|
var aFunction = function (argument) {
|
|
333
|
-
return isCallable$
|
|
333
|
+
return isCallable$b(argument) ? argument : undefined;
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
var getBuiltIn$3 = function (namespace, method) {
|
|
337
|
-
return arguments.length < 2 ? aFunction(global$
|
|
337
|
+
return arguments.length < 2 ? aFunction(global$5[namespace]) : global$5[namespace] && global$5[namespace][method];
|
|
338
338
|
};
|
|
339
339
|
|
|
340
|
-
var uncurryThis$
|
|
340
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
341
341
|
|
|
342
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
342
|
+
var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
|
|
343
343
|
|
|
344
344
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
345
|
-
var isCallable$
|
|
346
|
-
var isPrototypeOf
|
|
345
|
+
var isCallable$a = isCallable$d;
|
|
346
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
347
347
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
348
348
|
|
|
349
|
-
var $Object$
|
|
349
|
+
var $Object$1 = Object;
|
|
350
350
|
|
|
351
351
|
var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
|
|
352
352
|
return typeof it == 'symbol';
|
|
353
353
|
} : function (it) {
|
|
354
354
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
355
|
-
return isCallable$
|
|
355
|
+
return isCallable$a($Symbol) && isPrototypeOf($Symbol.prototype, $Object$1(it));
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
-
var $String$
|
|
358
|
+
var $String$2 = String;
|
|
359
359
|
|
|
360
|
-
var tryToString$
|
|
360
|
+
var tryToString$1 = function (argument) {
|
|
361
361
|
try {
|
|
362
|
-
return $String$
|
|
362
|
+
return $String$2(argument);
|
|
363
363
|
} catch (error) {
|
|
364
364
|
return 'Object';
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
367
|
|
|
368
|
-
var isCallable$
|
|
369
|
-
var tryToString
|
|
368
|
+
var isCallable$9 = isCallable$d;
|
|
369
|
+
var tryToString = tryToString$1;
|
|
370
370
|
|
|
371
|
-
var $TypeError$
|
|
371
|
+
var $TypeError$4 = TypeError;
|
|
372
372
|
|
|
373
373
|
// `Assert: IsCallable(argument) is true`
|
|
374
|
-
var aCallable$
|
|
375
|
-
if (isCallable$
|
|
376
|
-
throw new $TypeError$
|
|
374
|
+
var aCallable$2 = function (argument) {
|
|
375
|
+
if (isCallable$9(argument)) return argument;
|
|
376
|
+
throw new $TypeError$4(tryToString(argument) + ' is not a function');
|
|
377
377
|
};
|
|
378
378
|
|
|
379
|
-
var aCallable$
|
|
379
|
+
var aCallable$1 = aCallable$2;
|
|
380
380
|
var isNullOrUndefined = isNullOrUndefined$2;
|
|
381
381
|
|
|
382
382
|
// `GetMethod` abstract operation
|
|
383
383
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
384
384
|
var getMethod$1 = function (V, P) {
|
|
385
385
|
var func = V[P];
|
|
386
|
-
return isNullOrUndefined(func) ? undefined : aCallable$
|
|
386
|
+
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
-
var call$
|
|
390
|
-
var isCallable$
|
|
391
|
-
var isObject$
|
|
389
|
+
var call$4 = functionCall;
|
|
390
|
+
var isCallable$8 = isCallable$d;
|
|
391
|
+
var isObject$5 = isObject$8;
|
|
392
392
|
|
|
393
|
-
var $TypeError$
|
|
393
|
+
var $TypeError$3 = TypeError;
|
|
394
394
|
|
|
395
395
|
// `OrdinaryToPrimitive` abstract operation
|
|
396
396
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
397
397
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
398
398
|
var fn, val;
|
|
399
|
-
if (pref === 'string' && isCallable$
|
|
400
|
-
if (isCallable$
|
|
401
|
-
if (pref !== 'string' && isCallable$
|
|
402
|
-
throw new $TypeError$
|
|
399
|
+
if (pref === 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
|
|
400
|
+
if (isCallable$8(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
|
|
401
|
+
if (pref !== 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
|
|
402
|
+
throw new $TypeError$3("Can't convert object to primitive value");
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
-
var call$
|
|
406
|
-
var isObject$
|
|
405
|
+
var call$3 = functionCall;
|
|
406
|
+
var isObject$4 = isObject$8;
|
|
407
407
|
var isSymbol$1 = isSymbol$2;
|
|
408
408
|
var getMethod = getMethod$1;
|
|
409
409
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
410
|
-
var wellKnownSymbol$
|
|
410
|
+
var wellKnownSymbol$5 = wellKnownSymbol$6;
|
|
411
411
|
|
|
412
|
-
var $TypeError$
|
|
413
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
412
|
+
var $TypeError$2 = TypeError;
|
|
413
|
+
var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
|
|
414
414
|
|
|
415
415
|
// `ToPrimitive` abstract operation
|
|
416
416
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
417
417
|
var toPrimitive$1 = function (input, pref) {
|
|
418
|
-
if (!isObject$
|
|
418
|
+
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
419
419
|
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
420
420
|
var result;
|
|
421
421
|
if (exoticToPrim) {
|
|
422
422
|
if (pref === undefined) pref = 'default';
|
|
423
|
-
result = call$
|
|
424
|
-
if (!isObject$
|
|
425
|
-
throw new $TypeError$
|
|
423
|
+
result = call$3(exoticToPrim, input, pref);
|
|
424
|
+
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
425
|
+
throw new $TypeError$2("Can't convert object to primitive value");
|
|
426
426
|
}
|
|
427
427
|
if (pref === undefined) pref = 'number';
|
|
428
428
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -441,10 +441,10 @@ var toPropertyKey$2 = function (argument) {
|
|
|
441
441
|
var DESCRIPTORS$7 = descriptors;
|
|
442
442
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
443
443
|
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
444
|
-
var anObject$
|
|
444
|
+
var anObject$3 = anObject$4;
|
|
445
445
|
var toPropertyKey$1 = toPropertyKey$2;
|
|
446
446
|
|
|
447
|
-
var $TypeError$
|
|
447
|
+
var $TypeError$1 = TypeError;
|
|
448
448
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
449
449
|
var $defineProperty = Object.defineProperty;
|
|
450
450
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -456,9 +456,9 @@ var WRITABLE = 'writable';
|
|
|
456
456
|
// `Object.defineProperty` method
|
|
457
457
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
458
458
|
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
459
|
-
anObject$
|
|
459
|
+
anObject$3(O);
|
|
460
460
|
P = toPropertyKey$1(P);
|
|
461
|
-
anObject$
|
|
461
|
+
anObject$3(Attributes);
|
|
462
462
|
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
463
463
|
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
464
464
|
if (current && current[WRITABLE]) {
|
|
@@ -471,26 +471,26 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
471
471
|
}
|
|
472
472
|
} return $defineProperty(O, P, Attributes);
|
|
473
473
|
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
474
|
-
anObject$
|
|
474
|
+
anObject$3(O);
|
|
475
475
|
P = toPropertyKey$1(P);
|
|
476
|
-
anObject$
|
|
476
|
+
anObject$3(Attributes);
|
|
477
477
|
if (IE8_DOM_DEFINE$1) try {
|
|
478
478
|
return $defineProperty(O, P, Attributes);
|
|
479
479
|
} catch (error) { /* empty */ }
|
|
480
|
-
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$
|
|
480
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
|
|
481
481
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
482
482
|
return O;
|
|
483
483
|
};
|
|
484
484
|
|
|
485
485
|
var ceil = Math.ceil;
|
|
486
|
-
var floor
|
|
486
|
+
var floor = Math.floor;
|
|
487
487
|
|
|
488
488
|
// `Math.trunc` method
|
|
489
489
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
490
490
|
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
491
491
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
492
492
|
var n = +x;
|
|
493
|
-
return (n > 0 ? floor
|
|
493
|
+
return (n > 0 ? floor : ceil)(n);
|
|
494
494
|
};
|
|
495
495
|
|
|
496
496
|
var trunc = mathTrunc;
|
|
@@ -506,44 +506,44 @@ var toIntegerOrInfinity$2 = function (argument) {
|
|
|
506
506
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
507
507
|
|
|
508
508
|
var max = Math.max;
|
|
509
|
-
var min$
|
|
509
|
+
var min$1 = Math.min;
|
|
510
510
|
|
|
511
511
|
// Helper for a popular repeating case of the spec:
|
|
512
512
|
// Let integer be ? ToInteger(index).
|
|
513
513
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
514
514
|
var toAbsoluteIndex$1 = function (index, length) {
|
|
515
515
|
var integer = toIntegerOrInfinity$1(index);
|
|
516
|
-
return integer < 0 ? max(integer + length, 0) : min$
|
|
516
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
517
517
|
};
|
|
518
518
|
|
|
519
519
|
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
520
520
|
|
|
521
|
-
var min
|
|
521
|
+
var min = Math.min;
|
|
522
522
|
|
|
523
523
|
// `ToLength` abstract operation
|
|
524
524
|
// https://tc39.es/ecma262/#sec-tolength
|
|
525
|
-
var toLength$
|
|
525
|
+
var toLength$1 = function (argument) {
|
|
526
526
|
var len = toIntegerOrInfinity(argument);
|
|
527
|
-
return len > 0 ? min
|
|
527
|
+
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
528
528
|
};
|
|
529
529
|
|
|
530
|
-
var toLength
|
|
530
|
+
var toLength = toLength$1;
|
|
531
531
|
|
|
532
532
|
// `LengthOfArrayLike` abstract operation
|
|
533
533
|
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
534
|
-
var lengthOfArrayLike$
|
|
535
|
-
return toLength
|
|
534
|
+
var lengthOfArrayLike$1 = function (obj) {
|
|
535
|
+
return toLength(obj.length);
|
|
536
536
|
};
|
|
537
537
|
|
|
538
538
|
var toIndexedObject$4 = toIndexedObject$5;
|
|
539
539
|
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
540
|
-
var lengthOfArrayLike
|
|
540
|
+
var lengthOfArrayLike = lengthOfArrayLike$1;
|
|
541
541
|
|
|
542
542
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
543
543
|
var createMethod = function (IS_INCLUDES) {
|
|
544
544
|
return function ($this, el, fromIndex) {
|
|
545
545
|
var O = toIndexedObject$4($this);
|
|
546
|
-
var length = lengthOfArrayLike
|
|
546
|
+
var length = lengthOfArrayLike(O);
|
|
547
547
|
if (length === 0) return !IS_INCLUDES && -1;
|
|
548
548
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
549
549
|
var value;
|
|
@@ -571,23 +571,23 @@ var arrayIncludes = {
|
|
|
571
571
|
|
|
572
572
|
var hiddenKeys$4 = {};
|
|
573
573
|
|
|
574
|
-
var uncurryThis$
|
|
575
|
-
var hasOwn$
|
|
574
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
575
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
576
576
|
var toIndexedObject$3 = toIndexedObject$5;
|
|
577
|
-
var indexOf
|
|
577
|
+
var indexOf = arrayIncludes.indexOf;
|
|
578
578
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
579
579
|
|
|
580
|
-
var push
|
|
580
|
+
var push = uncurryThis$5([].push);
|
|
581
581
|
|
|
582
582
|
var objectKeysInternal = function (object, names) {
|
|
583
583
|
var O = toIndexedObject$3(object);
|
|
584
584
|
var i = 0;
|
|
585
585
|
var result = [];
|
|
586
586
|
var key;
|
|
587
|
-
for (key in O) !hasOwn$
|
|
587
|
+
for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
|
|
588
588
|
// Don't enum bug & hidden keys
|
|
589
|
-
while (names.length > i) if (hasOwn$
|
|
590
|
-
~indexOf
|
|
589
|
+
while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
|
|
590
|
+
~indexOf(result, key) || push(result, key);
|
|
591
591
|
}
|
|
592
592
|
return result;
|
|
593
593
|
};
|
|
@@ -616,7 +616,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
616
616
|
var DESCRIPTORS$6 = descriptors;
|
|
617
617
|
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
618
618
|
var definePropertyModule$3 = objectDefineProperty;
|
|
619
|
-
var anObject$
|
|
619
|
+
var anObject$2 = anObject$4;
|
|
620
620
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
621
621
|
var objectKeys$1 = objectKeys$2;
|
|
622
622
|
|
|
@@ -624,7 +624,7 @@ var objectKeys$1 = objectKeys$2;
|
|
|
624
624
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
625
625
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
626
626
|
objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
627
|
-
anObject$
|
|
627
|
+
anObject$2(O);
|
|
628
628
|
var props = toIndexedObject$2(Properties);
|
|
629
629
|
var keys = objectKeys$1(Properties);
|
|
630
630
|
var length = keys.length;
|
|
@@ -638,17 +638,17 @@ var getBuiltIn$1 = getBuiltIn$3;
|
|
|
638
638
|
|
|
639
639
|
var html$1 = getBuiltIn$1('document', 'documentElement');
|
|
640
640
|
|
|
641
|
-
var shared$
|
|
641
|
+
var shared$1 = shared$3;
|
|
642
642
|
var uid = uid$2;
|
|
643
643
|
|
|
644
|
-
var keys = shared$
|
|
644
|
+
var keys = shared$1('keys');
|
|
645
645
|
|
|
646
646
|
var sharedKey$3 = function (key) {
|
|
647
647
|
return keys[key] || (keys[key] = uid(key));
|
|
648
648
|
};
|
|
649
649
|
|
|
650
650
|
/* global ActiveXObject -- old IE, WSH */
|
|
651
|
-
var anObject$
|
|
651
|
+
var anObject$1 = anObject$4;
|
|
652
652
|
var definePropertiesModule = objectDefineProperties;
|
|
653
653
|
var enumBugKeys$1 = enumBugKeys$3;
|
|
654
654
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
@@ -722,7 +722,7 @@ hiddenKeys$2[IE_PROTO$1] = true;
|
|
|
722
722
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
723
723
|
var result;
|
|
724
724
|
if (O !== null) {
|
|
725
|
-
EmptyConstructor[PROTOTYPE] = anObject$
|
|
725
|
+
EmptyConstructor[PROTOTYPE] = anObject$1(O);
|
|
726
726
|
result = new EmptyConstructor();
|
|
727
727
|
EmptyConstructor[PROTOTYPE] = null;
|
|
728
728
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
@@ -731,11 +731,11 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
731
731
|
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
732
732
|
};
|
|
733
733
|
|
|
734
|
-
var wellKnownSymbol$
|
|
735
|
-
var create$
|
|
734
|
+
var wellKnownSymbol$4 = wellKnownSymbol$6;
|
|
735
|
+
var create$1 = objectCreate;
|
|
736
736
|
var defineProperty$4 = objectDefineProperty.f;
|
|
737
737
|
|
|
738
|
-
var UNSCOPABLES = wellKnownSymbol$
|
|
738
|
+
var UNSCOPABLES = wellKnownSymbol$4('unscopables');
|
|
739
739
|
var ArrayPrototype = Array.prototype;
|
|
740
740
|
|
|
741
741
|
// Array.prototype[@@unscopables]
|
|
@@ -743,7 +743,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
743
743
|
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
744
744
|
defineProperty$4(ArrayPrototype, UNSCOPABLES, {
|
|
745
745
|
configurable: true,
|
|
746
|
-
value: create$
|
|
746
|
+
value: create$1(null)
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
|
|
@@ -754,12 +754,12 @@ var addToUnscopables$1 = function (key) {
|
|
|
754
754
|
|
|
755
755
|
var iterators = {};
|
|
756
756
|
|
|
757
|
-
var global$
|
|
758
|
-
var isCallable$
|
|
757
|
+
var global$4 = global$b;
|
|
758
|
+
var isCallable$7 = isCallable$d;
|
|
759
759
|
|
|
760
|
-
var WeakMap$1 = global$
|
|
760
|
+
var WeakMap$1 = global$4.WeakMap;
|
|
761
761
|
|
|
762
|
-
var weakMapBasicDetection = isCallable$
|
|
762
|
+
var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
763
763
|
|
|
764
764
|
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
765
765
|
return {
|
|
@@ -782,17 +782,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
|
|
|
782
782
|
};
|
|
783
783
|
|
|
784
784
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
785
|
-
var global$
|
|
786
|
-
var isObject$
|
|
785
|
+
var global$3 = global$b;
|
|
786
|
+
var isObject$3 = isObject$8;
|
|
787
787
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
788
|
-
var hasOwn$
|
|
789
|
-
var shared
|
|
788
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
789
|
+
var shared = sharedStore.exports;
|
|
790
790
|
var sharedKey$1 = sharedKey$3;
|
|
791
791
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
792
792
|
|
|
793
793
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
794
|
-
var TypeError$1 = global$
|
|
795
|
-
var WeakMap = global$
|
|
794
|
+
var TypeError$1 = global$3.TypeError;
|
|
795
|
+
var WeakMap = global$3.WeakMap;
|
|
796
796
|
var set, get, has;
|
|
797
797
|
|
|
798
798
|
var enforce = function (it) {
|
|
@@ -802,14 +802,14 @@ var enforce = function (it) {
|
|
|
802
802
|
var getterFor = function (TYPE) {
|
|
803
803
|
return function (it) {
|
|
804
804
|
var state;
|
|
805
|
-
if (!isObject$
|
|
805
|
+
if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
|
|
806
806
|
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
807
807
|
} return state;
|
|
808
808
|
};
|
|
809
809
|
};
|
|
810
810
|
|
|
811
|
-
if (NATIVE_WEAK_MAP || shared
|
|
812
|
-
var store$1 = shared
|
|
811
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
812
|
+
var store$1 = shared.state || (shared.state = new WeakMap());
|
|
813
813
|
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
814
814
|
store$1.get = store$1.get;
|
|
815
815
|
store$1.has = store$1.has;
|
|
@@ -831,16 +831,16 @@ if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
|
831
831
|
var STATE = sharedKey$1('state');
|
|
832
832
|
hiddenKeys$1[STATE] = true;
|
|
833
833
|
set = function (it, metadata) {
|
|
834
|
-
if (hasOwn$
|
|
834
|
+
if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
835
835
|
metadata.facade = it;
|
|
836
836
|
createNonEnumerableProperty$3(it, STATE, metadata);
|
|
837
837
|
return metadata;
|
|
838
838
|
};
|
|
839
839
|
get = function (it) {
|
|
840
|
-
return hasOwn$
|
|
840
|
+
return hasOwn$6(it, STATE) ? it[STATE] : {};
|
|
841
841
|
};
|
|
842
842
|
has = function (it) {
|
|
843
|
-
return hasOwn$
|
|
843
|
+
return hasOwn$6(it, STATE);
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
846
|
|
|
@@ -858,25 +858,25 @@ var objectPropertyIsEnumerable = {};
|
|
|
858
858
|
|
|
859
859
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
860
860
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
861
|
-
var getOwnPropertyDescriptor$
|
|
861
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
862
862
|
|
|
863
863
|
// Nashorn ~ JDK8 bug
|
|
864
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$
|
|
864
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
865
865
|
|
|
866
866
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
867
867
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
868
868
|
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
869
|
-
var descriptor = getOwnPropertyDescriptor$
|
|
869
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
870
870
|
return !!descriptor && descriptor.enumerable;
|
|
871
871
|
} : $propertyIsEnumerable;
|
|
872
872
|
|
|
873
873
|
var DESCRIPTORS$4 = descriptors;
|
|
874
|
-
var call$
|
|
874
|
+
var call$2 = functionCall;
|
|
875
875
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
876
876
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
877
877
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
878
878
|
var toPropertyKey = toPropertyKey$2;
|
|
879
|
-
var hasOwn$
|
|
879
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
880
880
|
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
881
881
|
|
|
882
882
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -890,19 +890,19 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
890
890
|
if (IE8_DOM_DEFINE) try {
|
|
891
891
|
return $getOwnPropertyDescriptor(O, P);
|
|
892
892
|
} catch (error) { /* empty */ }
|
|
893
|
-
if (hasOwn$
|
|
893
|
+
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
894
894
|
};
|
|
895
895
|
|
|
896
896
|
var makeBuiltIn$2 = {exports: {}};
|
|
897
897
|
|
|
898
898
|
var DESCRIPTORS$3 = descriptors;
|
|
899
|
-
var hasOwn$
|
|
899
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
900
900
|
|
|
901
901
|
var FunctionPrototype = Function.prototype;
|
|
902
902
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
903
903
|
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
|
904
904
|
|
|
905
|
-
var EXISTS = hasOwn$
|
|
905
|
+
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
|
906
906
|
// additional protection from minified / mangled / dropped function names
|
|
907
907
|
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
908
908
|
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
@@ -913,14 +913,14 @@ var functionName = {
|
|
|
913
913
|
CONFIGURABLE: CONFIGURABLE
|
|
914
914
|
};
|
|
915
915
|
|
|
916
|
-
var uncurryThis$
|
|
917
|
-
var isCallable$
|
|
916
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
917
|
+
var isCallable$6 = isCallable$d;
|
|
918
918
|
var store = sharedStore.exports;
|
|
919
919
|
|
|
920
|
-
var functionToString = uncurryThis$
|
|
920
|
+
var functionToString = uncurryThis$4(Function.toString);
|
|
921
921
|
|
|
922
922
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
923
|
-
if (!isCallable$
|
|
923
|
+
if (!isCallable$6(store.inspectSource)) {
|
|
924
924
|
store.inspectSource = function (it) {
|
|
925
925
|
return functionToString(it);
|
|
926
926
|
};
|
|
@@ -928,51 +928,51 @@ if (!isCallable$7(store.inspectSource)) {
|
|
|
928
928
|
|
|
929
929
|
var inspectSource$1 = store.inspectSource;
|
|
930
930
|
|
|
931
|
-
var uncurryThis$
|
|
932
|
-
var fails$
|
|
933
|
-
var isCallable$
|
|
934
|
-
var hasOwn$
|
|
931
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
932
|
+
var fails$4 = fails$b;
|
|
933
|
+
var isCallable$5 = isCallable$d;
|
|
934
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
935
935
|
var DESCRIPTORS$2 = descriptors;
|
|
936
936
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
937
937
|
var inspectSource = inspectSource$1;
|
|
938
938
|
var InternalStateModule$1 = internalState;
|
|
939
939
|
|
|
940
940
|
var enforceInternalState = InternalStateModule$1.enforce;
|
|
941
|
-
var getInternalState$
|
|
942
|
-
var $String$
|
|
941
|
+
var getInternalState$1 = InternalStateModule$1.get;
|
|
942
|
+
var $String$1 = String;
|
|
943
943
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
944
944
|
var defineProperty$3 = Object.defineProperty;
|
|
945
|
-
var stringSlice
|
|
946
|
-
var replace
|
|
947
|
-
var join = uncurryThis$
|
|
945
|
+
var stringSlice = uncurryThis$3(''.slice);
|
|
946
|
+
var replace = uncurryThis$3(''.replace);
|
|
947
|
+
var join = uncurryThis$3([].join);
|
|
948
948
|
|
|
949
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$
|
|
949
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$4(function () {
|
|
950
950
|
return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
951
951
|
});
|
|
952
952
|
|
|
953
953
|
var TEMPLATE = String(String).split('String');
|
|
954
954
|
|
|
955
955
|
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
956
|
-
if (stringSlice
|
|
957
|
-
name = '[' + replace
|
|
956
|
+
if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
|
|
957
|
+
name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
958
958
|
}
|
|
959
959
|
if (options && options.getter) name = 'get ' + name;
|
|
960
960
|
if (options && options.setter) name = 'set ' + name;
|
|
961
|
-
if (!hasOwn$
|
|
961
|
+
if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
962
962
|
if (DESCRIPTORS$2) defineProperty$3(value, 'name', { value: name, configurable: true });
|
|
963
963
|
else value.name = name;
|
|
964
964
|
}
|
|
965
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$
|
|
965
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$3(options, 'arity') && value.length !== options.arity) {
|
|
966
966
|
defineProperty$3(value, 'length', { value: options.arity });
|
|
967
967
|
}
|
|
968
968
|
try {
|
|
969
|
-
if (options && hasOwn$
|
|
969
|
+
if (options && hasOwn$3(options, 'constructor') && options.constructor) {
|
|
970
970
|
if (DESCRIPTORS$2) defineProperty$3(value, 'prototype', { writable: false });
|
|
971
971
|
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
972
972
|
} else if (value.prototype) value.prototype = undefined;
|
|
973
973
|
} catch (error) { /* empty */ }
|
|
974
974
|
var state = enforceInternalState(value);
|
|
975
|
-
if (!hasOwn$
|
|
975
|
+
if (!hasOwn$3(state, 'source')) {
|
|
976
976
|
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
977
977
|
} return value;
|
|
978
978
|
};
|
|
@@ -980,19 +980,19 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
980
980
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
981
981
|
// eslint-disable-next-line no-extend-native -- required
|
|
982
982
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
983
|
-
return isCallable$
|
|
983
|
+
return isCallable$5(this) && getInternalState$1(this).source || inspectSource(this);
|
|
984
984
|
}, 'toString');
|
|
985
985
|
|
|
986
|
-
var isCallable$
|
|
986
|
+
var isCallable$4 = isCallable$d;
|
|
987
987
|
var definePropertyModule$1 = objectDefineProperty;
|
|
988
988
|
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
989
989
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
990
990
|
|
|
991
|
-
var defineBuiltIn$
|
|
991
|
+
var defineBuiltIn$3 = function (O, key, value, options) {
|
|
992
992
|
if (!options) options = {};
|
|
993
993
|
var simple = options.enumerable;
|
|
994
994
|
var name = options.name !== undefined ? options.name : key;
|
|
995
|
-
if (isCallable$
|
|
995
|
+
if (isCallable$4(value)) makeBuiltIn(value, name, options);
|
|
996
996
|
if (options.global) {
|
|
997
997
|
if (simple) O[key] = value;
|
|
998
998
|
else defineGlobalProperty$1(key, value);
|
|
@@ -1031,21 +1031,21 @@ var objectGetOwnPropertySymbols = {};
|
|
|
1031
1031
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1032
1032
|
|
|
1033
1033
|
var getBuiltIn = getBuiltIn$3;
|
|
1034
|
-
var uncurryThis$
|
|
1034
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1035
1035
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1036
1036
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1037
|
-
var anObject
|
|
1037
|
+
var anObject = anObject$4;
|
|
1038
1038
|
|
|
1039
|
-
var concat$1 = uncurryThis$
|
|
1039
|
+
var concat$1 = uncurryThis$2([].concat);
|
|
1040
1040
|
|
|
1041
1041
|
// all object keys, includes non-enumerable and symbols
|
|
1042
1042
|
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1043
|
-
var keys = getOwnPropertyNamesModule.f(anObject
|
|
1043
|
+
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
1044
1044
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1045
1045
|
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
1046
1046
|
};
|
|
1047
1047
|
|
|
1048
|
-
var hasOwn$
|
|
1048
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
1049
1049
|
var ownKeys = ownKeys$1;
|
|
1050
1050
|
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1051
1051
|
var definePropertyModule = objectDefineProperty;
|
|
@@ -1056,14 +1056,14 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
|
1056
1056
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1057
1057
|
for (var i = 0; i < keys.length; i++) {
|
|
1058
1058
|
var key = keys[i];
|
|
1059
|
-
if (!hasOwn$
|
|
1059
|
+
if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
|
|
1060
1060
|
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
};
|
|
1064
1064
|
|
|
1065
|
-
var fails$
|
|
1066
|
-
var isCallable$
|
|
1065
|
+
var fails$3 = fails$b;
|
|
1066
|
+
var isCallable$3 = isCallable$d;
|
|
1067
1067
|
|
|
1068
1068
|
var replacement = /#|\.prototype\./;
|
|
1069
1069
|
|
|
@@ -1071,7 +1071,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
1071
1071
|
var value = data[normalize(feature)];
|
|
1072
1072
|
return value === POLYFILL ? true
|
|
1073
1073
|
: value === NATIVE ? false
|
|
1074
|
-
: isCallable$
|
|
1074
|
+
: isCallable$3(detection) ? fails$3(detection)
|
|
1075
1075
|
: !!detection;
|
|
1076
1076
|
};
|
|
1077
1077
|
|
|
@@ -1085,10 +1085,10 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
1085
1085
|
|
|
1086
1086
|
var isForced_1 = isForced$1;
|
|
1087
1087
|
|
|
1088
|
-
var global$
|
|
1089
|
-
var getOwnPropertyDescriptor
|
|
1088
|
+
var global$2 = global$b;
|
|
1089
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1090
1090
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
1091
|
-
var defineBuiltIn$
|
|
1091
|
+
var defineBuiltIn$2 = defineBuiltIn$3;
|
|
1092
1092
|
var defineGlobalProperty = defineGlobalProperty$3;
|
|
1093
1093
|
var copyConstructorProperties = copyConstructorProperties$1;
|
|
1094
1094
|
var isForced = isForced_1;
|
|
@@ -1114,16 +1114,16 @@ var _export = function (options, source) {
|
|
|
1114
1114
|
var STATIC = options.stat;
|
|
1115
1115
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1116
1116
|
if (GLOBAL) {
|
|
1117
|
-
target = global$
|
|
1117
|
+
target = global$2;
|
|
1118
1118
|
} else if (STATIC) {
|
|
1119
|
-
target = global$
|
|
1119
|
+
target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1120
1120
|
} else {
|
|
1121
|
-
target = global$
|
|
1121
|
+
target = global$2[TARGET] && global$2[TARGET].prototype;
|
|
1122
1122
|
}
|
|
1123
1123
|
if (target) for (key in source) {
|
|
1124
1124
|
sourceProperty = source[key];
|
|
1125
1125
|
if (options.dontCallGetSet) {
|
|
1126
|
-
descriptor = getOwnPropertyDescriptor
|
|
1126
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1127
1127
|
targetProperty = descriptor && descriptor.value;
|
|
1128
1128
|
} else targetProperty = target[key];
|
|
1129
1129
|
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
@@ -1136,49 +1136,49 @@ var _export = function (options, source) {
|
|
|
1136
1136
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1137
1137
|
createNonEnumerableProperty$2(sourceProperty, 'sham', true);
|
|
1138
1138
|
}
|
|
1139
|
-
defineBuiltIn$
|
|
1139
|
+
defineBuiltIn$2(target, key, sourceProperty, options);
|
|
1140
1140
|
}
|
|
1141
1141
|
};
|
|
1142
1142
|
|
|
1143
|
-
var fails$
|
|
1143
|
+
var fails$2 = fails$b;
|
|
1144
1144
|
|
|
1145
|
-
var correctPrototypeGetter = !fails$
|
|
1145
|
+
var correctPrototypeGetter = !fails$2(function () {
|
|
1146
1146
|
function F() { /* empty */ }
|
|
1147
1147
|
F.prototype.constructor = null;
|
|
1148
1148
|
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1149
1149
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1150
1150
|
});
|
|
1151
1151
|
|
|
1152
|
-
var hasOwn$
|
|
1153
|
-
var isCallable$
|
|
1154
|
-
var toObject$
|
|
1152
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1153
|
+
var isCallable$2 = isCallable$d;
|
|
1154
|
+
var toObject$1 = toObject$3;
|
|
1155
1155
|
var sharedKey = sharedKey$3;
|
|
1156
1156
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1157
1157
|
|
|
1158
1158
|
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1159
|
-
var $Object
|
|
1160
|
-
var ObjectPrototype = $Object
|
|
1159
|
+
var $Object = Object;
|
|
1160
|
+
var ObjectPrototype = $Object.prototype;
|
|
1161
1161
|
|
|
1162
1162
|
// `Object.getPrototypeOf` method
|
|
1163
1163
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1164
1164
|
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1165
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object
|
|
1166
|
-
var object = toObject$
|
|
1167
|
-
if (hasOwn$
|
|
1165
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
|
1166
|
+
var object = toObject$1(O);
|
|
1167
|
+
if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
|
|
1168
1168
|
var constructor = object.constructor;
|
|
1169
|
-
if (isCallable$
|
|
1169
|
+
if (isCallable$2(constructor) && object instanceof constructor) {
|
|
1170
1170
|
return constructor.prototype;
|
|
1171
|
-
} return object instanceof $Object
|
|
1171
|
+
} return object instanceof $Object ? ObjectPrototype : null;
|
|
1172
1172
|
};
|
|
1173
1173
|
|
|
1174
|
-
var fails$
|
|
1175
|
-
var isCallable$
|
|
1176
|
-
var isObject$
|
|
1174
|
+
var fails$1 = fails$b;
|
|
1175
|
+
var isCallable$1 = isCallable$d;
|
|
1176
|
+
var isObject$2 = isObject$8;
|
|
1177
1177
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1178
|
-
var defineBuiltIn$
|
|
1179
|
-
var wellKnownSymbol$
|
|
1178
|
+
var defineBuiltIn$1 = defineBuiltIn$3;
|
|
1179
|
+
var wellKnownSymbol$3 = wellKnownSymbol$6;
|
|
1180
1180
|
|
|
1181
|
-
var ITERATOR$2 = wellKnownSymbol$
|
|
1181
|
+
var ITERATOR$2 = wellKnownSymbol$3('iterator');
|
|
1182
1182
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1183
1183
|
|
|
1184
1184
|
// `%IteratorPrototype%` object
|
|
@@ -1196,7 +1196,7 @@ if ([].keys) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$
|
|
1199
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$1(function () {
|
|
1200
1200
|
var test = {};
|
|
1201
1201
|
// FF44- legacy iterators case
|
|
1202
1202
|
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
@@ -1206,8 +1206,8 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
|
1206
1206
|
|
|
1207
1207
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1208
1208
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1209
|
-
if (!isCallable$
|
|
1210
|
-
defineBuiltIn$
|
|
1209
|
+
if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
|
|
1210
|
+
defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1211
1211
|
return this;
|
|
1212
1212
|
});
|
|
1213
1213
|
}
|
|
@@ -1218,20 +1218,20 @@ var iteratorsCore = {
|
|
|
1218
1218
|
};
|
|
1219
1219
|
|
|
1220
1220
|
var defineProperty$2 = objectDefineProperty.f;
|
|
1221
|
-
var hasOwn
|
|
1222
|
-
var wellKnownSymbol$
|
|
1221
|
+
var hasOwn = hasOwnProperty_1;
|
|
1222
|
+
var wellKnownSymbol$2 = wellKnownSymbol$6;
|
|
1223
1223
|
|
|
1224
|
-
var TO_STRING_TAG
|
|
1224
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
1225
1225
|
|
|
1226
1226
|
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1227
1227
|
if (target && !STATIC) target = target.prototype;
|
|
1228
|
-
if (target && !hasOwn
|
|
1229
|
-
defineProperty$2(target, TO_STRING_TAG
|
|
1228
|
+
if (target && !hasOwn(target, TO_STRING_TAG)) {
|
|
1229
|
+
defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
1232
|
|
|
1233
1233
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1234
|
-
var create
|
|
1234
|
+
var create = objectCreate;
|
|
1235
1235
|
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1236
1236
|
var setToStringTag$2 = setToStringTag$3;
|
|
1237
1237
|
var Iterators$2 = iterators;
|
|
@@ -1240,42 +1240,42 @@ var returnThis$1 = function () { return this; };
|
|
|
1240
1240
|
|
|
1241
1241
|
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1242
1242
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1243
|
-
IteratorConstructor.prototype = create
|
|
1243
|
+
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1244
1244
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1245
1245
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1246
1246
|
return IteratorConstructor;
|
|
1247
1247
|
};
|
|
1248
1248
|
|
|
1249
|
-
var uncurryThis$
|
|
1250
|
-
var aCallable
|
|
1249
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1250
|
+
var aCallable = aCallable$2;
|
|
1251
1251
|
|
|
1252
1252
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1253
1253
|
try {
|
|
1254
1254
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1255
|
-
return uncurryThis$
|
|
1255
|
+
return uncurryThis$1(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1256
1256
|
} catch (error) { /* empty */ }
|
|
1257
1257
|
};
|
|
1258
1258
|
|
|
1259
|
-
var isObject$
|
|
1259
|
+
var isObject$1 = isObject$8;
|
|
1260
1260
|
|
|
1261
1261
|
var isPossiblePrototype$1 = function (argument) {
|
|
1262
|
-
return isObject$
|
|
1262
|
+
return isObject$1(argument) || argument === null;
|
|
1263
1263
|
};
|
|
1264
1264
|
|
|
1265
1265
|
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1266
1266
|
|
|
1267
|
-
var $String
|
|
1268
|
-
var $TypeError
|
|
1267
|
+
var $String = String;
|
|
1268
|
+
var $TypeError = TypeError;
|
|
1269
1269
|
|
|
1270
1270
|
var aPossiblePrototype$1 = function (argument) {
|
|
1271
1271
|
if (isPossiblePrototype(argument)) return argument;
|
|
1272
|
-
throw new $TypeError
|
|
1272
|
+
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
|
1273
1273
|
};
|
|
1274
1274
|
|
|
1275
1275
|
/* eslint-disable no-proto -- safe */
|
|
1276
1276
|
var uncurryThisAccessor = functionUncurryThisAccessor;
|
|
1277
|
-
var isObject
|
|
1278
|
-
var requireObjectCoercible
|
|
1277
|
+
var isObject = isObject$8;
|
|
1278
|
+
var requireObjectCoercible = requireObjectCoercible$3;
|
|
1279
1279
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1280
1280
|
|
|
1281
1281
|
// `Object.setPrototypeOf` method
|
|
@@ -1292,34 +1292,34 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1292
1292
|
CORRECT_SETTER = test instanceof Array;
|
|
1293
1293
|
} catch (error) { /* empty */ }
|
|
1294
1294
|
return function setPrototypeOf(O, proto) {
|
|
1295
|
-
requireObjectCoercible
|
|
1295
|
+
requireObjectCoercible(O);
|
|
1296
1296
|
aPossiblePrototype(proto);
|
|
1297
|
-
if (!isObject
|
|
1297
|
+
if (!isObject(O)) return O;
|
|
1298
1298
|
if (CORRECT_SETTER) setter(O, proto);
|
|
1299
1299
|
else O.__proto__ = proto;
|
|
1300
1300
|
return O;
|
|
1301
1301
|
};
|
|
1302
1302
|
}() : undefined);
|
|
1303
1303
|
|
|
1304
|
-
var $$
|
|
1305
|
-
var call$
|
|
1304
|
+
var $$1 = _export;
|
|
1305
|
+
var call$1 = functionCall;
|
|
1306
1306
|
var FunctionName = functionName;
|
|
1307
|
-
var isCallable
|
|
1307
|
+
var isCallable = isCallable$d;
|
|
1308
1308
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1309
1309
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1310
1310
|
var setPrototypeOf = objectSetPrototypeOf;
|
|
1311
1311
|
var setToStringTag$1 = setToStringTag$3;
|
|
1312
1312
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
|
|
1313
|
-
var defineBuiltIn
|
|
1314
|
-
var wellKnownSymbol$
|
|
1313
|
+
var defineBuiltIn = defineBuiltIn$3;
|
|
1314
|
+
var wellKnownSymbol$1 = wellKnownSymbol$6;
|
|
1315
1315
|
var Iterators$1 = iterators;
|
|
1316
1316
|
var IteratorsCore = iteratorsCore;
|
|
1317
1317
|
|
|
1318
|
-
var PROPER_FUNCTION_NAME
|
|
1318
|
+
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1319
1319
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1320
1320
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1321
1321
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1322
|
-
var ITERATOR$1 = wellKnownSymbol$
|
|
1322
|
+
var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
|
1323
1323
|
var KEYS = 'keys';
|
|
1324
1324
|
var VALUES = 'values';
|
|
1325
1325
|
var ENTRIES = 'entries';
|
|
@@ -1359,8 +1359,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1359
1359
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1360
1360
|
if (setPrototypeOf) {
|
|
1361
1361
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1362
|
-
} else if (!isCallable
|
|
1363
|
-
defineBuiltIn
|
|
1362
|
+
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1363
|
+
defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
// Set @@toStringTag to native iterators
|
|
@@ -1369,12 +1369,12 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
1371
|
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1372
|
-
if (PROPER_FUNCTION_NAME
|
|
1372
|
+
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1373
1373
|
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1374
1374
|
createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
|
1375
1375
|
} else {
|
|
1376
1376
|
INCORRECT_VALUES_NAME = true;
|
|
1377
|
-
defaultIterator = function values() { return call$
|
|
1377
|
+
defaultIterator = function values() { return call$1(nativeIterator, this); };
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
@@ -1387,14 +1387,14 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1387
1387
|
};
|
|
1388
1388
|
if (FORCED) for (KEY in methods) {
|
|
1389
1389
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1390
|
-
defineBuiltIn
|
|
1390
|
+
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
|
1391
1391
|
}
|
|
1392
|
-
} else $$
|
|
1392
|
+
} else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1393
1393
|
}
|
|
1394
1394
|
|
|
1395
1395
|
// define iterator
|
|
1396
1396
|
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1397
|
-
defineBuiltIn
|
|
1397
|
+
defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1398
1398
|
}
|
|
1399
1399
|
Iterators$1[NAME] = defaultIterator;
|
|
1400
1400
|
|
|
@@ -1418,7 +1418,7 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
1418
1418
|
|
|
1419
1419
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1420
1420
|
var setInternalState = InternalStateModule.set;
|
|
1421
|
-
var getInternalState
|
|
1421
|
+
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1422
1422
|
|
|
1423
1423
|
// `Array.prototype.entries` method
|
|
1424
1424
|
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
@@ -1440,7 +1440,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1440
1440
|
// `%ArrayIteratorPrototype%.next` method
|
|
1441
1441
|
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1442
1442
|
}, function () {
|
|
1443
|
-
var state = getInternalState
|
|
1443
|
+
var state = getInternalState(this);
|
|
1444
1444
|
var target = state.target;
|
|
1445
1445
|
var index = state.index++;
|
|
1446
1446
|
if (!target || index >= target.length) {
|
|
@@ -1468,73 +1468,6 @@ if (DESCRIPTORS$1 && values.name !== 'values') try {
|
|
|
1468
1468
|
defineProperty$1(values, 'name', { value: 'values' });
|
|
1469
1469
|
} catch (error) { /* empty */ }
|
|
1470
1470
|
|
|
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
1471
|
// iterable DOM collections
|
|
1539
1472
|
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1540
1473
|
var domIterables = {
|
|
@@ -1579,15 +1512,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1579
1512
|
|
|
1580
1513
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1581
1514
|
|
|
1582
|
-
var global$
|
|
1515
|
+
var global$1 = global$b;
|
|
1583
1516
|
var DOMIterables = domIterables;
|
|
1584
1517
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1585
1518
|
var ArrayIteratorMethods = es_array_iterator;
|
|
1586
1519
|
var createNonEnumerableProperty = createNonEnumerableProperty$4;
|
|
1587
1520
|
var setToStringTag = setToStringTag$3;
|
|
1588
|
-
var wellKnownSymbol
|
|
1521
|
+
var wellKnownSymbol = wellKnownSymbol$6;
|
|
1589
1522
|
|
|
1590
|
-
var ITERATOR = wellKnownSymbol
|
|
1523
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
1591
1524
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1592
1525
|
|
|
1593
1526
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
@@ -1611,382 +1544,103 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1611
1544
|
};
|
|
1612
1545
|
|
|
1613
1546
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1614
|
-
handlePrototype(global$
|
|
1547
|
+
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1615
1548
|
}
|
|
1616
1549
|
|
|
1617
1550
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1618
1551
|
|
|
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+)\./);
|
|
1552
|
+
var DESCRIPTORS = descriptors;
|
|
1553
|
+
var uncurryThis = functionUncurryThis;
|
|
1554
|
+
var call = functionCall;
|
|
1555
|
+
var fails = fails$b;
|
|
1556
|
+
var objectKeys = objectKeys$2;
|
|
1557
|
+
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1558
|
+
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1559
|
+
var toObject = toObject$3;
|
|
1560
|
+
var IndexedObject = indexedObject;
|
|
1744
1561
|
|
|
1745
|
-
|
|
1562
|
+
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1563
|
+
var $assign = Object.assign;
|
|
1564
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1565
|
+
var defineProperty = Object.defineProperty;
|
|
1566
|
+
var concat = uncurryThis([].concat);
|
|
1746
1567
|
|
|
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;
|
|
1568
|
+
// `Object.assign` method
|
|
1569
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1570
|
+
var objectAssign = !$assign || fails(function () {
|
|
1571
|
+
// should have correct order of operations (Edge bug)
|
|
1572
|
+
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1573
|
+
enumerable: true,
|
|
1574
|
+
get: function () {
|
|
1575
|
+
defineProperty(this, 'b', {
|
|
1576
|
+
value: 3,
|
|
1577
|
+
enumerable: false
|
|
1578
|
+
});
|
|
1795
1579
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1580
|
+
}), { b: 2 })).b !== 1) return true;
|
|
1581
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1582
|
+
var A = {};
|
|
1583
|
+
var B = {};
|
|
1584
|
+
// eslint-disable-next-line es/no-symbol -- safe
|
|
1585
|
+
var symbol = Symbol('assign detection');
|
|
1586
|
+
var alphabet = 'abcdefghijklmnopqrst';
|
|
1587
|
+
A[symbol] = 7;
|
|
1588
|
+
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1589
|
+
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
|
1590
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1591
|
+
var T = toObject(target);
|
|
1592
|
+
var argumentsLength = arguments.length;
|
|
1593
|
+
var index = 1;
|
|
1594
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1595
|
+
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1596
|
+
while (argumentsLength > index) {
|
|
1597
|
+
var S = IndexedObject(arguments[index++]);
|
|
1598
|
+
var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
|
1599
|
+
var length = keys.length;
|
|
1600
|
+
var j = 0;
|
|
1601
|
+
var key;
|
|
1602
|
+
while (length > j) {
|
|
1603
|
+
key = keys[j++];
|
|
1604
|
+
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1799
1605
|
}
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
test.sort(function (a, b) { return b.v - a.v; });
|
|
1606
|
+
} return T;
|
|
1607
|
+
} : $assign;
|
|
1803
1608
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
1807
|
-
}
|
|
1609
|
+
var $ = _export;
|
|
1610
|
+
var assign = objectAssign;
|
|
1808
1611
|
|
|
1809
|
-
|
|
1612
|
+
// `Object.assign` method
|
|
1613
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1614
|
+
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1615
|
+
$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1616
|
+
assign: assign
|
|
1810
1617
|
});
|
|
1811
1618
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1619
|
+
const BuildSchemaAsFields = ({
|
|
1620
|
+
components,
|
|
1621
|
+
mappers,
|
|
1622
|
+
formIndex,
|
|
1623
|
+
mountedForm
|
|
1624
|
+
}) => {
|
|
1625
|
+
return components && components.map(component => {
|
|
1626
|
+
const mapper = mappers === null || mappers === void 0 ? void 0 : mappers.find(el => el.componentName === component.component);
|
|
1627
|
+
return mapper ? jsx(AsFormFieldBuilder, Object.assign({
|
|
1628
|
+
formIndex: formIndex,
|
|
1629
|
+
mapper: mapper,
|
|
1630
|
+
formMounted: mountedForm
|
|
1631
|
+
}, component, {
|
|
1632
|
+
children: component.children && component.children.length > 0 && jsx(BuildSchemaAsFields, {
|
|
1633
|
+
formIndex: formIndex,
|
|
1634
|
+
mappers: mappers,
|
|
1635
|
+
components: component.children,
|
|
1636
|
+
mountedForm: mountedForm
|
|
1637
|
+
})
|
|
1638
|
+
}), component.name) : jsx("div", {
|
|
1639
|
+
children: `component mapper not found for ${component.component} from field name ${component.name} on form ${formIndex}`
|
|
1640
|
+
}, component.name);
|
|
1641
|
+
});
|
|
1821
1642
|
};
|
|
1822
1643
|
|
|
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
1644
|
const FormGroupContext = /*#__PURE__*/createContext({});
|
|
1991
1645
|
/**
|
|
1992
1646
|
* context interface to be used isolated or with the context provider
|
|
@@ -2095,252 +1749,6 @@ const useFormGroupContext = props => {
|
|
|
2095
1749
|
return context;
|
|
2096
1750
|
};
|
|
2097
1751
|
|
|
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
1752
|
/******************************************************************************
|
|
2345
1753
|
Copyright (c) Microsoft Corporation.
|
|
2346
1754
|
|
|
@@ -2516,115 +1924,58 @@ function Form({
|
|
|
2516
1924
|
children
|
|
2517
1925
|
}) {
|
|
2518
1926
|
const {
|
|
2519
|
-
addForm,
|
|
2520
|
-
removeForm,
|
|
2521
1927
|
getForm,
|
|
2522
1928
|
mappers,
|
|
2523
1929
|
debugMode,
|
|
2524
1930
|
formGroupInstance
|
|
2525
1931
|
} = useFormGroupContext({});
|
|
2526
|
-
const
|
|
2527
|
-
const [
|
|
2528
|
-
|
|
2529
|
-
index: schemaIndex
|
|
2530
|
-
}),
|
|
2531
|
-
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2532
|
-
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
2533
|
-
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2534
|
-
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2535
|
-
index: schemaIndex,
|
|
2536
|
-
mappers,
|
|
2537
|
-
config: config || formGroupInstance.config
|
|
2538
|
-
}));
|
|
2539
|
-
if (schemaIndex === 'defaultChange' || schemaIndex === 'defaultChange-ssr') {
|
|
2540
|
-
console.warn('please, add an unique id to the form, otherwise multiple forms will break');
|
|
2541
|
-
}
|
|
2542
|
-
if (!formGroupInstance.forms.has(schemaIndex)) addForm({
|
|
2543
|
-
key: schemaIndex,
|
|
2544
|
-
formInstance
|
|
2545
|
-
});
|
|
1932
|
+
const schemaIndex = useRef(index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange').current;
|
|
1933
|
+
const [mounted, setMounted] = useState(false);
|
|
1934
|
+
const mountedRef = useRef(false);
|
|
2546
1935
|
/**
|
|
2547
|
-
*
|
|
2548
|
-
* and JSON schema onto FieldWrappers, refreshes when
|
|
2549
|
-
* the react tree changes it's children
|
|
1936
|
+
* effect to create the form instance and notify the recursive generated fields of it's mounted status
|
|
2550
1937
|
*/
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
1938
|
+
useEffect(() => {
|
|
1939
|
+
if (mountedRef.current) return;
|
|
1940
|
+
formGroupInstance.addForm({
|
|
1941
|
+
key: schemaIndex,
|
|
1942
|
+
formInstance: new FormCore({
|
|
1943
|
+
schema,
|
|
1944
|
+
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
1945
|
+
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
1946
|
+
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
1947
|
+
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
1948
|
+
index: schemaIndex,
|
|
1949
|
+
mappers,
|
|
1950
|
+
config: config || formGroupInstance.config
|
|
1951
|
+
})
|
|
2555
1952
|
});
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
key: schemaIndex
|
|
2561
|
-
})) === null || _b === void 0 ? void 0 : _b.fields;
|
|
2562
|
-
if (fields) {
|
|
2563
|
-
const buildTree = BuildTree({
|
|
2564
|
-
fields,
|
|
2565
|
-
formIndex: schemaIndex
|
|
2566
|
-
});
|
|
2567
|
-
return jsx(Fragment$1, {
|
|
2568
|
-
children: buildTree
|
|
2569
|
-
}, schemaIndex);
|
|
2570
|
-
}
|
|
2571
|
-
}, [children, schemaIndex, getForm]);
|
|
1953
|
+
setMounted(true);
|
|
1954
|
+
mountedRef.current = true;
|
|
1955
|
+
// }
|
|
1956
|
+
}, []);
|
|
2572
1957
|
/**
|
|
2573
1958
|
* iVars change tracker to update iVars onto form instance
|
|
2574
1959
|
*/
|
|
2575
1960
|
useEffect(() => {
|
|
2576
|
-
if (
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
1961
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
1962
|
+
console.log('failed to add iVars due to no form instance');
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
if (iVars && mounted) formGroupInstance.forms.get(schemaIndex).iVars = iVars;
|
|
1966
|
+
// if (iVars) formInstance.current.iVars = iVars;
|
|
1967
|
+
}, [iVars, mounted]);
|
|
2580
1968
|
/**
|
|
2581
1969
|
* initialValues setter for async initialValues
|
|
2582
1970
|
*/
|
|
2583
1971
|
useEffect(() => {
|
|
2584
|
-
if (
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
}, [initialValues]);
|
|
2588
|
-
/**
|
|
2589
|
-
* logic to mount and manage form removal
|
|
2590
|
-
*/
|
|
2591
|
-
useEffect(() => {
|
|
2592
|
-
const newIndex = index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange';
|
|
2593
|
-
const newInstance = new FormCore({
|
|
2594
|
-
schema,
|
|
2595
|
-
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2596
|
-
iVars: iVars || (schema === null || schema === void 0 ? void 0 : schema.iVars),
|
|
2597
|
-
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2598
|
-
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2599
|
-
index: newIndex,
|
|
2600
|
-
mappers,
|
|
2601
|
-
config: config || formGroupInstance.config
|
|
2602
|
-
});
|
|
2603
|
-
setSchemaIndex(newIndex);
|
|
2604
|
-
setFormInstance(newInstance);
|
|
2605
|
-
addForm({
|
|
2606
|
-
key: newIndex,
|
|
2607
|
-
formInstance: newInstance
|
|
2608
|
-
});
|
|
2609
|
-
let subMounted;
|
|
2610
|
-
if (onFormMount) {
|
|
2611
|
-
subMounted = newInstance.subscribeOnMount(onFormMount);
|
|
1972
|
+
if (!formGroupInstance.forms.has(schemaIndex)) {
|
|
1973
|
+
console.log('failed to add initialValues due to no form instance');
|
|
1974
|
+
return;
|
|
2612
1975
|
}
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
the management of multiple forms needs to be planned
|
|
2617
|
-
*/
|
|
2618
|
-
return () => {
|
|
2619
|
-
subMounted === null || subMounted === void 0 ? void 0 : subMounted.unsubscribe();
|
|
2620
|
-
removeForm({
|
|
2621
|
-
key: newIndex
|
|
2622
|
-
});
|
|
2623
|
-
if (formGroupInstance.forms.has(`${newIndex}-ssr`)) removeForm({
|
|
2624
|
-
key: `${newIndex}-ssr`
|
|
2625
|
-
});
|
|
2626
|
-
};
|
|
2627
|
-
}, []);
|
|
1976
|
+
if (initialValues && mounted) formGroupInstance.forms.get(schemaIndex).initialValues = initialValues;
|
|
1977
|
+
// if (initialValues) formInstance.current.initialValues = initialValues;
|
|
1978
|
+
}, [initialValues, mounted]);
|
|
2628
1979
|
/**
|
|
2629
1980
|
* hook usage to keep event bindings updated on callback functions passed as props
|
|
2630
1981
|
*/
|
|
@@ -2689,7 +2040,12 @@ function Form({
|
|
|
2689
2040
|
}), jsx("br", {}), jsx("hr", {})]
|
|
2690
2041
|
}), jsx("form", {
|
|
2691
2042
|
onSubmit: handleSubmit,
|
|
2692
|
-
children:
|
|
2043
|
+
children: jsx(BuildSchemaAsFields, {
|
|
2044
|
+
formIndex: schemaIndex,
|
|
2045
|
+
mappers: mappers,
|
|
2046
|
+
components: schema === null || schema === void 0 ? void 0 : schema.components,
|
|
2047
|
+
mountedForm: mounted
|
|
2048
|
+
})
|
|
2693
2049
|
})]
|
|
2694
2050
|
});
|
|
2695
2051
|
}
|
|
@@ -2707,185 +2063,186 @@ const AsFormField = props => {
|
|
|
2707
2063
|
return props.children;
|
|
2708
2064
|
};
|
|
2709
2065
|
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
return
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
2737
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
2738
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2066
|
+
/**
|
|
2067
|
+
* Renders the React element defined on the mappers configuration
|
|
2068
|
+
*
|
|
2069
|
+
* @param param component props, field instance and children to render
|
|
2070
|
+
* @returns
|
|
2071
|
+
*/
|
|
2072
|
+
const FieldWrapperComponentRender = ({
|
|
2073
|
+
props,
|
|
2074
|
+
fieldInstance,
|
|
2075
|
+
children,
|
|
2076
|
+
mapper
|
|
2077
|
+
}) => {
|
|
2078
|
+
var _a, _b, _c;
|
|
2079
|
+
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);
|
|
2080
|
+
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);
|
|
2081
|
+
if (Component) return jsx(Component, Object.assign({}, props, {
|
|
2082
|
+
children: children && children
|
|
2083
|
+
}));
|
|
2084
|
+
if (Asynccomponent) return jsx(Suspense, {
|
|
2085
|
+
children: jsx(Asynccomponent, Object.assign({}, props, {
|
|
2086
|
+
children: children && children
|
|
2087
|
+
}))
|
|
2088
|
+
});
|
|
2089
|
+
return jsx("div", {
|
|
2090
|
+
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`
|
|
2091
|
+
});
|
|
2739
2092
|
};
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
var
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
var indexOf = uncurryThis(''.indexOf);
|
|
2782
|
-
var replace = uncurryThis(''.replace);
|
|
2783
|
-
var stringSlice = uncurryThis(''.slice);
|
|
2784
|
-
|
|
2785
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2786
|
-
var re1 = /a/;
|
|
2787
|
-
var re2 = /b*/g;
|
|
2788
|
-
call(nativeExec, re1, 'a');
|
|
2789
|
-
call(nativeExec, re2, 'a');
|
|
2790
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2791
|
-
})();
|
|
2792
|
-
|
|
2793
|
-
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2794
|
-
|
|
2795
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2796
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2797
|
-
|
|
2798
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2799
|
-
|
|
2800
|
-
if (PATCH) {
|
|
2801
|
-
patchedExec = function exec(string) {
|
|
2802
|
-
var re = this;
|
|
2803
|
-
var state = getInternalState(re);
|
|
2804
|
-
var str = toString(string);
|
|
2805
|
-
var raw = state.raw;
|
|
2806
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
2807
|
-
|
|
2808
|
-
if (raw) {
|
|
2809
|
-
raw.lastIndex = re.lastIndex;
|
|
2810
|
-
result = call(patchedExec, raw, str);
|
|
2811
|
-
re.lastIndex = raw.lastIndex;
|
|
2812
|
-
return result;
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
var groups = state.groups;
|
|
2816
|
-
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2817
|
-
var flags = call(regexpFlags, re);
|
|
2818
|
-
var source = re.source;
|
|
2819
|
-
var charsAdded = 0;
|
|
2820
|
-
var strCopy = str;
|
|
2821
|
-
|
|
2822
|
-
if (sticky) {
|
|
2823
|
-
flags = replace(flags, 'y', '');
|
|
2824
|
-
if (indexOf(flags, 'g') === -1) {
|
|
2825
|
-
flags += 'g';
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
strCopy = stringSlice(str, re.lastIndex);
|
|
2829
|
-
// Support anchored sticky behavior.
|
|
2830
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
|
2831
|
-
source = '(?: ' + source + ')';
|
|
2832
|
-
strCopy = ' ' + strCopy;
|
|
2833
|
-
charsAdded++;
|
|
2834
|
-
}
|
|
2835
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2836
|
-
// simulate the 'y' flag.
|
|
2837
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
if (NPCG_INCLUDED) {
|
|
2841
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2842
|
-
}
|
|
2843
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2844
|
-
|
|
2845
|
-
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2846
|
-
|
|
2847
|
-
if (sticky) {
|
|
2848
|
-
if (match) {
|
|
2849
|
-
match.input = stringSlice(match.input, charsAdded);
|
|
2850
|
-
match[0] = stringSlice(match[0], charsAdded);
|
|
2851
|
-
match.index = re.lastIndex;
|
|
2852
|
-
re.lastIndex += match[0].length;
|
|
2853
|
-
} else re.lastIndex = 0;
|
|
2854
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2855
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2856
|
-
}
|
|
2857
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2858
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2859
|
-
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2860
|
-
call(nativeReplace, match[0], reCopy, function () {
|
|
2861
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
2862
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
2863
|
-
}
|
|
2864
|
-
});
|
|
2093
|
+
/**
|
|
2094
|
+
* Base field Wrapper to render the component with the necessary configurations from the schema
|
|
2095
|
+
* and mapper configuration
|
|
2096
|
+
*
|
|
2097
|
+
* @param {TFieldWrapperProps} param FieldWrapper params
|
|
2098
|
+
* @returns {ReactElement}
|
|
2099
|
+
*/
|
|
2100
|
+
const FieldWrapper = ({
|
|
2101
|
+
name,
|
|
2102
|
+
formIndex,
|
|
2103
|
+
children,
|
|
2104
|
+
props,
|
|
2105
|
+
context,
|
|
2106
|
+
mounted,
|
|
2107
|
+
mapper,
|
|
2108
|
+
visibility
|
|
2109
|
+
}) => {
|
|
2110
|
+
var _a, _b, _c;
|
|
2111
|
+
const localContext = useFormGroupContext({});
|
|
2112
|
+
/**
|
|
2113
|
+
* picks the right context prioritizing the context passed as prop
|
|
2114
|
+
*/
|
|
2115
|
+
const {
|
|
2116
|
+
formGroupInstance,
|
|
2117
|
+
debugMode
|
|
2118
|
+
} = useMemo(() => context ? context : localContext, [context, localContext]);
|
|
2119
|
+
const fieldInstance = useMemo(() => {
|
|
2120
|
+
var _a;
|
|
2121
|
+
return (_a = formGroupInstance.getForm({
|
|
2122
|
+
key: formIndex
|
|
2123
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2124
|
+
key: name
|
|
2125
|
+
});
|
|
2126
|
+
}, [mounted]);
|
|
2127
|
+
/**
|
|
2128
|
+
* props with templates stripped until the field ins't ready on the instance
|
|
2129
|
+
*/
|
|
2130
|
+
const filteredProps = useMemo(() => {
|
|
2131
|
+
let returnProps = {};
|
|
2132
|
+
if (props) {
|
|
2133
|
+
returnProps = FormField.filterProps(props);
|
|
2865
2134
|
}
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2135
|
+
if (fieldInstance) fieldInstance.props = returnProps;
|
|
2136
|
+
return returnProps;
|
|
2137
|
+
}, [props]);
|
|
2138
|
+
const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {
|
|
2139
|
+
[((_a = mapper === null || mapper === void 0 ? void 0 : mapper.events) === null || _a === void 0 ? void 0 : _a.setValue) || 'value']: ''
|
|
2140
|
+
});
|
|
2141
|
+
const [state, setState] = useState({
|
|
2142
|
+
visibility: typeof visibility === 'boolean' ? visibility : true,
|
|
2143
|
+
props: filteredProps
|
|
2144
|
+
});
|
|
2145
|
+
const mountedRef = useRef(false);
|
|
2146
|
+
/**
|
|
2147
|
+
* handles the mounting and unmounting logic onto the field instance
|
|
2148
|
+
*/
|
|
2149
|
+
useEffect(() => {
|
|
2150
|
+
if (!fieldInstance || mountedRef.current) return;
|
|
2151
|
+
fieldInstance.mountField({
|
|
2152
|
+
valueSubscription: value => {
|
|
2153
|
+
setValueState(value);
|
|
2154
|
+
},
|
|
2155
|
+
propsSubscription: ({
|
|
2156
|
+
visibility,
|
|
2157
|
+
props,
|
|
2158
|
+
errors
|
|
2159
|
+
}) => {
|
|
2160
|
+
setState(prev => Object.assign(Object.assign({}, prev), {
|
|
2161
|
+
visibility,
|
|
2162
|
+
props,
|
|
2163
|
+
errors
|
|
2164
|
+
}));
|
|
2872
2165
|
}
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2166
|
+
});
|
|
2167
|
+
mountedRef.current = true;
|
|
2168
|
+
}, [fieldInstance]);
|
|
2169
|
+
/**
|
|
2170
|
+
* recycle effect to remove the field Subscriptions due to memory leaks
|
|
2171
|
+
*/
|
|
2172
|
+
useEffect(() => {
|
|
2173
|
+
return () => {
|
|
2174
|
+
mountedRef.current && (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.destroyField());
|
|
2175
|
+
};
|
|
2176
|
+
}, []);
|
|
2177
|
+
/**
|
|
2178
|
+
* handles the value change onto the field instance
|
|
2179
|
+
*/
|
|
2180
|
+
const handleChange = useCallback(event => {
|
|
2181
|
+
if (!mounted) return;
|
|
2182
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitValue({
|
|
2183
|
+
value: event,
|
|
2184
|
+
event: 'ON_FIELD_CHANGE'
|
|
2185
|
+
});
|
|
2186
|
+
}, [mounted]);
|
|
2187
|
+
/**
|
|
2188
|
+
* handles the event emission onto the field instance
|
|
2189
|
+
*/
|
|
2190
|
+
const handleEvent = useCallback(event => {
|
|
2191
|
+
if (!mounted) return;
|
|
2192
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitEvents({
|
|
2193
|
+
event
|
|
2194
|
+
});
|
|
2195
|
+
}, [mounted]);
|
|
2196
|
+
/**
|
|
2197
|
+
* handles the mappers configuration to bind the event submission callback
|
|
2198
|
+
* to the corresponding prop defined on the mappers
|
|
2199
|
+
*/
|
|
2200
|
+
const mapProps = useMemo(() => {
|
|
2201
|
+
const events = mapper === null || mapper === void 0 ? void 0 : mapper.events;
|
|
2202
|
+
const props = {};
|
|
2203
|
+
if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
|
|
2204
|
+
if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
|
|
2205
|
+
if (events === null || events === void 0 ? void 0 : events.onFocus) props[events.onFocus] = () => handleEvent('ON_FIELD_FOCUS');
|
|
2206
|
+
if (events === null || events === void 0 ? void 0 : events.onClick) props[events.onClick] = () => handleEvent('ON_FIELD_CLICK');
|
|
2207
|
+
if (events === null || events === void 0 ? void 0 : events.onSubmit) props[events.onSubmit] = () => handleEvent('ON_FORM_SUBMIT');
|
|
2208
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyUp) props[events.onKeyUp] = () => handleEvent('ON_FIELD_KEYUP');
|
|
2209
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyDown) props[events.onKeyDown] = () => handleEvent('ON_FIELD_KEYDOWN');
|
|
2210
|
+
return props;
|
|
2211
|
+
}, [mounted]);
|
|
2212
|
+
return state.visibility ? jsxs(Fragment, {
|
|
2213
|
+
children: [debugMode && jsxs("div", {
|
|
2214
|
+
style: {
|
|
2215
|
+
width: '100%',
|
|
2216
|
+
display: 'flex',
|
|
2217
|
+
flexDirection: 'column'
|
|
2218
|
+
},
|
|
2219
|
+
children: [jsxs("b", {
|
|
2220
|
+
style: {
|
|
2221
|
+
padding: '0px',
|
|
2222
|
+
margin: '0px'
|
|
2223
|
+
},
|
|
2224
|
+
children: ["name:", name]
|
|
2225
|
+
}), jsxs("b", {
|
|
2226
|
+
style: {
|
|
2227
|
+
padding: '0px',
|
|
2228
|
+
margin: '0px'
|
|
2229
|
+
},
|
|
2230
|
+
children: ["order:", (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _b === void 0 ? void 0 : _b.order]
|
|
2231
|
+
}), jsxs("b", {
|
|
2232
|
+
style: {
|
|
2233
|
+
padding: '0px',
|
|
2234
|
+
margin: '0px'
|
|
2235
|
+
},
|
|
2236
|
+
children: ["path:", fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.path]
|
|
2237
|
+
}), jsx("br", {}), jsx("hr", {})]
|
|
2238
|
+
}), jsx(FieldWrapperComponentRender, {
|
|
2239
|
+
props: Object.assign(Object.assign(Object.assign(Object.assign({}, mapProps), state.props), state.errors), valueState),
|
|
2240
|
+
fieldInstance: fieldInstance,
|
|
2241
|
+
mapper: mapper,
|
|
2242
|
+
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
|
|
2243
|
+
})]
|
|
2244
|
+
}) : jsx(Fragment, {});
|
|
2245
|
+
};
|
|
2889
2246
|
|
|
2890
2247
|
/**
|
|
2891
2248
|
* Component Wrapper to render form fields without the Form component, gets additional formId and mapper since
|
|
@@ -2895,29 +2252,12 @@ $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
|
2895
2252
|
* @returns {ReactElement}
|
|
2896
2253
|
*/
|
|
2897
2254
|
const AsFormFieldBuilder = props => {
|
|
2898
|
-
var _a;
|
|
2899
2255
|
const context = useFormGroupContext({});
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
name: fieldName
|
|
2906
|
-
}), {
|
|
2907
|
-
component: props.mapper.componentName,
|
|
2908
|
-
children: undefined
|
|
2909
|
-
});
|
|
2910
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2911
|
-
fieldSchema,
|
|
2912
|
-
mapperElement: props.mapper
|
|
2913
|
-
});
|
|
2914
|
-
const field = formInstance === null || formInstance === void 0 ? void 0 : formInstance.getField({
|
|
2915
|
-
key: fieldName
|
|
2916
|
-
});
|
|
2917
|
-
if (typeof (props === null || props === void 0 ? void 0 : props.visibility) !== 'undefined' && field) {
|
|
2918
|
-
field.visibility = props.visibility;
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2256
|
+
/**
|
|
2257
|
+
* state to track the field instance creation process
|
|
2258
|
+
*/
|
|
2259
|
+
const [mounted, setMounted] = useState(false);
|
|
2260
|
+
const mountedRef = useRef(false);
|
|
2921
2261
|
/**
|
|
2922
2262
|
* initializer to create or add a form instance to the formGroup by it's formId
|
|
2923
2263
|
* and add the field to the form instance
|
|
@@ -2925,56 +2265,41 @@ const AsFormFieldBuilder = props => {
|
|
|
2925
2265
|
*/
|
|
2926
2266
|
useEffect(() => {
|
|
2927
2267
|
var _a;
|
|
2928
|
-
|
|
2929
|
-
if (!((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2268
|
+
if (mountedRef.current) return;
|
|
2269
|
+
if (typeof props.formMounted === 'undefined' && !((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2930
2270
|
context.addFormWithIndex(props.formIndex);
|
|
2931
2271
|
}
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2937
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2938
|
-
fieldSchema,
|
|
2939
|
-
mapperElement: props.mapper
|
|
2940
|
-
});
|
|
2941
|
-
const field = formInstance === null || formInstance === void 0 ? void 0 : formInstance.getField({
|
|
2942
|
-
key: props.name
|
|
2943
|
-
});
|
|
2944
|
-
if (typeof (props === null || props === void 0 ? void 0 : props.visibility) !== 'undefined' && field) {
|
|
2945
|
-
field.visibility = props.visibility;
|
|
2946
|
-
}
|
|
2947
|
-
return () => {
|
|
2948
|
-
formInstance === null || formInstance === void 0 ? void 0 : formInstance.removeField({
|
|
2949
|
-
key: props.name
|
|
2272
|
+
if (props.formMounted || typeof props.formMounted === 'undefined') {
|
|
2273
|
+
const fieldSchema = Object.assign(Object.assign({}, props), {
|
|
2274
|
+
component: props.mapper.componentName,
|
|
2275
|
+
children: undefined
|
|
2950
2276
|
});
|
|
2951
|
-
|
|
2952
|
-
|
|
2277
|
+
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2278
|
+
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2279
|
+
fieldSchema,
|
|
2280
|
+
mapperElement: props.mapper
|
|
2953
2281
|
});
|
|
2954
|
-
|
|
2955
|
-
|
|
2282
|
+
setMounted(true);
|
|
2283
|
+
mountedRef.current = true;
|
|
2284
|
+
}
|
|
2285
|
+
}, [props.formMounted]);
|
|
2956
2286
|
/**
|
|
2957
|
-
*
|
|
2958
|
-
*
|
|
2287
|
+
* recycle effect to remove the field from the form instance when the field leaves the vDOM
|
|
2288
|
+
* and the subscriptions
|
|
2959
2289
|
*/
|
|
2960
2290
|
useEffect(() => {
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
*/
|
|
2971
|
-
/\$/.test((_b = props.props) === null || _b === void 0 ? void 0 : _b[propKey])) {
|
|
2972
|
-
delete props.props[propKey];
|
|
2973
|
-
}
|
|
2291
|
+
return () => {
|
|
2292
|
+
var _a, _b;
|
|
2293
|
+
if ((_b = (_a = context.getForm({
|
|
2294
|
+
key: props.formIndex
|
|
2295
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2296
|
+
key: props.name
|
|
2297
|
+
})) === null || _b === void 0 ? void 0 : _b.mounted) context.formGroupInstance.removeField({
|
|
2298
|
+
formIndex: props.formIndex,
|
|
2299
|
+
fieldIndex: props.name
|
|
2974
2300
|
});
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
}, [props.props, fieldName]);
|
|
2301
|
+
};
|
|
2302
|
+
}, []);
|
|
2978
2303
|
/**
|
|
2979
2304
|
* allows to control field selected value on each event
|
|
2980
2305
|
*/
|
|
@@ -2993,11 +2318,14 @@ const AsFormFieldBuilder = props => {
|
|
|
2993
2318
|
}, [props.onSelected]);
|
|
2994
2319
|
return jsx(FieldWrapper, {
|
|
2995
2320
|
formIndex: props.formIndex,
|
|
2996
|
-
name:
|
|
2321
|
+
name: props.name,
|
|
2997
2322
|
props: props.props,
|
|
2998
2323
|
context: !context.active ? context : null,
|
|
2324
|
+
mounted: mounted,
|
|
2325
|
+
mapper: props.mapper,
|
|
2326
|
+
visibility: props.visibility,
|
|
2999
2327
|
children: props.children && props.children
|
|
3000
|
-
}
|
|
2328
|
+
});
|
|
3001
2329
|
};
|
|
3002
2330
|
|
|
3003
2331
|
function useFormGroup({
|