@rjsf/mantine 6.6.2 → 6.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +201 -0
- package/dist/index.cjs +256 -229
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +147 -118
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +50 -28
- package/lib/templates/ArrayFieldItemTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.d.ts +1 -1
- package/lib/templates/BaseInputTemplate.d.ts +1 -1
- package/lib/templates/BaseInputTemplate.js +4 -2
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ButtonTemplates/AddButton.d.ts +1 -1
- package/lib/templates/ButtonTemplates/IconButton.d.ts +6 -6
- package/lib/templates/ButtonTemplates/SubmitButton.d.ts +1 -1
- package/lib/templates/CyclicSchemaExpandTemplate.d.ts +6 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js +15 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js.map +1 -0
- package/lib/templates/DescriptionField.d.ts +1 -1
- package/lib/templates/ErrorList.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate.js +1 -1
- package/lib/templates/FieldErrorTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate.d.ts +1 -1
- package/lib/templates/FieldTemplate.d.ts +1 -1
- package/lib/templates/GridTemplate.d.ts +1 -1
- package/lib/templates/MultiSchemaFieldTemplate.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate.d.ts +1 -1
- package/lib/templates/OptionalDataControlsTemplate.d.ts +1 -1
- package/lib/templates/TitleField.d.ts +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/templates/icons.d.ts +6 -6
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxesWidget.d.ts +1 -1
- package/lib/widgets/ColorWidget.d.ts +1 -1
- package/lib/widgets/ColorWidget.js +2 -2
- package/lib/widgets/ColorWidget.js.map +1 -1
- package/lib/widgets/DateTime/AltDateTimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/AltDateWidget.d.ts +1 -1
- package/lib/widgets/DateTime/DateTimeInput.d.ts +1 -1
- package/lib/widgets/DateTime/DateTimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/DateWidget.d.ts +1 -1
- package/lib/widgets/DateTime/TimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/TimeWidget.js +2 -2
- package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
- package/lib/widgets/FileWidget.d.ts +1 -1
- package/lib/widgets/PasswordWidget.d.ts +1 -1
- package/lib/widgets/PasswordWidget.js +2 -2
- package/lib/widgets/PasswordWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.d.ts +1 -1
- package/lib/widgets/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/RangeWidget.d.ts +1 -1
- package/lib/widgets/SelectWidget.d.ts +1 -1
- package/lib/widgets/SelectWidget.js +7 -6
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.js +2 -2
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/package.json +27 -24
- package/src/templates/BaseInputTemplate.tsx +2 -2
- package/src/templates/CyclicSchemaExpandTemplate.tsx +34 -0
- package/src/templates/FieldErrorTemplate.tsx +1 -1
- package/src/templates/index.ts +2 -0
- package/src/widgets/ColorWidget.tsx +2 -2
- package/src/widgets/DateTime/TimeWidget.tsx +2 -2
- package/src/widgets/PasswordWidget.tsx +2 -2
- package/src/widgets/RadioWidget.tsx +2 -2
- package/src/widgets/SelectWidget.tsx +21 -12
- package/src/widgets/TextareaWidget.tsx +2 -2
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
enumOptionValueEncoder,
|
|
10
10
|
getOptionValueFormat,
|
|
11
11
|
labelValue,
|
|
12
|
+
logUnsupportedDefaultForEnum,
|
|
13
|
+
SelectedOptionDescription,
|
|
12
14
|
} from '@rjsf/utils';
|
|
13
15
|
|
|
14
16
|
import { cleanupOptions } from '../utils';
|
|
@@ -34,6 +36,7 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
34
36
|
hideLabel,
|
|
35
37
|
multiple,
|
|
36
38
|
rawErrors,
|
|
39
|
+
schema,
|
|
37
40
|
options,
|
|
38
41
|
onChange,
|
|
39
42
|
onBlur,
|
|
@@ -43,6 +46,7 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
43
46
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
44
47
|
const optionValueFormat = getOptionValueFormat(options);
|
|
45
48
|
const themeProps = cleanupOptions(options);
|
|
49
|
+
logUnsupportedDefaultForEnum<S>(id, schema, enumOptions, multiple);
|
|
46
50
|
|
|
47
51
|
const handleChange = useCallback(
|
|
48
52
|
(nextValue: any) => {
|
|
@@ -56,7 +60,7 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
56
60
|
const handleBlur = useCallback(
|
|
57
61
|
({ target }: FocusEvent<HTMLInputElement>) => {
|
|
58
62
|
if (onBlur) {
|
|
59
|
-
onBlur(id, enumOptionValueDecoder<S>(target
|
|
63
|
+
onBlur(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
60
64
|
}
|
|
61
65
|
},
|
|
62
66
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat],
|
|
@@ -65,7 +69,7 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
65
69
|
const handleFocus = useCallback(
|
|
66
70
|
({ target }: FocusEvent<HTMLInputElement>) => {
|
|
67
71
|
if (onFocus) {
|
|
68
|
-
onFocus(id, enumOptionValueDecoder<S>(target
|
|
72
|
+
onFocus(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
69
73
|
}
|
|
70
74
|
},
|
|
71
75
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat],
|
|
@@ -102,15 +106,20 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
102
106
|
...themeProps,
|
|
103
107
|
};
|
|
104
108
|
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
{...
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<SelectedOptionDescription {...props} />
|
|
112
|
+
{multiple ? (
|
|
113
|
+
<MultiSelect
|
|
114
|
+
{...sharedProps}
|
|
115
|
+
value={enumOptionSelectedValue<S>(value, enumOptions, true, optionValueFormat, []) as string[]}
|
|
116
|
+
/>
|
|
117
|
+
) : (
|
|
118
|
+
<Select
|
|
119
|
+
{...sharedProps}
|
|
120
|
+
value={enumOptionSelectedValue<S>(value, enumOptions, false, optionValueFormat, null) as string | null}
|
|
121
|
+
/>
|
|
122
|
+
)}
|
|
123
|
+
</>
|
|
115
124
|
);
|
|
116
125
|
}
|
|
@@ -47,7 +47,7 @@ export default function TextareaWidget<
|
|
|
47
47
|
const handleBlur = useCallback(
|
|
48
48
|
({ target }: FocusEvent<HTMLTextAreaElement>) => {
|
|
49
49
|
if (onBlur) {
|
|
50
|
-
onBlur(id, target
|
|
50
|
+
onBlur(id, target?.value);
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
[onBlur, id],
|
|
@@ -56,7 +56,7 @@ export default function TextareaWidget<
|
|
|
56
56
|
const handleFocus = useCallback(
|
|
57
57
|
({ target }: FocusEvent<HTMLTextAreaElement>) => {
|
|
58
58
|
if (onFocus) {
|
|
59
|
-
onFocus(id, target
|
|
59
|
+
onFocus(id, target?.value);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
[onFocus, id],
|