@rjsf/chakra-ui 5.9.0 → 5.11.1

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.
@@ -18,77 +18,48 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
18
18
  var createCache__default = /*#__PURE__*/_interopDefaultLegacy(createCache);
19
19
  var weakMemoize__default = /*#__PURE__*/_interopDefaultLegacy(weakMemoize);
20
20
 
21
- function _extends() {
22
- _extends = Object.assign ? Object.assign.bind() : function (target) {
23
- for (var i = 1; i < arguments.length; i++) {
24
- var source = arguments[i];
25
- for (var key in source) {
26
- if (Object.prototype.hasOwnProperty.call(source, key)) {
27
- target[key] = source[key];
28
- }
29
- }
30
- }
31
- return target;
32
- };
33
- return _extends.apply(this, arguments);
34
- }
35
- function _objectWithoutPropertiesLoose(source, excluded) {
36
- if (source == null) return {};
37
- var target = {};
38
- var sourceKeys = Object.keys(source);
39
- var key, i;
40
- for (i = 0; i < sourceKeys.length; i++) {
41
- key = sourceKeys[i];
42
- if (excluded.indexOf(key) >= 0) continue;
43
- target[key] = source[key];
44
- }
45
- return target;
46
- }
47
-
48
- var _excluded$2 = ["uiSchema", "registry"];
49
- function AddButton(_ref) {
50
- var registry = _ref.registry,
51
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
52
- var translateString = registry.translateString;
53
- return jsxRuntime.jsx(react.Button, _extends({
54
- leftIcon: jsxRuntime.jsx(icons.AddIcon, {})
55
- }, props, {
21
+ function AddButton({
22
+ uiSchema,
23
+ registry,
24
+ ...props
25
+ }) {
26
+ const {
27
+ translateString
28
+ } = registry;
29
+ return jsxRuntime.jsx(react.Button, {
30
+ leftIcon: jsxRuntime.jsx(icons.AddIcon, {}),
31
+ ...props,
56
32
  children: translateString(utils.TranslatableString.AddItemButton)
57
- }));
33
+ });
58
34
  }
59
35
 
60
36
  function ArrayFieldItemTemplate(props) {
61
- var children = props.children,
62
- disabled = props.disabled,
63
- hasToolbar = props.hasToolbar,
64
- hasCopy = props.hasCopy,
65
- hasMoveDown = props.hasMoveDown,
66
- hasMoveUp = props.hasMoveUp,
67
- hasRemove = props.hasRemove,
68
- index = props.index,
69
- onCopyIndexClick = props.onCopyIndexClick,
70
- onDropIndexClick = props.onDropIndexClick,
71
- onReorderClick = props.onReorderClick,
72
- readonly = props.readonly,
73
- uiSchema = props.uiSchema,
74
- registry = props.registry;
75
- var _registry$templates$B = registry.templates.ButtonTemplates,
76
- CopyButton = _registry$templates$B.CopyButton,
77
- MoveDownButton = _registry$templates$B.MoveDownButton,
78
- MoveUpButton = _registry$templates$B.MoveUpButton,
79
- RemoveButton = _registry$templates$B.RemoveButton;
80
- var onCopyClick = react$1.useMemo(function () {
81
- return onCopyIndexClick(index);
82
- }, [index, onCopyIndexClick]);
83
- var onRemoveClick = react$1.useMemo(function () {
84
- return onDropIndexClick(index);
85
- }, [index, onDropIndexClick]);
86
- var onArrowUpClick = react$1.useMemo(function () {
87
- return onReorderClick(index, index - 1);
88
- }, [index, onReorderClick]);
89
- var onArrowDownClick = react$1.useMemo(function () {
90
- return onReorderClick(index, index + 1);
91
- }, [index, onReorderClick]);
37
+ const {
38
+ children,
39
+ disabled,
40
+ hasToolbar,
41
+ hasCopy,
42
+ hasMoveDown,
43
+ hasMoveUp,
44
+ hasRemove,
45
+ index,
46
+ onCopyIndexClick,
47
+ onDropIndexClick,
48
+ onReorderClick,
49
+ readonly,
50
+ uiSchema,
51
+ registry
52
+ } = props;
53
+ const {
54
+ CopyButton,
55
+ MoveDownButton,
56
+ MoveUpButton,
57
+ RemoveButton
58
+ } = registry.templates.ButtonTemplates;
59
+ const onCopyClick = react$1.useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
60
+ const onRemoveClick = react$1.useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
61
+ const onArrowUpClick = react$1.useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
62
+ const onArrowDownClick = react$1.useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
92
63
  return jsxRuntime.jsxs(react.HStack, {
93
64
  alignItems: 'flex-end',
94
65
  py: 1,
@@ -125,25 +96,30 @@ function ArrayFieldItemTemplate(props) {
125
96
  });
126
97
  }
127
98
 
128
- var _excluded$1 = ["key"];
129
99
  function ArrayFieldTemplate(props) {
130
- var canAdd = props.canAdd,
131
- disabled = props.disabled,
132
- idSchema = props.idSchema,
133
- uiSchema = props.uiSchema,
134
- items = props.items,
135
- onAddClick = props.onAddClick,
136
- readonly = props.readonly,
137
- registry = props.registry,
138
- required = props.required,
139
- schema = props.schema,
140
- title = props.title;
141
- var uiOptions = utils.getUiOptions(uiSchema);
142
- var ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
143
- var ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
144
- var ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
100
+ const {
101
+ canAdd,
102
+ disabled,
103
+ idSchema,
104
+ uiSchema,
105
+ items,
106
+ onAddClick,
107
+ readonly,
108
+ registry,
109
+ required,
110
+ schema,
111
+ title
112
+ } = props;
113
+ const uiOptions = utils.getUiOptions(uiSchema);
114
+ const ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
115
+ const ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
116
+ const ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
145
117
  // Button templates are not overridden in the uiSchema
146
- var AddButton = registry.templates.ButtonTemplates.AddButton;
118
+ const {
119
+ ButtonTemplates: {
120
+ AddButton
121
+ }
122
+ } = registry.templates;
147
123
  return jsxRuntime.jsxs(react.Box, {
148
124
  children: [jsxRuntime.jsx(ArrayFieldTitleTemplate, {
149
125
  idSchema: idSchema,
@@ -160,11 +136,12 @@ function ArrayFieldTemplate(props) {
160
136
  registry: registry
161
137
  }), jsxRuntime.jsxs(react.Grid, {
162
138
  children: [jsxRuntime.jsx(react.GridItem, {
163
- children: items.length > 0 && items.map(function (_ref) {
164
- var key = _ref.key,
165
- itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$1);
166
- return jsxRuntime.jsx(ArrayFieldItemTemplate, _extends({}, itemProps), key);
167
- })
139
+ children: items.length > 0 && items.map(({
140
+ key,
141
+ ...itemProps
142
+ }) => jsxRuntime.jsx(ArrayFieldItemTemplate, {
143
+ ...itemProps
144
+ }, key))
168
145
  }), canAdd && jsxRuntime.jsx(react.GridItem, {
169
146
  justifySelf: 'flex-end',
170
147
  children: jsxRuntime.jsx(react.Box, {
@@ -178,15 +155,15 @@ function ArrayFieldTemplate(props) {
178
155
  })
179
156
  })
180
157
  })]
181
- }, "array-item-list-" + idSchema.$id)]
158
+ }, `array-item-list-${idSchema.$id}`)]
182
159
  });
183
160
  }
184
161
 
185
- function getChakra(_ref) {
186
- var _ref$uiSchema = _ref.uiSchema,
187
- uiSchema = _ref$uiSchema === void 0 ? {} : _ref$uiSchema;
188
- var chakraProps = uiSchema['ui:options'] && uiSchema['ui:options'].chakra || {};
189
- Object.keys(chakraProps).forEach(function (key) {
162
+ function getChakra({
163
+ uiSchema = {}
164
+ }) {
165
+ const chakraProps = uiSchema['ui:options'] && uiSchema['ui:options'].chakra || {};
166
+ Object.keys(chakraProps).forEach(key => {
190
167
  /**
191
168
  * Leveraging `shouldForwardProp` to remove props
192
169
  *
@@ -202,52 +179,57 @@ function getChakra(_ref) {
202
179
  }
203
180
 
204
181
  function BaseInputTemplate(props) {
205
- var id = props.id,
206
- type = props.type,
207
- value = props.value,
208
- label = props.label,
209
- hideLabel = props.hideLabel,
210
- schema = props.schema,
211
- uiSchema = props.uiSchema,
212
- onChange = props.onChange,
213
- onChangeOverride = props.onChangeOverride,
214
- onBlur = props.onBlur,
215
- onFocus = props.onFocus,
216
- options = props.options,
217
- required = props.required,
218
- readonly = props.readonly,
219
- rawErrors = props.rawErrors,
220
- autofocus = props.autofocus,
221
- placeholder = props.placeholder,
222
- disabled = props.disabled;
223
- var inputProps = utils.getInputProps(schema, type, options);
224
- var chakraProps = getChakra({
225
- uiSchema: uiSchema
182
+ const {
183
+ id,
184
+ type,
185
+ value,
186
+ label,
187
+ hideLabel,
188
+ schema,
189
+ uiSchema,
190
+ onChange,
191
+ onChangeOverride,
192
+ onBlur,
193
+ onFocus,
194
+ options,
195
+ required,
196
+ readonly,
197
+ rawErrors,
198
+ autofocus,
199
+ placeholder,
200
+ disabled
201
+ } = props;
202
+ const inputProps = utils.getInputProps(schema, type, options);
203
+ const chakraProps = getChakra({
204
+ uiSchema
226
205
  });
227
- var _onChange = function _onChange(_ref) {
228
- var value = _ref.target.value;
229
- return onChange(value === '' ? options.emptyValue : value);
230
- };
231
- var _onBlur = function _onBlur(_ref2) {
232
- var value = _ref2.target.value;
233
- return onBlur(id, value);
234
- };
235
- var _onFocus = function _onFocus(_ref3) {
236
- var value = _ref3.target.value;
237
- return onFocus(id, value);
238
- };
239
- return jsxRuntime.jsxs(react.FormControl, _extends({
240
- mb: 1
241
- }, chakraProps, {
206
+ const _onChange = ({
207
+ target: {
208
+ value
209
+ }
210
+ }) => onChange(value === '' ? options.emptyValue : value);
211
+ const _onBlur = ({
212
+ target: {
213
+ value
214
+ }
215
+ }) => onBlur(id, value);
216
+ const _onFocus = ({
217
+ target: {
218
+ value
219
+ }
220
+ }) => onFocus(id, value);
221
+ return jsxRuntime.jsxs(react.FormControl, {
222
+ mb: 1,
223
+ ...chakraProps,
242
224
  isDisabled: disabled || readonly,
243
225
  isRequired: required,
244
226
  isReadOnly: readonly,
245
227
  isInvalid: rawErrors && rawErrors.length > 0,
246
228
  children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
247
229
  htmlFor: id,
248
- id: id + "-label",
230
+ id: `${id}-label`,
249
231
  children: label
250
- }), hideLabel || !label), jsxRuntime.jsx(react.Input, _extends({
232
+ }), hideLabel || !label), jsxRuntime.jsx(react.Input, {
251
233
  id: id,
252
234
  name: id,
253
235
  value: value || value === 0 ? value : '',
@@ -255,24 +237,25 @@ function BaseInputTemplate(props) {
255
237
  onBlur: _onBlur,
256
238
  onFocus: _onFocus,
257
239
  autoFocus: autofocus,
258
- placeholder: placeholder
259
- }, inputProps, {
240
+ placeholder: placeholder,
241
+ ...inputProps,
260
242
  list: schema.examples ? utils.examplesId(id) : undefined,
261
243
  "aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
262
- })), Array.isArray(schema.examples) ? jsxRuntime.jsx("datalist", {
244
+ }), Array.isArray(schema.examples) ? jsxRuntime.jsx("datalist", {
263
245
  id: utils.examplesId(id),
264
- children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
246
+ children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
265
247
  return jsxRuntime.jsx("option", {
266
248
  value: example
267
249
  }, example);
268
250
  })
269
251
  }) : null]
270
- }));
252
+ });
271
253
  }
272
254
 
273
- function DescriptionField(_ref) {
274
- var description = _ref.description,
275
- id = _ref.id;
255
+ function DescriptionField({
256
+ description,
257
+ id
258
+ }) {
276
259
  if (!description) {
277
260
  return null;
278
261
  }
@@ -289,10 +272,13 @@ function DescriptionField(_ref) {
289
272
  });
290
273
  }
291
274
 
292
- function ErrorList(_ref) {
293
- var errors = _ref.errors,
294
- registry = _ref.registry;
295
- var translateString = registry.translateString;
275
+ function ErrorList({
276
+ errors,
277
+ registry
278
+ }) {
279
+ const {
280
+ translateString
281
+ } = registry;
296
282
  return jsxRuntime.jsxs(react.Alert, {
297
283
  flexDirection: 'column',
298
284
  alignItems: 'flex-start',
@@ -301,62 +287,80 @@ function ErrorList(_ref) {
301
287
  children: [jsxRuntime.jsx(react.AlertTitle, {
302
288
  children: translateString(utils.TranslatableString.ErrorsLabel)
303
289
  }), jsxRuntime.jsx(react.List, {
304
- children: errors.map(function (error, i) {
305
- return jsxRuntime.jsxs(react.ListItem, {
306
- children: [jsxRuntime.jsx(react.ListIcon, {
307
- as: icons.WarningIcon,
308
- color: 'red.500'
309
- }), error.stack]
310
- }, i);
311
- })
290
+ children: errors.map((error, i) => jsxRuntime.jsxs(react.ListItem, {
291
+ children: [jsxRuntime.jsx(react.ListIcon, {
292
+ as: icons.WarningIcon,
293
+ color: 'red.500'
294
+ }), error.stack]
295
+ }, i))
312
296
  })]
313
297
  });
314
298
  }
315
299
 
316
- var _excluded = ["icon", "iconType", "uiSchema", "registry"];
317
300
  function ChakraIconButton(props) {
318
- var icon = props.icon,
319
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
320
- return jsxRuntime.jsx(react.IconButton, _extends({
321
- "aria-label": props.title
322
- }, otherProps, {
301
+ const {
302
+ icon,
303
+ iconType,
304
+ uiSchema,
305
+ registry,
306
+ ...otherProps
307
+ } = props;
308
+ return jsxRuntime.jsx(react.IconButton, {
309
+ "aria-label": props.title,
310
+ ...otherProps,
323
311
  icon: icon
324
- }));
312
+ });
325
313
  }
326
314
  ChakraIconButton.displayName = 'ChakraIconButton';
327
315
  var ChakraIconButton$1 = /*#__PURE__*/react$1.memo(ChakraIconButton);
328
316
 
329
317
  function CopyButton(props) {
330
- var translateString = props.registry.translateString;
331
- return jsxRuntime.jsx(ChakraIconButton$1, _extends({
332
- title: translateString(utils.TranslatableString.CopyButton)
333
- }, props, {
318
+ const {
319
+ registry: {
320
+ translateString
321
+ }
322
+ } = props;
323
+ return jsxRuntime.jsx(ChakraIconButton$1, {
324
+ title: translateString(utils.TranslatableString.CopyButton),
325
+ ...props,
334
326
  icon: jsxRuntime.jsx(icons.CopyIcon, {})
335
- }));
327
+ });
336
328
  }
337
329
  function MoveDownButton(props) {
338
- var translateString = props.registry.translateString;
339
- return jsxRuntime.jsx(ChakraIconButton$1, _extends({
340
- title: translateString(utils.TranslatableString.MoveDownButton)
341
- }, props, {
330
+ const {
331
+ registry: {
332
+ translateString
333
+ }
334
+ } = props;
335
+ return jsxRuntime.jsx(ChakraIconButton$1, {
336
+ title: translateString(utils.TranslatableString.MoveDownButton),
337
+ ...props,
342
338
  icon: jsxRuntime.jsx(icons.ArrowDownIcon, {})
343
- }));
339
+ });
344
340
  }
345
341
  function MoveUpButton(props) {
346
- var translateString = props.registry.translateString;
347
- return jsxRuntime.jsx(ChakraIconButton$1, _extends({
348
- title: translateString(utils.TranslatableString.MoveUpButton)
349
- }, props, {
342
+ const {
343
+ registry: {
344
+ translateString
345
+ }
346
+ } = props;
347
+ return jsxRuntime.jsx(ChakraIconButton$1, {
348
+ title: translateString(utils.TranslatableString.MoveUpButton),
349
+ ...props,
350
350
  icon: jsxRuntime.jsx(icons.ArrowUpIcon, {})
351
- }));
351
+ });
352
352
  }
353
353
  function RemoveButton(props) {
354
- var translateString = props.registry.translateString;
355
- return jsxRuntime.jsx(ChakraIconButton$1, _extends({
356
- title: translateString(utils.TranslatableString.RemoveButton)
357
- }, props, {
354
+ const {
355
+ registry: {
356
+ translateString
357
+ }
358
+ } = props;
359
+ return jsxRuntime.jsx(ChakraIconButton$1, {
360
+ title: translateString(utils.TranslatableString.RemoveButton),
361
+ ...props,
358
362
  icon: jsxRuntime.jsx(icons.DeleteIcon, {})
359
- }));
363
+ });
360
364
  }
361
365
 
362
366
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
@@ -364,15 +368,16 @@ function RemoveButton(props) {
364
368
  * @param props - The `FieldErrorProps` for the errors being rendered
365
369
  */
366
370
  function FieldErrorTemplate(props) {
367
- var _props$errors = props.errors,
368
- errors = _props$errors === void 0 ? [] : _props$errors,
369
- idSchema = props.idSchema;
371
+ const {
372
+ errors = [],
373
+ idSchema
374
+ } = props;
370
375
  if (errors.length === 0) {
371
376
  return null;
372
377
  }
373
- var id = utils.errorId(idSchema);
378
+ const id = utils.errorId(idSchema);
374
379
  return jsxRuntime.jsx(react.List, {
375
- children: errors.map(function (error, i) {
380
+ children: errors.map((error, i) => {
376
381
  return jsxRuntime.jsx(react.ListItem, {
377
382
  children: jsxRuntime.jsx(react.FormErrorMessage, {
378
383
  id: id,
@@ -388,12 +393,14 @@ function FieldErrorTemplate(props) {
388
393
  * @param props - The `FieldHelpProps` to be rendered
389
394
  */
390
395
  function FieldHelpTemplate(props) {
391
- var idSchema = props.idSchema,
392
- help = props.help;
396
+ const {
397
+ idSchema,
398
+ help
399
+ } = props;
393
400
  if (!help) {
394
401
  return null;
395
402
  }
396
- var id = utils.helpId(idSchema);
403
+ const id = utils.helpId(idSchema);
397
404
  return jsxRuntime.jsx(react.FormHelperText, {
398
405
  id: id,
399
406
  children: help
@@ -401,29 +408,30 @@ function FieldHelpTemplate(props) {
401
408
  }
402
409
 
403
410
  function FieldTemplate(props) {
404
- var id = props.id,
405
- children = props.children,
406
- classNames = props.classNames,
407
- style = props.style,
408
- disabled = props.disabled,
409
- displayLabel = props.displayLabel,
410
- hidden = props.hidden,
411
- label = props.label,
412
- onDropPropertyClick = props.onDropPropertyClick,
413
- onKeyChange = props.onKeyChange,
414
- readonly = props.readonly,
415
- registry = props.registry,
416
- required = props.required,
417
- _props$rawErrors = props.rawErrors,
418
- rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
419
- errors = props.errors,
420
- help = props.help,
421
- description = props.description,
422
- rawDescription = props.rawDescription,
423
- schema = props.schema,
424
- uiSchema = props.uiSchema;
425
- var uiOptions = utils.getUiOptions(uiSchema);
426
- var WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
411
+ const {
412
+ id,
413
+ children,
414
+ classNames,
415
+ style,
416
+ disabled,
417
+ displayLabel,
418
+ hidden,
419
+ label,
420
+ onDropPropertyClick,
421
+ onKeyChange,
422
+ readonly,
423
+ registry,
424
+ required,
425
+ rawErrors = [],
426
+ errors,
427
+ help,
428
+ description,
429
+ rawDescription,
430
+ schema,
431
+ uiSchema
432
+ } = props;
433
+ const uiOptions = utils.getUiOptions(uiSchema);
434
+ const WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
427
435
  if (hidden) {
428
436
  return jsxRuntime.jsx("div", {
429
437
  style: {
@@ -457,23 +465,29 @@ function FieldTemplate(props) {
457
465
  }
458
466
 
459
467
  function ObjectFieldTemplate(props) {
460
- var description = props.description,
461
- title = props.title,
462
- properties = props.properties,
463
- required = props.required,
464
- disabled = props.disabled,
465
- readonly = props.readonly,
466
- uiSchema = props.uiSchema,
467
- idSchema = props.idSchema,
468
- schema = props.schema,
469
- formData = props.formData,
470
- onAddClick = props.onAddClick,
471
- registry = props.registry;
472
- var uiOptions = utils.getUiOptions(uiSchema);
473
- var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
474
- var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
468
+ const {
469
+ description,
470
+ title,
471
+ properties,
472
+ required,
473
+ disabled,
474
+ readonly,
475
+ uiSchema,
476
+ idSchema,
477
+ schema,
478
+ formData,
479
+ onAddClick,
480
+ registry
481
+ } = props;
482
+ const uiOptions = utils.getUiOptions(uiSchema);
483
+ const TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
484
+ const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
475
485
  // Button templates are not overridden in the uiSchema
476
- var AddButton = registry.templates.ButtonTemplates.AddButton;
486
+ const {
487
+ ButtonTemplates: {
488
+ AddButton
489
+ }
490
+ } = registry.templates;
477
491
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
478
492
  children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
479
493
  id: utils.titleId(idSchema),
@@ -491,11 +505,9 @@ function ObjectFieldTemplate(props) {
491
505
  }), jsxRuntime.jsxs(react.Grid, {
492
506
  gap: description ? 2 : 6,
493
507
  mb: 4,
494
- children: [properties.map(function (element, index) {
495
- return element.hidden ? element.content : jsxRuntime.jsx(react.GridItem, {
496
- children: element.content
497
- }, idSchema.$id + "-" + element.name + "-" + index);
498
- }), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(react.GridItem, {
508
+ children: [properties.map((element, index) => element.hidden ? element.content : jsxRuntime.jsx(react.GridItem, {
509
+ children: element.content
510
+ }, `${idSchema.$id}-${element.name}-${index}`)), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(react.GridItem, {
499
511
  justifySelf: 'flex-end',
500
512
  children: jsxRuntime.jsx(AddButton, {
501
513
  className: 'object-property-expand',
@@ -509,29 +521,32 @@ function ObjectFieldTemplate(props) {
509
521
  });
510
522
  }
511
523
 
512
- function SubmitButton(_ref) {
513
- var uiSchema = _ref.uiSchema;
514
- var _getSubmitButtonOptio = utils.getSubmitButtonOptions(uiSchema),
515
- submitText = _getSubmitButtonOptio.submitText,
516
- norender = _getSubmitButtonOptio.norender,
517
- submitButtonProps = _getSubmitButtonOptio.props;
524
+ function SubmitButton({
525
+ uiSchema
526
+ }) {
527
+ const {
528
+ submitText,
529
+ norender,
530
+ props: submitButtonProps
531
+ } = utils.getSubmitButtonOptions(uiSchema);
518
532
  if (norender) {
519
533
  return null;
520
534
  }
521
535
  return jsxRuntime.jsx(react.Box, {
522
536
  marginTop: 3,
523
- children: jsxRuntime.jsx(react.Button, _extends({
537
+ children: jsxRuntime.jsx(react.Button, {
524
538
  type: 'submit',
525
- variant: 'solid'
526
- }, submitButtonProps, {
539
+ variant: 'solid',
540
+ ...submitButtonProps,
527
541
  children: submitText
528
- }))
542
+ })
529
543
  });
530
544
  }
531
545
 
532
- function TitleField(_ref) {
533
- var id = _ref.id,
534
- title = _ref.title;
546
+ function TitleField({
547
+ id,
548
+ title
549
+ }) {
535
550
  return jsxRuntime.jsxs(react.Box, {
536
551
  id: id,
537
552
  mt: 1,
@@ -544,25 +559,31 @@ function TitleField(_ref) {
544
559
  }
545
560
 
546
561
  function WrapIfAdditionalTemplate(props) {
547
- var children = props.children,
548
- classNames = props.classNames,
549
- style = props.style,
550
- disabled = props.disabled,
551
- id = props.id,
552
- label = props.label,
553
- onDropPropertyClick = props.onDropPropertyClick,
554
- onKeyChange = props.onKeyChange,
555
- readonly = props.readonly,
556
- registry = props.registry,
557
- required = props.required,
558
- schema = props.schema,
559
- uiSchema = props.uiSchema;
560
- var templates = registry.templates,
561
- translateString = registry.translateString;
562
+ const {
563
+ children,
564
+ classNames,
565
+ style,
566
+ disabled,
567
+ id,
568
+ label,
569
+ onDropPropertyClick,
570
+ onKeyChange,
571
+ readonly,
572
+ registry,
573
+ required,
574
+ schema,
575
+ uiSchema
576
+ } = props;
577
+ const {
578
+ templates,
579
+ translateString
580
+ } = registry;
562
581
  // Button templates are not overridden in the uiSchema
563
- var RemoveButton = templates.ButtonTemplates.RemoveButton;
564
- var keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
565
- var additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
582
+ const {
583
+ RemoveButton
584
+ } = templates.ButtonTemplates;
585
+ const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
586
+ const additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
566
587
  if (!additional) {
567
588
  return jsxRuntime.jsx("div", {
568
589
  className: classNames,
@@ -570,10 +591,9 @@ function WrapIfAdditionalTemplate(props) {
570
591
  children: children
571
592
  });
572
593
  }
573
- var handleBlur = function handleBlur(_ref) {
574
- var target = _ref.target;
575
- return onKeyChange(target.value);
576
- };
594
+ const handleBlur = ({
595
+ target
596
+ }) => onKeyChange(target.value);
577
597
  return jsxRuntime.jsxs(react.Grid, {
578
598
  className: classNames,
579
599
  style: style,
@@ -583,14 +603,14 @@ function WrapIfAdditionalTemplate(props) {
583
603
  children: jsxRuntime.jsxs(react.FormControl, {
584
604
  isRequired: required,
585
605
  children: [jsxRuntime.jsx(react.FormLabel, {
586
- htmlFor: id + "-key",
587
- id: id + "-key-label",
606
+ htmlFor: `${id}-key`,
607
+ id: `${id}-key-label`,
588
608
  children: keyLabel
589
609
  }), jsxRuntime.jsx(react.Input, {
590
610
  defaultValue: label,
591
611
  disabled: disabled || readonly,
592
- id: id + "-key",
593
- name: id + "-key",
612
+ id: `${id}-key`,
613
+ name: `${id}-key`,
594
614
  onBlur: !readonly ? handleBlur : undefined,
595
615
  type: 'text',
596
616
  mb: 1
@@ -606,37 +626,37 @@ function WrapIfAdditionalTemplate(props) {
606
626
  registry: registry
607
627
  })
608
628
  })]
609
- }, id + "-key");
629
+ }, `${id}-key`);
610
630
  }
611
631
 
612
632
  function generateTemplates() {
613
633
  return {
614
- ArrayFieldItemTemplate: ArrayFieldItemTemplate,
615
- ArrayFieldTemplate: ArrayFieldTemplate,
616
- BaseInputTemplate: BaseInputTemplate,
634
+ ArrayFieldItemTemplate,
635
+ ArrayFieldTemplate,
636
+ BaseInputTemplate,
617
637
  ButtonTemplates: {
618
- CopyButton: CopyButton,
619
- AddButton: AddButton,
620
- MoveDownButton: MoveDownButton,
621
- MoveUpButton: MoveUpButton,
622
- RemoveButton: RemoveButton,
623
- SubmitButton: SubmitButton
638
+ CopyButton,
639
+ AddButton,
640
+ MoveDownButton,
641
+ MoveUpButton,
642
+ RemoveButton,
643
+ SubmitButton
624
644
  },
625
645
  DescriptionFieldTemplate: DescriptionField,
626
646
  ErrorListTemplate: ErrorList,
627
- FieldErrorTemplate: FieldErrorTemplate,
628
- FieldHelpTemplate: FieldHelpTemplate,
629
- FieldTemplate: FieldTemplate,
630
- ObjectFieldTemplate: ObjectFieldTemplate,
647
+ FieldErrorTemplate,
648
+ FieldHelpTemplate,
649
+ FieldTemplate,
650
+ ObjectFieldTemplate,
631
651
  TitleFieldTemplate: TitleField,
632
- WrapIfAdditionalTemplate: WrapIfAdditionalTemplate
652
+ WrapIfAdditionalTemplate
633
653
  };
634
654
  }
635
655
  var Templates = /*#__PURE__*/generateTemplates();
636
656
 
637
- var rangeOptions = function rangeOptions(start, stop) {
638
- var options = [];
639
- for (var i = start; i <= stop; i++) {
657
+ const rangeOptions = (start, stop) => {
658
+ const options = [];
659
+ for (let i = start; i <= stop; i++) {
640
660
  options.push({
641
661
  value: i,
642
662
  label: utils.pad(i, 2)
@@ -645,14 +665,15 @@ var rangeOptions = function rangeOptions(start, stop) {
645
665
  return options;
646
666
  };
647
667
  function DateElement(props) {
648
- var SelectWidget = props.registry.widgets.SelectWidget;
649
- var value = props.value ? props.value : undefined;
650
- return jsxRuntime.jsx(SelectWidget, _extends({}, props, {
668
+ const {
669
+ SelectWidget
670
+ } = props.registry.widgets;
671
+ const value = props.value ? props.value : undefined;
672
+ return jsxRuntime.jsx(SelectWidget, {
673
+ ...props,
651
674
  label: '',
652
675
  className: 'form-control',
653
- onChange: function onChange(elemValue) {
654
- return props.select(props.type, elemValue);
655
- },
676
+ onChange: elemValue => props.select(props.type, elemValue),
656
677
  options: {
657
678
  enumOptions: rangeOptions(props.range[0], props.range[1])
658
679
  },
@@ -662,64 +683,68 @@ function DateElement(props) {
662
683
  },
663
684
  value: value,
664
685
  "aria-describedby": utils.ariaDescribedByIds(props.name)
665
- }));
666
- }
667
- var readyForChange = function readyForChange(state) {
668
- return Object.keys(state).every(function (key) {
669
- return typeof state[key] !== 'undefined' && state[key] !== -1;
670
686
  });
687
+ }
688
+ const readyForChange = state => {
689
+ return Object.keys(state).every(key => typeof state[key] !== 'undefined' && state[key] !== -1);
671
690
  };
672
691
  function AltDateWidget(props) {
673
- var autofocus = props.autofocus,
674
- disabled = props.disabled,
675
- id = props.id,
676
- onBlur = props.onBlur,
677
- onChange = props.onChange,
678
- onFocus = props.onFocus,
679
- options = props.options,
680
- readonly = props.readonly,
681
- registry = props.registry,
682
- showTime = props.showTime,
683
- value = props.value;
684
- var translateString = registry.translateString;
685
- var _useState = react$1.useState(utils.parseDateString(value, showTime)),
686
- state = _useState[0],
687
- setState = _useState[1];
688
- react$1.useEffect(function () {
692
+ const {
693
+ autofocus,
694
+ disabled,
695
+ id,
696
+ onBlur,
697
+ onChange,
698
+ onFocus,
699
+ options,
700
+ readonly,
701
+ registry,
702
+ showTime,
703
+ value
704
+ } = props;
705
+ const {
706
+ translateString
707
+ } = registry;
708
+ const [state, setState] = react$1.useState(utils.parseDateString(value, showTime));
709
+ react$1.useEffect(() => {
689
710
  setState(utils.parseDateString(value, showTime));
690
711
  }, [showTime, value]);
691
- var handleChange = function handleChange(property, nextValue) {
692
- var _extends2;
693
- var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === 'undefined' ? -1 : nextValue, _extends2));
712
+ const handleChange = (property, nextValue) => {
713
+ const nextState = {
714
+ ...state,
715
+ [property]: typeof nextValue === 'undefined' ? -1 : nextValue
716
+ };
694
717
  if (readyForChange(nextState)) {
695
718
  onChange(utils.toDateString(nextState, showTime));
696
719
  } else {
697
720
  setState(nextState);
698
721
  }
699
722
  };
700
- var handleNow = function handleNow(event) {
723
+ const handleNow = event => {
701
724
  event.preventDefault();
702
725
  if (disabled || readonly) {
703
726
  return;
704
727
  }
705
- var nextState = utils.parseDateString(new Date().toJSON(), showTime);
728
+ const nextState = utils.parseDateString(new Date().toJSON(), showTime);
706
729
  onChange(utils.toDateString(nextState, showTime));
707
730
  };
708
- var handleClear = function handleClear(event) {
731
+ const handleClear = event => {
709
732
  event.preventDefault();
710
733
  if (disabled || readonly) {
711
734
  return;
712
735
  }
713
736
  onChange(undefined);
714
737
  };
715
- var dateElementProps = function dateElementProps() {
716
- var year = state.year,
717
- month = state.month,
718
- day = state.day,
719
- hour = state.hour,
720
- minute = state.minute,
721
- second = state.second;
722
- var data = [{
738
+ const dateElementProps = () => {
739
+ const {
740
+ year,
741
+ month,
742
+ day,
743
+ hour,
744
+ minute,
745
+ second
746
+ } = state;
747
+ const data = [{
723
748
  type: 'year',
724
749
  range: options.yearsRange,
725
750
  value: year
@@ -754,12 +779,14 @@ function AltDateWidget(props) {
754
779
  display: 'flex',
755
780
  flexWrap: 'wrap',
756
781
  alignItems: 'center',
757
- children: dateElementProps().map(function (elemProps, i) {
758
- var elemId = id + '_' + elemProps.type;
782
+ children: dateElementProps().map((elemProps, i) => {
783
+ const elemId = id + '_' + elemProps.type;
759
784
  return jsxRuntime.jsx(react.Box, {
760
785
  mr: '2',
761
786
  mb: '2',
762
- children: jsxRuntime.jsx(DateElement, _extends({}, props, elemProps, {
787
+ children: jsxRuntime.jsx(DateElement, {
788
+ ...props,
789
+ ...elemProps,
763
790
  autofocus: autofocus && i === 0,
764
791
  disabled: disabled,
765
792
  id: elemId,
@@ -770,21 +797,17 @@ function AltDateWidget(props) {
770
797
  registry: registry,
771
798
  select: handleChange,
772
799
  value: elemProps.value < 0 ? '' : elemProps.value
773
- }))
800
+ })
774
801
  }, elemId);
775
802
  })
776
803
  }), jsxRuntime.jsxs(react.Box, {
777
804
  display: 'flex',
778
805
  children: [!options.hideNowButton && jsxRuntime.jsx(react.Button, {
779
- onClick: function onClick(e) {
780
- return handleNow(e);
781
- },
806
+ onClick: e => handleNow(e),
782
807
  mr: '2',
783
808
  children: translateString(utils.TranslatableString.NowLabel)
784
809
  }), !options.hideClearButton && jsxRuntime.jsx(react.Button, {
785
- onClick: function onClick(e) {
786
- return handleClear(e);
787
- },
810
+ onClick: e => handleClear(e),
788
811
  children: translateString(utils.TranslatableString.ClearLabel)
789
812
  })]
790
813
  })]
@@ -801,53 +824,62 @@ AltDateWidget.defaultProps = {
801
824
  };
802
825
 
803
826
  function AltDateTimeWidget(props) {
804
- var AltDateWidget = props.registry.widgets.AltDateWidget;
805
- return jsxRuntime.jsx(AltDateWidget, _extends({}, props, {
827
+ const {
828
+ AltDateWidget
829
+ } = props.registry.widgets;
830
+ return jsxRuntime.jsx(AltDateWidget, {
831
+ ...props,
806
832
  showTime: true
807
- }));
833
+ });
808
834
  }
809
- AltDateTimeWidget.defaultProps = /*#__PURE__*/_extends({}, AltDateWidget.defaultProps, {
835
+ AltDateTimeWidget.defaultProps = {
836
+ ...AltDateWidget.defaultProps,
810
837
  showTime: true
811
- });
838
+ };
812
839
 
813
840
  function CheckboxWidget(props) {
814
- var id = props.id,
815
- value = props.value,
816
- disabled = props.disabled,
817
- readonly = props.readonly,
818
- onChange = props.onChange,
819
- onBlur = props.onBlur,
820
- onFocus = props.onFocus,
821
- label = props.label,
822
- hideLabel = props.hideLabel,
823
- registry = props.registry,
824
- options = props.options,
825
- uiSchema = props.uiSchema,
826
- schema = props.schema;
827
- var chakraProps = getChakra({
828
- uiSchema: uiSchema
841
+ const {
842
+ id,
843
+ value,
844
+ disabled,
845
+ readonly,
846
+ onChange,
847
+ onBlur,
848
+ onFocus,
849
+ label,
850
+ hideLabel,
851
+ registry,
852
+ options,
853
+ uiSchema,
854
+ schema
855
+ } = props;
856
+ const chakraProps = getChakra({
857
+ uiSchema
829
858
  });
830
859
  // Because an unchecked checkbox will cause html5 validation to fail, only add
831
860
  // the "required" attribute if the field value must be "true", due to the
832
861
  // "const" or "enum" keywords
833
- var required = utils.schemaRequiresTrueValue(schema);
834
- var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
835
- var description = options.description || schema.description;
836
- var _onChange = function _onChange(_ref) {
837
- var checked = _ref.target.checked;
838
- return onChange(checked);
839
- };
840
- var _onBlur = function _onBlur(_ref2) {
841
- var value = _ref2.target.value;
842
- return onBlur(id, value);
843
- };
844
- var _onFocus = function _onFocus(_ref3) {
845
- var value = _ref3.target.value;
846
- return onFocus(id, value);
847
- };
848
- return jsxRuntime.jsxs(react.FormControl, _extends({
849
- mb: 1
850
- }, chakraProps, {
862
+ const required = utils.schemaRequiresTrueValue(schema);
863
+ const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
864
+ const description = options.description || schema.description;
865
+ const _onChange = ({
866
+ target: {
867
+ checked
868
+ }
869
+ }) => onChange(checked);
870
+ const _onBlur = ({
871
+ target: {
872
+ value
873
+ }
874
+ }) => onBlur(id, value);
875
+ const _onFocus = ({
876
+ target: {
877
+ value
878
+ }
879
+ }) => onFocus(id, value);
880
+ return jsxRuntime.jsxs(react.FormControl, {
881
+ mb: 1,
882
+ ...chakraProps,
851
883
  isRequired: required,
852
884
  children: [!hideLabel && !!description && jsxRuntime.jsx(DescriptionFieldTemplate, {
853
885
  id: utils.descriptionId(id),
@@ -868,63 +900,66 @@ function CheckboxWidget(props) {
868
900
  children: label
869
901
  }), hideLabel || !label)
870
902
  })]
871
- }));
903
+ });
872
904
  }
873
905
 
874
906
  function CheckboxesWidget(props) {
875
- var id = props.id,
876
- disabled = props.disabled,
877
- options = props.options,
878
- value = props.value,
879
- readonly = props.readonly,
880
- _onChange = props.onChange,
881
- onBlur = props.onBlur,
882
- onFocus = props.onFocus,
883
- required = props.required,
884
- label = props.label,
885
- hideLabel = props.hideLabel,
886
- uiSchema = props.uiSchema,
887
- _props$rawErrors = props.rawErrors,
888
- rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors;
889
- var enumOptions = options.enumOptions,
890
- enumDisabled = options.enumDisabled,
891
- emptyValue = options.emptyValue;
892
- var chakraProps = getChakra({
893
- uiSchema: uiSchema
907
+ const {
908
+ id,
909
+ disabled,
910
+ options,
911
+ value,
912
+ readonly,
913
+ onChange,
914
+ onBlur,
915
+ onFocus,
916
+ required,
917
+ label,
918
+ hideLabel,
919
+ uiSchema,
920
+ rawErrors = []
921
+ } = props;
922
+ const {
923
+ enumOptions,
924
+ enumDisabled,
925
+ emptyValue
926
+ } = options;
927
+ const chakraProps = getChakra({
928
+ uiSchema
894
929
  });
895
- var checkboxesValues = Array.isArray(value) ? value : [value];
896
- var _onBlur = function _onBlur(_ref) {
897
- var value = _ref.target.value;
898
- return onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
899
- };
900
- var _onFocus = function _onFocus(_ref2) {
901
- var value = _ref2.target.value;
902
- return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
903
- };
904
- var row = options ? options.inline : false;
905
- var selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
906
- return jsxRuntime.jsxs(react.FormControl, _extends({
907
- mb: 1
908
- }, chakraProps, {
930
+ const checkboxesValues = Array.isArray(value) ? value : [value];
931
+ const _onBlur = ({
932
+ target: {
933
+ value
934
+ }
935
+ }) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
936
+ const _onFocus = ({
937
+ target: {
938
+ value
939
+ }
940
+ }) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
941
+ const row = options ? options.inline : false;
942
+ const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
943
+ return jsxRuntime.jsxs(react.FormControl, {
944
+ mb: 1,
945
+ ...chakraProps,
909
946
  isDisabled: disabled || readonly,
910
947
  isRequired: required,
911
948
  isReadOnly: readonly,
912
949
  isInvalid: rawErrors && rawErrors.length > 0,
913
950
  children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
914
951
  htmlFor: id,
915
- id: id + "-label",
952
+ id: `${id}-label`,
916
953
  children: label
917
954
  }), hideLabel || !label), jsxRuntime.jsx(react.CheckboxGroup, {
918
- onChange: function onChange(option) {
919
- return _onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue));
920
- },
955
+ onChange: option => onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue)),
921
956
  defaultValue: selectedIndexes,
922
957
  "aria-describedby": utils.ariaDescribedByIds(id),
923
958
  children: jsxRuntime.jsx(react.Stack, {
924
959
  direction: row ? 'row' : 'column',
925
- children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
926
- var checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
927
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
960
+ children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
961
+ const checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
962
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
928
963
  return jsxRuntime.jsx(react.Checkbox, {
929
964
  id: utils.optionId(id, index),
930
965
  name: id,
@@ -940,51 +975,53 @@ function CheckboxesWidget(props) {
940
975
  })
941
976
  })
942
977
  })]
943
- }));
978
+ });
944
979
  }
945
980
 
946
- function RadioWidget(_ref) {
947
- var _enumOptionsIndexForV;
948
- var id = _ref.id,
949
- options = _ref.options,
950
- value = _ref.value,
951
- required = _ref.required,
952
- disabled = _ref.disabled,
953
- readonly = _ref.readonly,
954
- label = _ref.label,
955
- hideLabel = _ref.hideLabel,
956
- onChange = _ref.onChange,
957
- onBlur = _ref.onBlur,
958
- onFocus = _ref.onFocus,
959
- uiSchema = _ref.uiSchema;
960
- var enumOptions = options.enumOptions,
961
- enumDisabled = options.enumDisabled,
962
- emptyValue = options.emptyValue;
963
- var chakraProps = getChakra({
964
- uiSchema: uiSchema
981
+ function RadioWidget({
982
+ id,
983
+ options,
984
+ value,
985
+ required,
986
+ disabled,
987
+ readonly,
988
+ label,
989
+ hideLabel,
990
+ onChange,
991
+ onBlur,
992
+ onFocus,
993
+ uiSchema
994
+ }) {
995
+ const {
996
+ enumOptions,
997
+ enumDisabled,
998
+ emptyValue
999
+ } = options;
1000
+ const chakraProps = getChakra({
1001
+ uiSchema
965
1002
  });
966
- var _onChange = function _onChange(nextValue) {
967
- return onChange(utils.enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
968
- };
969
- var _onBlur = function _onBlur(_ref2) {
970
- var value = _ref2.target.value;
971
- return onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
972
- };
973
- var _onFocus = function _onFocus(_ref3) {
974
- var value = _ref3.target.value;
975
- return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
976
- };
977
- var row = options ? options.inline : false;
978
- var selectedIndex = (_enumOptionsIndexForV = utils.enumOptionsIndexForValue(value, enumOptions)) != null ? _enumOptionsIndexForV : null;
979
- return jsxRuntime.jsxs(react.FormControl, _extends({
980
- mb: 1
981
- }, chakraProps, {
1003
+ const _onChange = nextValue => onChange(utils.enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
1004
+ const _onBlur = ({
1005
+ target: {
1006
+ value
1007
+ }
1008
+ }) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1009
+ const _onFocus = ({
1010
+ target: {
1011
+ value
1012
+ }
1013
+ }) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1014
+ const row = options ? options.inline : false;
1015
+ const selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions) ?? null;
1016
+ return jsxRuntime.jsxs(react.FormControl, {
1017
+ mb: 1,
1018
+ ...chakraProps,
982
1019
  isDisabled: disabled || readonly,
983
1020
  isRequired: required,
984
1021
  isReadOnly: readonly,
985
1022
  children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
986
1023
  htmlFor: id,
987
- id: id + "-label",
1024
+ id: `${id}-label`,
988
1025
  children: label
989
1026
  }), hideLabel || !label), jsxRuntime.jsx(react.RadioGroup, {
990
1027
  onChange: _onChange,
@@ -995,8 +1032,8 @@ function RadioWidget(_ref) {
995
1032
  "aria-describedby": utils.ariaDescribedByIds(id),
996
1033
  children: jsxRuntime.jsx(react.Stack, {
997
1034
  direction: row ? 'row' : 'column',
998
- children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
999
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1035
+ children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1036
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1000
1037
  return jsxRuntime.jsx(react.Radio, {
1001
1038
  value: String(index),
1002
1039
  id: utils.optionId(id, index),
@@ -1006,48 +1043,51 @@ function RadioWidget(_ref) {
1006
1043
  })
1007
1044
  })
1008
1045
  })]
1009
- }));
1046
+ });
1010
1047
  }
1011
1048
 
1012
- function RangeWidget(_ref) {
1013
- var value = _ref.value,
1014
- readonly = _ref.readonly,
1015
- disabled = _ref.disabled,
1016
- onBlur = _ref.onBlur,
1017
- onFocus = _ref.onFocus,
1018
- options = _ref.options,
1019
- schema = _ref.schema,
1020
- uiSchema = _ref.uiSchema,
1021
- onChange = _ref.onChange,
1022
- label = _ref.label,
1023
- hideLabel = _ref.hideLabel,
1024
- id = _ref.id;
1025
- var chakraProps = getChakra({
1026
- uiSchema: uiSchema
1049
+ function RangeWidget({
1050
+ value,
1051
+ readonly,
1052
+ disabled,
1053
+ onBlur,
1054
+ onFocus,
1055
+ options,
1056
+ schema,
1057
+ uiSchema,
1058
+ onChange,
1059
+ label,
1060
+ hideLabel,
1061
+ id
1062
+ }) {
1063
+ const chakraProps = getChakra({
1064
+ uiSchema
1027
1065
  });
1028
- var sliderWidgetProps = _extends({
1029
- value: value,
1030
- label: label,
1031
- id: id
1032
- }, utils.rangeSpec(schema));
1033
- var _onChange = function _onChange(value) {
1034
- return onChange(value === undefined ? options.emptyValue : value);
1035
- };
1036
- var _onBlur = function _onBlur(_ref2) {
1037
- var value = _ref2.target.value;
1038
- return onBlur(id, value);
1039
- };
1040
- var _onFocus = function _onFocus(_ref3) {
1041
- var value = _ref3.target.value;
1042
- return onFocus(id, value);
1066
+ const sliderWidgetProps = {
1067
+ value,
1068
+ label,
1069
+ id,
1070
+ ...utils.rangeSpec(schema)
1043
1071
  };
1044
- return jsxRuntime.jsxs(react.FormControl, _extends({
1045
- mb: 1
1046
- }, chakraProps, {
1072
+ const _onChange = value => onChange(value === undefined ? options.emptyValue : value);
1073
+ const _onBlur = ({
1074
+ target: {
1075
+ value
1076
+ }
1077
+ }) => onBlur(id, value);
1078
+ const _onFocus = ({
1079
+ target: {
1080
+ value
1081
+ }
1082
+ }) => onFocus(id, value);
1083
+ return jsxRuntime.jsxs(react.FormControl, {
1084
+ mb: 1,
1085
+ ...chakraProps,
1047
1086
  children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
1048
1087
  htmlFor: id,
1049
1088
  children: label
1050
- }), hideLabel || !label), jsxRuntime.jsxs(react.Slider, _extends({}, sliderWidgetProps, {
1089
+ }), hideLabel || !label), jsxRuntime.jsxs(react.Slider, {
1090
+ ...sliderWidgetProps,
1051
1091
  id: id,
1052
1092
  name: id,
1053
1093
  isDisabled: disabled || readonly,
@@ -1058,82 +1098,89 @@ function RangeWidget(_ref) {
1058
1098
  children: [jsxRuntime.jsx(react.SliderTrack, {
1059
1099
  children: jsxRuntime.jsx(react.SliderFilledTrack, {})
1060
1100
  }), jsxRuntime.jsx(react.SliderThumb, {})]
1061
- }))]
1062
- }));
1101
+ })]
1102
+ });
1063
1103
  }
1064
1104
 
1065
1105
  function SelectWidget(props) {
1066
- var id = props.id,
1067
- options = props.options,
1068
- label = props.label,
1069
- hideLabel = props.hideLabel,
1070
- placeholder = props.placeholder,
1071
- multiple = props.multiple,
1072
- required = props.required,
1073
- disabled = props.disabled,
1074
- readonly = props.readonly,
1075
- value = props.value,
1076
- autofocus = props.autofocus,
1077
- onChange = props.onChange,
1078
- onBlur = props.onBlur,
1079
- onFocus = props.onFocus,
1080
- _props$rawErrors = props.rawErrors,
1081
- rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
1082
- uiSchema = props.uiSchema;
1083
- var enumOptions = options.enumOptions,
1084
- enumDisabled = options.enumDisabled,
1085
- emptyValue = options.emptyValue;
1086
- var chakraProps = getChakra({
1087
- uiSchema: uiSchema
1106
+ const {
1107
+ id,
1108
+ options,
1109
+ label,
1110
+ hideLabel,
1111
+ placeholder,
1112
+ multiple,
1113
+ required,
1114
+ disabled,
1115
+ readonly,
1116
+ value,
1117
+ autofocus,
1118
+ onChange,
1119
+ onBlur,
1120
+ onFocus,
1121
+ rawErrors = [],
1122
+ uiSchema
1123
+ } = props;
1124
+ const {
1125
+ enumOptions,
1126
+ enumDisabled,
1127
+ emptyValue
1128
+ } = options;
1129
+ const chakraProps = getChakra({
1130
+ uiSchema
1088
1131
  });
1089
- var _onMultiChange = function _onMultiChange(e) {
1090
- return onChange(utils.enumOptionsValueForIndex(e.map(function (v) {
1132
+ const _onMultiChange = e => {
1133
+ return onChange(utils.enumOptionsValueForIndex(e.map(v => {
1091
1134
  return v.value;
1092
1135
  }), enumOptions, emptyValue));
1093
1136
  };
1094
- var _onChange = function _onChange(e) {
1137
+ const _onChange = e => {
1095
1138
  return onChange(utils.enumOptionsValueForIndex(e.value, enumOptions, emptyValue));
1096
1139
  };
1097
- var _onBlur = function _onBlur(_ref) {
1098
- var value = _ref.target.value;
1099
- return onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1100
- };
1101
- var _onFocus = function _onFocus(_ref2) {
1102
- var value = _ref2.target.value;
1103
- return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1104
- };
1105
- var _valueLabelMap = {};
1106
- var displayEnumOptions = Array.isArray(enumOptions) ? enumOptions.map(function (option, index) {
1107
- var value = option.value,
1108
- label = option.label;
1140
+ const _onBlur = ({
1141
+ target: {
1142
+ value
1143
+ }
1144
+ }) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1145
+ const _onFocus = ({
1146
+ target: {
1147
+ value
1148
+ }
1149
+ }) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
1150
+ const _valueLabelMap = {};
1151
+ const displayEnumOptions = Array.isArray(enumOptions) ? enumOptions.map((option, index) => {
1152
+ const {
1153
+ value,
1154
+ label
1155
+ } = option;
1109
1156
  _valueLabelMap[index] = label || String(value);
1110
1157
  return {
1111
- label: label,
1158
+ label,
1112
1159
  value: String(index),
1113
1160
  isDisabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1
1114
1161
  };
1115
1162
  }) : [];
1116
- var isMultiple = typeof multiple !== 'undefined' && Boolean(enumOptions);
1117
- var selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions, isMultiple);
1118
- var formValue = isMultiple ? (selectedIndex || []).map(function (i) {
1163
+ const isMultiple = typeof multiple !== 'undefined' && Boolean(enumOptions);
1164
+ const selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions, isMultiple);
1165
+ const formValue = isMultiple ? (selectedIndex || []).map(i => {
1119
1166
  return {
1120
1167
  label: _valueLabelMap[i],
1121
1168
  value: i
1122
1169
  };
1123
1170
  }) : {
1124
1171
  label: _valueLabelMap[selectedIndex] || '',
1125
- selectedIndex: selectedIndex
1172
+ selectedIndex
1126
1173
  };
1127
- return jsxRuntime.jsxs(react.FormControl, _extends({
1128
- mb: 1
1129
- }, chakraProps, {
1174
+ return jsxRuntime.jsxs(react.FormControl, {
1175
+ mb: 1,
1176
+ ...chakraProps,
1130
1177
  isDisabled: disabled || readonly,
1131
1178
  isRequired: required,
1132
1179
  isReadOnly: readonly,
1133
1180
  isInvalid: rawErrors && rawErrors.length > 0,
1134
1181
  children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
1135
1182
  htmlFor: id,
1136
- id: id + "-label",
1183
+ id: `${id}-label`,
1137
1184
  children: label
1138
1185
  }), hideLabel || !label), jsxRuntime.jsx(chakraReactSelect.Select, {
1139
1186
  inputId: id,
@@ -1149,43 +1196,47 @@ function SelectWidget(props) {
1149
1196
  value: formValue,
1150
1197
  "aria-describedby": utils.ariaDescribedByIds(id)
1151
1198
  })]
1152
- }));
1199
+ });
1153
1200
  }
1154
1201
 
1155
- function TextareaWidget(_ref) {
1156
- var id = _ref.id,
1157
- placeholder = _ref.placeholder,
1158
- value = _ref.value,
1159
- label = _ref.label,
1160
- hideLabel = _ref.hideLabel,
1161
- disabled = _ref.disabled,
1162
- autofocus = _ref.autofocus,
1163
- readonly = _ref.readonly,
1164
- onBlur = _ref.onBlur,
1165
- onFocus = _ref.onFocus,
1166
- onChange = _ref.onChange,
1167
- options = _ref.options,
1168
- uiSchema = _ref.uiSchema,
1169
- required = _ref.required,
1170
- rawErrors = _ref.rawErrors;
1171
- var chakraProps = getChakra({
1172
- uiSchema: uiSchema
1202
+ function TextareaWidget({
1203
+ id,
1204
+ placeholder,
1205
+ value,
1206
+ label,
1207
+ hideLabel,
1208
+ disabled,
1209
+ autofocus,
1210
+ readonly,
1211
+ onBlur,
1212
+ onFocus,
1213
+ onChange,
1214
+ options,
1215
+ uiSchema,
1216
+ required,
1217
+ rawErrors
1218
+ }) {
1219
+ const chakraProps = getChakra({
1220
+ uiSchema
1173
1221
  });
1174
- var _onChange = function _onChange(_ref2) {
1175
- var value = _ref2.target.value;
1176
- return onChange(value === '' ? options.emptyValue : value);
1177
- };
1178
- var _onBlur = function _onBlur(_ref3) {
1179
- var value = _ref3.target.value;
1180
- return onBlur(id, value);
1181
- };
1182
- var _onFocus = function _onFocus(_ref4) {
1183
- var value = _ref4.target.value;
1184
- return onFocus(id, value);
1185
- };
1186
- return jsxRuntime.jsxs(react.FormControl, _extends({
1187
- mb: 1
1188
- }, chakraProps, {
1222
+ const _onChange = ({
1223
+ target: {
1224
+ value
1225
+ }
1226
+ }) => onChange(value === '' ? options.emptyValue : value);
1227
+ const _onBlur = ({
1228
+ target: {
1229
+ value
1230
+ }
1231
+ }) => onBlur(id, value);
1232
+ const _onFocus = ({
1233
+ target: {
1234
+ value
1235
+ }
1236
+ }) => onFocus(id, value);
1237
+ return jsxRuntime.jsxs(react.FormControl, {
1238
+ mb: 1,
1239
+ ...chakraProps,
1189
1240
  isDisabled: disabled || readonly,
1190
1241
  isRequired: required,
1191
1242
  isReadOnly: readonly,
@@ -1196,7 +1247,7 @@ function TextareaWidget(_ref) {
1196
1247
  }), hideLabel || !label), jsxRuntime.jsx(react.Textarea, {
1197
1248
  id: id,
1198
1249
  name: id,
1199
- value: value != null ? value : '',
1250
+ value: value ?? '',
1200
1251
  placeholder: placeholder,
1201
1252
  autoFocus: autofocus,
1202
1253
  onChange: _onChange,
@@ -1204,39 +1255,41 @@ function TextareaWidget(_ref) {
1204
1255
  onFocus: _onFocus,
1205
1256
  "aria-describedby": utils.ariaDescribedByIds(id)
1206
1257
  })]
1207
- }));
1258
+ });
1208
1259
  }
1209
1260
 
1210
1261
  function UpDownWidget(props) {
1211
- var id = props.id,
1212
- uiSchema = props.uiSchema,
1213
- readonly = props.readonly,
1214
- disabled = props.disabled,
1215
- label = props.label,
1216
- hideLabel = props.hideLabel,
1217
- value = props.value,
1218
- onChange = props.onChange,
1219
- onBlur = props.onBlur,
1220
- onFocus = props.onFocus,
1221
- rawErrors = props.rawErrors,
1222
- required = props.required;
1223
- var chakraProps = getChakra({
1224
- uiSchema: uiSchema
1262
+ const {
1263
+ id,
1264
+ uiSchema,
1265
+ readonly,
1266
+ disabled,
1267
+ label,
1268
+ hideLabel,
1269
+ value,
1270
+ onChange,
1271
+ onBlur,
1272
+ onFocus,
1273
+ rawErrors,
1274
+ required
1275
+ } = props;
1276
+ const chakraProps = getChakra({
1277
+ uiSchema
1225
1278
  });
1226
- var _onChange = function _onChange(value) {
1227
- return onChange(value);
1228
- };
1229
- var _onBlur = function _onBlur(_ref) {
1230
- var value = _ref.target.value;
1231
- return onBlur(id, value);
1232
- };
1233
- var _onFocus = function _onFocus(_ref2) {
1234
- var value = _ref2.target.value;
1235
- return onFocus(id, value);
1236
- };
1237
- return jsxRuntime.jsxs(react.FormControl, _extends({
1238
- mb: 1
1239
- }, chakraProps, {
1279
+ const _onChange = value => onChange(value);
1280
+ const _onBlur = ({
1281
+ target: {
1282
+ value
1283
+ }
1284
+ }) => onBlur(id, value);
1285
+ const _onFocus = ({
1286
+ target: {
1287
+ value
1288
+ }
1289
+ }) => onFocus(id, value);
1290
+ return jsxRuntime.jsxs(react.FormControl, {
1291
+ mb: 1,
1292
+ ...chakraProps,
1240
1293
  isDisabled: disabled || readonly,
1241
1294
  isRequired: required,
1242
1295
  isReadOnly: readonly,
@@ -1245,7 +1298,7 @@ function UpDownWidget(props) {
1245
1298
  htmlFor: id,
1246
1299
  children: label
1247
1300
  }), hideLabel || !label), jsxRuntime.jsxs(react.NumberInput, {
1248
- value: value != null ? value : '',
1301
+ value: value ?? '',
1249
1302
  onChange: _onChange,
1250
1303
  onBlur: _onBlur,
1251
1304
  onFocus: _onFocus,
@@ -1257,20 +1310,20 @@ function UpDownWidget(props) {
1257
1310
  children: [jsxRuntime.jsx(react.NumberIncrementStepper, {}), jsxRuntime.jsx(react.NumberDecrementStepper, {})]
1258
1311
  })]
1259
1312
  })]
1260
- }));
1313
+ });
1261
1314
  }
1262
1315
 
1263
1316
  function generateWidgets() {
1264
1317
  return {
1265
- AltDateTimeWidget: AltDateTimeWidget,
1266
- AltDateWidget: AltDateWidget,
1267
- CheckboxWidget: CheckboxWidget,
1268
- CheckboxesWidget: CheckboxesWidget,
1269
- RadioWidget: RadioWidget,
1270
- RangeWidget: RangeWidget,
1271
- SelectWidget: SelectWidget,
1272
- TextareaWidget: TextareaWidget,
1273
- UpDownWidget: UpDownWidget
1318
+ AltDateTimeWidget,
1319
+ AltDateWidget,
1320
+ CheckboxWidget,
1321
+ CheckboxesWidget,
1322
+ RadioWidget,
1323
+ RangeWidget,
1324
+ SelectWidget,
1325
+ TextareaWidget,
1326
+ UpDownWidget
1274
1327
  };
1275
1328
  }
1276
1329
  var Widgets = /*#__PURE__*/generateWidgets();
@@ -1309,11 +1362,249 @@ var Form = /*#__PURE__*/generateForm();
1309
1362
 
1310
1363
  It is located at the bottom of the styles string.
1311
1364
  */
1312
- var CSSReset = function CSSReset() {
1313
- return jsxRuntime.jsx(react$2.Global, {
1314
- styles: "\n html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n font-family: system-ui, sans-serif;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -moz-osx-font-smoothing: grayscale;\n touch-action: manipulation;\n }\n body {\n position: relative;\n min-height: 100%;\n font-feature-settings: 'kern';\n }\n *,\n *::before,\n *::after {\n border-width: 0;\n border-style: solid;\n box-sizing: border-box;\n }\n main {\n display: block;\n }\n hr {\n border-top-width: 1px;\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n pre,\n code,\n kbd,\n samp {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 1em;\n }\n a {\n background-color: transparent;\n color: inherit;\n text-decoration: inherit;\n }\n abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n b,\n strong {\n font-weight: bold;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n img {\n border-style: none;\n }\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n button,\n input {\n overflow: visible;\n }\n button,\n select {\n text-transform: none;\n }\n button::-moz-focus-inner,\n [type=\"button\"]::-moz-focus-inner,\n [type=\"reset\"]::-moz-focus-inner,\n [type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n progress {\n vertical-align: baseline;\n }\n textarea {\n overflow: auto;\n }\n [type=\"checkbox\"],\n [type=\"radio\"] {\n box-sizing: border-box;\n padding: 0;\n }\n [type=\"number\"]::-webkit-inner-spin-button,\n [type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n [type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n [type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n details {\n display: block;\n }\n summary {\n display: list-item;\n }\n template {\n display: none;\n }\n [hidden] {\n display: none !important;\n }\n body,\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n button {\n background: transparent;\n padding: 0;\n }\n fieldset {\n margin: 0;\n padding: 0;\n }\n ol,\n ul {\n margin: 0;\n padding: 0;\n }\n textarea {\n resize: vertical;\n }\n button,\n [role=\"button\"] {\n cursor: pointer;\n }\n button::-moz-focus-inner {\n border: 0 !important;\n }\n table {\n border-collapse: collapse;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n button,\n input,\n optgroup,\n select,\n textarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n [data-js-focus-visible] :focus:not([data-focus-visible-added]) {\n outline: none;\n box-shadow: none;\n }\n select::-ms-expand {\n display: none;\n }\n input {\n border-width: revert;\n border-color: revert;\n border-style: revert;\n }\n .array-item > hr {\n margin-top: 16px;\n margin-bottom: 16px;\n }\n "
1315
- });
1316
- };
1365
+ const CSSReset = () => jsxRuntime.jsx(react$2.Global, {
1366
+ styles: `
1367
+ html {
1368
+ line-height: 1.5;
1369
+ -webkit-text-size-adjust: 100%;
1370
+ font-family: system-ui, sans-serif;
1371
+ -webkit-font-smoothing: antialiased;
1372
+ text-rendering: optimizeLegibility;
1373
+ -moz-osx-font-smoothing: grayscale;
1374
+ touch-action: manipulation;
1375
+ }
1376
+ body {
1377
+ position: relative;
1378
+ min-height: 100%;
1379
+ font-feature-settings: 'kern';
1380
+ }
1381
+ *,
1382
+ *::before,
1383
+ *::after {
1384
+ border-width: 0;
1385
+ border-style: solid;
1386
+ box-sizing: border-box;
1387
+ }
1388
+ main {
1389
+ display: block;
1390
+ }
1391
+ hr {
1392
+ border-top-width: 1px;
1393
+ box-sizing: content-box;
1394
+ height: 0;
1395
+ overflow: visible;
1396
+ }
1397
+ pre,
1398
+ code,
1399
+ kbd,
1400
+ samp {
1401
+ font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
1402
+ font-size: 1em;
1403
+ }
1404
+ a {
1405
+ background-color: transparent;
1406
+ color: inherit;
1407
+ text-decoration: inherit;
1408
+ }
1409
+ abbr[title] {
1410
+ border-bottom: none;
1411
+ text-decoration: underline;
1412
+ -webkit-text-decoration: underline dotted;
1413
+ text-decoration: underline dotted;
1414
+ }
1415
+ b,
1416
+ strong {
1417
+ font-weight: bold;
1418
+ }
1419
+ small {
1420
+ font-size: 80%;
1421
+ }
1422
+ sub,
1423
+ sup {
1424
+ font-size: 75%;
1425
+ line-height: 0;
1426
+ position: relative;
1427
+ vertical-align: baseline;
1428
+ }
1429
+ sub {
1430
+ bottom: -0.25em;
1431
+ }
1432
+ sup {
1433
+ top: -0.5em;
1434
+ }
1435
+ img {
1436
+ border-style: none;
1437
+ }
1438
+ button,
1439
+ input,
1440
+ optgroup,
1441
+ select,
1442
+ textarea {
1443
+ font-family: inherit;
1444
+ font-size: 100%;
1445
+ line-height: 1.15;
1446
+ margin: 0;
1447
+ }
1448
+ button,
1449
+ input {
1450
+ overflow: visible;
1451
+ }
1452
+ button,
1453
+ select {
1454
+ text-transform: none;
1455
+ }
1456
+ button::-moz-focus-inner,
1457
+ [type="button"]::-moz-focus-inner,
1458
+ [type="reset"]::-moz-focus-inner,
1459
+ [type="submit"]::-moz-focus-inner {
1460
+ border-style: none;
1461
+ padding: 0;
1462
+ }
1463
+ fieldset {
1464
+ padding: 0.35em 0.75em 0.625em;
1465
+ }
1466
+ legend {
1467
+ box-sizing: border-box;
1468
+ color: inherit;
1469
+ display: table;
1470
+ max-width: 100%;
1471
+ padding: 0;
1472
+ white-space: normal;
1473
+ }
1474
+ progress {
1475
+ vertical-align: baseline;
1476
+ }
1477
+ textarea {
1478
+ overflow: auto;
1479
+ }
1480
+ [type="checkbox"],
1481
+ [type="radio"] {
1482
+ box-sizing: border-box;
1483
+ padding: 0;
1484
+ }
1485
+ [type="number"]::-webkit-inner-spin-button,
1486
+ [type="number"]::-webkit-outer-spin-button {
1487
+ -webkit-appearance: none !important;
1488
+ }
1489
+ input[type="number"] {
1490
+ -moz-appearance: textfield;
1491
+ }
1492
+ [type="search"] {
1493
+ -webkit-appearance: textfield;
1494
+ outline-offset: -2px;
1495
+ }
1496
+ [type="search"]::-webkit-search-decoration {
1497
+ -webkit-appearance: none !important;
1498
+ }
1499
+ ::-webkit-file-upload-button {
1500
+ -webkit-appearance: button;
1501
+ font: inherit;
1502
+ }
1503
+ details {
1504
+ display: block;
1505
+ }
1506
+ summary {
1507
+ display: list-item;
1508
+ }
1509
+ template {
1510
+ display: none;
1511
+ }
1512
+ [hidden] {
1513
+ display: none !important;
1514
+ }
1515
+ body,
1516
+ blockquote,
1517
+ dl,
1518
+ dd,
1519
+ h1,
1520
+ h2,
1521
+ h3,
1522
+ h4,
1523
+ h5,
1524
+ h6,
1525
+ hr,
1526
+ figure,
1527
+ p,
1528
+ pre {
1529
+ margin: 0;
1530
+ }
1531
+ button {
1532
+ background: transparent;
1533
+ padding: 0;
1534
+ }
1535
+ fieldset {
1536
+ margin: 0;
1537
+ padding: 0;
1538
+ }
1539
+ ol,
1540
+ ul {
1541
+ margin: 0;
1542
+ padding: 0;
1543
+ }
1544
+ textarea {
1545
+ resize: vertical;
1546
+ }
1547
+ button,
1548
+ [role="button"] {
1549
+ cursor: pointer;
1550
+ }
1551
+ button::-moz-focus-inner {
1552
+ border: 0 !important;
1553
+ }
1554
+ table {
1555
+ border-collapse: collapse;
1556
+ }
1557
+ h1,
1558
+ h2,
1559
+ h3,
1560
+ h4,
1561
+ h5,
1562
+ h6 {
1563
+ font-size: inherit;
1564
+ font-weight: inherit;
1565
+ }
1566
+ button,
1567
+ input,
1568
+ optgroup,
1569
+ select,
1570
+ textarea {
1571
+ padding: 0;
1572
+ line-height: inherit;
1573
+ color: inherit;
1574
+ }
1575
+ img,
1576
+ svg,
1577
+ video,
1578
+ canvas,
1579
+ audio,
1580
+ iframe,
1581
+ embed,
1582
+ object {
1583
+ display: block;
1584
+ }
1585
+ img,
1586
+ video {
1587
+ max-width: 100%;
1588
+ height: auto;
1589
+ }
1590
+ [data-js-focus-visible] :focus:not([data-focus-visible-added]) {
1591
+ outline: none;
1592
+ box-shadow: none;
1593
+ }
1594
+ select::-ms-expand {
1595
+ display: none;
1596
+ }
1597
+ input {
1598
+ border-width: revert;
1599
+ border-color: revert;
1600
+ border-style: revert;
1601
+ }
1602
+ .array-item > hr {
1603
+ margin-top: 16px;
1604
+ margin-bottom: 16px;
1605
+ }
1606
+ `
1607
+ });
1317
1608
 
1318
1609
  /**
1319
1610
  * __createChakraFrameProvider is used to ensure that <Global> emotion components
@@ -1329,29 +1620,28 @@ var CSSReset = function CSSReset() {
1329
1620
  * From: https://codesandbox.io/s/p98y9o7jz0?file=/src/frame-provider.js:0-650
1330
1621
  * Also see: https://github.com/emotion-js/emotion/issues/760#issuecomment-404353706
1331
1622
  */
1332
- var memoizedCreateCacheWithContainer = /*#__PURE__*/weakMemoize__default["default"](function (container) {
1333
- var newCache = createCache__default["default"]({
1334
- container: container,
1623
+ const memoizedCreateCacheWithContainer = /*#__PURE__*/weakMemoize__default["default"](container => {
1624
+ const newCache = createCache__default["default"]({
1625
+ container,
1335
1626
  key: 'rjsf'
1336
1627
  });
1337
1628
  return newCache;
1338
1629
  });
1339
- var __createChakraFrameProvider = function __createChakraFrameProvider(props) {
1340
- return function (_ref) {
1341
- var document = _ref.document;
1342
- return jsxRuntime.jsx("div", {
1343
- style: {
1344
- margin: 2
1345
- },
1346
- children: jsxRuntime.jsx(react$2.CacheProvider, {
1347
- value: memoizedCreateCacheWithContainer(document.head),
1348
- children: jsxRuntime.jsxs(react.ChakraProvider, {
1349
- resetCSS: false,
1350
- children: [jsxRuntime.jsx(CSSReset, {}), props.children]
1351
- })
1630
+ const __createChakraFrameProvider = props => ({
1631
+ document
1632
+ }) => {
1633
+ return jsxRuntime.jsx("div", {
1634
+ style: {
1635
+ margin: 2
1636
+ },
1637
+ children: jsxRuntime.jsx(react$2.CacheProvider, {
1638
+ value: memoizedCreateCacheWithContainer(document.head),
1639
+ children: jsxRuntime.jsxs(react.ChakraProvider, {
1640
+ resetCSS: false,
1641
+ children: [jsxRuntime.jsx(CSSReset, {}), props.children]
1352
1642
  })
1353
- });
1354
- };
1643
+ })
1644
+ });
1355
1645
  };
1356
1646
 
1357
1647
  exports.Form = Form;