@sebgroup/green-react 1.0.0-beta.2 → 1.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +6 -0
- package/{react.esm.js → index.esm.js} +1332 -389
- package/index.umd.js +2928 -0
- package/lib/alert/alert.d.ts +3 -2
- package/lib/badge/badge.d.ts +12 -0
- package/lib/card/card.d.ts +3 -4
- package/lib/datepicker/datepicker.d.ts +2 -0
- package/lib/datepicker/hook.d.ts +12 -0
- package/lib/dropdown/dropdown.d.ts +10 -3
- package/lib/dropdown/hooks.d.ts +25 -7
- package/lib/form/{button.d.ts → button/button.d.ts} +0 -0
- package/lib/form/{buttonGroup.d.ts → buttonGroup/buttonGroup.d.ts} +2 -2
- package/lib/form/form.d.ts +5 -4
- package/lib/form/formContext.d.ts +13 -0
- package/lib/form/formItems.d.ts +9 -0
- package/lib/form/group/group.d.ts +9 -0
- package/lib/form/index.d.ts +7 -4
- package/lib/form/input/input.d.ts +11 -0
- package/lib/form/radioButton/radioGroup.d.ts +13 -0
- package/lib/form/{text.d.ts → text/text.d.ts} +1 -1
- package/lib/form/types.d.ts +14 -16
- package/lib/form/useInput.d.ts +2 -3
- package/lib/form/validateInput.d.ts +9 -0
- package/lib/layout/flexbox/flexbox.d.ts +13 -0
- package/lib/layout/flexbox/types.d.ts +5 -0
- package/lib/layout/index.d.ts +1 -1
- package/lib/link/link.d.ts +7 -0
- package/lib/list/list.d.ts +14 -0
- package/lib/list/listItem.d.ts +10 -0
- package/lib/modal/modal.d.ts +2 -1
- package/lib/navbar/navbar.d.ts +12 -0
- package/lib/stepper/hook.d.ts +3 -0
- package/lib/stepper/stepper.d.ts +8 -0
- package/lib/tabs/tabs.d.ts +13 -0
- package/package.json +7 -10
- package/lib/form/input.d.ts +0 -5
- package/lib/layout/group.d.ts +0 -6
- package/react.umd.js +0 -1419
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useState, useLayoutEffect, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { randomId, validateClassName, createStepper, createDropdown } from '@sebgroup/extract';
|
|
4
4
|
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ var check = function (it) {
|
|
|
10
10
|
|
|
11
11
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
12
12
|
var global$r =
|
|
13
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
13
|
+
// eslint-disable-next-line es-x/no-global-this -- safe
|
|
14
14
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
15
15
|
check(typeof window == 'object' && window) ||
|
|
16
16
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -21,7 +21,7 @@ var global$r =
|
|
|
21
21
|
|
|
22
22
|
var objectGetOwnPropertyDescriptor = {};
|
|
23
23
|
|
|
24
|
-
var fails$
|
|
24
|
+
var fails$a = function (exec) {
|
|
25
25
|
try {
|
|
26
26
|
return !!exec();
|
|
27
27
|
} catch (error) {
|
|
@@ -29,24 +29,35 @@ var fails$9 = function (exec) {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
var fails$
|
|
32
|
+
var fails$9 = fails$a;
|
|
33
33
|
|
|
34
34
|
// Detect IE8's incomplete defineProperty implementation
|
|
35
|
-
var descriptors = !fails$
|
|
36
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
35
|
+
var descriptors = !fails$9(function () {
|
|
36
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
37
37
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
var fails$8 = fails$a;
|
|
41
|
+
|
|
42
|
+
var functionBindNative = !fails$8(function () {
|
|
43
|
+
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
44
|
+
var test = (function () { /* empty */ }).bind();
|
|
45
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
46
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
var NATIVE_BIND$1 = functionBindNative;
|
|
50
|
+
|
|
40
51
|
var call$6 = Function.prototype.call;
|
|
41
52
|
|
|
42
|
-
var functionCall =
|
|
53
|
+
var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
|
|
43
54
|
return call$6.apply(call$6, arguments);
|
|
44
55
|
};
|
|
45
56
|
|
|
46
57
|
var objectPropertyIsEnumerable = {};
|
|
47
58
|
|
|
48
59
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
49
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
60
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
50
61
|
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
51
62
|
|
|
52
63
|
// Nashorn ~ JDK8 bug
|
|
@@ -68,35 +79,37 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
|
68
79
|
};
|
|
69
80
|
};
|
|
70
81
|
|
|
82
|
+
var NATIVE_BIND = functionBindNative;
|
|
83
|
+
|
|
71
84
|
var FunctionPrototype$1 = Function.prototype;
|
|
72
85
|
var bind = FunctionPrototype$1.bind;
|
|
73
86
|
var call$5 = FunctionPrototype$1.call;
|
|
74
|
-
var
|
|
87
|
+
var uncurryThis$c = NATIVE_BIND && bind.bind(call$5, call$5);
|
|
75
88
|
|
|
76
|
-
var functionUncurryThis =
|
|
77
|
-
return fn &&
|
|
89
|
+
var functionUncurryThis = NATIVE_BIND ? function (fn) {
|
|
90
|
+
return fn && uncurryThis$c(fn);
|
|
78
91
|
} : function (fn) {
|
|
79
92
|
return fn && function () {
|
|
80
93
|
return call$5.apply(fn, arguments);
|
|
81
94
|
};
|
|
82
95
|
};
|
|
83
96
|
|
|
84
|
-
var uncurryThis$
|
|
97
|
+
var uncurryThis$b = functionUncurryThis;
|
|
85
98
|
|
|
86
|
-
var toString$
|
|
87
|
-
var stringSlice = uncurryThis$
|
|
99
|
+
var toString$3 = uncurryThis$b({}.toString);
|
|
100
|
+
var stringSlice$1 = uncurryThis$b(''.slice);
|
|
88
101
|
|
|
89
102
|
var classofRaw$1 = function (it) {
|
|
90
|
-
return stringSlice(toString$
|
|
103
|
+
return stringSlice$1(toString$3(it), 8, -1);
|
|
91
104
|
};
|
|
92
105
|
|
|
93
106
|
var global$q = global$r;
|
|
94
|
-
var uncurryThis$
|
|
95
|
-
var fails$7 = fails$
|
|
107
|
+
var uncurryThis$a = functionUncurryThis;
|
|
108
|
+
var fails$7 = fails$a;
|
|
96
109
|
var classof$2 = classofRaw$1;
|
|
97
110
|
|
|
98
111
|
var Object$5 = global$q.Object;
|
|
99
|
-
var split = uncurryThis$
|
|
112
|
+
var split = uncurryThis$a(''.split);
|
|
100
113
|
|
|
101
114
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
102
115
|
var indexedObject = fails$7(function () {
|
|
@@ -113,45 +126,45 @@ var TypeError$8 = global$p.TypeError;
|
|
|
113
126
|
|
|
114
127
|
// `RequireObjectCoercible` abstract operation
|
|
115
128
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
116
|
-
var requireObjectCoercible$
|
|
129
|
+
var requireObjectCoercible$2 = function (it) {
|
|
117
130
|
if (it == undefined) throw TypeError$8("Can't call method on " + it);
|
|
118
131
|
return it;
|
|
119
132
|
};
|
|
120
133
|
|
|
121
134
|
// toObject with fallback for non-array-like ES3 strings
|
|
122
135
|
var IndexedObject$1 = indexedObject;
|
|
123
|
-
var requireObjectCoercible$
|
|
136
|
+
var requireObjectCoercible$1 = requireObjectCoercible$2;
|
|
124
137
|
|
|
125
138
|
var toIndexedObject$5 = function (it) {
|
|
126
|
-
return IndexedObject$1(requireObjectCoercible$
|
|
139
|
+
return IndexedObject$1(requireObjectCoercible$1(it));
|
|
127
140
|
};
|
|
128
141
|
|
|
129
142
|
// `IsCallable` abstract operation
|
|
130
143
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
131
|
-
var isCallable$
|
|
144
|
+
var isCallable$f = function (argument) {
|
|
132
145
|
return typeof argument == 'function';
|
|
133
146
|
};
|
|
134
147
|
|
|
135
|
-
var isCallable$
|
|
148
|
+
var isCallable$e = isCallable$f;
|
|
136
149
|
|
|
137
150
|
var isObject$5 = function (it) {
|
|
138
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
151
|
+
return typeof it == 'object' ? it !== null : isCallable$e(it);
|
|
139
152
|
};
|
|
140
153
|
|
|
141
154
|
var global$o = global$r;
|
|
142
|
-
var isCallable$
|
|
155
|
+
var isCallable$d = isCallable$f;
|
|
143
156
|
|
|
144
157
|
var aFunction = function (argument) {
|
|
145
|
-
return isCallable$
|
|
158
|
+
return isCallable$d(argument) ? argument : undefined;
|
|
146
159
|
};
|
|
147
160
|
|
|
148
161
|
var getBuiltIn$4 = function (namespace, method) {
|
|
149
162
|
return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
|
|
150
163
|
};
|
|
151
164
|
|
|
152
|
-
var uncurryThis$
|
|
165
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
153
166
|
|
|
154
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
167
|
+
var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
|
|
155
168
|
|
|
156
169
|
var getBuiltIn$3 = getBuiltIn$4;
|
|
157
170
|
|
|
@@ -185,12 +198,12 @@ if (!version && userAgent) {
|
|
|
185
198
|
|
|
186
199
|
var engineV8Version = version;
|
|
187
200
|
|
|
188
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
201
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
189
202
|
|
|
190
203
|
var V8_VERSION = engineV8Version;
|
|
191
|
-
var fails$6 = fails$
|
|
204
|
+
var fails$6 = fails$a;
|
|
192
205
|
|
|
193
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
206
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
194
207
|
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
|
|
195
208
|
var symbol = Symbol();
|
|
196
209
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
@@ -200,18 +213,18 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
|
|
|
200
213
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
201
214
|
});
|
|
202
215
|
|
|
203
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
216
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
204
217
|
|
|
205
|
-
var NATIVE_SYMBOL$
|
|
218
|
+
var NATIVE_SYMBOL$2 = nativeSymbol;
|
|
206
219
|
|
|
207
|
-
var useSymbolAsUid = NATIVE_SYMBOL$
|
|
220
|
+
var useSymbolAsUid = NATIVE_SYMBOL$2
|
|
208
221
|
&& !Symbol.sham
|
|
209
222
|
&& typeof Symbol.iterator == 'symbol';
|
|
210
223
|
|
|
211
224
|
var global$m = global$r;
|
|
212
225
|
var getBuiltIn$2 = getBuiltIn$4;
|
|
213
|
-
var isCallable$
|
|
214
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
226
|
+
var isCallable$c = isCallable$f;
|
|
227
|
+
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
215
228
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
216
229
|
|
|
217
230
|
var Object$4 = global$m.Object;
|
|
@@ -220,7 +233,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
|
220
233
|
return typeof it == 'symbol';
|
|
221
234
|
} : function (it) {
|
|
222
235
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
223
|
-
return isCallable$
|
|
236
|
+
return isCallable$c($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$4(it));
|
|
224
237
|
};
|
|
225
238
|
|
|
226
239
|
var global$l = global$r;
|
|
@@ -236,14 +249,14 @@ var tryToString$1 = function (argument) {
|
|
|
236
249
|
};
|
|
237
250
|
|
|
238
251
|
var global$k = global$r;
|
|
239
|
-
var isCallable$
|
|
252
|
+
var isCallable$b = isCallable$f;
|
|
240
253
|
var tryToString = tryToString$1;
|
|
241
254
|
|
|
242
255
|
var TypeError$7 = global$k.TypeError;
|
|
243
256
|
|
|
244
257
|
// `Assert: IsCallable(argument) is true`
|
|
245
258
|
var aCallable$1 = function (argument) {
|
|
246
|
-
if (isCallable$
|
|
259
|
+
if (isCallable$b(argument)) return argument;
|
|
247
260
|
throw TypeError$7(tryToString(argument) + ' is not a function');
|
|
248
261
|
};
|
|
249
262
|
|
|
@@ -258,7 +271,7 @@ var getMethod$1 = function (V, P) {
|
|
|
258
271
|
|
|
259
272
|
var global$j = global$r;
|
|
260
273
|
var call$4 = functionCall;
|
|
261
|
-
var isCallable$
|
|
274
|
+
var isCallable$a = isCallable$f;
|
|
262
275
|
var isObject$4 = isObject$5;
|
|
263
276
|
|
|
264
277
|
var TypeError$6 = global$j.TypeError;
|
|
@@ -267,9 +280,9 @@ var TypeError$6 = global$j.TypeError;
|
|
|
267
280
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
268
281
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
269
282
|
var fn, val;
|
|
270
|
-
if (pref === 'string' && isCallable$
|
|
271
|
-
if (isCallable$
|
|
272
|
-
if (pref !== 'string' && isCallable$
|
|
283
|
+
if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
|
|
284
|
+
if (isCallable$a(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
|
|
285
|
+
if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
|
|
273
286
|
throw TypeError$6("Can't convert object to primitive value");
|
|
274
287
|
};
|
|
275
288
|
|
|
@@ -277,12 +290,12 @@ var shared$3 = {exports: {}};
|
|
|
277
290
|
|
|
278
291
|
var global$i = global$r;
|
|
279
292
|
|
|
280
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
281
|
-
var defineProperty$
|
|
293
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
294
|
+
var defineProperty$4 = Object.defineProperty;
|
|
282
295
|
|
|
283
296
|
var setGlobal$3 = function (key, value) {
|
|
284
297
|
try {
|
|
285
|
-
defineProperty$
|
|
298
|
+
defineProperty$4(global$i, key, { value: value, configurable: true, writable: true });
|
|
286
299
|
} catch (error) {
|
|
287
300
|
global$i[key] = value;
|
|
288
301
|
} return value;
|
|
@@ -301,60 +314,63 @@ var store$2 = sharedStore;
|
|
|
301
314
|
(shared$3.exports = function (key, value) {
|
|
302
315
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
303
316
|
})('versions', []).push({
|
|
304
|
-
version: '3.
|
|
317
|
+
version: '3.22.2',
|
|
305
318
|
mode: 'global',
|
|
306
|
-
copyright: '©
|
|
319
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
320
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE',
|
|
321
|
+
source: 'https://github.com/zloirock/core-js'
|
|
307
322
|
});
|
|
308
323
|
|
|
309
324
|
var global$g = global$r;
|
|
310
|
-
var requireObjectCoercible
|
|
325
|
+
var requireObjectCoercible = requireObjectCoercible$2;
|
|
311
326
|
|
|
312
327
|
var Object$3 = global$g.Object;
|
|
313
328
|
|
|
314
329
|
// `ToObject` abstract operation
|
|
315
330
|
// https://tc39.es/ecma262/#sec-toobject
|
|
316
331
|
var toObject$3 = function (argument) {
|
|
317
|
-
return Object$3(requireObjectCoercible
|
|
332
|
+
return Object$3(requireObjectCoercible(argument));
|
|
318
333
|
};
|
|
319
334
|
|
|
320
|
-
var uncurryThis$
|
|
335
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
321
336
|
var toObject$2 = toObject$3;
|
|
322
337
|
|
|
323
|
-
var hasOwnProperty = uncurryThis$
|
|
338
|
+
var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
|
|
324
339
|
|
|
325
340
|
// `HasOwnProperty` abstract operation
|
|
326
341
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
342
|
+
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
327
343
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
328
344
|
return hasOwnProperty(toObject$2(it), key);
|
|
329
345
|
};
|
|
330
346
|
|
|
331
|
-
var uncurryThis$
|
|
347
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
332
348
|
|
|
333
349
|
var id = 0;
|
|
334
350
|
var postfix = Math.random();
|
|
335
|
-
var toString$
|
|
351
|
+
var toString$2 = uncurryThis$7(1.0.toString);
|
|
336
352
|
|
|
337
353
|
var uid$2 = function (key) {
|
|
338
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$
|
|
354
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
|
|
339
355
|
};
|
|
340
356
|
|
|
341
357
|
var global$f = global$r;
|
|
342
358
|
var shared$2 = shared$3.exports;
|
|
343
|
-
var hasOwn$
|
|
359
|
+
var hasOwn$9 = hasOwnProperty_1;
|
|
344
360
|
var uid$1 = uid$2;
|
|
345
|
-
var NATIVE_SYMBOL = nativeSymbol;
|
|
361
|
+
var NATIVE_SYMBOL$1 = nativeSymbol;
|
|
346
362
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
347
363
|
|
|
348
364
|
var WellKnownSymbolsStore = shared$2('wks');
|
|
349
|
-
var Symbol$
|
|
350
|
-
var symbolFor = Symbol$
|
|
351
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$
|
|
365
|
+
var Symbol$1 = global$f.Symbol;
|
|
366
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
367
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
352
368
|
|
|
353
369
|
var wellKnownSymbol$8 = function (name) {
|
|
354
|
-
if (!hasOwn$
|
|
370
|
+
if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
355
371
|
var description = 'Symbol.' + name;
|
|
356
|
-
if (NATIVE_SYMBOL && hasOwn$
|
|
357
|
-
WellKnownSymbolsStore[name] = Symbol$
|
|
372
|
+
if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
|
|
373
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
358
374
|
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
359
375
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
360
376
|
} else {
|
|
@@ -411,43 +427,56 @@ var documentCreateElement$2 = function (it) {
|
|
|
411
427
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
412
428
|
};
|
|
413
429
|
|
|
414
|
-
var DESCRIPTORS$
|
|
415
|
-
var fails$5 = fails$
|
|
430
|
+
var DESCRIPTORS$9 = descriptors;
|
|
431
|
+
var fails$5 = fails$a;
|
|
416
432
|
var createElement = documentCreateElement$2;
|
|
417
433
|
|
|
418
|
-
//
|
|
419
|
-
var ie8DomDefine = !DESCRIPTORS$
|
|
420
|
-
// eslint-disable-next-line es/no-object-defineproperty --
|
|
434
|
+
// Thanks to IE8 for its funny defineProperty
|
|
435
|
+
var ie8DomDefine = !DESCRIPTORS$9 && !fails$5(function () {
|
|
436
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
421
437
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
422
438
|
get: function () { return 7; }
|
|
423
439
|
}).a != 7;
|
|
424
440
|
});
|
|
425
441
|
|
|
426
|
-
var DESCRIPTORS$
|
|
442
|
+
var DESCRIPTORS$8 = descriptors;
|
|
427
443
|
var call$2 = functionCall;
|
|
428
444
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
429
445
|
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
|
430
446
|
var toIndexedObject$4 = toIndexedObject$5;
|
|
431
447
|
var toPropertyKey$1 = toPropertyKey$2;
|
|
432
|
-
var hasOwn$
|
|
448
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
433
449
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
434
450
|
|
|
435
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
436
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
451
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
452
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
437
453
|
|
|
438
454
|
// `Object.getOwnPropertyDescriptor` method
|
|
439
455
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
440
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$
|
|
456
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
441
457
|
O = toIndexedObject$4(O);
|
|
442
458
|
P = toPropertyKey$1(P);
|
|
443
459
|
if (IE8_DOM_DEFINE$1) try {
|
|
444
|
-
return $getOwnPropertyDescriptor(O, P);
|
|
460
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
445
461
|
} catch (error) { /* empty */ }
|
|
446
|
-
if (hasOwn$
|
|
462
|
+
if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
447
463
|
};
|
|
448
464
|
|
|
449
465
|
var objectDefineProperty = {};
|
|
450
466
|
|
|
467
|
+
var DESCRIPTORS$7 = descriptors;
|
|
468
|
+
var fails$4 = fails$a;
|
|
469
|
+
|
|
470
|
+
// V8 ~ Chrome 36-
|
|
471
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
472
|
+
var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$4(function () {
|
|
473
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
474
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
475
|
+
value: 42,
|
|
476
|
+
writable: false
|
|
477
|
+
}).prototype != 42;
|
|
478
|
+
});
|
|
479
|
+
|
|
451
480
|
var global$c = global$r;
|
|
452
481
|
var isObject$1 = isObject$5;
|
|
453
482
|
|
|
@@ -461,18 +490,39 @@ var anObject$5 = function (argument) {
|
|
|
461
490
|
};
|
|
462
491
|
|
|
463
492
|
var global$b = global$r;
|
|
464
|
-
var DESCRIPTORS$
|
|
493
|
+
var DESCRIPTORS$6 = descriptors;
|
|
465
494
|
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
495
|
+
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
466
496
|
var anObject$4 = anObject$5;
|
|
467
497
|
var toPropertyKey = toPropertyKey$2;
|
|
468
498
|
|
|
469
499
|
var TypeError$3 = global$b.TypeError;
|
|
470
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
500
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
471
501
|
var $defineProperty = Object.defineProperty;
|
|
502
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
503
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
504
|
+
var ENUMERABLE = 'enumerable';
|
|
505
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
506
|
+
var WRITABLE = 'writable';
|
|
472
507
|
|
|
473
508
|
// `Object.defineProperty` method
|
|
474
509
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
475
|
-
objectDefineProperty.f = DESCRIPTORS$
|
|
510
|
+
objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
511
|
+
anObject$4(O);
|
|
512
|
+
P = toPropertyKey(P);
|
|
513
|
+
anObject$4(Attributes);
|
|
514
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
515
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
516
|
+
if (current && current[WRITABLE]) {
|
|
517
|
+
O[P] = Attributes.value;
|
|
518
|
+
Attributes = {
|
|
519
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
520
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
521
|
+
writable: false
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
} return $defineProperty(O, P, Attributes);
|
|
525
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
476
526
|
anObject$4(O);
|
|
477
527
|
P = toPropertyKey(P);
|
|
478
528
|
anObject$4(Attributes);
|
|
@@ -484,11 +534,11 @@ objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProper
|
|
|
484
534
|
return O;
|
|
485
535
|
};
|
|
486
536
|
|
|
487
|
-
var DESCRIPTORS$
|
|
537
|
+
var DESCRIPTORS$5 = descriptors;
|
|
488
538
|
var definePropertyModule$3 = objectDefineProperty;
|
|
489
539
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
490
540
|
|
|
491
|
-
var createNonEnumerableProperty$5 = DESCRIPTORS$
|
|
541
|
+
var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
|
|
492
542
|
return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
|
|
493
543
|
} : function (object, key, value) {
|
|
494
544
|
object[key] = value;
|
|
@@ -497,14 +547,14 @@ var createNonEnumerableProperty$5 = DESCRIPTORS$3 ? function (object, key, value
|
|
|
497
547
|
|
|
498
548
|
var redefine$3 = {exports: {}};
|
|
499
549
|
|
|
500
|
-
var uncurryThis$
|
|
501
|
-
var isCallable$
|
|
550
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
551
|
+
var isCallable$9 = isCallable$f;
|
|
502
552
|
var store$1 = sharedStore;
|
|
503
553
|
|
|
504
|
-
var functionToString = uncurryThis$
|
|
554
|
+
var functionToString = uncurryThis$6(Function.toString);
|
|
505
555
|
|
|
506
556
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
507
|
-
if (!isCallable$
|
|
557
|
+
if (!isCallable$9(store$1.inspectSource)) {
|
|
508
558
|
store$1.inspectSource = function (it) {
|
|
509
559
|
return functionToString(it);
|
|
510
560
|
};
|
|
@@ -513,12 +563,12 @@ if (!isCallable$8(store$1.inspectSource)) {
|
|
|
513
563
|
var inspectSource$2 = store$1.inspectSource;
|
|
514
564
|
|
|
515
565
|
var global$a = global$r;
|
|
516
|
-
var isCallable$
|
|
566
|
+
var isCallable$8 = isCallable$f;
|
|
517
567
|
var inspectSource$1 = inspectSource$2;
|
|
518
568
|
|
|
519
569
|
var WeakMap$1 = global$a.WeakMap;
|
|
520
570
|
|
|
521
|
-
var nativeWeakMap = isCallable$
|
|
571
|
+
var nativeWeakMap = isCallable$8(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
|
|
522
572
|
|
|
523
573
|
var shared$1 = shared$3.exports;
|
|
524
574
|
var uid = uid$2;
|
|
@@ -533,10 +583,10 @@ var hiddenKeys$4 = {};
|
|
|
533
583
|
|
|
534
584
|
var NATIVE_WEAK_MAP = nativeWeakMap;
|
|
535
585
|
var global$9 = global$r;
|
|
536
|
-
var uncurryThis$
|
|
586
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
537
587
|
var isObject = isObject$5;
|
|
538
588
|
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
539
|
-
var hasOwn$
|
|
589
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
540
590
|
var shared = sharedStore;
|
|
541
591
|
var sharedKey$2 = sharedKey$3;
|
|
542
592
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
@@ -561,9 +611,9 @@ var getterFor = function (TYPE) {
|
|
|
561
611
|
|
|
562
612
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
563
613
|
var store = shared.state || (shared.state = new WeakMap());
|
|
564
|
-
var wmget = uncurryThis$
|
|
565
|
-
var wmhas = uncurryThis$
|
|
566
|
-
var wmset = uncurryThis$
|
|
614
|
+
var wmget = uncurryThis$5(store.get);
|
|
615
|
+
var wmhas = uncurryThis$5(store.has);
|
|
616
|
+
var wmset = uncurryThis$5(store.set);
|
|
567
617
|
set = function (it, metadata) {
|
|
568
618
|
if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
569
619
|
metadata.facade = it;
|
|
@@ -580,16 +630,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
|
|
|
580
630
|
var STATE = sharedKey$2('state');
|
|
581
631
|
hiddenKeys$3[STATE] = true;
|
|
582
632
|
set = function (it, metadata) {
|
|
583
|
-
if (hasOwn$
|
|
633
|
+
if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
584
634
|
metadata.facade = it;
|
|
585
635
|
createNonEnumerableProperty$4(it, STATE, metadata);
|
|
586
636
|
return metadata;
|
|
587
637
|
};
|
|
588
638
|
get = function (it) {
|
|
589
|
-
return hasOwn$
|
|
639
|
+
return hasOwn$7(it, STATE) ? it[STATE] : {};
|
|
590
640
|
};
|
|
591
641
|
has = function (it) {
|
|
592
|
-
return hasOwn$
|
|
642
|
+
return hasOwn$7(it, STATE);
|
|
593
643
|
};
|
|
594
644
|
}
|
|
595
645
|
|
|
@@ -601,17 +651,17 @@ var internalState = {
|
|
|
601
651
|
getterFor: getterFor
|
|
602
652
|
};
|
|
603
653
|
|
|
604
|
-
var DESCRIPTORS$
|
|
605
|
-
var hasOwn$
|
|
654
|
+
var DESCRIPTORS$4 = descriptors;
|
|
655
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
606
656
|
|
|
607
657
|
var FunctionPrototype = Function.prototype;
|
|
608
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
609
|
-
var getDescriptor = DESCRIPTORS$
|
|
658
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
659
|
+
var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
|
|
610
660
|
|
|
611
|
-
var EXISTS = hasOwn$
|
|
661
|
+
var EXISTS = hasOwn$6(FunctionPrototype, 'name');
|
|
612
662
|
// additional protection from minified / mangled / dropped function names
|
|
613
663
|
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
614
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$
|
|
664
|
+
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
615
665
|
|
|
616
666
|
var functionName = {
|
|
617
667
|
EXISTS: EXISTS,
|
|
@@ -620,8 +670,8 @@ var functionName = {
|
|
|
620
670
|
};
|
|
621
671
|
|
|
622
672
|
var global$8 = global$r;
|
|
623
|
-
var isCallable$
|
|
624
|
-
var hasOwn$
|
|
673
|
+
var isCallable$7 = isCallable$f;
|
|
674
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
625
675
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
|
|
626
676
|
var setGlobal$1 = setGlobal$3;
|
|
627
677
|
var inspectSource = inspectSource$2;
|
|
@@ -638,11 +688,11 @@ var TEMPLATE = String(String).split('String');
|
|
|
638
688
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
639
689
|
var name = options && options.name !== undefined ? options.name : key;
|
|
640
690
|
var state;
|
|
641
|
-
if (isCallable$
|
|
691
|
+
if (isCallable$7(value)) {
|
|
642
692
|
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
643
693
|
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
644
694
|
}
|
|
645
|
-
if (!hasOwn$
|
|
695
|
+
if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
646
696
|
createNonEnumerableProperty$3(value, 'name', name);
|
|
647
697
|
}
|
|
648
698
|
state = enforceInternalState(value);
|
|
@@ -663,7 +713,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
663
713
|
else createNonEnumerableProperty$3(O, key, value);
|
|
664
714
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
665
715
|
})(Function.prototype, 'toString', function toString() {
|
|
666
|
-
return isCallable$
|
|
716
|
+
return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
|
|
667
717
|
});
|
|
668
718
|
|
|
669
719
|
var objectGetOwnPropertyNames = {};
|
|
@@ -715,7 +765,7 @@ var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
|
715
765
|
var lengthOfArrayLike = lengthOfArrayLike$1;
|
|
716
766
|
|
|
717
767
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
718
|
-
var createMethod
|
|
768
|
+
var createMethod = function (IS_INCLUDES) {
|
|
719
769
|
return function ($this, el, fromIndex) {
|
|
720
770
|
var O = toIndexedObject$3($this);
|
|
721
771
|
var length = lengthOfArrayLike(O);
|
|
@@ -737,28 +787,28 @@ var createMethod$1 = function (IS_INCLUDES) {
|
|
|
737
787
|
var arrayIncludes = {
|
|
738
788
|
// `Array.prototype.includes` method
|
|
739
789
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
740
|
-
includes: createMethod
|
|
790
|
+
includes: createMethod(true),
|
|
741
791
|
// `Array.prototype.indexOf` method
|
|
742
792
|
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
743
|
-
indexOf: createMethod
|
|
793
|
+
indexOf: createMethod(false)
|
|
744
794
|
};
|
|
745
795
|
|
|
746
|
-
var uncurryThis$
|
|
747
|
-
var hasOwn$
|
|
796
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
797
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
748
798
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
749
799
|
var indexOf = arrayIncludes.indexOf;
|
|
750
800
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
751
801
|
|
|
752
|
-
var push = uncurryThis$
|
|
802
|
+
var push = uncurryThis$4([].push);
|
|
753
803
|
|
|
754
804
|
var objectKeysInternal = function (object, names) {
|
|
755
805
|
var O = toIndexedObject$2(object);
|
|
756
806
|
var i = 0;
|
|
757
807
|
var result = [];
|
|
758
808
|
var key;
|
|
759
|
-
for (key in O) !hasOwn$
|
|
809
|
+
for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
|
|
760
810
|
// Don't enum bug & hidden keys
|
|
761
|
-
while (names.length > i) if (hasOwn$
|
|
811
|
+
while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
|
|
762
812
|
~indexOf(result, key) || push(result, key);
|
|
763
813
|
}
|
|
764
814
|
return result;
|
|
@@ -782,23 +832,23 @@ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
|
782
832
|
|
|
783
833
|
// `Object.getOwnPropertyNames` method
|
|
784
834
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
785
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
835
|
+
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
786
836
|
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
787
837
|
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
788
838
|
};
|
|
789
839
|
|
|
790
840
|
var objectGetOwnPropertySymbols = {};
|
|
791
841
|
|
|
792
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
842
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
793
843
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
794
844
|
|
|
795
845
|
var getBuiltIn$1 = getBuiltIn$4;
|
|
796
|
-
var uncurryThis$
|
|
846
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
797
847
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
798
848
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
799
849
|
var anObject$3 = anObject$5;
|
|
800
850
|
|
|
801
|
-
var concat$1 = uncurryThis$
|
|
851
|
+
var concat$1 = uncurryThis$3([].concat);
|
|
802
852
|
|
|
803
853
|
// all object keys, includes non-enumerable and symbols
|
|
804
854
|
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -807,23 +857,25 @@ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
|
807
857
|
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
808
858
|
};
|
|
809
859
|
|
|
810
|
-
var hasOwn$
|
|
860
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
811
861
|
var ownKeys = ownKeys$1;
|
|
812
862
|
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
813
863
|
var definePropertyModule$2 = objectDefineProperty;
|
|
814
864
|
|
|
815
|
-
var copyConstructorProperties$
|
|
865
|
+
var copyConstructorProperties$2 = function (target, source, exceptions) {
|
|
816
866
|
var keys = ownKeys(source);
|
|
817
867
|
var defineProperty = definePropertyModule$2.f;
|
|
818
868
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
819
869
|
for (var i = 0; i < keys.length; i++) {
|
|
820
870
|
var key = keys[i];
|
|
821
|
-
if (!hasOwn$
|
|
871
|
+
if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
|
|
872
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
873
|
+
}
|
|
822
874
|
}
|
|
823
875
|
};
|
|
824
876
|
|
|
825
|
-
var fails$
|
|
826
|
-
var isCallable$
|
|
877
|
+
var fails$3 = fails$a;
|
|
878
|
+
var isCallable$6 = isCallable$f;
|
|
827
879
|
|
|
828
880
|
var replacement = /#|\.prototype\./;
|
|
829
881
|
|
|
@@ -831,7 +883,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
831
883
|
var value = data[normalize(feature)];
|
|
832
884
|
return value == POLYFILL ? true
|
|
833
885
|
: value == NATIVE ? false
|
|
834
|
-
: isCallable$
|
|
886
|
+
: isCallable$6(detection) ? fails$3(detection)
|
|
835
887
|
: !!detection;
|
|
836
888
|
};
|
|
837
889
|
|
|
@@ -850,7 +902,7 @@ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
|
850
902
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
851
903
|
var redefine$2 = redefine$3.exports;
|
|
852
904
|
var setGlobal = setGlobal$3;
|
|
853
|
-
var copyConstructorProperties = copyConstructorProperties$
|
|
905
|
+
var copyConstructorProperties$1 = copyConstructorProperties$2;
|
|
854
906
|
var isForced = isForced_1;
|
|
855
907
|
|
|
856
908
|
/*
|
|
@@ -890,7 +942,7 @@ var _export = function (options, source) {
|
|
|
890
942
|
// contained in target
|
|
891
943
|
if (!FORCED && targetProperty !== undefined) {
|
|
892
944
|
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
893
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
945
|
+
copyConstructorProperties$1(sourceProperty, targetProperty);
|
|
894
946
|
}
|
|
895
947
|
// add a flag to not completely full polyfills
|
|
896
948
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
@@ -906,35 +958,35 @@ var enumBugKeys$1 = enumBugKeys$3;
|
|
|
906
958
|
|
|
907
959
|
// `Object.keys` method
|
|
908
960
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
909
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
961
|
+
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
910
962
|
var objectKeys$2 = Object.keys || function keys(O) {
|
|
911
963
|
return internalObjectKeys(O, enumBugKeys$1);
|
|
912
964
|
};
|
|
913
965
|
|
|
914
|
-
var DESCRIPTORS$
|
|
915
|
-
var uncurryThis$
|
|
966
|
+
var DESCRIPTORS$3 = descriptors;
|
|
967
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
916
968
|
var call$1 = functionCall;
|
|
917
|
-
var fails$
|
|
969
|
+
var fails$2 = fails$a;
|
|
918
970
|
var objectKeys$1 = objectKeys$2;
|
|
919
971
|
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
920
972
|
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
921
973
|
var toObject$1 = toObject$3;
|
|
922
974
|
var IndexedObject = indexedObject;
|
|
923
975
|
|
|
924
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
976
|
+
// eslint-disable-next-line es-x/no-object-assign -- safe
|
|
925
977
|
var $assign = Object.assign;
|
|
926
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
927
|
-
var defineProperty$
|
|
928
|
-
var concat = uncurryThis$
|
|
978
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
979
|
+
var defineProperty$3 = Object.defineProperty;
|
|
980
|
+
var concat = uncurryThis$2([].concat);
|
|
929
981
|
|
|
930
982
|
// `Object.assign` method
|
|
931
983
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
932
|
-
var objectAssign = !$assign || fails$
|
|
984
|
+
var objectAssign = !$assign || fails$2(function () {
|
|
933
985
|
// should have correct order of operations (Edge bug)
|
|
934
|
-
if (DESCRIPTORS$
|
|
986
|
+
if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
|
|
935
987
|
enumerable: true,
|
|
936
988
|
get: function () {
|
|
937
|
-
defineProperty$
|
|
989
|
+
defineProperty$3(this, 'b', {
|
|
938
990
|
value: 3,
|
|
939
991
|
enumerable: false
|
|
940
992
|
});
|
|
@@ -943,7 +995,7 @@ var objectAssign = !$assign || fails$3(function () {
|
|
|
943
995
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
944
996
|
var A = {};
|
|
945
997
|
var B = {};
|
|
946
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
998
|
+
// eslint-disable-next-line es-x/no-symbol -- safe
|
|
947
999
|
var symbol = Symbol();
|
|
948
1000
|
var alphabet = 'abcdefghijklmnopqrst';
|
|
949
1001
|
A[symbol] = 7;
|
|
@@ -963,7 +1015,7 @@ var objectAssign = !$assign || fails$3(function () {
|
|
|
963
1015
|
var key;
|
|
964
1016
|
while (length > j) {
|
|
965
1017
|
key = keys[j++];
|
|
966
|
-
if (!DESCRIPTORS$
|
|
1018
|
+
if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
967
1019
|
}
|
|
968
1020
|
} return T;
|
|
969
1021
|
} : $assign;
|
|
@@ -973,12 +1025,12 @@ var assign = objectAssign;
|
|
|
973
1025
|
|
|
974
1026
|
// `Object.assign` method
|
|
975
1027
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
976
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1028
|
+
// eslint-disable-next-line es-x/no-object-assign -- required for testing
|
|
977
1029
|
$$2({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
|
978
1030
|
assign: assign
|
|
979
1031
|
});
|
|
980
1032
|
|
|
981
|
-
|
|
1033
|
+
/******************************************************************************
|
|
982
1034
|
Copyright (c) Microsoft Corporation.
|
|
983
1035
|
|
|
984
1036
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1022,7 +1074,7 @@ function Button({
|
|
|
1022
1074
|
if (onClick) props.onClick = onClick;
|
|
1023
1075
|
return jsx("button", Object.assign({}, props, {
|
|
1024
1076
|
children: children
|
|
1025
|
-
})
|
|
1077
|
+
}));
|
|
1026
1078
|
}
|
|
1027
1079
|
|
|
1028
1080
|
const ModalHeader = ({
|
|
@@ -1038,7 +1090,7 @@ const ModalHeader = ({
|
|
|
1038
1090
|
}, {
|
|
1039
1091
|
children: [jsx("h3", {
|
|
1040
1092
|
children: _header
|
|
1041
|
-
}
|
|
1093
|
+
}), jsx("button", Object.assign({
|
|
1042
1094
|
className: "close",
|
|
1043
1095
|
onClick: handleClose
|
|
1044
1096
|
}, {
|
|
@@ -1046,9 +1098,9 @@ const ModalHeader = ({
|
|
|
1046
1098
|
className: "sr-only"
|
|
1047
1099
|
}, {
|
|
1048
1100
|
children: "Close"
|
|
1049
|
-
})
|
|
1050
|
-
})
|
|
1051
|
-
})
|
|
1101
|
+
}))
|
|
1102
|
+
}))]
|
|
1103
|
+
}));
|
|
1052
1104
|
};
|
|
1053
1105
|
|
|
1054
1106
|
const ModalBody = ({
|
|
@@ -1058,7 +1110,7 @@ const ModalBody = ({
|
|
|
1058
1110
|
className: "body"
|
|
1059
1111
|
}, {
|
|
1060
1112
|
children: children
|
|
1061
|
-
})
|
|
1113
|
+
}));
|
|
1062
1114
|
};
|
|
1063
1115
|
|
|
1064
1116
|
const ModalFooter = ({
|
|
@@ -1086,61 +1138,60 @@ const ModalFooter = ({
|
|
|
1086
1138
|
onClick: handleDismiss
|
|
1087
1139
|
}, {
|
|
1088
1140
|
children: dismiss
|
|
1089
|
-
})
|
|
1141
|
+
})), confirm && jsx(Button, Object.assign({
|
|
1090
1142
|
variant: "primary",
|
|
1091
1143
|
onClick: handleConfirm
|
|
1092
1144
|
}, {
|
|
1093
1145
|
children: confirm
|
|
1094
|
-
})
|
|
1095
|
-
})
|
|
1146
|
+
}))]
|
|
1147
|
+
}));
|
|
1096
1148
|
};
|
|
1097
1149
|
|
|
1098
1150
|
const Modal = _a => {
|
|
1099
1151
|
var {
|
|
1100
|
-
type = 'default'
|
|
1152
|
+
type = 'default',
|
|
1153
|
+
isOpen
|
|
1101
1154
|
} = _a,
|
|
1102
|
-
props = __rest(_a, ["type"]);
|
|
1155
|
+
props = __rest(_a, ["type", "isOpen"]);
|
|
1103
1156
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1157
|
+
const modalContent = () => {
|
|
1158
|
+
switch (type) {
|
|
1159
|
+
case 'slideout':
|
|
1160
|
+
{
|
|
1161
|
+
return jsxs("aside", Object.assign({
|
|
1162
|
+
role: "dialog"
|
|
1163
|
+
}, {
|
|
1164
|
+
children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
|
|
1165
|
+
}));
|
|
1166
|
+
}
|
|
1110
1167
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
}
|
|
1168
|
+
case 'takeover':
|
|
1169
|
+
{
|
|
1170
|
+
return jsxs("main", Object.assign({
|
|
1171
|
+
role: "dialog"
|
|
1172
|
+
}, {
|
|
1173
|
+
children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
|
|
1174
|
+
}));
|
|
1175
|
+
}
|
|
1120
1176
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}, {
|
|
1132
|
-
children: [headline && jsx("h2", {
|
|
1133
|
-
children: headline
|
|
1134
|
-
}, void 0), jsx("p", {
|
|
1135
|
-
children: children
|
|
1136
|
-
}, void 0), buttons && jsx("footer", {
|
|
1137
|
-
children: buttons
|
|
1138
|
-
}, void 0)]
|
|
1139
|
-
}), void 0)
|
|
1140
|
-
}), void 0);
|
|
1141
|
-
}
|
|
1177
|
+
default:
|
|
1178
|
+
{
|
|
1179
|
+
return jsxs("section", Object.assign({
|
|
1180
|
+
role: "dialog"
|
|
1181
|
+
}, {
|
|
1182
|
+
children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
|
|
1183
|
+
}));
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
};
|
|
1142
1187
|
|
|
1143
|
-
|
|
1188
|
+
return isOpen ? modalContent() : null;
|
|
1189
|
+
};
|
|
1190
|
+
|
|
1191
|
+
var objectDefineProperties = {};
|
|
1192
|
+
|
|
1193
|
+
var DESCRIPTORS$2 = descriptors;
|
|
1194
|
+
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1144
1195
|
var definePropertyModule$1 = objectDefineProperty;
|
|
1145
1196
|
var anObject$2 = anObject$5;
|
|
1146
1197
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
@@ -1148,8 +1199,8 @@ var objectKeys = objectKeys$2;
|
|
|
1148
1199
|
|
|
1149
1200
|
// `Object.defineProperties` method
|
|
1150
1201
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1151
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1152
|
-
|
|
1202
|
+
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
1203
|
+
objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1153
1204
|
anObject$2(O);
|
|
1154
1205
|
var props = toIndexedObject$1(Properties);
|
|
1155
1206
|
var keys = objectKeys(Properties);
|
|
@@ -1167,7 +1218,7 @@ var html$1 = getBuiltIn('document', 'documentElement');
|
|
|
1167
1218
|
/* global ActiveXObject -- old IE, WSH */
|
|
1168
1219
|
|
|
1169
1220
|
var anObject$1 = anObject$5;
|
|
1170
|
-
var
|
|
1221
|
+
var definePropertiesModule = objectDefineProperties;
|
|
1171
1222
|
var enumBugKeys = enumBugKeys$3;
|
|
1172
1223
|
var hiddenKeys = hiddenKeys$4;
|
|
1173
1224
|
var html = html$1;
|
|
@@ -1236,6 +1287,7 @@ hiddenKeys[IE_PROTO$1] = true;
|
|
|
1236
1287
|
|
|
1237
1288
|
// `Object.create` method
|
|
1238
1289
|
// https://tc39.es/ecma262/#sec-object.create
|
|
1290
|
+
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
1239
1291
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
1240
1292
|
var result;
|
|
1241
1293
|
if (O !== null) {
|
|
@@ -1245,7 +1297,7 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
1245
1297
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1246
1298
|
result[IE_PROTO$1] = O;
|
|
1247
1299
|
} else result = NullProtoObject();
|
|
1248
|
-
return Properties === undefined ? result :
|
|
1300
|
+
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1249
1301
|
};
|
|
1250
1302
|
|
|
1251
1303
|
var wellKnownSymbol$6 = wellKnownSymbol$8;
|
|
@@ -1271,18 +1323,18 @@ var addToUnscopables$1 = function (key) {
|
|
|
1271
1323
|
|
|
1272
1324
|
var iterators = {};
|
|
1273
1325
|
|
|
1274
|
-
var fails$
|
|
1326
|
+
var fails$1 = fails$a;
|
|
1275
1327
|
|
|
1276
|
-
var correctPrototypeGetter = !fails$
|
|
1328
|
+
var correctPrototypeGetter = !fails$1(function () {
|
|
1277
1329
|
function F() { /* empty */ }
|
|
1278
1330
|
F.prototype.constructor = null;
|
|
1279
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1331
|
+
// eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
|
|
1280
1332
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1281
1333
|
});
|
|
1282
1334
|
|
|
1283
1335
|
var global$6 = global$r;
|
|
1284
|
-
var hasOwn$
|
|
1285
|
-
var isCallable$
|
|
1336
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
1337
|
+
var isCallable$5 = isCallable$f;
|
|
1286
1338
|
var toObject = toObject$3;
|
|
1287
1339
|
var sharedKey = sharedKey$3;
|
|
1288
1340
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
@@ -1295,27 +1347,27 @@ var ObjectPrototype = Object$2.prototype;
|
|
|
1295
1347
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1296
1348
|
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
|
|
1297
1349
|
var object = toObject(O);
|
|
1298
|
-
if (hasOwn$
|
|
1350
|
+
if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
|
1299
1351
|
var constructor = object.constructor;
|
|
1300
|
-
if (isCallable$
|
|
1352
|
+
if (isCallable$5(constructor) && object instanceof constructor) {
|
|
1301
1353
|
return constructor.prototype;
|
|
1302
1354
|
} return object instanceof Object$2 ? ObjectPrototype : null;
|
|
1303
1355
|
};
|
|
1304
1356
|
|
|
1305
|
-
var fails
|
|
1306
|
-
var isCallable$
|
|
1357
|
+
var fails = fails$a;
|
|
1358
|
+
var isCallable$4 = isCallable$f;
|
|
1307
1359
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1308
1360
|
var redefine$1 = redefine$3.exports;
|
|
1309
1361
|
var wellKnownSymbol$5 = wellKnownSymbol$8;
|
|
1310
1362
|
|
|
1311
|
-
var ITERATOR$
|
|
1363
|
+
var ITERATOR$2 = wellKnownSymbol$5('iterator');
|
|
1312
1364
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1313
1365
|
|
|
1314
1366
|
// `%IteratorPrototype%` object
|
|
1315
1367
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1316
1368
|
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1317
1369
|
|
|
1318
|
-
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1370
|
+
/* eslint-disable es-x/no-array-prototype-keys -- safe */
|
|
1319
1371
|
if ([].keys) {
|
|
1320
1372
|
arrayIterator = [].keys();
|
|
1321
1373
|
// Safari 8 has buggy iterators w/o `next`
|
|
@@ -1326,18 +1378,18 @@ if ([].keys) {
|
|
|
1326
1378
|
}
|
|
1327
1379
|
}
|
|
1328
1380
|
|
|
1329
|
-
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails
|
|
1381
|
+
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
|
|
1330
1382
|
var test = {};
|
|
1331
1383
|
// FF44- legacy iterators case
|
|
1332
|
-
return IteratorPrototype$2[ITERATOR$
|
|
1384
|
+
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
1333
1385
|
});
|
|
1334
1386
|
|
|
1335
1387
|
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1336
1388
|
|
|
1337
1389
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1338
1390
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1339
|
-
if (!isCallable$
|
|
1340
|
-
redefine$1(IteratorPrototype$2, ITERATOR$
|
|
1391
|
+
if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
|
|
1392
|
+
redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1341
1393
|
return this;
|
|
1342
1394
|
});
|
|
1343
1395
|
}
|
|
@@ -1347,15 +1399,16 @@ var iteratorsCore = {
|
|
|
1347
1399
|
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1348
1400
|
};
|
|
1349
1401
|
|
|
1350
|
-
var defineProperty = objectDefineProperty.f;
|
|
1351
|
-
var hasOwn = hasOwnProperty_1;
|
|
1402
|
+
var defineProperty$2 = objectDefineProperty.f;
|
|
1403
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1352
1404
|
var wellKnownSymbol$4 = wellKnownSymbol$8;
|
|
1353
1405
|
|
|
1354
1406
|
var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
|
|
1355
1407
|
|
|
1356
|
-
var setToStringTag$2 = function (
|
|
1357
|
-
if (
|
|
1358
|
-
|
|
1408
|
+
var setToStringTag$2 = function (target, TAG, STATIC) {
|
|
1409
|
+
if (target && !STATIC) target = target.prototype;
|
|
1410
|
+
if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
|
|
1411
|
+
defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
|
|
1359
1412
|
}
|
|
1360
1413
|
};
|
|
1361
1414
|
|
|
@@ -1367,42 +1420,42 @@ var Iterators$2 = iterators;
|
|
|
1367
1420
|
|
|
1368
1421
|
var returnThis$1 = function () { return this; };
|
|
1369
1422
|
|
|
1370
|
-
var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next) {
|
|
1423
|
+
var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1371
1424
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1372
|
-
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(
|
|
1425
|
+
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1373
1426
|
setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
|
|
1374
1427
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1375
1428
|
return IteratorConstructor;
|
|
1376
1429
|
};
|
|
1377
1430
|
|
|
1378
1431
|
var global$5 = global$r;
|
|
1379
|
-
var isCallable$
|
|
1432
|
+
var isCallable$3 = isCallable$f;
|
|
1380
1433
|
|
|
1381
1434
|
var String$2 = global$5.String;
|
|
1382
1435
|
var TypeError$1 = global$5.TypeError;
|
|
1383
1436
|
|
|
1384
1437
|
var aPossiblePrototype$1 = function (argument) {
|
|
1385
|
-
if (typeof argument == 'object' || isCallable$
|
|
1438
|
+
if (typeof argument == 'object' || isCallable$3(argument)) return argument;
|
|
1386
1439
|
throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
|
|
1387
1440
|
};
|
|
1388
1441
|
|
|
1389
1442
|
/* eslint-disable no-proto -- safe */
|
|
1390
1443
|
|
|
1391
|
-
var uncurryThis$
|
|
1444
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1392
1445
|
var anObject = anObject$5;
|
|
1393
1446
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1394
1447
|
|
|
1395
1448
|
// `Object.setPrototypeOf` method
|
|
1396
1449
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1397
1450
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1398
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1451
|
+
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
1399
1452
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1400
1453
|
var CORRECT_SETTER = false;
|
|
1401
1454
|
var test = {};
|
|
1402
1455
|
var setter;
|
|
1403
1456
|
try {
|
|
1404
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1405
|
-
setter = uncurryThis$
|
|
1457
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
1458
|
+
setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1406
1459
|
setter(test, []);
|
|
1407
1460
|
CORRECT_SETTER = test instanceof Array;
|
|
1408
1461
|
} catch (error) { /* empty */ }
|
|
@@ -1418,7 +1471,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1418
1471
|
var $$1 = _export;
|
|
1419
1472
|
var call = functionCall;
|
|
1420
1473
|
var FunctionName = functionName;
|
|
1421
|
-
var isCallable$
|
|
1474
|
+
var isCallable$2 = isCallable$f;
|
|
1422
1475
|
var createIteratorConstructor = createIteratorConstructor$1;
|
|
1423
1476
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1424
1477
|
var setPrototypeOf = objectSetPrototypeOf;
|
|
@@ -1433,7 +1486,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
|
1433
1486
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1434
1487
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1435
1488
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1436
|
-
var ITERATOR$
|
|
1489
|
+
var ITERATOR$1 = wellKnownSymbol$3('iterator');
|
|
1437
1490
|
var KEYS = 'keys';
|
|
1438
1491
|
var VALUES = 'values';
|
|
1439
1492
|
var ENTRIES = 'entries';
|
|
@@ -1456,7 +1509,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
|
|
|
1456
1509
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1457
1510
|
var INCORRECT_VALUES_NAME = false;
|
|
1458
1511
|
var IterablePrototype = Iterable.prototype;
|
|
1459
|
-
var nativeIterator = IterablePrototype[ITERATOR$
|
|
1512
|
+
var nativeIterator = IterablePrototype[ITERATOR$1]
|
|
1460
1513
|
|| IterablePrototype['@@iterator']
|
|
1461
1514
|
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1462
1515
|
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
@@ -1470,8 +1523,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
|
|
|
1470
1523
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1471
1524
|
if (setPrototypeOf) {
|
|
1472
1525
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1473
|
-
} else if (!isCallable$
|
|
1474
|
-
redefine(CurrentIteratorPrototype, ITERATOR$
|
|
1526
|
+
} else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1527
|
+
redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1475
1528
|
}
|
|
1476
1529
|
}
|
|
1477
1530
|
// Set @@toStringTag to native iterators
|
|
@@ -1504,8 +1557,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
|
|
|
1504
1557
|
}
|
|
1505
1558
|
|
|
1506
1559
|
// define iterator
|
|
1507
|
-
if (IterablePrototype[ITERATOR$
|
|
1508
|
-
redefine(IterablePrototype, ITERATOR$
|
|
1560
|
+
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1561
|
+
redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1509
1562
|
}
|
|
1510
1563
|
Iterators$1[NAME] = defaultIterator;
|
|
1511
1564
|
|
|
@@ -1516,7 +1569,9 @@ var toIndexedObject = toIndexedObject$5;
|
|
|
1516
1569
|
var addToUnscopables = addToUnscopables$1;
|
|
1517
1570
|
var Iterators = iterators;
|
|
1518
1571
|
var InternalStateModule = internalState;
|
|
1572
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
1519
1573
|
var defineIterator = defineIterator$1;
|
|
1574
|
+
var DESCRIPTORS$1 = descriptors;
|
|
1520
1575
|
|
|
1521
1576
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1522
1577
|
var setInternalState = InternalStateModule.set;
|
|
@@ -1558,13 +1613,18 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1558
1613
|
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1559
1614
|
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1560
1615
|
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1561
|
-
Iterators.Arguments = Iterators.Array;
|
|
1616
|
+
var values = Iterators.Arguments = Iterators.Array;
|
|
1562
1617
|
|
|
1563
1618
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1564
1619
|
addToUnscopables('keys');
|
|
1565
1620
|
addToUnscopables('values');
|
|
1566
1621
|
addToUnscopables('entries');
|
|
1567
1622
|
|
|
1623
|
+
// V8 ~ Chrome 45- bug
|
|
1624
|
+
if (DESCRIPTORS$1 && values.name !== 'values') try {
|
|
1625
|
+
defineProperty$1(values, 'name', { value: 'values' });
|
|
1626
|
+
} catch (error) { /* empty */ }
|
|
1627
|
+
|
|
1568
1628
|
// iterable DOM collections
|
|
1569
1629
|
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1570
1630
|
var domIterables = {
|
|
@@ -1616,17 +1676,17 @@ var ArrayIteratorMethods = es_array_iterator;
|
|
|
1616
1676
|
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
1617
1677
|
var wellKnownSymbol$2 = wellKnownSymbol$8;
|
|
1618
1678
|
|
|
1619
|
-
var ITERATOR
|
|
1679
|
+
var ITERATOR = wellKnownSymbol$2('iterator');
|
|
1620
1680
|
var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
|
|
1621
1681
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1622
1682
|
|
|
1623
1683
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1624
1684
|
if (CollectionPrototype) {
|
|
1625
1685
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1626
|
-
if (CollectionPrototype[ITERATOR
|
|
1627
|
-
createNonEnumerableProperty(CollectionPrototype, ITERATOR
|
|
1686
|
+
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
1687
|
+
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
|
1628
1688
|
} catch (error) {
|
|
1629
|
-
CollectionPrototype[ITERATOR
|
|
1689
|
+
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
1630
1690
|
}
|
|
1631
1691
|
if (!CollectionPrototype[TO_STRING_TAG$2]) {
|
|
1632
1692
|
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
|
|
@@ -1648,9 +1708,65 @@ for (var COLLECTION_NAME in DOMIterables) {
|
|
|
1648
1708
|
|
|
1649
1709
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1650
1710
|
|
|
1711
|
+
const Flexbox = _a => {
|
|
1712
|
+
var {
|
|
1713
|
+
alignContent,
|
|
1714
|
+
alignItems,
|
|
1715
|
+
alignSelf,
|
|
1716
|
+
children,
|
|
1717
|
+
justifyContent,
|
|
1718
|
+
flexDirection,
|
|
1719
|
+
flexWrap,
|
|
1720
|
+
className
|
|
1721
|
+
} = _a,
|
|
1722
|
+
props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
|
|
1723
|
+
|
|
1724
|
+
const [classes, setClasses] = useState(['d-flex']);
|
|
1725
|
+
const [flexClassName, setFlexClassName] = useState('d-flex'); // // update className when classes change
|
|
1726
|
+
|
|
1727
|
+
useLayoutEffect(() => {
|
|
1728
|
+
const newClassName = classes.join(' ');
|
|
1729
|
+
if (newClassName !== flexClassName) setFlexClassName(newClassName);
|
|
1730
|
+
}, [classes, flexClassName]); // // update classes when props change
|
|
1731
|
+
|
|
1732
|
+
useLayoutEffect(() => {
|
|
1733
|
+
const newClasses = ['d-flex'];
|
|
1734
|
+
alignItems && newClasses.push(`align-items-${alignItems}`);
|
|
1735
|
+
alignContent && newClasses.push(`align-content-${alignContent}`);
|
|
1736
|
+
alignSelf && newClasses.push(`align-self-${alignSelf}`);
|
|
1737
|
+
justifyContent && newClasses.push(`justify-content-${justifyContent}`);
|
|
1738
|
+
flexDirection && newClasses.push(`flex-${flexDirection}`);
|
|
1739
|
+
flexWrap && newClasses.push(`flex-${flexWrap}`);
|
|
1740
|
+
className && newClasses.push(className);
|
|
1741
|
+
setClasses(newClasses);
|
|
1742
|
+
}, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
|
|
1743
|
+
return jsx("div", Object.assign({
|
|
1744
|
+
className: flexClassName
|
|
1745
|
+
}, props, {
|
|
1746
|
+
children: children
|
|
1747
|
+
}));
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
function Card({
|
|
1751
|
+
children,
|
|
1752
|
+
header,
|
|
1753
|
+
footer
|
|
1754
|
+
}) {
|
|
1755
|
+
return jsxs("section", Object.assign({
|
|
1756
|
+
className: "card"
|
|
1757
|
+
}, {
|
|
1758
|
+
children: [jsx("header", {
|
|
1759
|
+
children: header
|
|
1760
|
+
}), children, jsx("footer", {
|
|
1761
|
+
children: footer
|
|
1762
|
+
})]
|
|
1763
|
+
}));
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1651
1766
|
function Alert({
|
|
1652
1767
|
type,
|
|
1653
|
-
|
|
1768
|
+
header,
|
|
1769
|
+
footer,
|
|
1654
1770
|
children,
|
|
1655
1771
|
closeText,
|
|
1656
1772
|
isCloseable = true
|
|
@@ -1660,23 +1776,33 @@ function Alert({
|
|
|
1660
1776
|
if (!isCloseable) {
|
|
1661
1777
|
setCloseButton(null);
|
|
1662
1778
|
} else {
|
|
1663
|
-
if (closeText) setCloseButton(jsx(Button, {
|
|
1664
|
-
|
|
1665
|
-
},
|
|
1779
|
+
if (closeText) setCloseButton(jsx(Button, Object.assign({
|
|
1780
|
+
variant: "ghost"
|
|
1781
|
+
}, {
|
|
1782
|
+
children: jsx("span", Object.assign({
|
|
1783
|
+
className: "sr-only"
|
|
1784
|
+
}, {
|
|
1785
|
+
children: closeText
|
|
1786
|
+
}))
|
|
1787
|
+
})));else setCloseButton(jsx("button", {
|
|
1666
1788
|
className: "close"
|
|
1667
|
-
}
|
|
1789
|
+
}));
|
|
1668
1790
|
}
|
|
1669
1791
|
}, [isCloseable, closeText]);
|
|
1670
1792
|
return jsxs("div", Object.assign({
|
|
1671
1793
|
role: "alert",
|
|
1672
1794
|
className: type
|
|
1673
1795
|
}, {
|
|
1674
|
-
children: [
|
|
1675
|
-
children:
|
|
1676
|
-
|
|
1796
|
+
children: [header && jsxs("header", {
|
|
1797
|
+
children: [/*#__PURE__*/React.isValidElement(header) ? header : jsx("h3", {
|
|
1798
|
+
children: header
|
|
1799
|
+
}), closeButton]
|
|
1800
|
+
}), jsx("p", {
|
|
1677
1801
|
children: children
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1802
|
+
}), footer && jsx("footer", {
|
|
1803
|
+
children: footer
|
|
1804
|
+
})]
|
|
1805
|
+
}));
|
|
1680
1806
|
}
|
|
1681
1807
|
|
|
1682
1808
|
const ButtonGroup = ({
|
|
@@ -1704,149 +1830,220 @@ const ButtonGroup = ({
|
|
|
1704
1830
|
}, [children, selected, variant]);
|
|
1705
1831
|
return jsx(Group, {
|
|
1706
1832
|
children: buttons.map(props => jsx(Button, Object.assign({}, props), props.key))
|
|
1707
|
-
}
|
|
1833
|
+
});
|
|
1708
1834
|
};
|
|
1709
1835
|
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
-
return jsx("form", Object.assign({
|
|
1716
|
-
className: [direction, `size-${size}`].join(' ')
|
|
1717
|
-
}, {
|
|
1718
|
-
children: children
|
|
1719
|
-
}), void 0);
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
var wellKnownSymbol$1 = wellKnownSymbol$8;
|
|
1723
|
-
|
|
1724
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
|
|
1725
|
-
var test = {};
|
|
1726
|
-
|
|
1727
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1728
|
-
|
|
1729
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1836
|
+
const validateInputValue = (target, rules, setError) => {
|
|
1837
|
+
const errorMessage = validateInputValueErrors(rules, target);
|
|
1838
|
+
errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
|
|
1839
|
+
return errorMessage;
|
|
1840
|
+
};
|
|
1730
1841
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
var wellKnownSymbol = wellKnownSymbol$8;
|
|
1842
|
+
const validateInputValueErrors = (rules, target) => {
|
|
1843
|
+
const {
|
|
1844
|
+
value
|
|
1845
|
+
} = target;
|
|
1736
1846
|
|
|
1737
|
-
|
|
1738
|
-
|
|
1847
|
+
if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
|
|
1848
|
+
return rules === null || rules === void 0 ? void 0 : rules.custom();
|
|
1849
|
+
}
|
|
1739
1850
|
|
|
1740
|
-
|
|
1741
|
-
|
|
1851
|
+
return validateTextInputValues(value, rules);
|
|
1852
|
+
};
|
|
1742
1853
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1854
|
+
const setErrorInsert = (setError, name) => {
|
|
1855
|
+
setError(errors => {
|
|
1856
|
+
return Object.assign(Object.assign({}, errors), {
|
|
1857
|
+
[name]: true
|
|
1858
|
+
});
|
|
1859
|
+
});
|
|
1748
1860
|
};
|
|
1749
1861
|
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
// builtinTag case
|
|
1757
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1758
|
-
// ES3 arguments fallback
|
|
1759
|
-
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1862
|
+
const setErrorRemove = (setError, name) => {
|
|
1863
|
+
setError(errors => {
|
|
1864
|
+
const newError = Object.assign({}, errors);
|
|
1865
|
+
delete newError[name];
|
|
1866
|
+
return newError;
|
|
1867
|
+
});
|
|
1760
1868
|
};
|
|
1761
1869
|
|
|
1762
|
-
|
|
1763
|
-
|
|
1870
|
+
const validateTextInputValues = (value, rules) => {
|
|
1871
|
+
switch (rules === null || rules === void 0 ? void 0 : rules.type) {
|
|
1872
|
+
case 'Required':
|
|
1873
|
+
{
|
|
1874
|
+
return value === '' || value === undefined || value === null ? 'error' : null;
|
|
1875
|
+
}
|
|
1764
1876
|
|
|
1765
|
-
|
|
1877
|
+
default:
|
|
1878
|
+
{
|
|
1879
|
+
return;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1766
1883
|
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
return
|
|
1884
|
+
const FormContext = /*#__PURE__*/React.createContext({});
|
|
1885
|
+
const useFormContext = () => {
|
|
1886
|
+
return React.useContext(FormContext);
|
|
1770
1887
|
};
|
|
1888
|
+
const FormProvider = _a => {
|
|
1889
|
+
var {
|
|
1890
|
+
children,
|
|
1891
|
+
direction = 'vertical',
|
|
1892
|
+
formSize = 'md',
|
|
1893
|
+
onSubmit,
|
|
1894
|
+
onFormSubmit
|
|
1895
|
+
} = _a,
|
|
1896
|
+
props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
|
|
1897
|
+
|
|
1898
|
+
const [values, setValues] = React.useState();
|
|
1899
|
+
const [errors, setErrors] = React.useState();
|
|
1900
|
+
const [fields, setFields] = React.useState({});
|
|
1901
|
+
|
|
1902
|
+
const formSubmit = event => {
|
|
1903
|
+
let hasError = false;
|
|
1904
|
+
event.preventDefault();
|
|
1905
|
+
Object.keys(fields).forEach(key => {
|
|
1906
|
+
const errorMessage = validateInputValue({
|
|
1907
|
+
name: key,
|
|
1908
|
+
value: values === null || values === void 0 ? void 0 : values[key]
|
|
1909
|
+
}, fields[key], setErrors);
|
|
1910
|
+
hasError = hasError || !!errorMessage;
|
|
1911
|
+
});
|
|
1771
1912
|
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1913
|
+
if (!hasError) {
|
|
1914
|
+
onFormSubmit && onFormSubmit(values);
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1775
1917
|
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
var whitespaces$1 = whitespaces$2;
|
|
1780
|
-
|
|
1781
|
-
var replace = uncurryThis$1(''.replace);
|
|
1782
|
-
var whitespace = '[' + whitespaces$1 + ']';
|
|
1783
|
-
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
1784
|
-
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
1785
|
-
|
|
1786
|
-
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
1787
|
-
var createMethod = function (TYPE) {
|
|
1788
|
-
return function ($this) {
|
|
1789
|
-
var string = toString$1(requireObjectCoercible($this));
|
|
1790
|
-
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
1791
|
-
if (TYPE & 2) string = replace(string, rtrim, '');
|
|
1792
|
-
return string;
|
|
1918
|
+
const resetForm = () => {
|
|
1919
|
+
setValues({});
|
|
1920
|
+
setErrors({});
|
|
1793
1921
|
};
|
|
1922
|
+
|
|
1923
|
+
return jsx(FormContext.Provider, Object.assign({
|
|
1924
|
+
value: {
|
|
1925
|
+
setValues,
|
|
1926
|
+
setErrors,
|
|
1927
|
+
setFields,
|
|
1928
|
+
errors,
|
|
1929
|
+
values
|
|
1930
|
+
}
|
|
1931
|
+
}, {
|
|
1932
|
+
children: jsx("form", Object.assign({
|
|
1933
|
+
className: [direction, `size-${formSize}`].join(' '),
|
|
1934
|
+
onSubmit: formSubmit
|
|
1935
|
+
}, props, {
|
|
1936
|
+
onReset: resetForm
|
|
1937
|
+
}, {
|
|
1938
|
+
children: children
|
|
1939
|
+
}))
|
|
1940
|
+
}));
|
|
1794
1941
|
};
|
|
1795
1942
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
1799
|
-
start: createMethod(1),
|
|
1800
|
-
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
1801
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
1802
|
-
end: createMethod(2),
|
|
1803
|
-
// `String.prototype.trim` method
|
|
1804
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1805
|
-
trim: createMethod(3)
|
|
1943
|
+
const Form = props => {
|
|
1944
|
+
return jsx(FormProvider, Object.assign({}, props));
|
|
1806
1945
|
};
|
|
1807
1946
|
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
} : $parseInt$1;
|
|
1947
|
+
const FormItems = ({
|
|
1948
|
+
children,
|
|
1949
|
+
validate,
|
|
1950
|
+
name
|
|
1951
|
+
}) => {
|
|
1952
|
+
const {
|
|
1953
|
+
setValues,
|
|
1954
|
+
setErrors,
|
|
1955
|
+
setFields,
|
|
1956
|
+
errors
|
|
1957
|
+
} = useFormContext();
|
|
1958
|
+
React.useEffect(() => {
|
|
1959
|
+
setFields(fields => Object.assign(Object.assign({}, fields), {
|
|
1960
|
+
[name]: validate === null || validate === void 0 ? void 0 : validate.rules
|
|
1961
|
+
}));
|
|
1962
|
+
|
|
1963
|
+
const removeValues = values => {
|
|
1964
|
+
const newValues = Object.assign({}, values);
|
|
1965
|
+
delete newValues[name];
|
|
1966
|
+
return newValues;
|
|
1967
|
+
};
|
|
1830
1968
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1969
|
+
return () => {
|
|
1970
|
+
setFields(fields => removeValues(fields));
|
|
1971
|
+
setValues(values => removeValues(values));
|
|
1972
|
+
setErrors(errors => removeValues(errors));
|
|
1973
|
+
};
|
|
1974
|
+
}, []);
|
|
1833
1975
|
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1976
|
+
const onChange = event => {
|
|
1977
|
+
if (!event.target) return;
|
|
1978
|
+
const {
|
|
1979
|
+
value,
|
|
1980
|
+
name,
|
|
1981
|
+
type,
|
|
1982
|
+
checked
|
|
1983
|
+
} = event.target;
|
|
1984
|
+
let inputValue;
|
|
1985
|
+
|
|
1986
|
+
if (type === 'checkbox') {
|
|
1987
|
+
inputValue = checked ? value : null;
|
|
1988
|
+
checked ? setValues(values => Object.assign(Object.assign({}, values), {
|
|
1989
|
+
[name]: value
|
|
1990
|
+
})) : setValues(values => Object.assign(Object.assign({}, values), {
|
|
1991
|
+
[name]: null
|
|
1992
|
+
}));
|
|
1993
|
+
} else {
|
|
1994
|
+
inputValue = value;
|
|
1995
|
+
setValues(values => Object.assign(Object.assign({}, values), {
|
|
1996
|
+
[name]: value
|
|
1997
|
+
}));
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
validateInputValue({
|
|
2001
|
+
value: inputValue,
|
|
2002
|
+
name,
|
|
2003
|
+
type,
|
|
2004
|
+
checked
|
|
2005
|
+
}, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
return /*#__PURE__*/React.cloneElement(children, {
|
|
2009
|
+
validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
|
|
2010
|
+
name,
|
|
2011
|
+
onChange
|
|
2012
|
+
});
|
|
2013
|
+
};
|
|
1839
2014
|
|
|
1840
|
-
|
|
2015
|
+
function Group({
|
|
2016
|
+
children,
|
|
2017
|
+
error,
|
|
2018
|
+
groupBorder = false
|
|
2019
|
+
}) {
|
|
2020
|
+
const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
|
|
2021
|
+
const errorMessage = error ? error.message || error : '';
|
|
2022
|
+
return jsxs("div", Object.assign({
|
|
2023
|
+
className: "form-group"
|
|
2024
|
+
}, {
|
|
2025
|
+
children: [jsx("div", Object.assign({
|
|
2026
|
+
className: groupClassName
|
|
2027
|
+
}, {
|
|
2028
|
+
children: children
|
|
2029
|
+
})), error && jsx("span", Object.assign({
|
|
2030
|
+
className: "form-info"
|
|
2031
|
+
}, {
|
|
2032
|
+
children: errorMessage
|
|
2033
|
+
}))]
|
|
2034
|
+
}));
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
const useInput = (props, onChanges, onChangeInput) => {
|
|
1841
2038
|
const id = useMemo(() => props.id || randomId(), [props.id]);
|
|
1842
2039
|
const ref = useRef(null);
|
|
1843
|
-
const [value, setValue] = useState(props.value);
|
|
1844
|
-
const [checked, setChecked] = useState(props.checked);
|
|
2040
|
+
const [value, setValue] = useState(props.value ? props.value : '');
|
|
2041
|
+
const [checked, setChecked] = useState(props.checked ? props.checked : false);
|
|
1845
2042
|
useEffect(() => {
|
|
1846
2043
|
if (ref.current && ref.current.form) {
|
|
1847
2044
|
const resetListener = () => {
|
|
1848
|
-
setValue(props.value);
|
|
1849
|
-
setChecked(props.checked);
|
|
2045
|
+
setValue(props.value ? props.value : '');
|
|
2046
|
+
setChecked(props.checked ? props.checked : false);
|
|
1850
2047
|
};
|
|
1851
2048
|
|
|
1852
2049
|
const form = ref.current.form;
|
|
@@ -1860,8 +2057,9 @@ const useInput = (props, evaluator, notify) => {
|
|
|
1860
2057
|
|
|
1861
2058
|
const onChange = event => {
|
|
1862
2059
|
setValue(event.target.value);
|
|
1863
|
-
setChecked(event.
|
|
1864
|
-
|
|
2060
|
+
setChecked(event.currentTarget.checked);
|
|
2061
|
+
onChanges && onChanges(event);
|
|
2062
|
+
onChangeInput && onChangeInput(event.target.value);
|
|
1865
2063
|
};
|
|
1866
2064
|
|
|
1867
2065
|
return Object.assign(Object.assign({}, props), {
|
|
@@ -1873,8 +2071,8 @@ const useInput = (props, evaluator, notify) => {
|
|
|
1873
2071
|
});
|
|
1874
2072
|
};
|
|
1875
2073
|
|
|
1876
|
-
const RenderInput = (type, props,
|
|
1877
|
-
const _a = useInput(props,
|
|
2074
|
+
const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
|
|
2075
|
+
const _a = useInput(props, onChange, onChangeInput),
|
|
1878
2076
|
{
|
|
1879
2077
|
value
|
|
1880
2078
|
} = _a,
|
|
@@ -1882,72 +2080,817 @@ const RenderInput = (type, props, evaluator, label, info, listener) => {
|
|
|
1882
2080
|
|
|
1883
2081
|
const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
|
|
1884
2082
|
'aria-describedby': `${inputProps.id}_info`
|
|
1885
|
-
}) : inputProps;
|
|
2083
|
+
}) : inputProps; // Render naked
|
|
2084
|
+
|
|
2085
|
+
if (!label && !info) return jsx("input", Object.assign({
|
|
2086
|
+
type: type,
|
|
2087
|
+
value: value
|
|
2088
|
+
}, propsWithDescription));
|
|
1886
2089
|
return jsxs("div", Object.assign({
|
|
1887
|
-
className: "form-
|
|
2090
|
+
className: "form-group"
|
|
1888
2091
|
}, {
|
|
1889
2092
|
children: [label && jsx("label", Object.assign({
|
|
1890
2093
|
htmlFor: inputProps.id
|
|
1891
2094
|
}, {
|
|
1892
2095
|
children: label
|
|
1893
|
-
})
|
|
2096
|
+
})), info && jsx("span", Object.assign({
|
|
1894
2097
|
className: "form-info",
|
|
1895
|
-
id:
|
|
2098
|
+
id: `${inputProps.id}_info`
|
|
1896
2099
|
}, {
|
|
1897
2100
|
children: info
|
|
1898
|
-
})
|
|
2101
|
+
})), jsx("input", Object.assign({
|
|
1899
2102
|
type: type,
|
|
1900
2103
|
value: value
|
|
1901
|
-
}, propsWithDescription
|
|
1902
|
-
|
|
2104
|
+
}, propsWithDescription, {
|
|
2105
|
+
className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
|
|
2106
|
+
})), validator && jsx("span", Object.assign({
|
|
2107
|
+
className: "form-info"
|
|
2108
|
+
}, {
|
|
2109
|
+
children: validator.message
|
|
2110
|
+
}))]
|
|
2111
|
+
}));
|
|
1903
2112
|
};
|
|
1904
|
-
|
|
1905
2113
|
const TextInput = _a => {
|
|
1906
2114
|
var {
|
|
1907
2115
|
label,
|
|
1908
2116
|
info,
|
|
1909
|
-
|
|
2117
|
+
onChange,
|
|
2118
|
+
onChangeInput,
|
|
2119
|
+
validator
|
|
1910
2120
|
} = _a,
|
|
1911
|
-
props = __rest(_a, ["label", "info", "
|
|
2121
|
+
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
|
|
1912
2122
|
|
|
1913
|
-
return RenderInput('text', props,
|
|
2123
|
+
return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
|
|
1914
2124
|
};
|
|
1915
2125
|
const EmailInput = _a => {
|
|
1916
2126
|
var {
|
|
1917
2127
|
label,
|
|
1918
2128
|
info,
|
|
1919
|
-
|
|
2129
|
+
onChange,
|
|
2130
|
+
onChangeInput,
|
|
2131
|
+
validator
|
|
1920
2132
|
} = _a,
|
|
1921
|
-
props = __rest(_a, ["label", "info", "
|
|
2133
|
+
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
|
|
1922
2134
|
|
|
1923
|
-
return RenderInput('email', props,
|
|
2135
|
+
return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
|
|
1924
2136
|
};
|
|
1925
2137
|
const NumberInput = _a => {
|
|
1926
2138
|
var {
|
|
1927
2139
|
label,
|
|
1928
2140
|
info,
|
|
1929
|
-
|
|
2141
|
+
onChange,
|
|
2142
|
+
onChangeInput,
|
|
2143
|
+
validator
|
|
1930
2144
|
} = _a,
|
|
1931
|
-
props = __rest(_a, ["label", "info", "
|
|
2145
|
+
props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
|
|
1932
2146
|
|
|
1933
|
-
return RenderInput('number', props,
|
|
2147
|
+
return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
|
|
1934
2148
|
};
|
|
1935
2149
|
const Checkbox = _a => {
|
|
1936
2150
|
var {
|
|
1937
2151
|
label,
|
|
1938
|
-
|
|
2152
|
+
onChange,
|
|
2153
|
+
validator
|
|
1939
2154
|
} = _a,
|
|
1940
|
-
props = __rest(_a, ["label", "
|
|
2155
|
+
props = __rest(_a, ["label", "onChange", "validator"]);
|
|
2156
|
+
|
|
2157
|
+
const inputProps = useInput(props, onChange);
|
|
2158
|
+
const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
|
|
2159
|
+
return jsxs(Fragment, {
|
|
2160
|
+
children: [jsxs("label", Object.assign({
|
|
2161
|
+
htmlFor: inputProps.id,
|
|
2162
|
+
className: `form-control ${validatorClassName}`
|
|
2163
|
+
}, {
|
|
2164
|
+
children: [label, jsx("input", Object.assign({
|
|
2165
|
+
type: "checkbox"
|
|
2166
|
+
}, inputProps)), jsx("span", {}), jsx("i", {})]
|
|
2167
|
+
})), validator && jsx("span", Object.assign({
|
|
2168
|
+
className: "form-info"
|
|
2169
|
+
}, {
|
|
2170
|
+
children: validator.message
|
|
2171
|
+
}))]
|
|
2172
|
+
});
|
|
2173
|
+
};
|
|
2174
|
+
const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
2175
|
+
var {
|
|
2176
|
+
label,
|
|
2177
|
+
validator
|
|
2178
|
+
} = _a,
|
|
2179
|
+
props = __rest(_a, ["label", "validator"]);
|
|
1941
2180
|
|
|
1942
|
-
const
|
|
2181
|
+
const {
|
|
2182
|
+
id
|
|
2183
|
+
} = useInput(props);
|
|
1943
2184
|
return jsxs("label", Object.assign({
|
|
1944
|
-
htmlFor:
|
|
2185
|
+
htmlFor: id,
|
|
1945
2186
|
className: "form-control"
|
|
1946
2187
|
}, {
|
|
1947
|
-
children: [
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2188
|
+
children: [jsx("input", Object.assign({
|
|
2189
|
+
id: id,
|
|
2190
|
+
type: "radio"
|
|
2191
|
+
}, props, {
|
|
2192
|
+
className: validator,
|
|
2193
|
+
ref: ref
|
|
2194
|
+
})), jsx("span", {
|
|
2195
|
+
children: label
|
|
2196
|
+
}), jsx("i", {})]
|
|
2197
|
+
}));
|
|
2198
|
+
});
|
|
2199
|
+
|
|
2200
|
+
const Text = ({
|
|
2201
|
+
children
|
|
2202
|
+
}) => jsx("span", Object.assign({
|
|
2203
|
+
className: "form-text"
|
|
2204
|
+
}, {
|
|
2205
|
+
children: children
|
|
2206
|
+
}));
|
|
2207
|
+
|
|
2208
|
+
var wellKnownSymbol$1 = wellKnownSymbol$8;
|
|
2209
|
+
|
|
2210
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
|
|
2211
|
+
var test = {};
|
|
2212
|
+
|
|
2213
|
+
test[TO_STRING_TAG$1] = 'z';
|
|
2214
|
+
|
|
2215
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
2216
|
+
|
|
2217
|
+
var global$3 = global$r;
|
|
2218
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
2219
|
+
var isCallable$1 = isCallable$f;
|
|
2220
|
+
var classofRaw = classofRaw$1;
|
|
2221
|
+
var wellKnownSymbol = wellKnownSymbol$8;
|
|
2222
|
+
|
|
2223
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
2224
|
+
var Object$1 = global$3.Object;
|
|
2225
|
+
|
|
2226
|
+
// ES3 wrong here
|
|
2227
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
2228
|
+
|
|
2229
|
+
// fallback for IE11 Script Access Denied error
|
|
2230
|
+
var tryGet = function (it, key) {
|
|
2231
|
+
try {
|
|
2232
|
+
return it[key];
|
|
2233
|
+
} catch (error) { /* empty */ }
|
|
2234
|
+
};
|
|
2235
|
+
|
|
2236
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
2237
|
+
var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
2238
|
+
var O, tag, result;
|
|
2239
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
2240
|
+
// @@toStringTag case
|
|
2241
|
+
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
|
|
2242
|
+
// builtinTag case
|
|
2243
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
2244
|
+
// ES3 arguments fallback
|
|
2245
|
+
: (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
|
2246
|
+
};
|
|
2247
|
+
|
|
2248
|
+
var global$2 = global$r;
|
|
2249
|
+
var classof = classof$1;
|
|
2250
|
+
|
|
2251
|
+
var String$1 = global$2.String;
|
|
2252
|
+
|
|
2253
|
+
var toString$1 = function (argument) {
|
|
2254
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
2255
|
+
return String$1(argument);
|
|
2256
|
+
};
|
|
2257
|
+
|
|
2258
|
+
var $ = _export;
|
|
2259
|
+
var DESCRIPTORS = descriptors;
|
|
2260
|
+
var global$1 = global$r;
|
|
2261
|
+
var uncurryThis = functionUncurryThis;
|
|
2262
|
+
var hasOwn = hasOwnProperty_1;
|
|
2263
|
+
var isCallable = isCallable$f;
|
|
2264
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
2265
|
+
var toString = toString$1;
|
|
2266
|
+
var defineProperty = objectDefineProperty.f;
|
|
2267
|
+
var copyConstructorProperties = copyConstructorProperties$2;
|
|
2268
|
+
|
|
2269
|
+
var NativeSymbol = global$1.Symbol;
|
|
2270
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
2271
|
+
|
|
2272
|
+
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
2273
|
+
// Safari 12 bug
|
|
2274
|
+
NativeSymbol().description !== undefined
|
|
2275
|
+
)) {
|
|
2276
|
+
var EmptyStringDescriptionStore = {};
|
|
2277
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
2278
|
+
var SymbolWrapper = function Symbol() {
|
|
2279
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
2280
|
+
var result = isPrototypeOf(SymbolPrototype, this)
|
|
2281
|
+
? new NativeSymbol(description)
|
|
2282
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
2283
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
2284
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
2285
|
+
return result;
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
2289
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
2290
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
2291
|
+
|
|
2292
|
+
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
2293
|
+
var symbolToString = uncurryThis(SymbolPrototype.toString);
|
|
2294
|
+
var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
|
|
2295
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
2296
|
+
var replace = uncurryThis(''.replace);
|
|
2297
|
+
var stringSlice = uncurryThis(''.slice);
|
|
2298
|
+
|
|
2299
|
+
defineProperty(SymbolPrototype, 'description', {
|
|
2300
|
+
configurable: true,
|
|
2301
|
+
get: function description() {
|
|
2302
|
+
var symbol = symbolValueOf(this);
|
|
2303
|
+
var string = symbolToString(symbol);
|
|
2304
|
+
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
2305
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
2306
|
+
return desc === '' ? undefined : desc;
|
|
2307
|
+
}
|
|
2308
|
+
});
|
|
2309
|
+
|
|
2310
|
+
$({ global: true, forced: true }, {
|
|
2311
|
+
Symbol: SymbolWrapper
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
const RadioGroup = ({
|
|
2316
|
+
defaultSelected,
|
|
2317
|
+
description,
|
|
2318
|
+
title,
|
|
2319
|
+
validator,
|
|
2320
|
+
onChangeRadio,
|
|
2321
|
+
onChange,
|
|
2322
|
+
name,
|
|
2323
|
+
children
|
|
2324
|
+
}) => {
|
|
2325
|
+
const [checked, setChecked] = React.useState();
|
|
2326
|
+
const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
|
|
2327
|
+
|
|
2328
|
+
const onChanges = event => {
|
|
2329
|
+
setChecked(event.target.value);
|
|
2330
|
+
onChangeRadio && onChangeRadio(event.target.value);
|
|
2331
|
+
onChange && onChange(event);
|
|
2332
|
+
};
|
|
2333
|
+
|
|
2334
|
+
const radioBtnRef = React.useRef(null);
|
|
2335
|
+
React.useEffect(() => {
|
|
2336
|
+
var _a;
|
|
2337
|
+
|
|
2338
|
+
if (radioBtnRef && radioBtnRef.current) {
|
|
2339
|
+
if (defaultSelected) setChecked(defaultSelected);
|
|
2340
|
+
const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
|
|
2341
|
+
|
|
2342
|
+
const resetListner = () => {
|
|
2343
|
+
setChecked(undefined);
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2346
|
+
form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
|
|
2347
|
+
return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
|
|
2348
|
+
} else {
|
|
2349
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2350
|
+
return () => {};
|
|
2351
|
+
}
|
|
2352
|
+
}, []);
|
|
2353
|
+
return jsxs("div", Object.assign({
|
|
2354
|
+
className: "form-group"
|
|
2355
|
+
}, {
|
|
2356
|
+
children: [jsxs("fieldset", Object.assign({
|
|
2357
|
+
className: validatorClassName
|
|
2358
|
+
}, {
|
|
2359
|
+
children: [jsx("legend", {
|
|
2360
|
+
children: title
|
|
2361
|
+
}), jsx("span", Object.assign({
|
|
2362
|
+
className: "form-info"
|
|
2363
|
+
}, {
|
|
2364
|
+
children: description
|
|
2365
|
+
})), React.Children.map(children, Child => {
|
|
2366
|
+
return /*#__PURE__*/React.isValidElement(Child) ? /*#__PURE__*/React.cloneElement(Child, {
|
|
2367
|
+
validator: validatorClassName,
|
|
2368
|
+
onChange: onChanges,
|
|
2369
|
+
checked: checked === Child.props.value,
|
|
2370
|
+
name,
|
|
2371
|
+
ref: radioBtnRef
|
|
2372
|
+
}) : Child;
|
|
2373
|
+
})]
|
|
2374
|
+
})), (validator === null || validator === void 0 ? void 0 : validator.message) && jsx("span", Object.assign({
|
|
2375
|
+
className: "form-info"
|
|
2376
|
+
}, {
|
|
2377
|
+
children: validator === null || validator === void 0 ? void 0 : validator.message
|
|
2378
|
+
}))]
|
|
2379
|
+
}));
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
const ListItem = _a => {
|
|
2383
|
+
var {
|
|
2384
|
+
listType,
|
|
2385
|
+
tableRowData,
|
|
2386
|
+
children
|
|
2387
|
+
} = _a,
|
|
2388
|
+
props = __rest(_a, ["listType", "tableRowData", "children"]);
|
|
2389
|
+
|
|
2390
|
+
if (listType === 'table') {
|
|
2391
|
+
return jsx("dl", {
|
|
2392
|
+
children: jsxs("div", {
|
|
2393
|
+
children: [jsx("dt", {
|
|
2394
|
+
children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
|
|
2395
|
+
}), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsx("dd", {
|
|
2396
|
+
children: item
|
|
2397
|
+
}, index))]
|
|
2398
|
+
})
|
|
2399
|
+
});
|
|
2400
|
+
} else {
|
|
2401
|
+
return jsx("li", Object.assign({}, props, {
|
|
2402
|
+
children: children
|
|
2403
|
+
}));
|
|
2404
|
+
}
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
const List = _a => {
|
|
2408
|
+
var {
|
|
2409
|
+
listType,
|
|
2410
|
+
tableCaption,
|
|
2411
|
+
tableData,
|
|
2412
|
+
children
|
|
2413
|
+
} = _a,
|
|
2414
|
+
props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
|
|
2415
|
+
|
|
2416
|
+
if (listType === 'ordered') {
|
|
2417
|
+
return jsx("ol", Object.assign({}, props, {
|
|
2418
|
+
children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
|
|
2419
|
+
children: child
|
|
2420
|
+
}, index))
|
|
2421
|
+
}));
|
|
2422
|
+
} else if (listType !== 'table') {
|
|
2423
|
+
return jsx("ul", Object.assign({}, props, {
|
|
2424
|
+
className: listType
|
|
2425
|
+
}, {
|
|
2426
|
+
children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
|
|
2427
|
+
children: child
|
|
2428
|
+
}, index))
|
|
2429
|
+
}));
|
|
2430
|
+
} else {
|
|
2431
|
+
return jsxs("figure", {
|
|
2432
|
+
children: [jsx("figcaption", Object.assign({
|
|
2433
|
+
className: "table-list-caption"
|
|
2434
|
+
}, {
|
|
2435
|
+
children: tableCaption
|
|
2436
|
+
})), jsx("dl", {
|
|
2437
|
+
children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem, {
|
|
2438
|
+
listType: listType,
|
|
2439
|
+
tableRowData: data
|
|
2440
|
+
}, index))
|
|
2441
|
+
})]
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
|
|
2446
|
+
const Link = _a => {
|
|
2447
|
+
var {
|
|
2448
|
+
button,
|
|
2449
|
+
children
|
|
2450
|
+
} = _a,
|
|
2451
|
+
props = __rest(_a, ["button", "children"]);
|
|
2452
|
+
|
|
2453
|
+
const [anchorProps, setAnchorProps] = useState({});
|
|
2454
|
+
useEffect(() => {
|
|
2455
|
+
const className = button ? typeof button === 'string' ? `button ${button}` : 'button' : undefined;
|
|
2456
|
+
const newProps = Object.assign({
|
|
2457
|
+
role: button ? 'button' : undefined,
|
|
2458
|
+
className: className
|
|
2459
|
+
}, props);
|
|
2460
|
+
setAnchorProps(newProps);
|
|
2461
|
+
}, [button]);
|
|
2462
|
+
return jsx("a", Object.assign({}, anchorProps, {
|
|
2463
|
+
children: children
|
|
2464
|
+
}));
|
|
2465
|
+
};
|
|
2466
|
+
|
|
2467
|
+
const Navbar = ({
|
|
2468
|
+
children,
|
|
2469
|
+
variant,
|
|
2470
|
+
title,
|
|
2471
|
+
titleLink,
|
|
2472
|
+
brandLink: _brandLink = 'https://www.seb.se',
|
|
2473
|
+
brandAriaLabel: _brandAriaLabel = 'Open seb.se in new tab'
|
|
2474
|
+
}) => {
|
|
2475
|
+
const [props, setProps] = useState({});
|
|
2476
|
+
useEffect(() => {
|
|
2477
|
+
const classNames = [];
|
|
2478
|
+
if (variant) classNames.push(variant);
|
|
2479
|
+
setProps(Object.assign(Object.assign({}, props), {
|
|
2480
|
+
className: classNames.join(' ')
|
|
2481
|
+
})); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2482
|
+
}, [variant]);
|
|
2483
|
+
return jsxs("nav", Object.assign({
|
|
2484
|
+
role: "navigation"
|
|
2485
|
+
}, props, {
|
|
2486
|
+
children: [jsx(Link, {
|
|
2487
|
+
"aria-label": _brandAriaLabel,
|
|
2488
|
+
href: _brandLink,
|
|
2489
|
+
target: "_blank",
|
|
2490
|
+
className: "brand"
|
|
2491
|
+
}), jsx("div", Object.assign({
|
|
2492
|
+
className: "container-fluid"
|
|
2493
|
+
}, {
|
|
2494
|
+
children: jsxs("div", Object.assign({
|
|
2495
|
+
className: "row justify-content-between align-items-center"
|
|
2496
|
+
}, {
|
|
2497
|
+
children: [jsx("div", Object.assign({
|
|
2498
|
+
className: "col-auto"
|
|
2499
|
+
}, {
|
|
2500
|
+
children: titleLink ? jsx(Link, Object.assign({
|
|
2501
|
+
className: "mx-4",
|
|
2502
|
+
href: titleLink
|
|
2503
|
+
}, {
|
|
2504
|
+
children: jsx("h1", {
|
|
2505
|
+
children: title
|
|
2506
|
+
})
|
|
2507
|
+
})) : jsx("h1", {
|
|
2508
|
+
children: title
|
|
2509
|
+
})
|
|
2510
|
+
})), jsx("div", Object.assign({
|
|
2511
|
+
className: "col-auto"
|
|
2512
|
+
}, {
|
|
2513
|
+
children: jsx("div", Object.assign({
|
|
2514
|
+
className: "group size-sm"
|
|
2515
|
+
}, {
|
|
2516
|
+
children: children
|
|
2517
|
+
}))
|
|
2518
|
+
}))]
|
|
2519
|
+
}))
|
|
2520
|
+
}))]
|
|
2521
|
+
}));
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
function Badge(_a) {
|
|
2525
|
+
var {
|
|
2526
|
+
children,
|
|
2527
|
+
badgeType,
|
|
2528
|
+
isCloseable,
|
|
2529
|
+
closeText,
|
|
2530
|
+
customColor,
|
|
2531
|
+
customBackgroundColor
|
|
2532
|
+
} = _a,
|
|
2533
|
+
props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText", "customColor", "customBackgroundColor"]);
|
|
2534
|
+
|
|
2535
|
+
const [isClosed, setIsClosed] = React.useState(false);
|
|
2536
|
+
const [type, setType] = React.useState('');
|
|
2537
|
+
React.useEffect(() => {
|
|
2538
|
+
if (badgeType) {
|
|
2539
|
+
setType(badgeType);
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
if (!!customColor || !!customBackgroundColor) {
|
|
2543
|
+
setType('');
|
|
2544
|
+
}
|
|
2545
|
+
}, []);
|
|
2546
|
+
return !isClosed ? jsxs("span", Object.assign({}, props, {
|
|
2547
|
+
className: `badge ${type}`,
|
|
2548
|
+
style: {
|
|
2549
|
+
color: customColor,
|
|
2550
|
+
backgroundColor: customBackgroundColor
|
|
2551
|
+
}
|
|
2552
|
+
}, {
|
|
2553
|
+
children: [jsx("strong", {
|
|
2554
|
+
children: children
|
|
2555
|
+
}), isCloseable && jsx("button", Object.assign({
|
|
2556
|
+
type: "button",
|
|
2557
|
+
className: "close",
|
|
2558
|
+
onClick: () => setIsClosed(true)
|
|
2559
|
+
}, {
|
|
2560
|
+
children: closeText
|
|
2561
|
+
}))]
|
|
2562
|
+
})) : null;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
const noop = () => {};
|
|
2566
|
+
|
|
2567
|
+
const useStepper = ({
|
|
2568
|
+
min,
|
|
2569
|
+
max,
|
|
2570
|
+
value: _value = 0,
|
|
2571
|
+
step: _step = 1,
|
|
2572
|
+
id: _id = randomId()
|
|
2573
|
+
}) => {
|
|
2574
|
+
const pStepper = {
|
|
2575
|
+
down: noop,
|
|
2576
|
+
setMax: noop,
|
|
2577
|
+
setMin: noop,
|
|
2578
|
+
setStep: noop,
|
|
2579
|
+
setValue: noop,
|
|
2580
|
+
up: noop
|
|
2581
|
+
};
|
|
2582
|
+
const [stepper, setStepper] = useState(pStepper);
|
|
2583
|
+
const [data, setData] = useState({
|
|
2584
|
+
id: _id,
|
|
2585
|
+
value: _value,
|
|
2586
|
+
min,
|
|
2587
|
+
max,
|
|
2588
|
+
step: _step
|
|
2589
|
+
});
|
|
2590
|
+
useEffect(() => {
|
|
2591
|
+
if (max !== data.max) stepper.setMax(max);
|
|
2592
|
+
}, [stepper, max]);
|
|
2593
|
+
useEffect(() => {
|
|
2594
|
+
if (min !== data.min) stepper.setMin(min);
|
|
2595
|
+
}, [stepper, min]);
|
|
2596
|
+
useEffect(() => {
|
|
2597
|
+
if (_step !== data.step) stepper.setStep(_step || 1);
|
|
2598
|
+
}, [stepper, _step]);
|
|
2599
|
+
useEffect(() => {
|
|
2600
|
+
if (_value !== data.value) stepper.setValue(_value || 0);
|
|
2601
|
+
}, [stepper, _value]);
|
|
2602
|
+
useEffect(() => {
|
|
2603
|
+
setStepper(createStepper({
|
|
2604
|
+
id: _id,
|
|
2605
|
+
value: _value,
|
|
2606
|
+
min,
|
|
2607
|
+
max,
|
|
2608
|
+
step: _step
|
|
2609
|
+
}, setData));
|
|
2610
|
+
}, []);
|
|
2611
|
+
return [stepper, data];
|
|
2612
|
+
};
|
|
2613
|
+
|
|
2614
|
+
function Stepper(_a) {
|
|
2615
|
+
var {
|
|
2616
|
+
label,
|
|
2617
|
+
description,
|
|
2618
|
+
statusMessage,
|
|
2619
|
+
onChange
|
|
2620
|
+
} = _a,
|
|
2621
|
+
props = __rest(_a, ["label", "description", "statusMessage", "onChange"]);
|
|
2622
|
+
|
|
2623
|
+
const [stepper, data] = useStepper(props);
|
|
2624
|
+
useEffect(() => {
|
|
2625
|
+
if (onChange && data.value) onChange(data.value);
|
|
2626
|
+
}, [data.value]);
|
|
2627
|
+
|
|
2628
|
+
const onChangeEvent = e => {
|
|
2629
|
+
stepper.setValue(e.target.valueAsNumber);
|
|
2630
|
+
};
|
|
2631
|
+
|
|
2632
|
+
return jsxs("div", Object.assign({
|
|
2633
|
+
className: "form-group"
|
|
2634
|
+
}, {
|
|
2635
|
+
children: [label && jsx("label", Object.assign({
|
|
2636
|
+
htmlFor: data.id
|
|
2637
|
+
}, {
|
|
2638
|
+
children: label
|
|
2639
|
+
})), description && jsx("span", Object.assign({
|
|
2640
|
+
className: "form-info"
|
|
2641
|
+
}, {
|
|
2642
|
+
children: description
|
|
2643
|
+
})), jsxs("div", Object.assign({
|
|
2644
|
+
className: "group group-border group-stepper"
|
|
2645
|
+
}, {
|
|
2646
|
+
children: [jsx("button", Object.assign({
|
|
2647
|
+
onClick: () => stepper.down()
|
|
2648
|
+
}, {
|
|
2649
|
+
children: "-"
|
|
2650
|
+
})), jsx("input", {
|
|
2651
|
+
id: data.id,
|
|
2652
|
+
type: "number",
|
|
2653
|
+
onChange: onChangeEvent,
|
|
2654
|
+
onFocus: ({
|
|
2655
|
+
target
|
|
2656
|
+
}) => target.select(),
|
|
2657
|
+
placeholder: "0",
|
|
2658
|
+
value: data.value
|
|
2659
|
+
}), jsx("button", Object.assign({
|
|
2660
|
+
onClick: () => stepper.up()
|
|
2661
|
+
}, {
|
|
2662
|
+
children: "+"
|
|
2663
|
+
}))]
|
|
2664
|
+
})), statusMessage && jsx("span", Object.assign({
|
|
2665
|
+
className: "form-info"
|
|
2666
|
+
}, {
|
|
2667
|
+
children: statusMessage
|
|
2668
|
+
}))]
|
|
2669
|
+
}));
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
const useDropdown = ({
|
|
2673
|
+
id,
|
|
2674
|
+
texts,
|
|
2675
|
+
options,
|
|
2676
|
+
loop,
|
|
2677
|
+
multiSelect,
|
|
2678
|
+
selectValue,
|
|
2679
|
+
useValue,
|
|
2680
|
+
display,
|
|
2681
|
+
togglerRef,
|
|
2682
|
+
listboxRef,
|
|
2683
|
+
onChange,
|
|
2684
|
+
validator
|
|
2685
|
+
}) => {
|
|
2686
|
+
const [handler, setHandler] = useState();
|
|
2687
|
+
const [dropdown, setDropdown] = useState();
|
|
2688
|
+
const [togglerProps, setTogglerProps] = useState({});
|
|
2689
|
+
const [listboxProps, setListboxProps] = useState({});
|
|
2690
|
+
const [listItems, setListItems] = useState([]);
|
|
2691
|
+
const [multiSelectProps, setMultiSelectProps] = useState({}); // When dropdown data changes
|
|
2692
|
+
|
|
2693
|
+
useEffect(() => {
|
|
2694
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2695
|
+
|
|
2696
|
+
if (!dropdown) return;
|
|
2697
|
+
const {
|
|
2698
|
+
elements: {
|
|
2699
|
+
toggler,
|
|
2700
|
+
listbox
|
|
2701
|
+
}
|
|
2702
|
+
} = dropdown;
|
|
2703
|
+
const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
|
|
2704
|
+
className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
|
|
2705
|
+
children: ((_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select) || ((_c = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _c === void 0 ? void 0 : _c.placeholder),
|
|
2706
|
+
onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
|
|
2707
|
+
});
|
|
2708
|
+
setTogglerProps(newToggleProps);
|
|
2709
|
+
const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
|
|
2710
|
+
className: (_d = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _d === void 0 ? void 0 : _d.join(' ')
|
|
2711
|
+
});
|
|
2712
|
+
setListboxProps(newListboxProps);
|
|
2713
|
+
|
|
2714
|
+
if (!dropdown.isMultiSelect) {
|
|
2715
|
+
const newListItems = dropdown.options.map(o => {
|
|
2716
|
+
var _a;
|
|
2717
|
+
|
|
2718
|
+
return Object.assign(Object.assign({}, o.attributes), {
|
|
2719
|
+
className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
|
|
2720
|
+
children: o[dropdown.display],
|
|
2721
|
+
selected: o.selected,
|
|
2722
|
+
onClick: () => {
|
|
2723
|
+
handler === null || handler === void 0 ? void 0 : handler.select(o).then(() => {
|
|
2724
|
+
if (onChange) {
|
|
2725
|
+
const result = options.find(item => item.key === o.key);
|
|
2726
|
+
result && onChange(result);
|
|
2727
|
+
}
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
});
|
|
2731
|
+
});
|
|
2732
|
+
setListItems(newListItems);
|
|
2733
|
+
} else {
|
|
2734
|
+
const checkboxes = dropdown.options.map(o => ({
|
|
2735
|
+
labelProps: Object.assign(Object.assign({}, o.attributes), {
|
|
2736
|
+
className: ['form-control', ...o.classes].join(' ')
|
|
2737
|
+
}),
|
|
2738
|
+
inputProps: {
|
|
2739
|
+
defaultChecked: o.selected,
|
|
2740
|
+
type: 'checkbox',
|
|
2741
|
+
onChange: () => {
|
|
2742
|
+
handler === null || handler === void 0 ? void 0 : handler.select(o, false).then(() => {
|
|
2743
|
+
if (onChange) {
|
|
2744
|
+
const result = options.find(item => item.key === o.key);
|
|
2745
|
+
result && onChange(result);
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
},
|
|
2750
|
+
spanProps: {
|
|
2751
|
+
children: o[dropdown.display]
|
|
2752
|
+
}
|
|
2753
|
+
}));
|
|
2754
|
+
const newMultiselect = {
|
|
2755
|
+
fieldsetProps: {
|
|
2756
|
+
'aria-describedby': (_g = (_f = (_e = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _e === void 0 ? void 0 : _e.fieldset) === null || _f === void 0 ? void 0 : _f.attributes) === null || _g === void 0 ? void 0 : _g.id,
|
|
2757
|
+
'aria-multiselectable': true,
|
|
2758
|
+
role: 'listbox',
|
|
2759
|
+
tabIndex: -1
|
|
2760
|
+
},
|
|
2761
|
+
legendProps: {
|
|
2762
|
+
className: 'sr-only',
|
|
2763
|
+
id: (_k = (_j = (_h = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _h === void 0 ? void 0 : _h.fieldset) === null || _j === void 0 ? void 0 : _j.attributes) === null || _k === void 0 ? void 0 : _k.id,
|
|
2764
|
+
children: dropdown.texts.optionsDescription
|
|
2765
|
+
},
|
|
2766
|
+
checkboxes
|
|
2767
|
+
};
|
|
2768
|
+
setMultiSelectProps(newMultiselect);
|
|
2769
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2770
|
+
|
|
2771
|
+
}, [dropdown]); // When dropdown properties change
|
|
2772
|
+
|
|
2773
|
+
useEffect(() => {
|
|
2774
|
+
if (!dropdown) return;
|
|
2775
|
+
handler === null || handler === void 0 ? void 0 : handler.update({
|
|
2776
|
+
id,
|
|
2777
|
+
texts,
|
|
2778
|
+
options,
|
|
2779
|
+
loop,
|
|
2780
|
+
multiSelect
|
|
2781
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2782
|
+
}, [id, texts, options, loop, multiSelect, selectValue, useValue, display]); // When validator changes
|
|
2783
|
+
|
|
2784
|
+
useEffect(() => {
|
|
2785
|
+
if (!dropdown) return;
|
|
2786
|
+
if (validator) handler === null || handler === void 0 ? void 0 : handler.validate(validator);
|
|
2787
|
+
}, [validator]); // Create dropdown handler
|
|
2788
|
+
|
|
2789
|
+
useEffect(() => {
|
|
2790
|
+
if (!handler && togglerRef.current && listboxRef.current) {
|
|
2791
|
+
setHandler(createDropdown({
|
|
2792
|
+
id,
|
|
2793
|
+
texts,
|
|
2794
|
+
options,
|
|
2795
|
+
loop,
|
|
2796
|
+
multiSelect,
|
|
2797
|
+
selectValue,
|
|
2798
|
+
useValue,
|
|
2799
|
+
display,
|
|
2800
|
+
validator
|
|
2801
|
+
}, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd)));
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
return () => handler === null || handler === void 0 ? void 0 : handler.destroy(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2805
|
+
}, [togglerRef, listboxRef]);
|
|
2806
|
+
return {
|
|
2807
|
+
dropdown: handler,
|
|
2808
|
+
togglerProps,
|
|
2809
|
+
listboxProps,
|
|
2810
|
+
listItems,
|
|
2811
|
+
multiSelectProps
|
|
2812
|
+
};
|
|
2813
|
+
};
|
|
2814
|
+
|
|
2815
|
+
const Dropdown = ({
|
|
2816
|
+
id,
|
|
2817
|
+
options,
|
|
2818
|
+
loop,
|
|
2819
|
+
multiSelect,
|
|
2820
|
+
selectValue,
|
|
2821
|
+
useValue,
|
|
2822
|
+
display,
|
|
2823
|
+
texts,
|
|
2824
|
+
onChange,
|
|
2825
|
+
validator
|
|
2826
|
+
}) => {
|
|
2827
|
+
var _a;
|
|
2828
|
+
|
|
2829
|
+
const togglerRef = useRef(null);
|
|
2830
|
+
const listboxRef = useRef(null);
|
|
2831
|
+
const {
|
|
2832
|
+
dropdown,
|
|
2833
|
+
listboxProps,
|
|
2834
|
+
togglerProps,
|
|
2835
|
+
listItems,
|
|
2836
|
+
multiSelectProps
|
|
2837
|
+
} = useDropdown({
|
|
2838
|
+
id,
|
|
2839
|
+
options,
|
|
2840
|
+
loop,
|
|
2841
|
+
multiSelect,
|
|
2842
|
+
selectValue,
|
|
2843
|
+
useValue,
|
|
2844
|
+
display,
|
|
2845
|
+
togglerRef,
|
|
2846
|
+
listboxRef,
|
|
2847
|
+
texts,
|
|
2848
|
+
onChange,
|
|
2849
|
+
validator
|
|
2850
|
+
});
|
|
2851
|
+
return jsxs("div", Object.assign({
|
|
2852
|
+
className: "form-group"
|
|
2853
|
+
}, {
|
|
2854
|
+
children: [jsx("button", Object.assign({
|
|
2855
|
+
type: "button"
|
|
2856
|
+
}, togglerProps, {
|
|
2857
|
+
ref: togglerRef
|
|
2858
|
+
}, {
|
|
2859
|
+
children: jsx("span", {
|
|
2860
|
+
children: togglerProps.children
|
|
2861
|
+
})
|
|
2862
|
+
})), jsxs("div", Object.assign({}, listboxProps, {
|
|
2863
|
+
ref: listboxRef
|
|
2864
|
+
}, {
|
|
2865
|
+
children: [jsx("button", Object.assign({
|
|
2866
|
+
type: "button",
|
|
2867
|
+
className: "close m-4 m-sm-2 d-block d-sm-none",
|
|
2868
|
+
onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
|
|
2869
|
+
}, {
|
|
2870
|
+
children: jsx("span", Object.assign({
|
|
2871
|
+
className: "sr-only"
|
|
2872
|
+
}, {
|
|
2873
|
+
children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
|
|
2874
|
+
}))
|
|
2875
|
+
})), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsx("div", Object.assign({
|
|
2876
|
+
className: "sg-fieldset-container"
|
|
2877
|
+
}, {
|
|
2878
|
+
children: jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
|
|
2879
|
+
children: [jsx("legend", Object.assign({}, multiSelectProps.legendProps)), (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxs("label", Object.assign({}, checkboxItem.labelProps, {
|
|
2880
|
+
children: [jsx("input", Object.assign({}, checkboxItem.inputProps)), jsx("span", Object.assign({}, checkboxItem.spanProps)), jsx("i", {})]
|
|
2881
|
+
}), checkboxItem.labelProps.id))]
|
|
2882
|
+
}))
|
|
2883
|
+
})) : jsx("ul", Object.assign({
|
|
2884
|
+
role: "listbox"
|
|
2885
|
+
}, {
|
|
2886
|
+
children: listItems.map(liProps => jsx("li", Object.assign({}, liProps), liProps.id))
|
|
2887
|
+
}))]
|
|
2888
|
+
})), validator && jsx("span", Object.assign({
|
|
2889
|
+
className: "form-info"
|
|
2890
|
+
}, {
|
|
2891
|
+
children: validator === null || validator === void 0 ? void 0 : validator.message
|
|
2892
|
+
}))]
|
|
2893
|
+
}));
|
|
1951
2894
|
};
|
|
1952
2895
|
|
|
1953
|
-
export { Alert, Button, ButtonGroup, Card, Checkbox, EmailInput, Form, Group, Modal, NumberInput, TextInput };
|
|
2896
|
+
export { Alert, Badge, Button, ButtonGroup, Card, Checkbox, Dropdown, EmailInput, Flexbox, Form, FormItems, Group, Link, List, Modal, Navbar, NumberInput, RadioButton, RadioGroup, RenderInput, Stepper, Text, TextInput };
|