@rjsf/mui 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.
package/dist/mui.esm.js CHANGED
@@ -30,46 +30,22 @@ import RadioGroup from '@mui/material/RadioGroup';
30
30
  import Slider from '@mui/material/Slider';
31
31
  import MenuItem from '@mui/material/MenuItem';
32
32
 
33
- function _extends() {
34
- _extends = Object.assign ? Object.assign.bind() : function (target) {
35
- for (var i = 1; i < arguments.length; i++) {
36
- var source = arguments[i];
37
- for (var key in source) {
38
- if (Object.prototype.hasOwnProperty.call(source, key)) {
39
- target[key] = source[key];
40
- }
41
- }
42
- }
43
- return target;
44
- };
45
- return _extends.apply(this, arguments);
46
- }
47
- function _objectWithoutPropertiesLoose(source, excluded) {
48
- if (source == null) return {};
49
- var target = {};
50
- var sourceKeys = Object.keys(source);
51
- var key, i;
52
- for (i = 0; i < sourceKeys.length; i++) {
53
- key = sourceKeys[i];
54
- if (excluded.indexOf(key) >= 0) continue;
55
- target[key] = source[key];
56
- }
57
- return target;
58
- }
59
-
60
- var _excluded$4 = ["uiSchema", "registry"];
61
33
  /** The `AddButton` renders a button that represent the `Add` action on a form
62
34
  */
63
- function AddButton(_ref) {
64
- var registry = _ref.registry,
65
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
66
- var translateString = registry.translateString;
67
- return jsx(IconButton, _extends({
68
- title: translateString(TranslatableString.AddItemButton)
69
- }, props, {
35
+ function AddButton({
36
+ uiSchema,
37
+ registry,
38
+ ...props
39
+ }) {
40
+ const {
41
+ translateString
42
+ } = registry;
43
+ return jsx(IconButton, {
44
+ title: translateString(TranslatableString.AddItemButton),
45
+ ...props,
70
46
  color: 'primary',
71
47
  children: jsx(AddIcon, {})
72
- }));
48
+ });
73
49
  }
74
50
 
75
51
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
@@ -77,26 +53,29 @@ function AddButton(_ref) {
77
53
  * @param props - The `ArrayFieldTemplateItemType` props for the component
78
54
  */
79
55
  function ArrayFieldItemTemplate(props) {
80
- var children = props.children,
81
- disabled = props.disabled,
82
- hasToolbar = props.hasToolbar,
83
- hasCopy = props.hasCopy,
84
- hasMoveDown = props.hasMoveDown,
85
- hasMoveUp = props.hasMoveUp,
86
- hasRemove = props.hasRemove,
87
- index = props.index,
88
- onCopyIndexClick = props.onCopyIndexClick,
89
- onDropIndexClick = props.onDropIndexClick,
90
- onReorderClick = props.onReorderClick,
91
- readonly = props.readonly,
92
- uiSchema = props.uiSchema,
93
- registry = props.registry;
94
- var _registry$templates$B = registry.templates.ButtonTemplates,
95
- CopyButton = _registry$templates$B.CopyButton,
96
- MoveDownButton = _registry$templates$B.MoveDownButton,
97
- MoveUpButton = _registry$templates$B.MoveUpButton,
98
- RemoveButton = _registry$templates$B.RemoveButton;
99
- var btnStyle = {
56
+ const {
57
+ children,
58
+ disabled,
59
+ hasToolbar,
60
+ hasCopy,
61
+ hasMoveDown,
62
+ hasMoveUp,
63
+ hasRemove,
64
+ index,
65
+ onCopyIndexClick,
66
+ onDropIndexClick,
67
+ onReorderClick,
68
+ readonly,
69
+ uiSchema,
70
+ registry
71
+ } = props;
72
+ const {
73
+ CopyButton,
74
+ MoveDownButton,
75
+ MoveUpButton,
76
+ RemoveButton
77
+ } = registry.templates.ButtonTemplates;
78
+ const btnStyle = {
100
79
  flex: 1,
101
80
  paddingLeft: 6,
102
81
  paddingRight: 6,
@@ -153,29 +132,34 @@ function ArrayFieldItemTemplate(props) {
153
132
  });
154
133
  }
155
134
 
156
- var _excluded$3 = ["key"];
157
135
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
158
136
  *
159
137
  * @param props - The `ArrayFieldTemplateItemType` props for the component
160
138
  */
161
139
  function ArrayFieldTemplate(props) {
162
- var canAdd = props.canAdd,
163
- disabled = props.disabled,
164
- idSchema = props.idSchema,
165
- uiSchema = props.uiSchema,
166
- items = props.items,
167
- onAddClick = props.onAddClick,
168
- readonly = props.readonly,
169
- registry = props.registry,
170
- required = props.required,
171
- schema = props.schema,
172
- title = props.title;
173
- var uiOptions = getUiOptions(uiSchema);
174
- var ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
175
- var ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
176
- var ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
140
+ const {
141
+ canAdd,
142
+ disabled,
143
+ idSchema,
144
+ uiSchema,
145
+ items,
146
+ onAddClick,
147
+ readonly,
148
+ registry,
149
+ required,
150
+ schema,
151
+ title
152
+ } = props;
153
+ const uiOptions = getUiOptions(uiSchema);
154
+ const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
155
+ const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
156
+ const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
177
157
  // Button templates are not overridden in the uiSchema
178
- var AddButton = registry.templates.ButtonTemplates.AddButton;
158
+ const {
159
+ ButtonTemplates: {
160
+ AddButton
161
+ }
162
+ } = registry.templates;
179
163
  return jsx(Paper, {
180
164
  elevation: 2,
181
165
  children: jsxs(Box, {
@@ -195,11 +179,12 @@ function ArrayFieldTemplate(props) {
195
179
  registry: registry
196
180
  }), jsxs(Grid, {
197
181
  container: true,
198
- children: [items && items.map(function (_ref) {
199
- var key = _ref.key,
200
- itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$3);
201
- return jsx(ArrayFieldItemTemplate, _extends({}, itemProps), key);
202
- }), canAdd && jsx(Grid, {
182
+ children: [items && items.map(({
183
+ key,
184
+ ...itemProps
185
+ }) => jsx(ArrayFieldItemTemplate, {
186
+ ...itemProps
187
+ }, key)), canAdd && jsx(Grid, {
203
188
  container: true,
204
189
  justifyContent: 'flex-end',
205
190
  children: jsx(Grid, {
@@ -216,14 +201,12 @@ function ArrayFieldTemplate(props) {
216
201
  })
217
202
  })
218
203
  })]
219
- }, "array-item-list-" + idSchema.$id)]
204
+ }, `array-item-list-${idSchema.$id}`)]
220
205
  })
221
206
  });
222
207
  }
223
208
 
224
- var _excluded$2 = ["id", "name", "placeholder", "required", "readonly", "disabled", "type", "label", "hideLabel", "value", "onChange", "onChangeOverride", "onBlur", "onFocus", "autofocus", "options", "schema", "uiSchema", "rawErrors", "formContext", "registry", "InputLabelProps"],
225
- _excluded2$1 = ["step", "min", "max"];
226
- var TYPES_THAT_SHRINK_LABEL = ['date', 'datetime-local', 'file', 'time'];
209
+ const TYPES_THAT_SHRINK_LABEL = ['date', 'datetime-local', 'file', 'time'];
227
210
  /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
228
211
  * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
229
212
  * It can be customized/overridden for other themes or individual implementations as needed.
@@ -231,77 +214,91 @@ var TYPES_THAT_SHRINK_LABEL = ['date', 'datetime-local', 'file', 'time'];
231
214
  * @param props - The `WidgetProps` for this template
232
215
  */
233
216
  function BaseInputTemplate(props) {
234
- var id = props.id,
235
- placeholder = props.placeholder,
236
- required = props.required,
237
- readonly = props.readonly,
238
- disabled = props.disabled,
239
- type = props.type,
240
- label = props.label,
241
- hideLabel = props.hideLabel,
242
- value = props.value,
243
- onChange = props.onChange,
244
- onChangeOverride = props.onChangeOverride,
245
- onBlur = props.onBlur,
246
- onFocus = props.onFocus,
247
- autofocus = props.autofocus,
248
- options = props.options,
249
- schema = props.schema,
250
- _props$rawErrors = props.rawErrors,
251
- rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
252
- InputLabelProps = props.InputLabelProps,
253
- textFieldProps = _objectWithoutPropertiesLoose(props, _excluded$2);
254
- var inputProps = getInputProps(schema, type, options);
217
+ const {
218
+ id,
219
+ name,
220
+ // remove this from textFieldProps
221
+ placeholder,
222
+ required,
223
+ readonly,
224
+ disabled,
225
+ type,
226
+ label,
227
+ hideLabel,
228
+ value,
229
+ onChange,
230
+ onChangeOverride,
231
+ onBlur,
232
+ onFocus,
233
+ autofocus,
234
+ options,
235
+ schema,
236
+ uiSchema,
237
+ rawErrors = [],
238
+ formContext,
239
+ registry,
240
+ InputLabelProps,
241
+ ...textFieldProps
242
+ } = props;
243
+ const inputProps = getInputProps(schema, type, options);
255
244
  // Now we need to pull out the step, min, max into an inner `inputProps` for material-ui
256
- var step = inputProps.step,
257
- min = inputProps.min,
258
- max = inputProps.max,
259
- rest = _objectWithoutPropertiesLoose(inputProps, _excluded2$1);
260
- var otherProps = _extends({
261
- inputProps: _extends({
262
- step: step,
263
- min: min,
264
- max: max
265
- }, schema.examples ? {
266
- list: examplesId(id)
267
- } : undefined)
268
- }, rest);
269
- var _onChange = function _onChange(_ref) {
270
- var value = _ref.target.value;
271
- return onChange(value === '' ? options.emptyValue : value);
272
- };
273
- var _onBlur = function _onBlur(_ref2) {
274
- var value = _ref2.target.value;
275
- return onBlur(id, value);
276
- };
277
- var _onFocus = function _onFocus(_ref3) {
278
- var value = _ref3.target.value;
279
- return onFocus(id, value);
245
+ const {
246
+ step,
247
+ min,
248
+ max,
249
+ ...rest
250
+ } = inputProps;
251
+ const otherProps = {
252
+ inputProps: {
253
+ step,
254
+ min,
255
+ max,
256
+ ...(schema.examples ? {
257
+ list: examplesId(id)
258
+ } : undefined)
259
+ },
260
+ ...rest
280
261
  };
281
- var DisplayInputLabelProps = TYPES_THAT_SHRINK_LABEL.includes(type) ? _extends({}, InputLabelProps, {
262
+ const _onChange = ({
263
+ target: {
264
+ value
265
+ }
266
+ }) => onChange(value === '' ? options.emptyValue : value);
267
+ const _onBlur = ({
268
+ target: {
269
+ value
270
+ }
271
+ }) => onBlur(id, value);
272
+ const _onFocus = ({
273
+ target: {
274
+ value
275
+ }
276
+ }) => onFocus(id, value);
277
+ const DisplayInputLabelProps = TYPES_THAT_SHRINK_LABEL.includes(type) ? {
278
+ ...InputLabelProps,
282
279
  shrink: true
283
- }) : InputLabelProps;
280
+ } : InputLabelProps;
284
281
  return jsxs(Fragment, {
285
- children: [jsx(TextField, _extends({
282
+ children: [jsx(TextField, {
286
283
  id: id,
287
284
  name: id,
288
285
  placeholder: placeholder,
289
286
  label: labelValue(label || undefined, hideLabel, false),
290
287
  autoFocus: autofocus,
291
288
  required: required,
292
- disabled: disabled || readonly
293
- }, otherProps, {
289
+ disabled: disabled || readonly,
290
+ ...otherProps,
294
291
  value: value || value === 0 ? value : '',
295
292
  error: rawErrors.length > 0,
296
293
  onChange: onChangeOverride || _onChange,
297
294
  onBlur: _onBlur,
298
295
  onFocus: _onFocus,
299
- InputLabelProps: DisplayInputLabelProps
300
- }, textFieldProps, {
296
+ InputLabelProps: DisplayInputLabelProps,
297
+ ...textFieldProps,
301
298
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
302
- })), Array.isArray(schema.examples) && jsx("datalist", {
299
+ }), Array.isArray(schema.examples) && jsx("datalist", {
303
300
  id: examplesId(id),
304
- children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
301
+ children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
305
302
  return jsx("option", {
306
303
  value: example
307
304
  }, example);
@@ -315,8 +312,10 @@ function BaseInputTemplate(props) {
315
312
  * @param props - The `DescriptionFieldProps` for this component
316
313
  */
317
314
  function DescriptionField(props) {
318
- var id = props.id,
319
- description = props.description;
315
+ const {
316
+ id,
317
+ description
318
+ } = props;
320
319
  if (description) {
321
320
  return jsx(Typography, {
322
321
  id: id,
@@ -334,10 +333,13 @@ function DescriptionField(props) {
334
333
  *
335
334
  * @param props - The `ErrorListProps` for this component
336
335
  */
337
- function ErrorList(_ref) {
338
- var errors = _ref.errors,
339
- registry = _ref.registry;
340
- var translateString = registry.translateString;
336
+ function ErrorList({
337
+ errors,
338
+ registry
339
+ }) {
340
+ const {
341
+ translateString
342
+ } = registry;
341
343
  return jsx(Paper, {
342
344
  elevation: 2,
343
345
  children: jsxs(Box, {
@@ -348,7 +350,7 @@ function ErrorList(_ref) {
348
350
  children: translateString(TranslatableString.ErrorsLabel)
349
351
  }), jsx(List, {
350
352
  dense: true,
351
- children: errors.map(function (error, i) {
353
+ children: errors.map((error, i) => {
352
354
  return jsxs(ListItem, {
353
355
  children: [jsx(ListItemIcon, {
354
356
  children: jsx(ErrorIcon, {
@@ -364,60 +366,81 @@ function ErrorList(_ref) {
364
366
  });
365
367
  }
366
368
 
367
- var _excluded$1 = ["icon", "color", "uiSchema", "registry"],
368
- _excluded2 = ["iconType"];
369
369
  function MuiIconButton(props) {
370
- var icon = props.icon,
371
- color = props.color,
372
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
373
- return jsx(IconButton, _extends({}, otherProps, {
370
+ const {
371
+ icon,
372
+ color,
373
+ uiSchema,
374
+ registry,
375
+ ...otherProps
376
+ } = props;
377
+ return jsx(IconButton, {
378
+ ...otherProps,
374
379
  size: 'small',
375
380
  color: color,
376
381
  children: icon
377
- }));
382
+ });
378
383
  }
379
384
  function CopyButton(props) {
380
- var translateString = props.registry.translateString;
381
- return jsx(MuiIconButton, _extends({
382
- title: translateString(TranslatableString.CopyButton)
383
- }, props, {
385
+ const {
386
+ registry: {
387
+ translateString
388
+ }
389
+ } = props;
390
+ return jsx(MuiIconButton, {
391
+ title: translateString(TranslatableString.CopyButton),
392
+ ...props,
384
393
  icon: jsx(CopyIcon, {
385
394
  fontSize: 'small'
386
395
  })
387
- }));
396
+ });
388
397
  }
389
398
  function MoveDownButton(props) {
390
- var translateString = props.registry.translateString;
391
- return jsx(MuiIconButton, _extends({
392
- title: translateString(TranslatableString.MoveDownButton)
393
- }, props, {
399
+ const {
400
+ registry: {
401
+ translateString
402
+ }
403
+ } = props;
404
+ return jsx(MuiIconButton, {
405
+ title: translateString(TranslatableString.MoveDownButton),
406
+ ...props,
394
407
  icon: jsx(ArrowDownwardIcon, {
395
408
  fontSize: 'small'
396
409
  })
397
- }));
410
+ });
398
411
  }
399
412
  function MoveUpButton(props) {
400
- var translateString = props.registry.translateString;
401
- return jsx(MuiIconButton, _extends({
402
- title: translateString(TranslatableString.MoveUpButton)
403
- }, props, {
413
+ const {
414
+ registry: {
415
+ translateString
416
+ }
417
+ } = props;
418
+ return jsx(MuiIconButton, {
419
+ title: translateString(TranslatableString.MoveUpButton),
420
+ ...props,
404
421
  icon: jsx(ArrowUpwardIcon, {
405
422
  fontSize: 'small'
406
423
  })
407
- }));
424
+ });
408
425
  }
409
426
  function RemoveButton(props) {
410
- var iconType = props.iconType,
411
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
412
- var translateString = otherProps.registry.translateString;
413
- return jsx(MuiIconButton, _extends({
414
- title: translateString(TranslatableString.RemoveButton)
415
- }, otherProps, {
427
+ const {
428
+ iconType,
429
+ ...otherProps
430
+ } = props;
431
+ const {
432
+ registry: {
433
+ translateString
434
+ }
435
+ } = otherProps;
436
+ return jsx(MuiIconButton, {
437
+ title: translateString(TranslatableString.RemoveButton),
438
+ ...otherProps,
416
439
  color: 'error',
417
440
  icon: jsx(RemoveIcon, {
418
441
  fontSize: iconType === 'default' ? undefined : 'small'
419
442
  })
420
- }));
443
+ });
421
444
  }
422
445
 
423
446
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
@@ -425,17 +448,18 @@ function RemoveButton(props) {
425
448
  * @param props - The `FieldErrorProps` for the errors being rendered
426
449
  */
427
450
  function FieldErrorTemplate(props) {
428
- var _props$errors = props.errors,
429
- errors = _props$errors === void 0 ? [] : _props$errors,
430
- idSchema = props.idSchema;
451
+ const {
452
+ errors = [],
453
+ idSchema
454
+ } = props;
431
455
  if (errors.length === 0) {
432
456
  return null;
433
457
  }
434
- var id = errorId(idSchema);
458
+ const id = errorId(idSchema);
435
459
  return jsx(List, {
436
460
  dense: true,
437
461
  disablePadding: true,
438
- children: errors.map(function (error, i) {
462
+ children: errors.map((error, i) => {
439
463
  return jsx(ListItem, {
440
464
  disableGutters: true,
441
465
  children: jsx(FormHelperText, {
@@ -452,12 +476,14 @@ function FieldErrorTemplate(props) {
452
476
  * @param props - The `FieldHelpProps` to be rendered
453
477
  */
454
478
  function FieldHelpTemplate(props) {
455
- var idSchema = props.idSchema,
456
- help = props.help;
479
+ const {
480
+ idSchema,
481
+ help
482
+ } = props;
457
483
  if (!help) {
458
484
  return null;
459
485
  }
460
- var id = helpId(idSchema);
486
+ const id = helpId(idSchema);
461
487
  return jsx(FormHelperText, {
462
488
  id: id,
463
489
  children: help
@@ -470,29 +496,30 @@ function FieldHelpTemplate(props) {
470
496
  * @param props - The `FieldTemplateProps` for this component
471
497
  */
472
498
  function FieldTemplate(props) {
473
- var id = props.id,
474
- children = props.children,
475
- classNames = props.classNames,
476
- style = props.style,
477
- disabled = props.disabled,
478
- displayLabel = props.displayLabel,
479
- hidden = props.hidden,
480
- label = props.label,
481
- onDropPropertyClick = props.onDropPropertyClick,
482
- onKeyChange = props.onKeyChange,
483
- readonly = props.readonly,
484
- required = props.required,
485
- _props$rawErrors = props.rawErrors,
486
- rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
487
- errors = props.errors,
488
- help = props.help,
489
- description = props.description,
490
- rawDescription = props.rawDescription,
491
- schema = props.schema,
492
- uiSchema = props.uiSchema,
493
- registry = props.registry;
494
- var uiOptions = getUiOptions(uiSchema);
495
- var WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
499
+ const {
500
+ id,
501
+ children,
502
+ classNames,
503
+ style,
504
+ disabled,
505
+ displayLabel,
506
+ hidden,
507
+ label,
508
+ onDropPropertyClick,
509
+ onKeyChange,
510
+ readonly,
511
+ required,
512
+ rawErrors = [],
513
+ errors,
514
+ help,
515
+ description,
516
+ rawDescription,
517
+ schema,
518
+ uiSchema,
519
+ registry
520
+ } = props;
521
+ const uiOptions = getUiOptions(uiSchema);
522
+ const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
496
523
  if (hidden) {
497
524
  return jsx("div", {
498
525
  style: {
@@ -534,23 +561,29 @@ function FieldTemplate(props) {
534
561
  * @param props - The `ObjectFieldTemplateProps` for this component
535
562
  */
536
563
  function ObjectFieldTemplate(props) {
537
- var description = props.description,
538
- title = props.title,
539
- properties = props.properties,
540
- required = props.required,
541
- disabled = props.disabled,
542
- readonly = props.readonly,
543
- uiSchema = props.uiSchema,
544
- idSchema = props.idSchema,
545
- schema = props.schema,
546
- formData = props.formData,
547
- onAddClick = props.onAddClick,
548
- registry = props.registry;
549
- var uiOptions = getUiOptions(uiSchema);
550
- var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
551
- var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
564
+ const {
565
+ description,
566
+ title,
567
+ properties,
568
+ required,
569
+ disabled,
570
+ readonly,
571
+ uiSchema,
572
+ idSchema,
573
+ schema,
574
+ formData,
575
+ onAddClick,
576
+ registry
577
+ } = props;
578
+ const uiOptions = getUiOptions(uiSchema);
579
+ const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
580
+ const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
552
581
  // Button templates are not overridden in the uiSchema
553
- var AddButton = registry.templates.ButtonTemplates.AddButton;
582
+ const {
583
+ ButtonTemplates: {
584
+ AddButton
585
+ }
586
+ } = registry.templates;
554
587
  return jsxs(Fragment, {
555
588
  children: [title && jsx(TitleFieldTemplate, {
556
589
  id: titleId(idSchema),
@@ -571,20 +604,17 @@ function ObjectFieldTemplate(props) {
571
604
  style: {
572
605
  marginTop: '10px'
573
606
  },
574
- children: [properties.map(function (element, index) {
575
- return (
576
- // Remove the <Grid> if the inner element is hidden as the <Grid>
577
- // itself would otherwise still take up space.
578
- element.hidden ? element.content : jsx(Grid, {
579
- item: true,
580
- xs: 12,
581
- style: {
582
- marginBottom: '10px'
583
- },
584
- children: element.content
585
- }, index)
586
- );
587
- }), canExpand(schema, uiSchema, formData) && jsx(Grid, {
607
+ children: [properties.map((element, index) =>
608
+ // Remove the <Grid> if the inner element is hidden as the <Grid>
609
+ // itself would otherwise still take up space.
610
+ element.hidden ? element.content : jsx(Grid, {
611
+ item: true,
612
+ xs: 12,
613
+ style: {
614
+ marginBottom: '10px'
615
+ },
616
+ children: element.content
617
+ }, index)), canExpand(schema, uiSchema, formData) && jsx(Grid, {
588
618
  container: true,
589
619
  justifyContent: 'flex-end',
590
620
  children: jsx(Grid, {
@@ -604,25 +634,26 @@ function ObjectFieldTemplate(props) {
604
634
 
605
635
  /** The `SubmitButton` renders a button that represent the `Submit` action on a form
606
636
  */
607
- function SubmitButton(_ref) {
608
- var uiSchema = _ref.uiSchema;
609
- var _getSubmitButtonOptio = getSubmitButtonOptions(uiSchema),
610
- submitText = _getSubmitButtonOptio.submitText,
611
- norender = _getSubmitButtonOptio.norender,
612
- _getSubmitButtonOptio2 = _getSubmitButtonOptio.props,
613
- submitButtonProps = _getSubmitButtonOptio2 === void 0 ? {} : _getSubmitButtonOptio2;
637
+ function SubmitButton({
638
+ uiSchema
639
+ }) {
640
+ const {
641
+ submitText,
642
+ norender,
643
+ props: submitButtonProps = {}
644
+ } = getSubmitButtonOptions(uiSchema);
614
645
  if (norender) {
615
646
  return null;
616
647
  }
617
648
  return jsx(Box, {
618
649
  marginTop: 3,
619
- children: jsx(Button, _extends({
650
+ children: jsx(Button, {
620
651
  type: 'submit',
621
652
  variant: 'contained',
622
- color: 'primary'
623
- }, submitButtonProps, {
653
+ color: 'primary',
654
+ ...submitButtonProps,
624
655
  children: submitText
625
- }))
656
+ })
626
657
  });
627
658
  }
628
659
 
@@ -630,9 +661,10 @@ function SubmitButton(_ref) {
630
661
  *
631
662
  * @param props - The `TitleFieldProps` for this component
632
663
  */
633
- function TitleField(_ref) {
634
- var id = _ref.id,
635
- title = _ref.title;
664
+ function TitleField({
665
+ id,
666
+ title
667
+ }) {
636
668
  return jsxs(Box, {
637
669
  id: id,
638
670
  mb: 1,
@@ -650,26 +682,32 @@ function TitleField(_ref) {
650
682
  * @param props - The `WrapIfAdditionalProps` for this component
651
683
  */
652
684
  function WrapIfAdditionalTemplate(props) {
653
- var children = props.children,
654
- classNames = props.classNames,
655
- style = props.style,
656
- disabled = props.disabled,
657
- id = props.id,
658
- label = props.label,
659
- onDropPropertyClick = props.onDropPropertyClick,
660
- onKeyChange = props.onKeyChange,
661
- readonly = props.readonly,
662
- required = props.required,
663
- schema = props.schema,
664
- uiSchema = props.uiSchema,
665
- registry = props.registry;
666
- var templates = registry.templates,
667
- translateString = registry.translateString;
685
+ const {
686
+ children,
687
+ classNames,
688
+ style,
689
+ disabled,
690
+ id,
691
+ label,
692
+ onDropPropertyClick,
693
+ onKeyChange,
694
+ readonly,
695
+ required,
696
+ schema,
697
+ uiSchema,
698
+ registry
699
+ } = props;
700
+ const {
701
+ templates,
702
+ translateString
703
+ } = registry;
668
704
  // Button templates are not overridden in the uiSchema
669
- var RemoveButton = templates.ButtonTemplates.RemoveButton;
670
- var keyLabel = translateString(TranslatableString.KeyLabel, [label]);
671
- var additional = (ADDITIONAL_PROPERTY_FLAG in schema);
672
- var btnStyle = {
705
+ const {
706
+ RemoveButton
707
+ } = templates.ButtonTemplates;
708
+ const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
709
+ const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
710
+ const btnStyle = {
673
711
  flex: 1,
674
712
  paddingLeft: 6,
675
713
  paddingRight: 6,
@@ -682,10 +720,9 @@ function WrapIfAdditionalTemplate(props) {
682
720
  children: children
683
721
  });
684
722
  }
685
- var handleBlur = function handleBlur(_ref) {
686
- var target = _ref.target;
687
- return onKeyChange(target.value);
688
- };
723
+ const handleBlur = ({
724
+ target
725
+ }) => onKeyChange(target.value);
689
726
  return jsxs(Grid, {
690
727
  container: true,
691
728
  alignItems: 'center',
@@ -701,8 +738,8 @@ function WrapIfAdditionalTemplate(props) {
701
738
  label: keyLabel,
702
739
  defaultValue: label,
703
740
  disabled: disabled || readonly,
704
- id: id + "-key",
705
- name: id + "-key",
741
+ id: `${id}-key`,
742
+ name: `${id}-key`,
706
743
  onBlur: !readonly ? handleBlur : undefined,
707
744
  type: 'text'
708
745
  })
@@ -721,30 +758,30 @@ function WrapIfAdditionalTemplate(props) {
721
758
  registry: registry
722
759
  })
723
760
  })]
724
- }, id + "-key");
761
+ }, `${id}-key`);
725
762
  }
726
763
 
727
764
  function generateTemplates() {
728
765
  return {
729
- ArrayFieldItemTemplate: ArrayFieldItemTemplate,
730
- ArrayFieldTemplate: ArrayFieldTemplate,
731
- BaseInputTemplate: BaseInputTemplate,
766
+ ArrayFieldItemTemplate,
767
+ ArrayFieldTemplate,
768
+ BaseInputTemplate,
732
769
  ButtonTemplates: {
733
- AddButton: AddButton,
734
- CopyButton: CopyButton,
735
- MoveDownButton: MoveDownButton,
736
- MoveUpButton: MoveUpButton,
737
- RemoveButton: RemoveButton,
738
- SubmitButton: SubmitButton
770
+ AddButton,
771
+ CopyButton,
772
+ MoveDownButton,
773
+ MoveUpButton,
774
+ RemoveButton,
775
+ SubmitButton
739
776
  },
740
777
  DescriptionFieldTemplate: DescriptionField,
741
778
  ErrorListTemplate: ErrorList,
742
- FieldErrorTemplate: FieldErrorTemplate,
743
- FieldHelpTemplate: FieldHelpTemplate,
744
- FieldTemplate: FieldTemplate,
745
- ObjectFieldTemplate: ObjectFieldTemplate,
779
+ FieldErrorTemplate,
780
+ FieldHelpTemplate,
781
+ FieldTemplate,
782
+ ObjectFieldTemplate,
746
783
  TitleFieldTemplate: TitleField,
747
- WrapIfAdditionalTemplate: WrapIfAdditionalTemplate
784
+ WrapIfAdditionalTemplate
748
785
  };
749
786
  }
750
787
  var Templates = /*#__PURE__*/generateTemplates();
@@ -755,39 +792,39 @@ var Templates = /*#__PURE__*/generateTemplates();
755
792
  * @param props - The `WidgetProps` for this component
756
793
  */
757
794
  function CheckboxWidget(props) {
758
- var _options$description;
759
- var schema = props.schema,
760
- id = props.id,
761
- value = props.value,
762
- disabled = props.disabled,
763
- readonly = props.readonly,
764
- _props$label = props.label,
765
- label = _props$label === void 0 ? '' : _props$label,
766
- hideLabel = props.hideLabel,
767
- autofocus = props.autofocus,
768
- onChange = props.onChange,
769
- onBlur = props.onBlur,
770
- onFocus = props.onFocus,
771
- registry = props.registry,
772
- options = props.options,
773
- uiSchema = props.uiSchema;
774
- var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
795
+ const {
796
+ schema,
797
+ id,
798
+ value,
799
+ disabled,
800
+ readonly,
801
+ label = '',
802
+ hideLabel,
803
+ autofocus,
804
+ onChange,
805
+ onBlur,
806
+ onFocus,
807
+ registry,
808
+ options,
809
+ uiSchema
810
+ } = props;
811
+ const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
775
812
  // Because an unchecked checkbox will cause html5 validation to fail, only add
776
813
  // the "required" attribute if the field value must be "true", due to the
777
814
  // "const" or "enum" keywords
778
- var required = schemaRequiresTrueValue(schema);
779
- var _onChange = function _onChange(_, checked) {
780
- return onChange(checked);
781
- };
782
- var _onBlur = function _onBlur(_ref) {
783
- var value = _ref.target.value;
784
- return onBlur(id, value);
785
- };
786
- var _onFocus = function _onFocus(_ref2) {
787
- var value = _ref2.target.value;
788
- return onFocus(id, value);
789
- };
790
- var description = (_options$description = options.description) != null ? _options$description : schema.description;
815
+ const required = schemaRequiresTrueValue(schema);
816
+ const _onChange = (_, checked) => onChange(checked);
817
+ const _onBlur = ({
818
+ target: {
819
+ value
820
+ }
821
+ }) => onBlur(id, value);
822
+ const _onFocus = ({
823
+ target: {
824
+ value
825
+ }
826
+ }) => onFocus(id, value);
827
+ const description = options.description ?? schema.description;
791
828
  return jsxs(Fragment, {
792
829
  children: [!hideLabel && !!description && jsx(DescriptionFieldTemplate, {
793
830
  id: descriptionId(id),
@@ -818,42 +855,48 @@ function CheckboxWidget(props) {
818
855
  *
819
856
  * @param props - The `WidgetProps` for this component
820
857
  */
821
- function CheckboxesWidget(_ref) {
822
- var label = _ref.label,
823
- hideLabel = _ref.hideLabel,
824
- id = _ref.id,
825
- disabled = _ref.disabled,
826
- options = _ref.options,
827
- value = _ref.value,
828
- autofocus = _ref.autofocus,
829
- readonly = _ref.readonly,
830
- required = _ref.required,
831
- onChange = _ref.onChange,
832
- onBlur = _ref.onBlur,
833
- onFocus = _ref.onFocus;
834
- var enumOptions = options.enumOptions,
835
- enumDisabled = options.enumDisabled,
836
- inline = options.inline,
837
- emptyValue = options.emptyValue;
838
- var checkboxesValues = Array.isArray(value) ? value : [value];
839
- var _onChange = function _onChange(index) {
840
- return function (_ref2) {
841
- var checked = _ref2.target.checked;
842
- if (checked) {
843
- onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
844
- } else {
845
- onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
846
- }
847
- };
848
- };
849
- var _onBlur = function _onBlur(_ref3) {
850
- var value = _ref3.target.value;
851
- return onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
852
- };
853
- var _onFocus = function _onFocus(_ref4) {
854
- var value = _ref4.target.value;
855
- return onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
858
+ function CheckboxesWidget({
859
+ label,
860
+ hideLabel,
861
+ id,
862
+ disabled,
863
+ options,
864
+ value,
865
+ autofocus,
866
+ readonly,
867
+ required,
868
+ onChange,
869
+ onBlur,
870
+ onFocus
871
+ }) {
872
+ const {
873
+ enumOptions,
874
+ enumDisabled,
875
+ inline,
876
+ emptyValue
877
+ } = options;
878
+ const checkboxesValues = Array.isArray(value) ? value : [value];
879
+ const _onChange = index => ({
880
+ target: {
881
+ checked
882
+ }
883
+ }) => {
884
+ if (checked) {
885
+ onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
886
+ } else {
887
+ onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
888
+ }
856
889
  };
890
+ const _onBlur = ({
891
+ target: {
892
+ value
893
+ }
894
+ }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
895
+ const _onFocus = ({
896
+ target: {
897
+ value
898
+ }
899
+ }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
857
900
  return jsxs(Fragment, {
858
901
  children: [labelValue(jsx(FormLabel, {
859
902
  required: required,
@@ -862,10 +905,10 @@ function CheckboxesWidget(_ref) {
862
905
  }), hideLabel), jsx(FormGroup, {
863
906
  id: id,
864
907
  row: !!inline,
865
- children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
866
- var checked = enumOptionsIsSelected(option.value, checkboxesValues);
867
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
868
- var checkbox = jsx(Checkbox, {
908
+ children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
909
+ const checked = enumOptionsIsSelected(option.value, checkboxesValues);
910
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
911
+ const checkbox = jsx(Checkbox, {
869
912
  id: optionId(id, index),
870
913
  name: id,
871
914
  checked: checked,
@@ -890,35 +933,37 @@ function CheckboxesWidget(_ref) {
890
933
  *
891
934
  * @param props - The `WidgetProps` for this component
892
935
  */
893
- function RadioWidget(_ref) {
894
- var _enumOptionsIndexForV;
895
- var id = _ref.id,
896
- options = _ref.options,
897
- value = _ref.value,
898
- required = _ref.required,
899
- disabled = _ref.disabled,
900
- readonly = _ref.readonly,
901
- label = _ref.label,
902
- hideLabel = _ref.hideLabel,
903
- onChange = _ref.onChange,
904
- onBlur = _ref.onBlur,
905
- onFocus = _ref.onFocus;
906
- var enumOptions = options.enumOptions,
907
- enumDisabled = options.enumDisabled,
908
- emptyValue = options.emptyValue;
909
- var _onChange = function _onChange(_, value) {
910
- return onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue));
911
- };
912
- var _onBlur = function _onBlur(_ref2) {
913
- var value = _ref2.target.value;
914
- return onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
915
- };
916
- var _onFocus = function _onFocus(_ref3) {
917
- var value = _ref3.target.value;
918
- return onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
919
- };
920
- var row = options ? options.inline : false;
921
- var selectedIndex = (_enumOptionsIndexForV = enumOptionsIndexForValue(value, enumOptions)) != null ? _enumOptionsIndexForV : null;
936
+ function RadioWidget({
937
+ id,
938
+ options,
939
+ value,
940
+ required,
941
+ disabled,
942
+ readonly,
943
+ label,
944
+ hideLabel,
945
+ onChange,
946
+ onBlur,
947
+ onFocus
948
+ }) {
949
+ const {
950
+ enumOptions,
951
+ enumDisabled,
952
+ emptyValue
953
+ } = options;
954
+ const _onChange = (_, value) => onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue));
955
+ const _onBlur = ({
956
+ target: {
957
+ value
958
+ }
959
+ }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
960
+ const _onFocus = ({
961
+ target: {
962
+ value
963
+ }
964
+ }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
965
+ const row = options ? options.inline : false;
966
+ const selectedIndex = enumOptionsIndexForValue(value, enumOptions) ?? null;
922
967
  return jsxs(Fragment, {
923
968
  children: [labelValue(jsx(FormLabel, {
924
969
  required: required,
@@ -933,9 +978,9 @@ function RadioWidget(_ref) {
933
978
  onBlur: _onBlur,
934
979
  onFocus: _onFocus,
935
980
  "aria-describedby": ariaDescribedByIds(id),
936
- children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
937
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
938
- var radio = jsx(FormControlLabel, {
981
+ children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
982
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
983
+ const radio = jsx(FormControlLabel, {
939
984
  control: jsx(Radio, {
940
985
  name: id,
941
986
  id: optionId(id, index),
@@ -957,96 +1002,112 @@ function RadioWidget(_ref) {
957
1002
  * @param props - The `WidgetProps` for this component
958
1003
  */
959
1004
  function RangeWidget(props) {
960
- var value = props.value,
961
- readonly = props.readonly,
962
- disabled = props.disabled,
963
- onBlur = props.onBlur,
964
- onFocus = props.onFocus,
965
- options = props.options,
966
- schema = props.schema,
967
- onChange = props.onChange,
968
- required = props.required,
969
- label = props.label,
970
- hideLabel = props.hideLabel,
971
- id = props.id;
972
- var sliderProps = _extends({
973
- value: value,
974
- label: label,
975
- id: id,
976
- name: id
977
- }, rangeSpec(schema));
978
- var _onChange = function _onChange(_, value) {
979
- onChange(value != null ? value : options.emptyValue);
980
- };
981
- var _onBlur = function _onBlur(_ref) {
982
- var value = _ref.target.value;
983
- return onBlur(id, value);
1005
+ const {
1006
+ value,
1007
+ readonly,
1008
+ disabled,
1009
+ onBlur,
1010
+ onFocus,
1011
+ options,
1012
+ schema,
1013
+ onChange,
1014
+ required,
1015
+ label,
1016
+ hideLabel,
1017
+ id
1018
+ } = props;
1019
+ const sliderProps = {
1020
+ value,
1021
+ label,
1022
+ id,
1023
+ name: id,
1024
+ ...rangeSpec(schema)
984
1025
  };
985
- var _onFocus = function _onFocus(_ref2) {
986
- var value = _ref2.target.value;
987
- return onFocus(id, value);
1026
+ const _onChange = (_, value) => {
1027
+ onChange(value ?? options.emptyValue);
988
1028
  };
1029
+ const _onBlur = ({
1030
+ target: {
1031
+ value
1032
+ }
1033
+ }) => onBlur(id, value);
1034
+ const _onFocus = ({
1035
+ target: {
1036
+ value
1037
+ }
1038
+ }) => onFocus(id, value);
989
1039
  return jsxs(Fragment, {
990
1040
  children: [labelValue(jsx(FormLabel, {
991
1041
  required: required,
992
1042
  htmlFor: id,
993
1043
  children: label || undefined
994
- }), hideLabel), jsx(Slider, _extends({
1044
+ }), hideLabel), jsx(Slider, {
995
1045
  disabled: disabled || readonly,
996
1046
  onChange: _onChange,
997
1047
  onBlur: _onBlur,
998
1048
  onFocus: _onFocus,
999
- valueLabelDisplay: 'auto'
1000
- }, sliderProps, {
1049
+ valueLabelDisplay: 'auto',
1050
+ ...sliderProps,
1001
1051
  "aria-describedby": ariaDescribedByIds(id)
1002
- }))]
1052
+ })]
1003
1053
  });
1004
1054
  }
1005
1055
 
1006
- var _excluded = ["schema", "id", "name", "options", "label", "hideLabel", "required", "disabled", "placeholder", "readonly", "value", "multiple", "autofocus", "onChange", "onBlur", "onFocus", "rawErrors", "registry", "uiSchema", "hideError", "formContext"];
1007
1056
  /** The `SelectWidget` is a widget for rendering dropdowns.
1008
1057
  * It is typically used with string properties constrained with enum options.
1009
1058
  *
1010
1059
  * @param props - The `WidgetProps` for this component
1011
1060
  */
1012
- function SelectWidget(_ref) {
1013
- var id = _ref.id,
1014
- options = _ref.options,
1015
- label = _ref.label,
1016
- hideLabel = _ref.hideLabel,
1017
- required = _ref.required,
1018
- disabled = _ref.disabled,
1019
- placeholder = _ref.placeholder,
1020
- readonly = _ref.readonly,
1021
- value = _ref.value,
1022
- multiple = _ref.multiple,
1023
- autofocus = _ref.autofocus,
1024
- onChange = _ref.onChange,
1025
- onBlur = _ref.onBlur,
1026
- onFocus = _ref.onFocus,
1027
- _ref$rawErrors = _ref.rawErrors,
1028
- rawErrors = _ref$rawErrors === void 0 ? [] : _ref$rawErrors,
1029
- textFieldProps = _objectWithoutPropertiesLoose(_ref, _excluded);
1030
- var enumOptions = options.enumOptions,
1031
- enumDisabled = options.enumDisabled,
1032
- optEmptyVal = options.emptyValue;
1061
+ function SelectWidget({
1062
+ schema,
1063
+ id,
1064
+ name,
1065
+ // remove this from textFieldProps
1066
+ options,
1067
+ label,
1068
+ hideLabel,
1069
+ required,
1070
+ disabled,
1071
+ placeholder,
1072
+ readonly,
1073
+ value,
1074
+ multiple,
1075
+ autofocus,
1076
+ onChange,
1077
+ onBlur,
1078
+ onFocus,
1079
+ rawErrors = [],
1080
+ registry,
1081
+ uiSchema,
1082
+ hideError,
1083
+ formContext,
1084
+ ...textFieldProps
1085
+ }) {
1086
+ const {
1087
+ enumOptions,
1088
+ enumDisabled,
1089
+ emptyValue: optEmptyVal
1090
+ } = options;
1033
1091
  multiple = typeof multiple === 'undefined' ? false : !!multiple;
1034
- var emptyValue = multiple ? [] : '';
1035
- var isEmpty = typeof value === 'undefined' || multiple && value.length < 1 || !multiple && value === emptyValue;
1036
- var _onChange = function _onChange(_ref2) {
1037
- var value = _ref2.target.value;
1038
- return onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1039
- };
1040
- var _onBlur = function _onBlur(_ref3) {
1041
- var value = _ref3.target.value;
1042
- return onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1043
- };
1044
- var _onFocus = function _onFocus(_ref4) {
1045
- var value = _ref4.target.value;
1046
- return onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1047
- };
1048
- var selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
1049
- return jsx(TextField, _extends({
1092
+ const emptyValue = multiple ? [] : '';
1093
+ const isEmpty = typeof value === 'undefined' || multiple && value.length < 1 || !multiple && value === emptyValue;
1094
+ const _onChange = ({
1095
+ target: {
1096
+ value
1097
+ }
1098
+ }) => onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1099
+ const _onBlur = ({
1100
+ target: {
1101
+ value
1102
+ }
1103
+ }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1104
+ const _onFocus = ({
1105
+ target: {
1106
+ value
1107
+ }
1108
+ }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1109
+ const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
1110
+ return jsx(TextField, {
1050
1111
  id: id,
1051
1112
  name: id,
1052
1113
  label: labelValue(label || undefined, hideLabel, false),
@@ -1058,28 +1119,31 @@ function SelectWidget(_ref) {
1058
1119
  error: rawErrors.length > 0,
1059
1120
  onChange: _onChange,
1060
1121
  onBlur: _onBlur,
1061
- onFocus: _onFocus
1062
- }, textFieldProps, {
1122
+ onFocus: _onFocus,
1123
+ ...textFieldProps,
1063
1124
  select // Apply this and the following props after the potential overrides defined in textFieldProps
1064
1125
  : true,
1065
- InputLabelProps: _extends({}, textFieldProps.InputLabelProps, {
1126
+ InputLabelProps: {
1127
+ ...textFieldProps.InputLabelProps,
1066
1128
  shrink: !isEmpty
1067
- }),
1068
- SelectProps: _extends({}, textFieldProps.SelectProps, {
1069
- multiple: multiple
1070
- }),
1129
+ },
1130
+ SelectProps: {
1131
+ ...textFieldProps.SelectProps,
1132
+ multiple
1133
+ },
1071
1134
  "aria-describedby": ariaDescribedByIds(id),
1072
- children: Array.isArray(enumOptions) && enumOptions.map(function (_ref5, i) {
1073
- var value = _ref5.value,
1074
- label = _ref5.label;
1075
- var disabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1;
1135
+ children: Array.isArray(enumOptions) && enumOptions.map(({
1136
+ value,
1137
+ label
1138
+ }, i) => {
1139
+ const disabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1;
1076
1140
  return jsx(MenuItem, {
1077
1141
  value: String(i),
1078
1142
  disabled: disabled,
1079
1143
  children: label
1080
1144
  }, i);
1081
1145
  })
1082
- }));
1146
+ });
1083
1147
  }
1084
1148
 
1085
1149
  /** The `TextareaWidget` is a widget for rendering input fields as textarea.
@@ -1087,27 +1151,30 @@ function SelectWidget(_ref) {
1087
1151
  * @param props - The `WidgetProps` for this component
1088
1152
  */
1089
1153
  function TextareaWidget(props) {
1090
- var options = props.options,
1091
- registry = props.registry;
1092
- var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
1093
- var rows = 5;
1154
+ const {
1155
+ options,
1156
+ registry
1157
+ } = props;
1158
+ const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
1159
+ let rows = 5;
1094
1160
  if (typeof options.rows === 'string' || typeof options.rows === 'number') {
1095
1161
  rows = options.rows;
1096
1162
  }
1097
- return jsx(BaseInputTemplate, _extends({}, props, {
1163
+ return jsx(BaseInputTemplate, {
1164
+ ...props,
1098
1165
  multiline: true,
1099
1166
  rows: rows
1100
- }));
1167
+ });
1101
1168
  }
1102
1169
 
1103
1170
  function generateWidgets() {
1104
1171
  return {
1105
- CheckboxWidget: CheckboxWidget,
1106
- CheckboxesWidget: CheckboxesWidget,
1107
- RadioWidget: RadioWidget,
1108
- RangeWidget: RangeWidget,
1109
- SelectWidget: SelectWidget,
1110
- TextareaWidget: TextareaWidget
1172
+ CheckboxWidget,
1173
+ CheckboxesWidget,
1174
+ RadioWidget,
1175
+ RangeWidget,
1176
+ SelectWidget,
1177
+ TextareaWidget
1111
1178
  };
1112
1179
  }
1113
1180
  var Widgets = /*#__PURE__*/generateWidgets();