@rjsf/core 5.4.0 → 5.5.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
@@ -1555,6 +1555,7 @@ var ObjectField = /*#__PURE__*/function (_Component) {
1555
1555
  required: required,
1556
1556
  idSchema: idSchema,
1557
1557
  uiSchema: uiSchema,
1558
+ errorSchema: errorSchema,
1558
1559
  schema: schema,
1559
1560
  formData: formData,
1560
1561
  formContext: formContext,
@@ -2119,7 +2120,7 @@ function ArrayFieldTitleTemplate(props) {
2119
2120
  });
2120
2121
  }
2121
2122
 
2122
- var _excluded$3 = ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type"];
2123
+ var _excluded$3 = ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type", "hideLabel", "hideError"];
2123
2124
  /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
2124
2125
  * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
2125
2126
  * It can be customized/overridden for other themes or individual implementations as needed.
@@ -2207,7 +2208,7 @@ function SubmitButton(_ref) {
2207
2208
  children: jsx("button", _extends({
2208
2209
  type: 'submit'
2209
2210
  }, submitButtonProps, {
2210
- className: "btn btn-info " + submitButtonProps.className,
2211
+ className: "btn btn-info " + (submitButtonProps.className || ''),
2211
2212
  children: submitText
2212
2213
  }))
2213
2214
  });
@@ -3193,6 +3194,7 @@ function extractFileInfo(dataURLs) {
3193
3194
  function FileWidget(props) {
3194
3195
  var disabled = props.disabled,
3195
3196
  readonly = props.readonly,
3197
+ required = props.required,
3196
3198
  multiple = props.multiple,
3197
3199
  onChange = props.onChange,
3198
3200
  value = props.value,
@@ -3225,6 +3227,7 @@ function FileWidget(props) {
3225
3227
  children: [jsx(BaseInputTemplate, _extends({}, props, {
3226
3228
  disabled: disabled || readonly,
3227
3229
  type: 'file',
3230
+ required: value ? false : required,
3228
3231
  onChangeOverride: handleChange,
3229
3232
  value: '',
3230
3233
  accept: options.accept ? String(options.accept) : undefined
@@ -3282,8 +3285,6 @@ function RadioWidget(_ref) {
3282
3285
  onFocus = _ref.onFocus,
3283
3286
  onChange = _ref.onChange,
3284
3287
  id = _ref.id;
3285
- // Generating a unique field name to identify this set of radio buttons
3286
- var name = Math.random().toString();
3287
3288
  var enumOptions = options.enumOptions,
3288
3289
  enumDisabled = options.enumDisabled,
3289
3290
  inline = options.inline,
@@ -3311,7 +3312,7 @@ function RadioWidget(_ref) {
3311
3312
  type: 'radio',
3312
3313
  id: optionId(id, i),
3313
3314
  checked: checked,
3314
- name: name,
3315
+ name: id,
3315
3316
  required: required,
3316
3317
  value: String(i),
3317
3318
  disabled: disabled || itemDisabled || readonly,
@@ -3994,6 +3995,10 @@ var Form = /*#__PURE__*/function (_Component) {
3994
3995
  // if not an exact match, try finding an input starting with the element id (like radio buttons or checkboxes)
3995
3996
  field = this.formElement.current.querySelector("input[id^=" + elementId);
3996
3997
  }
3998
+ if (field.length) {
3999
+ // If we got a list with length > 0
4000
+ field = field[0];
4001
+ }
3997
4002
  if (field) {
3998
4003
  field.focus();
3999
4004
  }