@rjsf/core 5.2.0 → 5.3.0

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/core.esm.js CHANGED
@@ -1,16 +1,18 @@
1
- import React, { Component, useState, useCallback, useEffect, useReducer, useMemo, forwardRef } from 'react';
2
- import { isFixedItems, allowAdditionalItems, getUiOptions, ITEMS_KEY, getTemplate, TranslatableString, isCustomWidget, getWidget, optionsList, deepEquals, ERRORS_KEY, asNumber, REF_KEY, orderProperties, PROPERTIES_KEY, ADDITIONAL_PROPERTY_FLAG, ANY_OF_KEY, ONE_OF_KEY, mergeObjects, UI_OPTIONS_KEY, descriptionId, getSchemaType, ID_KEY, hasWidget, titleId, getInputProps, examplesId, ariaDescribedByIds, getSubmitButtonOptions, errorId, helpId, canExpand, parseDateString, toDateString, pad, schemaRequiresTrueValue, enumOptionsValueForIndex, enumOptionsIsSelected, optionId, enumOptionsSelectValue, enumOptionsDeselectValue, utcToLocal, localToUTC, dataURItoBlob, enumOptionsIndexForValue, englishStringTranslator, createSchemaUtils, shouldRender, isObject as isObject$1, RJSF_ADDITONAL_PROPERTIES_FLAG, NAME_KEY } from '@rjsf/utils';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { Component, useState, useCallback, useEffect, useReducer, useMemo, createRef, forwardRef } from 'react';
3
+ import { isFixedItems, allowAdditionalItems, getUiOptions, ITEMS_KEY, getTemplate, TranslatableString, isCustomWidget, getWidget, optionsList, deepEquals, ERRORS_KEY, asNumber, REF_KEY, orderProperties, PROPERTIES_KEY, ADDITIONAL_PROPERTY_FLAG, ANY_OF_KEY, ONE_OF_KEY, mergeObjects, UI_OPTIONS_KEY, descriptionId, getSchemaType, ID_KEY, hasWidget, titleId, getInputProps, examplesId, ariaDescribedByIds, getSubmitButtonOptions, errorId, helpId, canExpand, parseDateString, toDateString, pad, schemaRequiresTrueValue, enumOptionsValueForIndex, enumOptionsIsSelected, optionId, enumOptionsSelectValue, enumOptionsDeselectValue, utcToLocal, localToUTC, dataURItoBlob, enumOptionsIndexForValue, englishStringTranslator, createSchemaUtils, shouldRender, UI_GLOBAL_OPTIONS_KEY, isObject as isObject$1, RJSF_ADDITONAL_PROPERTIES_FLAG, NAME_KEY } from '@rjsf/utils';
3
4
  import get from 'lodash-es/get';
4
5
  import isEmpty from 'lodash-es/isEmpty';
5
6
  import _pick from 'lodash-es/pick';
6
7
  import _toPath from 'lodash-es/toPath';
8
+ import cloneDeep from 'lodash-es/cloneDeep';
7
9
  import isObject from 'lodash-es/isObject';
8
10
  import set from 'lodash-es/set';
9
11
  import { nanoid } from 'nanoid';
10
12
  import omit from 'lodash-es/omit';
13
+ import Markdown from 'markdown-to-jsx';
11
14
  import has from 'lodash-es/has';
12
15
  import unset from 'lodash-es/unset';
13
- import Markdown from 'markdown-to-jsx';
14
16
 
15
17
  function _defineProperties(target, props) {
16
18
  for (var i = 0; i < props.length; i++) {
@@ -147,6 +149,31 @@ var ArrayField = /*#__PURE__*/function (_Component) {
147
149
  _this._handleAddClick(event, index);
148
150
  };
149
151
  };
152
+ _this.onCopyIndexClick = function (index) {
153
+ return function (event) {
154
+ if (event) {
155
+ event.preventDefault();
156
+ }
157
+ var onChange = _this.props.onChange;
158
+ var keyedFormData = _this.state.keyedFormData;
159
+ var newKeyedFormDataRow = {
160
+ key: generateRowId(),
161
+ item: cloneDeep(keyedFormData[index].item)
162
+ };
163
+ var newKeyedFormData = [].concat(keyedFormData);
164
+ if (index !== undefined) {
165
+ newKeyedFormData.splice(index + 1, 0, newKeyedFormDataRow);
166
+ } else {
167
+ newKeyedFormData.push(newKeyedFormDataRow);
168
+ }
169
+ _this.setState({
170
+ keyedFormData: newKeyedFormData,
171
+ updatedKeyedFormData: true
172
+ }, function () {
173
+ return onChange(keyedToPlainFormData(newKeyedFormData));
174
+ });
175
+ };
176
+ };
150
177
  _this.onDropIndexClick = function (index) {
151
178
  return function (event) {
152
179
  if (event) {
@@ -231,7 +258,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
231
258
  var newFormData = arrayData.map(function (item, i) {
232
259
  // We need to treat undefined items as nulls to have validation.
233
260
  // See https://github.com/tdegrunt/jsonschema/issues/206
234
- var jsonValue = typeof value === "undefined" ? null : value;
261
+ var jsonValue = typeof value === 'undefined' ? null : value;
235
262
  return index === i ? jsonValue : item;
236
263
  });
237
264
  onChange(newFormData, errorSchema && errorSchema && _extends({}, errorSchema, (_extends2 = {}, _extends2[index] = newErrorSchema, _extends2)), id);
@@ -291,10 +318,10 @@ var ArrayField = /*#__PURE__*/function (_Component) {
291
318
  if (Array.isArray(itemSchema.type)) {
292
319
  // While we don't yet support composite/nullable jsonschema types, it's
293
320
  // future-proof to check for requirement against these.
294
- return !itemSchema.type.includes("null");
321
+ return !itemSchema.type.includes('null');
295
322
  }
296
323
  // All non-null array item types are inherently required by design
297
- return itemSchema.type !== "null";
324
+ return itemSchema.type !== 'null';
298
325
  }
299
326
  /** Determines whether more items can be added to the array. If the uiSchema indicates the array doesn't allow adding
300
327
  * then false is returned. Otherwise, if the schema indicates that there are a maximum number of items and the
@@ -306,8 +333,9 @@ var ArrayField = /*#__PURE__*/function (_Component) {
306
333
  _proto.canAddItem = function canAddItem(formItems) {
307
334
  var _this$props6 = this.props,
308
335
  schema = _this$props6.schema,
309
- uiSchema = _this$props6.uiSchema;
310
- var _getUiOptions = getUiOptions(uiSchema),
336
+ uiSchema = _this$props6.uiSchema,
337
+ registry = _this$props6.registry;
338
+ var _getUiOptions = getUiOptions(uiSchema, registry.globalUiOptions),
311
339
  addable = _getUiOptions.addable;
312
340
  if (addable !== false) {
313
341
  // if ui:options.addable was not explicitly set to false, we can add
@@ -371,8 +399,8 @@ var ArrayField = /*#__PURE__*/function (_Component) {
371
399
  translateString = registry.translateString;
372
400
  if (!(ITEMS_KEY in schema)) {
373
401
  var uiOptions = getUiOptions(uiSchema);
374
- var UnsupportedFieldTemplate = getTemplate("UnsupportedFieldTemplate", registry, uiOptions);
375
- return /*#__PURE__*/React.createElement(UnsupportedFieldTemplate, {
402
+ var UnsupportedFieldTemplate = getTemplate('UnsupportedFieldTemplate', registry, uiOptions);
403
+ return jsx(UnsupportedFieldTemplate, {
376
404
  schema: schema,
377
405
  idSchema: idSchema,
378
406
  reason: translateString(TranslatableString.MissingItems),
@@ -418,7 +446,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
418
446
  onFocus = _this$props8.onFocus,
419
447
  idPrefix = _this$props8.idPrefix,
420
448
  _this$props8$idSepara = _this$props8.idSeparator,
421
- idSeparator = _this$props8$idSepara === void 0 ? "_" : _this$props8$idSepara,
449
+ idSeparator = _this$props8$idSepara === void 0 ? '_' : _this$props8$idSepara,
422
450
  rawErrors = _this$props8.rawErrors;
423
451
  var keyedFormData = this.state.keyedFormData;
424
452
  var title = schema.title === undefined ? name : schema.title;
@@ -473,8 +501,8 @@ var ArrayField = /*#__PURE__*/function (_Component) {
473
501
  rawErrors: rawErrors,
474
502
  registry: registry
475
503
  };
476
- var Template = getTemplate("ArrayFieldTemplate", registry, uiOptions);
477
- return /*#__PURE__*/React.createElement(Template, _extends({}, arrayProps));
504
+ var Template = getTemplate('ArrayFieldTemplate', registry, uiOptions);
505
+ return jsx(Template, _extends({}, arrayProps));
478
506
  }
479
507
  /** Renders an array using the custom widget provided by the user in the `uiSchema`
480
508
  */;
@@ -507,8 +535,9 @@ var ArrayField = /*#__PURE__*/function (_Component) {
507
535
  widget = _getUiOptions2.widget,
508
536
  options = _objectWithoutPropertiesLoose(_getUiOptions2, _excluded$9);
509
537
  var Widget = getWidget(schema, widget, widgets);
510
- return /*#__PURE__*/React.createElement(Widget, {
538
+ return jsx(Widget, {
511
539
  id: idSchema.$id,
540
+ name: name,
512
541
  multiple: true,
513
542
  onChange: this.onSelectChange,
514
543
  onBlur: onBlur,
@@ -560,11 +589,12 @@ var ArrayField = /*#__PURE__*/function (_Component) {
560
589
  var enumOptions = optionsList(itemsSchema);
561
590
  var _getUiOptions3 = getUiOptions(uiSchema),
562
591
  _getUiOptions3$widget = _getUiOptions3.widget,
563
- widget = _getUiOptions3$widget === void 0 ? "select" : _getUiOptions3$widget,
592
+ widget = _getUiOptions3$widget === void 0 ? 'select' : _getUiOptions3$widget,
564
593
  options = _objectWithoutPropertiesLoose(_getUiOptions3, _excluded2);
565
594
  var Widget = getWidget(schema, widget, widgets);
566
- return /*#__PURE__*/React.createElement(Widget, {
595
+ return jsx(Widget, {
567
596
  id: idSchema.$id,
597
+ name: name,
568
598
  multiple: true,
569
599
  onChange: this.onSelectChange,
570
600
  onBlur: onBlur,
@@ -613,12 +643,13 @@ var ArrayField = /*#__PURE__*/function (_Component) {
613
643
  formContext = registry.formContext;
614
644
  var _getUiOptions4 = getUiOptions(uiSchema),
615
645
  _getUiOptions4$widget = _getUiOptions4.widget,
616
- widget = _getUiOptions4$widget === void 0 ? "files" : _getUiOptions4$widget,
646
+ widget = _getUiOptions4$widget === void 0 ? 'files' : _getUiOptions4$widget,
617
647
  options = _objectWithoutPropertiesLoose(_getUiOptions4, _excluded3);
618
648
  var Widget = getWidget(schema, widget, widgets);
619
- return /*#__PURE__*/React.createElement(Widget, {
649
+ return jsx(Widget, {
620
650
  options: options,
621
651
  id: idSchema.$id,
652
+ name: name,
622
653
  multiple: true,
623
654
  onChange: this.onSelectChange,
624
655
  onBlur: onBlur,
@@ -634,7 +665,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
634
665
  formContext: formContext,
635
666
  autofocus: autofocus,
636
667
  rawErrors: rawErrors,
637
- label: ""
668
+ label: ''
638
669
  });
639
670
  }
640
671
  /** Renders an array that has a maximum limit of items
@@ -650,7 +681,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
650
681
  errorSchema = _this$props12.errorSchema,
651
682
  idPrefix = _this$props12.idPrefix,
652
683
  _this$props12$idSepar = _this$props12.idSeparator,
653
- idSeparator = _this$props12$idSepar === void 0 ? "_" : _this$props12$idSepar,
684
+ idSeparator = _this$props12$idSepar === void 0 ? '_' : _this$props12$idSepar,
654
685
  idSchema = _this$props12.idSchema,
655
686
  name = _this$props12.name,
656
687
  _this$props12$disable = _this$props12.disabled,
@@ -686,7 +717,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
686
717
  var canAdd = this.canAddItem(items) && !!additionalSchema;
687
718
  var arrayProps = {
688
719
  canAdd: canAdd,
689
- className: "field field-array field-array-fixed-items",
720
+ className: 'field field-array field-array-fixed-items',
690
721
  disabled: disabled,
691
722
  idSchema: idSchema,
692
723
  formData: formData,
@@ -731,8 +762,8 @@ var ArrayField = /*#__PURE__*/function (_Component) {
731
762
  formContext: formContext,
732
763
  rawErrors: rawErrors
733
764
  };
734
- var Template = getTemplate("ArrayFieldTemplate", registry, uiOptions);
735
- return /*#__PURE__*/React.createElement(Template, _extends({}, arrayProps));
765
+ var Template = getTemplate('ArrayFieldTemplate', registry, uiOptions);
766
+ return jsx(Template, _extends({}, arrayProps));
736
767
  }
737
768
  /** Renders the individual array item using a `SchemaField` along with the additional properties required to be send
738
769
  * back to the `ArrayFieldItemTemplate`.
@@ -746,10 +777,8 @@ var ArrayField = /*#__PURE__*/function (_Component) {
746
777
  canAdd = props.canAdd,
747
778
  _props$canRemove = props.canRemove,
748
779
  canRemove = _props$canRemove === void 0 ? true : _props$canRemove,
749
- _props$canMoveUp = props.canMoveUp,
750
- canMoveUp = _props$canMoveUp === void 0 ? true : _props$canMoveUp,
751
- _props$canMoveDown = props.canMoveDown,
752
- canMoveDown = _props$canMoveDown === void 0 ? true : _props$canMoveDown,
780
+ canMoveUp = props.canMoveUp,
781
+ canMoveDown = props.canMoveDown,
753
782
  itemSchema = props.itemSchema,
754
783
  itemData = props.itemData,
755
784
  itemUiSchema = props.itemUiSchema,
@@ -771,16 +800,20 @@ var ArrayField = /*#__PURE__*/function (_Component) {
771
800
  formContext = _this$props13.formContext;
772
801
  var _registry$fields = registry.fields,
773
802
  ArraySchemaField = _registry$fields.ArraySchemaField,
774
- SchemaField = _registry$fields.SchemaField;
803
+ SchemaField = _registry$fields.SchemaField,
804
+ globalUiOptions = registry.globalUiOptions;
775
805
  var ItemSchemaField = ArraySchemaField || SchemaField;
776
- var _getUiOptions5 = getUiOptions(uiSchema),
806
+ var _getUiOptions5 = getUiOptions(uiSchema, globalUiOptions),
777
807
  _getUiOptions5$ordera = _getUiOptions5.orderable,
778
808
  orderable = _getUiOptions5$ordera === void 0 ? true : _getUiOptions5$ordera,
779
809
  _getUiOptions5$remova = _getUiOptions5.removable,
780
- removable = _getUiOptions5$remova === void 0 ? true : _getUiOptions5$remova;
810
+ removable = _getUiOptions5$remova === void 0 ? true : _getUiOptions5$remova,
811
+ _getUiOptions5$copyab = _getUiOptions5.copyable,
812
+ copyable = _getUiOptions5$copyab === void 0 ? false : _getUiOptions5$copyab;
781
813
  var has = {
782
814
  moveUp: orderable && canMoveUp,
783
815
  moveDown: orderable && canMoveDown,
816
+ copy: copyable && canAdd,
784
817
  remove: removable && canRemove,
785
818
  toolbar: false
786
819
  };
@@ -788,7 +821,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
788
821
  return has[key];
789
822
  });
790
823
  return {
791
- children: /*#__PURE__*/React.createElement(ItemSchemaField, {
824
+ children: jsx(ItemSchemaField, {
792
825
  name: name,
793
826
  index: index,
794
827
  schema: itemSchema,
@@ -810,9 +843,10 @@ var ArrayField = /*#__PURE__*/function (_Component) {
810
843
  autofocus: autofocus,
811
844
  rawErrors: rawErrors
812
845
  }),
813
- className: "array-item",
846
+ className: 'array-item',
814
847
  disabled: disabled,
815
848
  canAdd: canAdd,
849
+ hasCopy: has.copy,
816
850
  hasToolbar: has.toolbar,
817
851
  hasMoveUp: has.moveUp,
818
852
  hasMoveDown: has.moveDown,
@@ -821,6 +855,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
821
855
  totalItems: totalItems,
822
856
  key: key,
823
857
  onAddIndexClick: this.onAddIndexClick,
858
+ onCopyIndexClick: this.onCopyIndexClick,
824
859
  onDropIndexClick: this.onDropIndexClick,
825
860
  onReorderClick: this.onReorderClick,
826
861
  readonly: readonly,
@@ -836,7 +871,7 @@ var ArrayField = /*#__PURE__*/function (_Component) {
836
871
  schema = _this$props14.schema,
837
872
  registry = _this$props14.registry;
838
873
  var translateString = registry.translateString;
839
- return get(schema, [ITEMS_KEY, "title"], get(schema, [ITEMS_KEY, "description"], translateString(TranslatableString.ArrayItemTitle)));
874
+ return get(schema, [ITEMS_KEY, 'title'], get(schema, [ITEMS_KEY, 'description'], translateString(TranslatableString.ArrayItemTitle)));
840
875
  }
841
876
  }]);
842
877
  return ArrayField;
@@ -869,7 +904,7 @@ function BooleanField(props) {
869
904
  translateString = registry.translateString;
870
905
  var _getUiOptions = getUiOptions(uiSchema),
871
906
  _getUiOptions$widget = _getUiOptions.widget,
872
- widget = _getUiOptions$widget === void 0 ? "checkbox" : _getUiOptions$widget,
907
+ widget = _getUiOptions$widget === void 0 ? 'checkbox' : _getUiOptions$widget,
873
908
  options = _objectWithoutPropertiesLoose(_getUiOptions, _excluded$8);
874
909
  var Widget = getWidget(schema, widget, widgets);
875
910
  var yes = translateString(TranslatableString.YesLabel);
@@ -894,7 +929,7 @@ function BooleanField(props) {
894
929
  var schemaWithEnumNames = schema;
895
930
  var enums = (_schema$enum = schema["enum"]) != null ? _schema$enum : [true, false];
896
931
  if (!schemaWithEnumNames.enumNames && enums.length === 2 && enums.every(function (v) {
897
- return typeof v === "boolean";
932
+ return typeof v === 'boolean';
898
933
  })) {
899
934
  enumOptions = [{
900
935
  value: enums[0],
@@ -911,13 +946,14 @@ function BooleanField(props) {
911
946
  });
912
947
  }
913
948
  }
914
- return /*#__PURE__*/React.createElement(Widget, {
949
+ return jsx(Widget, {
915
950
  options: _extends({}, options, {
916
951
  enumOptions: enumOptions
917
952
  }),
918
953
  schema: schema,
919
954
  uiSchema: uiSchema,
920
955
  id: idSchema.$id,
956
+ name: name,
921
957
  onChange: onChange,
922
958
  onFocus: onFocus,
923
959
  onBlur: onBlur,
@@ -967,7 +1003,7 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
967
1003
  if (newFormData && newOption) {
968
1004
  // Call getDefaultFormState to make sure defaults are populated on change. Pass "excludeObjectChildren"
969
1005
  // so that only the root objects themselves are created without adding undefined children properties
970
- newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, "excludeObjectChildren");
1006
+ newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren');
971
1007
  }
972
1008
  onChange(newFormData, undefined, _this.getFieldId());
973
1009
  _this.setState({
@@ -1054,12 +1090,13 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1054
1090
  var _this$props4 = this.props,
1055
1091
  idSchema = _this$props4.idSchema,
1056
1092
  schema = _this$props4.schema;
1057
- return "" + idSchema.$id + (schema.oneOf ? "__oneof_select" : "__anyof_select");
1093
+ return "" + idSchema.$id + (schema.oneOf ? '__oneof_select' : '__anyof_select');
1058
1094
  }
1059
1095
  /** Renders the `AnyOfField` selector along with a `SchemaField` for the value of the `formData`
1060
1096
  */;
1061
1097
  _proto.render = function render() {
1062
1098
  var _this$props5 = this.props,
1099
+ name = _this$props5.name,
1063
1100
  baseType = _this$props5.baseType,
1064
1101
  _this$props5$disabled = _this$props5.disabled,
1065
1102
  disabled = _this$props5$disabled === void 0 ? false : _this$props5$disabled,
@@ -1080,7 +1117,7 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1080
1117
  retrievedOptions = _this$state2.retrievedOptions;
1081
1118
  var _getUiOptions = getUiOptions(uiSchema),
1082
1119
  _getUiOptions$widget = _getUiOptions.widget,
1083
- widget = _getUiOptions$widget === void 0 ? "select" : _getUiOptions$widget,
1120
+ widget = _getUiOptions$widget === void 0 ? 'select' : _getUiOptions$widget,
1084
1121
  placeholder = _getUiOptions.placeholder,
1085
1122
  autofocus = _getUiOptions.autofocus,
1086
1123
  autocomplete = _getUiOptions.autocomplete,
@@ -1088,7 +1125,7 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1088
1125
  title = _getUiOptions$title === void 0 ? schema.title : _getUiOptions$title,
1089
1126
  uiOptions = _objectWithoutPropertiesLoose(_getUiOptions, _excluded$7);
1090
1127
  var Widget = getWidget({
1091
- type: "number"
1128
+ type: 'number'
1092
1129
  }, widget, widgets);
1093
1130
  var rawErrors = get(errorSchema, ERRORS_KEY, []);
1094
1131
  var fieldErrorSchema = omit(errorSchema, [ERRORS_KEY]);
@@ -1109,36 +1146,39 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1109
1146
  value: index
1110
1147
  };
1111
1148
  });
1112
- return /*#__PURE__*/React.createElement("div", {
1113
- className: "panel panel-default panel-body"
1114
- }, /*#__PURE__*/React.createElement("div", {
1115
- className: "form-group"
1116
- }, /*#__PURE__*/React.createElement(Widget, {
1117
- id: this.getFieldId(),
1118
- schema: {
1119
- type: "number",
1120
- "default": 0
1121
- },
1122
- onChange: this.onOptionChange,
1123
- onBlur: onBlur,
1124
- onFocus: onFocus,
1125
- disabled: disabled || isEmpty(enumOptions),
1126
- multiple: false,
1127
- rawErrors: rawErrors,
1128
- errorSchema: fieldErrorSchema,
1129
- value: selectedOption >= 0 ? selectedOption : undefined,
1130
- options: _extends({
1131
- enumOptions: enumOptions
1132
- }, uiOptions),
1133
- registry: registry,
1134
- formContext: formContext,
1135
- placeholder: placeholder,
1136
- autocomplete: autocomplete,
1137
- autofocus: autofocus,
1138
- label: ""
1139
- })), option !== null && /*#__PURE__*/React.createElement(_SchemaField, _extends({}, this.props, {
1140
- schema: optionSchema
1141
- })));
1149
+ return jsxs("div", {
1150
+ className: 'panel panel-default panel-body',
1151
+ children: [jsx("div", {
1152
+ className: 'form-group',
1153
+ children: jsx(Widget, {
1154
+ id: this.getFieldId(),
1155
+ name: "" + name + (schema.oneOf ? '__oneof_select' : '__anyof_select'),
1156
+ schema: {
1157
+ type: 'number',
1158
+ "default": 0
1159
+ },
1160
+ onChange: this.onOptionChange,
1161
+ onBlur: onBlur,
1162
+ onFocus: onFocus,
1163
+ disabled: disabled || isEmpty(enumOptions),
1164
+ multiple: false,
1165
+ rawErrors: rawErrors,
1166
+ errorSchema: fieldErrorSchema,
1167
+ value: selectedOption >= 0 ? selectedOption : undefined,
1168
+ options: _extends({
1169
+ enumOptions: enumOptions
1170
+ }, uiOptions),
1171
+ registry: registry,
1172
+ formContext: formContext,
1173
+ placeholder: placeholder,
1174
+ autocomplete: autocomplete,
1175
+ autofocus: autofocus,
1176
+ label: ''
1177
+ })
1178
+ }), option !== null && jsx(_SchemaField, _extends({}, this.props, {
1179
+ schema: optionSchema
1180
+ }))]
1181
+ });
1142
1182
  };
1143
1183
  return AnyOfField;
1144
1184
  }(Component);
@@ -1189,27 +1229,27 @@ function NumberField(props) {
1189
1229
  setLastValue(value);
1190
1230
  // Normalize decimals that don't start with a zero character in advance so
1191
1231
  // that the rest of the normalization logic is simpler
1192
- if (("" + value).charAt(0) === ".") {
1232
+ if (("" + value).charAt(0) === '.') {
1193
1233
  value = "0" + value;
1194
1234
  }
1195
1235
  // Check that the value is a string (this can happen if the widget used is a
1196
1236
  // <select>, due to an enum declaration etc) then, if the value ends in a
1197
1237
  // trailing decimal point or multiple zeroes, strip the trailing values
1198
- var processed = typeof value === "string" && value.match(trailingCharMatcherWithPrefix) ? asNumber(value.replace(trailingCharMatcher, "")) : asNumber(value);
1238
+ var processed = typeof value === 'string' && value.match(trailingCharMatcherWithPrefix) ? asNumber(value.replace(trailingCharMatcher, '')) : asNumber(value);
1199
1239
  onChange(processed);
1200
1240
  }, [onChange]);
1201
- if (typeof lastValue === "string" && typeof value === "number") {
1241
+ if (typeof lastValue === 'string' && typeof value === 'number') {
1202
1242
  // Construct a regular expression that checks for a string that consists
1203
1243
  // of the formData value suffixed with zero or one '.' characters and zero
1204
1244
  // or more '0' characters
1205
- var re = new RegExp(("" + value).replace(".", "\\.") + "\\.?0*$");
1245
+ var re = new RegExp(("" + value).replace('.', '\\.') + '\\.?0*$');
1206
1246
  // If the cached "lastValue" is a match, use that instead of the formData
1207
1247
  // value to prevent the input value from changing in the UI
1208
1248
  if (lastValue.match(re)) {
1209
1249
  value = lastValue;
1210
1250
  }
1211
1251
  }
1212
- return /*#__PURE__*/React.createElement(StringField, _extends({}, props, {
1252
+ return jsx(StringField, _extends({}, props, {
1213
1253
  formData: value,
1214
1254
  onChange: handleChange
1215
1255
  }));
@@ -1250,7 +1290,7 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1250
1290
  // fields which are "mandated" by the schema, these fields can
1251
1291
  // be set to undefined by clicking a "delete field" button, so
1252
1292
  // set empty values to the empty string.
1253
- value = "";
1293
+ value = '';
1254
1294
  }
1255
1295
  var newFormData = _extends({}, formData, (_extends2 = {}, _extends2[name] = value, _extends2));
1256
1296
  onChange(newFormData, errorSchema && errorSchema && _extends({}, errorSchema, (_extends3 = {}, _extends3[name] = newErrorSchema, _extends3)), id);
@@ -1268,10 +1308,12 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1268
1308
  };
1269
1309
  };
1270
1310
  _this.getAvailableKey = function (preferredKey, formData) {
1271
- var uiSchema = _this.props.uiSchema;
1272
- var _getUiOptions = getUiOptions(uiSchema),
1311
+ var _this$props3 = _this.props,
1312
+ uiSchema = _this$props3.uiSchema,
1313
+ registry = _this$props3.registry;
1314
+ var _getUiOptions = getUiOptions(uiSchema, registry.globalUiOptions),
1273
1315
  _getUiOptions$duplica = _getUiOptions.duplicateKeySuffixSeparator,
1274
- duplicateKeySuffixSeparator = _getUiOptions$duplica === void 0 ? "-" : _getUiOptions$duplica;
1316
+ duplicateKeySuffixSeparator = _getUiOptions$duplica === void 0 ? '-' : _getUiOptions$duplica;
1275
1317
  var index = 0;
1276
1318
  var newKey = preferredKey;
1277
1319
  while (has(formData, newKey)) {
@@ -1285,10 +1327,10 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1285
1327
  if (oldValue === value) {
1286
1328
  return;
1287
1329
  }
1288
- var _this$props3 = _this.props,
1289
- formData = _this$props3.formData,
1290
- onChange = _this$props3.onChange,
1291
- errorSchema = _this$props3.errorSchema;
1330
+ var _this$props4 = _this.props,
1331
+ formData = _this$props4.formData,
1332
+ onChange = _this$props4.onChange,
1333
+ errorSchema = _this$props4.errorSchema;
1292
1334
  value = _this.getAvailableKey(value, formData);
1293
1335
  var newFormData = _extends({}, formData);
1294
1336
  var newKeys = (_newKeys = {}, _newKeys[oldValue] = value, _newKeys);
@@ -1309,10 +1351,10 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1309
1351
  if (!schema.additionalProperties) {
1310
1352
  return;
1311
1353
  }
1312
- var _this$props4 = _this.props,
1313
- formData = _this$props4.formData,
1314
- onChange = _this$props4.onChange,
1315
- registry = _this$props4.registry;
1354
+ var _this$props5 = _this.props,
1355
+ formData = _this$props5.formData,
1356
+ onChange = _this$props5.onChange,
1357
+ registry = _this$props5.registry;
1316
1358
  var newFormData = _extends({}, formData);
1317
1359
  var type = undefined;
1318
1360
  if (isObject(schema.additionalProperties)) {
@@ -1326,10 +1368,10 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1326
1368
  type = apSchema.type;
1327
1369
  }
1328
1370
  if (!type && (ANY_OF_KEY in apSchema || ONE_OF_KEY in apSchema)) {
1329
- type = "object";
1371
+ type = 'object';
1330
1372
  }
1331
1373
  }
1332
- var newKey = _this.getAvailableKey("newKey", newFormData);
1374
+ var newKey = _this.getAvailableKey('newKey', newFormData);
1333
1375
  // Cast this to make the `set` work properly
1334
1376
  set(newFormData, newKey, _this.getDefaultValue(type));
1335
1377
  onChange(newFormData);
@@ -1362,17 +1404,17 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1362
1404
  _proto.getDefaultValue = function getDefaultValue(type) {
1363
1405
  var translateString = this.props.registry.translateString;
1364
1406
  switch (type) {
1365
- case "array":
1407
+ case 'array':
1366
1408
  return [];
1367
- case "boolean":
1409
+ case 'boolean':
1368
1410
  return false;
1369
- case "null":
1411
+ case 'null':
1370
1412
  return null;
1371
- case "number":
1413
+ case 'number':
1372
1414
  return 0;
1373
- case "object":
1415
+ case 'object':
1374
1416
  return {};
1375
- case "string":
1417
+ case 'string':
1376
1418
  default:
1377
1419
  // We don't have a datatype for some reason (perhaps additionalProperties was true)
1378
1420
  return translateString(TranslatableString.NewStringDefault);
@@ -1387,60 +1429,67 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1387
1429
  */
1388
1430
  _proto.render = function render() {
1389
1431
  var _this2 = this;
1390
- var _this$props5 = this.props,
1391
- rawSchema = _this$props5.schema,
1392
- _this$props5$uiSchema = _this$props5.uiSchema,
1393
- uiSchema = _this$props5$uiSchema === void 0 ? {} : _this$props5$uiSchema,
1394
- formData = _this$props5.formData,
1395
- errorSchema = _this$props5.errorSchema,
1396
- idSchema = _this$props5.idSchema,
1397
- name = _this$props5.name,
1398
- _this$props5$required = _this$props5.required,
1399
- required = _this$props5$required === void 0 ? false : _this$props5$required,
1400
- _this$props5$disabled = _this$props5.disabled,
1401
- disabled = _this$props5$disabled === void 0 ? false : _this$props5$disabled,
1402
- _this$props5$readonly = _this$props5.readonly,
1403
- readonly = _this$props5$readonly === void 0 ? false : _this$props5$readonly,
1404
- hideError = _this$props5.hideError,
1405
- idPrefix = _this$props5.idPrefix,
1406
- idSeparator = _this$props5.idSeparator,
1407
- onBlur = _this$props5.onBlur,
1408
- onFocus = _this$props5.onFocus,
1409
- registry = _this$props5.registry;
1432
+ var _this$props6 = this.props,
1433
+ rawSchema = _this$props6.schema,
1434
+ _this$props6$uiSchema = _this$props6.uiSchema,
1435
+ uiSchema = _this$props6$uiSchema === void 0 ? {} : _this$props6$uiSchema,
1436
+ formData = _this$props6.formData,
1437
+ errorSchema = _this$props6.errorSchema,
1438
+ idSchema = _this$props6.idSchema,
1439
+ name = _this$props6.name,
1440
+ _this$props6$required = _this$props6.required,
1441
+ required = _this$props6$required === void 0 ? false : _this$props6$required,
1442
+ _this$props6$disabled = _this$props6.disabled,
1443
+ disabled = _this$props6$disabled === void 0 ? false : _this$props6$disabled,
1444
+ _this$props6$readonly = _this$props6.readonly,
1445
+ readonly = _this$props6$readonly === void 0 ? false : _this$props6$readonly,
1446
+ hideError = _this$props6.hideError,
1447
+ idPrefix = _this$props6.idPrefix,
1448
+ idSeparator = _this$props6.idSeparator,
1449
+ onBlur = _this$props6.onBlur,
1450
+ onFocus = _this$props6.onFocus,
1451
+ registry = _this$props6.registry;
1410
1452
  var fields = registry.fields,
1411
1453
  formContext = registry.formContext,
1412
- schemaUtils = registry.schemaUtils;
1454
+ schemaUtils = registry.schemaUtils,
1455
+ translateString = registry.translateString;
1413
1456
  var SchemaField = fields.SchemaField;
1414
1457
  var schema = schemaUtils.retrieveSchema(rawSchema, formData);
1415
1458
  var uiOptions = getUiOptions(uiSchema);
1416
1459
  var _schema$properties = schema.properties,
1417
1460
  schemaProperties = _schema$properties === void 0 ? {} : _schema$properties;
1418
- var title = schema.title === undefined ? name : schema.title;
1461
+ var title = uiOptions.title || (schema.title === undefined ? name : schema.title);
1419
1462
  var description = uiOptions.description || schema.description;
1420
1463
  var orderedProperties;
1421
1464
  try {
1422
1465
  var properties = Object.keys(schemaProperties);
1423
1466
  orderedProperties = orderProperties(properties, uiOptions.order);
1424
1467
  } catch (err) {
1425
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
1426
- className: "config-error",
1427
- style: {
1428
- color: "red"
1429
- }
1430
- }, "Invalid ", name || "root", " object field configuration:", /*#__PURE__*/React.createElement("em", null, err.message), "."), /*#__PURE__*/React.createElement("pre", null, JSON.stringify(schema)));
1468
+ return jsxs("div", {
1469
+ children: [jsx("p", {
1470
+ className: 'config-error',
1471
+ style: {
1472
+ color: 'red'
1473
+ },
1474
+ children: jsx(Markdown, {
1475
+ children: translateString(TranslatableString.InvalidObjectField, [name || 'root', err.message])
1476
+ })
1477
+ }), jsx("pre", {
1478
+ children: JSON.stringify(schema)
1479
+ })]
1480
+ });
1431
1481
  }
1432
- var Template = getTemplate("ObjectFieldTemplate", registry, uiOptions);
1482
+ var Template = getTemplate('ObjectFieldTemplate', registry, uiOptions);
1433
1483
  var templateProps = {
1434
- title: uiOptions.title || title,
1484
+ title: title,
1435
1485
  description: description,
1436
1486
  properties: orderedProperties.map(function (name) {
1437
1487
  var addedByAdditionalProperties = has(schema, [PROPERTIES_KEY, name, ADDITIONAL_PROPERTY_FLAG]);
1438
1488
  var fieldUiSchema = addedByAdditionalProperties ? uiSchema.additionalProperties : uiSchema[name];
1439
- var hidden = getUiOptions(fieldUiSchema).widget === "hidden";
1489
+ var hidden = getUiOptions(fieldUiSchema).widget === 'hidden';
1440
1490
  var fieldIdSchema = get(idSchema, [name], {});
1441
1491
  return {
1442
- content: /*#__PURE__*/React.createElement(SchemaField, {
1443
- key: name,
1492
+ content: jsx(SchemaField, {
1444
1493
  name: name,
1445
1494
  required: _this2.isRequired(name),
1446
1495
  schema: get(schema, [PROPERTIES_KEY, name], {}),
@@ -1461,7 +1510,7 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1461
1510
  readonly: readonly,
1462
1511
  hideError: hideError,
1463
1512
  onDropPropertyClick: _this2.onDropPropertyClick
1464
- }),
1513
+ }, name),
1465
1514
  name: name,
1466
1515
  readonly: readonly,
1467
1516
  disabled: disabled,
@@ -1479,7 +1528,7 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1479
1528
  formContext: formContext,
1480
1529
  registry: registry
1481
1530
  };
1482
- return /*#__PURE__*/React.createElement(Template, _extends({}, templateProps, {
1531
+ return jsx(Template, _extends({}, templateProps, {
1483
1532
  onAddClick: this.handleAddClick
1484
1533
  }));
1485
1534
  };
@@ -1489,13 +1538,13 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1489
1538
  var _excluded$6 = ["__errors"];
1490
1539
  /** The map of component type to FieldName */
1491
1540
  var COMPONENT_TYPES = {
1492
- array: "ArrayField",
1493
- "boolean": "BooleanField",
1494
- integer: "NumberField",
1495
- number: "NumberField",
1496
- object: "ObjectField",
1497
- string: "StringField",
1498
- "null": "NullField"
1541
+ array: 'ArrayField',
1542
+ "boolean": 'BooleanField',
1543
+ integer: 'NumberField',
1544
+ number: 'NumberField',
1545
+ object: 'ObjectField',
1546
+ string: 'StringField',
1547
+ "null": 'NullField'
1499
1548
  };
1500
1549
  /** Computes and returns which `Field` implementation to return in order to render the field represented by the
1501
1550
  * `schema`. The `uiOptions` are used to alter what potential `Field` implementation is actually returned. If no
@@ -1511,14 +1560,14 @@ function getFieldComponent(schema, uiOptions, idSchema, registry) {
1511
1560
  var field = uiOptions.field;
1512
1561
  var fields = registry.fields,
1513
1562
  translateString = registry.translateString;
1514
- if (typeof field === "function") {
1563
+ if (typeof field === 'function') {
1515
1564
  return field;
1516
1565
  }
1517
- if (typeof field === "string" && field in fields) {
1566
+ if (typeof field === 'string' && field in fields) {
1518
1567
  return fields[field];
1519
1568
  }
1520
1569
  var schemaType = getSchemaType(schema);
1521
- var type = Array.isArray(schemaType) ? schemaType[0] : schemaType || "";
1570
+ var type = Array.isArray(schemaType) ? schemaType[0] : schemaType || '';
1522
1571
  var componentName = COMPONENT_TYPES[type];
1523
1572
  // If the type is not defined and the schema uses 'anyOf' or 'oneOf', don't
1524
1573
  // render a field and let the MultiSchemaField component handle the form display
@@ -1528,8 +1577,8 @@ function getFieldComponent(schema, uiOptions, idSchema, registry) {
1528
1577
  };
1529
1578
  }
1530
1579
  return componentName in fields ? fields[componentName] : function () {
1531
- var UnsupportedFieldTemplate = getTemplate("UnsupportedFieldTemplate", registry, uiOptions);
1532
- return /*#__PURE__*/React.createElement(UnsupportedFieldTemplate, {
1580
+ var UnsupportedFieldTemplate = getTemplate('UnsupportedFieldTemplate', registry, uiOptions);
1581
+ return jsx(UnsupportedFieldTemplate, {
1533
1582
  schema: schema,
1534
1583
  idSchema: idSchema,
1535
1584
  reason: translateString(TranslatableString.UnknownFieldType, [String(schema.type)]),
@@ -1560,19 +1609,20 @@ function SchemaFieldRender(props) {
1560
1609
  _props$wasPropertyKey = props.wasPropertyKeyModified,
1561
1610
  wasPropertyKeyModified = _props$wasPropertyKey === void 0 ? false : _props$wasPropertyKey;
1562
1611
  var formContext = registry.formContext,
1563
- schemaUtils = registry.schemaUtils;
1564
- var uiOptions = getUiOptions(uiSchema);
1565
- var FieldTemplate = getTemplate("FieldTemplate", registry, uiOptions);
1566
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
1567
- var FieldHelpTemplate = getTemplate("FieldHelpTemplate", registry, uiOptions);
1568
- var FieldErrorTemplate = getTemplate("FieldErrorTemplate", registry, uiOptions);
1612
+ schemaUtils = registry.schemaUtils,
1613
+ globalUiOptions = registry.globalUiOptions;
1614
+ var uiOptions = getUiOptions(uiSchema, globalUiOptions);
1615
+ var FieldTemplate = getTemplate('FieldTemplate', registry, uiOptions);
1616
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
1617
+ var FieldHelpTemplate = getTemplate('FieldHelpTemplate', registry, uiOptions);
1618
+ var FieldErrorTemplate = getTemplate('FieldErrorTemplate', registry, uiOptions);
1569
1619
  var schema = schemaUtils.retrieveSchema(_schema, formData);
1570
1620
  var fieldId = _idSchema[ID_KEY];
1571
1621
  var idSchema = mergeObjects(schemaUtils.toIdSchema(schema, fieldId, formData, idPrefix, idSeparator), _idSchema);
1572
1622
  /** Intermediary `onChange` handler for field components that will inject the `id` of the current field into the
1573
1623
  * `onChange` chain if it is not already being provided from a deeper level in the hierarchy
1574
1624
  */
1575
- var handleFieldComponentChange = React.useCallback(function (formData, newErrorSchema, id) {
1625
+ var handleFieldComponentChange = useCallback(function (formData, newErrorSchema, id) {
1576
1626
  var theId = id || fieldId;
1577
1627
  return onChange(formData, newErrorSchema, theId);
1578
1628
  }, [fieldId, onChange]);
@@ -1586,16 +1636,16 @@ function SchemaFieldRender(props) {
1586
1636
  if (Object.keys(schema).length === 0) {
1587
1637
  return null;
1588
1638
  }
1589
- var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
1639
+ var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
1590
1640
  var _ref = errorSchema || {},
1591
1641
  __errors = _ref.__errors,
1592
1642
  fieldErrorSchema = _objectWithoutPropertiesLoose(_ref, _excluded$6);
1593
1643
  // See #439: uiSchema: Don't pass consumed class names or style to child components
1594
- var fieldUiSchema = omit(uiSchema, ["ui:classNames", "classNames", "ui:style"]);
1644
+ var fieldUiSchema = omit(uiSchema, ['ui:classNames', 'classNames', 'ui:style']);
1595
1645
  if (UI_OPTIONS_KEY in fieldUiSchema) {
1596
- fieldUiSchema[UI_OPTIONS_KEY] = omit(fieldUiSchema[UI_OPTIONS_KEY], ["classNames", "style"]);
1646
+ fieldUiSchema[UI_OPTIONS_KEY] = omit(fieldUiSchema[UI_OPTIONS_KEY], ['classNames', 'style']);
1597
1647
  }
1598
- var field = /*#__PURE__*/React.createElement(FieldComponent, _extends({}, props, {
1648
+ var field = jsx(FieldComponent, _extends({}, props, {
1599
1649
  onChange: handleFieldComponentChange,
1600
1650
  idSchema: idSchema,
1601
1651
  schema: schema,
@@ -1616,15 +1666,15 @@ function SchemaFieldRender(props) {
1616
1666
  } else {
1617
1667
  label = ADDITIONAL_PROPERTY_FLAG in schema ? name : uiOptions.title || props.schema.title || schema.title || name;
1618
1668
  }
1619
- var description = uiOptions.description || props.schema.description || schema.description || "";
1669
+ var description = uiOptions.description || props.schema.description || schema.description || '';
1620
1670
  var help = uiOptions.help;
1621
- var hidden = uiOptions.widget === "hidden";
1622
- var classNames = ["form-group", "field", "field-" + schema.type];
1671
+ var hidden = uiOptions.widget === 'hidden';
1672
+ var classNames = ['form-group', 'field', "field-" + schema.type];
1623
1673
  if (!hideError && __errors && __errors.length > 0) {
1624
- classNames.push("field-error has-error has-danger");
1674
+ classNames.push('field-error has-error has-danger');
1625
1675
  }
1626
1676
  if (uiSchema !== null && uiSchema !== void 0 && uiSchema.classNames) {
1627
- if (process.env.NODE_ENV !== "production") {
1677
+ if (process.env.NODE_ENV !== 'production') {
1628
1678
  console.warn("'uiSchema.classNames' is deprecated and may be removed in a major release; Use 'ui:classNames' instead.");
1629
1679
  }
1630
1680
  classNames.push(uiSchema.classNames);
@@ -1632,7 +1682,7 @@ function SchemaFieldRender(props) {
1632
1682
  if (uiOptions.classNames) {
1633
1683
  classNames.push(uiOptions.classNames);
1634
1684
  }
1635
- var helpComponent = /*#__PURE__*/React.createElement(FieldHelpTemplate, {
1685
+ var helpComponent = jsx(FieldHelpTemplate, {
1636
1686
  help: help,
1637
1687
  idSchema: idSchema,
1638
1688
  schema: schema,
@@ -1640,7 +1690,7 @@ function SchemaFieldRender(props) {
1640
1690
  hasErrors: !hideError && __errors && __errors.length > 0,
1641
1691
  registry: registry
1642
1692
  });
1643
- var errorsComponent = hideError ? undefined : /*#__PURE__*/React.createElement(FieldErrorTemplate, {
1693
+ var errorsComponent = hideError ? undefined : jsx(FieldErrorTemplate, {
1644
1694
  errors: __errors,
1645
1695
  errorSchema: errorSchema,
1646
1696
  idSchema: idSchema,
@@ -1649,7 +1699,7 @@ function SchemaFieldRender(props) {
1649
1699
  registry: registry
1650
1700
  });
1651
1701
  var fieldProps = {
1652
- description: /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
1702
+ description: jsx(DescriptionFieldTemplate, {
1653
1703
  id: descriptionId(id),
1654
1704
  description: description,
1655
1705
  schema: schema,
@@ -1658,7 +1708,7 @@ function SchemaFieldRender(props) {
1658
1708
  }),
1659
1709
  rawDescription: description,
1660
1710
  help: helpComponent,
1661
- rawHelp: typeof help === "string" ? help : undefined,
1711
+ rawHelp: typeof help === 'string' ? help : undefined,
1662
1712
  errors: errorsComponent,
1663
1713
  rawErrors: hideError ? undefined : __errors,
1664
1714
  id: id,
@@ -1672,7 +1722,7 @@ function SchemaFieldRender(props) {
1672
1722
  readonly: readonly,
1673
1723
  hideError: hideError,
1674
1724
  displayLabel: displayLabel,
1675
- classNames: classNames.join(" ").trim(),
1725
+ classNames: classNames.join(' ').trim(),
1676
1726
  style: uiOptions.style,
1677
1727
  formContext: formContext,
1678
1728
  formData: formData,
@@ -1682,68 +1732,72 @@ function SchemaFieldRender(props) {
1682
1732
  };
1683
1733
  var _AnyOfField = registry.fields.AnyOfField;
1684
1734
  var _OneOfField = registry.fields.OneOfField;
1685
- var isReplacingAnyOrOneOf = (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:field"]) && (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:fieldReplacesAnyOrOneOf"]) === true;
1686
- return /*#__PURE__*/React.createElement(FieldTemplate, _extends({}, fieldProps), /*#__PURE__*/React.createElement(React.Fragment, null, field, schema.anyOf && !isReplacingAnyOrOneOf && !schemaUtils.isSelect(schema) && /*#__PURE__*/React.createElement(_AnyOfField, {
1687
- name: name,
1688
- disabled: disabled,
1689
- readonly: readonly,
1690
- hideError: hideError,
1691
- errorSchema: errorSchema,
1692
- formData: formData,
1693
- formContext: formContext,
1694
- idPrefix: idPrefix,
1695
- idSchema: idSchema,
1696
- idSeparator: idSeparator,
1697
- onBlur: props.onBlur,
1698
- onChange: props.onChange,
1699
- onFocus: props.onFocus,
1700
- options: schema.anyOf.map(function (_schema) {
1701
- return schemaUtils.retrieveSchema(isObject(_schema) ? _schema : {}, formData);
1702
- }),
1703
- baseType: schema.type,
1704
- registry: registry,
1705
- schema: schema,
1706
- uiSchema: uiSchema
1707
- }), schema.oneOf && !isReplacingAnyOrOneOf && !schemaUtils.isSelect(schema) && /*#__PURE__*/React.createElement(_OneOfField, {
1708
- name: name,
1709
- disabled: disabled,
1710
- readonly: readonly,
1711
- hideError: hideError,
1712
- errorSchema: errorSchema,
1713
- formData: formData,
1714
- formContext: formContext,
1715
- idPrefix: idPrefix,
1716
- idSchema: idSchema,
1717
- idSeparator: idSeparator,
1718
- onBlur: props.onBlur,
1719
- onChange: props.onChange,
1720
- onFocus: props.onFocus,
1721
- options: schema.oneOf.map(function (_schema) {
1722
- return schemaUtils.retrieveSchema(isObject(_schema) ? _schema : {}, formData);
1723
- }),
1724
- baseType: schema.type,
1725
- registry: registry,
1726
- schema: schema,
1727
- uiSchema: uiSchema
1728
- })));
1735
+ var isReplacingAnyOrOneOf = (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:field']) && (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:fieldReplacesAnyOrOneOf']) === true;
1736
+ return jsx(FieldTemplate, _extends({}, fieldProps, {
1737
+ children: jsxs(Fragment, {
1738
+ children: [field, schema.anyOf && !isReplacingAnyOrOneOf && !schemaUtils.isSelect(schema) && jsx(_AnyOfField, {
1739
+ name: name,
1740
+ disabled: disabled,
1741
+ readonly: readonly,
1742
+ hideError: hideError,
1743
+ errorSchema: errorSchema,
1744
+ formData: formData,
1745
+ formContext: formContext,
1746
+ idPrefix: idPrefix,
1747
+ idSchema: idSchema,
1748
+ idSeparator: idSeparator,
1749
+ onBlur: props.onBlur,
1750
+ onChange: props.onChange,
1751
+ onFocus: props.onFocus,
1752
+ options: schema.anyOf.map(function (_schema) {
1753
+ return schemaUtils.retrieveSchema(isObject(_schema) ? _schema : {}, formData);
1754
+ }),
1755
+ baseType: schema.type,
1756
+ registry: registry,
1757
+ schema: schema,
1758
+ uiSchema: uiSchema
1759
+ }), schema.oneOf && !isReplacingAnyOrOneOf && !schemaUtils.isSelect(schema) && jsx(_OneOfField, {
1760
+ name: name,
1761
+ disabled: disabled,
1762
+ readonly: readonly,
1763
+ hideError: hideError,
1764
+ errorSchema: errorSchema,
1765
+ formData: formData,
1766
+ formContext: formContext,
1767
+ idPrefix: idPrefix,
1768
+ idSchema: idSchema,
1769
+ idSeparator: idSeparator,
1770
+ onBlur: props.onBlur,
1771
+ onChange: props.onChange,
1772
+ onFocus: props.onFocus,
1773
+ options: schema.oneOf.map(function (_schema) {
1774
+ return schemaUtils.retrieveSchema(isObject(_schema) ? _schema : {}, formData);
1775
+ }),
1776
+ baseType: schema.type,
1777
+ registry: registry,
1778
+ schema: schema,
1779
+ uiSchema: uiSchema
1780
+ })]
1781
+ })
1782
+ }));
1729
1783
  }
1730
1784
  /** The `SchemaField` component determines whether it is necessary to rerender the component based on any props changes
1731
1785
  * and if so, calls the `SchemaFieldRender` component with the props.
1732
1786
  */
1733
- var SchemaField = /*#__PURE__*/function (_React$Component) {
1734
- _inheritsLoose(SchemaField, _React$Component);
1787
+ var SchemaField = /*#__PURE__*/function (_Component) {
1788
+ _inheritsLoose(SchemaField, _Component);
1735
1789
  function SchemaField() {
1736
- return _React$Component.apply(this, arguments) || this;
1790
+ return _Component.apply(this, arguments) || this;
1737
1791
  }
1738
1792
  var _proto = SchemaField.prototype;
1739
1793
  _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
1740
1794
  return !deepEquals(this.props, nextProps);
1741
1795
  };
1742
1796
  _proto.render = function render() {
1743
- return /*#__PURE__*/React.createElement(SchemaFieldRender, _extends({}, this.props));
1797
+ return jsx(SchemaFieldRender, _extends({}, this.props));
1744
1798
  };
1745
1799
  return SchemaField;
1746
- }(React.Component);
1800
+ }(Component);
1747
1801
 
1748
1802
  var _excluded$5 = ["widget", "placeholder"];
1749
1803
  /** The `StringField` component is used to render a schema field that represents a string type
@@ -1774,7 +1828,7 @@ function StringField(props) {
1774
1828
  formContext = registry.formContext,
1775
1829
  schemaUtils = registry.schemaUtils;
1776
1830
  var enumOptions = schemaUtils.isSelect(schema) ? optionsList(schema) : undefined;
1777
- var defaultWidget = enumOptions ? "select" : "text";
1831
+ var defaultWidget = enumOptions ? 'select' : 'text';
1778
1832
  if (format && hasWidget(schema, format, widgets)) {
1779
1833
  defaultWidget = format;
1780
1834
  }
@@ -1782,16 +1836,17 @@ function StringField(props) {
1782
1836
  _getUiOptions$widget = _getUiOptions.widget,
1783
1837
  widget = _getUiOptions$widget === void 0 ? defaultWidget : _getUiOptions$widget,
1784
1838
  _getUiOptions$placeho = _getUiOptions.placeholder,
1785
- placeholder = _getUiOptions$placeho === void 0 ? "" : _getUiOptions$placeho,
1839
+ placeholder = _getUiOptions$placeho === void 0 ? '' : _getUiOptions$placeho,
1786
1840
  options = _objectWithoutPropertiesLoose(_getUiOptions, _excluded$5);
1787
1841
  var Widget = getWidget(schema, widget, widgets);
1788
- return /*#__PURE__*/React.createElement(Widget, {
1842
+ return jsx(Widget, {
1789
1843
  options: _extends({}, options, {
1790
1844
  enumOptions: enumOptions
1791
1845
  }),
1792
1846
  schema: schema,
1793
1847
  uiSchema: uiSchema,
1794
1848
  id: idSchema.$id,
1849
+ name: name,
1795
1850
  label: title === undefined ? name : title,
1796
1851
  value: formData,
1797
1852
  onChange: onChange,
@@ -1856,8 +1911,8 @@ function ArrayFieldDescriptionTemplate(props) {
1856
1911
  if (!description || !displayLabel) {
1857
1912
  return null;
1858
1913
  }
1859
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, options);
1860
- return /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
1914
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
1915
+ return jsx(DescriptionFieldTemplate, {
1861
1916
  id: descriptionId(idSchema),
1862
1917
  description: description,
1863
1918
  schema: schema,
@@ -1878,13 +1933,16 @@ function ArrayFieldItemTemplate(props) {
1878
1933
  hasMoveDown = props.hasMoveDown,
1879
1934
  hasMoveUp = props.hasMoveUp,
1880
1935
  hasRemove = props.hasRemove,
1936
+ hasCopy = props.hasCopy,
1881
1937
  index = props.index,
1938
+ onCopyIndexClick = props.onCopyIndexClick,
1882
1939
  onDropIndexClick = props.onDropIndexClick,
1883
1940
  onReorderClick = props.onReorderClick,
1884
1941
  readonly = props.readonly,
1885
1942
  registry = props.registry,
1886
1943
  uiSchema = props.uiSchema;
1887
1944
  var _registry$templates$B = registry.templates.ButtonTemplates,
1945
+ CopyButton = _registry$templates$B.CopyButton,
1888
1946
  MoveDownButton = _registry$templates$B.MoveDownButton,
1889
1947
  MoveUpButton = _registry$templates$B.MoveUpButton,
1890
1948
  RemoveButton = _registry$templates$B.RemoveButton;
@@ -1892,39 +1950,49 @@ function ArrayFieldItemTemplate(props) {
1892
1950
  flex: 1,
1893
1951
  paddingLeft: 6,
1894
1952
  paddingRight: 6,
1895
- fontWeight: "bold"
1953
+ fontWeight: 'bold'
1896
1954
  };
1897
- return /*#__PURE__*/React.createElement("div", {
1898
- className: className
1899
- }, /*#__PURE__*/React.createElement("div", {
1900
- className: hasToolbar ? "col-xs-9" : "col-xs-12"
1901
- }, children), hasToolbar && /*#__PURE__*/React.createElement("div", {
1902
- className: "col-xs-3 array-item-toolbox"
1903
- }, /*#__PURE__*/React.createElement("div", {
1904
- className: "btn-group",
1905
- style: {
1906
- display: "flex",
1907
- justifyContent: "space-around"
1908
- }
1909
- }, (hasMoveUp || hasMoveDown) && /*#__PURE__*/React.createElement(MoveUpButton, {
1910
- style: btnStyle,
1911
- disabled: disabled || readonly || !hasMoveUp,
1912
- onClick: onReorderClick(index, index - 1),
1913
- uiSchema: uiSchema,
1914
- registry: registry
1915
- }), (hasMoveUp || hasMoveDown) && /*#__PURE__*/React.createElement(MoveDownButton, {
1916
- style: btnStyle,
1917
- disabled: disabled || readonly || !hasMoveDown,
1918
- onClick: onReorderClick(index, index + 1),
1919
- uiSchema: uiSchema,
1920
- registry: registry
1921
- }), hasRemove && /*#__PURE__*/React.createElement(RemoveButton, {
1922
- style: btnStyle,
1923
- disabled: disabled || readonly,
1924
- onClick: onDropIndexClick(index),
1925
- uiSchema: uiSchema,
1926
- registry: registry
1927
- }))));
1955
+ return jsxs("div", {
1956
+ className: className,
1957
+ children: [jsx("div", {
1958
+ className: hasToolbar ? 'col-xs-9' : 'col-xs-12',
1959
+ children: children
1960
+ }), hasToolbar && jsx("div", {
1961
+ className: 'col-xs-3 array-item-toolbox',
1962
+ children: jsxs("div", {
1963
+ className: 'btn-group',
1964
+ style: {
1965
+ display: 'flex',
1966
+ justifyContent: 'space-around'
1967
+ },
1968
+ children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
1969
+ style: btnStyle,
1970
+ disabled: disabled || readonly || !hasMoveUp,
1971
+ onClick: onReorderClick(index, index - 1),
1972
+ uiSchema: uiSchema,
1973
+ registry: registry
1974
+ }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
1975
+ style: btnStyle,
1976
+ disabled: disabled || readonly || !hasMoveDown,
1977
+ onClick: onReorderClick(index, index + 1),
1978
+ uiSchema: uiSchema,
1979
+ registry: registry
1980
+ }), hasCopy && jsx(CopyButton, {
1981
+ style: btnStyle,
1982
+ disabled: disabled || readonly,
1983
+ onClick: onCopyIndexClick(index),
1984
+ uiSchema: uiSchema,
1985
+ registry: registry
1986
+ }), hasRemove && jsx(RemoveButton, {
1987
+ style: btnStyle,
1988
+ disabled: disabled || readonly,
1989
+ onClick: onDropIndexClick(index),
1990
+ uiSchema: uiSchema,
1991
+ registry: registry
1992
+ })]
1993
+ })
1994
+ })]
1995
+ });
1928
1996
  }
1929
1997
 
1930
1998
  var _excluded$4 = ["key"];
@@ -1946,42 +2014,42 @@ function ArrayFieldTemplate(props) {
1946
2014
  schema = props.schema,
1947
2015
  title = props.title;
1948
2016
  var uiOptions = getUiOptions(uiSchema);
1949
- var ArrayFieldDescriptionTemplate = getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
1950
- var ArrayFieldItemTemplate = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
1951
- var ArrayFieldTitleTemplate = getTemplate("ArrayFieldTitleTemplate", registry, uiOptions);
2017
+ var ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
2018
+ var ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
2019
+ var ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
1952
2020
  // Button templates are not overridden in the uiSchema
1953
2021
  var AddButton = registry.templates.ButtonTemplates.AddButton;
1954
- return /*#__PURE__*/React.createElement("fieldset", {
2022
+ return jsxs("fieldset", {
1955
2023
  className: className,
1956
- id: idSchema.$id
1957
- }, /*#__PURE__*/React.createElement(ArrayFieldTitleTemplate, {
1958
- idSchema: idSchema,
1959
- title: uiOptions.title || title,
1960
- required: required,
1961
- schema: schema,
1962
- uiSchema: uiSchema,
1963
- registry: registry
1964
- }), /*#__PURE__*/React.createElement(ArrayFieldDescriptionTemplate, {
1965
- idSchema: idSchema,
1966
- description: uiOptions.description || schema.description,
1967
- schema: schema,
1968
- uiSchema: uiSchema,
1969
- registry: registry
1970
- }), /*#__PURE__*/React.createElement("div", {
1971
- className: "row array-item-list"
1972
- }, items && items.map(function (_ref) {
1973
- var key = _ref.key,
1974
- itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
1975
- return /*#__PURE__*/React.createElement(ArrayFieldItemTemplate, _extends({
1976
- key: key
1977
- }, itemProps));
1978
- })), canAdd && /*#__PURE__*/React.createElement(AddButton, {
1979
- className: "array-item-add",
1980
- onClick: onAddClick,
1981
- disabled: disabled || readonly,
1982
- uiSchema: uiSchema,
1983
- registry: registry
1984
- }));
2024
+ id: idSchema.$id,
2025
+ children: [jsx(ArrayFieldTitleTemplate, {
2026
+ idSchema: idSchema,
2027
+ title: uiOptions.title || title,
2028
+ required: required,
2029
+ schema: schema,
2030
+ uiSchema: uiSchema,
2031
+ registry: registry
2032
+ }), jsx(ArrayFieldDescriptionTemplate, {
2033
+ idSchema: idSchema,
2034
+ description: uiOptions.description || schema.description,
2035
+ schema: schema,
2036
+ uiSchema: uiSchema,
2037
+ registry: registry
2038
+ }), jsx("div", {
2039
+ className: 'row array-item-list',
2040
+ children: items && items.map(function (_ref) {
2041
+ var key = _ref.key,
2042
+ itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2043
+ return jsx(ArrayFieldItemTemplate, _extends({}, itemProps), key);
2044
+ })
2045
+ }), canAdd && jsx(AddButton, {
2046
+ className: 'array-item-add',
2047
+ onClick: onAddClick,
2048
+ disabled: disabled || readonly,
2049
+ uiSchema: uiSchema,
2050
+ registry: registry
2051
+ })]
2052
+ });
1985
2053
  }
1986
2054
 
1987
2055
  /** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from
@@ -2002,8 +2070,8 @@ function ArrayFieldTitleTemplate(props) {
2002
2070
  if (!title || !displayLabel) {
2003
2071
  return null;
2004
2072
  }
2005
- var TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, options);
2006
- return /*#__PURE__*/React.createElement(TitleFieldTemplate, {
2073
+ var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
2074
+ return jsx(TitleFieldTemplate, {
2007
2075
  id: titleId(idSchema),
2008
2076
  title: title,
2009
2077
  required: required,
@@ -2013,7 +2081,7 @@ function ArrayFieldTitleTemplate(props) {
2013
2081
  });
2014
2082
  }
2015
2083
 
2016
- var _excluded$3 = ["id", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type"];
2084
+ var _excluded$3 = ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type"];
2017
2085
  /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
2018
2086
  * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
2019
2087
  * It can be customized/overridden for other themes or individual implementations as needed.
@@ -2029,6 +2097,7 @@ function BaseInputTemplate(props) {
2029
2097
  onBlur = props.onBlur,
2030
2098
  onFocus = props.onFocus,
2031
2099
  onChange = props.onChange,
2100
+ onChangeOverride = props.onChangeOverride,
2032
2101
  options = props.options,
2033
2102
  schema = props.schema,
2034
2103
  type = props.type,
@@ -2036,19 +2105,19 @@ function BaseInputTemplate(props) {
2036
2105
  // Note: since React 15.2.0 we can't forward unknown element attributes, so we
2037
2106
  // exclude the "options" and "schema" ones here.
2038
2107
  if (!id) {
2039
- console.log("No id for", props);
2108
+ console.log('No id for', props);
2040
2109
  throw new Error("no id for props " + JSON.stringify(props));
2041
2110
  }
2042
2111
  var inputProps = _extends({}, rest, getInputProps(schema, type, options));
2043
2112
  var inputValue;
2044
- if (inputProps.type === "number" || inputProps.type === "integer") {
2045
- inputValue = value || value === 0 ? value : "";
2113
+ if (inputProps.type === 'number' || inputProps.type === 'integer') {
2114
+ inputValue = value || value === 0 ? value : '';
2046
2115
  } else {
2047
- inputValue = value == null ? "" : value;
2116
+ inputValue = value == null ? '' : value;
2048
2117
  }
2049
2118
  var _onChange = useCallback(function (_ref) {
2050
2119
  var value = _ref.target.value;
2051
- return onChange(value === "" ? options.emptyValue : value);
2120
+ return onChange(value === '' ? options.emptyValue : value);
2052
2121
  }, [onChange, options]);
2053
2122
  var _onBlur = useCallback(function (_ref2) {
2054
2123
  var value = _ref2.target.value;
@@ -2058,29 +2127,30 @@ function BaseInputTemplate(props) {
2058
2127
  var value = _ref3.target.value;
2059
2128
  return onFocus(id, value);
2060
2129
  }, [onFocus, id]);
2061
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({
2062
- id: id,
2063
- name: id,
2064
- className: "form-control",
2065
- readOnly: readonly,
2066
- disabled: disabled,
2067
- autoFocus: autofocus,
2068
- value: inputValue
2069
- }, inputProps, {
2070
- list: schema.examples ? examplesId(id) : undefined,
2071
- onChange: _onChange,
2072
- onBlur: _onBlur,
2073
- onFocus: _onFocus,
2074
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
2075
- })), Array.isArray(schema.examples) && /*#__PURE__*/React.createElement("datalist", {
2076
- key: "datalist_" + id,
2077
- id: examplesId(id)
2078
- }, schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
2079
- return /*#__PURE__*/React.createElement("option", {
2080
- key: example,
2081
- value: example
2082
- });
2083
- })));
2130
+ return jsxs(Fragment, {
2131
+ children: [jsx("input", _extends({
2132
+ id: id,
2133
+ name: id,
2134
+ className: 'form-control',
2135
+ readOnly: readonly,
2136
+ disabled: disabled,
2137
+ autoFocus: autofocus,
2138
+ value: inputValue
2139
+ }, inputProps, {
2140
+ list: schema.examples ? examplesId(id) : undefined,
2141
+ onChange: onChangeOverride || _onChange,
2142
+ onBlur: _onBlur,
2143
+ onFocus: _onFocus,
2144
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
2145
+ })), Array.isArray(schema.examples) && jsx("datalist", {
2146
+ id: examplesId(id),
2147
+ children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
2148
+ return jsx("option", {
2149
+ value: example
2150
+ }, example);
2151
+ })
2152
+ }, "datalist_" + id)]
2153
+ });
2084
2154
  }
2085
2155
 
2086
2156
  /** The `SubmitButton` renders a button that represent the `Submit` action on a form
@@ -2095,53 +2165,67 @@ function SubmitButton(_ref) {
2095
2165
  if (norender) {
2096
2166
  return null;
2097
2167
  }
2098
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", _extends({
2099
- type: "submit"
2100
- }, submitButtonProps, {
2101
- className: "btn btn-info " + submitButtonProps.className
2102
- }), submitText));
2168
+ return jsx("div", {
2169
+ children: jsx("button", _extends({
2170
+ type: 'submit'
2171
+ }, submitButtonProps, {
2172
+ className: "btn btn-info " + submitButtonProps.className,
2173
+ children: submitText
2174
+ }))
2175
+ });
2103
2176
  }
2104
2177
 
2105
2178
  var _excluded$2 = ["iconType", "icon", "className", "uiSchema", "registry"];
2106
2179
  function IconButton(props) {
2107
2180
  var _props$iconType = props.iconType,
2108
- iconType = _props$iconType === void 0 ? "default" : _props$iconType,
2181
+ iconType = _props$iconType === void 0 ? 'default' : _props$iconType,
2109
2182
  icon = props.icon,
2110
2183
  className = props.className,
2111
2184
  otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
2112
- return /*#__PURE__*/React.createElement("button", _extends({
2113
- type: "button",
2185
+ return jsx("button", _extends({
2186
+ type: 'button',
2114
2187
  className: "btn btn-" + iconType + " " + className
2115
- }, otherProps), /*#__PURE__*/React.createElement("i", {
2116
- className: "glyphicon glyphicon-" + icon
2188
+ }, otherProps, {
2189
+ children: jsx("i", {
2190
+ className: "glyphicon glyphicon-" + icon
2191
+ })
2192
+ }));
2193
+ }
2194
+ function CopyButton(props) {
2195
+ var translateString = props.registry.translateString;
2196
+ return jsx(IconButton, _extends({
2197
+ title: translateString(TranslatableString.CopyButton),
2198
+ className: 'array-item-copy'
2199
+ }, props, {
2200
+ icon: 'copy'
2117
2201
  }));
2118
2202
  }
2119
2203
  function MoveDownButton(props) {
2120
2204
  var translateString = props.registry.translateString;
2121
- return /*#__PURE__*/React.createElement(IconButton, _extends({
2205
+ return jsx(IconButton, _extends({
2122
2206
  title: translateString(TranslatableString.MoveDownButton),
2123
- className: "array-item-move-down"
2207
+ className: 'array-item-move-down'
2124
2208
  }, props, {
2125
- icon: "arrow-down"
2209
+ icon: 'arrow-down'
2126
2210
  }));
2127
2211
  }
2128
2212
  function MoveUpButton(props) {
2129
2213
  var translateString = props.registry.translateString;
2130
- return /*#__PURE__*/React.createElement(IconButton, _extends({
2214
+ return jsx(IconButton, _extends({
2131
2215
  title: translateString(TranslatableString.MoveUpButton),
2132
- className: "array-item-move-up"
2216
+ className: 'array-item-move-up'
2133
2217
  }, props, {
2134
- icon: "arrow-up"
2218
+ icon: 'arrow-up'
2135
2219
  }));
2136
2220
  }
2137
2221
  function RemoveButton(props) {
2138
2222
  var translateString = props.registry.translateString;
2139
- return /*#__PURE__*/React.createElement(IconButton, _extends({
2223
+ return jsx(IconButton, _extends({
2140
2224
  title: translateString(TranslatableString.RemoveButton),
2141
- className: "array-item-remove"
2225
+ className: 'array-item-remove'
2142
2226
  }, props, {
2143
- iconType: "danger",
2144
- icon: "remove"
2227
+ iconType: 'danger',
2228
+ icon: 'remove'
2145
2229
  }));
2146
2230
  }
2147
2231
 
@@ -2153,25 +2237,28 @@ function AddButton(_ref) {
2153
2237
  disabled = _ref.disabled,
2154
2238
  registry = _ref.registry;
2155
2239
  var translateString = registry.translateString;
2156
- return /*#__PURE__*/React.createElement("div", {
2157
- className: "row"
2158
- }, /*#__PURE__*/React.createElement("p", {
2159
- className: "col-xs-3 col-xs-offset-9 text-right " + className
2160
- }, /*#__PURE__*/React.createElement(IconButton, {
2161
- iconType: "info",
2162
- icon: "plus",
2163
- className: "btn-add col-xs-12",
2164
- title: translateString(TranslatableString.AddButton),
2165
- onClick: onClick,
2166
- disabled: disabled,
2167
- registry: registry
2168
- })));
2240
+ return jsx("div", {
2241
+ className: 'row',
2242
+ children: jsx("p", {
2243
+ className: "col-xs-3 col-xs-offset-9 text-right " + className,
2244
+ children: jsx(IconButton, {
2245
+ iconType: 'info',
2246
+ icon: 'plus',
2247
+ className: 'btn-add col-xs-12',
2248
+ title: translateString(TranslatableString.AddButton),
2249
+ onClick: onClick,
2250
+ disabled: disabled,
2251
+ registry: registry
2252
+ })
2253
+ })
2254
+ });
2169
2255
  }
2170
2256
 
2171
2257
  function buttonTemplates() {
2172
2258
  return {
2173
2259
  SubmitButton: SubmitButton,
2174
2260
  AddButton: AddButton,
2261
+ CopyButton: CopyButton,
2175
2262
  MoveDownButton: MoveDownButton,
2176
2263
  MoveUpButton: MoveUpButton,
2177
2264
  RemoveButton: RemoveButton
@@ -2188,16 +2275,18 @@ function DescriptionField(props) {
2188
2275
  if (!description) {
2189
2276
  return null;
2190
2277
  }
2191
- if (typeof description === "string") {
2192
- return /*#__PURE__*/React.createElement("p", {
2278
+ if (typeof description === 'string') {
2279
+ return jsx("p", {
2193
2280
  id: id,
2194
- className: "field-description"
2195
- }, description);
2281
+ className: 'field-description',
2282
+ children: description
2283
+ });
2196
2284
  } else {
2197
- return /*#__PURE__*/React.createElement("div", {
2285
+ return jsx("div", {
2198
2286
  id: id,
2199
- className: "field-description"
2200
- }, description);
2287
+ className: 'field-description',
2288
+ children: description
2289
+ });
2201
2290
  }
2202
2291
  }
2203
2292
 
@@ -2209,23 +2298,27 @@ function ErrorList(_ref) {
2209
2298
  var errors = _ref.errors,
2210
2299
  registry = _ref.registry;
2211
2300
  var translateString = registry.translateString;
2212
- return /*#__PURE__*/React.createElement("div", {
2213
- className: "panel panel-danger errors"
2214
- }, /*#__PURE__*/React.createElement("div", {
2215
- className: "panel-heading"
2216
- }, /*#__PURE__*/React.createElement("h3", {
2217
- className: "panel-title"
2218
- }, translateString(TranslatableString.ErrorsLabel))), /*#__PURE__*/React.createElement("ul", {
2219
- className: "list-group"
2220
- }, errors.map(function (error, i) {
2221
- return /*#__PURE__*/React.createElement("li", {
2222
- key: i,
2223
- className: "list-group-item text-danger"
2224
- }, error.stack);
2225
- })));
2301
+ return jsxs("div", {
2302
+ className: 'panel panel-danger errors',
2303
+ children: [jsx("div", {
2304
+ className: 'panel-heading',
2305
+ children: jsx("h3", {
2306
+ className: 'panel-title',
2307
+ children: translateString(TranslatableString.ErrorsLabel)
2308
+ })
2309
+ }), jsx("ul", {
2310
+ className: 'list-group',
2311
+ children: errors.map(function (error, i) {
2312
+ return jsx("li", {
2313
+ className: 'list-group-item text-danger',
2314
+ children: error.stack
2315
+ }, i);
2316
+ })
2317
+ })]
2318
+ });
2226
2319
  }
2227
2320
 
2228
- var REQUIRED_FIELD_SYMBOL$1 = "*";
2321
+ var REQUIRED_FIELD_SYMBOL$1 = '*';
2229
2322
  /** Renders a label for a field
2230
2323
  *
2231
2324
  * @param props - The `LabelProps` for this component
@@ -2237,12 +2330,14 @@ function Label(props) {
2237
2330
  if (!label) {
2238
2331
  return null;
2239
2332
  }
2240
- return /*#__PURE__*/React.createElement("label", {
2241
- className: "control-label",
2242
- htmlFor: id
2243
- }, label, required && /*#__PURE__*/React.createElement("span", {
2244
- className: "required"
2245
- }, REQUIRED_FIELD_SYMBOL$1));
2333
+ return jsxs("label", {
2334
+ className: 'control-label',
2335
+ htmlFor: id,
2336
+ children: [label, required && jsx("span", {
2337
+ className: 'required',
2338
+ children: REQUIRED_FIELD_SYMBOL$1
2339
+ })]
2340
+ });
2246
2341
  }
2247
2342
 
2248
2343
  /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
@@ -2263,17 +2358,20 @@ function FieldTemplate(props) {
2263
2358
  registry = props.registry,
2264
2359
  uiSchema = props.uiSchema;
2265
2360
  var uiOptions = getUiOptions(uiSchema);
2266
- var WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
2361
+ var WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
2267
2362
  if (hidden) {
2268
- return /*#__PURE__*/React.createElement("div", {
2269
- className: "hidden"
2270
- }, children);
2363
+ return jsx("div", {
2364
+ className: 'hidden',
2365
+ children: children
2366
+ });
2271
2367
  }
2272
- return /*#__PURE__*/React.createElement(WrapIfAdditionalTemplate, _extends({}, props), displayLabel && /*#__PURE__*/React.createElement(Label, {
2273
- label: label,
2274
- required: required,
2275
- id: id
2276
- }), displayLabel && description ? description : null, children, errors, help);
2368
+ return jsxs(WrapIfAdditionalTemplate, _extends({}, props, {
2369
+ children: [displayLabel && jsx(Label, {
2370
+ label: label,
2371
+ required: required,
2372
+ id: id
2373
+ }), displayLabel && description ? description : null, children, errors, help]
2374
+ }));
2277
2375
  }
2278
2376
 
2279
2377
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
@@ -2288,17 +2386,20 @@ function FieldErrorTemplate(props) {
2288
2386
  return null;
2289
2387
  }
2290
2388
  var id = errorId(idSchema);
2291
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("ul", {
2292
- id: id,
2293
- className: "error-detail bs-callout bs-callout-info"
2294
- }, errors.filter(function (elem) {
2295
- return !!elem;
2296
- }).map(function (error, index) {
2297
- return /*#__PURE__*/React.createElement("li", {
2298
- className: "text-danger",
2299
- key: index
2300
- }, error);
2301
- })));
2389
+ return jsx("div", {
2390
+ children: jsx("ul", {
2391
+ id: id,
2392
+ className: 'error-detail bs-callout bs-callout-info',
2393
+ children: errors.filter(function (elem) {
2394
+ return !!elem;
2395
+ }).map(function (error, index) {
2396
+ return jsx("li", {
2397
+ className: 'text-danger',
2398
+ children: error
2399
+ }, index);
2400
+ })
2401
+ })
2402
+ });
2302
2403
  }
2303
2404
 
2304
2405
  /** The `FieldHelpTemplate` component renders any help desired for a field
@@ -2312,16 +2413,18 @@ function FieldHelpTemplate(props) {
2312
2413
  return null;
2313
2414
  }
2314
2415
  var id = helpId(idSchema);
2315
- if (typeof help === "string") {
2316
- return /*#__PURE__*/React.createElement("p", {
2416
+ if (typeof help === 'string') {
2417
+ return jsx("p", {
2317
2418
  id: id,
2318
- className: "help-block"
2319
- }, help);
2419
+ className: 'help-block',
2420
+ children: help
2421
+ });
2320
2422
  }
2321
- return /*#__PURE__*/React.createElement("div", {
2423
+ return jsx("div", {
2322
2424
  id: id,
2323
- className: "help-block"
2324
- }, help);
2425
+ className: 'help-block',
2426
+ children: help
2427
+ });
2325
2428
  }
2326
2429
 
2327
2430
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
@@ -2344,37 +2447,38 @@ function ObjectFieldTemplate(props) {
2344
2447
  title = props.title,
2345
2448
  uiSchema = props.uiSchema;
2346
2449
  var options = getUiOptions(uiSchema);
2347
- var TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, options);
2348
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, options);
2450
+ var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
2451
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
2349
2452
  // Button templates are not overridden in the uiSchema
2350
2453
  var AddButton = registry.templates.ButtonTemplates.AddButton;
2351
- return /*#__PURE__*/React.createElement("fieldset", {
2352
- id: idSchema.$id
2353
- }, (options.title || title) && /*#__PURE__*/React.createElement(TitleFieldTemplate, {
2354
- id: titleId(idSchema),
2355
- title: options.title || title,
2356
- required: required,
2357
- schema: schema,
2358
- uiSchema: uiSchema,
2359
- registry: registry
2360
- }), (options.description || description) && /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
2361
- id: descriptionId(idSchema),
2362
- description: options.description || description,
2363
- schema: schema,
2364
- uiSchema: uiSchema,
2365
- registry: registry
2366
- }), properties.map(function (prop) {
2367
- return prop.content;
2368
- }), canExpand(schema, uiSchema, formData) && /*#__PURE__*/React.createElement(AddButton, {
2369
- className: "object-property-expand",
2370
- onClick: onAddClick(schema),
2371
- disabled: disabled || readonly,
2372
- uiSchema: uiSchema,
2373
- registry: registry
2374
- }));
2454
+ return jsxs("fieldset", {
2455
+ id: idSchema.$id,
2456
+ children: [(options.title || title) && jsx(TitleFieldTemplate, {
2457
+ id: titleId(idSchema),
2458
+ title: options.title || title,
2459
+ required: required,
2460
+ schema: schema,
2461
+ uiSchema: uiSchema,
2462
+ registry: registry
2463
+ }), (options.description || description) && jsx(DescriptionFieldTemplate, {
2464
+ id: descriptionId(idSchema),
2465
+ description: options.description || description,
2466
+ schema: schema,
2467
+ uiSchema: uiSchema,
2468
+ registry: registry
2469
+ }), properties.map(function (prop) {
2470
+ return prop.content;
2471
+ }), canExpand(schema, uiSchema, formData) && jsx(AddButton, {
2472
+ className: 'object-property-expand',
2473
+ onClick: onAddClick(schema),
2474
+ disabled: disabled || readonly,
2475
+ uiSchema: uiSchema,
2476
+ registry: registry
2477
+ })]
2478
+ });
2375
2479
  }
2376
2480
 
2377
- var REQUIRED_FIELD_SYMBOL = "*";
2481
+ var REQUIRED_FIELD_SYMBOL = '*';
2378
2482
  /** The `TitleField` is the template to use to render the title of a field
2379
2483
  *
2380
2484
  * @param props - The `TitleFieldProps` for this component
@@ -2383,11 +2487,13 @@ function TitleField(props) {
2383
2487
  var id = props.id,
2384
2488
  title = props.title,
2385
2489
  required = props.required;
2386
- return /*#__PURE__*/React.createElement("legend", {
2387
- id: id
2388
- }, title, required && /*#__PURE__*/React.createElement("span", {
2389
- className: "required"
2390
- }, REQUIRED_FIELD_SYMBOL));
2490
+ return jsxs("legend", {
2491
+ id: id,
2492
+ children: [title, required && jsx("span", {
2493
+ className: 'required',
2494
+ children: REQUIRED_FIELD_SYMBOL
2495
+ })]
2496
+ });
2391
2497
  }
2392
2498
 
2393
2499
  /** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
@@ -2411,9 +2517,16 @@ function UnsupportedField(props) {
2411
2517
  translateEnum = translateEnum === TranslatableString.UnsupportedField ? TranslatableString.UnsupportedFieldWithReason : TranslatableString.UnsupportedFieldWithIdAndReason;
2412
2518
  translateParams.push(reason);
2413
2519
  }
2414
- return /*#__PURE__*/React.createElement("div", {
2415
- className: "unsupported-field"
2416
- }, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Markdown, null, translateString(translateEnum, translateParams))), schema && /*#__PURE__*/React.createElement("pre", null, JSON.stringify(schema, null, 2)));
2520
+ return jsxs("div", {
2521
+ className: 'unsupported-field',
2522
+ children: [jsx("p", {
2523
+ children: jsx(Markdown, {
2524
+ children: translateString(translateEnum, translateParams)
2525
+ })
2526
+ }), schema && jsx("pre", {
2527
+ children: JSON.stringify(schema, null, 2)
2528
+ })]
2529
+ });
2417
2530
  }
2418
2531
 
2419
2532
  /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
@@ -2442,46 +2555,53 @@ function WrapIfAdditionalTemplate(props) {
2442
2555
  var keyLabel = translateString(TranslatableString.KeyLabel, [label]);
2443
2556
  var additional = (ADDITIONAL_PROPERTY_FLAG in schema);
2444
2557
  if (!additional) {
2445
- return /*#__PURE__*/React.createElement("div", {
2558
+ return jsx("div", {
2446
2559
  className: classNames,
2447
- style: style
2448
- }, children);
2560
+ style: style,
2561
+ children: children
2562
+ });
2449
2563
  }
2450
- return /*#__PURE__*/React.createElement("div", {
2564
+ return jsx("div", {
2451
2565
  className: classNames,
2452
- style: style
2453
- }, /*#__PURE__*/React.createElement("div", {
2454
- className: "row"
2455
- }, /*#__PURE__*/React.createElement("div", {
2456
- className: "col-xs-5 form-additional"
2457
- }, /*#__PURE__*/React.createElement("div", {
2458
- className: "form-group"
2459
- }, /*#__PURE__*/React.createElement(Label, {
2460
- label: keyLabel,
2461
- required: required,
2462
- id: id + "-key"
2463
- }), /*#__PURE__*/React.createElement("input", {
2464
- className: "form-control",
2465
- type: "text",
2466
- id: id + "-key",
2467
- onBlur: function onBlur(event) {
2468
- return onKeyChange(event.target.value);
2469
- },
2470
- defaultValue: label
2471
- }))), /*#__PURE__*/React.createElement("div", {
2472
- className: "form-additional form-group col-xs-5"
2473
- }, children), /*#__PURE__*/React.createElement("div", {
2474
- className: "col-xs-2"
2475
- }, /*#__PURE__*/React.createElement(RemoveButton, {
2476
- className: "array-item-remove btn-block",
2477
- style: {
2478
- border: "0"
2479
- },
2480
- disabled: disabled || readonly,
2481
- onClick: onDropPropertyClick(label),
2482
- uiSchema: uiSchema,
2483
- registry: registry
2484
- }))));
2566
+ style: style,
2567
+ children: jsxs("div", {
2568
+ className: 'row',
2569
+ children: [jsx("div", {
2570
+ className: 'col-xs-5 form-additional',
2571
+ children: jsxs("div", {
2572
+ className: 'form-group',
2573
+ children: [jsx(Label, {
2574
+ label: keyLabel,
2575
+ required: required,
2576
+ id: id + "-key"
2577
+ }), jsx("input", {
2578
+ className: 'form-control',
2579
+ type: 'text',
2580
+ id: id + "-key",
2581
+ onBlur: function onBlur(event) {
2582
+ return onKeyChange(event.target.value);
2583
+ },
2584
+ defaultValue: label
2585
+ })]
2586
+ })
2587
+ }), jsx("div", {
2588
+ className: 'form-additional form-group col-xs-5',
2589
+ children: children
2590
+ }), jsx("div", {
2591
+ className: 'col-xs-2',
2592
+ children: jsx(RemoveButton, {
2593
+ className: 'array-item-remove btn-block',
2594
+ style: {
2595
+ border: '0'
2596
+ },
2597
+ disabled: disabled || readonly,
2598
+ onClick: onDropPropertyClick(label),
2599
+ uiSchema: uiSchema,
2600
+ registry: registry
2601
+ })
2602
+ })]
2603
+ })
2604
+ });
2485
2605
  }
2486
2606
 
2487
2607
  function templates() {
@@ -2530,29 +2650,29 @@ function dateElementProps(state, time, yearsRange) {
2530
2650
  minute = state.minute,
2531
2651
  second = state.second;
2532
2652
  var data = [{
2533
- type: "year",
2653
+ type: 'year',
2534
2654
  range: yearsRange,
2535
2655
  value: year
2536
2656
  }, {
2537
- type: "month",
2657
+ type: 'month',
2538
2658
  range: [1, 12],
2539
2659
  value: month
2540
2660
  }, {
2541
- type: "day",
2661
+ type: 'day',
2542
2662
  range: [1, 31],
2543
2663
  value: day
2544
2664
  }];
2545
2665
  if (time) {
2546
2666
  data.push({
2547
- type: "hour",
2667
+ type: 'hour',
2548
2668
  range: [0, 23],
2549
2669
  value: hour
2550
2670
  }, {
2551
- type: "minute",
2671
+ type: 'minute',
2552
2672
  range: [0, 59],
2553
2673
  value: minute
2554
2674
  }, {
2555
- type: "second",
2675
+ type: 'second',
2556
2676
  range: [0, 59],
2557
2677
  value: second
2558
2678
  });
@@ -2565,20 +2685,22 @@ function DateElement(_ref) {
2565
2685
  value = _ref.value,
2566
2686
  select = _ref.select,
2567
2687
  rootId = _ref.rootId,
2688
+ name = _ref.name,
2568
2689
  disabled = _ref.disabled,
2569
2690
  readonly = _ref.readonly,
2570
2691
  autofocus = _ref.autofocus,
2571
2692
  registry = _ref.registry,
2572
2693
  onBlur = _ref.onBlur,
2573
2694
  onFocus = _ref.onFocus;
2574
- var id = rootId + "_" + type;
2695
+ var id = rootId + '_' + type;
2575
2696
  var SelectWidget = registry.widgets.SelectWidget;
2576
- return /*#__PURE__*/React.createElement(SelectWidget, {
2697
+ return jsx(SelectWidget, {
2577
2698
  schema: {
2578
- type: "integer"
2699
+ type: 'integer'
2579
2700
  },
2580
2701
  id: id,
2581
- className: "form-control",
2702
+ name: name,
2703
+ className: 'form-control',
2582
2704
  options: {
2583
2705
  enumOptions: rangeOptions(range[0], range[1])
2584
2706
  },
@@ -2593,7 +2715,7 @@ function DateElement(_ref) {
2593
2715
  onBlur: onBlur,
2594
2716
  onFocus: onFocus,
2595
2717
  registry: registry,
2596
- label: "",
2718
+ label: '',
2597
2719
  "aria-describedby": ariaDescribedByIds(rootId)
2598
2720
  });
2599
2721
  }
@@ -2611,6 +2733,7 @@ function AltDateWidget(_ref2) {
2611
2733
  autofocus = _ref2$autofocus === void 0 ? false : _ref2$autofocus,
2612
2734
  options = _ref2.options,
2613
2735
  id = _ref2.id,
2736
+ name = _ref2.name,
2614
2737
  registry = _ref2.registry,
2615
2738
  onBlur = _ref2.onBlur,
2616
2739
  onFocus = _ref2.onFocus,
@@ -2650,39 +2773,45 @@ function AltDateWidget(_ref2) {
2650
2773
  if (disabled || readonly) {
2651
2774
  return;
2652
2775
  }
2653
- setState(parseDateString("", time));
2776
+ setState(parseDateString('', time));
2654
2777
  onChange(undefined);
2655
2778
  }, [disabled, readonly, time, onChange]);
2656
- return /*#__PURE__*/React.createElement("ul", {
2657
- className: "list-inline"
2658
- }, dateElementProps(state, time, options.yearsRange).map(function (elemProps, i) {
2659
- return /*#__PURE__*/React.createElement("li", {
2660
- className: "list-inline-item",
2661
- key: i
2662
- }, /*#__PURE__*/React.createElement(DateElement, _extends({
2663
- rootId: id,
2664
- select: handleChange
2665
- }, elemProps, {
2666
- disabled: disabled,
2667
- readonly: readonly,
2668
- registry: registry,
2669
- onBlur: onBlur,
2670
- onFocus: onFocus,
2671
- autofocus: autofocus && i === 0
2672
- })));
2673
- }), (options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /*#__PURE__*/React.createElement("li", {
2674
- className: "list-inline-item"
2675
- }, /*#__PURE__*/React.createElement("a", {
2676
- href: "#",
2677
- className: "btn btn-info btn-now",
2678
- onClick: handleSetNow
2679
- }, translateString(TranslatableString.NowLabel))), (options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /*#__PURE__*/React.createElement("li", {
2680
- className: "list-inline-item"
2681
- }, /*#__PURE__*/React.createElement("a", {
2682
- href: "#",
2683
- className: "btn btn-warning btn-clear",
2684
- onClick: handleClear
2685
- }, translateString(TranslatableString.ClearLabel))));
2779
+ return jsxs("ul", {
2780
+ className: 'list-inline',
2781
+ children: [dateElementProps(state, time, options.yearsRange).map(function (elemProps, i) {
2782
+ return jsx("li", {
2783
+ className: 'list-inline-item',
2784
+ children: jsx(DateElement, _extends({
2785
+ rootId: id,
2786
+ name: name,
2787
+ select: handleChange
2788
+ }, elemProps, {
2789
+ disabled: disabled,
2790
+ readonly: readonly,
2791
+ registry: registry,
2792
+ onBlur: onBlur,
2793
+ onFocus: onFocus,
2794
+ autofocus: autofocus && i === 0
2795
+ }))
2796
+ }, i);
2797
+ }), (options.hideNowButton !== 'undefined' ? !options.hideNowButton : true) && jsx("li", {
2798
+ className: 'list-inline-item',
2799
+ children: jsx("a", {
2800
+ href: '#',
2801
+ className: 'btn btn-info btn-now',
2802
+ onClick: handleSetNow,
2803
+ children: translateString(TranslatableString.NowLabel)
2804
+ })
2805
+ }), (options.hideClearButton !== 'undefined' ? !options.hideClearButton : true) && jsx("li", {
2806
+ className: 'list-inline-item',
2807
+ children: jsx("a", {
2808
+ href: '#',
2809
+ className: 'btn btn-warning btn-clear',
2810
+ onClick: handleClear,
2811
+ children: translateString(TranslatableString.ClearLabel)
2812
+ })
2813
+ })]
2814
+ });
2686
2815
  }
2687
2816
 
2688
2817
  var _excluded$1 = ["time"];
@@ -2696,7 +2825,7 @@ function AltDateTimeWidget(_ref) {
2696
2825
  time = _ref$time === void 0 ? true : _ref$time,
2697
2826
  props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2698
2827
  var AltDateWidget = props.registry.widgets.AltDateWidget;
2699
- return /*#__PURE__*/React.createElement(AltDateWidget, _extends({
2828
+ return jsx(AltDateWidget, _extends({
2700
2829
  time: time
2701
2830
  }, props));
2702
2831
  }
@@ -2721,7 +2850,7 @@ function CheckboxWidget(_ref) {
2721
2850
  onFocus = _ref.onFocus,
2722
2851
  onChange = _ref.onChange,
2723
2852
  registry = _ref.registry;
2724
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, options);
2853
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
2725
2854
  // Because an unchecked checkbox will cause html5 validation to fail, only add
2726
2855
  // the "required" attribute if the field value must be "true", due to the
2727
2856
  // "const" or "enum" keywords
@@ -2735,27 +2864,32 @@ function CheckboxWidget(_ref) {
2735
2864
  var handleFocus = useCallback(function (event) {
2736
2865
  return onFocus(id, event.target.checked);
2737
2866
  }, [onFocus, id]);
2738
- return /*#__PURE__*/React.createElement("div", {
2739
- className: "checkbox " + (disabled || readonly ? "disabled" : "")
2740
- }, schema.description && /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
2741
- id: descriptionId(id),
2742
- description: schema.description,
2743
- schema: schema,
2744
- uiSchema: uiSchema,
2745
- registry: registry
2746
- }), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
2747
- type: "checkbox",
2748
- id: id,
2749
- name: id,
2750
- checked: typeof value === "undefined" ? false : value,
2751
- required: required,
2752
- disabled: disabled || readonly,
2753
- autoFocus: autofocus,
2754
- onChange: handleChange,
2755
- onBlur: handleBlur,
2756
- onFocus: handleFocus,
2757
- "aria-describedby": ariaDescribedByIds(id)
2758
- }), /*#__PURE__*/React.createElement("span", null, label)));
2867
+ return jsxs("div", {
2868
+ className: "checkbox " + (disabled || readonly ? 'disabled' : ''),
2869
+ children: [schema.description && jsx(DescriptionFieldTemplate, {
2870
+ id: descriptionId(id),
2871
+ description: schema.description,
2872
+ schema: schema,
2873
+ uiSchema: uiSchema,
2874
+ registry: registry
2875
+ }), jsxs("label", {
2876
+ children: [jsx("input", {
2877
+ type: 'checkbox',
2878
+ id: id,
2879
+ name: id,
2880
+ checked: typeof value === 'undefined' ? false : value,
2881
+ required: required,
2882
+ disabled: disabled || readonly,
2883
+ autoFocus: autofocus,
2884
+ onChange: handleChange,
2885
+ onBlur: handleBlur,
2886
+ onFocus: handleFocus,
2887
+ "aria-describedby": ariaDescribedByIds(id)
2888
+ }), jsx("span", {
2889
+ children: label
2890
+ })]
2891
+ })]
2892
+ });
2759
2893
  }
2760
2894
 
2761
2895
  /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
@@ -2788,41 +2922,48 @@ function CheckboxesWidget(_ref) {
2788
2922
  var value = _ref3.target.value;
2789
2923
  return onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
2790
2924
  }, [onFocus, id]);
2791
- return /*#__PURE__*/React.createElement("div", {
2792
- className: "checkboxes",
2793
- id: id
2794
- }, Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
2795
- var checked = enumOptionsIsSelected(option.value, checkboxesValues);
2796
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
2797
- var disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
2798
- var handleChange = function handleChange(event) {
2799
- if (event.target.checked) {
2800
- onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
2801
- } else {
2802
- onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
2803
- }
2804
- };
2805
- var checkbox = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
2806
- type: "checkbox",
2807
- id: optionId(id, index),
2808
- name: id,
2809
- checked: checked,
2810
- value: String(index),
2811
- disabled: disabled || itemDisabled || readonly,
2812
- autoFocus: autofocus && index === 0,
2813
- onChange: handleChange,
2814
- onBlur: handleBlur,
2815
- onFocus: handleFocus,
2816
- "aria-describedby": ariaDescribedByIds(id)
2817
- }), /*#__PURE__*/React.createElement("span", null, option.label));
2818
- return inline ? /*#__PURE__*/React.createElement("label", {
2819
- key: index,
2820
- className: "checkbox-inline " + disabledCls
2821
- }, checkbox) : /*#__PURE__*/React.createElement("div", {
2822
- key: index,
2823
- className: "checkbox " + disabledCls
2824
- }, /*#__PURE__*/React.createElement("label", null, checkbox));
2825
- }));
2925
+ return jsx("div", {
2926
+ className: 'checkboxes',
2927
+ id: id,
2928
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
2929
+ var checked = enumOptionsIsSelected(option.value, checkboxesValues);
2930
+ var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
2931
+ var disabledCls = disabled || itemDisabled || readonly ? 'disabled' : '';
2932
+ var handleChange = function handleChange(event) {
2933
+ if (event.target.checked) {
2934
+ onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
2935
+ } else {
2936
+ onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
2937
+ }
2938
+ };
2939
+ var checkbox = jsxs("span", {
2940
+ children: [jsx("input", {
2941
+ type: 'checkbox',
2942
+ id: optionId(id, index),
2943
+ name: id,
2944
+ checked: checked,
2945
+ value: String(index),
2946
+ disabled: disabled || itemDisabled || readonly,
2947
+ autoFocus: autofocus && index === 0,
2948
+ onChange: handleChange,
2949
+ onBlur: handleBlur,
2950
+ onFocus: handleFocus,
2951
+ "aria-describedby": ariaDescribedByIds(id)
2952
+ }), jsx("span", {
2953
+ children: option.label
2954
+ })]
2955
+ });
2956
+ return inline ? jsx("label", {
2957
+ className: "checkbox-inline " + disabledCls,
2958
+ children: checkbox
2959
+ }, index) : jsx("div", {
2960
+ className: "checkbox " + disabledCls,
2961
+ children: jsx("label", {
2962
+ children: checkbox
2963
+ })
2964
+ }, index);
2965
+ })
2966
+ });
2826
2967
  }
2827
2968
 
2828
2969
  /** The `ColorWidget` component uses the `BaseInputTemplate` changing the type to `color` and disables it when it is
@@ -2835,9 +2976,9 @@ function ColorWidget(props) {
2835
2976
  readonly = props.readonly,
2836
2977
  options = props.options,
2837
2978
  registry = props.registry;
2838
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
2839
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
2840
- type: "color"
2979
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
2980
+ return jsx(BaseInputTemplate, _extends({
2981
+ type: 'color'
2841
2982
  }, props, {
2842
2983
  disabled: disabled || readonly
2843
2984
  }));
@@ -2852,12 +2993,12 @@ function DateWidget(props) {
2852
2993
  var onChange = props.onChange,
2853
2994
  options = props.options,
2854
2995
  registry = props.registry;
2855
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
2996
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
2856
2997
  var handleChange = useCallback(function (value) {
2857
2998
  return onChange(value || undefined);
2858
2999
  }, [onChange]);
2859
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
2860
- type: "date"
3000
+ return jsx(BaseInputTemplate, _extends({
3001
+ type: 'date'
2861
3002
  }, props, {
2862
3003
  onChange: handleChange
2863
3004
  }));
@@ -2873,9 +3014,9 @@ function DateTimeWidget(props) {
2873
3014
  value = props.value,
2874
3015
  options = props.options,
2875
3016
  registry = props.registry;
2876
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
2877
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
2878
- type: "datetime-local"
3017
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3018
+ return jsx(BaseInputTemplate, _extends({
3019
+ type: 'datetime-local'
2879
3020
  }, props, {
2880
3021
  value: utcToLocal(value),
2881
3022
  onChange: function onChange(value) {
@@ -2891,9 +3032,9 @@ function DateTimeWidget(props) {
2891
3032
  function EmailWidget(props) {
2892
3033
  var options = props.options,
2893
3034
  registry = props.registry;
2894
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
2895
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
2896
- type: "email"
3035
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3036
+ return jsx(BaseInputTemplate, _extends({
3037
+ type: 'email'
2897
3038
  }, props));
2898
3039
  }
2899
3040
 
@@ -2901,7 +3042,7 @@ function addNameToDataURL(dataURL, name) {
2901
3042
  if (dataURL === null) {
2902
3043
  return null;
2903
3044
  }
2904
- return dataURL.replace(";base64", ";name=" + encodeURIComponent(name) + ";base64");
3045
+ return dataURL.replace(';base64', ";name=" + encodeURIComponent(name) + ";base64");
2905
3046
  }
2906
3047
  function processFile(file) {
2907
3048
  var name = file.name,
@@ -2912,7 +3053,7 @@ function processFile(file) {
2912
3053
  reader.onerror = reject;
2913
3054
  reader.onload = function (event) {
2914
3055
  var _event$target;
2915
- if (typeof ((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.result) === "string") {
3056
+ if (typeof ((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.result) === 'string') {
2916
3057
  resolve({
2917
3058
  dataURL: addNameToDataURL(event.target.result, name),
2918
3059
  name: name,
@@ -2941,20 +3082,23 @@ function FilesInfo(_ref) {
2941
3082
  return null;
2942
3083
  }
2943
3084
  var translateString = registry.translateString;
2944
- return /*#__PURE__*/React.createElement("ul", {
2945
- className: "file-info"
2946
- }, filesInfo.map(function (fileInfo, key) {
2947
- var name = fileInfo.name,
2948
- size = fileInfo.size,
2949
- type = fileInfo.type;
2950
- return /*#__PURE__*/React.createElement("li", {
2951
- key: key
2952
- }, /*#__PURE__*/React.createElement(Markdown, null, translateString(TranslatableString.FilesInfo, [name, type, String(size)])));
2953
- }));
3085
+ return jsx("ul", {
3086
+ className: 'file-info',
3087
+ children: filesInfo.map(function (fileInfo, key) {
3088
+ var name = fileInfo.name,
3089
+ size = fileInfo.size,
3090
+ type = fileInfo.type;
3091
+ return jsx("li", {
3092
+ children: jsx(Markdown, {
3093
+ children: translateString(TranslatableString.FilesInfo, [name, type, String(size)])
3094
+ })
3095
+ }, key);
3096
+ })
3097
+ });
2954
3098
  }
2955
3099
  function extractFileInfo(dataURLs) {
2956
3100
  return dataURLs.filter(function (dataURL) {
2957
- return typeof dataURL !== "undefined";
3101
+ return dataURL;
2958
3102
  }).map(function (dataURL) {
2959
3103
  var _dataURItoBlob = dataURItoBlob(dataURL),
2960
3104
  blob = _dataURItoBlob.blob,
@@ -2970,17 +3114,15 @@ function extractFileInfo(dataURLs) {
2970
3114
  * The `FileWidget` is a widget for rendering file upload fields.
2971
3115
  * It is typically used with a string property with data-url format.
2972
3116
  */
2973
- function FileWidget(_ref2) {
2974
- var multiple = _ref2.multiple,
2975
- id = _ref2.id,
2976
- readonly = _ref2.readonly,
2977
- disabled = _ref2.disabled,
2978
- onChange = _ref2.onChange,
2979
- value = _ref2.value,
2980
- _ref2$autofocus = _ref2.autofocus,
2981
- autofocus = _ref2$autofocus === void 0 ? false : _ref2$autofocus,
2982
- options = _ref2.options,
2983
- registry = _ref2.registry;
3117
+ function FileWidget(props) {
3118
+ var disabled = props.disabled,
3119
+ readonly = props.readonly,
3120
+ multiple = props.multiple,
3121
+ onChange = props.onChange,
3122
+ value = props.value,
3123
+ options = props.options,
3124
+ registry = props.registry;
3125
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
2984
3126
  var extractedFilesInfo = useMemo(function () {
2985
3127
  return Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value]);
2986
3128
  }, [value]);
@@ -3003,21 +3145,18 @@ function FileWidget(_ref2) {
3003
3145
  }
3004
3146
  });
3005
3147
  }, [multiple, onChange]);
3006
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("input", {
3007
- id: id,
3008
- name: id,
3009
- type: "file",
3010
- disabled: readonly || disabled,
3011
- onChange: handleChange,
3012
- defaultValue: "",
3013
- autoFocus: autofocus,
3014
- multiple: multiple,
3015
- accept: options.accept ? String(options.accept) : undefined,
3016
- "aria-describedby": ariaDescribedByIds(id)
3017
- })), /*#__PURE__*/React.createElement(FilesInfo, {
3018
- filesInfo: filesInfo,
3019
- registry: registry
3020
- }));
3148
+ return jsxs("div", {
3149
+ children: [jsx(BaseInputTemplate, _extends({}, props, {
3150
+ disabled: disabled || readonly,
3151
+ type: 'file',
3152
+ onChangeOverride: handleChange,
3153
+ value: '',
3154
+ accept: options.accept ? String(options.accept) : undefined
3155
+ })), jsx(FilesInfo, {
3156
+ filesInfo: filesInfo,
3157
+ registry: registry
3158
+ })]
3159
+ });
3021
3160
  }
3022
3161
 
3023
3162
  /** The `HiddenWidget` is a widget for rendering a hidden input field.
@@ -3028,11 +3167,11 @@ function FileWidget(_ref2) {
3028
3167
  function HiddenWidget(_ref) {
3029
3168
  var id = _ref.id,
3030
3169
  value = _ref.value;
3031
- return /*#__PURE__*/React.createElement("input", {
3032
- type: "hidden",
3170
+ return jsx("input", {
3171
+ type: 'hidden',
3033
3172
  id: id,
3034
3173
  name: id,
3035
- value: typeof value === "undefined" ? "" : value
3174
+ value: typeof value === 'undefined' ? '' : value
3036
3175
  });
3037
3176
  }
3038
3177
 
@@ -3043,9 +3182,9 @@ function HiddenWidget(_ref) {
3043
3182
  function PasswordWidget(props) {
3044
3183
  var options = props.options,
3045
3184
  registry = props.registry;
3046
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
3047
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
3048
- type: "password"
3185
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3186
+ return jsx(BaseInputTemplate, _extends({
3187
+ type: 'password'
3049
3188
  }, props));
3050
3189
  }
3051
3190
 
@@ -3080,38 +3219,45 @@ function RadioWidget(_ref) {
3080
3219
  var value = _ref3.target.value;
3081
3220
  return onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
3082
3221
  }, [onFocus, id]);
3083
- return /*#__PURE__*/React.createElement("div", {
3084
- className: "field-radio-group",
3085
- id: id
3086
- }, Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
3087
- var checked = enumOptionsIsSelected(option.value, value);
3088
- var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
3089
- var disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
3090
- var handleChange = function handleChange() {
3091
- return onChange(option.value);
3092
- };
3093
- var radio = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
3094
- type: "radio",
3095
- id: optionId(id, i),
3096
- checked: checked,
3097
- name: name,
3098
- required: required,
3099
- value: String(i),
3100
- disabled: disabled || itemDisabled || readonly,
3101
- autoFocus: autofocus && i === 0,
3102
- onChange: handleChange,
3103
- onBlur: handleBlur,
3104
- onFocus: handleFocus,
3105
- "aria-describedby": ariaDescribedByIds(id)
3106
- }), /*#__PURE__*/React.createElement("span", null, option.label));
3107
- return inline ? /*#__PURE__*/React.createElement("label", {
3108
- key: i,
3109
- className: "radio-inline " + disabledCls
3110
- }, radio) : /*#__PURE__*/React.createElement("div", {
3111
- key: i,
3112
- className: "radio " + disabledCls
3113
- }, /*#__PURE__*/React.createElement("label", null, radio));
3114
- }));
3222
+ return jsx("div", {
3223
+ className: 'field-radio-group',
3224
+ id: id,
3225
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
3226
+ var checked = enumOptionsIsSelected(option.value, value);
3227
+ var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
3228
+ var disabledCls = disabled || itemDisabled || readonly ? 'disabled' : '';
3229
+ var handleChange = function handleChange() {
3230
+ return onChange(option.value);
3231
+ };
3232
+ var radio = jsxs("span", {
3233
+ children: [jsx("input", {
3234
+ type: 'radio',
3235
+ id: optionId(id, i),
3236
+ checked: checked,
3237
+ name: name,
3238
+ required: required,
3239
+ value: String(i),
3240
+ disabled: disabled || itemDisabled || readonly,
3241
+ autoFocus: autofocus && i === 0,
3242
+ onChange: handleChange,
3243
+ onBlur: handleBlur,
3244
+ onFocus: handleFocus,
3245
+ "aria-describedby": ariaDescribedByIds(id)
3246
+ }), jsx("span", {
3247
+ children: option.label
3248
+ })]
3249
+ });
3250
+ return inline ? jsx("label", {
3251
+ className: "radio-inline " + disabledCls,
3252
+ children: radio
3253
+ }, i) : jsx("div", {
3254
+ className: "radio " + disabledCls,
3255
+ children: jsx("label", {
3256
+ children: radio
3257
+ })
3258
+ }, i);
3259
+ })
3260
+ });
3115
3261
  }
3116
3262
 
3117
3263
  /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
@@ -3122,13 +3268,15 @@ function RadioWidget(_ref) {
3122
3268
  function RangeWidget(props) {
3123
3269
  var value = props.value,
3124
3270
  BaseInputTemplate = props.registry.templates.BaseInputTemplate;
3125
- return /*#__PURE__*/React.createElement("div", {
3126
- className: "field-range-wrapper"
3127
- }, /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
3128
- type: "range"
3129
- }, props)), /*#__PURE__*/React.createElement("span", {
3130
- className: "range-view"
3131
- }, value));
3271
+ return jsxs("div", {
3272
+ className: 'field-range-wrapper',
3273
+ children: [jsx(BaseInputTemplate, _extends({
3274
+ type: 'range'
3275
+ }, props)), jsx("span", {
3276
+ className: 'range-view',
3277
+ children: value
3278
+ })]
3279
+ });
3132
3280
  }
3133
3281
 
3134
3282
  function getValue(event, multiple) {
@@ -3165,7 +3313,7 @@ function SelectWidget(_ref) {
3165
3313
  var enumOptions = options.enumOptions,
3166
3314
  enumDisabled = options.enumDisabled,
3167
3315
  optEmptyVal = options.emptyValue;
3168
- var emptyValue = multiple ? [] : "";
3316
+ var emptyValue = multiple ? [] : '';
3169
3317
  var handleFocus = useCallback(function (event) {
3170
3318
  var newValue = getValue(event, multiple);
3171
3319
  return onFocus(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
@@ -3179,31 +3327,33 @@ function SelectWidget(_ref) {
3179
3327
  return onChange(enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
3180
3328
  }, [onChange, schema, multiple, options]);
3181
3329
  var selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
3182
- return /*#__PURE__*/React.createElement("select", {
3330
+ return jsxs("select", {
3183
3331
  id: id,
3184
3332
  name: id,
3185
3333
  multiple: multiple,
3186
- className: "form-control",
3187
- value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
3334
+ className: 'form-control',
3335
+ value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes,
3188
3336
  required: required,
3189
3337
  disabled: disabled || readonly,
3190
3338
  autoFocus: autofocus,
3191
3339
  onBlur: handleBlur,
3192
3340
  onFocus: handleFocus,
3193
3341
  onChange: handleChange,
3194
- "aria-describedby": ariaDescribedByIds(id)
3195
- }, !multiple && schema["default"] === undefined && /*#__PURE__*/React.createElement("option", {
3196
- value: ""
3197
- }, placeholder), Array.isArray(enumOptions) && enumOptions.map(function (_ref2, i) {
3198
- var value = _ref2.value,
3199
- label = _ref2.label;
3200
- var disabled = enumDisabled && enumDisabled.indexOf(value) !== -1;
3201
- return /*#__PURE__*/React.createElement("option", {
3202
- key: i,
3203
- value: String(i),
3204
- disabled: disabled
3205
- }, label);
3206
- }));
3342
+ "aria-describedby": ariaDescribedByIds(id),
3343
+ children: [!multiple && schema["default"] === undefined && jsx("option", {
3344
+ value: '',
3345
+ children: placeholder
3346
+ }), Array.isArray(enumOptions) && enumOptions.map(function (_ref2, i) {
3347
+ var value = _ref2.value,
3348
+ label = _ref2.label;
3349
+ var disabled = enumDisabled && enumDisabled.indexOf(value) !== -1;
3350
+ return jsx("option", {
3351
+ value: String(i),
3352
+ disabled: disabled,
3353
+ children: label
3354
+ }, i);
3355
+ })]
3356
+ });
3207
3357
  }
3208
3358
 
3209
3359
  /** The `TextareaWidget` is a widget for rendering input fields as textarea.
@@ -3226,7 +3376,7 @@ function TextareaWidget(_ref) {
3226
3376
  onFocus = _ref.onFocus;
3227
3377
  var handleChange = useCallback(function (_ref2) {
3228
3378
  var value = _ref2.target.value;
3229
- return onChange(value === "" ? options.emptyValue : value);
3379
+ return onChange(value === '' ? options.emptyValue : value);
3230
3380
  }, [onChange, options.emptyValue]);
3231
3381
  var handleBlur = useCallback(function (_ref3) {
3232
3382
  var value = _ref3.target.value;
@@ -3236,11 +3386,11 @@ function TextareaWidget(_ref) {
3236
3386
  var value = _ref4.target.value;
3237
3387
  return onFocus(id, value);
3238
3388
  }, [id, onFocus]);
3239
- return /*#__PURE__*/React.createElement("textarea", {
3389
+ return jsx("textarea", {
3240
3390
  id: id,
3241
3391
  name: id,
3242
- className: "form-control",
3243
- value: value ? value : "",
3392
+ className: 'form-control',
3393
+ value: value ? value : '',
3244
3394
  placeholder: placeholder,
3245
3395
  required: required,
3246
3396
  disabled: disabled,
@@ -3265,8 +3415,28 @@ TextareaWidget.defaultProps = {
3265
3415
  function TextWidget(props) {
3266
3416
  var options = props.options,
3267
3417
  registry = props.registry;
3268
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
3269
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({}, props));
3418
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3419
+ return jsx(BaseInputTemplate, _extends({}, props));
3420
+ }
3421
+
3422
+ /** The `TimeWidget` component uses the `BaseInputTemplate` changing the type to `time` and transforms
3423
+ * the value to undefined when it is falsy during the `onChange` handling.
3424
+ *
3425
+ * @param props - The `WidgetProps` for this component
3426
+ */
3427
+ function TimeWidget(props) {
3428
+ var onChange = props.onChange,
3429
+ options = props.options,
3430
+ registry = props.registry;
3431
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3432
+ var handleChange = useCallback(function (value) {
3433
+ return onChange(value ? value + ":00" : undefined);
3434
+ }, [onChange]);
3435
+ return jsx(BaseInputTemplate, _extends({
3436
+ type: 'time'
3437
+ }, props, {
3438
+ onChange: handleChange
3439
+ }));
3270
3440
  }
3271
3441
 
3272
3442
  /** The `URLWidget` component uses the `BaseInputTemplate` changing the type to `url`.
@@ -3276,9 +3446,9 @@ function TextWidget(props) {
3276
3446
  function URLWidget(props) {
3277
3447
  var options = props.options,
3278
3448
  registry = props.registry;
3279
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
3280
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
3281
- type: "url"
3449
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3450
+ return jsx(BaseInputTemplate, _extends({
3451
+ type: 'url'
3282
3452
  }, props));
3283
3453
  }
3284
3454
 
@@ -3289,32 +3459,33 @@ function URLWidget(props) {
3289
3459
  function UpDownWidget(props) {
3290
3460
  var options = props.options,
3291
3461
  registry = props.registry;
3292
- var BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
3293
- return /*#__PURE__*/React.createElement(BaseInputTemplate, _extends({
3294
- type: "number"
3462
+ var BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
3463
+ return jsx(BaseInputTemplate, _extends({
3464
+ type: 'number'
3295
3465
  }, props));
3296
3466
  }
3297
3467
 
3298
3468
  function widgets() {
3299
3469
  return {
3470
+ AltDateWidget: AltDateWidget,
3471
+ AltDateTimeWidget: AltDateTimeWidget,
3472
+ CheckboxWidget: CheckboxWidget,
3473
+ CheckboxesWidget: CheckboxesWidget,
3474
+ ColorWidget: ColorWidget,
3475
+ DateWidget: DateWidget,
3476
+ DateTimeWidget: DateTimeWidget,
3477
+ EmailWidget: EmailWidget,
3478
+ FileWidget: FileWidget,
3479
+ HiddenWidget: HiddenWidget,
3300
3480
  PasswordWidget: PasswordWidget,
3301
3481
  RadioWidget: RadioWidget,
3302
- UpDownWidget: UpDownWidget,
3303
3482
  RangeWidget: RangeWidget,
3304
3483
  SelectWidget: SelectWidget,
3305
3484
  TextWidget: TextWidget,
3306
- DateWidget: DateWidget,
3307
- DateTimeWidget: DateTimeWidget,
3308
- AltDateWidget: AltDateWidget,
3309
- AltDateTimeWidget: AltDateTimeWidget,
3310
- EmailWidget: EmailWidget,
3311
- URLWidget: URLWidget,
3312
3485
  TextareaWidget: TextareaWidget,
3313
- HiddenWidget: HiddenWidget,
3314
- ColorWidget: ColorWidget,
3315
- FileWidget: FileWidget,
3316
- CheckboxWidget: CheckboxWidget,
3317
- CheckboxesWidget: CheckboxesWidget
3486
+ TimeWidget: TimeWidget,
3487
+ UpDownWidget: UpDownWidget,
3488
+ URLWidget: URLWidget
3318
3489
  };
3319
3490
  }
3320
3491
 
@@ -3352,7 +3523,7 @@ var Form = /*#__PURE__*/function (_Component) {
3352
3523
  _this.formElement = void 0;
3353
3524
  _this.getUsedFormData = function (formData, fields) {
3354
3525
  // For the case of a single input form
3355
- if (fields.length === 0 && typeof formData !== "object") {
3526
+ if (fields.length === 0 && typeof formData !== 'object') {
3356
3527
  return formData;
3357
3528
  }
3358
3529
  // _pick has incorrect type definition, it works with string[][], because lodash/hasIn supports it
@@ -3373,22 +3544,22 @@ var Form = /*#__PURE__*/function (_Component) {
3373
3544
  paths = [[]];
3374
3545
  }
3375
3546
  Object.keys(_obj).forEach(function (key) {
3376
- if (typeof _obj[key] === "object") {
3547
+ if (typeof _obj[key] === 'object') {
3377
3548
  var newPaths = paths.map(function (path) {
3378
3549
  return [].concat(path, [key]);
3379
3550
  });
3380
3551
  // If an object is marked with additionalProperties, all its keys are valid
3381
- if (_obj[key][RJSF_ADDITONAL_PROPERTIES_FLAG] && _obj[key][NAME_KEY] !== "") {
3552
+ if (_obj[key][RJSF_ADDITONAL_PROPERTIES_FLAG] && _obj[key][NAME_KEY] !== '') {
3382
3553
  acc.push(_obj[key][NAME_KEY]);
3383
3554
  } else {
3384
3555
  getAllPaths(_obj[key], acc, newPaths);
3385
3556
  }
3386
- } else if (key === NAME_KEY && _obj[key] !== "") {
3557
+ } else if (key === NAME_KEY && _obj[key] !== '') {
3387
3558
  paths.forEach(function (path) {
3388
3559
  var formValue = get(formData, path);
3389
3560
  // adds path to fieldNames if it points to a value
3390
3561
  // or an empty object/array
3391
- if (typeof formValue !== "object" || isEmpty(formValue)) {
3562
+ if (typeof formValue !== 'object' || isEmpty(formValue)) {
3392
3563
  acc.push(path);
3393
3564
  }
3394
3565
  });
@@ -3421,7 +3592,7 @@ var Form = /*#__PURE__*/function (_Component) {
3421
3592
  var newFormData = formData;
3422
3593
  if (omitExtraData === true && liveOmit === true) {
3423
3594
  var retrievedSchema = schemaUtils.retrieveSchema(schema, formData);
3424
- var pathSchema = schemaUtils.toPathSchema(retrievedSchema, "", formData);
3595
+ var pathSchema = schemaUtils.toPathSchema(retrievedSchema, '', formData);
3425
3596
  var fieldNames = _this.getFieldNames(pathSchema, formData);
3426
3597
  newFormData = _this.getUsedFormData(formData, fieldNames);
3427
3598
  state = {
@@ -3447,7 +3618,7 @@ var Form = /*#__PURE__*/function (_Component) {
3447
3618
  schemaValidationErrorSchema: schemaValidationErrorSchema
3448
3619
  };
3449
3620
  } else if (!noValidate && newErrorSchema) {
3450
- var _errorSchema = extraErrors ? mergeObjects(newErrorSchema, extraErrors, "preventDuplicates") : newErrorSchema;
3621
+ var _errorSchema = extraErrors ? mergeObjects(newErrorSchema, extraErrors, 'preventDuplicates') : newErrorSchema;
3451
3622
  state = {
3452
3623
  formData: newFormData,
3453
3624
  errorSchema: _errorSchema,
@@ -3458,6 +3629,21 @@ var Form = /*#__PURE__*/function (_Component) {
3458
3629
  return onChange && onChange(_extends({}, _this.state, state), id);
3459
3630
  });
3460
3631
  };
3632
+ _this.reset = function () {
3633
+ var onChange = _this.props.onChange;
3634
+ var newState = _this.getStateFromProps(_this.props, undefined);
3635
+ var newFormData = newState.formData;
3636
+ var state = {
3637
+ formData: newFormData,
3638
+ errorSchema: {},
3639
+ errors: [],
3640
+ schemaValidationErrors: [],
3641
+ schemaValidationErrorSchema: {}
3642
+ };
3643
+ _this.setState(state, function () {
3644
+ return onChange && onChange(_extends({}, _this.state, state));
3645
+ });
3646
+ };
3461
3647
  _this.onBlur = function (id, data) {
3462
3648
  var onBlur = _this.props.onBlur;
3463
3649
  if (onBlur) {
@@ -3487,7 +3673,7 @@ var Form = /*#__PURE__*/function (_Component) {
3487
3673
  schemaUtils = _this$state2.schemaUtils;
3488
3674
  if (omitExtraData === true) {
3489
3675
  var retrievedSchema = schemaUtils.retrieveSchema(schema, newFormData);
3490
- var pathSchema = schemaUtils.toPathSchema(retrievedSchema, "", newFormData);
3676
+ var pathSchema = schemaUtils.toPathSchema(retrievedSchema, '', newFormData);
3491
3677
  var fieldNames = _this.getFieldNames(pathSchema, newFormData);
3492
3678
  newFormData = _this.getUsedFormData(newFormData, fieldNames);
3493
3679
  }
@@ -3506,20 +3692,20 @@ var Form = /*#__PURE__*/function (_Component) {
3506
3692
  if (onSubmit) {
3507
3693
  onSubmit(_extends({}, _this.state, {
3508
3694
  formData: newFormData,
3509
- status: "submitted"
3695
+ status: 'submitted'
3510
3696
  }), event);
3511
3697
  }
3512
3698
  });
3513
3699
  }
3514
3700
  };
3515
3701
  if (!props.validator) {
3516
- throw new Error("A validator is required for Form functionality to work");
3702
+ throw new Error('A validator is required for Form functionality to work');
3517
3703
  }
3518
3704
  _this.state = _this.getStateFromProps(props, props.formData);
3519
3705
  if (_this.props.onChange && !deepEquals(_this.state.formData, _this.props.formData)) {
3520
3706
  _this.props.onChange(_this.state);
3521
3707
  }
3522
- _this.formElement = /*#__PURE__*/React.createRef();
3708
+ _this.formElement = /*#__PURE__*/createRef();
3523
3709
  return _this;
3524
3710
  }
3525
3711
  /** React lifecycle method that gets called before new props are provided, updates the state based on new props. It
@@ -3546,10 +3732,10 @@ var Form = /*#__PURE__*/function (_Component) {
3546
3732
  */;
3547
3733
  _proto.getStateFromProps = function getStateFromProps(props, inputFormData) {
3548
3734
  var state = this.state || {};
3549
- var schema = "schema" in props ? props.schema : this.props.schema;
3550
- var uiSchema = ("uiSchema" in props ? props.uiSchema : this.props.uiSchema) || {};
3551
- var edit = typeof inputFormData !== "undefined";
3552
- var liveValidate = "liveValidate" in props ? props.liveValidate : this.props.liveValidate;
3735
+ var schema = 'schema' in props ? props.schema : this.props.schema;
3736
+ var uiSchema = ('uiSchema' in props ? props.uiSchema : this.props.uiSchema) || {};
3737
+ var edit = typeof inputFormData !== 'undefined';
3738
+ var liveValidate = 'liveValidate' in props ? props.liveValidate : this.props.liveValidate;
3553
3739
  var mustValidate = edit && !props.noValidate && liveValidate;
3554
3740
  var rootSchema = schema;
3555
3741
  var schemaUtils = state.schemaUtils;
@@ -3598,7 +3784,7 @@ var Form = /*#__PURE__*/function (_Component) {
3598
3784
  errorSchema = merged.errorSchema;
3599
3785
  errors = merged.errors;
3600
3786
  }
3601
- var idSchema = schemaUtils.toIdSchema(retrievedSchema, uiSchema["ui:rootFieldId"], formData, props.idPrefix, props.idSeparator);
3787
+ var idSchema = schemaUtils.toIdSchema(retrievedSchema, uiSchema['ui:rootFieldId'], formData, props.idPrefix, props.idSeparator);
3602
3788
  var nextState = {
3603
3789
  schemaUtils: schemaUtils,
3604
3790
  schema: schema,
@@ -3650,9 +3836,9 @@ var Form = /*#__PURE__*/function (_Component) {
3650
3836
  uiSchema = _this$state3.uiSchema;
3651
3837
  var formContext = this.props.formContext;
3652
3838
  var options = getUiOptions(uiSchema);
3653
- var ErrorListTemplate = getTemplate("ErrorListTemplate", registry, options);
3839
+ var ErrorListTemplate = getTemplate('ErrorListTemplate', registry, options);
3654
3840
  if (errors && errors.length) {
3655
- return /*#__PURE__*/React.createElement(ErrorListTemplate, {
3841
+ return jsx(ErrorListTemplate, {
3656
3842
  errors: errors,
3657
3843
  errorSchema: errorSchema || {},
3658
3844
  schema: schema,
@@ -3671,7 +3857,10 @@ var Form = /*#__PURE__*/function (_Component) {
3671
3857
  /** Returns the registry for the form */
3672
3858
  _proto.getRegistry = function getRegistry() {
3673
3859
  var _this$props$templates;
3674
- var customTranslateString = this.props.translateString;
3860
+ var _this$props4 = this.props,
3861
+ customTranslateString = _this$props4.translateString,
3862
+ _this$props4$uiSchema = _this$props4.uiSchema,
3863
+ uiSchema = _this$props4$uiSchema === void 0 ? {} : _this$props4$uiSchema;
3675
3864
  var schemaUtils = this.state.schemaUtils;
3676
3865
  var _getDefaultRegistry = getDefaultRegistry(),
3677
3866
  fields = _getDefaultRegistry.fields,
@@ -3688,13 +3877,14 @@ var Form = /*#__PURE__*/function (_Component) {
3688
3877
  rootSchema: this.props.schema,
3689
3878
  formContext: this.props.formContext || formContext,
3690
3879
  schemaUtils: schemaUtils,
3691
- translateString: customTranslateString || translateString
3880
+ translateString: customTranslateString || translateString,
3881
+ globalUiOptions: uiSchema[UI_GLOBAL_OPTIONS_KEY]
3692
3882
  };
3693
3883
  }
3694
3884
  /** Provides a function that can be used to programmatically submit the `Form` */;
3695
3885
  _proto.submit = function submit() {
3696
3886
  if (this.formElement.current) {
3697
- this.formElement.current.dispatchEvent(new CustomEvent("submit", {
3887
+ this.formElement.current.dispatchEvent(new CustomEvent('submit', {
3698
3888
  cancelable: true
3699
3889
  }));
3700
3890
  this.formElement.current.requestSubmit();
@@ -3707,14 +3897,14 @@ var Form = /*#__PURE__*/function (_Component) {
3707
3897
  * @param error - The error on which to focus
3708
3898
  */;
3709
3899
  _proto.focusOnError = function focusOnError(error) {
3710
- var _this$props4 = this.props,
3711
- _this$props4$idPrefix = _this$props4.idPrefix,
3712
- idPrefix = _this$props4$idPrefix === void 0 ? "root" : _this$props4$idPrefix,
3713
- _this$props4$idSepara = _this$props4.idSeparator,
3714
- idSeparator = _this$props4$idSepara === void 0 ? "_" : _this$props4$idSepara;
3900
+ var _this$props5 = this.props,
3901
+ _this$props5$idPrefix = _this$props5.idPrefix,
3902
+ idPrefix = _this$props5$idPrefix === void 0 ? 'root' : _this$props5$idPrefix,
3903
+ _this$props5$idSepara = _this$props5.idSeparator,
3904
+ idSeparator = _this$props5$idSepara === void 0 ? '_' : _this$props5$idSepara;
3715
3905
  var property = error.property;
3716
3906
  var path = _toPath(property);
3717
- if (path[0] === "") {
3907
+ if (path[0] === '') {
3718
3908
  // Most of the time the `.foo` property results in the first element being empty, so replace it with the idPrefix
3719
3909
  path[0] = idPrefix;
3720
3910
  } else {
@@ -3737,10 +3927,10 @@ var Form = /*#__PURE__*/function (_Component) {
3737
3927
  * @returns - True if the form is valid, false otherwise.
3738
3928
  */;
3739
3929
  _proto.validateForm = function validateForm() {
3740
- var _this$props5 = this.props,
3741
- extraErrors = _this$props5.extraErrors,
3742
- focusOnFirstError = _this$props5.focusOnFirstError,
3743
- onError = _this$props5.onError;
3930
+ var _this$props6 = this.props,
3931
+ extraErrors = _this$props6.extraErrors,
3932
+ focusOnFirstError = _this$props6.focusOnFirstError,
3933
+ onError = _this$props6.onError;
3744
3934
  var formData = this.state.formData;
3745
3935
  var schemaUtils = this.state.schemaUtils;
3746
3936
  var schemaValidation = this.validate(formData);
@@ -3766,7 +3956,7 @@ var Form = /*#__PURE__*/function (_Component) {
3766
3956
  if (onError) {
3767
3957
  onError(errors);
3768
3958
  } else {
3769
- console.error("Form validation failed", errors);
3959
+ console.error('Form validation failed', errors);
3770
3960
  }
3771
3961
  });
3772
3962
  return false;
@@ -3777,31 +3967,31 @@ var Form = /*#__PURE__*/function (_Component) {
3777
3967
  * needed along with the submit button or any children of the form.
3778
3968
  */;
3779
3969
  _proto.render = function render() {
3780
- var _this$props6 = this.props,
3781
- children = _this$props6.children,
3782
- id = _this$props6.id,
3783
- idPrefix = _this$props6.idPrefix,
3784
- idSeparator = _this$props6.idSeparator,
3785
- _this$props6$classNam = _this$props6.className,
3786
- className = _this$props6$classNam === void 0 ? "" : _this$props6$classNam,
3787
- tagName = _this$props6.tagName,
3788
- name = _this$props6.name,
3789
- method = _this$props6.method,
3790
- target = _this$props6.target,
3791
- action = _this$props6.action,
3792
- autoComplete = _this$props6.autoComplete,
3793
- enctype = _this$props6.enctype,
3794
- acceptcharset = _this$props6.acceptcharset,
3795
- _this$props6$noHtml5V = _this$props6.noHtml5Validate,
3796
- noHtml5Validate = _this$props6$noHtml5V === void 0 ? false : _this$props6$noHtml5V,
3797
- _this$props6$disabled = _this$props6.disabled,
3798
- disabled = _this$props6$disabled === void 0 ? false : _this$props6$disabled,
3799
- _this$props6$readonly = _this$props6.readonly,
3800
- readonly = _this$props6$readonly === void 0 ? false : _this$props6$readonly,
3801
- formContext = _this$props6.formContext,
3802
- _this$props6$showErro = _this$props6.showErrorList,
3803
- showErrorList = _this$props6$showErro === void 0 ? "top" : _this$props6$showErro,
3804
- _internalFormWrapper = _this$props6._internalFormWrapper;
3970
+ var _this$props7 = this.props,
3971
+ children = _this$props7.children,
3972
+ id = _this$props7.id,
3973
+ idPrefix = _this$props7.idPrefix,
3974
+ idSeparator = _this$props7.idSeparator,
3975
+ _this$props7$classNam = _this$props7.className,
3976
+ className = _this$props7$classNam === void 0 ? '' : _this$props7$classNam,
3977
+ tagName = _this$props7.tagName,
3978
+ name = _this$props7.name,
3979
+ method = _this$props7.method,
3980
+ target = _this$props7.target,
3981
+ action = _this$props7.action,
3982
+ autoComplete = _this$props7.autoComplete,
3983
+ enctype = _this$props7.enctype,
3984
+ acceptcharset = _this$props7.acceptcharset,
3985
+ _this$props7$noHtml5V = _this$props7.noHtml5Validate,
3986
+ noHtml5Validate = _this$props7$noHtml5V === void 0 ? false : _this$props7$noHtml5V,
3987
+ _this$props7$disabled = _this$props7.disabled,
3988
+ disabled = _this$props7$disabled === void 0 ? false : _this$props7$disabled,
3989
+ _this$props7$readonly = _this$props7.readonly,
3990
+ readonly = _this$props7$readonly === void 0 ? false : _this$props7$readonly,
3991
+ formContext = _this$props7.formContext,
3992
+ _this$props7$showErro = _this$props7.showErrorList,
3993
+ showErrorList = _this$props7$showErro === void 0 ? 'top' : _this$props7$showErro,
3994
+ _internalFormWrapper = _this$props7._internalFormWrapper;
3805
3995
  var _this$state4 = this.state,
3806
3996
  schema = _this$state4.schema,
3807
3997
  uiSchema = _this$state4.uiSchema,
@@ -3815,9 +4005,9 @@ var Form = /*#__PURE__*/function (_Component) {
3815
4005
  // PropTypes.elementType to use for the inner tag, so we'll need to pass `tagName` along if it is provided.
3816
4006
  // NOTE, the `as` prop is native to `semantic-ui` and is emulated in the `material-ui` theme
3817
4007
  var as = _internalFormWrapper ? tagName : undefined;
3818
- var FormTag = _internalFormWrapper || tagName || "form";
3819
- return /*#__PURE__*/React.createElement(FormTag, {
3820
- className: className ? className : "rjsf",
4008
+ var FormTag = _internalFormWrapper || tagName || 'form';
4009
+ return jsxs(FormTag, {
4010
+ className: className ? className : 'rjsf',
3821
4011
  id: id,
3822
4012
  name: name,
3823
4013
  method: method,
@@ -3829,27 +4019,28 @@ var Form = /*#__PURE__*/function (_Component) {
3829
4019
  noValidate: noHtml5Validate,
3830
4020
  onSubmit: this.onSubmit,
3831
4021
  as: as,
3832
- ref: this.formElement
3833
- }, showErrorList === "top" && this.renderErrors(registry), /*#__PURE__*/React.createElement(_SchemaField, {
3834
- name: "",
3835
- schema: schema,
3836
- uiSchema: uiSchema,
3837
- errorSchema: errorSchema,
3838
- idSchema: idSchema,
3839
- idPrefix: idPrefix,
3840
- idSeparator: idSeparator,
3841
- formContext: formContext,
3842
- formData: formData,
3843
- onChange: this.onChange,
3844
- onBlur: this.onBlur,
3845
- onFocus: this.onFocus,
3846
- registry: registry,
3847
- disabled: disabled,
3848
- readonly: readonly
3849
- }), children ? children : /*#__PURE__*/React.createElement(SubmitButton, {
3850
- uiSchema: uiSchema,
3851
- registry: registry
3852
- }), showErrorList === "bottom" && this.renderErrors(registry));
4022
+ ref: this.formElement,
4023
+ children: [showErrorList === 'top' && this.renderErrors(registry), jsx(_SchemaField, {
4024
+ name: '',
4025
+ schema: schema,
4026
+ uiSchema: uiSchema,
4027
+ errorSchema: errorSchema,
4028
+ idSchema: idSchema,
4029
+ idPrefix: idPrefix,
4030
+ idSeparator: idSeparator,
4031
+ formContext: formContext,
4032
+ formData: formData,
4033
+ onChange: this.onChange,
4034
+ onBlur: this.onBlur,
4035
+ onFocus: this.onFocus,
4036
+ registry: registry,
4037
+ disabled: disabled,
4038
+ readonly: readonly
4039
+ }), children ? children : jsx(SubmitButton, {
4040
+ uiSchema: uiSchema,
4041
+ registry: registry
4042
+ }), showErrorList === 'bottom' && this.renderErrors(registry)]
4043
+ });
3853
4044
  };
3854
4045
  return Form;
3855
4046
  }(Component);
@@ -3868,7 +4059,7 @@ function withTheme(themeProps) {
3868
4059
  templates = _extends({}, themeProps === null || themeProps === void 0 ? void 0 : themeProps.templates, templates, {
3869
4060
  ButtonTemplates: _extends({}, themeProps === null || themeProps === void 0 ? void 0 : (_themeProps$templates = themeProps.templates) === null || _themeProps$templates === void 0 ? void 0 : _themeProps$templates.ButtonTemplates, (_templates = templates) === null || _templates === void 0 ? void 0 : _templates.ButtonTemplates)
3870
4061
  });
3871
- return /*#__PURE__*/React.createElement(Form, _extends({}, themeProps, directProps, {
4062
+ return jsx(Form, _extends({}, themeProps, directProps, {
3872
4063
  fields: fields,
3873
4064
  widgets: widgets,
3874
4065
  templates: templates,