@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
package/dist/esm/setupTests.js
DELETED
|
@@ -1,599 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import * as formik from "formik";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import styled from "styled-components";
|
|
5
|
-
import { ObjectFieldButtonPurpose } from "./types";
|
|
6
|
-
import { getStyle } from "./utils/getStyle";
|
|
7
|
-
export const Form = styled(formik.Form) ``;
|
|
8
|
-
export const FormButtonWrapper = styled.div ``;
|
|
9
|
-
export const FormButton = styled.button ``;
|
|
10
|
-
export const ObjectFieldWrapper = styled.fieldset ``;
|
|
11
|
-
export const ObjectFieldTitle = styled.legend ``;
|
|
12
|
-
export const ObjectFieldList = styled.ul `
|
|
13
|
-
list-style-type: none;
|
|
14
|
-
padding: 0;
|
|
15
|
-
`;
|
|
16
|
-
export const ObjectFieldItem = styled.li `
|
|
17
|
-
display: flex;
|
|
18
|
-
`;
|
|
19
|
-
export const ObjectFieldItemButtons = styled.div `
|
|
20
|
-
display: flex;
|
|
21
|
-
margin: 0.5rem;
|
|
22
|
-
`;
|
|
23
|
-
export const ObjectFieldButton = styled.a `
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
border: 1px solid black;
|
|
26
|
-
line-height: 1em;
|
|
27
|
-
height: 1em;
|
|
28
|
-
padding: 0 0.3em;
|
|
29
|
-
`;
|
|
30
|
-
export const ObjectFieldLineButton = styled(ObjectFieldButton) ``;
|
|
31
|
-
export const ObjectFieldUpButton = styled(ObjectFieldLineButton) ``;
|
|
32
|
-
export const ObjectFieldDownButton = styled(ObjectFieldLineButton) ``;
|
|
33
|
-
export const ObjectFieldRemoveButton = styled(ObjectFieldLineButton) ``;
|
|
34
|
-
export const ObjectFieldAddButton = styled(ObjectFieldButton) ``;
|
|
35
|
-
export const getObjectFieldButton = ({ purpose, onClick, uiSchema, }) => {
|
|
36
|
-
switch (purpose) {
|
|
37
|
-
case ObjectFieldButtonPurpose.ADD:
|
|
38
|
-
return (_jsx(ObjectFieldAddButton, { ...(uiSchema?.["ui:addButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:addButtonOptions"]?.content ?? "+" }));
|
|
39
|
-
case ObjectFieldButtonPurpose.REMOVE:
|
|
40
|
-
return (_jsx(ObjectFieldRemoveButton, { ...(uiSchema?.["ui:removeButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:removeButtonOptions"]?.content ?? "-" }));
|
|
41
|
-
case ObjectFieldButtonPurpose.MOVE_UP:
|
|
42
|
-
return (_jsx(ObjectFieldUpButton, { ...(uiSchema?.["ui:upButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:upButtonOptions"]?.content ?? "↑" }));
|
|
43
|
-
case ObjectFieldButtonPurpose.MOVE_DOWN:
|
|
44
|
-
return (_jsx(ObjectFieldDownButton, { ...(uiSchema?.["ui:downButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:downButtonOptions"]?.content ?? "↓" }));
|
|
45
|
-
default:
|
|
46
|
-
return (_jsx(ObjectFieldButton, { ...(uiSchema?.["ui:customButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:customButtonOptions"]?.content ?? "" }));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
export const ArrayFieldWrapper = ObjectFieldWrapper;
|
|
50
|
-
export const ArrayFieldTitle = ObjectFieldTitle;
|
|
51
|
-
export const ArrayFieldList = ObjectFieldList;
|
|
52
|
-
export const ArrayFieldItem = ObjectFieldItem;
|
|
53
|
-
export const ArrayFieldItemButtons = ObjectFieldItemButtons;
|
|
54
|
-
export const ArrayFieldButton = styled(ObjectFieldButton) ``;
|
|
55
|
-
export const ArrayFieldLineButton = styled(ArrayFieldButton) ``;
|
|
56
|
-
export const ArrayFieldUpButton = styled(ArrayFieldLineButton) ``;
|
|
57
|
-
export const ArrayFieldDownButton = styled(ArrayFieldLineButton) ``;
|
|
58
|
-
export const ArrayFieldRemoveButton = styled(ArrayFieldLineButton) ``;
|
|
59
|
-
export const ArrayFieldAddButton = styled(ArrayFieldButton) ``;
|
|
60
|
-
export const FieldWrapper = styled.div `
|
|
61
|
-
margin: 0.5rem 0;
|
|
62
|
-
`;
|
|
63
|
-
export const FieldTitle = styled.label `
|
|
64
|
-
font-weight: 700;
|
|
65
|
-
`;
|
|
66
|
-
export const FieldDescription = styled.p `
|
|
67
|
-
margin: 0;
|
|
68
|
-
font-size: 0.9em;
|
|
69
|
-
`;
|
|
70
|
-
export const FieldHelp = styled.p `
|
|
71
|
-
margin: 0;
|
|
72
|
-
font-size: 0.9em;
|
|
73
|
-
`;
|
|
74
|
-
export const InfoFieldBoxElement = styled.div `
|
|
75
|
-
transition: opacity 0.5s;
|
|
76
|
-
position: absolute;
|
|
77
|
-
z-index: 1080;
|
|
78
|
-
opacity: 0;
|
|
79
|
-
visibility: hidden;
|
|
80
|
-
margin: 0;
|
|
81
|
-
font-size: 0.875rem;
|
|
82
|
-
word-wrap: break-word;
|
|
83
|
-
min-width: max-content;
|
|
84
|
-
|
|
85
|
-
top: ${({ position }) => position === "bottom" ? "140%" : position === "top" ? "auto" : "50%"};
|
|
86
|
-
bottom: ${({ position }) => position === "top"
|
|
87
|
-
? "140%"
|
|
88
|
-
: position === "right" || position === "left"
|
|
89
|
-
? "50%"
|
|
90
|
-
: "auto"};
|
|
91
|
-
left: ${({ position }) => position === "right"
|
|
92
|
-
? "100%"
|
|
93
|
-
: position === "bottom" || position === "top"
|
|
94
|
-
? "50%"
|
|
95
|
-
: "auto"};
|
|
96
|
-
right: ${({ position }) => position === "left"
|
|
97
|
-
? "100%"
|
|
98
|
-
: position === "bottom" || position === "top"
|
|
99
|
-
? "50%"
|
|
100
|
-
: "auto"};
|
|
101
|
-
transform: translate(
|
|
102
|
-
${({ position }) => position === "bottom" || position === "top" ? "-50%" : "0"},
|
|
103
|
-
${({ position }) => position === "right" || position === "left" ? "-50%" : "0"}
|
|
104
|
-
);
|
|
105
|
-
`;
|
|
106
|
-
export const InfoFieldBoxArrowElement = styled.div `
|
|
107
|
-
top: ${({ position }) => position === "top"
|
|
108
|
-
? "100%"
|
|
109
|
-
: position === "right" || position === "left"
|
|
110
|
-
? "40%"
|
|
111
|
-
: "unset"};
|
|
112
|
-
left: ${({ position }) => position === "top" || position === "bottom"
|
|
113
|
-
? "50%"
|
|
114
|
-
: position === "right"
|
|
115
|
-
? "-2%"
|
|
116
|
-
: "102.5%"};
|
|
117
|
-
bottom: ${({ position }) => (position === "bottom" ? "100%" : "unset")};
|
|
118
|
-
border: solid transparent;
|
|
119
|
-
content: "";
|
|
120
|
-
height: 0;
|
|
121
|
-
width: 0;
|
|
122
|
-
position: absolute;
|
|
123
|
-
pointer-events: none;
|
|
124
|
-
border-top-color: ${({ position }) => position === "top" ? "grey" : "transparent"};
|
|
125
|
-
border-bottom-color: ${({ position }) => position === "bottom" ? "grey" : "transparent"};
|
|
126
|
-
border-right-color: ${({ position }) => position === "right" ? "grey" : "transparent"};
|
|
127
|
-
border-left-color: ${({ position }) => position === "left" ? "grey" : "transparent"};
|
|
128
|
-
border-width: 5px;
|
|
129
|
-
margin-left: -5px;
|
|
130
|
-
`;
|
|
131
|
-
export const InfoFieldBoxInnerElement = styled.div `
|
|
132
|
-
padding: 0.25rem 0.5rem;
|
|
133
|
-
color: white;
|
|
134
|
-
text-align: center;
|
|
135
|
-
background: grey;
|
|
136
|
-
border: solid 1px grey;
|
|
137
|
-
border-radius: 0.25rem;
|
|
138
|
-
cursor: default;
|
|
139
|
-
`;
|
|
140
|
-
export const InfoFieldContainerElement = styled.a `
|
|
141
|
-
position: relative;
|
|
142
|
-
color: black;
|
|
143
|
-
background: none;
|
|
144
|
-
outline: none;
|
|
145
|
-
cursor: pointer;
|
|
146
|
-
border: 1px solid black;
|
|
147
|
-
border-radius: 50%;
|
|
148
|
-
line-height: 1em;
|
|
149
|
-
font-size: 0.7em;
|
|
150
|
-
padding: 0 0.44em;
|
|
151
|
-
text-decoration: unset;
|
|
152
|
-
|
|
153
|
-
&:active,
|
|
154
|
-
&:focus {
|
|
155
|
-
color: white;
|
|
156
|
-
background: black;
|
|
157
|
-
${InfoFieldBoxElement} {
|
|
158
|
-
opacity: 1;
|
|
159
|
-
visibility: visible;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
`;
|
|
163
|
-
export const InfoFieldLabel = styled.span ``;
|
|
164
|
-
export const InfoFieldButton = ({ label, content, position, props, className, }) => {
|
|
165
|
-
return (_jsxs(InfoFieldContainerElement, { href: "#", onClick: (e) => e.preventDefault(), className: className, children: [_jsx(InfoFieldLabel, { children: label ?? "i" }), _jsxs(InfoFieldBoxElement, { position: position ?? "top", role: "tooltip", children: [_jsx(InfoFieldBoxArrowElement, { position: position ?? "top" }), _jsx(InfoFieldBoxInnerElement, { children: content })] })] }));
|
|
166
|
-
};
|
|
167
|
-
InfoFieldButton.styles = {
|
|
168
|
-
InfoFieldContainerElementStyle: InfoFieldContainerElement,
|
|
169
|
-
InfoFieldBoxElementStyle: InfoFieldBoxElement,
|
|
170
|
-
InfoFieldBoxInnerElementStyle: InfoFieldBoxInnerElement,
|
|
171
|
-
InfoFieldBoxArrowElementStyle: InfoFieldBoxArrowElement,
|
|
172
|
-
InfoFieldLabelStyle: InfoFieldLabel,
|
|
173
|
-
};
|
|
174
|
-
// <--- InfoFieldButton
|
|
175
|
-
export const ErrorMessage = styled(formik.ErrorMessage) ``;
|
|
176
|
-
/*
|
|
177
|
-
* Works like Formik field, but "as" props needs to be given with "formikAs", since styled components uses as.
|
|
178
|
-
*
|
|
179
|
-
*/
|
|
180
|
-
export const FieldInput = styled(({ formikAs, ...props }) => {
|
|
181
|
-
return _jsx(formik.Field, { ...props, as: formikAs });
|
|
182
|
-
}) ``;
|
|
183
|
-
export const RequiredIndicator = styled.span ``;
|
|
184
|
-
// ToggleSwitchField --->
|
|
185
|
-
export const Toggle = styled.span `
|
|
186
|
-
position: absolute;
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
top: 0;
|
|
189
|
-
left: 0;
|
|
190
|
-
right: 0;
|
|
191
|
-
bottom: 0;
|
|
192
|
-
background: #ccc;
|
|
193
|
-
-webkit-transition: 0.4s;
|
|
194
|
-
transition: 0.4s;
|
|
195
|
-
border-radius: 34px;
|
|
196
|
-
|
|
197
|
-
&:before {
|
|
198
|
-
position: absolute;
|
|
199
|
-
content: "";
|
|
200
|
-
height: 0.9em;
|
|
201
|
-
width: 0.9em;
|
|
202
|
-
background: white;
|
|
203
|
-
-webkit-transition: 0.4s;
|
|
204
|
-
transition: 0.4s;
|
|
205
|
-
border-radius: 50%;
|
|
206
|
-
top: 0.13em;
|
|
207
|
-
left: 0.13em;
|
|
208
|
-
}
|
|
209
|
-
`;
|
|
210
|
-
export const ToggleLabel = styled.label `
|
|
211
|
-
position: relative;
|
|
212
|
-
display: inline-block;
|
|
213
|
-
width: 2em;
|
|
214
|
-
`;
|
|
215
|
-
export const ToggleFieldInput = styled(FieldInput) `
|
|
216
|
-
opacity: 0;
|
|
217
|
-
width: 0;
|
|
218
|
-
height: 0;
|
|
219
|
-
|
|
220
|
-
&:checked + ${Toggle} {
|
|
221
|
-
background: #2196f3;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
&:focus + ${Toggle} {
|
|
225
|
-
box-shadow: 0 0 1px #2196f3;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
&:checked + ${Toggle}:before {
|
|
229
|
-
transform: translateX(0.85em);
|
|
230
|
-
}
|
|
231
|
-
`;
|
|
232
|
-
export const ToggleSwitchField = ({ inputProps, name, className, }) => {
|
|
233
|
-
return (_jsxs(ToggleLabel, { className: className, children: [_jsx(ToggleFieldInput, { ...inputProps, name: name, type: "checkbox" }), _jsx(Toggle, {})] }));
|
|
234
|
-
};
|
|
235
|
-
ToggleSwitchField.styles = {
|
|
236
|
-
ToggleLabelStyle: ToggleLabel,
|
|
237
|
-
ToggleFieldInputStyle: ToggleFieldInput,
|
|
238
|
-
ToggleStyle: Toggle,
|
|
239
|
-
};
|
|
240
|
-
// <--- ToggleSwitchField
|
|
241
|
-
// RadioButtonField --->
|
|
242
|
-
export const RadioButtonFieldContainer = styled.div `
|
|
243
|
-
display: flex;
|
|
244
|
-
gap: 1em;
|
|
245
|
-
`;
|
|
246
|
-
export const RadioButtonFieldElement = styled.label `
|
|
247
|
-
display: inline-flex;
|
|
248
|
-
align-items: center;
|
|
249
|
-
`;
|
|
250
|
-
export const RadioButtonFieldInput = styled(FieldInput) `
|
|
251
|
-
margin: unset;
|
|
252
|
-
margin-top: 0.15em;
|
|
253
|
-
`;
|
|
254
|
-
export const ButtonLabel = styled.span `
|
|
255
|
-
margin-left: 0.2em;
|
|
256
|
-
`;
|
|
257
|
-
export const ButtonLabelTrue = styled(ButtonLabel) ``;
|
|
258
|
-
export const ButtonLabelFalse = styled(ButtonLabel) ``;
|
|
259
|
-
export const RadioButtonField = ({ label, inputProps, name, className, }) => {
|
|
260
|
-
return (_jsxs(RadioButtonFieldContainer, { className: className, children: [_jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, { ...inputProps, name: name, type: "radio", value: "true" }), _jsx(ButtonLabelTrue, { children: label?.true ?? "true" })] }), _jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, { ...inputProps, name: name, type: "radio", value: "false" }), _jsx(ButtonLabelFalse, { children: label?.false ?? "false" })] })] }));
|
|
261
|
-
};
|
|
262
|
-
RadioButtonField.styles = {
|
|
263
|
-
RadioButtonFieldContainerStyle: RadioButtonFieldContainer,
|
|
264
|
-
RadioButtonFieldElementStyle: RadioButtonFieldElement,
|
|
265
|
-
RadioButtonFieldInputStyle: RadioButtonFieldInput,
|
|
266
|
-
ButtonLabelStyle: ButtonLabel,
|
|
267
|
-
ButtonLabelTrueStyle: ButtonLabelTrue,
|
|
268
|
-
ButtonLabelFalseStyle: ButtonLabelFalse,
|
|
269
|
-
};
|
|
270
|
-
export const MultipleChoiceFieldContainer = styled(RadioButtonFieldContainer) ``;
|
|
271
|
-
export const MultipleChoiceFieldElement = styled(RadioButtonFieldElement) ``;
|
|
272
|
-
export const MultipleChoiceFieldInput = styled(RadioButtonFieldInput) ``;
|
|
273
|
-
export const MultipleChoiceFieldLabel = styled(ButtonLabel) ``;
|
|
274
|
-
export const MultipleChoiceField = ({ inputProps, name, className, enums, style, value, form, }) => {
|
|
275
|
-
const isMultiSelect = enums.type === "multiSelect";
|
|
276
|
-
const currentValue = isMultiSelect
|
|
277
|
-
? Array.isArray(value)
|
|
278
|
-
? value
|
|
279
|
-
: []
|
|
280
|
-
: value;
|
|
281
|
-
const isChecked = (optionValue) => {
|
|
282
|
-
if (isMultiSelect && Array.isArray(currentValue)) {
|
|
283
|
-
return currentValue.includes(optionValue);
|
|
284
|
-
}
|
|
285
|
-
return currentValue === optionValue;
|
|
286
|
-
};
|
|
287
|
-
const handleChange = (optionValue) => {
|
|
288
|
-
if (isMultiSelect && Array.isArray(currentValue)) {
|
|
289
|
-
const newValue = isChecked(optionValue)
|
|
290
|
-
? currentValue.filter((v) => v !== optionValue)
|
|
291
|
-
: [...currentValue, optionValue];
|
|
292
|
-
form?.setFieldValue(name, newValue);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
form?.setFieldValue(name, optionValue);
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
return (_jsx(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: enums.values.map((v) => {
|
|
299
|
-
const optionValue = v.const;
|
|
300
|
-
return (_jsxs(MultipleChoiceFieldElement, { "data-fjsf-enum-value": optionValue, children: [_jsx(MultipleChoiceFieldInput, { ...inputProps, name: name, type: isMultiSelect ? "checkbox" : "radio", value: optionValue !== undefined ? optionValue.toString() : "", checked: isChecked(optionValue), onChange: () => handleChange(optionValue) }), _jsx(MultipleChoiceFieldLabel, { children: v.title })] }, optionValue !== undefined ? optionValue.toString() : "undefined"));
|
|
301
|
-
}) }));
|
|
302
|
-
};
|
|
303
|
-
MultipleChoiceField.styles = {
|
|
304
|
-
MultipleChoiceFieldElementStyle: MultipleChoiceFieldElement,
|
|
305
|
-
MultipleChoiceFieldInputStyle: MultipleChoiceFieldInput,
|
|
306
|
-
MultipleChoiceFieldLabelStyle: MultipleChoiceFieldLabel,
|
|
307
|
-
};
|
|
308
|
-
// ---> SearchableMultiTagSelectField
|
|
309
|
-
export const MultiSelectContainer = styled.div `
|
|
310
|
-
display: flex;
|
|
311
|
-
flex-direction: column;
|
|
312
|
-
`;
|
|
313
|
-
export const MultiSelectSearchContainer = styled.div `
|
|
314
|
-
display: inline-block;
|
|
315
|
-
position: relative;
|
|
316
|
-
width: fit-content;
|
|
317
|
-
`;
|
|
318
|
-
export const MultiSelectInput = styled(FieldInput) `
|
|
319
|
-
width: 100%;
|
|
320
|
-
`;
|
|
321
|
-
export const MultiSelectBadgeContainer = styled.div `
|
|
322
|
-
margin: 0.3em 0;
|
|
323
|
-
display: inline-flex;
|
|
324
|
-
gap: 1em;
|
|
325
|
-
`;
|
|
326
|
-
export const MultiSelectBadge = styled.span `
|
|
327
|
-
background: lightgray;
|
|
328
|
-
padding: 0 0.2em 0 0.5em;
|
|
329
|
-
border-radius: 0.1em;
|
|
330
|
-
display: flex;
|
|
331
|
-
`;
|
|
332
|
-
export const MultiSelectBadgeCloseElement = styled.span `
|
|
333
|
-
cursor: pointer;
|
|
334
|
-
margin-left: 0.5em;
|
|
335
|
-
font-size: 0.7em;
|
|
336
|
-
align-self: baseline;
|
|
337
|
-
font-family: sans-serif;
|
|
338
|
-
`;
|
|
339
|
-
export const MultiSelectOptionList = styled.ul `
|
|
340
|
-
width: 100%;
|
|
341
|
-
padding: unset;
|
|
342
|
-
margin: unset;
|
|
343
|
-
border: 1px solid gray;
|
|
344
|
-
border-radius: 0.2em;
|
|
345
|
-
position: absolute;
|
|
346
|
-
background: white;
|
|
347
|
-
top: 100%;
|
|
348
|
-
z-index: 1000;
|
|
349
|
-
`;
|
|
350
|
-
export const MultiSelectOptionListItem = styled.li `
|
|
351
|
-
cursor: pointer;
|
|
352
|
-
list-style-type: none;
|
|
353
|
-
padding: 0.06em 0.2em;
|
|
354
|
-
height: 1.2em;
|
|
355
|
-
&:hover {
|
|
356
|
-
background: lightgray;
|
|
357
|
-
}
|
|
358
|
-
`;
|
|
359
|
-
export const MultiSelectOptionListWithoutItem = styled.li `
|
|
360
|
-
cursor: default;
|
|
361
|
-
color: gray;
|
|
362
|
-
list-style-type: none;
|
|
363
|
-
padding: 0.06em 0.2em;
|
|
364
|
-
height: 1.2em;
|
|
365
|
-
`;
|
|
366
|
-
export const SearchableMultiTagSelectField = ({ name, placeholder, enums, emptySearchMessage, closeElement, className, }) => {
|
|
367
|
-
const [search, setSearch] = useState("");
|
|
368
|
-
const searchIncludedInEnum = () => {
|
|
369
|
-
const hasValue = enums?.values.map((value) => value.title.toLowerCase().includes(search.toLowerCase()));
|
|
370
|
-
return hasValue?.includes(true);
|
|
371
|
-
};
|
|
372
|
-
return (_jsx(formik.Field, { className: className, name: name, multiple: true, children: ({ field, form: { setFieldValue }, meta, }) => (_jsxs(MultiSelectContainer, { className: className, children: [_jsx(FieldInput, { id: className, type: "hidden", ...field }), _jsxs(MultiSelectSearchContainer, { children: [_jsx(MultiSelectInput, { id: className + "_id", className: className, type: "text", onChange: (e) => {
|
|
373
|
-
setSearch(e.currentTarget.value);
|
|
374
|
-
}, placeholder: placeholder, value: search }), search.length > 0 && (_jsx(MultiSelectOptionList, { children: searchIncludedInEnum() ? (enums?.values
|
|
375
|
-
.filter((item) => !(field.value ?? []).includes(item.const))
|
|
376
|
-
.filter((value) => value.title.toLowerCase().includes(search.toLowerCase()))
|
|
377
|
-
.map((option, index) => (_jsx(MultiSelectOptionListItem, { value: option.const, onClick: () => {
|
|
378
|
-
setFieldValue(name, [
|
|
379
|
-
...new Set([...(field.value ?? []), option.const]),
|
|
380
|
-
]);
|
|
381
|
-
setSearch("");
|
|
382
|
-
}, children: option.title }, index)))) : (_jsx(MultiSelectOptionListWithoutItem, { children: emptySearchMessage ?? "No match found" })) }))] }), _jsx(MultiSelectBadgeContainer, { children: (field.value ?? []).map((value) => (_jsxs(MultiSelectBadge, { children: [enums?.values.find((option) => option.const === value)
|
|
383
|
-
?.title, _jsx(MultiSelectBadgeCloseElement, { onClick: () => setFieldValue(name, field.value.filter((v) => v !== value)), children: closeElement ?? "x" })] }, value))) }), meta.touched && meta.error && (_jsx("div", { className: "error", children: meta.error }))] })) }));
|
|
384
|
-
};
|
|
385
|
-
SearchableMultiTagSelectField.styles = {
|
|
386
|
-
MultiSelectContainerStyle: MultiSelectContainer,
|
|
387
|
-
MultiSelectSearchContainerStyle: MultiSelectSearchContainer,
|
|
388
|
-
MultiSelectInputStyle: MultiSelectInput,
|
|
389
|
-
MultiSelectBadgeContainerStyle: MultiSelectBadgeContainer,
|
|
390
|
-
MultiSelectBadgeStyle: MultiSelectBadge,
|
|
391
|
-
MultiSelectBadgeCloseElementStyle: MultiSelectBadgeCloseElement,
|
|
392
|
-
MultiSelectOptionListStyle: MultiSelectOptionList,
|
|
393
|
-
MultiSelectOptionListItemStyle: MultiSelectOptionListItem,
|
|
394
|
-
MultiSelectOptionListWithoutItemStyle: MultiSelectOptionListWithoutItem,
|
|
395
|
-
};
|
|
396
|
-
export const TextAreaFieldInput = styled(FieldInput) `
|
|
397
|
-
width: 100%;
|
|
398
|
-
min-height: 5rem;
|
|
399
|
-
`;
|
|
400
|
-
export const TextAreaInputField = ({ inputProps, name, className, }) => {
|
|
401
|
-
return _jsx(TextAreaFieldInput, { ...inputProps, name: name, formikAs: "textarea" });
|
|
402
|
-
};
|
|
403
|
-
export const BooleanFieldWrapper = styled.div `
|
|
404
|
-
display: flex;
|
|
405
|
-
cursor: pointer;
|
|
406
|
-
`;
|
|
407
|
-
const ClickableEl = styled.button `
|
|
408
|
-
background: none;
|
|
409
|
-
color: inherit;
|
|
410
|
-
border: none;
|
|
411
|
-
padding: 0;
|
|
412
|
-
font: inherit;
|
|
413
|
-
outline: inherit;
|
|
414
|
-
cursor: pointer;
|
|
415
|
-
`;
|
|
416
|
-
export const Clickable = ({ children, onClick, onMouseUp = () => { }, onMouseDown = () => { }, innerRef = () => { }, className, ariaLabel, ariaExpanded = false, ariaControls, id, }) => {
|
|
417
|
-
return (_jsx(ClickableEl, { type: "button", onClick: onClick, onMouseUp: onMouseUp, onMouseDown: onMouseDown, ref: (r) => innerRef(r), className: className, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-controls": ariaControls, id: id, children: children }));
|
|
418
|
-
};
|
|
419
|
-
export const CollapsibleToggle = styled(Clickable) `
|
|
420
|
-
display: flex;
|
|
421
|
-
flex-direction: column;
|
|
422
|
-
width: 100%;
|
|
423
|
-
`;
|
|
424
|
-
export const Icon = styled.div `
|
|
425
|
-
padding: 0 0.5rem;
|
|
426
|
-
`;
|
|
427
|
-
export const CollapsibleChildWrapper = styled.div ``;
|
|
428
|
-
export const CollapsibleObjectFieldWrapper = ObjectFieldWrapper;
|
|
429
|
-
export const CollapsibleObjectFieldTitle = ObjectFieldTitle;
|
|
430
|
-
export const SearchableSelectContainer = styled(MultiSelectSearchContainer) ``;
|
|
431
|
-
export const SearchDropdownContainer = styled(MultiSelectOptionList) `
|
|
432
|
-
overflow-y: auto;
|
|
433
|
-
overflow-x: auto;
|
|
434
|
-
max-height: 6rem;
|
|
435
|
-
white-space: nowrap;
|
|
436
|
-
`;
|
|
437
|
-
export const SearchListOption = styled(MultiSelectOptionListItem) `
|
|
438
|
-
cursor: default;
|
|
439
|
-
`;
|
|
440
|
-
export const SearchListExpand = styled(MultiSelectOptionListItem) `
|
|
441
|
-
text-decoration: underline;
|
|
442
|
-
&:hover {
|
|
443
|
-
background: none;
|
|
444
|
-
}
|
|
445
|
-
`;
|
|
446
|
-
export const SearchNotFound = styled(MultiSelectOptionListItem) `
|
|
447
|
-
cursor: default;
|
|
448
|
-
&:hover {
|
|
449
|
-
background: none;
|
|
450
|
-
}
|
|
451
|
-
`;
|
|
452
|
-
export const SearchInput = styled(FieldInput) `
|
|
453
|
-
width: 100%;
|
|
454
|
-
padding-right: 1.5em;
|
|
455
|
-
text-overflow: ellipsis;
|
|
456
|
-
`;
|
|
457
|
-
export const SearchClearButton = styled.span `
|
|
458
|
-
cursor: pointer;
|
|
459
|
-
position: absolute;
|
|
460
|
-
right: 0.3em;
|
|
461
|
-
bottom: 0;
|
|
462
|
-
top: 0;
|
|
463
|
-
margin: auto;
|
|
464
|
-
background-color: #ccc;
|
|
465
|
-
border-radius: 50%;
|
|
466
|
-
line-height: 1em;
|
|
467
|
-
min-width: 1em;
|
|
468
|
-
height: 1em;
|
|
469
|
-
text-align: center;
|
|
470
|
-
`;
|
|
471
|
-
export const SearchInputContainer = styled.div `
|
|
472
|
-
display: flex;
|
|
473
|
-
`;
|
|
474
|
-
export const StringFieldPdf = styled.div `
|
|
475
|
-
white-space: pre-line;
|
|
476
|
-
`;
|
|
477
|
-
export const TextAreaPdf = styled.div `
|
|
478
|
-
white-space: pre-line;
|
|
479
|
-
`;
|
|
480
|
-
export const EJSField = styled.div `
|
|
481
|
-
width: 100%;
|
|
482
|
-
`;
|
|
483
|
-
export const BooleanFieldPdf = ({ name, className, value, label, }) => {
|
|
484
|
-
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" })] })) }));
|
|
485
|
-
};
|
|
486
|
-
const NotSelected = styled.div `
|
|
487
|
-
opacity: 0.3;
|
|
488
|
-
display: flex;
|
|
489
|
-
align-items: center;
|
|
490
|
-
`;
|
|
491
|
-
const Selected = styled.div `
|
|
492
|
-
display: flex;
|
|
493
|
-
align-items: center;
|
|
494
|
-
`;
|
|
495
|
-
const SelectedBox = styled.span `
|
|
496
|
-
color: white;
|
|
497
|
-
background: black;
|
|
498
|
-
padding: 0 0.2rem;
|
|
499
|
-
font-size: small;
|
|
500
|
-
display: inline-flex;
|
|
501
|
-
justify-content: center;
|
|
502
|
-
align-items: center;
|
|
503
|
-
`;
|
|
504
|
-
const NotSelectedCircle = styled.span `
|
|
505
|
-
color: white;
|
|
506
|
-
background: black;
|
|
507
|
-
padding: 0.1rem;
|
|
508
|
-
border-radius: 50%;
|
|
509
|
-
font-size: x-small;
|
|
510
|
-
display: inline-flex;
|
|
511
|
-
justify-content: center;
|
|
512
|
-
align-items: center;
|
|
513
|
-
height: 1rem;
|
|
514
|
-
width: 1rem;
|
|
515
|
-
`;
|
|
516
|
-
export const MultipleChoiceFieldPdf = ({ inputProps, name, className, style, selected, notSelected, }) => {
|
|
517
|
-
return (_jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: [!selected && !notSelected && _jsx(_Fragment, { children: "Nothing was selected" }), selected &&
|
|
518
|
-
selected.length > 0 &&
|
|
519
|
-
selected.map((s) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: "\u2713" }), _jsx(MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
|
|
520
|
-
notSelected?.length > 0 &&
|
|
521
|
-
notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedCircle, { children: "\u2715" }), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }));
|
|
522
|
-
};
|
|
523
|
-
// --> FileUploadField
|
|
524
|
-
export const FileUploadButton = styled.button `
|
|
525
|
-
background-color: #ccc;
|
|
526
|
-
color: black;
|
|
527
|
-
padding: 10px 20px;
|
|
528
|
-
border: none;
|
|
529
|
-
border-radius: 5px;
|
|
530
|
-
cursor: pointer;
|
|
531
|
-
font-size: 14px;
|
|
532
|
-
`;
|
|
533
|
-
export const HiddenFileInput = styled.input `
|
|
534
|
-
display: none;
|
|
535
|
-
`;
|
|
536
|
-
export const ProgressBarContainer = styled.div `
|
|
537
|
-
width: 120px;
|
|
538
|
-
height: 20px;
|
|
539
|
-
border-radius: 2px;
|
|
540
|
-
background-color: #b1b2b5;
|
|
541
|
-
position: relative;
|
|
542
|
-
margin-left: 10px;
|
|
543
|
-
`;
|
|
544
|
-
export const ProgressBar = styled.div `
|
|
545
|
-
width: ${(props) => props.$progress}%;
|
|
546
|
-
height: 100%;
|
|
547
|
-
background-color: #548088;
|
|
548
|
-
border-radius: 2px;
|
|
549
|
-
transition: width 0.2s ease;
|
|
550
|
-
`;
|
|
551
|
-
export const ProgressText = styled.span `
|
|
552
|
-
position: absolute;
|
|
553
|
-
top: 50%;
|
|
554
|
-
left: 50%;
|
|
555
|
-
transform: translate(-50%, -50%);
|
|
556
|
-
color: white;
|
|
557
|
-
font-weight: bold;
|
|
558
|
-
`;
|
|
559
|
-
export const FileItemContainer = styled.div `
|
|
560
|
-
margin-bottom: 10px;
|
|
561
|
-
display: flex;
|
|
562
|
-
align-items: center;
|
|
563
|
-
`;
|
|
564
|
-
export const RemoveButton = styled.button `
|
|
565
|
-
margin-left: 10px;
|
|
566
|
-
background-color: transparent;
|
|
567
|
-
border: none;
|
|
568
|
-
cursor: pointer;
|
|
569
|
-
`;
|
|
570
|
-
export const FileInfoText = styled.span `
|
|
571
|
-
margin-left: 10px;
|
|
572
|
-
font-size: 14px;
|
|
573
|
-
color: #555;
|
|
574
|
-
`;
|
|
575
|
-
export const FileUploadFieldContainer = styled.div ``;
|
|
576
|
-
export const FileUploadField = ({ name, uploadedFile, handleFileUpload, value, setFieldValue, className, uploadProgress, handleRemoveFile, removeButton, uploadButtonText, infoText, hideRemoveButton, }) => {
|
|
577
|
-
return (_jsxs(FileUploadFieldContainer, { className: className, children: [_jsxs("div", { children: [_jsx(FileUploadButton, { type: "button", onClick: () => document.getElementById(name)?.click(), children: uploadButtonText ?? "Choose File" }), _jsx(HiddenFileInput, { id: name, name: name, type: "file", onChange: (event) => {
|
|
578
|
-
const file = event.currentTarget.files[0];
|
|
579
|
-
if (file) {
|
|
580
|
-
handleFileUpload(file, setFieldValue);
|
|
581
|
-
event.target.value = null;
|
|
582
|
-
}
|
|
583
|
-
} }), !value ? (_jsx(FileInfoText, { children: infoText ?? "No file chosen" })) : null] }), uploadedFile && value && (_jsx(FileItemContainer, { children: uploadProgress === 100 ? (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), !hideRemoveButton && (_jsx(RemoveButton, { type: "button", onClick: () => handleRemoveFile(setFieldValue), ...removeButton?.props, style: {
|
|
584
|
-
color: "red",
|
|
585
|
-
fontWeight: "bold",
|
|
586
|
-
...(removeButton?.props?.style ?? {}),
|
|
587
|
-
}, children: removeButton?.content ?? "X" }))] })) : (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), _jsxs(ProgressBarContainer, { children: [_jsx(ProgressBar, { "$progress": uploadProgress }), _jsxs(ProgressText, { children: [uploadProgress, "%"] })] })] })) }))] }));
|
|
588
|
-
};
|
|
589
|
-
FileUploadField.styles = {
|
|
590
|
-
FileUploadFieldFileUploadFieldContainerStyle: FileUploadFieldContainer,
|
|
591
|
-
FileUploadFieldFileUploadButtonStyle: FileUploadButton,
|
|
592
|
-
FileUploadFieldHiddenFileInputStyle: HiddenFileInput,
|
|
593
|
-
FileUploadFieldFileInfoTextStyle: FileInfoText,
|
|
594
|
-
FileUploadFieldFileItemContainerStyle: FileItemContainer,
|
|
595
|
-
FileUploadFieldRemoveButtonStyle: RemoveButton,
|
|
596
|
-
FileUploadFieldProgressBarContainerStyle: ProgressBarContainer,
|
|
597
|
-
FileUploadFieldProgressBarStyle: ProgressBar,
|
|
598
|
-
FileUploadFieldProgressTextStyle: ProgressText,
|
|
599
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { FormRegistry } from "../Form";
|
|
4
|
-
import { getDescription, getTitle } from "../utils";
|
|
5
|
-
import { useExtractUiSchema } from "../hooks";
|
|
6
|
-
import { RequiredIndicator } from "../styledComponents";
|
|
7
|
-
import { getIn, useFormikContext } from "formik";
|
|
8
|
-
export const ArrayFieldTemplate = (props) => {
|
|
9
|
-
const { components: { ArrayFieldWrapper, ArrayFieldTitle, FieldDescription, ErrorMessage, FieldHelp, InfoFieldButton, }, } = useContext(FormRegistry);
|
|
10
|
-
const { name, uiSchema, children, ...otherProps } = props;
|
|
11
|
-
const title = getTitle(props);
|
|
12
|
-
const description = getDescription(props);
|
|
13
|
-
const { help, info,
|
|
14
|
-
//TODO: This is not right
|
|
15
|
-
props: { wrapper: wrapperProps = {}, title: titleProps, description: descriptionProps, help: helpProps, error: errorProps, } = {}, } = useExtractUiSchema(uiSchema);
|
|
16
|
-
const dataAttributes = Object.keys(otherProps)
|
|
17
|
-
.filter((key) => key.startsWith("data-"))
|
|
18
|
-
.reduce((acc, key) => {
|
|
19
|
-
acc[key] = otherProps[key];
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
22
|
-
const mergedWrapperProps = {
|
|
23
|
-
...wrapperProps,
|
|
24
|
-
...dataAttributes,
|
|
25
|
-
};
|
|
26
|
-
// These lines make sure the error message is a string, which means the error
|
|
27
|
-
// is actually for the whole Array component, not for one of the children.
|
|
28
|
-
const { errors } = useFormikContext();
|
|
29
|
-
const error = getIn(errors, name);
|
|
30
|
-
// In case of array of objects, it will give error message as an object value,
|
|
31
|
-
// which is incorrect value for React, causing UI to crash.
|
|
32
|
-
const errorIsString = typeof error === "string";
|
|
33
|
-
return (_jsxs(ArrayFieldWrapper, { ...mergedWrapperProps, children: [title && (_jsxs(ArrayFieldTitle, { ...titleProps, htmlFor: name, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help }), errorIsString && _jsx(ErrorMessage, { ...errorProps, name: name })] }));
|
|
34
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext, useState } from "react";
|
|
3
|
-
import { FormRegistry } from "../Form";
|
|
4
|
-
import { getDescription, getTitle } from "../utils";
|
|
5
|
-
import { useExtractUiSchema } from "../hooks";
|
|
6
|
-
import { CollapsibleChildWrapper, CollapsibleToggle, Icon, RequiredIndicator, } from "../styledComponents";
|
|
7
|
-
export const CollapsibleObjectFieldTemplate = (props) => {
|
|
8
|
-
const { components: { FieldDescription, CollapsibleObjectFieldTitle, CollapsibleObjectFieldWrapper, FieldHelp, InfoFieldButton, }, } = useContext(FormRegistry);
|
|
9
|
-
const { children, name, uiSchema, ...otherProps } = 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, isCollapsedOnLoad = true, openIcon, collapsedIcon, ariaLabel,
|
|
15
|
-
// error: errorProps,
|
|
16
|
-
} = {}, } = useExtractUiSchema(uiSchema);
|
|
17
|
-
const dataAttributes = Object.keys(otherProps)
|
|
18
|
-
.filter((key) => key.startsWith("data-"))
|
|
19
|
-
.reduce((acc, key) => {
|
|
20
|
-
acc[key] = otherProps[key];
|
|
21
|
-
return acc;
|
|
22
|
-
}, {});
|
|
23
|
-
const mergedWrapperProps = {
|
|
24
|
-
...wrapperProps,
|
|
25
|
-
...dataAttributes,
|
|
26
|
-
};
|
|
27
|
-
const [collapsed, setCollapsed] = useState(isCollapsedOnLoad);
|
|
28
|
-
const hide = collapsed;
|
|
29
|
-
return (_jsxs(CollapsibleObjectFieldWrapper, { ...mergedWrapperProps, children: [title && (_jsx(CollapsibleToggle, { onClick: () => setCollapsed(!collapsed), ariaExpanded: !hide, ariaLabel: ariaLabel ?? name, children: _jsxs(CollapsibleObjectFieldTitle, { style: { display: "flex", alignItems: "center" }, ...titleProps, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" }), _jsx(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), !hide && _jsx(CollapsibleChildWrapper, { children: children }), help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
|
|
30
|
-
};
|