@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.cjs.development.js +10 -5
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +10 -5
- package/dist/core.esm.js.map +1 -1
- package/dist/core.umd.development.js +10 -5
- package/dist/core.umd.development.js.map +1 -1
- package/dist/core.umd.production.min.js +1 -1
- package/dist/core.umd.production.min.js.map +1 -1
- package/package.json +8 -7
|
@@ -1559,6 +1559,7 @@
|
|
|
1559
1559
|
required: required,
|
|
1560
1560
|
idSchema: idSchema,
|
|
1561
1561
|
uiSchema: uiSchema,
|
|
1562
|
+
errorSchema: errorSchema,
|
|
1562
1563
|
schema: schema,
|
|
1563
1564
|
formData: formData,
|
|
1564
1565
|
formContext: formContext,
|
|
@@ -2123,7 +2124,7 @@
|
|
|
2123
2124
|
});
|
|
2124
2125
|
}
|
|
2125
2126
|
|
|
2126
|
-
var _excluded$3 = ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type"];
|
|
2127
|
+
var _excluded$3 = ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type", "hideLabel", "hideError"];
|
|
2127
2128
|
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
2128
2129
|
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
2129
2130
|
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
@@ -2211,7 +2212,7 @@
|
|
|
2211
2212
|
children: jsxRuntime.jsx("button", _extends({
|
|
2212
2213
|
type: 'submit'
|
|
2213
2214
|
}, submitButtonProps, {
|
|
2214
|
-
className: "btn btn-info " + submitButtonProps.className,
|
|
2215
|
+
className: "btn btn-info " + (submitButtonProps.className || ''),
|
|
2215
2216
|
children: submitText
|
|
2216
2217
|
}))
|
|
2217
2218
|
});
|
|
@@ -3197,6 +3198,7 @@
|
|
|
3197
3198
|
function FileWidget(props) {
|
|
3198
3199
|
var disabled = props.disabled,
|
|
3199
3200
|
readonly = props.readonly,
|
|
3201
|
+
required = props.required,
|
|
3200
3202
|
multiple = props.multiple,
|
|
3201
3203
|
onChange = props.onChange,
|
|
3202
3204
|
value = props.value,
|
|
@@ -3229,6 +3231,7 @@
|
|
|
3229
3231
|
children: [jsxRuntime.jsx(BaseInputTemplate, _extends({}, props, {
|
|
3230
3232
|
disabled: disabled || readonly,
|
|
3231
3233
|
type: 'file',
|
|
3234
|
+
required: value ? false : required,
|
|
3232
3235
|
onChangeOverride: handleChange,
|
|
3233
3236
|
value: '',
|
|
3234
3237
|
accept: options.accept ? String(options.accept) : undefined
|
|
@@ -3286,8 +3289,6 @@
|
|
|
3286
3289
|
onFocus = _ref.onFocus,
|
|
3287
3290
|
onChange = _ref.onChange,
|
|
3288
3291
|
id = _ref.id;
|
|
3289
|
-
// Generating a unique field name to identify this set of radio buttons
|
|
3290
|
-
var name = Math.random().toString();
|
|
3291
3292
|
var enumOptions = options.enumOptions,
|
|
3292
3293
|
enumDisabled = options.enumDisabled,
|
|
3293
3294
|
inline = options.inline,
|
|
@@ -3315,7 +3316,7 @@
|
|
|
3315
3316
|
type: 'radio',
|
|
3316
3317
|
id: utils.optionId(id, i),
|
|
3317
3318
|
checked: checked,
|
|
3318
|
-
name:
|
|
3319
|
+
name: id,
|
|
3319
3320
|
required: required,
|
|
3320
3321
|
value: String(i),
|
|
3321
3322
|
disabled: disabled || itemDisabled || readonly,
|
|
@@ -3998,6 +3999,10 @@
|
|
|
3998
3999
|
// if not an exact match, try finding an input starting with the element id (like radio buttons or checkboxes)
|
|
3999
4000
|
field = this.formElement.current.querySelector("input[id^=" + elementId);
|
|
4000
4001
|
}
|
|
4002
|
+
if (field.length) {
|
|
4003
|
+
// If we got a list with length > 0
|
|
4004
|
+
field = field[0];
|
|
4005
|
+
}
|
|
4001
4006
|
if (field) {
|
|
4002
4007
|
field.focus();
|
|
4003
4008
|
}
|