@nolwenture/formik-jsonschema-form 0.26.8 → 1.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/README.md +32 -13
- package/dist/cjs/Form/Form.js +49 -0
- package/dist/cjs/Form/FormRegistry.js +17 -0
- package/dist/cjs/Form/components/Clickable.js +18 -0
- package/dist/cjs/Form/components/ErrorMessage.js +32 -0
- package/dist/cjs/Form/components/FieldInfo.js +104 -0
- package/dist/cjs/Form/components/FieldInput.js +59 -0
- package/dist/cjs/Form/components/Form.js +54 -0
- package/dist/cjs/Form/components/Icon.js +7 -0
- package/dist/cjs/Form/components/RequiredIndicator.js +9 -0
- package/dist/cjs/Form/components/index.js +48 -0
- package/dist/cjs/{fields → Form/fields/AnyField}/AnyField.js +5 -4
- package/dist/cjs/Form/fields/AnyField/index.js +28 -0
- package/dist/cjs/Form/fields/AnyField/styledComponents.js +9 -0
- package/dist/cjs/{fields → Form/fields/ArrayField}/ArrayField.js +9 -11
- package/dist/cjs/Form/fields/ArrayField/index.js +28 -0
- package/dist/cjs/Form/fields/ArrayField/styledComponents.js +17 -0
- package/dist/cjs/{fields → Form/fields/BooleanField}/BooleanField.js +5 -4
- package/dist/cjs/Form/fields/BooleanField/index.js +28 -0
- package/dist/cjs/Form/fields/BooleanField/styledComponents.js +15 -0
- package/dist/cjs/Form/fields/DateField/DateField.js +17 -0
- package/dist/cjs/Form/fields/DateField/index.js +28 -0
- package/dist/cjs/Form/fields/DateField/styledComponents.js +9 -0
- package/dist/cjs/{fields → Form/fields/FileUploadField}/FileUploadField.js +7 -6
- package/dist/cjs/Form/fields/FileUploadField/FileUploadFieldInput.js +21 -0
- package/dist/cjs/Form/fields/FileUploadField/index.js +31 -0
- package/dist/cjs/Form/fields/FileUploadField/styledComponents.js +63 -0
- package/dist/cjs/{fields → Form/fields/MultipleChoiceField}/MultipleChoiceField.js +7 -7
- package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +39 -0
- package/dist/cjs/Form/fields/MultipleChoiceField/index.js +31 -0
- package/dist/cjs/Form/fields/MultipleChoiceField/styledComponents.js +17 -0
- package/dist/cjs/{fields → Form/fields/NullField}/NullField.js +2 -2
- package/dist/cjs/Form/fields/NullField/index.js +27 -0
- package/dist/cjs/Form/fields/NumberField/NumberField.js +16 -0
- package/dist/cjs/Form/fields/NumberField/index.js +28 -0
- package/dist/cjs/Form/fields/NumberField/styledComponents.js +8 -0
- package/dist/cjs/{fields → Form/fields/ObjectField}/ObjectField.js +39 -16
- package/dist/cjs/Form/fields/ObjectField/ObjectFieldSection.js +16 -0
- package/dist/cjs/Form/fields/ObjectField/index.js +31 -0
- package/dist/cjs/Form/fields/ObjectField/styledComponents.js +37 -0
- package/dist/cjs/Form/fields/RadioField/RadioField.js +16 -0
- package/dist/cjs/Form/fields/RadioField/RadioFieldInput.js +11 -0
- package/dist/cjs/Form/fields/RadioField/index.js +31 -0
- package/dist/cjs/Form/fields/RadioField/styledComponents.js +27 -0
- package/dist/cjs/{fields → Form/fields/SchemaField}/SchemaField.js +9 -10
- package/dist/cjs/Form/fields/SchemaField/index.js +27 -0
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +17 -0
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +27 -0
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/index.js +31 -0
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/styledComponents.js +68 -0
- package/dist/cjs/{fields → Form/fields/SearchableSelectField}/SearchableSelectField.js +14 -8
- package/dist/cjs/Form/fields/SearchableSelectField/index.js +30 -0
- package/dist/cjs/Form/fields/SearchableSelectField/styledComponents.js +50 -0
- package/dist/cjs/Form/fields/SearchableSelectField/types.js +2 -0
- package/dist/cjs/Form/fields/StringField/StringField.js +39 -0
- package/dist/cjs/Form/fields/StringField/index.js +27 -0
- package/dist/cjs/Form/fields/StringField/styledComponents.js +9 -0
- package/dist/cjs/{fields → Form/fields/TextAreaField}/TextAreaField.js +6 -5
- package/dist/cjs/Form/fields/TextAreaField/index.js +28 -0
- package/dist/cjs/Form/fields/TextAreaField/styledComponents.js +17 -0
- package/dist/cjs/{fields → Form/fields/ToggleField}/ToggleField.js +6 -5
- package/dist/cjs/Form/fields/ToggleField/ToggleFieldInput.js +11 -0
- package/dist/cjs/Form/fields/ToggleField/index.js +31 -0
- package/dist/cjs/Form/fields/ToggleField/styledComponents.js +53 -0
- package/dist/cjs/Form/fields/index.js +81 -0
- package/dist/cjs/{hooks → Form/hooks}/index.js +0 -1
- package/dist/cjs/{hooks → Form/hooks}/useSetDefault.js +2 -2
- package/dist/cjs/Form/index.js +29 -0
- package/dist/cjs/Form/styles/common.js +211 -0
- package/dist/cjs/{templates → Form/templates/ArrayFieldTemplate}/ArrayFieldTemplate.js +7 -9
- package/dist/cjs/Form/templates/ArrayFieldTemplate/index.js +28 -0
- package/dist/cjs/Form/templates/ArrayFieldTemplate/styledComponents.js +25 -0
- package/dist/cjs/Form/templates/ArrayFieldTemplate/types.js +2 -0
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +34 -0
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/index.js +28 -0
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +46 -0
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/types.js +2 -0
- package/dist/cjs/{templates → Form/templates/FieldTemplate}/FieldTemplate.js +5 -6
- package/dist/cjs/Form/templates/FieldTemplate/index.js +27 -0
- package/dist/cjs/Form/templates/FieldTemplate/types.js +2 -0
- package/dist/cjs/{templates → Form/templates/ObjectFieldTemplate}/ObjectFieldTemplate.js +7 -7
- package/dist/cjs/Form/templates/ObjectFieldTemplate/index.js +28 -0
- package/dist/cjs/Form/templates/ObjectFieldTemplate/styledComponents.js +35 -0
- package/dist/cjs/Form/templates/ObjectFieldTemplate/types.js +2 -0
- package/dist/cjs/Form/templates/index.js +45 -0
- package/dist/cjs/Form/types/FormRegistryContext.js +2 -0
- package/dist/cjs/{pdfTemplates → Form/types}/index.js +1 -4
- package/dist/cjs/FormView/FormView.js +42 -0
- package/dist/cjs/FormView/FormViewRegistry.js +17 -0
- package/dist/cjs/FormView/components/Field.js +13 -0
- package/dist/cjs/FormView/components/Form.js +5 -0
- package/dist/cjs/FormView/components/Icon.js +7 -0
- package/dist/cjs/FormView/components/index.js +48 -0
- package/dist/cjs/FormView/components/old_styledComponents.js +65 -0
- package/dist/cjs/{pdfFields → FormView/fields}/AnyField.js +3 -3
- package/dist/cjs/{pdfFields → FormView/fields}/ArrayField.js +3 -5
- package/dist/cjs/{pdfFields → FormView/fields}/BooleanField.js +5 -6
- package/dist/cjs/{pdfFields → FormView/fields}/EJSField.js +4 -6
- package/dist/cjs/FormView/fields/FileUploadField.js +7 -0
- package/dist/cjs/{pdfFields → FormView/fields}/MultipleChoiceField.js +7 -9
- package/dist/cjs/{pdfFields → FormView/fields}/NullField.js +2 -2
- package/dist/cjs/{pdfFields → FormView/fields/ObjectField}/ObjectField.js +21 -13
- package/dist/cjs/FormView/fields/ObjectField/ObjectFieldSection.js +11 -0
- package/dist/cjs/FormView/fields/ObjectField/index.js +31 -0
- package/dist/cjs/FormView/fields/ObjectField/styledComponents.js +6 -0
- package/dist/cjs/{pdfFields → FormView/fields}/SchemaField.js +9 -10
- package/dist/cjs/FormView/fields/SearchableMultiTagSelectField.js +14 -0
- package/dist/cjs/{pdfFields → FormView/fields}/SearchableSelectField.js +3 -3
- package/dist/cjs/{pdfFields → FormView/fields}/StringField.js +4 -6
- package/dist/cjs/{pdfFields → FormView/fields}/TextAreaField.js +3 -5
- package/dist/cjs/FormView/fields/index.js +70 -0
- package/dist/cjs/{templates → FormView}/index.js +3 -4
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +20 -0
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/index.js +28 -0
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/styledComponents.js +15 -0
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/types.js +2 -0
- package/dist/cjs/FormView/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +5 -0
- package/dist/cjs/FormView/templates/CollapsibleObjectFieldTemplate/index.js +27 -0
- package/dist/cjs/FormView/templates/FieldTemplate/FieldTemplate.js +18 -0
- package/dist/cjs/FormView/templates/FieldTemplate/index.js +27 -0
- package/dist/cjs/FormView/templates/FieldTemplate/types.js +2 -0
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +20 -0
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/index.js +28 -0
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +18 -0
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/types.js +2 -0
- package/dist/cjs/FormView/templates/index.js +45 -0
- package/dist/cjs/FormView/types/FormViewRegistryContext.js +2 -0
- package/dist/cjs/common/types/Field.js +2 -0
- package/dist/cjs/common/types/FieldInfo.js +2 -0
- package/dist/cjs/common/types/Form.js +2 -0
- package/dist/cjs/common/types/Schemas.js +2 -0
- package/dist/cjs/{sampleData → common/types}/index.js +3 -8
- package/dist/cjs/index.js +3 -9
- package/dist/cjs/utils/extractUiSchema.js +22 -0
- package/dist/cjs/utils/getEnums.js +10 -4
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/orderByUiSchema.js +3 -2
- package/dist/esm/{Form.js → Form/Form.js} +14 -18
- package/dist/esm/Form/FormRegistry.js +11 -0
- package/dist/esm/Form/components/Clickable.js +14 -0
- package/dist/esm/Form/components/ErrorMessage.js +3 -0
- package/dist/esm/Form/components/FieldInfo.js +100 -0
- package/dist/esm/Form/components/FieldInput.js +33 -0
- package/dist/esm/Form/components/Form.js +25 -0
- package/dist/esm/Form/components/Icon.js +4 -0
- package/dist/esm/Form/components/RequiredIndicator.js +6 -0
- package/dist/esm/Form/components/index.js +22 -0
- package/dist/esm/{fields → Form/fields/AnyField}/AnyField.js +5 -4
- package/dist/esm/Form/fields/AnyField/index.js +2 -0
- package/dist/esm/Form/fields/AnyField/styledComponents.js +6 -0
- package/dist/esm/{fields → Form/fields/ArrayField}/ArrayField.js +8 -10
- package/dist/esm/Form/fields/ArrayField/index.js +2 -0
- package/dist/esm/Form/fields/ArrayField/styledComponents.js +11 -0
- package/dist/esm/{fields → Form/fields/BooleanField}/BooleanField.js +5 -4
- package/dist/esm/Form/fields/BooleanField/index.js +2 -0
- package/dist/esm/Form/fields/BooleanField/styledComponents.js +12 -0
- package/dist/esm/Form/fields/DateField/DateField.js +13 -0
- package/dist/esm/Form/fields/DateField/index.js +2 -0
- package/dist/esm/Form/fields/DateField/styledComponents.js +6 -0
- package/dist/esm/{fields → Form/fields/FileUploadField}/FileUploadField.js +8 -7
- package/dist/esm/Form/fields/FileUploadField/FileUploadFieldInput.js +17 -0
- package/dist/esm/Form/fields/FileUploadField/index.js +5 -0
- package/dist/esm/Form/fields/FileUploadField/styledComponents.js +57 -0
- package/dist/esm/{fields → Form/fields/MultipleChoiceField}/MultipleChoiceField.js +6 -6
- package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +35 -0
- package/dist/esm/Form/fields/MultipleChoiceField/index.js +5 -0
- package/dist/esm/Form/fields/MultipleChoiceField/styledComponents.js +11 -0
- package/dist/esm/{fields → Form/fields/NullField}/NullField.js +1 -1
- package/dist/esm/Form/fields/NullField/index.js +1 -0
- package/dist/esm/Form/fields/NumberField/NumberField.js +12 -0
- package/dist/esm/Form/fields/NumberField/index.js +2 -0
- package/dist/esm/Form/fields/NumberField/styledComponents.js +5 -0
- package/dist/esm/{fields → Form/fields/ObjectField}/ObjectField.js +36 -13
- package/dist/esm/Form/fields/ObjectField/ObjectFieldSection.js +12 -0
- package/dist/esm/Form/fields/ObjectField/index.js +5 -0
- package/dist/esm/Form/fields/ObjectField/styledComponents.js +34 -0
- package/dist/esm/Form/fields/RadioField/RadioField.js +12 -0
- package/dist/esm/Form/fields/RadioField/RadioFieldInput.js +7 -0
- package/dist/esm/Form/fields/RadioField/index.js +5 -0
- package/dist/esm/Form/fields/RadioField/styledComponents.js +24 -0
- package/dist/esm/{fields → Form/fields/SchemaField}/SchemaField.js +9 -10
- package/dist/esm/Form/fields/SchemaField/index.js +1 -0
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +13 -0
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +23 -0
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/index.js +5 -0
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/styledComponents.js +65 -0
- package/dist/esm/{fields → Form/fields/SearchableSelectField}/SearchableSelectField.js +14 -8
- package/dist/esm/Form/fields/SearchableSelectField/index.js +4 -0
- package/dist/esm/Form/fields/SearchableSelectField/styledComponents.js +47 -0
- package/dist/esm/Form/fields/StringField/StringField.js +35 -0
- package/dist/esm/Form/fields/StringField/index.js +1 -0
- package/dist/esm/Form/fields/StringField/styledComponents.js +6 -0
- package/dist/esm/Form/fields/TextAreaField/TextAreaField.js +12 -0
- package/dist/esm/Form/fields/TextAreaField/index.js +2 -0
- package/dist/esm/Form/fields/TextAreaField/styledComponents.js +11 -0
- package/dist/esm/Form/fields/ToggleField/ToggleField.js +12 -0
- package/dist/esm/Form/fields/ToggleField/ToggleFieldInput.js +7 -0
- package/dist/esm/Form/fields/ToggleField/index.js +5 -0
- package/dist/esm/Form/fields/ToggleField/styledComponents.js +50 -0
- package/dist/esm/Form/fields/index.js +55 -0
- package/dist/esm/Form/hooks/index.js +1 -0
- package/dist/esm/{hooks → Form/hooks}/useSetDefault.js +1 -1
- package/dist/esm/Form/index.js +10 -0
- package/dist/esm/Form/styles/common.js +208 -0
- package/dist/esm/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +32 -0
- package/dist/esm/Form/templates/ArrayFieldTemplate/index.js +2 -0
- package/dist/esm/Form/templates/ArrayFieldTemplate/styledComponents.js +21 -0
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +30 -0
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/index.js +2 -0
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +42 -0
- package/dist/esm/{templates → Form/templates/FieldTemplate}/FieldTemplate.js +6 -7
- package/dist/esm/Form/templates/FieldTemplate/index.js +1 -0
- package/dist/esm/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +28 -0
- package/dist/esm/Form/templates/ObjectFieldTemplate/index.js +2 -0
- package/dist/esm/Form/templates/ObjectFieldTemplate/styledComponents.js +31 -0
- package/dist/esm/Form/templates/index.js +19 -0
- package/dist/esm/Form/types/index.js +1 -0
- package/dist/esm/{FormPdf.js → FormView/FormView.js} +7 -17
- package/dist/esm/FormView/FormViewRegistry.js +11 -0
- package/dist/esm/FormView/components/Field.js +10 -0
- package/dist/esm/FormView/components/Form.js +2 -0
- package/dist/esm/FormView/components/Icon.js +4 -0
- package/dist/esm/FormView/components/index.js +19 -0
- package/dist/esm/FormView/components/old_styledComponents.js +57 -0
- package/dist/esm/{pdfFields → FormView/fields}/AnyField.js +2 -2
- package/dist/esm/{pdfFields → FormView/fields}/ArrayField.js +3 -5
- package/dist/esm/{pdfFields → FormView/fields}/BooleanField.js +6 -7
- package/dist/esm/{pdfFields → FormView/fields}/EJSField.js +4 -6
- package/dist/esm/FormView/fields/FileUploadField.js +3 -0
- package/dist/esm/{pdfFields → FormView/fields}/MultipleChoiceField.js +5 -7
- package/dist/esm/{pdfFields → FormView/fields}/NullField.js +2 -2
- package/dist/esm/FormView/fields/ObjectField/ObjectField.js +53 -0
- package/dist/esm/FormView/fields/ObjectField/ObjectFieldSection.js +7 -0
- package/dist/esm/FormView/fields/ObjectField/index.js +5 -0
- package/dist/esm/FormView/fields/ObjectField/styledComponents.js +3 -0
- package/dist/esm/{pdfFields → FormView/fields}/SchemaField.js +10 -11
- package/dist/esm/{pdfFields/SearchMultiTagSelectField.js → FormView/fields/SearchableMultiTagSelectField.js} +4 -6
- package/dist/esm/{pdfFields → FormView/fields}/SearchableSelectField.js +3 -3
- package/dist/esm/{pdfFields → FormView/fields}/StringField.js +4 -6
- package/dist/esm/{pdfFields → FormView/fields}/TextAreaField.js +3 -5
- package/dist/esm/FormView/fields/index.js +44 -0
- package/dist/esm/FormView/index.js +3 -0
- package/dist/esm/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +16 -0
- package/dist/esm/FormView/templates/ArrayFieldTemplate/index.js +2 -0
- package/dist/esm/FormView/templates/ArrayFieldTemplate/styledComponents.js +11 -0
- package/dist/esm/FormView/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +2 -0
- package/dist/esm/FormView/templates/CollapsibleObjectFieldTemplate/index.js +1 -0
- package/dist/esm/FormView/templates/FieldTemplate/FieldTemplate.js +14 -0
- package/dist/esm/FormView/templates/FieldTemplate/index.js +1 -0
- package/dist/esm/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +16 -0
- package/dist/esm/FormView/templates/ObjectFieldTemplate/index.js +2 -0
- package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +11 -0
- package/dist/esm/FormView/templates/index.js +19 -0
- package/dist/esm/common/types/Schemas.js +1 -0
- package/dist/esm/common/types/index.js +3 -0
- package/dist/esm/index.js +2 -8
- package/dist/esm/utils/extractUiSchema.js +18 -0
- package/dist/esm/utils/getEnums.js +9 -3
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/orderByUiSchema.js +3 -2
- package/dist/types/Form/Form.d.ts +2 -0
- package/dist/types/Form/FormRegistry.d.ts +3 -0
- package/dist/types/Form/components/Clickable.d.ts +14 -0
- package/dist/types/Form/components/ErrorMessage.d.ts +6 -0
- package/dist/types/Form/components/FieldInfo.d.ts +8 -0
- package/dist/types/Form/components/FieldInput.d.ts +9 -0
- package/dist/types/Form/components/Form.d.ts +5 -0
- package/dist/types/Form/components/Icon.d.ts +1 -0
- package/dist/types/Form/components/RequiredIndicator.d.ts +1 -0
- package/dist/types/Form/components/index.d.ts +210 -0
- package/dist/types/Form/fields/AnyField/AnyField.d.ts +2 -0
- package/dist/types/Form/fields/AnyField/index.d.ts +2 -0
- package/dist/types/Form/fields/AnyField/styledComponents.d.ts +1 -0
- package/dist/types/Form/fields/ArrayField/ArrayField.d.ts +2 -0
- package/dist/types/Form/fields/ArrayField/index.d.ts +2 -0
- package/dist/types/Form/fields/ArrayField/styledComponents.d.ts +21 -0
- package/dist/types/Form/fields/BooleanField/BooleanField.d.ts +2 -0
- package/dist/types/Form/fields/BooleanField/index.d.ts +2 -0
- package/dist/types/Form/fields/BooleanField/styledComponents.d.ts +1 -0
- package/dist/types/Form/fields/DateField/DateField.d.ts +2 -0
- package/dist/types/Form/fields/DateField/index.d.ts +2 -0
- package/dist/types/Form/fields/DateField/styledComponents.d.ts +1 -0
- package/dist/types/Form/fields/FileUploadField/FileUploadField.d.ts +2 -0
- package/dist/types/Form/fields/FileUploadField/FileUploadFieldInput.d.ts +25 -0
- package/dist/types/Form/fields/FileUploadField/index.d.ts +17 -0
- package/dist/types/Form/fields/FileUploadField/styledComponents.d.ts +11 -0
- package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceField.d.ts +2 -0
- package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.d.ts +17 -0
- package/dist/types/Form/fields/MultipleChoiceField/index.d.ts +22 -0
- package/dist/types/Form/fields/MultipleChoiceField/styledComponents.d.ts +16 -0
- package/dist/types/Form/fields/NullField/NullField.d.ts +2 -0
- package/dist/types/Form/fields/NullField/index.d.ts +1 -0
- package/dist/types/Form/fields/NumberField/NumberField.d.ts +2 -0
- package/dist/types/Form/fields/NumberField/index.d.ts +2 -0
- package/dist/types/Form/fields/NumberField/styledComponents.d.ts +1 -0
- package/dist/types/Form/fields/ObjectField/ObjectField.d.ts +2 -0
- package/dist/types/Form/fields/ObjectField/ObjectFieldSection.d.ts +3 -0
- package/dist/types/Form/fields/ObjectField/index.d.ts +27 -0
- package/dist/types/Form/fields/ObjectField/styledComponents.d.ts +21 -0
- package/dist/types/Form/fields/ObjectField/types.d.ts +17 -0
- package/dist/types/Form/fields/RadioField/RadioField.d.ts +2 -0
- package/dist/types/Form/fields/RadioField/RadioFieldInput.d.ts +11 -0
- package/dist/types/Form/fields/RadioField/index.d.ts +20 -0
- package/dist/types/Form/fields/RadioField/styledComponents.d.ts +14 -0
- package/dist/types/Form/fields/SchemaField/SchemaField.d.ts +2 -0
- package/dist/types/Form/fields/SchemaField/index.d.ts +1 -0
- package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.d.ts +2 -0
- package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.d.ts +9 -0
- package/dist/types/Form/fields/SearchableMultiTagSelectField/index.d.ts +19 -0
- package/dist/types/Form/fields/SearchableMultiTagSelectField/styledComponents.d.ts +13 -0
- package/dist/types/Form/fields/SearchableSelectField/SearchableSelectField.d.ts +2 -0
- package/dist/types/Form/fields/SearchableSelectField/index.d.ts +2 -0
- package/dist/types/Form/fields/SearchableSelectField/styledComponents.d.ts +22 -0
- package/dist/types/Form/fields/SearchableSelectField/types.d.ts +25 -0
- package/dist/types/Form/fields/StringField/StringField.d.ts +2 -0
- package/dist/types/Form/fields/StringField/index.d.ts +1 -0
- package/dist/types/Form/fields/StringField/styledComponents.d.ts +1 -0
- package/dist/types/Form/fields/TextAreaField/TextAreaField.d.ts +2 -0
- package/dist/types/Form/fields/TextAreaField/index.d.ts +2 -0
- package/dist/types/Form/fields/TextAreaField/styledComponents.d.ts +5 -0
- package/dist/types/Form/fields/ToggleField/ToggleField.d.ts +2 -0
- package/dist/types/Form/fields/ToggleField/ToggleFieldInput.d.ts +6 -0
- package/dist/types/Form/fields/ToggleField/index.d.ts +13 -0
- package/dist/types/Form/fields/ToggleField/styledComponents.d.ts +7 -0
- package/dist/types/Form/fields/index.d.ts +164 -0
- package/dist/types/Form/hooks/index.d.ts +1 -0
- package/dist/types/{hooks → Form/hooks}/useSetDefault.d.ts +1 -1
- package/dist/types/Form/index.d.ts +11 -0
- package/dist/types/Form/styles/common.d.ts +6 -0
- package/dist/types/{pdfTemplates → Form/templates/ArrayFieldTemplate}/ArrayFieldTemplate.d.ts +1 -1
- package/dist/types/Form/templates/ArrayFieldTemplate/index.d.ts +2 -0
- package/dist/types/Form/templates/ArrayFieldTemplate/styledComponents.d.ts +28 -0
- package/dist/types/Form/templates/ArrayFieldTemplate/types.d.ts +11 -0
- package/dist/types/{pdfTemplates → Form/templates/CollapsibleObjectFieldTemplate}/CollapsibleObjectFieldTemplate.d.ts +1 -1
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/index.d.ts +2 -0
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.d.ts +29 -0
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/types.d.ts +9 -0
- package/dist/types/{pdfTemplates → Form/templates/FieldTemplate}/FieldTemplate.d.ts +1 -1
- package/dist/types/Form/templates/FieldTemplate/index.d.ts +1 -0
- package/dist/types/Form/templates/FieldTemplate/types.d.ts +11 -0
- package/dist/types/{pdfTemplates → Form/templates/ObjectFieldTemplate}/ObjectFieldTemplate.d.ts +1 -1
- package/dist/types/Form/templates/ObjectFieldTemplate/index.d.ts +2 -0
- package/dist/types/Form/templates/ObjectFieldTemplate/styledComponents.d.ts +25 -0
- package/dist/types/Form/templates/ObjectFieldTemplate/types.d.ts +8 -0
- package/dist/types/Form/templates/index.d.ts +52 -0
- package/dist/types/Form/types/FormRegistryContext.d.ts +20 -0
- package/dist/types/Form/types/index.d.ts +1 -0
- package/dist/types/FormView/FormView.d.ts +4 -0
- package/dist/types/FormView/FormViewRegistry.d.ts +3 -0
- package/dist/types/FormView/components/Field.d.ts +3 -0
- package/dist/types/FormView/components/Form.d.ts +1 -0
- package/dist/types/FormView/components/Icon.d.ts +1 -0
- package/dist/types/FormView/components/index.d.ts +53 -0
- package/dist/types/FormView/components/old_styledComponents.d.ts +32 -0
- package/dist/types/FormView/fields/AnyField.d.ts +2 -0
- package/dist/types/FormView/fields/ArrayField.d.ts +2 -0
- package/dist/types/FormView/fields/BooleanField.d.ts +2 -0
- package/dist/types/FormView/fields/DateField.d.ts +2 -0
- package/dist/types/FormView/fields/EJSField.d.ts +2 -0
- package/dist/types/FormView/fields/FileUploadField.d.ts +2 -0
- package/dist/types/FormView/fields/MultipleChoiceField.d.ts +2 -0
- package/dist/types/FormView/fields/NullField.d.ts +2 -0
- package/dist/types/FormView/fields/NumberField.d.ts +2 -0
- package/dist/types/FormView/fields/ObjectField/ObjectField.d.ts +2 -0
- package/dist/types/FormView/fields/ObjectField/ObjectFieldSection.d.ts +7 -0
- package/dist/types/FormView/fields/ObjectField/index.d.ts +8 -0
- package/dist/types/FormView/fields/ObjectField/styledComponents.d.ts +2 -0
- package/dist/types/FormView/fields/RadioField.d.ts +2 -0
- package/dist/types/FormView/fields/SchemaField.d.ts +2 -0
- package/dist/types/FormView/fields/SearchableMultiTagSelectField.d.ts +2 -0
- package/dist/types/FormView/fields/SearchableSelectField.d.ts +2 -0
- package/dist/types/FormView/fields/StringField.d.ts +2 -0
- package/dist/types/FormView/fields/TextAreaField.d.ts +2 -0
- package/dist/types/FormView/fields/ToggleField.d.ts +2 -0
- package/dist/types/FormView/fields/index.d.ts +12 -0
- package/dist/types/FormView/index.d.ts +3 -0
- package/dist/types/{templates → FormView/templates/ArrayFieldTemplate}/ArrayFieldTemplate.d.ts +1 -1
- package/dist/types/FormView/templates/ArrayFieldTemplate/index.d.ts +2 -0
- package/dist/types/FormView/templates/ArrayFieldTemplate/styledComponents.d.ts +10 -0
- package/dist/types/FormView/templates/ArrayFieldTemplate/types.d.ts +11 -0
- package/dist/types/FormView/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.d.ts +1 -0
- package/dist/types/FormView/templates/CollapsibleObjectFieldTemplate/index.d.ts +1 -0
- package/dist/types/{templates → FormView/templates/FieldTemplate}/FieldTemplate.d.ts +1 -1
- package/dist/types/FormView/templates/FieldTemplate/index.d.ts +1 -0
- package/dist/types/FormView/templates/FieldTemplate/types.d.ts +11 -0
- package/dist/types/{templates → FormView/templates/ObjectFieldTemplate}/ObjectFieldTemplate.d.ts +1 -1
- package/dist/types/FormView/templates/ObjectFieldTemplate/index.d.ts +2 -0
- package/dist/types/FormView/templates/ObjectFieldTemplate/styledComponents.d.ts +10 -0
- package/dist/types/FormView/templates/ObjectFieldTemplate/types.d.ts +8 -0
- package/dist/types/FormView/templates/index.d.ts +21 -0
- package/dist/types/FormView/types/FormViewRegistryContext.d.ts +19 -0
- package/dist/types/{FileUploadContext.d.ts → common/FileUploadContext.d.ts} +2 -2
- package/dist/types/common/types/Field.d.ts +20 -0
- package/dist/types/common/types/FieldInfo.d.ts +11 -0
- package/dist/types/common/types/Form.d.ts +28 -0
- package/dist/types/common/types/Schemas.d.ts +88 -0
- package/dist/types/common/types/index.d.ts +3 -0
- package/dist/types/index.d.ts +1 -8
- package/dist/types/utils/createValidationSchema.d.ts +10 -1
- package/dist/types/utils/extractUiSchema.d.ts +9 -0
- package/dist/types/utils/getEnums.d.ts +6 -2
- package/dist/types/utils/getTitleAndDescription.d.ts +3 -3
- package/dist/types/utils/getTypes.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/orderByUiSchema.d.ts +2 -1
- package/dist/types/utils/resolveSchema.d.ts +1 -1
- package/dist/types/utils/solveReferences.d.ts +2 -2
- package/package.json +22 -10
- package/dist/cjs/Form.js +0 -79
- package/dist/cjs/Form.stories.js +0 -230
- package/dist/cjs/Form.test.js +0 -13
- package/dist/cjs/FormEditor.js +0 -47
- package/dist/cjs/FormEditor.stories.js +0 -12
- package/dist/cjs/FormPdf.js +0 -78
- package/dist/cjs/FormPdf.stories.js +0 -134
- package/dist/cjs/FormPdf.test.js +0 -15
- package/dist/cjs/fields/DateField.js +0 -15
- package/dist/cjs/fields/RadioField.js +0 -15
- package/dist/cjs/fields/SearchMultiTagSelectField.js +0 -18
- package/dist/cjs/fields/StringField.js +0 -38
- package/dist/cjs/fields/index.js +0 -32
- package/dist/cjs/fields/stories/AnyField.stories.js +0 -73
- package/dist/cjs/fields/stories/ArrayField.stories.js +0 -218
- package/dist/cjs/fields/stories/BooleanField.stories.js +0 -30
- package/dist/cjs/fields/stories/DateField.stories.js +0 -28
- package/dist/cjs/fields/stories/FileUploadField.stories.js +0 -63
- package/dist/cjs/fields/stories/MultipleChoiceField.stories.js +0 -80
- package/dist/cjs/fields/stories/NullField.stories.js +0 -32
- package/dist/cjs/fields/stories/NumberField.stories.js +0 -27
- package/dist/cjs/fields/stories/ObjectField.stories.js +0 -88
- package/dist/cjs/fields/stories/RadioField.stories.js +0 -36
- package/dist/cjs/fields/stories/SchemaField.stories.js +0 -95
- package/dist/cjs/fields/stories/SearchMultiTagSelectField.stories.js +0 -52
- package/dist/cjs/fields/stories/StringField.stories.js +0 -69
- package/dist/cjs/fields/stories/TextAreaField.stories.js +0 -28
- package/dist/cjs/fields/stories/ToggleField.stories.js +0 -28
- package/dist/cjs/formEditorSchemas.js +0 -195
- package/dist/cjs/hooks/__tests__/useExtractUiSchema.test.js +0 -47
- package/dist/cjs/hooks/__tests__/useSetDefault.test.js +0 -67
- package/dist/cjs/hooks/useExtractUiSchema.js +0 -27
- package/dist/cjs/pdfFields/NumberField.js +0 -12
- package/dist/cjs/pdfFields/SearchMultiTagSelectField.js +0 -16
- package/dist/cjs/pdfFields/index.js +0 -32
- package/dist/cjs/pdfFields/types.js +0 -13
- package/dist/cjs/pdfTemplates/ArrayFieldTemplate.js +0 -20
- package/dist/cjs/pdfTemplates/CollapsibleObjectFieldTemplate.js +0 -24
- package/dist/cjs/pdfTemplates/FieldTemplate.js +0 -19
- package/dist/cjs/pdfTemplates/ObjectFieldTemplate.js +0 -22
- package/dist/cjs/sampleData/ageFieldDefinition.js +0 -8
- package/dist/cjs/sampleData/collapsibleSchema.js +0 -30
- package/dist/cjs/sampleData/completeSchema.js +0 -351
- package/dist/cjs/sampleData/conditionsSchema.js +0 -85
- package/dist/cjs/sampleData/ejsSchema.js +0 -28
- package/dist/cjs/sampleData/fileUpload.js +0 -43
- package/dist/cjs/sampleData/generatedSchema.js +0 -22
- package/dist/cjs/sampleData/multipleChoiceSchema.js +0 -134
- package/dist/cjs/sampleData/pdfProExampleSchema.js +0 -188
- package/dist/cjs/sampleData/refDefSchema.js +0 -301
- package/dist/cjs/sampleData/requiredInputSchema.js +0 -70
- package/dist/cjs/sampleData/simpleData.js +0 -20
- package/dist/cjs/setupTests.js +0 -7
- package/dist/cjs/styledComponents.js +0 -640
- package/dist/cjs/templates/CollapsibleObjectFieldTemplate.js +0 -34
- package/dist/cjs/utils/__tests/createInitialValues.test.js +0 -106
- package/dist/cjs/utils/__tests/createValidationSchema.test.js +0 -946
- package/dist/cjs/utils/__tests/deepOverlap.test.js +0 -43
- package/dist/cjs/utils/__tests/getEnums.test.js +0 -61
- package/dist/cjs/utils/__tests/getTitleAndDescription.test.js +0 -55
- package/dist/cjs/utils/__tests/getTypes.test.js +0 -64
- package/dist/cjs/utils/__tests/hasReferences.test.js +0 -102
- package/dist/cjs/utils/__tests/mergeSchemas.test.js +0 -42
- package/dist/cjs/utils/__tests/orderByUiSchema.test.js +0 -65
- package/dist/cjs/utils/__tests/resolveSchema.test.js +0 -118
- package/dist/cjs/utils/__tests/solveReferences.test.js +0 -58
- package/dist/cjs/utils/__tests/testSchemas.js +0 -102
- package/dist/cjs/utils/hasReferences.js +0 -15
- package/dist/esm/Form.stories.js +0 -222
- package/dist/esm/Form.test.js +0 -11
- package/dist/esm/FormEditor.js +0 -20
- package/dist/esm/FormEditor.stories.js +0 -9
- package/dist/esm/FormPdf.stories.js +0 -130
- package/dist/esm/FormPdf.test.js +0 -13
- package/dist/esm/fields/DateField.js +0 -11
- package/dist/esm/fields/RadioField.js +0 -11
- package/dist/esm/fields/SearchMultiTagSelectField.js +0 -14
- package/dist/esm/fields/StringField.js +0 -34
- package/dist/esm/fields/TextAreaField.js +0 -11
- package/dist/esm/fields/ToggleField.js +0 -11
- package/dist/esm/fields/index.js +0 -16
- package/dist/esm/fields/stories/AnyField.stories.js +0 -70
- package/dist/esm/fields/stories/ArrayField.stories.js +0 -215
- package/dist/esm/fields/stories/BooleanField.stories.js +0 -27
- package/dist/esm/fields/stories/DateField.stories.js +0 -25
- package/dist/esm/fields/stories/FileUploadField.stories.js +0 -57
- package/dist/esm/fields/stories/MultipleChoiceField.stories.js +0 -77
- package/dist/esm/fields/stories/NullField.stories.js +0 -29
- package/dist/esm/fields/stories/NumberField.stories.js +0 -24
- package/dist/esm/fields/stories/ObjectField.stories.js +0 -85
- package/dist/esm/fields/stories/RadioField.stories.js +0 -33
- package/dist/esm/fields/stories/SchemaField.stories.js +0 -92
- package/dist/esm/fields/stories/SearchMultiTagSelectField.stories.js +0 -49
- package/dist/esm/fields/stories/StringField.stories.js +0 -66
- package/dist/esm/fields/stories/TextAreaField.stories.js +0 -25
- package/dist/esm/fields/stories/ToggleField.stories.js +0 -25
- package/dist/esm/formEditorSchemas.js +0 -192
- package/dist/esm/hooks/__tests__/useExtractUiSchema.test.js +0 -45
- package/dist/esm/hooks/__tests__/useSetDefault.test.js +0 -65
- package/dist/esm/hooks/index.js +0 -2
- package/dist/esm/hooks/useExtractUiSchema.js +0 -23
- package/dist/esm/pdfFields/NumberField.js +0 -8
- package/dist/esm/pdfFields/ObjectField.js +0 -45
- package/dist/esm/pdfFields/index.js +0 -16
- package/dist/esm/pdfFields/types.js +0 -10
- package/dist/esm/pdfTemplates/ArrayFieldTemplate.js +0 -16
- package/dist/esm/pdfTemplates/CollapsibleObjectFieldTemplate.js +0 -20
- package/dist/esm/pdfTemplates/FieldTemplate.js +0 -15
- package/dist/esm/pdfTemplates/ObjectFieldTemplate.js +0 -18
- package/dist/esm/pdfTemplates/index.js +0 -4
- package/dist/esm/sampleData/ageFieldDefinition.js +0 -5
- package/dist/esm/sampleData/collapsibleSchema.js +0 -27
- package/dist/esm/sampleData/completeSchema.js +0 -348
- package/dist/esm/sampleData/conditionsSchema.js +0 -82
- package/dist/esm/sampleData/ejsSchema.js +0 -25
- package/dist/esm/sampleData/fileUpload.js +0 -40
- package/dist/esm/sampleData/generatedSchema.js +0 -19
- package/dist/esm/sampleData/index.js +0 -8
- package/dist/esm/sampleData/multipleChoiceSchema.js +0 -131
- package/dist/esm/sampleData/pdfProExampleSchema.js +0 -185
- package/dist/esm/sampleData/refDefSchema.js +0 -298
- package/dist/esm/sampleData/requiredInputSchema.js +0 -67
- package/dist/esm/sampleData/simpleData.js +0 -17
- package/dist/esm/setupTests.js +0 -5
- package/dist/esm/styledComponents.js +0 -599
- package/dist/esm/templates/ArrayFieldTemplate.js +0 -34
- package/dist/esm/templates/CollapsibleObjectFieldTemplate.js +0 -30
- package/dist/esm/templates/ObjectFieldTemplate.js +0 -28
- package/dist/esm/templates/index.js +0 -4
- package/dist/esm/utils/__tests/createInitialValues.test.js +0 -104
- package/dist/esm/utils/__tests/createValidationSchema.test.js +0 -944
- package/dist/esm/utils/__tests/deepOverlap.test.js +0 -41
- package/dist/esm/utils/__tests/getEnums.test.js +0 -59
- package/dist/esm/utils/__tests/getTitleAndDescription.test.js +0 -53
- package/dist/esm/utils/__tests/getTypes.test.js +0 -62
- package/dist/esm/utils/__tests/hasReferences.test.js +0 -100
- package/dist/esm/utils/__tests/mergeSchemas.test.js +0 -40
- package/dist/esm/utils/__tests/orderByUiSchema.test.js +0 -63
- package/dist/esm/utils/__tests/resolveSchema.test.js +0 -116
- package/dist/esm/utils/__tests/solveReferences.test.js +0 -56
- package/dist/esm/utils/__tests/testSchemas.js +0 -99
- package/dist/esm/utils/hasReferences.js +0 -12
- package/dist/types/Form.d.ts +0 -4
- package/dist/types/Form.stories.d.ts +0 -19
- package/dist/types/Form.test.d.ts +0 -1
- package/dist/types/FormEditor.d.ts +0 -8
- package/dist/types/FormEditor.stories.d.ts +0 -6
- package/dist/types/FormPdf.d.ts +0 -6
- package/dist/types/FormPdf.stories.d.ts +0 -11
- package/dist/types/FormPdf.test.d.ts +0 -1
- package/dist/types/fields/AnyField.d.ts +0 -3
- package/dist/types/fields/ArrayField.d.ts +0 -3
- package/dist/types/fields/BooleanField.d.ts +0 -3
- package/dist/types/fields/DateField.d.ts +0 -3
- package/dist/types/fields/FileUploadField.d.ts +0 -3
- package/dist/types/fields/MultipleChoiceField.d.ts +0 -3
- package/dist/types/fields/NullField.d.ts +0 -3
- package/dist/types/fields/NumberField.d.ts +0 -3
- package/dist/types/fields/ObjectField.d.ts +0 -3
- package/dist/types/fields/RadioField.d.ts +0 -3
- package/dist/types/fields/SchemaField.d.ts +0 -3
- package/dist/types/fields/SearchMultiTagSelectField.d.ts +0 -3
- package/dist/types/fields/SearchableSelectField.d.ts +0 -3
- package/dist/types/fields/StringField.d.ts +0 -3
- package/dist/types/fields/TextAreaField.d.ts +0 -3
- package/dist/types/fields/ToggleField.d.ts +0 -3
- package/dist/types/fields/index.d.ts +0 -16
- package/dist/types/fields/stories/AnyField.stories.d.ts +0 -5
- package/dist/types/fields/stories/ArrayField.stories.d.ts +0 -8
- package/dist/types/fields/stories/BooleanField.stories.d.ts +0 -5
- package/dist/types/fields/stories/DateField.stories.d.ts +0 -5
- package/dist/types/fields/stories/FileUploadField.stories.d.ts +0 -15
- package/dist/types/fields/stories/MultipleChoiceField.stories.d.ts +0 -6
- package/dist/types/fields/stories/NullField.stories.d.ts +0 -5
- package/dist/types/fields/stories/NumberField.stories.d.ts +0 -5
- package/dist/types/fields/stories/ObjectField.stories.d.ts +0 -5
- package/dist/types/fields/stories/RadioField.stories.d.ts +0 -5
- package/dist/types/fields/stories/SchemaField.stories.d.ts +0 -1730
- package/dist/types/fields/stories/SearchMultiTagSelectField.stories.d.ts +0 -5
- package/dist/types/fields/stories/StringField.stories.d.ts +0 -7
- package/dist/types/fields/stories/TextAreaField.stories.d.ts +0 -5
- package/dist/types/fields/stories/ToggleField.stories.d.ts +0 -5
- package/dist/types/formEditorSchemas.d.ts +0 -3
- package/dist/types/hooks/index.d.ts +0 -2
- package/dist/types/hooks/useExtractUiSchema.d.ts +0 -8
- package/dist/types/pdfFields/AnyField.d.ts +0 -3
- package/dist/types/pdfFields/ArrayField.d.ts +0 -3
- package/dist/types/pdfFields/BooleanField.d.ts +0 -3
- package/dist/types/pdfFields/DateField.d.ts +0 -3
- package/dist/types/pdfFields/EJSField.d.ts +0 -3
- package/dist/types/pdfFields/MultipleChoiceField.d.ts +0 -3
- package/dist/types/pdfFields/NullField.d.ts +0 -3
- package/dist/types/pdfFields/NumberField.d.ts +0 -3
- package/dist/types/pdfFields/ObjectField.d.ts +0 -3
- package/dist/types/pdfFields/RadioField.d.ts +0 -3
- package/dist/types/pdfFields/SchemaField.d.ts +0 -3
- package/dist/types/pdfFields/SearchMultiTagSelectField.d.ts +0 -3
- package/dist/types/pdfFields/SearchableSelectField.d.ts +0 -3
- package/dist/types/pdfFields/StringField.d.ts +0 -3
- package/dist/types/pdfFields/TextAreaField.d.ts +0 -3
- package/dist/types/pdfFields/ToggleField.d.ts +0 -3
- package/dist/types/pdfFields/index.d.ts +0 -16
- package/dist/types/pdfFields/types.d.ts +0 -10
- package/dist/types/pdfTemplates/index.d.ts +0 -4
- package/dist/types/sampleData/ageFieldDefinition.d.ts +0 -2
- package/dist/types/sampleData/collapsibleSchema.d.ts +0 -3
- package/dist/types/sampleData/completeSchema.d.ts +0 -4
- package/dist/types/sampleData/conditionsSchema.d.ts +0 -3
- package/dist/types/sampleData/ejsSchema.d.ts +0 -6
- package/dist/types/sampleData/fileUpload.d.ts +0 -7
- package/dist/types/sampleData/generatedSchema.d.ts +0 -2
- package/dist/types/sampleData/index.d.ts +0 -8
- package/dist/types/sampleData/multipleChoiceSchema.d.ts +0 -9
- package/dist/types/sampleData/pdfProExampleSchema.d.ts +0 -21
- package/dist/types/sampleData/refDefSchema.d.ts +0 -3
- package/dist/types/sampleData/requiredInputSchema.d.ts +0 -3
- package/dist/types/sampleData/simpleData.d.ts +0 -7
- package/dist/types/setupTests.d.ts +0 -1
- package/dist/types/styledComponents.d.ts +0 -275
- package/dist/types/templates/CollapsibleObjectFieldTemplate.d.ts +0 -3
- package/dist/types/templates/index.d.ts +0 -4
- package/dist/types/types.d.ts +0 -337
- package/dist/types/utils/__tests/testSchemas.d.ts +0 -5
- package/dist/types/utils/hasReferences.d.ts +0 -2
- /package/dist/cjs/{types.js → Form/fields/ObjectField/types.js} +0 -0
- /package/dist/cjs/{pdfFields → FormView/fields}/DateField.js +0 -0
- /package/dist/cjs/{fields → FormView/fields}/NumberField.js +0 -0
- /package/dist/cjs/{pdfFields → FormView/fields}/RadioField.js +0 -0
- /package/dist/cjs/{pdfFields → FormView/fields}/ToggleField.js +0 -0
- /package/dist/cjs/{FileUploadContext.js → common/FileUploadContext.js} +0 -0
- /package/dist/cjs/{fields/types.js → common/constants.js} +0 -0
- /package/dist/esm/{types.js → Form/fields/ObjectField/types.js} +0 -0
- /package/dist/{types/hooks/__tests__/useExtractUiSchema.test.d.ts → esm/Form/fields/SearchableSelectField/types.js} +0 -0
- /package/dist/{types/hooks/__tests__/useSetDefault.test.d.ts → esm/Form/templates/ArrayFieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/createInitialValues.test.d.ts → esm/Form/templates/CollapsibleObjectFieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/createValidationSchema.test.d.ts → esm/Form/templates/FieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/deepOverlap.test.d.ts → esm/Form/templates/ObjectFieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/getEnums.test.d.ts → esm/Form/types/FormRegistryContext.js} +0 -0
- /package/dist/esm/{pdfFields → FormView/fields}/DateField.js +0 -0
- /package/dist/esm/{fields → FormView/fields}/NumberField.js +0 -0
- /package/dist/esm/{pdfFields → FormView/fields}/RadioField.js +0 -0
- /package/dist/esm/{pdfFields → FormView/fields}/ToggleField.js +0 -0
- /package/dist/{types/utils/__tests/getTitleAndDescription.test.d.ts → esm/FormView/templates/ArrayFieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/getTypes.test.d.ts → esm/FormView/templates/FieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/hasReferences.test.d.ts → esm/FormView/templates/ObjectFieldTemplate/types.js} +0 -0
- /package/dist/{types/utils/__tests/mergeSchemas.test.d.ts → esm/FormView/types/FormViewRegistryContext.js} +0 -0
- /package/dist/esm/{FileUploadContext.js → common/FileUploadContext.js} +0 -0
- /package/dist/esm/{fields/types.js → common/constants.js} +0 -0
- /package/dist/{types/utils/__tests/orderByUiSchema.test.d.ts → esm/common/types/Field.js} +0 -0
- /package/dist/{types/utils/__tests/resolveSchema.test.d.ts → esm/common/types/FieldInfo.js} +0 -0
- /package/dist/{types/utils/__tests/solveReferences.test.d.ts → esm/common/types/Form.js} +0 -0
- /package/dist/types/{fields/types.d.ts → common/constants.d.ts} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { styled } from "styled-components";
|
|
2
|
+
import { commonInputStyles, commonSelectStyles } from "../../styles/common";
|
|
3
|
+
export const ObjectFieldTemplateWrapper = styled.fieldset `
|
|
4
|
+
color: ${(props) => props.theme.text.default};
|
|
5
|
+
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
6
|
+
margin-inline: 0;
|
|
7
|
+
margin-bottom: ${(props) => props.theme.spacing.xs};
|
|
8
|
+
${commonInputStyles}
|
|
9
|
+
${commonSelectStyles}
|
|
10
|
+
`;
|
|
11
|
+
export const ObjectFieldTemplateTitle = styled.legend `
|
|
12
|
+
color: ${(props) => props.theme.text.default};
|
|
13
|
+
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
14
|
+
`;
|
|
15
|
+
export const ObjectFieldTemplateDescription = undefined;
|
|
16
|
+
export const ObjectFieldTemplateHelp = undefined;
|
|
17
|
+
export const ObjectFieldTemplateInfo = undefined;
|
|
18
|
+
export const ObjectFieldTemplateRequiredIndicator = undefined;
|
|
19
|
+
export const ObjectFieldTemplateErrorMessage = undefined;
|
|
20
|
+
export function getComponents(components) {
|
|
21
|
+
return {
|
|
22
|
+
Wrapper: components.ObjectFieldTemplateWrapper,
|
|
23
|
+
Title: components.ObjectFieldTemplateTitle,
|
|
24
|
+
Description: components.ObjectFieldTemplateDescription ?? components.FieldDescription,
|
|
25
|
+
Help: components.ObjectFieldTemplateHelp ?? components.FieldHelp,
|
|
26
|
+
Info: components.ObjectFieldTemplateInfo ?? components.FieldInfo,
|
|
27
|
+
RequiredIndicator: components.ObjectFieldTemplateRequiredIndicator ??
|
|
28
|
+
components.RequiredIndicator,
|
|
29
|
+
ErrorMessage: components.ObjectFieldTemplateErrorMessage ?? components.ErrorMessage,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//Please keep this in alphabetical order
|
|
2
|
+
import * as ArrayFieldTemplate from "./ArrayFieldTemplate";
|
|
3
|
+
import * as CollapsibleObjectFieldTemplate from "./CollapsibleObjectFieldTemplate";
|
|
4
|
+
import * as FieldTemplate from "./FieldTemplate";
|
|
5
|
+
import * as ObjectFieldTemplate from "./ObjectFieldTemplate";
|
|
6
|
+
//Please keep this in alphabetical order
|
|
7
|
+
export const templateComponents = {
|
|
8
|
+
...ArrayFieldTemplate.components,
|
|
9
|
+
...CollapsibleObjectFieldTemplate.components,
|
|
10
|
+
//...FieldTemplate.components, // Field template uses generic components (should it own those?)
|
|
11
|
+
...ObjectFieldTemplate.components,
|
|
12
|
+
};
|
|
13
|
+
//Please keep this in alphabetical order
|
|
14
|
+
export const templates = {
|
|
15
|
+
...ArrayFieldTemplate.templates,
|
|
16
|
+
...CollapsibleObjectFieldTemplate.templates,
|
|
17
|
+
...FieldTemplate.templates,
|
|
18
|
+
...ObjectFieldTemplate.templates,
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FormRegistryContext";
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
export const
|
|
8
|
-
fields: defaultFields,
|
|
9
|
-
templates: defaultTemplates,
|
|
10
|
-
components: defaultComponents,
|
|
11
|
-
definitions: {},
|
|
12
|
-
uiSchemaDefinitions: {},
|
|
13
|
-
formContext: {},
|
|
14
|
-
useItemsAsAdditionalItems: false,
|
|
15
|
-
hideUnmarkedAdditionalProperties: false,
|
|
16
|
-
});
|
|
17
|
-
export const FormPdf = (props) => {
|
|
2
|
+
import { warnFromUnsupportedKeys } from "../utils";
|
|
3
|
+
import { fields as defaultFields } from "./fields";
|
|
4
|
+
import { components as defaultComponents } from "./components";
|
|
5
|
+
import { templates as defaultTemplates } from "./templates";
|
|
6
|
+
import { FormViewRegistry } from "./FormViewRegistry";
|
|
7
|
+
export const FormView = (props) => {
|
|
18
8
|
warnFromUnsupportedKeys("Form", props, [
|
|
19
9
|
"schema",
|
|
20
10
|
"onSubmit",
|
|
@@ -44,5 +34,5 @@ export const FormPdf = (props) => {
|
|
|
44
34
|
};
|
|
45
35
|
const { Form: FormEl } = registry.components;
|
|
46
36
|
const SchemaField = registry.fields.SchemaField;
|
|
47
|
-
return (_jsx(
|
|
37
|
+
return (_jsx(FormViewRegistry.Provider, { value: registry, children: _jsx(FormEl, { className: className, children: _jsx(SchemaField, { name: "", schema: schema, uiSchema: uiSchema, values: values }) }) }));
|
|
48
38
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const FormViewRegistry = React.createContext({
|
|
3
|
+
fields: {},
|
|
4
|
+
templates: {},
|
|
5
|
+
components: {},
|
|
6
|
+
definitions: {},
|
|
7
|
+
uiSchemaDefinitions: {},
|
|
8
|
+
formContext: {},
|
|
9
|
+
useItemsAsAdditionalItems: false,
|
|
10
|
+
hideUnmarkedAdditionalProperties: false,
|
|
11
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { styled } from "styled-components";
|
|
2
|
+
export const FieldWrapper = styled.div ``;
|
|
3
|
+
export const FieldTitle = styled.label `
|
|
4
|
+
font-size: ${(props) => props.theme.typography.size.base};
|
|
5
|
+
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
6
|
+
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
7
|
+
margin-right: ${(props) => props.theme.spacing.s};
|
|
8
|
+
color: ${(props) => props.theme.text.default};
|
|
9
|
+
`;
|
|
10
|
+
export const FieldDescription = styled.div ``;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./Field";
|
|
2
|
+
export * from "./Form";
|
|
3
|
+
export * from "./Icon";
|
|
4
|
+
import { fieldComponents } from "../fields";
|
|
5
|
+
import { templateComponents } from "../templates";
|
|
6
|
+
//Please keep this in alphabetical order
|
|
7
|
+
import * as Field from "./Field";
|
|
8
|
+
import * as Form from "./Form";
|
|
9
|
+
import * as Icon from "./Icon";
|
|
10
|
+
import * as oldComponents from "./old_styledComponents";
|
|
11
|
+
export const components = {
|
|
12
|
+
...oldComponents,
|
|
13
|
+
...fieldComponents,
|
|
14
|
+
...templateComponents,
|
|
15
|
+
//Please keep this in alphabetical order
|
|
16
|
+
...Field,
|
|
17
|
+
...Form,
|
|
18
|
+
...Icon,
|
|
19
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { MultipleChoiceFieldContainer, MultipleChoiceFieldElement, MultipleChoiceFieldLabel, } from "../../Form/fields/MultipleChoiceField/styledComponents";
|
|
4
|
+
import { getStyle } from "../../utils/getStyle";
|
|
5
|
+
export const StringFieldValue = styled.div `
|
|
6
|
+
white-space: pre-line;
|
|
7
|
+
`;
|
|
8
|
+
export const TextAreaValue = styled.div `
|
|
9
|
+
white-space: pre-line;
|
|
10
|
+
`;
|
|
11
|
+
export const ArrayFieldItem = styled.div ``;
|
|
12
|
+
export const EJSFieldValue = styled.div `
|
|
13
|
+
width: 100%;
|
|
14
|
+
`;
|
|
15
|
+
export const BooleanFieldWrapper = styled.div ``;
|
|
16
|
+
export const BooleanFieldValue = ({ name, className, value, label, }) => {
|
|
17
|
+
return (_jsx("div", { className: className, children: value === true ? (_jsxs("div", { children: [_jsx("span", { children: "\u2713" }), _jsx("span", { children: label !== undefined ? label : "Selected" })] })) : (_jsxs("div", { children: [_jsx("span", { children: "\u2716" }), _jsx("span", { children: label !== undefined ? label : "Not selected" })] })) }));
|
|
18
|
+
};
|
|
19
|
+
const NotSelected = styled.div `
|
|
20
|
+
opacity: 0.3;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
`;
|
|
24
|
+
const Selected = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
`;
|
|
28
|
+
const SelectedBox = styled.span `
|
|
29
|
+
color: ${(props) => props.theme.background.default};
|
|
30
|
+
background: ${(props) => props.theme.text.default};
|
|
31
|
+
padding: ${(props) => `0 ${props.theme.spacing.xs}`};
|
|
32
|
+
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
33
|
+
font-size: ${(props) => props.theme.typography.size.small};
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
`;
|
|
38
|
+
const NotSelectedCircle = styled.span `
|
|
39
|
+
color: ${(props) => props.theme.background.default};
|
|
40
|
+
background: ${(props) => props.theme.text.default};
|
|
41
|
+
padding: ${(props) => props.theme.spacing.xxs};
|
|
42
|
+
border-radius: ${(props) => props.theme.borderRadius.circle};
|
|
43
|
+
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
44
|
+
font-size: ${(props) => props.theme.typography.size.small};
|
|
45
|
+
line-height: 1.1;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
flex: 0 0 1rem;
|
|
50
|
+
`;
|
|
51
|
+
export const MultipleChoiceFieldValue = ({ inputProps, name, className, style, selected, notSelected }) => {
|
|
52
|
+
return (_jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: [!selected && !notSelected && _jsx(_Fragment, { children: "Nothing was selected" }), selected &&
|
|
53
|
+
selected.length > 0 &&
|
|
54
|
+
selected.map((s) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: "\u2713" }), _jsx(MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
55
|
+
notSelected?.length > 0 &&
|
|
56
|
+
notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedCircle, { children: "\u2715" }), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }));
|
|
57
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { useField } from "formik";
|
|
4
|
-
import {
|
|
4
|
+
import { COMPONENT_TYPES } from "../../common/constants";
|
|
5
|
+
import { guessType } from "../../utils";
|
|
5
6
|
import { SchemaField } from "./SchemaField";
|
|
6
|
-
import { COMPONENT_TYPES } from "./types";
|
|
7
7
|
export const AnyField = (props) => {
|
|
8
8
|
const { name, schema, uiSchema } = props;
|
|
9
9
|
const [{ value }] = useField(name);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useField } from "formik";
|
|
3
3
|
import { useContext, useMemo } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getEnums } from "../utils";
|
|
4
|
+
import { getEnums } from "../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
7
6
|
export const ArrayField = (props) => {
|
|
8
|
-
const { fields: { SchemaField }, templates: { ArrayFieldTemplate }, components: { ArrayFieldItem }, } = useContext(
|
|
9
|
-
useSetDefault(props);
|
|
7
|
+
const { fields: { SchemaField }, templates: { ArrayFieldTemplate }, components: { ArrayFieldItem }, } = useContext(FormViewRegistry);
|
|
10
8
|
const { name, uiSchema } = props;
|
|
11
9
|
const [{ value }, _] = useField(name);
|
|
12
10
|
const findEnumInProps = props.schema.additionalItems
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { FormPdfRegistry } from "../FormPdf";
|
|
4
|
-
import { useExtractUiSchema, useSetDefault } from "../hooks";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
5
3
|
import { getIn, useFormikContext } from "formik";
|
|
4
|
+
import { extractUiSchema } from "../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
6
6
|
export const BooleanField = (props) => {
|
|
7
|
-
const { templates: { FieldTemplate }, components: {
|
|
8
|
-
useSetDefault(props);
|
|
7
|
+
const { templates: { FieldTemplate }, components: { BooleanFieldValue, BooleanFieldWrapper }, } = useContext(FormViewRegistry);
|
|
9
8
|
const { name, uiSchema } = props;
|
|
10
|
-
const { label } =
|
|
9
|
+
const { label } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
11
10
|
const { values } = useFormikContext();
|
|
12
11
|
const value = getIn(values, name);
|
|
13
12
|
function findLabel(label) {
|
|
@@ -23,5 +22,5 @@ export const BooleanField = (props) => {
|
|
|
23
22
|
}
|
|
24
23
|
return typeof label === "string" ? label : undefined;
|
|
25
24
|
}
|
|
26
|
-
return (_jsx(FieldTemplate, { ...props, children: _jsx(BooleanFieldWrapper, { children: _jsx(
|
|
25
|
+
return (_jsx(FieldTemplate, { ...props, children: _jsx(BooleanFieldWrapper, { children: _jsx(BooleanFieldValue, { name: name, value: value, label: findLabel(label) }) }) }));
|
|
27
26
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { useSetDefault } from "../hooks";
|
|
4
3
|
import ejs from "ejs-browser";
|
|
5
4
|
import DOMPurify from "dompurify";
|
|
6
5
|
import { getIn, useFormikContext } from "formik";
|
|
7
|
-
import { getDescription, getTitle } from "
|
|
8
|
-
import {
|
|
6
|
+
import { getDescription, getTitle } from "../../utils";
|
|
7
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
9
8
|
export const EJSField = (props) => {
|
|
10
|
-
const { components: {
|
|
11
|
-
useSetDefault(props);
|
|
9
|
+
const { components: { EJSFieldValue }, } = useContext(FormViewRegistry);
|
|
12
10
|
const { name, uiSchema = {} } = props;
|
|
13
11
|
const { values } = useFormikContext();
|
|
14
12
|
const title = getTitle(props) || "Untitled Field";
|
|
@@ -28,7 +26,7 @@ export const EJSField = (props) => {
|
|
|
28
26
|
}
|
|
29
27
|
}, [template, title, description, name, values]);
|
|
30
28
|
const sanitizedHTML = DOMPurify.sanitize(renderedTemplate);
|
|
31
|
-
return (_jsx(
|
|
29
|
+
return (_jsx(EJSFieldValue, { dangerouslySetInnerHTML: {
|
|
32
30
|
__html: sanitizedHTML,
|
|
33
31
|
} }));
|
|
34
32
|
};
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { FormPdfRegistry } from "../FormPdf";
|
|
4
|
-
import { useExtractUiSchema, useSetDefault } from "../hooks";
|
|
5
|
-
import { getEnums, getSelectedEnum } from "../utils/getEnums";
|
|
6
3
|
import { getIn, useFormikContext } from "formik";
|
|
4
|
+
import { extractUiSchema, getEnums, getSelectedEnum } from "../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
7
6
|
export const MultipleChoiceField = (props) => {
|
|
8
|
-
const { templates: { FieldTemplate }, components: {
|
|
9
|
-
useSetDefault(props);
|
|
7
|
+
const { templates: { FieldTemplate }, components: { MultipleChoiceFieldValue }, } = useContext(FormViewRegistry);
|
|
10
8
|
const { name, uiSchema } = props;
|
|
11
|
-
const { props: inputProps, style, onlyShowSelected, } =
|
|
9
|
+
const { props: inputProps, style, onlyShowSelected, } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
12
10
|
const enums = useMemo(() => getEnums(props), [props]);
|
|
13
11
|
const { values } = useFormikContext();
|
|
14
12
|
const value = getIn(values, name);
|
|
15
13
|
const selected = getSelectedEnum(value, enums);
|
|
16
14
|
const notSelected = enums?.values?.filter((v) => Array.isArray(value) && !value.includes(v));
|
|
17
15
|
const hideNotSelected = onlyShowSelected === true || selected === undefined;
|
|
18
|
-
return (_jsx(FieldTemplate, { ...props, children: _jsx(
|
|
16
|
+
return (_jsx(FieldTemplate, { ...props, children: _jsx(MultipleChoiceFieldValue, { inputProps: inputProps, name: name, style: style, selected: selected, notSelected: hideNotSelected ? undefined : notSelected }) }));
|
|
19
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
4
4
|
export const NullField = (props) => {
|
|
5
|
-
const { templates: { FieldTemplate }, } = useContext(
|
|
5
|
+
const { templates: { FieldTemplate }, } = useContext(FormViewRegistry);
|
|
6
6
|
return _jsx(FieldTemplate, { ...props });
|
|
7
7
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useField, useFormikContext } from "formik";
|
|
3
|
+
import { useContext, useEffect, useMemo } from "react";
|
|
4
|
+
import { orderByUiSchema, resolveSchema } from "../../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../../FormViewRegistry";
|
|
6
|
+
const useObjectField = (name) => {
|
|
7
|
+
if (!name) {
|
|
8
|
+
const { values = {}, setValues } = useFormikContext();
|
|
9
|
+
return { value: values, setValue: setValues };
|
|
10
|
+
}
|
|
11
|
+
const [{ value = {} }, _, { setValue }] = useField(name);
|
|
12
|
+
return { value, setValue };
|
|
13
|
+
};
|
|
14
|
+
export const ObjectField = (props) => {
|
|
15
|
+
const { fields: { SchemaField }, components: { ObjectFieldSection }, templates: { ObjectFieldTemplate, CollapsibleObjectFieldTemplate }, } = useContext(FormViewRegistry);
|
|
16
|
+
const { name, schema, uiSchema } = props;
|
|
17
|
+
const { value, setValue } = useObjectField(name);
|
|
18
|
+
const [{ properties }, valuesToRemove] = useMemo(() => {
|
|
19
|
+
return resolveSchema(schema, value);
|
|
20
|
+
}, [schema, value]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (valuesToRemove.length > 0) {
|
|
23
|
+
const newValue = valuesToRemove.reduce((prevValue, key) => {
|
|
24
|
+
const { [key]: _removedProperty, ...newValue } = prevValue;
|
|
25
|
+
return newValue;
|
|
26
|
+
}, value);
|
|
27
|
+
setValue(newValue);
|
|
28
|
+
}
|
|
29
|
+
}, [valuesToRemove]);
|
|
30
|
+
const FieldTemplateComponent = props.uiSchema?.props?.isCollapsible
|
|
31
|
+
? CollapsibleObjectFieldTemplate
|
|
32
|
+
: ObjectFieldTemplate;
|
|
33
|
+
const orderedProperties = orderByUiSchema(uiSchema?.["ui:order"], Object.keys(properties || {}));
|
|
34
|
+
return (_jsx(FieldTemplateComponent, { ...props, children: orderedProperties
|
|
35
|
+
.map((child, index) => {
|
|
36
|
+
if (typeof child === "string") {
|
|
37
|
+
const childSchema = properties?.[child];
|
|
38
|
+
if (!childSchema)
|
|
39
|
+
return undefined;
|
|
40
|
+
return (_jsx(SchemaField, { name: name ? [name, child].join(".") : child, schema: typeof childSchema !== "boolean" ? childSchema : {}, uiSchema: uiSchema?.[child] }, child));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const { title, fields } = child;
|
|
44
|
+
return (_jsx(ObjectFieldSection, { title: title, children: fields.map((child2) => {
|
|
45
|
+
const childSchema = properties?.[child2];
|
|
46
|
+
if (!childSchema)
|
|
47
|
+
return undefined;
|
|
48
|
+
return (_jsx(SchemaField, { name: name ? [name, child2].join(".") : child2, schema: typeof childSchema !== "boolean" ? childSchema : {}, uiSchema: uiSchema?.[child2] }, child2));
|
|
49
|
+
}) }, fields.join("_")));
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.filter((x) => x) }));
|
|
53
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { FormViewRegistry } from "../../FormViewRegistry";
|
|
4
|
+
export const ObjectFieldSection = ({ title, children, }) => {
|
|
5
|
+
const { components: { ObjectFieldSectionWrapper, ObjectFieldSectionTitle }, } = useContext(FormViewRegistry);
|
|
6
|
+
return (_jsxs(ObjectFieldSectionWrapper, { children: [_jsx(ObjectFieldSectionTitle, { children: title }), children] }));
|
|
7
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { COMPONENT_TYPES } from "./types";
|
|
3
|
+
import { COMPONENT_TYPES } from "../../common/constants";
|
|
4
|
+
import { extractUiSchema, getSchemaType, solveReferences } from "../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
7
6
|
const useFieldComponent = (schema, uiSchema, fields) => {
|
|
8
|
-
const { field } =
|
|
7
|
+
const { field } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
9
8
|
if (typeof field === "function") {
|
|
10
9
|
return field;
|
|
11
10
|
}
|
|
@@ -16,14 +15,14 @@ const useFieldComponent = (schema, uiSchema, fields) => {
|
|
|
16
15
|
if (Array.isArray(schemaType)) {
|
|
17
16
|
schemaType = schemaType[0];
|
|
18
17
|
}
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
? fields[
|
|
22
|
-
:
|
|
18
|
+
const fieldName = COMPONENT_TYPES[schemaType || "any"];
|
|
19
|
+
return fieldName in fields
|
|
20
|
+
? fields[fieldName]
|
|
21
|
+
: () => (_jsxs("p", { style: { color: "red" }, children: ["!!! Unsupported field \"", fieldName, "\" !!!"] }));
|
|
23
22
|
};
|
|
24
23
|
export const SchemaField = (props) => {
|
|
25
24
|
const { schema, uiSchema } = props;
|
|
26
|
-
const { fields, definitions, uiSchemaDefinitions } = useContext(
|
|
25
|
+
const { fields, definitions, uiSchemaDefinitions } = useContext(FormViewRegistry);
|
|
27
26
|
const schemaSolvedForReferences = useMemo(() => solveReferences(schema, definitions, uiSchema, uiSchemaDefinitions), [schema, definitions]);
|
|
28
27
|
const FieldComponent = useFieldComponent(schemaSolvedForReferences.schema, schemaSolvedForReferences.uiSchema, fields);
|
|
29
28
|
const newProps = {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { getEnums } from "
|
|
4
|
-
import { useExtractUiSchema, useSetDefault } from "../hooks";
|
|
3
|
+
import { extractUiSchema, getEnums } from "../../utils";
|
|
5
4
|
import { ArrayField } from "./ArrayField";
|
|
6
|
-
export const
|
|
7
|
-
useSetDefault(props);
|
|
5
|
+
export const SearchableMultiTagSelectField = (props) => {
|
|
8
6
|
const { name, uiSchema } = props;
|
|
9
|
-
const { placeholder, emptySearchMessage, props: inputProps, } =
|
|
7
|
+
const { placeholder, emptySearchMessage, props: inputProps, } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
10
8
|
const enums = useMemo(() => getEnums(props), [props]);
|
|
11
|
-
return (_jsx(ArrayField, { ...props, ...inputProps, name: name
|
|
9
|
+
return (_jsx(ArrayField, { ...props, ...inputProps, name: name }));
|
|
12
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { extractUiSchema } from "../../utils";
|
|
3
4
|
import { StringField } from "./StringField";
|
|
4
5
|
export const SearchableSelectField = (props) => {
|
|
5
|
-
useSetDefault(props);
|
|
6
6
|
const { uiSchema } = props;
|
|
7
|
-
const { props: inputProps } =
|
|
7
|
+
const { props: inputProps } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
8
8
|
return _jsx(StringField, { ...props, ...inputProps });
|
|
9
9
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { FormPdfRegistry } from "../FormPdf";
|
|
4
|
-
import { useSetDefault } from "../hooks";
|
|
5
3
|
import { getIn, useFormikContext } from "formik";
|
|
6
|
-
import { getEnums } from "
|
|
4
|
+
import { getEnums } from "../../utils";
|
|
5
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
7
6
|
export const StringField = (props) => {
|
|
8
|
-
const { templates: { FieldTemplate }, components: {
|
|
9
|
-
useSetDefault(props);
|
|
7
|
+
const { templates: { FieldTemplate }, components: { StringFieldValue }, } = useContext(FormViewRegistry);
|
|
10
8
|
const { name } = props;
|
|
11
9
|
const { values } = useFormikContext();
|
|
12
10
|
const enums = useMemo(() => getEnums(props), [props]);
|
|
@@ -15,5 +13,5 @@ export const StringField = (props) => {
|
|
|
15
13
|
value =
|
|
16
14
|
enums.values.find((element) => element.const === value)?.title ?? value;
|
|
17
15
|
}
|
|
18
|
-
return (_jsx(FieldTemplate, { ...props, children: _jsx(
|
|
16
|
+
return (_jsx(FieldTemplate, { ...props, children: _jsx(StringFieldValue, { "data-keyword": value, children: value }) }));
|
|
19
17
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
-
import { FormPdfRegistry } from "../FormPdf";
|
|
4
|
-
import { useSetDefault } from "../hooks";
|
|
5
3
|
import { getIn, useFormikContext } from "formik";
|
|
4
|
+
import { FormViewRegistry } from "../FormViewRegistry";
|
|
6
5
|
export const TextAreaField = (props) => {
|
|
7
|
-
const { templates: { FieldTemplate }, components: {
|
|
8
|
-
useSetDefault(props);
|
|
6
|
+
const { templates: { FieldTemplate }, components: { TextAreaValue }, } = useContext(FormViewRegistry);
|
|
9
7
|
const { name, uiSchema } = props;
|
|
10
8
|
const { values } = useFormikContext();
|
|
11
9
|
const value = getIn(values, name);
|
|
12
|
-
return (_jsx(FieldTemplate, { ...props, children: _jsx(
|
|
10
|
+
return (_jsx(FieldTemplate, { ...props, children: _jsx(TextAreaValue, { children: value }) }));
|
|
13
11
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//OLD stuff
|
|
2
|
+
import { AnyField } from "./AnyField";
|
|
3
|
+
import { ArrayField } from "./ArrayField";
|
|
4
|
+
import { BooleanField } from "./BooleanField";
|
|
5
|
+
import { DateField } from "./DateField";
|
|
6
|
+
import { EJSField } from "./EJSField";
|
|
7
|
+
import { FileUploadField } from "./FileUploadField";
|
|
8
|
+
import { MultipleChoiceField } from "./MultipleChoiceField";
|
|
9
|
+
import { NullField } from "./NullField";
|
|
10
|
+
import { NumberField } from "./NumberField";
|
|
11
|
+
import { RadioField } from "./RadioField";
|
|
12
|
+
import { SchemaField } from "./SchemaField";
|
|
13
|
+
import { StringField } from "./StringField";
|
|
14
|
+
import { SearchableSelectField } from "./SearchableSelectField";
|
|
15
|
+
import { SearchableMultiTagSelectField } from "./SearchableMultiTagSelectField";
|
|
16
|
+
import { TextAreaField } from "./TextAreaField";
|
|
17
|
+
import { ToggleField } from "./ToggleField";
|
|
18
|
+
//Please keep this in alphabetical order
|
|
19
|
+
import * as ObjectField from "./ObjectField";
|
|
20
|
+
//Please keep this in alphabetical order
|
|
21
|
+
export const fieldComponents = {
|
|
22
|
+
...ObjectField.components,
|
|
23
|
+
};
|
|
24
|
+
//Please keep this in alphabetical order
|
|
25
|
+
export const fields = {
|
|
26
|
+
...ObjectField.fields,
|
|
27
|
+
//OLD stuff
|
|
28
|
+
AnyField,
|
|
29
|
+
ArrayField,
|
|
30
|
+
BooleanField,
|
|
31
|
+
DateField,
|
|
32
|
+
EJSField,
|
|
33
|
+
FileUploadField,
|
|
34
|
+
NullField,
|
|
35
|
+
NumberField,
|
|
36
|
+
MultipleChoiceField,
|
|
37
|
+
RadioField,
|
|
38
|
+
SchemaField,
|
|
39
|
+
StringField,
|
|
40
|
+
SearchableSelectField,
|
|
41
|
+
SearchableMultiTagSelectField,
|
|
42
|
+
TextAreaField,
|
|
43
|
+
ToggleField,
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { extractUiSchema, getDescription, getTitle } from "../../../utils";
|
|
4
|
+
import { FormViewRegistry } from "../../FormViewRegistry";
|
|
5
|
+
import { getComponents } from "./styledComponents";
|
|
6
|
+
export const ArrayFieldTemplate = (props) => {
|
|
7
|
+
const { components } = useContext(FormViewRegistry);
|
|
8
|
+
const { Wrapper, Title, Description } = getComponents(components);
|
|
9
|
+
const { name, uiSchema, children } = props;
|
|
10
|
+
const title = getTitle(props);
|
|
11
|
+
const description = getDescription(props);
|
|
12
|
+
const { help, info,
|
|
13
|
+
//TODO: This is not right
|
|
14
|
+
props: { wrapper: wrapperProps, title: titleProps, description: descriptionProps, help: helpProps, error: errorProps, } = {}, } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
15
|
+
return (_jsxs(Wrapper, { ...wrapperProps, children: [title && (_jsx(Title, { ...titleProps, htmlFor: name, children: title })), description && (_jsx(Description, { ...descriptionProps, children: description })), children] }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const ArrayFieldTemplateWrapper = undefined;
|
|
2
|
+
export const ArrayFieldTemplateTitle = undefined;
|
|
3
|
+
export const ArrayFieldTemplateDescription = undefined;
|
|
4
|
+
export function getComponents(components) {
|
|
5
|
+
return {
|
|
6
|
+
Wrapper: components.ArrayFieldTemplateWrapper ??
|
|
7
|
+
components.ObjectFieldTemplateWrapper,
|
|
8
|
+
Title: components.ArrayFieldTemplateTitle ?? components.ObjectFieldTemplateTitle,
|
|
9
|
+
Description: components.ArrayFieldTemplateDescription ?? components.FieldDescription,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as templates from "./CollapsibleObjectFieldTemplate";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { extractUiSchema, getDescription, getTitle } from "../../../utils";
|
|
4
|
+
import { FormViewRegistry } from "../../FormViewRegistry";
|
|
5
|
+
export const FieldTemplate = (props) => {
|
|
6
|
+
const { components: { FieldWrapper, FieldTitle, FieldDescription }, } = useContext(FormViewRegistry);
|
|
7
|
+
const { name, uiSchema, children } = props;
|
|
8
|
+
const title = getTitle(props);
|
|
9
|
+
const description = getDescription(props);
|
|
10
|
+
const { help,
|
|
11
|
+
//TODO: This is not right
|
|
12
|
+
props: { wrapper: wrapperProps, title: titleProps, description: descriptionProps, help: helpProps, } = {}, } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
13
|
+
return (_jsxs(FieldWrapper, { ...wrapperProps, children: [title && (_jsx(FieldTitle, { ...titleProps, htmlFor: name, children: title })), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children] }));
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as templates from "./FieldTemplate";
|