@rjsf/core 6.0.0-alpha.0 → 6.0.0-beta.2
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.umd.js +1680 -809
- package/dist/index.esm.js +2166 -1198
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +2221 -1299
- package/dist/index.js.map +4 -4
- package/lib/components/Form.d.ts +22 -9
- package/lib/components/Form.d.ts.map +1 -0
- package/lib/components/Form.js +368 -312
- package/lib/components/RichDescription.d.ts +20 -0
- package/lib/components/RichDescription.d.ts.map +1 -0
- package/lib/components/RichDescription.js +17 -0
- package/lib/components/fields/ArrayField.d.ts +20 -9
- package/lib/components/fields/ArrayField.d.ts.map +1 -0
- package/lib/components/fields/ArrayField.js +212 -206
- package/lib/components/fields/BooleanField.d.ts +1 -0
- package/lib/components/fields/BooleanField.d.ts.map +1 -0
- package/lib/components/fields/BooleanField.js +6 -14
- package/lib/components/fields/LayoutGridField.d.ts +480 -0
- package/lib/components/fields/LayoutGridField.d.ts.map +1 -0
- package/lib/components/fields/LayoutGridField.js +711 -0
- package/lib/components/fields/LayoutHeaderField.d.ts +12 -0
- package/lib/components/fields/LayoutHeaderField.d.ts.map +1 -0
- package/lib/components/fields/LayoutHeaderField.js +23 -0
- package/lib/components/fields/LayoutMultiSchemaField.d.ts +28 -0
- package/lib/components/fields/LayoutMultiSchemaField.d.ts.map +1 -0
- package/lib/components/fields/LayoutMultiSchemaField.js +114 -0
- package/lib/components/fields/MultiSchemaField.d.ts +1 -0
- package/lib/components/fields/MultiSchemaField.d.ts.map +1 -0
- package/lib/components/fields/MultiSchemaField.js +31 -31
- package/lib/components/fields/NullField.d.ts +1 -0
- package/lib/components/fields/NullField.d.ts.map +1 -0
- package/lib/components/fields/NullField.js +0 -1
- package/lib/components/fields/NumberField.d.ts +1 -0
- package/lib/components/fields/NumberField.d.ts.map +1 -0
- package/lib/components/fields/NumberField.js +2 -3
- package/lib/components/fields/ObjectField.d.ts +1 -0
- package/lib/components/fields/ObjectField.d.ts.map +1 -0
- package/lib/components/fields/ObjectField.js +146 -141
- package/lib/components/fields/SchemaField.d.ts +1 -0
- package/lib/components/fields/SchemaField.d.ts.map +1 -0
- package/lib/components/fields/SchemaField.js +10 -20
- package/lib/components/fields/StringField.d.ts +1 -0
- package/lib/components/fields/StringField.d.ts.map +1 -0
- package/lib/components/fields/StringField.js +1 -3
- package/lib/components/fields/index.d.ts +1 -0
- package/lib/components/fields/index.d.ts.map +1 -0
- package/lib/components/fields/index.js +14 -9
- package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +1 -0
- package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts.map +1 -0
- package/lib/components/templates/ArrayFieldDescriptionTemplate.js +0 -1
- package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts +8 -0
- package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts.map +1 -0
- package/lib/components/templates/ArrayFieldItemButtonsTemplate.js +17 -0
- package/lib/components/templates/ArrayFieldItemTemplate.d.ts +4 -3
- package/lib/components/templates/ArrayFieldItemTemplate.d.ts.map +1 -0
- package/lib/components/templates/ArrayFieldItemTemplate.js +7 -6
- package/lib/components/templates/ArrayFieldTemplate.d.ts +2 -1
- package/lib/components/templates/ArrayFieldTemplate.d.ts.map +1 -0
- package/lib/components/templates/ArrayFieldTemplate.js +3 -4
- package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +1 -0
- package/lib/components/templates/ArrayFieldTitleTemplate.d.ts.map +1 -0
- package/lib/components/templates/ArrayFieldTitleTemplate.js +0 -1
- package/lib/components/templates/BaseInputTemplate.d.ts +1 -0
- package/lib/components/templates/BaseInputTemplate.d.ts.map +1 -0
- package/lib/components/templates/BaseInputTemplate.js +0 -1
- package/lib/components/templates/ButtonTemplates/AddButton.d.ts +1 -0
- package/lib/components/templates/ButtonTemplates/AddButton.d.ts.map +1 -0
- package/lib/components/templates/ButtonTemplates/AddButton.js +1 -2
- package/lib/components/templates/ButtonTemplates/IconButton.d.ts +1 -0
- package/lib/components/templates/ButtonTemplates/IconButton.d.ts.map +1 -0
- package/lib/components/templates/ButtonTemplates/IconButton.js +4 -5
- package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +1 -0
- package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts.map +1 -0
- package/lib/components/templates/ButtonTemplates/SubmitButton.js +0 -1
- package/lib/components/templates/ButtonTemplates/index.d.ts +1 -0
- package/lib/components/templates/ButtonTemplates/index.d.ts.map +1 -0
- package/lib/components/templates/ButtonTemplates/index.js +3 -4
- package/lib/components/templates/DescriptionField.d.ts +1 -0
- package/lib/components/templates/DescriptionField.d.ts.map +1 -0
- package/lib/components/templates/DescriptionField.js +3 -8
- package/lib/components/templates/ErrorList.d.ts +1 -0
- package/lib/components/templates/ErrorList.d.ts.map +1 -0
- package/lib/components/templates/ErrorList.js +0 -1
- package/lib/components/templates/FieldErrorTemplate.d.ts +1 -0
- package/lib/components/templates/FieldErrorTemplate.d.ts.map +1 -0
- package/lib/components/templates/FieldErrorTemplate.js +0 -1
- package/lib/components/templates/FieldHelpTemplate.d.ts +1 -0
- package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -0
- package/lib/components/templates/FieldHelpTemplate.js +0 -1
- package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +1 -0
- package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts.map +1 -0
- package/lib/components/templates/FieldTemplate/FieldTemplate.js +1 -2
- package/lib/components/templates/FieldTemplate/Label.d.ts +1 -0
- package/lib/components/templates/FieldTemplate/Label.d.ts.map +1 -0
- package/lib/components/templates/FieldTemplate/Label.js +0 -1
- package/lib/components/templates/FieldTemplate/index.d.ts +2 -1
- package/lib/components/templates/FieldTemplate/index.d.ts.map +1 -0
- package/lib/components/templates/FieldTemplate/index.js +1 -2
- package/lib/components/templates/GridTemplate.d.ts +8 -0
- package/lib/components/templates/GridTemplate.d.ts.map +1 -0
- package/lib/components/templates/GridTemplate.js +10 -0
- package/lib/components/templates/ObjectFieldTemplate.d.ts +1 -0
- package/lib/components/templates/ObjectFieldTemplate.d.ts.map +1 -0
- package/lib/components/templates/ObjectFieldTemplate.js +2 -3
- package/lib/components/templates/TitleField.d.ts +1 -0
- package/lib/components/templates/TitleField.d.ts.map +1 -0
- package/lib/components/templates/TitleField.js +0 -1
- package/lib/components/templates/UnsupportedField.d.ts +1 -0
- package/lib/components/templates/UnsupportedField.d.ts.map +1 -0
- package/lib/components/templates/UnsupportedField.js +0 -1
- package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +1 -0
- package/lib/components/templates/WrapIfAdditionalTemplate.d.ts.map +1 -0
- package/lib/components/templates/WrapIfAdditionalTemplate.js +10 -6
- package/lib/components/templates/index.d.ts +1 -0
- package/lib/components/templates/index.d.ts.map +1 -0
- package/lib/components/templates/index.js +19 -16
- package/lib/components/widgets/AltDateTimeWidget.d.ts +1 -0
- package/lib/components/widgets/AltDateTimeWidget.d.ts.map +1 -0
- package/lib/components/widgets/AltDateTimeWidget.js +0 -1
- package/lib/components/widgets/AltDateWidget.d.ts +1 -0
- package/lib/components/widgets/AltDateWidget.d.ts.map +1 -0
- package/lib/components/widgets/AltDateWidget.js +0 -1
- package/lib/components/widgets/CheckboxWidget.d.ts +1 -0
- package/lib/components/widgets/CheckboxWidget.d.ts.map +1 -0
- package/lib/components/widgets/CheckboxWidget.js +2 -4
- package/lib/components/widgets/CheckboxesWidget.d.ts +1 -0
- package/lib/components/widgets/CheckboxesWidget.d.ts.map +1 -0
- package/lib/components/widgets/CheckboxesWidget.js +0 -1
- package/lib/components/widgets/ColorWidget.d.ts +1 -0
- package/lib/components/widgets/ColorWidget.d.ts.map +1 -0
- package/lib/components/widgets/ColorWidget.js +0 -1
- package/lib/components/widgets/DateTimeWidget.d.ts +1 -0
- package/lib/components/widgets/DateTimeWidget.d.ts.map +1 -0
- package/lib/components/widgets/DateTimeWidget.js +0 -1
- package/lib/components/widgets/DateWidget.d.ts +1 -0
- package/lib/components/widgets/DateWidget.d.ts.map +1 -0
- package/lib/components/widgets/DateWidget.js +0 -1
- package/lib/components/widgets/EmailWidget.d.ts +1 -0
- package/lib/components/widgets/EmailWidget.d.ts.map +1 -0
- package/lib/components/widgets/EmailWidget.js +0 -1
- package/lib/components/widgets/FileWidget.d.ts +1 -0
- package/lib/components/widgets/FileWidget.d.ts.map +1 -0
- package/lib/components/widgets/FileWidget.js +3 -5
- package/lib/components/widgets/HiddenWidget.d.ts +1 -0
- package/lib/components/widgets/HiddenWidget.d.ts.map +1 -0
- package/lib/components/widgets/HiddenWidget.js +0 -1
- package/lib/components/widgets/PasswordWidget.d.ts +1 -0
- package/lib/components/widgets/PasswordWidget.d.ts.map +1 -0
- package/lib/components/widgets/PasswordWidget.js +0 -1
- package/lib/components/widgets/RadioWidget.d.ts +1 -0
- package/lib/components/widgets/RadioWidget.d.ts.map +1 -0
- package/lib/components/widgets/RadioWidget.js +3 -4
- package/lib/components/widgets/RangeWidget.d.ts +1 -0
- package/lib/components/widgets/RangeWidget.d.ts.map +1 -0
- package/lib/components/widgets/RangeWidget.js +0 -1
- package/lib/components/widgets/RatingWidget.d.ts +15 -0
- package/lib/components/widgets/RatingWidget.d.ts.map +1 -0
- package/lib/components/widgets/RatingWidget.js +63 -0
- package/lib/components/widgets/SelectWidget.d.ts +1 -0
- package/lib/components/widgets/SelectWidget.d.ts.map +1 -0
- package/lib/components/widgets/SelectWidget.js +4 -5
- package/lib/components/widgets/TextWidget.d.ts +1 -0
- package/lib/components/widgets/TextWidget.d.ts.map +1 -0
- package/lib/components/widgets/TextWidget.js +0 -1
- package/lib/components/widgets/TextareaWidget.d.ts +1 -0
- package/lib/components/widgets/TextareaWidget.d.ts.map +1 -0
- package/lib/components/widgets/TextareaWidget.js +0 -1
- package/lib/components/widgets/TimeWidget.d.ts +1 -0
- package/lib/components/widgets/TimeWidget.d.ts.map +1 -0
- package/lib/components/widgets/TimeWidget.js +0 -1
- package/lib/components/widgets/URLWidget.d.ts +1 -0
- package/lib/components/widgets/URLWidget.d.ts.map +1 -0
- package/lib/components/widgets/URLWidget.js +0 -1
- package/lib/components/widgets/UpDownWidget.d.ts +1 -0
- package/lib/components/widgets/UpDownWidget.d.ts.map +1 -0
- package/lib/components/widgets/UpDownWidget.js +0 -1
- package/lib/components/widgets/index.d.ts +1 -0
- package/lib/components/widgets/index.d.ts.map +1 -0
- package/lib/components/widgets/index.js +21 -20
- package/lib/getDefaultRegistry.d.ts +1 -0
- package/lib/getDefaultRegistry.d.ts.map +1 -0
- package/lib/getDefaultRegistry.js +3 -4
- package/lib/index.d.ts +7 -5
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/withTheme.d.ts +2 -1
- package/lib/withTheme.d.ts.map +1 -0
- package/lib/withTheme.js +7 -8
- package/package.json +46 -37
- package/src/components/Form.tsx +127 -41
- package/src/components/RichDescription.tsx +50 -0
- package/src/components/fields/ArrayField.tsx +34 -24
- package/src/components/fields/BooleanField.tsx +6 -14
- package/src/components/fields/LayoutGridField.tsx +967 -0
- package/src/components/fields/LayoutHeaderField.tsx +49 -0
- package/src/components/fields/LayoutMultiSchemaField.tsx +228 -0
- package/src/components/fields/MultiSchemaField.tsx +9 -4
- package/src/components/fields/NullField.tsx +1 -1
- package/src/components/fields/NumberField.tsx +5 -5
- package/src/components/fields/ObjectField.tsx +32 -24
- package/src/components/fields/SchemaField.tsx +17 -30
- package/src/components/fields/StringField.tsx +2 -2
- package/src/components/fields/index.ts +7 -1
- package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +2 -2
- package/src/components/templates/ArrayFieldItemButtonsTemplate.tsx +85 -0
- package/src/components/templates/ArrayFieldItemTemplate.tsx +18 -57
- package/src/components/templates/ArrayFieldTemplate.tsx +10 -8
- package/src/components/templates/ArrayFieldTitleTemplate.tsx +2 -2
- package/src/components/templates/BaseInputTemplate.tsx +4 -4
- package/src/components/templates/ButtonTemplates/IconButton.tsx +9 -36
- package/src/components/templates/ButtonTemplates/SubmitButton.tsx +1 -1
- package/src/components/templates/ButtonTemplates/index.ts +1 -1
- package/src/components/templates/DescriptionField.tsx +9 -15
- package/src/components/templates/FieldErrorTemplate.tsx +1 -1
- package/src/components/templates/FieldHelpTemplate.tsx +1 -1
- package/src/components/templates/FieldTemplate/FieldTemplate.tsx +2 -2
- package/src/components/templates/GridTemplate.tsx +15 -0
- package/src/components/templates/ObjectFieldTemplate.tsx +5 -3
- package/src/components/templates/TitleField.tsx +1 -1
- package/src/components/templates/UnsupportedField.tsx +1 -1
- package/src/components/templates/WrapIfAdditionalTemplate.tsx +14 -4
- package/src/components/templates/index.ts +4 -0
- package/src/components/widgets/AltDateWidget.tsx +9 -6
- package/src/components/widgets/CheckboxWidget.tsx +5 -5
- package/src/components/widgets/CheckboxesWidget.tsx +2 -2
- package/src/components/widgets/ColorWidget.tsx +1 -1
- package/src/components/widgets/DateTimeWidget.tsx +1 -1
- package/src/components/widgets/DateWidget.tsx +1 -1
- package/src/components/widgets/EmailWidget.tsx +1 -1
- package/src/components/widgets/FileWidget.tsx +5 -5
- package/src/components/widgets/PasswordWidget.tsx +1 -1
- package/src/components/widgets/RadioWidget.tsx +3 -3
- package/src/components/widgets/RangeWidget.tsx +1 -1
- package/src/components/widgets/RatingWidget.tsx +129 -0
- package/src/components/widgets/SelectWidget.tsx +4 -3
- package/src/components/widgets/TextWidget.tsx +1 -1
- package/src/components/widgets/TextareaWidget.tsx +3 -3
- package/src/components/widgets/TimeWidget.tsx +1 -1
- package/src/components/widgets/URLWidget.tsx +1 -1
- package/src/components/widgets/UpDownWidget.tsx +1 -1
- package/src/components/widgets/index.ts +3 -1
- package/src/getDefaultRegistry.ts +1 -1
- package/src/index.ts +3 -2
- package/src/tsconfig.json +14 -6
- package/src/withTheme.tsx +4 -3
- package/LICENSE.md +0 -201
- package/lib/components/Form.js.map +0 -1
- package/lib/components/fields/ArrayField.js.map +0 -1
- package/lib/components/fields/BooleanField.js.map +0 -1
- package/lib/components/fields/MultiSchemaField.js.map +0 -1
- package/lib/components/fields/NullField.js.map +0 -1
- package/lib/components/fields/NumberField.js.map +0 -1
- package/lib/components/fields/ObjectField.js.map +0 -1
- package/lib/components/fields/SchemaField.js.map +0 -1
- package/lib/components/fields/StringField.js.map +0 -1
- package/lib/components/fields/index.js.map +0 -1
- package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +0 -1
- package/lib/components/templates/ArrayFieldItemTemplate.js.map +0 -1
- package/lib/components/templates/ArrayFieldTemplate.js.map +0 -1
- package/lib/components/templates/ArrayFieldTitleTemplate.js.map +0 -1
- package/lib/components/templates/BaseInputTemplate.js.map +0 -1
- package/lib/components/templates/ButtonTemplates/AddButton.js.map +0 -1
- package/lib/components/templates/ButtonTemplates/IconButton.js.map +0 -1
- package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +0 -1
- package/lib/components/templates/ButtonTemplates/index.js.map +0 -1
- package/lib/components/templates/DescriptionField.js.map +0 -1
- package/lib/components/templates/ErrorList.js.map +0 -1
- package/lib/components/templates/FieldErrorTemplate.js.map +0 -1
- package/lib/components/templates/FieldHelpTemplate.js.map +0 -1
- package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +0 -1
- package/lib/components/templates/FieldTemplate/Label.js.map +0 -1
- package/lib/components/templates/FieldTemplate/index.js.map +0 -1
- package/lib/components/templates/ObjectFieldTemplate.js.map +0 -1
- package/lib/components/templates/TitleField.js.map +0 -1
- package/lib/components/templates/UnsupportedField.js.map +0 -1
- package/lib/components/templates/WrapIfAdditionalTemplate.js.map +0 -1
- package/lib/components/templates/index.js.map +0 -1
- package/lib/components/widgets/AltDateTimeWidget.js.map +0 -1
- package/lib/components/widgets/AltDateWidget.js.map +0 -1
- package/lib/components/widgets/CheckboxWidget.js.map +0 -1
- package/lib/components/widgets/CheckboxesWidget.js.map +0 -1
- package/lib/components/widgets/ColorWidget.js.map +0 -1
- package/lib/components/widgets/DateTimeWidget.js.map +0 -1
- package/lib/components/widgets/DateWidget.js.map +0 -1
- package/lib/components/widgets/EmailWidget.js.map +0 -1
- package/lib/components/widgets/FileWidget.js.map +0 -1
- package/lib/components/widgets/HiddenWidget.js.map +0 -1
- package/lib/components/widgets/PasswordWidget.js.map +0 -1
- package/lib/components/widgets/RadioWidget.js.map +0 -1
- package/lib/components/widgets/RangeWidget.js.map +0 -1
- package/lib/components/widgets/SelectWidget.js.map +0 -1
- package/lib/components/widgets/TextWidget.js.map +0 -1
- package/lib/components/widgets/TextareaWidget.js.map +0 -1
- package/lib/components/widgets/TimeWidget.js.map +0 -1
- package/lib/components/widgets/URLWidget.js.map +0 -1
- package/lib/components/widgets/UpDownWidget.js.map +0 -1
- package/lib/components/widgets/index.js.map +0 -1
- package/lib/getDefaultRegistry.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/withTheme.js.map +0 -1
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function ColorWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ColorWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/ColorWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACnH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAK5B"}
|
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function DateTimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DateTimeWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/DateTimeWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAW5B"}
|
|
@@ -10,4 +10,3 @@ export default function DateTimeWidget(props) {
|
|
|
10
10
|
const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
|
|
11
11
|
return (_jsx(BaseInputTemplate, { type: 'datetime-local', ...props, value: utcToLocal(value), onChange: (value) => onChange(localToUTC(value)) }));
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=DateTimeWidget.js.map
|
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function DateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DateWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/DateWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAO5B"}
|
|
@@ -4,3 +4,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
5
5
|
*/
|
|
6
6
|
export default function EmailWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=EmailWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/EmailWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACnH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAK5B"}
|
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
*/
|
|
6
6
|
declare function FileWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default FileWidget;
|
|
8
|
+
//# sourceMappingURL=FileWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/FileWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,EAGf,UAAU,EACV,gBAAgB,EAGhB,WAAW,EACZ,MAAM,aAAa,CAAC;AA2IrB;;;GAGG;AACH,iBAAS,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACnG,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAyD5B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -14,8 +14,7 @@ function processFile(file) {
|
|
|
14
14
|
const reader = new window.FileReader();
|
|
15
15
|
reader.onerror = reject;
|
|
16
16
|
reader.onload = (event) => {
|
|
17
|
-
|
|
18
|
-
if (typeof ((_a = event.target) === null || _a === void 0 ? void 0 : _a.result) === 'string') {
|
|
17
|
+
if (typeof event.target?.result === 'string') {
|
|
19
18
|
resolve({
|
|
20
19
|
dataURL: addNameToDataURL(event.target.result, name),
|
|
21
20
|
name,
|
|
@@ -82,7 +81,7 @@ function extractFileInfo(dataURLs) {
|
|
|
82
81
|
},
|
|
83
82
|
];
|
|
84
83
|
}
|
|
85
|
-
catch
|
|
84
|
+
catch {
|
|
86
85
|
// Invalid dataURI, so just ignore it.
|
|
87
86
|
return acc;
|
|
88
87
|
}
|
|
@@ -105,7 +104,7 @@ function FileWidget(props) {
|
|
|
105
104
|
processFiles(event.target.files).then((filesInfoEvent) => {
|
|
106
105
|
const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL);
|
|
107
106
|
if (multiple) {
|
|
108
|
-
onChange(value.concat(newValue
|
|
107
|
+
onChange(value.concat(newValue));
|
|
109
108
|
}
|
|
110
109
|
else {
|
|
111
110
|
onChange(newValue[0]);
|
|
@@ -125,4 +124,3 @@ function FileWidget(props) {
|
|
|
125
124
|
return (_jsxs("div", { children: [_jsx(BaseInputTemplate, { ...props, disabled: disabled || readonly, type: 'file', required: value ? false : required, onChangeOverride: handleChange, value: '', accept: options.accept ? String(options.accept) : undefined }), _jsx(FilesInfo, { filesInfo: filesInfo, onRemove: rmFile, registry: registry, preview: options.filePreview, options: options })] }));
|
|
126
125
|
}
|
|
127
126
|
export default FileWidget;
|
|
128
|
-
//# sourceMappingURL=FileWidget.js.map
|
|
@@ -6,3 +6,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
6
6
|
*/
|
|
7
7
|
declare function HiddenWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, value, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default HiddenWidget;
|
|
9
|
+
//# sourceMappingURL=HiddenWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HiddenWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/HiddenWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzF;;;;GAIG;AACH,iBAAS,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACvG,EAAE,EACF,KAAK,GACN,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAEtB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -4,3 +4,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
5
5
|
*/
|
|
6
6
|
export default function PasswordWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=PasswordWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/PasswordWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAI5B"}
|
|
@@ -6,3 +6,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
6
6
|
*/
|
|
7
7
|
declare function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ options, value, required, disabled, readonly, autofocus, onBlur, onFocus, onChange, id, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default RadioWidget;
|
|
9
|
+
//# sourceMappingURL=RadioWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/RadioWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,iBAAS,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACtG,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAiB,EACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,EAAE,GACH,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAyDtB;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -8,9 +8,9 @@ import { ariaDescribedByIds, enumOptionsIsSelected, enumOptionsValueForIndex, op
|
|
|
8
8
|
*/
|
|
9
9
|
function RadioWidget({ options, value, required, disabled, readonly, autofocus = false, onBlur, onFocus, onChange, id, }) {
|
|
10
10
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
11
|
-
const handleBlur = useCallback(({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue)), [onBlur, id]);
|
|
12
|
-
const handleFocus = useCallback(({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue)), [onFocus, id]);
|
|
13
|
-
return (_jsx("div", { className: 'field-radio-group', id: id, children: Array.isArray(enumOptions) &&
|
|
11
|
+
const handleBlur = useCallback(({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue)), [onBlur, enumOptions, emptyValue, id]);
|
|
12
|
+
const handleFocus = useCallback(({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue)), [onFocus, enumOptions, emptyValue, id]);
|
|
13
|
+
return (_jsx("div", { className: 'field-radio-group', id: id, role: 'radiogroup', children: Array.isArray(enumOptions) &&
|
|
14
14
|
enumOptions.map((option, i) => {
|
|
15
15
|
const checked = enumOptionsIsSelected(option.value, value);
|
|
16
16
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
@@ -21,4 +21,3 @@ function RadioWidget({ options, value, required, disabled, readonly, autofocus =
|
|
|
21
21
|
}) }));
|
|
22
22
|
}
|
|
23
23
|
export default RadioWidget;
|
|
24
|
-
//# sourceMappingURL=RadioWidget.js.map
|
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function RangeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=RangeWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/RangeWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACnH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAc5B"}
|
|
@@ -8,4 +8,3 @@ export default function RangeWidget(props) {
|
|
|
8
8
|
const { value, registry: { templates: { BaseInputTemplate }, }, } = props;
|
|
9
9
|
return (_jsxs("div", { className: 'field-range-wrapper', children: [_jsx(BaseInputTemplate, { type: 'range', ...props }), _jsx("span", { className: 'range-view', children: value })] }));
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=RangeWidget.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `RatingWidget` component renders a star or heart rating input
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Configurable number of stars/hearts (1-5) with default of 5
|
|
6
|
+
* - Supports different shapes (star, heart)
|
|
7
|
+
* - Supports minimum and maximum values from schema
|
|
8
|
+
* - Handles required, disabled, and readonly states
|
|
9
|
+
* - Provides focus and blur event handling for accessibility
|
|
10
|
+
* - Uses Unicode characters for better visual representation
|
|
11
|
+
*
|
|
12
|
+
* @param props - The `WidgetProps` for this component
|
|
13
|
+
*/
|
|
14
|
+
export default function RatingWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, value, required, disabled, readonly, autofocus, onChange, onFocus, onBlur, schema, options, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=RatingWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/RatingWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,EACA,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAiGtB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
/** The `RatingWidget` component renders a star or heart rating input
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Configurable number of stars/hearts (1-5) with default of 5
|
|
7
|
+
* - Supports different shapes (star, heart)
|
|
8
|
+
* - Supports minimum and maximum values from schema
|
|
9
|
+
* - Handles required, disabled, and readonly states
|
|
10
|
+
* - Provides focus and blur event handling for accessibility
|
|
11
|
+
* - Uses Unicode characters for better visual representation
|
|
12
|
+
*
|
|
13
|
+
* @param props - The `WidgetProps` for this component
|
|
14
|
+
*/
|
|
15
|
+
export default function RatingWidget({ id, value, required, disabled, readonly, autofocus, onChange, onFocus, onBlur, schema, options, }) {
|
|
16
|
+
const { stars = 5, shape = 'star' } = options;
|
|
17
|
+
// Use schema.maximum if provided, otherwise use stars option (limited to 1-5)
|
|
18
|
+
const numStars = schema.maximum ? Math.min(schema.maximum, 5) : Math.min(Math.max(stars, 1), 5);
|
|
19
|
+
const min = schema.minimum || 0;
|
|
20
|
+
/** Handles clicking on a star to set the rating */
|
|
21
|
+
const handleStarClick = useCallback((starValue) => {
|
|
22
|
+
if (!disabled && !readonly) {
|
|
23
|
+
onChange(starValue);
|
|
24
|
+
}
|
|
25
|
+
}, [onChange, disabled, readonly]);
|
|
26
|
+
/** Handles focus events for accessibility */
|
|
27
|
+
const handleFocus = useCallback((event) => {
|
|
28
|
+
if (onFocus) {
|
|
29
|
+
// Get the star value from the data attribute
|
|
30
|
+
const starValue = Number(event.target.dataset.value);
|
|
31
|
+
onFocus(id, starValue);
|
|
32
|
+
}
|
|
33
|
+
}, [onFocus, id]);
|
|
34
|
+
/** Handles blur events for accessibility */
|
|
35
|
+
const handleBlur = useCallback((event) => {
|
|
36
|
+
if (onBlur) {
|
|
37
|
+
// Get the star value from the data attribute
|
|
38
|
+
const starValue = Number(event.target.dataset.value);
|
|
39
|
+
onBlur(id, starValue);
|
|
40
|
+
}
|
|
41
|
+
}, [onBlur, id]);
|
|
42
|
+
// Get the appropriate Unicode character based on shape option
|
|
43
|
+
const getSymbol = (isFilled) => {
|
|
44
|
+
if (shape === 'heart') {
|
|
45
|
+
return isFilled ? '♥' : '♡';
|
|
46
|
+
}
|
|
47
|
+
return isFilled ? '★' : '☆';
|
|
48
|
+
};
|
|
49
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: 'rating-widget', style: {
|
|
50
|
+
display: 'inline-flex',
|
|
51
|
+
fontSize: '1.5rem',
|
|
52
|
+
cursor: disabled || readonly ? 'default' : 'pointer',
|
|
53
|
+
}, children: [[...Array(numStars)].map((_, index) => {
|
|
54
|
+
const starValue = min + index;
|
|
55
|
+
const isFilled = starValue <= value;
|
|
56
|
+
return (_jsx("span", { onClick: () => handleStarClick(starValue), onFocus: handleFocus, onBlur: handleBlur, "data-value": starValue, tabIndex: disabled || readonly ? -1 : 0, role: 'radio', "aria-checked": starValue === value, "aria-label": `${starValue} ${shape === 'heart' ? 'heart' : 'star'}${starValue === 1 ? '' : 's'}`, style: {
|
|
57
|
+
color: isFilled ? '#FFD700' : '#ccc',
|
|
58
|
+
padding: '0 0.2rem',
|
|
59
|
+
transition: 'color 0.2s',
|
|
60
|
+
userSelect: 'none',
|
|
61
|
+
}, children: getSymbol(isFilled) }, index));
|
|
62
|
+
}), _jsx("input", { type: 'hidden', id: id, name: id, value: value || '', required: required, disabled: disabled || readonly, "aria-hidden": 'true' })] }) }));
|
|
63
|
+
}
|
|
@@ -6,3 +6,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
6
6
|
*/
|
|
7
7
|
declare function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ schema, id, options, value, required, disabled, readonly, multiple, autofocus, onChange, onBlur, onFocus, placeholder, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default SelectWidget;
|
|
9
|
+
//# sourceMappingURL=SelectWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/SelectWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,aAAa,CAAC;AAYrB;;;;GAIG;AACH,iBAAS,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACvG,MAAM,EACN,EAAE,EACF,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,SAAiB,EACjB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,GACZ,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA2DtB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -21,22 +21,21 @@ function SelectWidget({ schema, id, options, value, required, disabled, readonly
|
|
|
21
21
|
const handleFocus = useCallback((event) => {
|
|
22
22
|
const newValue = getValue(event, multiple);
|
|
23
23
|
return onFocus(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
|
|
24
|
-
}, [onFocus, id,
|
|
24
|
+
}, [onFocus, id, multiple, enumOptions, optEmptyVal]);
|
|
25
25
|
const handleBlur = useCallback((event) => {
|
|
26
26
|
const newValue = getValue(event, multiple);
|
|
27
27
|
return onBlur(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
|
|
28
|
-
}, [onBlur, id,
|
|
28
|
+
}, [onBlur, id, multiple, enumOptions, optEmptyVal]);
|
|
29
29
|
const handleChange = useCallback((event) => {
|
|
30
30
|
const newValue = getValue(event, multiple);
|
|
31
31
|
return onChange(enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
|
|
32
|
-
}, [onChange,
|
|
32
|
+
}, [onChange, multiple, enumOptions, optEmptyVal]);
|
|
33
33
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
34
34
|
const showPlaceholderOption = !multiple && schema.default === undefined;
|
|
35
|
-
return (_jsxs("select", { id: id, name: id, multiple: multiple, className: 'form-control', value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes, required: required, disabled: disabled || readonly, autoFocus: autofocus, onBlur: handleBlur, onFocus: handleFocus, onChange: handleChange, "aria-describedby": ariaDescribedByIds(id), children: [showPlaceholderOption && _jsx("option", { value: '', children: placeholder }), Array.isArray(enumOptions) &&
|
|
35
|
+
return (_jsxs("select", { id: id, name: id, multiple: multiple, role: 'combobox', className: 'form-control', value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes, required: required, disabled: disabled || readonly, autoFocus: autofocus, onBlur: handleBlur, onFocus: handleFocus, onChange: handleChange, "aria-describedby": ariaDescribedByIds(id), children: [showPlaceholderOption && _jsx("option", { value: '', children: placeholder }), Array.isArray(enumOptions) &&
|
|
36
36
|
enumOptions.map(({ value, label }, i) => {
|
|
37
37
|
const disabled = enumDisabled && enumDisabled.indexOf(value) !== -1;
|
|
38
38
|
return (_jsx("option", { value: String(i), disabled: disabled, children: label }, i));
|
|
39
39
|
})] }));
|
|
40
40
|
}
|
|
41
41
|
export default SelectWidget;
|
|
42
|
-
//# sourceMappingURL=SelectWidget.js.map
|
|
@@ -4,3 +4,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
5
5
|
*/
|
|
6
6
|
export default function TextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=TextWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/TextWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAK5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextareaWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/TextareaWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7G;;;GAGG;AACH,iBAAS,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACzG,EAAE,EACF,OAAY,EACZ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAiB,EACjB,QAAQ,EACR,MAAM,EACN,OAAO,GACR,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAkCtB;kBA9CQ,cAAc;;;;;;AAqDvB,eAAe,cAAc,CAAC"}
|
|
@@ -5,3 +5,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function TimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TimeWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/TimeWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAO5B"}
|
|
@@ -12,4 +12,3 @@ export default function TimeWidget(props) {
|
|
|
12
12
|
const handleChange = useCallback((value) => onChange(value ? `${value}:00` : undefined), [onChange]);
|
|
13
13
|
return _jsx(BaseInputTemplate, { type: 'time', ...props, onChange: handleChange });
|
|
14
14
|
}
|
|
15
|
-
//# sourceMappingURL=TimeWidget.js.map
|
|
@@ -4,3 +4,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
5
5
|
*/
|
|
6
6
|
export default function URLWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=URLWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"URLWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/URLWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACjH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAK5B"}
|
|
@@ -4,3 +4,4 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
5
5
|
*/
|
|
6
6
|
export default function UpDownWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=UpDownWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpDownWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/UpDownWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACpH,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAK5B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
declare function widgets<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): RegistryWidgetsType<T, S, F>;
|
|
3
3
|
export default widgets;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAuBjG,iBAAS,OAAO,CACd,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,KAC5B,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAuBhC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import AltDateWidget from './AltDateWidget';
|
|
2
|
-
import AltDateTimeWidget from './AltDateTimeWidget';
|
|
3
|
-
import CheckboxWidget from './CheckboxWidget';
|
|
4
|
-
import CheckboxesWidget from './CheckboxesWidget';
|
|
5
|
-
import ColorWidget from './ColorWidget';
|
|
6
|
-
import DateWidget from './DateWidget';
|
|
7
|
-
import DateTimeWidget from './DateTimeWidget';
|
|
8
|
-
import EmailWidget from './EmailWidget';
|
|
9
|
-
import FileWidget from './FileWidget';
|
|
10
|
-
import HiddenWidget from './HiddenWidget';
|
|
11
|
-
import PasswordWidget from './PasswordWidget';
|
|
12
|
-
import RadioWidget from './RadioWidget';
|
|
13
|
-
import RangeWidget from './RangeWidget';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
1
|
+
import AltDateWidget from './AltDateWidget.js';
|
|
2
|
+
import AltDateTimeWidget from './AltDateTimeWidget.js';
|
|
3
|
+
import CheckboxWidget from './CheckboxWidget.js';
|
|
4
|
+
import CheckboxesWidget from './CheckboxesWidget.js';
|
|
5
|
+
import ColorWidget from './ColorWidget.js';
|
|
6
|
+
import DateWidget from './DateWidget.js';
|
|
7
|
+
import DateTimeWidget from './DateTimeWidget.js';
|
|
8
|
+
import EmailWidget from './EmailWidget.js';
|
|
9
|
+
import FileWidget from './FileWidget.js';
|
|
10
|
+
import HiddenWidget from './HiddenWidget.js';
|
|
11
|
+
import PasswordWidget from './PasswordWidget.js';
|
|
12
|
+
import RadioWidget from './RadioWidget.js';
|
|
13
|
+
import RangeWidget from './RangeWidget.js';
|
|
14
|
+
import RatingWidget from './RatingWidget.js';
|
|
15
|
+
import SelectWidget from './SelectWidget.js';
|
|
16
|
+
import TextareaWidget from './TextareaWidget.js';
|
|
17
|
+
import TextWidget from './TextWidget.js';
|
|
18
|
+
import TimeWidget from './TimeWidget.js';
|
|
19
|
+
import URLWidget from './URLWidget.js';
|
|
20
|
+
import UpDownWidget from './UpDownWidget.js';
|
|
20
21
|
function widgets() {
|
|
21
22
|
return {
|
|
22
23
|
AltDateWidget,
|
|
@@ -32,6 +33,7 @@ function widgets() {
|
|
|
32
33
|
PasswordWidget,
|
|
33
34
|
RadioWidget,
|
|
34
35
|
RangeWidget,
|
|
36
|
+
RatingWidget,
|
|
35
37
|
SelectWidget,
|
|
36
38
|
TextWidget,
|
|
37
39
|
TextareaWidget,
|
|
@@ -41,4 +43,3 @@ function widgets() {
|
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
export default widgets;
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -4,3 +4,4 @@ import { FormContextType, Registry, RJSFSchema, StrictRJSFSchema } from '@rjsf/u
|
|
|
4
4
|
* rootSchema and validator. It will be added into the computed registry later in the Form.
|
|
5
5
|
*/
|
|
6
6
|
export default function getDefaultRegistry<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): Omit<Registry<T, S, F>, 'schemaUtils'>;
|
|
7
|
+
//# sourceMappingURL=getDefaultRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDefaultRegistry.d.ts","sourceRoot":"","sources":["../src/getDefaultRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAM/G;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,KAC5B,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,CAS1C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { englishStringTranslator } from '@rjsf/utils';
|
|
2
|
-
import fields from './components/fields';
|
|
3
|
-
import templates from './components/templates';
|
|
4
|
-
import widgets from './components/widgets';
|
|
2
|
+
import fields from './components/fields/index.js';
|
|
3
|
+
import templates from './components/templates/index.js';
|
|
4
|
+
import widgets from './components/widgets/index.js';
|
|
5
5
|
/** The default registry consists of all the fields, templates and widgets provided in the core implementation,
|
|
6
6
|
* plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a
|
|
7
7
|
* rootSchema and validator. It will be added into the computed registry later in the Form.
|
|
@@ -16,4 +16,3 @@ export default function getDefaultRegistry() {
|
|
|
16
16
|
translateString: englishStringTranslator,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=getDefaultRegistry.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import Form, { FormProps, FormState, IChangeEvent } from './components/Form';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export {
|
|
1
|
+
import Form, { FormProps, FormState, IChangeEvent } from './components/Form.js';
|
|
2
|
+
import RichDescription, { RichDescriptionProps } from './components/RichDescription.js';
|
|
3
|
+
import withTheme, { ThemeProps } from './withTheme.js';
|
|
4
|
+
import getDefaultRegistry from './getDefaultRegistry.js';
|
|
5
|
+
export type { FormProps, FormState, IChangeEvent, ThemeProps, RichDescriptionProps };
|
|
6
|
+
export { withTheme, getDefaultRegistry, RichDescription };
|
|
6
7
|
export default Form;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,eAAe,EAAE,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;AAErF,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC;AAC1D,eAAe,IAAI,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Form from './components/Form';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import Form from './components/Form.js';
|
|
2
|
+
import RichDescription from './components/RichDescription.js';
|
|
3
|
+
import withTheme from './withTheme.js';
|
|
4
|
+
import getDefaultRegistry from './getDefaultRegistry.js';
|
|
5
|
+
export { withTheme, getDefaultRegistry, RichDescription };
|
|
5
6
|
export default Form;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|