@nolwenture/formik-jsonschema-form 2.0.2 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/cjs/common/types/index.js +2 -0
- package/dist/cjs/index.js +15 -5
- package/dist/cjs/v3/codemod/bindings.js +124 -0
- package/dist/cjs/v3/codemod/cli.js +89 -0
- package/dist/cjs/v3/codemod/migrate.js +21 -0
- package/dist/cjs/v3/codemod/package.js +5 -0
- package/dist/cjs/v3/codemod/slots.js +27 -0
- package/dist/cjs/v3/codemod/transform.js +61 -0
- package/dist/cjs/v3/document/fromDocument.js +50 -0
- package/dist/cjs/v3/document/index.js +9 -0
- package/dist/cjs/v3/document/render.js +22 -0
- package/dist/cjs/v3/raw/compat/v2utils.js +39 -0
- package/dist/cjs/v3/raw/core/arrays.js +55 -0
- package/dist/cjs/v3/raw/core/choiceStyle.js +14 -0
- package/dist/cjs/v3/raw/core/conditionals.js +88 -0
- package/dist/cjs/v3/raw/core/dates.js +74 -0
- package/dist/cjs/v3/raw/core/defaults.js +31 -0
- package/dist/cjs/v3/raw/core/enums.js +37 -0
- package/dist/cjs/v3/raw/core/initialValues.js +68 -0
- package/dist/cjs/v3/raw/core/issues.js +42 -0
- package/dist/cjs/v3/raw/core/json.js +58 -0
- package/dist/cjs/v3/raw/core/merge.js +51 -0
- package/dist/cjs/v3/raw/core/paths.js +88 -0
- package/dist/cjs/v3/raw/core/policies/fileUploadView.js +4 -0
- package/dist/cjs/v3/raw/core/policies/optionalNumberInitial.js +7 -0
- package/dist/cjs/v3/raw/core/policies/storedFormats.js +5 -0
- package/dist/cjs/v3/raw/core/refs.js +104 -0
- package/dist/cjs/v3/raw/core/schemaType.js +75 -0
- package/dist/cjs/v3/raw/core/titles.js +30 -0
- package/dist/cjs/v3/raw/core/trail.js +18 -0
- package/dist/cjs/v3/raw/core/uiProps.js +72 -0
- package/dist/cjs/v3/raw/core/uiSchema.js +56 -0
- package/dist/cjs/v3/raw/dom/bind.js +84 -0
- package/dist/cjs/v3/raw/dom/build.js +27 -0
- package/dist/cjs/v3/raw/dom/controller.js +87 -0
- package/dist/cjs/v3/raw/dom/core.js +67 -0
- package/dist/cjs/v3/raw/dom/delegate.js +31 -0
- package/dist/cjs/v3/raw/dom/effects.js +67 -0
- package/dist/cjs/v3/raw/dom/elements.js +88 -0
- package/dist/cjs/v3/raw/dom/emitter.js +47 -0
- package/dist/cjs/v3/raw/dom/nodes.js +25 -0
- package/dist/cjs/v3/raw/dom/render.js +122 -0
- package/dist/cjs/v3/raw/dom/upload.js +186 -0
- package/dist/cjs/v3/raw/i18n/en.js +47 -0
- package/dist/cjs/v3/raw/i18n/fi.js +44 -0
- package/dist/cjs/v3/raw/i18n/index.js +14 -0
- package/dist/cjs/v3/raw/index.js +98 -0
- package/dist/cjs/v3/raw/model/classes.js +9 -0
- package/dist/cjs/v3/raw/model/form/actions.js +154 -0
- package/dist/cjs/v3/raw/model/form/any.js +27 -0
- package/dist/cjs/v3/raw/model/form/appearance.js +32 -0
- package/dist/cjs/v3/raw/model/form/array.js +69 -0
- package/dist/cjs/v3/raw/model/form/choice.js +74 -0
- package/dist/cjs/v3/raw/model/form/chrome.js +65 -0
- package/dist/cjs/v3/raw/model/form/componentTable.js +148 -0
- package/dist/cjs/v3/raw/model/form/date.js +53 -0
- package/dist/cjs/v3/raw/model/form/dispatch.js +119 -0
- package/dist/cjs/v3/raw/model/form/iconData.js +19 -0
- package/dist/cjs/v3/raw/model/form/icons.js +10 -0
- package/dist/cjs/v3/raw/model/form/index.js +43 -0
- package/dist/cjs/v3/raw/model/form/leaf.js +99 -0
- package/dist/cjs/v3/raw/model/form/markup.js +46 -0
- package/dist/cjs/v3/raw/model/form/object.js +105 -0
- package/dist/cjs/v3/raw/model/form/parts.js +26 -0
- package/dist/cjs/v3/raw/model/form/searchable.js +81 -0
- package/dist/cjs/v3/raw/model/form/templated.js +22 -0
- package/dist/cjs/v3/raw/model/form/upload.js +88 -0
- package/dist/cjs/v3/raw/model/styledChains.js +43 -0
- package/dist/cjs/v3/raw/model/view/build.js +165 -0
- package/dist/cjs/v3/raw/model/view/fields.js +102 -0
- package/dist/cjs/v3/raw/model/view/index.js +10 -0
- package/dist/cjs/v3/raw/model/view/markup.js +62 -0
- package/dist/cjs/v3/raw/model/view/toVNode.js +67 -0
- package/dist/cjs/v3/raw/model/view/values.js +58 -0
- package/dist/cjs/v3/raw/model/vnode.js +21 -0
- package/dist/cjs/v3/raw/sanitize/index.js +10 -0
- package/dist/cjs/v3/raw/sanitize/sanitizeHtml.js +128 -0
- package/dist/cjs/v3/raw/serialize/toDOM.js +150 -0
- package/dist/cjs/v3/raw/serialize/toString.js +58 -0
- package/dist/cjs/v3/raw/store/createStore.js +133 -0
- package/dist/cjs/v3/raw/styles/color.js +112 -0
- package/dist/cjs/v3/raw/styles/colorNames.js +30 -0
- package/dist/cjs/v3/raw/styles/defaultStyles.js +114 -0
- package/dist/cjs/v3/raw/styles/index.js +24 -0
- package/dist/cjs/v3/raw/styles/themeToCssVars.js +60 -0
- package/dist/cjs/v3/raw/styles/vars.js +28 -0
- package/dist/cjs/v3/raw/validation/arrays.js +78 -0
- package/dist/cjs/v3/raw/validation/conditions.js +63 -0
- package/dist/cjs/v3/raw/validation/index.js +182 -0
- package/dist/cjs/v3/raw/validation/keywords.js +113 -0
- package/dist/cjs/v3/raw/validation/messages.js +14 -0
- package/dist/cjs/v3/raw/validation/patterns.js +74 -0
- package/dist/cjs/v3/react/chain.js +7 -0
- package/dist/cjs/v3/react/compat.js +11 -0
- package/dist/cjs/v3/react/componentsProp.js +23 -0
- package/dist/cjs/v3/react/defined.js +6 -0
- package/dist/cjs/v3/react/ejs/EJSField.js +75 -0
- package/dist/cjs/v3/react/ejs/index.js +8 -0
- package/dist/cjs/v3/react/form/components.js +105 -0
- package/dist/cjs/v3/react/form/fields.js +75 -0
- package/dist/cjs/v3/react/form/host.js +100 -0
- package/dist/cjs/{Form/FormRegistry.js → v3/react/form/registry.js} +6 -7
- package/dist/cjs/v3/react/form/root.js +42 -0
- package/dist/cjs/v3/react/form/runtime.js +117 -0
- package/dist/cjs/v3/react/form/templates.js +58 -0
- package/dist/cjs/v3/react/form/upload.js +173 -0
- package/dist/cjs/v3/react/form/uploadContexts.js +27 -0
- package/dist/cjs/v3/react/form/useSetDefault.js +21 -0
- package/dist/cjs/v3/react/hostCore.js +59 -0
- package/dist/cjs/v3/react/index.js +45 -0
- package/dist/cjs/v3/react/selector.js +17 -0
- package/dist/cjs/v3/react/slots.js +19 -0
- package/dist/cjs/v3/react/toReact.js +63 -0
- package/dist/cjs/v3/react/view/components.js +63 -0
- package/dist/cjs/v3/react/view/fields.js +46 -0
- package/dist/cjs/v3/react/view/host.js +36 -0
- package/dist/cjs/v3/react/view/registry.js +20 -0
- package/dist/cjs/v3/react/view/root.js +37 -0
- package/dist/cjs/v3/react/view/templates.js +50 -0
- package/dist/esm/common/types/index.js +2 -0
- package/dist/esm/index.js +8 -5
- package/dist/esm/v3/document/fromDocument.js +46 -0
- package/dist/esm/v3/document/index.js +4 -0
- package/dist/esm/v3/document/render.js +18 -0
- package/dist/esm/v3/raw/compat/v2utils.js +15 -0
- package/dist/esm/v3/raw/core/arrays.js +49 -0
- package/dist/esm/v3/raw/core/choiceStyle.js +10 -0
- package/dist/esm/v3/raw/core/conditionals.js +82 -0
- package/dist/esm/v3/raw/core/dates.js +66 -0
- package/dist/esm/v3/raw/core/defaults.js +25 -0
- package/dist/esm/v3/raw/core/enums.js +32 -0
- package/dist/esm/v3/raw/core/initialValues.js +65 -0
- package/dist/esm/v3/raw/core/issues.js +36 -0
- package/dist/esm/v3/raw/core/json.js +49 -0
- package/dist/esm/v3/raw/core/merge.js +47 -0
- package/dist/esm/v3/raw/core/paths.js +79 -0
- package/dist/esm/v3/raw/core/policies/fileUploadView.js +1 -0
- package/dist/esm/v3/raw/core/policies/optionalNumberInitial.js +3 -0
- package/dist/esm/v3/raw/core/policies/storedFormats.js +2 -0
- package/dist/esm/v3/raw/core/refs.js +97 -0
- package/dist/esm/v3/raw/core/schemaType.js +68 -0
- package/dist/esm/v3/raw/core/titles.js +25 -0
- package/dist/esm/v3/raw/core/trail.js +14 -0
- package/dist/esm/v3/raw/core/uiProps.js +68 -0
- package/dist/esm/v3/raw/core/uiSchema.js +47 -0
- package/dist/esm/v3/raw/dom/bind.js +80 -0
- package/dist/esm/v3/raw/dom/build.js +23 -0
- package/dist/esm/v3/raw/dom/controller.js +83 -0
- package/dist/esm/v3/raw/dom/core.js +63 -0
- package/dist/esm/v3/raw/dom/delegate.js +25 -0
- package/dist/esm/v3/raw/dom/effects.js +62 -0
- package/dist/esm/v3/raw/dom/elements.js +84 -0
- package/dist/esm/v3/raw/dom/emitter.js +43 -0
- package/dist/esm/v3/raw/dom/nodes.js +20 -0
- package/dist/esm/v3/raw/dom/render.js +118 -0
- package/dist/esm/v3/raw/dom/upload.js +182 -0
- package/dist/esm/v3/raw/i18n/en.js +44 -0
- package/dist/esm/v3/raw/i18n/fi.js +41 -0
- package/dist/esm/v3/raw/i18n/index.js +9 -0
- package/dist/esm/v3/raw/index.js +33 -0
- package/dist/esm/v3/raw/model/classes.js +5 -0
- package/dist/esm/v3/raw/model/form/actions.js +150 -0
- package/dist/esm/v3/raw/model/form/any.js +23 -0
- package/dist/esm/v3/raw/model/form/appearance.js +27 -0
- package/dist/esm/v3/raw/model/form/array.js +65 -0
- package/dist/esm/v3/raw/model/form/choice.js +65 -0
- package/dist/esm/v3/raw/model/form/chrome.js +58 -0
- package/dist/esm/v3/raw/model/form/componentTable.js +145 -0
- package/dist/esm/v3/raw/model/form/date.js +48 -0
- package/dist/esm/v3/raw/model/form/dispatch.js +114 -0
- package/dist/esm/v3/raw/model/form/iconData.js +16 -0
- package/dist/esm/v3/raw/model/form/icons.js +6 -0
- package/dist/esm/v3/raw/model/form/index.js +32 -0
- package/dist/esm/v3/raw/model/form/leaf.js +89 -0
- package/dist/esm/v3/raw/model/form/markup.js +35 -0
- package/dist/esm/v3/raw/model/form/object.js +100 -0
- package/dist/esm/v3/raw/model/form/parts.js +21 -0
- package/dist/esm/v3/raw/model/form/searchable.js +76 -0
- package/dist/esm/v3/raw/model/form/templated.js +17 -0
- package/dist/esm/v3/raw/model/form/upload.js +81 -0
- package/dist/esm/v3/raw/model/styledChains.js +40 -0
- package/dist/esm/v3/raw/model/view/build.js +158 -0
- package/dist/esm/v3/raw/model/view/fields.js +90 -0
- package/dist/esm/v3/raw/model/view/index.js +6 -0
- package/dist/esm/v3/raw/model/view/markup.js +48 -0
- package/dist/esm/v3/raw/model/view/toVNode.js +63 -0
- package/dist/esm/v3/raw/model/view/values.js +50 -0
- package/dist/esm/v3/raw/model/vnode.js +13 -0
- package/dist/esm/v3/raw/sanitize/index.js +2 -0
- package/dist/esm/v3/raw/sanitize/sanitizeHtml.js +119 -0
- package/dist/esm/v3/raw/serialize/toDOM.js +145 -0
- package/dist/esm/v3/raw/serialize/toString.js +52 -0
- package/dist/esm/v3/raw/store/createStore.js +126 -0
- package/dist/esm/v3/raw/styles/color.js +104 -0
- package/dist/esm/v3/raw/styles/colorNames.js +27 -0
- package/dist/esm/v3/raw/styles/defaultStyles.js +111 -0
- package/dist/esm/v3/raw/styles/index.js +14 -0
- package/dist/esm/v3/raw/styles/themeToCssVars.js +55 -0
- package/dist/esm/v3/raw/styles/vars.js +24 -0
- package/dist/esm/v3/raw/validation/arrays.js +40 -0
- package/dist/esm/v3/raw/validation/conditions.js +60 -0
- package/dist/esm/v3/raw/validation/index.js +146 -0
- package/dist/esm/v3/raw/validation/keywords.js +73 -0
- package/dist/esm/v3/raw/validation/messages.js +10 -0
- package/dist/esm/v3/raw/validation/patterns.js +68 -0
- package/dist/esm/v3/react/chain.js +4 -0
- package/dist/esm/v3/react/compat.js +8 -0
- package/dist/esm/v3/react/componentsProp.js +18 -0
- package/dist/esm/v3/react/defined.js +2 -0
- package/dist/esm/v3/react/ejs/EJSField.js +67 -0
- package/dist/esm/v3/react/ejs/index.js +3 -0
- package/dist/esm/v3/react/form/components.js +101 -0
- package/dist/esm/v3/react/form/fields.js +70 -0
- package/dist/esm/v3/react/form/host.js +95 -0
- package/dist/esm/{Form/FormRegistry.js → v3/react/form/registry.js} +5 -3
- package/dist/esm/v3/react/form/root.js +38 -0
- package/dist/esm/v3/react/form/runtime.js +113 -0
- package/dist/esm/v3/react/form/templates.js +55 -0
- package/dist/esm/v3/react/form/upload.js +168 -0
- package/dist/esm/v3/react/form/uploadContexts.js +24 -0
- package/dist/esm/v3/react/form/useSetDefault.js +17 -0
- package/dist/esm/v3/react/hostCore.js +52 -0
- package/dist/esm/v3/react/index.js +18 -0
- package/dist/esm/v3/react/selector.js +13 -0
- package/dist/esm/v3/react/slots.js +15 -0
- package/dist/esm/v3/react/toReact.js +58 -0
- package/dist/esm/v3/react/view/components.js +59 -0
- package/dist/esm/v3/react/view/fields.js +43 -0
- package/dist/esm/v3/react/view/host.js +32 -0
- package/dist/esm/v3/react/view/registry.js +16 -0
- package/dist/esm/v3/react/view/root.js +33 -0
- package/dist/esm/v3/react/view/templates.js +47 -0
- package/dist/types/common/types/Form.d.ts +9 -32
- package/dist/types/common/types/Utils.d.ts +11 -0
- package/dist/types/common/types/index.d.ts +2 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/v3/codemod/bindings.d.ts +18 -0
- package/dist/types/v3/codemod/cli.d.ts +2 -0
- package/dist/types/v3/codemod/migrate.d.ts +8 -0
- package/dist/types/v3/codemod/package.d.ts +2 -0
- package/dist/types/v3/codemod/slots.d.ts +13 -0
- package/dist/types/v3/codemod/transform.d.ts +29 -0
- package/dist/types/v3/document/fromDocument.d.ts +22 -0
- package/dist/types/v3/document/index.d.ts +4 -0
- package/dist/types/v3/document/render.d.ts +11 -0
- package/dist/types/v3/raw/compat/v2utils.d.ts +14 -0
- package/dist/types/v3/raw/core/arrays.d.ts +22 -0
- package/dist/types/v3/raw/core/choiceStyle.d.ts +4 -0
- package/dist/types/v3/raw/core/conditionals.d.ts +6 -0
- package/dist/types/v3/raw/core/dates.d.ts +8 -0
- package/dist/types/v3/raw/core/defaults.d.ts +15 -0
- package/dist/types/v3/raw/core/enums.d.ts +18 -0
- package/dist/types/v3/raw/core/initialValues.d.ts +12 -0
- package/dist/types/v3/raw/core/issues.d.ts +17 -0
- package/dist/types/v3/raw/core/json.d.ts +52 -0
- package/dist/types/v3/raw/core/merge.d.ts +6 -0
- package/dist/types/v3/raw/core/paths.d.ts +17 -0
- package/dist/types/v3/raw/core/policies/fileUploadView.d.ts +2 -0
- package/dist/types/v3/raw/core/policies/optionalNumberInitial.d.ts +4 -0
- package/dist/types/v3/raw/core/policies/storedFormats.d.ts +4 -0
- package/dist/types/v3/raw/core/refs.d.ts +41 -0
- package/dist/types/v3/raw/core/schemaType.d.ts +16 -0
- package/dist/types/v3/raw/core/titles.d.ts +2 -0
- package/dist/types/v3/raw/core/trail.d.ts +5 -0
- package/dist/types/v3/raw/core/uiProps.d.ts +12 -0
- package/dist/types/v3/raw/core/uiSchema.d.ts +19 -0
- package/dist/types/v3/raw/dom/bind.d.ts +2 -0
- package/dist/types/v3/raw/dom/build.d.ts +10 -0
- package/dist/types/v3/raw/dom/controller.d.ts +37 -0
- package/dist/types/v3/raw/dom/core.d.ts +43 -0
- package/dist/types/v3/raw/dom/delegate.d.ts +18 -0
- package/dist/types/v3/raw/dom/effects.d.ts +18 -0
- package/dist/types/v3/raw/dom/elements.d.ts +17 -0
- package/dist/types/v3/raw/dom/emitter.d.ts +8 -0
- package/dist/types/v3/raw/dom/nodes.d.ts +3 -0
- package/dist/types/v3/raw/dom/render.d.ts +2 -0
- package/dist/types/v3/raw/dom/types.d.ts +112 -0
- package/dist/types/v3/raw/dom/upload.d.ts +16 -0
- package/dist/types/v3/raw/i18n/en.d.ts +42 -0
- package/dist/types/v3/raw/i18n/fi.d.ts +2 -0
- package/dist/types/v3/raw/i18n/index.d.ts +9 -0
- package/dist/types/v3/raw/index.d.ts +43 -0
- package/dist/types/v3/raw/model/classes.d.ts +2 -0
- package/dist/types/v3/raw/model/form/actions.d.ts +41 -0
- package/dist/types/v3/raw/model/form/any.d.ts +5 -0
- package/dist/types/v3/raw/model/form/appearance.d.ts +9 -0
- package/dist/types/v3/raw/model/form/array.d.ts +4 -0
- package/dist/types/v3/raw/model/form/choice.d.ts +16 -0
- package/dist/types/v3/raw/model/form/chrome.d.ts +20 -0
- package/dist/types/v3/raw/model/form/componentTable.d.ts +2 -0
- package/dist/types/v3/raw/model/form/date.d.ts +13 -0
- package/dist/types/v3/raw/model/form/dispatch.d.ts +13 -0
- package/dist/types/v3/raw/model/form/iconData.d.ts +4 -0
- package/dist/types/v3/raw/model/form/icons.d.ts +2 -0
- package/dist/types/v3/raw/model/form/index.d.ts +38 -0
- package/dist/types/v3/raw/model/form/leaf.d.ts +29 -0
- package/dist/types/v3/raw/model/form/markup.d.ts +39 -0
- package/dist/types/v3/raw/model/form/object.d.ts +9 -0
- package/dist/types/v3/raw/model/form/parts.d.ts +10 -0
- package/dist/types/v3/raw/model/form/searchable.d.ts +5 -0
- package/dist/types/v3/raw/model/form/templated.d.ts +14 -0
- package/dist/types/v3/raw/model/form/types.d.ts +179 -0
- package/dist/types/v3/raw/model/form/upload.d.ts +28 -0
- package/dist/types/v3/raw/model/host.d.ts +46 -0
- package/dist/types/v3/raw/model/styledChains.d.ts +1 -0
- package/dist/types/v3/raw/model/view/build.d.ts +21 -0
- package/dist/types/v3/raw/model/view/fields.d.ts +31 -0
- package/dist/types/v3/raw/model/view/index.d.ts +6 -0
- package/dist/types/v3/raw/model/view/markup.d.ts +39 -0
- package/dist/types/v3/raw/model/view/toVNode.d.ts +3 -0
- package/dist/types/v3/raw/model/view/types.d.ts +109 -0
- package/dist/types/v3/raw/model/view/values.d.ts +10 -0
- package/dist/types/v3/raw/model/vnode.d.ts +24 -0
- package/dist/types/v3/raw/sanitize/index.d.ts +2 -0
- package/dist/types/v3/raw/sanitize/sanitizeHtml.d.ts +30 -0
- package/dist/types/v3/raw/serialize/toDOM.d.ts +14 -0
- package/dist/types/v3/raw/serialize/toString.d.ts +4 -0
- package/dist/types/v3/raw/store/createStore.d.ts +39 -0
- package/dist/types/v3/raw/styles/color.d.ts +15 -0
- package/dist/types/v3/raw/styles/colorNames.d.ts +1 -0
- package/dist/types/v3/raw/styles/defaultStyles.d.ts +1 -0
- package/dist/types/v3/raw/styles/index.d.ts +8 -0
- package/dist/types/v3/raw/styles/themeToCssVars.d.ts +4 -0
- package/dist/types/v3/raw/styles/vars.d.ts +43 -0
- package/dist/types/v3/raw/validation/arrays.d.ts +16 -0
- package/dist/types/v3/raw/validation/conditions.d.ts +10 -0
- package/dist/types/v3/raw/validation/index.d.ts +30 -0
- package/dist/types/v3/raw/validation/keywords.d.ts +10 -0
- package/dist/types/v3/raw/validation/messages.d.ts +8 -0
- package/dist/types/v3/raw/validation/patterns.d.ts +8 -0
- package/dist/types/v3/react/chain.d.ts +1 -0
- package/dist/types/v3/react/compat.d.ts +4 -0
- package/dist/types/v3/react/componentsProp.d.ts +5 -0
- package/dist/types/v3/react/defined.d.ts +1 -0
- package/dist/types/v3/react/ejs/EJSField.d.ts +14 -0
- package/dist/types/v3/react/ejs/index.d.ts +1 -0
- package/dist/types/v3/react/form/components.d.ts +3 -0
- package/dist/types/v3/react/form/fields.d.ts +8 -0
- package/dist/types/v3/react/form/host.d.ts +9 -0
- package/dist/types/v3/react/form/registry.d.ts +46 -0
- package/dist/types/v3/react/form/root.d.ts +32 -0
- package/dist/types/v3/react/form/runtime.d.ts +3 -0
- package/dist/types/v3/react/form/templates.d.ts +1 -0
- package/dist/types/v3/react/form/upload.d.ts +3 -0
- package/dist/types/v3/react/form/uploadContexts.d.ts +34 -0
- package/dist/types/v3/react/form/useSetDefault.d.ts +5 -0
- package/dist/types/v3/react/hostCore.d.ts +24 -0
- package/dist/types/v3/react/index.d.ts +23 -0
- package/dist/types/v3/react/selector.d.ts +10 -0
- package/dist/types/v3/react/slots.d.ts +4 -0
- package/dist/types/v3/react/toReact.d.ts +10 -0
- package/dist/types/v3/react/view/components.d.ts +8 -0
- package/dist/types/v3/react/view/fields.d.ts +4 -0
- package/dist/types/v3/react/view/host.d.ts +6 -0
- package/dist/types/v3/react/view/registry.d.ts +34 -0
- package/dist/types/v3/react/view/root.d.ts +32 -0
- package/dist/types/v3/react/view/templates.d.ts +15 -0
- package/package.json +97 -11
- package/styles.css +187 -0
- package/dist/cjs/Form/Form.js +0 -38
- package/dist/cjs/Form/components/Clickable.js +0 -11
- package/dist/cjs/Form/components/ErrorMessage.js +0 -23
- package/dist/cjs/Form/components/FieldInfo.js +0 -144
- package/dist/cjs/Form/components/FieldInput.js +0 -86
- package/dist/cjs/Form/components/Form.js +0 -52
- package/dist/cjs/Form/components/Icon.js +0 -5
- package/dist/cjs/Form/components/RequiredIndicator.js +0 -9
- package/dist/cjs/Form/components/index.js +0 -58
- package/dist/cjs/Form/fields/AnyField/AnyField.js +0 -30
- package/dist/cjs/Form/fields/AnyField/index.js +0 -38
- package/dist/cjs/Form/fields/AnyField/styledComponents.js +0 -6
- package/dist/cjs/Form/fields/ArrayField/ArrayField.js +0 -130
- package/dist/cjs/Form/fields/ArrayField/index.js +0 -38
- package/dist/cjs/Form/fields/ArrayField/styledComponents.js +0 -22
- package/dist/cjs/Form/fields/BooleanField/BooleanField.js +0 -26
- package/dist/cjs/Form/fields/BooleanField/index.js +0 -38
- package/dist/cjs/Form/fields/BooleanField/styledComponents.js +0 -18
- package/dist/cjs/Form/fields/DateField/DateField.js +0 -26
- package/dist/cjs/Form/fields/DateField/DateInput.js +0 -121
- package/dist/cjs/Form/fields/DateField/dateParsing.js +0 -68
- package/dist/cjs/Form/fields/DateField/index.js +0 -42
- package/dist/cjs/Form/fields/DateField/styledComponents.js +0 -60
- package/dist/cjs/Form/fields/FileUploadField/FileUploadField.js +0 -69
- package/dist/cjs/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -21
- package/dist/cjs/Form/fields/FileUploadField/index.js +0 -41
- package/dist/cjs/Form/fields/FileUploadField/styledComponents.js +0 -63
- package/dist/cjs/Form/fields/FilesUploadField/FilesUploadField.js +0 -102
- package/dist/cjs/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -174
- package/dist/cjs/Form/fields/FilesUploadField/index.js +0 -41
- package/dist/cjs/Form/fields/FilesUploadField/styledComponents.js +0 -217
- package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -35
- package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -40
- package/dist/cjs/Form/fields/MultipleChoiceField/index.js +0 -41
- package/dist/cjs/Form/fields/MultipleChoiceField/styledComponents.js +0 -24
- package/dist/cjs/Form/fields/NullField/NullField.js +0 -15
- package/dist/cjs/Form/fields/NullField/index.js +0 -37
- package/dist/cjs/Form/fields/NumberField/NumberField.js +0 -16
- package/dist/cjs/Form/fields/NumberField/index.js +0 -38
- package/dist/cjs/Form/fields/NumberField/styledComponents.js +0 -6
- package/dist/cjs/Form/fields/ObjectField/ObjectField.js +0 -190
- package/dist/cjs/Form/fields/ObjectField/ObjectFieldSection.js +0 -17
- package/dist/cjs/Form/fields/ObjectField/index.js +0 -41
- package/dist/cjs/Form/fields/ObjectField/styledComponents.js +0 -50
- package/dist/cjs/Form/fields/ObjectField/types.js +0 -10
- package/dist/cjs/Form/fields/RadioField/RadioField.js +0 -19
- package/dist/cjs/Form/fields/RadioField/RadioFieldInput.js +0 -11
- package/dist/cjs/Form/fields/RadioField/index.js +0 -41
- package/dist/cjs/Form/fields/RadioField/styledComponents.js +0 -78
- package/dist/cjs/Form/fields/SchemaField/SchemaField.js +0 -38
- package/dist/cjs/Form/fields/SchemaField/index.js +0 -37
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -20
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -27
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/index.js +0 -41
- package/dist/cjs/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -71
- package/dist/cjs/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -147
- package/dist/cjs/Form/fields/SearchableSelectField/index.js +0 -40
- package/dist/cjs/Form/fields/SearchableSelectField/styledComponents.js +0 -53
- package/dist/cjs/Form/fields/StringField/StringField.js +0 -44
- package/dist/cjs/Form/fields/StringField/index.js +0 -37
- package/dist/cjs/Form/fields/StringField/styledComponents.js +0 -6
- package/dist/cjs/Form/fields/TextAreaField/TextAreaField.js +0 -21
- package/dist/cjs/Form/fields/TextAreaField/index.js +0 -38
- package/dist/cjs/Form/fields/TextAreaField/styledComponents.js +0 -17
- package/dist/cjs/Form/fields/ToggleField/ToggleField.js +0 -19
- package/dist/cjs/Form/fields/ToggleField/ToggleFieldInput.js +0 -11
- package/dist/cjs/Form/fields/ToggleField/index.js +0 -41
- package/dist/cjs/Form/fields/ToggleField/styledComponents.js +0 -58
- package/dist/cjs/Form/fields/index.js +0 -93
- package/dist/cjs/Form/hooks/index.js +0 -17
- package/dist/cjs/Form/hooks/useSetDefault.js +0 -32
- package/dist/cjs/Form/index.js +0 -26
- package/dist/cjs/Form/styles/common.js +0 -259
- package/dist/cjs/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -36
- package/dist/cjs/Form/templates/ArrayFieldTemplate/index.js +0 -38
- package/dist/cjs/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -28
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -41
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -38
- package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -55
- package/dist/cjs/Form/templates/FieldTemplate/FieldTemplate.js +0 -28
- package/dist/cjs/Form/templates/FieldTemplate/index.js +0 -37
- package/dist/cjs/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -32
- package/dist/cjs/Form/templates/ObjectFieldTemplate/index.js +0 -38
- package/dist/cjs/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -57
- package/dist/cjs/Form/templates/index.js +0 -55
- package/dist/cjs/Form/types/index.js +0 -17
- package/dist/cjs/FormView/FormView.js +0 -36
- package/dist/cjs/FormView/FormViewRegistry.js +0 -19
- package/dist/cjs/FormView/components/Field.js +0 -131
- package/dist/cjs/FormView/components/Form.js +0 -9
- package/dist/cjs/FormView/components/Icon.js +0 -7
- package/dist/cjs/FormView/components/index.js +0 -56
- package/dist/cjs/FormView/fields/AnyField.js +0 -26
- package/dist/cjs/FormView/fields/ArrayField.js +0 -32
- package/dist/cjs/FormView/fields/BooleanField.js +0 -33
- package/dist/cjs/FormView/fields/DateField.js +0 -12
- package/dist/cjs/FormView/fields/EJSField.js +0 -39
- package/dist/cjs/FormView/fields/FileUploadField.js +0 -7
- package/dist/cjs/FormView/fields/FilesUploadField.js +0 -7
- package/dist/cjs/FormView/fields/MultipleChoiceField.js +0 -30
- package/dist/cjs/FormView/fields/NullField.js +0 -14
- package/dist/cjs/FormView/fields/NumberField.js +0 -12
- package/dist/cjs/FormView/fields/ObjectField/ObjectField.js +0 -57
- package/dist/cjs/FormView/fields/ObjectField/ObjectFieldSection.js +0 -11
- package/dist/cjs/FormView/fields/ObjectField/index.js +0 -41
- package/dist/cjs/FormView/fields/ObjectField/styledComponents.js +0 -6
- package/dist/cjs/FormView/fields/RadioField.js +0 -15
- package/dist/cjs/FormView/fields/SchemaField.js +0 -38
- package/dist/cjs/FormView/fields/SearchableMultiTagSelectField.js +0 -14
- package/dist/cjs/FormView/fields/SearchableSelectField.js +0 -13
- package/dist/cjs/FormView/fields/StringField.js +0 -24
- package/dist/cjs/FormView/fields/TextAreaField.js +0 -18
- package/dist/cjs/FormView/fields/ToggleField.js +0 -15
- package/dist/cjs/FormView/fields/index.js +0 -81
- package/dist/cjs/FormView/index.js +0 -25
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -20
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/index.js +0 -38
- package/dist/cjs/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -15
- package/dist/cjs/FormView/templates/FieldTemplate/FieldTemplate.js +0 -18
- package/dist/cjs/FormView/templates/FieldTemplate/index.js +0 -37
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -30
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/index.js +0 -38
- package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -65
- package/dist/cjs/FormView/templates/index.js +0 -52
- package/dist/cjs/common/FileUploadContext.js +0 -15
- package/dist/cjs/common/FilesUploadContext.js +0 -14
- package/dist/cjs/common/constants.js +0 -13
- package/dist/cjs/common/index.js +0 -20
- package/dist/cjs/utils/createInitialValues.js +0 -38
- package/dist/cjs/utils/createValidationSchema.js +0 -397
- package/dist/cjs/utils/deepOverlap.js +0 -18
- package/dist/cjs/utils/extractUiSchema.js +0 -22
- package/dist/cjs/utils/getEnums.js +0 -56
- package/dist/cjs/utils/getHiddenProperties.js +0 -11
- package/dist/cjs/utils/getStyle.js +0 -21
- package/dist/cjs/utils/getTitleAndDescription.js +0 -19
- package/dist/cjs/utils/getTypes.js +0 -60
- package/dist/cjs/utils/immutablySwapItems.js +0 -10
- package/dist/cjs/utils/index.js +0 -31
- package/dist/cjs/utils/mergeSchemas.js +0 -30
- package/dist/cjs/utils/orderAdditionalProperties.js +0 -12
- package/dist/cjs/utils/orderByUiSchema.js +0 -29
- package/dist/cjs/utils/resolveSchema.js +0 -117
- package/dist/cjs/utils/setTitleValues.js +0 -25
- package/dist/cjs/utils/solveReferences.js +0 -25
- package/dist/esm/Form/Form.js +0 -34
- package/dist/esm/Form/components/Clickable.js +0 -7
- package/dist/esm/Form/components/ErrorMessage.js +0 -16
- package/dist/esm/Form/components/FieldInfo.js +0 -140
- package/dist/esm/Form/components/FieldInput.js +0 -50
- package/dist/esm/Form/components/Form.js +0 -13
- package/dist/esm/Form/components/Icon.js +0 -2
- package/dist/esm/Form/components/RequiredIndicator.js +0 -6
- package/dist/esm/Form/components/index.js +0 -22
- package/dist/esm/Form/fields/AnyField/AnyField.js +0 -26
- package/dist/esm/Form/fields/AnyField/index.js +0 -2
- package/dist/esm/Form/fields/AnyField/styledComponents.js +0 -3
- package/dist/esm/Form/fields/ArrayField/ArrayField.js +0 -126
- package/dist/esm/Form/fields/ArrayField/index.js +0 -2
- package/dist/esm/Form/fields/ArrayField/styledComponents.js +0 -16
- package/dist/esm/Form/fields/BooleanField/BooleanField.js +0 -22
- package/dist/esm/Form/fields/BooleanField/index.js +0 -2
- package/dist/esm/Form/fields/BooleanField/styledComponents.js +0 -15
- package/dist/esm/Form/fields/DateField/DateField.js +0 -22
- package/dist/esm/Form/fields/DateField/DateInput.js +0 -117
- package/dist/esm/Form/fields/DateField/dateParsing.js +0 -62
- package/dist/esm/Form/fields/DateField/index.js +0 -3
- package/dist/esm/Form/fields/DateField/styledComponents.js +0 -54
- package/dist/esm/Form/fields/FileUploadField/FileUploadField.js +0 -65
- package/dist/esm/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -17
- package/dist/esm/Form/fields/FileUploadField/index.js +0 -5
- package/dist/esm/Form/fields/FileUploadField/styledComponents.js +0 -57
- package/dist/esm/Form/fields/FilesUploadField/FilesUploadField.js +0 -98
- package/dist/esm/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -137
- package/dist/esm/Form/fields/FilesUploadField/index.js +0 -5
- package/dist/esm/Form/fields/FilesUploadField/styledComponents.js +0 -211
- package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -31
- package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -36
- package/dist/esm/Form/fields/MultipleChoiceField/index.js +0 -5
- package/dist/esm/Form/fields/MultipleChoiceField/styledComponents.js +0 -18
- package/dist/esm/Form/fields/NullField/NullField.js +0 -11
- package/dist/esm/Form/fields/NullField/index.js +0 -1
- package/dist/esm/Form/fields/NumberField/NumberField.js +0 -12
- package/dist/esm/Form/fields/NumberField/index.js +0 -2
- package/dist/esm/Form/fields/NumberField/styledComponents.js +0 -3
- package/dist/esm/Form/fields/ObjectField/ObjectField.js +0 -186
- package/dist/esm/Form/fields/ObjectField/ObjectFieldSection.js +0 -13
- package/dist/esm/Form/fields/ObjectField/index.js +0 -5
- package/dist/esm/Form/fields/ObjectField/styledComponents.js +0 -47
- package/dist/esm/Form/fields/ObjectField/types.js +0 -7
- package/dist/esm/Form/fields/RadioField/RadioField.js +0 -15
- package/dist/esm/Form/fields/RadioField/RadioFieldInput.js +0 -7
- package/dist/esm/Form/fields/RadioField/index.js +0 -5
- package/dist/esm/Form/fields/RadioField/styledComponents.js +0 -75
- package/dist/esm/Form/fields/SchemaField/SchemaField.js +0 -34
- package/dist/esm/Form/fields/SchemaField/index.js +0 -1
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -16
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -23
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/index.js +0 -5
- package/dist/esm/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -68
- package/dist/esm/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -143
- package/dist/esm/Form/fields/SearchableSelectField/index.js +0 -4
- package/dist/esm/Form/fields/SearchableSelectField/styledComponents.js +0 -50
- package/dist/esm/Form/fields/StringField/StringField.js +0 -40
- package/dist/esm/Form/fields/StringField/index.js +0 -1
- package/dist/esm/Form/fields/StringField/styledComponents.js +0 -3
- package/dist/esm/Form/fields/TextAreaField/TextAreaField.js +0 -17
- package/dist/esm/Form/fields/TextAreaField/index.js +0 -2
- package/dist/esm/Form/fields/TextAreaField/styledComponents.js +0 -11
- package/dist/esm/Form/fields/ToggleField/ToggleField.js +0 -15
- package/dist/esm/Form/fields/ToggleField/ToggleFieldInput.js +0 -7
- package/dist/esm/Form/fields/ToggleField/index.js +0 -5
- package/dist/esm/Form/fields/ToggleField/styledComponents.js +0 -55
- package/dist/esm/Form/fields/index.js +0 -57
- package/dist/esm/Form/hooks/index.js +0 -1
- package/dist/esm/Form/hooks/useSetDefault.js +0 -28
- package/dist/esm/Form/index.js +0 -7
- package/dist/esm/Form/styles/common.js +0 -256
- package/dist/esm/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -32
- package/dist/esm/Form/templates/ArrayFieldTemplate/index.js +0 -2
- package/dist/esm/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -24
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -37
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -2
- package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -51
- package/dist/esm/Form/templates/FieldTemplate/FieldTemplate.js +0 -24
- package/dist/esm/Form/templates/FieldTemplate/index.js +0 -1
- package/dist/esm/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -28
- package/dist/esm/Form/templates/ObjectFieldTemplate/index.js +0 -2
- package/dist/esm/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -53
- package/dist/esm/Form/templates/index.js +0 -19
- package/dist/esm/Form/types/index.js +0 -1
- package/dist/esm/FormView/FormView.js +0 -29
- package/dist/esm/FormView/FormViewRegistry.js +0 -13
- package/dist/esm/FormView/components/Field.js +0 -123
- package/dist/esm/FormView/components/Form.js +0 -6
- package/dist/esm/FormView/components/Icon.js +0 -4
- package/dist/esm/FormView/components/index.js +0 -17
- package/dist/esm/FormView/fields/AnyField.js +0 -22
- package/dist/esm/FormView/fields/ArrayField.js +0 -28
- package/dist/esm/FormView/fields/BooleanField.js +0 -29
- package/dist/esm/FormView/fields/DateField.js +0 -8
- package/dist/esm/FormView/fields/EJSField.js +0 -32
- package/dist/esm/FormView/fields/FileUploadField.js +0 -3
- package/dist/esm/FormView/fields/FilesUploadField.js +0 -3
- package/dist/esm/FormView/fields/MultipleChoiceField.js +0 -26
- package/dist/esm/FormView/fields/NullField.js +0 -10
- package/dist/esm/FormView/fields/NumberField.js +0 -8
- package/dist/esm/FormView/fields/ObjectField/ObjectField.js +0 -53
- package/dist/esm/FormView/fields/ObjectField/ObjectFieldSection.js +0 -7
- package/dist/esm/FormView/fields/ObjectField/index.js +0 -5
- package/dist/esm/FormView/fields/ObjectField/styledComponents.js +0 -3
- package/dist/esm/FormView/fields/RadioField.js +0 -11
- package/dist/esm/FormView/fields/SchemaField.js +0 -34
- package/dist/esm/FormView/fields/SearchableMultiTagSelectField.js +0 -10
- package/dist/esm/FormView/fields/SearchableSelectField.js +0 -9
- package/dist/esm/FormView/fields/StringField.js +0 -20
- package/dist/esm/FormView/fields/TextAreaField.js +0 -14
- package/dist/esm/FormView/fields/ToggleField.js +0 -11
- package/dist/esm/FormView/fields/index.js +0 -45
- package/dist/esm/FormView/index.js +0 -6
- package/dist/esm/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -16
- package/dist/esm/FormView/templates/ArrayFieldTemplate/index.js +0 -2
- package/dist/esm/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -11
- package/dist/esm/FormView/templates/FieldTemplate/FieldTemplate.js +0 -14
- package/dist/esm/FormView/templates/FieldTemplate/index.js +0 -1
- package/dist/esm/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -26
- package/dist/esm/FormView/templates/ObjectFieldTemplate/index.js +0 -2
- package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -58
- package/dist/esm/FormView/templates/index.js +0 -16
- package/dist/esm/common/FileUploadContext.js +0 -12
- package/dist/esm/common/FilesUploadContext.js +0 -11
- package/dist/esm/common/constants.js +0 -10
- package/dist/esm/common/index.js +0 -4
- package/dist/esm/utils/createInitialValues.js +0 -35
- package/dist/esm/utils/createValidationSchema.js +0 -361
- package/dist/esm/utils/deepOverlap.js +0 -14
- package/dist/esm/utils/extractUiSchema.js +0 -18
- package/dist/esm/utils/getEnums.js +0 -51
- package/dist/esm/utils/getHiddenProperties.js +0 -7
- package/dist/esm/utils/getStyle.js +0 -18
- package/dist/esm/utils/getTitleAndDescription.js +0 -14
- package/dist/esm/utils/getTypes.js +0 -53
- package/dist/esm/utils/immutablySwapItems.js +0 -7
- package/dist/esm/utils/index.js +0 -15
- package/dist/esm/utils/mergeSchemas.js +0 -26
- package/dist/esm/utils/orderAdditionalProperties.js +0 -9
- package/dist/esm/utils/orderByUiSchema.js +0 -26
- package/dist/esm/utils/resolveSchema.js +0 -112
- package/dist/esm/utils/setTitleValues.js +0 -21
- package/dist/esm/utils/solveReferences.js +0 -22
- package/dist/types/Form/Form.d.ts +0 -2
- package/dist/types/Form/FormRegistry.d.ts +0 -3
- package/dist/types/Form/components/Clickable.d.ts +0 -15
- package/dist/types/Form/components/ErrorMessage.d.ts +0 -3
- package/dist/types/Form/components/FieldInfo.d.ts +0 -10
- package/dist/types/Form/components/FieldInput.d.ts +0 -19
- package/dist/types/Form/components/Form.d.ts +0 -6
- package/dist/types/Form/components/Icon.d.ts +0 -1
- package/dist/types/Form/components/RequiredIndicator.d.ts +0 -1
- package/dist/types/Form/components/index.d.ts +0 -249
- package/dist/types/Form/fields/AnyField/AnyField.d.ts +0 -2
- package/dist/types/Form/fields/AnyField/index.d.ts +0 -2
- package/dist/types/Form/fields/AnyField/styledComponents.d.ts +0 -3
- package/dist/types/Form/fields/ArrayField/ArrayField.d.ts +0 -2
- package/dist/types/Form/fields/ArrayField/index.d.ts +0 -2
- package/dist/types/Form/fields/ArrayField/styledComponents.d.ts +0 -13
- package/dist/types/Form/fields/BooleanField/BooleanField.d.ts +0 -2
- package/dist/types/Form/fields/BooleanField/index.d.ts +0 -2
- package/dist/types/Form/fields/BooleanField/styledComponents.d.ts +0 -3
- package/dist/types/Form/fields/DateField/DateField.d.ts +0 -2
- package/dist/types/Form/fields/DateField/DateInput.d.ts +0 -17
- package/dist/types/Form/fields/DateField/dateParsing.d.ts +0 -9
- package/dist/types/Form/fields/DateField/index.d.ts +0 -3
- package/dist/types/Form/fields/DateField/styledComponents.d.ts +0 -4
- package/dist/types/Form/fields/FileUploadField/FileUploadField.d.ts +0 -2
- package/dist/types/Form/fields/FileUploadField/FileUploadFieldInput.d.ts +0 -25
- package/dist/types/Form/fields/FileUploadField/index.d.ts +0 -17
- package/dist/types/Form/fields/FileUploadField/styledComponents.d.ts +0 -11
- package/dist/types/Form/fields/FilesUploadField/FilesUploadField.d.ts +0 -2
- package/dist/types/Form/fields/FilesUploadField/FilesUploadFieldInput.d.ts +0 -42
- package/dist/types/Form/fields/FilesUploadField/index.d.ts +0 -37
- package/dist/types/Form/fields/FilesUploadField/styledComponents.d.ts +0 -32
- package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceField.d.ts +0 -2
- package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.d.ts +0 -17
- package/dist/types/Form/fields/MultipleChoiceField/index.d.ts +0 -22
- package/dist/types/Form/fields/MultipleChoiceField/styledComponents.d.ts +0 -16
- package/dist/types/Form/fields/NullField/NullField.d.ts +0 -2
- package/dist/types/Form/fields/NullField/index.d.ts +0 -1
- package/dist/types/Form/fields/NumberField/NumberField.d.ts +0 -2
- package/dist/types/Form/fields/NumberField/index.d.ts +0 -2
- package/dist/types/Form/fields/NumberField/styledComponents.d.ts +0 -1
- package/dist/types/Form/fields/ObjectField/ObjectField.d.ts +0 -2
- package/dist/types/Form/fields/ObjectField/ObjectFieldSection.d.ts +0 -3
- package/dist/types/Form/fields/ObjectField/index.d.ts +0 -20
- package/dist/types/Form/fields/ObjectField/styledComponents.d.ts +0 -15
- package/dist/types/Form/fields/ObjectField/types.d.ts +0 -19
- package/dist/types/Form/fields/RadioField/RadioField.d.ts +0 -2
- package/dist/types/Form/fields/RadioField/RadioFieldInput.d.ts +0 -11
- package/dist/types/Form/fields/RadioField/index.d.ts +0 -22
- package/dist/types/Form/fields/RadioField/styledComponents.d.ts +0 -16
- package/dist/types/Form/fields/SchemaField/SchemaField.d.ts +0 -2
- package/dist/types/Form/fields/SchemaField/index.d.ts +0 -1
- package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.d.ts +0 -2
- package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.d.ts +0 -11
- package/dist/types/Form/fields/SearchableMultiTagSelectField/index.d.ts +0 -21
- package/dist/types/Form/fields/SearchableMultiTagSelectField/styledComponents.d.ts +0 -15
- package/dist/types/Form/fields/SearchableSelectField/SearchableSelectField.d.ts +0 -2
- package/dist/types/Form/fields/SearchableSelectField/index.d.ts +0 -2
- package/dist/types/Form/fields/SearchableSelectField/styledComponents.d.ts +0 -22
- package/dist/types/Form/fields/SearchableSelectField/types.d.ts +0 -25
- package/dist/types/Form/fields/StringField/StringField.d.ts +0 -2
- package/dist/types/Form/fields/StringField/index.d.ts +0 -1
- package/dist/types/Form/fields/StringField/styledComponents.d.ts +0 -3
- package/dist/types/Form/fields/TextAreaField/TextAreaField.d.ts +0 -2
- package/dist/types/Form/fields/TextAreaField/index.d.ts +0 -2
- package/dist/types/Form/fields/TextAreaField/styledComponents.d.ts +0 -5
- package/dist/types/Form/fields/ToggleField/ToggleField.d.ts +0 -2
- package/dist/types/Form/fields/ToggleField/ToggleFieldInput.d.ts +0 -6
- package/dist/types/Form/fields/ToggleField/index.d.ts +0 -13
- package/dist/types/Form/fields/ToggleField/styledComponents.d.ts +0 -7
- package/dist/types/Form/fields/index.d.ts +0 -191
- package/dist/types/Form/hooks/index.d.ts +0 -1
- package/dist/types/Form/hooks/useSetDefault.d.ts +0 -2
- package/dist/types/Form/index.d.ts +0 -8
- package/dist/types/Form/styles/common.d.ts +0 -2
- package/dist/types/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
- package/dist/types/Form/templates/ArrayFieldTemplate/index.d.ts +0 -2
- package/dist/types/Form/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -30
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.d.ts +0 -2
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/index.d.ts +0 -2
- package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.d.ts +0 -36
- package/dist/types/Form/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
- package/dist/types/Form/templates/FieldTemplate/index.d.ts +0 -1
- package/dist/types/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
- package/dist/types/Form/templates/ObjectFieldTemplate/index.d.ts +0 -2
- package/dist/types/Form/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -27
- package/dist/types/Form/templates/index.d.ts +0 -57
- package/dist/types/Form/types/FormRegistryContext.d.ts +0 -23
- package/dist/types/Form/types/index.d.ts +0 -1
- package/dist/types/FormView/FormView.d.ts +0 -4
- package/dist/types/FormView/FormViewRegistry.d.ts +0 -3
- package/dist/types/FormView/components/Field.d.ts +0 -35
- package/dist/types/FormView/components/Form.d.ts +0 -1
- package/dist/types/FormView/components/Icon.d.ts +0 -1
- package/dist/types/FormView/components/index.d.ts +0 -53
- package/dist/types/FormView/fields/AnyField.d.ts +0 -2
- package/dist/types/FormView/fields/ArrayField.d.ts +0 -2
- package/dist/types/FormView/fields/BooleanField.d.ts +0 -2
- package/dist/types/FormView/fields/DateField.d.ts +0 -2
- package/dist/types/FormView/fields/EJSField.d.ts +0 -2
- package/dist/types/FormView/fields/FileUploadField.d.ts +0 -2
- package/dist/types/FormView/fields/FilesUploadField.d.ts +0 -2
- package/dist/types/FormView/fields/MultipleChoiceField.d.ts +0 -2
- package/dist/types/FormView/fields/NullField.d.ts +0 -2
- package/dist/types/FormView/fields/NumberField.d.ts +0 -2
- package/dist/types/FormView/fields/ObjectField/ObjectField.d.ts +0 -2
- package/dist/types/FormView/fields/ObjectField/ObjectFieldSection.d.ts +0 -7
- package/dist/types/FormView/fields/ObjectField/index.d.ts +0 -8
- package/dist/types/FormView/fields/ObjectField/styledComponents.d.ts +0 -2
- package/dist/types/FormView/fields/RadioField.d.ts +0 -2
- package/dist/types/FormView/fields/SchemaField.d.ts +0 -2
- package/dist/types/FormView/fields/SearchableMultiTagSelectField.d.ts +0 -2
- package/dist/types/FormView/fields/SearchableSelectField.d.ts +0 -2
- package/dist/types/FormView/fields/StringField.d.ts +0 -2
- package/dist/types/FormView/fields/TextAreaField.d.ts +0 -2
- package/dist/types/FormView/fields/ToggleField.d.ts +0 -2
- package/dist/types/FormView/fields/index.d.ts +0 -9
- package/dist/types/FormView/index.d.ts +0 -7
- package/dist/types/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
- package/dist/types/FormView/templates/ArrayFieldTemplate/index.d.ts +0 -2
- package/dist/types/FormView/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -10
- package/dist/types/FormView/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
- package/dist/types/FormView/templates/FieldTemplate/index.d.ts +0 -1
- package/dist/types/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
- package/dist/types/FormView/templates/ObjectFieldTemplate/index.d.ts +0 -2
- package/dist/types/FormView/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -10
- package/dist/types/FormView/templates/index.d.ts +0 -23
- package/dist/types/FormView/types/FormViewRegistryContext.d.ts +0 -21
- package/dist/types/FormView/types/index.d.ts +0 -1
- package/dist/types/common/FileUploadContext.d.ts +0 -18
- package/dist/types/common/FilesUploadContext.d.ts +0 -17
- package/dist/types/common/constants.d.ts +0 -10
- package/dist/types/common/index.d.ts +0 -4
- package/dist/types/styles/types.d.ts +0 -216
- package/dist/types/utils/createInitialValues.d.ts +0 -7
- package/dist/types/utils/createValidationSchema.d.ts +0 -31
- package/dist/types/utils/deepOverlap.d.ts +0 -1
- package/dist/types/utils/extractUiSchema.d.ts +0 -9
- package/dist/types/utils/getEnums.d.ts +0 -30
- package/dist/types/utils/getHiddenProperties.d.ts +0 -2
- package/dist/types/utils/getStyle.d.ts +0 -5
- package/dist/types/utils/getTitleAndDescription.d.ts +0 -12
- package/dist/types/utils/getTypes.d.ts +0 -5
- package/dist/types/utils/immutablySwapItems.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -15
- package/dist/types/utils/mergeSchemas.d.ts +0 -1
- package/dist/types/utils/orderAdditionalProperties.d.ts +0 -2
- package/dist/types/utils/orderByUiSchema.d.ts +0 -2
- package/dist/types/utils/resolveSchema.d.ts +0 -4
- package/dist/types/utils/setTitleValues.d.ts +0 -1
- package/dist/types/utils/solveReferences.d.ts +0 -10
- /package/dist/cjs/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
- /package/dist/cjs/{styles → v3/raw/dom}/types.js +0 -0
- /package/dist/cjs/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
- /package/dist/cjs/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
- /package/dist/cjs/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
- /package/dist/esm/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
- /package/dist/esm/{styles → v3/raw/dom}/types.js +0 -0
- /package/dist/esm/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
- /package/dist/esm/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
- /package/dist/esm/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
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 ObjectFieldTemplate = (props) => {
|
|
7
|
-
const { components } = useContext(FormViewRegistry);
|
|
8
|
-
const { Wrapper, Title, Description } = getComponents(components);
|
|
9
|
-
const { children, 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, } = {}, } = useMemo(() => extractUiSchema(uiSchema), [uiSchema]);
|
|
15
|
-
const dataAttributes = Object.keys(otherProps)
|
|
16
|
-
.filter((key) => key.startsWith("data-"))
|
|
17
|
-
.reduce((acc, key) => {
|
|
18
|
-
acc[key] = otherProps[key];
|
|
19
|
-
return acc;
|
|
20
|
-
}, {});
|
|
21
|
-
const mergedWrapperProps = {
|
|
22
|
-
...wrapperProps,
|
|
23
|
-
...dataAttributes,
|
|
24
|
-
};
|
|
25
|
-
return (_jsxs(Wrapper, { ...mergedWrapperProps, children: [title && _jsx(Title, { ...titleProps, children: title }), description && (_jsx(Description, { ...descriptionProps, children: description })), children] }));
|
|
26
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
export const ObjectFieldTemplateWrapper = styled.div `
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
gap: ${(props) => props.theme.spacing.l};
|
|
6
|
-
|
|
7
|
-
&[data-fjsf-level="1"],
|
|
8
|
-
&[data-fjsf-level="2"] {
|
|
9
|
-
@media print {
|
|
10
|
-
display: block;
|
|
11
|
-
break-inside: auto;
|
|
12
|
-
page-break-inside: auto;
|
|
13
|
-
|
|
14
|
-
& > div {
|
|
15
|
-
margin-bottom: 1rem;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
& > div:last-child {
|
|
19
|
-
margin-bottom: 0;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
export const ObjectFieldTemplateTitle = styled.div `
|
|
25
|
-
color: ${(props) => props.theme.color.text.default};
|
|
26
|
-
font-family: ${(props) => props.theme.typography.fontFamily.base};
|
|
27
|
-
font-size: ${(props) => props.theme.typography.size.base};
|
|
28
|
-
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
29
|
-
page-break-after: avoid;
|
|
30
|
-
break-after: avoid;
|
|
31
|
-
|
|
32
|
-
${ObjectFieldTemplateWrapper}[data-fjsf-level] > & {
|
|
33
|
-
font-size: ${(props) => props.theme.typography.size.base};
|
|
34
|
-
}
|
|
35
|
-
${ObjectFieldTemplateWrapper}[data-fjsf-level="0"] > & {
|
|
36
|
-
font-family: ${(props) => props.theme.typography.fontFamily.heading};
|
|
37
|
-
font-size: ${(props) => props.theme.typography.size.h2};
|
|
38
|
-
font-weight: ${(props) => props.theme.typography.weight.bold};
|
|
39
|
-
max-width: 85%;
|
|
40
|
-
}
|
|
41
|
-
${ObjectFieldTemplateWrapper}[data-fjsf-level="1"] > & {
|
|
42
|
-
font-size: ${(props) => props.theme.typography.size.h3};
|
|
43
|
-
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
44
|
-
margin-top: ${(props) => props.theme.spacing.m};
|
|
45
|
-
}
|
|
46
|
-
${ObjectFieldTemplateWrapper}[data-fjsf-level="2"] > & {
|
|
47
|
-
font-size: ${(props) => props.theme.typography.size.h4};
|
|
48
|
-
font-weight: ${(props) => props.theme.typography.weight.medium};
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
export const ObjectFieldTemplateDescription = undefined;
|
|
52
|
-
export function getComponents(components) {
|
|
53
|
-
return {
|
|
54
|
-
Wrapper: components.ObjectFieldTemplateWrapper,
|
|
55
|
-
Title: components.ObjectFieldTemplateTitle,
|
|
56
|
-
Description: components.ObjectFieldTemplateDescription ?? components.FieldDescription,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//Please keep this in alphabetical order
|
|
2
|
-
import * as ArrayFieldTemplate from "./ArrayFieldTemplate";
|
|
3
|
-
import * as FieldTemplate from "./FieldTemplate";
|
|
4
|
-
import * as ObjectFieldTemplate from "./ObjectFieldTemplate";
|
|
5
|
-
//Please keep this in alphabetical order
|
|
6
|
-
export const templateComponents = {
|
|
7
|
-
...ArrayFieldTemplate.components,
|
|
8
|
-
//...FieldTemplate.components, // Field template uses generic components (should it own those?)
|
|
9
|
-
...ObjectFieldTemplate.components,
|
|
10
|
-
};
|
|
11
|
-
//Please keep this in alphabetical order
|
|
12
|
-
export const templates = {
|
|
13
|
-
...ArrayFieldTemplate.templates,
|
|
14
|
-
...FieldTemplate.templates,
|
|
15
|
-
...ObjectFieldTemplate.templates,
|
|
16
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
export const FileUploadContext = createContext({
|
|
3
|
-
uploadFile: () => {
|
|
4
|
-
console.error("Lacking upload from FileUploadContext");
|
|
5
|
-
return Promise.reject();
|
|
6
|
-
},
|
|
7
|
-
fetchFile: (value) => Promise.resolve(value),
|
|
8
|
-
removeFile: () => {
|
|
9
|
-
console.error("Lacking remove from FileUploadContext");
|
|
10
|
-
return Promise.reject();
|
|
11
|
-
},
|
|
12
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
export const FilesUploadContext = createContext({
|
|
3
|
-
uploadFiles: () => {
|
|
4
|
-
console.error("Lacking upload from FilesUploadContext");
|
|
5
|
-
return Promise.reject();
|
|
6
|
-
},
|
|
7
|
-
removeFile: () => {
|
|
8
|
-
console.error("Lacking remove from FileUploadContext");
|
|
9
|
-
return Promise.reject();
|
|
10
|
-
},
|
|
11
|
-
});
|
package/dist/esm/common/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { solveReferences } from "./solveReferences";
|
|
2
|
-
export function createInitialValues(schema, definitions = {}) {
|
|
3
|
-
if (!schema || !schema.properties) {
|
|
4
|
-
return {};
|
|
5
|
-
}
|
|
6
|
-
const schemaDefinitions = { ...definitions, ...(schema.definitions ?? {}) };
|
|
7
|
-
function getValue(schema) {
|
|
8
|
-
if (schema.properties) {
|
|
9
|
-
return createInitialValues(schema, schemaDefinitions);
|
|
10
|
-
}
|
|
11
|
-
const type = schema.type;
|
|
12
|
-
switch (type) {
|
|
13
|
-
case "array":
|
|
14
|
-
return [];
|
|
15
|
-
case "number":
|
|
16
|
-
return 0;
|
|
17
|
-
// Boolean cannot be true/false by default, since that is a valid value
|
|
18
|
-
case "boolean":
|
|
19
|
-
case "null":
|
|
20
|
-
case "string":
|
|
21
|
-
return "";
|
|
22
|
-
default:
|
|
23
|
-
console.error({ schema });
|
|
24
|
-
throw new Error(`createInitialValues: Unsupported schema type: ${type}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return Object.keys(schema?.properties).reduce((acc, key) => {
|
|
28
|
-
const value = schema?.properties?.[key];
|
|
29
|
-
const solvedValue = solveReferences(value, schemaDefinitions, {}, {});
|
|
30
|
-
return {
|
|
31
|
-
...acc,
|
|
32
|
-
[key]: getValue(solvedValue.schema),
|
|
33
|
-
};
|
|
34
|
-
}, {});
|
|
35
|
-
}
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import * as Yup from "yup";
|
|
2
|
-
import { resolveOneOfValue } from "./resolveSchema";
|
|
3
|
-
import { solveReferences } from "./solveReferences";
|
|
4
|
-
const DEFAULT_ERROR_MESSAGES = {
|
|
5
|
-
required: "Required",
|
|
6
|
-
minLength: (params) => `Must be at least ${params.limit} characters`,
|
|
7
|
-
maxLength: (params) => `Must be at most ${params.limit} characters`,
|
|
8
|
-
pattern: "Invalid format",
|
|
9
|
-
minimum: (params) => `Must be at least ${params.min}`,
|
|
10
|
-
maximum: (params) => `Must be at most ${params.max}`,
|
|
11
|
-
exclusiveMinimum: (params) => `Must be more than ${params.min}`,
|
|
12
|
-
exclusiveMaximum: (params) => `Must be less than ${params.max}`,
|
|
13
|
-
multipleOf: (params) => `Must be a multiple of ${params.multipleOf}`,
|
|
14
|
-
minItems: (params) => `Must have at least ${params.min} items`,
|
|
15
|
-
maxItems: (params) => `Must have at most ${params.max} items`,
|
|
16
|
-
uniqueItems: "Items must be unique",
|
|
17
|
-
enum: "Invalid value",
|
|
18
|
-
const: "Invalid value",
|
|
19
|
-
notConst: "Invalid value",
|
|
20
|
-
};
|
|
21
|
-
// Difficult to solve
|
|
22
|
-
// @ts-expect-error
|
|
23
|
-
Yup.addMethod(Yup.array, "mixedOf", function ({ itemSchemas, additionalItemSchema }) {
|
|
24
|
-
return Yup.lazy((value) => {
|
|
25
|
-
if (value === undefined) {
|
|
26
|
-
return Yup.mixed().notRequired();
|
|
27
|
-
}
|
|
28
|
-
const valueLength = value?.length ?? 0;
|
|
29
|
-
const numOfAdditionalItems = itemSchemas.length > valueLength ? 0 : valueLength - itemSchemas.length;
|
|
30
|
-
const additionalSchemas = additionalItemSchema
|
|
31
|
-
? Array(numOfAdditionalItems).fill(additionalItemSchema)
|
|
32
|
-
: Array(numOfAdditionalItems).fill(Yup.mixed());
|
|
33
|
-
return Yup.tuple([...itemSchemas, ...additionalSchemas]).typeError("Required");
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
function getConditionalValidations(schema) {
|
|
37
|
-
const { dependencies, allOf } = schema;
|
|
38
|
-
let conditionalValidations = [];
|
|
39
|
-
if (dependencies) {
|
|
40
|
-
conditionalValidations = Object.entries(dependencies).reduce((validations, [key, dependency]) => {
|
|
41
|
-
if (typeof dependency === "boolean" || Array.isArray(dependency)) {
|
|
42
|
-
return validations;
|
|
43
|
-
}
|
|
44
|
-
const oneOf = dependency.oneOf;
|
|
45
|
-
if (Array.isArray(oneOf)) {
|
|
46
|
-
oneOf.forEach((oneOfSchema) => {
|
|
47
|
-
if (typeof oneOfSchema === "boolean") {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const { [key]: propertyToCheck, ...propertiesSansKey } = oneOfSchema.properties ?? {};
|
|
51
|
-
// Push validation only if there are additions in schema
|
|
52
|
-
if (Object.keys(propertiesSansKey)?.length ||
|
|
53
|
-
Object.keys(oneOfSchema).length > 1) {
|
|
54
|
-
validations.push({
|
|
55
|
-
schema: { ...oneOfSchema, properties: propertiesSansKey },
|
|
56
|
-
condition: {
|
|
57
|
-
dependentKeys: [key],
|
|
58
|
-
conditionFn: (value) => value === resolveOneOfValue(propertyToCheck),
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
return validations;
|
|
64
|
-
}
|
|
65
|
-
// Depends on presence of `key` property value
|
|
66
|
-
validations.push({
|
|
67
|
-
schema: dependency,
|
|
68
|
-
condition: {
|
|
69
|
-
dependentKeys: [key],
|
|
70
|
-
conditionFn: (value) => value !== undefined && value !== "",
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
return validations;
|
|
74
|
-
}, conditionalValidations);
|
|
75
|
-
}
|
|
76
|
-
if (allOf) {
|
|
77
|
-
conditionalValidations = allOf.reduce((validations, condition) => {
|
|
78
|
-
if (typeof condition === "boolean") {
|
|
79
|
-
return validations;
|
|
80
|
-
}
|
|
81
|
-
const { if: expression, then, else: otherwise, ...schemaWithoutCondition } = condition;
|
|
82
|
-
if (expression &&
|
|
83
|
-
typeof expression !== "boolean" &&
|
|
84
|
-
expression.properties) {
|
|
85
|
-
const keyValueMap = Object.entries(expression.properties).reduce((result, [key, value]) => {
|
|
86
|
-
if (typeof value !== "boolean") {
|
|
87
|
-
return { ...result, [key]: value.const };
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}, {});
|
|
91
|
-
const dependentKeys = Object.keys(keyValueMap);
|
|
92
|
-
if (then && typeof then !== "boolean") {
|
|
93
|
-
validations.push({
|
|
94
|
-
schema: then,
|
|
95
|
-
condition: {
|
|
96
|
-
dependentKeys,
|
|
97
|
-
conditionFn: (...args) => args.every((value, index) => keyValueMap[dependentKeys[index]] === value),
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
if (otherwise && typeof otherwise !== "boolean") {
|
|
102
|
-
validations.push({
|
|
103
|
-
schema: otherwise,
|
|
104
|
-
condition: {
|
|
105
|
-
dependentKeys,
|
|
106
|
-
conditionFn: (...args) => args.some((value, index) => keyValueMap[dependentKeys[index]] !== value),
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
validations.push({ schema: schemaWithoutCondition });
|
|
113
|
-
}
|
|
114
|
-
return validations;
|
|
115
|
-
}, conditionalValidations);
|
|
116
|
-
}
|
|
117
|
-
return conditionalValidations;
|
|
118
|
-
}
|
|
119
|
-
function getYupType(schema) {
|
|
120
|
-
const type = schema?.type;
|
|
121
|
-
switch (type) {
|
|
122
|
-
case "object":
|
|
123
|
-
return Yup.object();
|
|
124
|
-
case "array":
|
|
125
|
-
return Yup.array();
|
|
126
|
-
case "boolean":
|
|
127
|
-
return Yup.boolean();
|
|
128
|
-
case "integer":
|
|
129
|
-
case "number":
|
|
130
|
-
return Yup.number();
|
|
131
|
-
case "null":
|
|
132
|
-
return Yup.string();
|
|
133
|
-
case "string":
|
|
134
|
-
return Yup.string();
|
|
135
|
-
default:
|
|
136
|
-
console.error({ schema });
|
|
137
|
-
throw new Error(`createValidationSchema: Unsupported schema type: ${type}`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
export function createValidationSchema(schemas, options) {
|
|
141
|
-
const { schema, uiSchema = {} } = schemas;
|
|
142
|
-
const { localize, definitions, conditionsContext = {}, condition } = options ?? {};
|
|
143
|
-
if (!schema?.properties) {
|
|
144
|
-
return Yup.object().shape({});
|
|
145
|
-
}
|
|
146
|
-
const getErrorMessage = (key, fieldUiSchema, params) => {
|
|
147
|
-
const uiError = fieldUiSchema?.["ui:validation"]?.error?.[key];
|
|
148
|
-
if (uiError)
|
|
149
|
-
return uiError;
|
|
150
|
-
if (localize) {
|
|
151
|
-
return localize(`validation.error.${key}`, params);
|
|
152
|
-
}
|
|
153
|
-
const defaultMsg = DEFAULT_ERROR_MESSAGES[key];
|
|
154
|
-
return typeof defaultMsg === "function" ? defaultMsg(params) : defaultMsg;
|
|
155
|
-
};
|
|
156
|
-
const schemaDefinitions = (definitions ?? schema.definitions ?? {});
|
|
157
|
-
const requiredFields = schema.required;
|
|
158
|
-
function getValue(givenSchema, key, required) {
|
|
159
|
-
const { schema } = solveReferences(givenSchema, schemaDefinitions, {}, {});
|
|
160
|
-
const isRequired = requiredFields?.includes(key) || required === true;
|
|
161
|
-
let type = schema.type;
|
|
162
|
-
let yupSchema;
|
|
163
|
-
const fieldUiSchema = uiSchema?.[key];
|
|
164
|
-
if (schema.properties) {
|
|
165
|
-
yupSchema = createValidationSchema({
|
|
166
|
-
schema,
|
|
167
|
-
uiSchema: fieldUiSchema
|
|
168
|
-
}, {
|
|
169
|
-
localize,
|
|
170
|
-
definitions: schemaDefinitions,
|
|
171
|
-
conditionsContext,
|
|
172
|
-
});
|
|
173
|
-
type = type ?? "object";
|
|
174
|
-
}
|
|
175
|
-
else if (type === "array" && schema.anyOf) {
|
|
176
|
-
if (!schema.items && !schema.additionalItems) {
|
|
177
|
-
yupSchema = Yup.array();
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
const anyOf = schema.anyOf;
|
|
181
|
-
// anyOf is optional, therefore we cannot change it to array.mixedOf() aka tuple
|
|
182
|
-
const anyOfSchema = Yup.array().of(Yup.lazy(() => {
|
|
183
|
-
// value has to match with one of the anyOf values in the schema
|
|
184
|
-
return Yup.mixed().oneOf(anyOf.map((item) => item.const));
|
|
185
|
-
}));
|
|
186
|
-
// In case the property is required, there should be at least one item in the array
|
|
187
|
-
yupSchema = isRequired
|
|
188
|
-
? anyOfSchema.min(1, getErrorMessage("required", fieldUiSchema))
|
|
189
|
-
: anyOfSchema;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
else if (type === "array") {
|
|
193
|
-
if (!schema.items && !schema.additionalItems) {
|
|
194
|
-
yupSchema = Yup.array();
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
const additionalItemSchema = (() => {
|
|
198
|
-
const additionalItems = schema.additionalItems;
|
|
199
|
-
if (!additionalItems) {
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
// Yup.lazy() enables validation for infinitely nested schemas
|
|
203
|
-
// aka references that refer to themselves or in circular references
|
|
204
|
-
return Yup.lazy(() => {
|
|
205
|
-
return getValue(schema?.additionalItems, "#ignore-this", true);
|
|
206
|
-
});
|
|
207
|
-
})();
|
|
208
|
-
const schemaItems = schema?.items ?? [];
|
|
209
|
-
const items = Array.isArray(schemaItems) ? schemaItems : [schemaItems];
|
|
210
|
-
yupSchema = Yup.array().mixedOf({
|
|
211
|
-
itemSchemas: items.map((item) => getValue(item, "#ignore-this", true)),
|
|
212
|
-
additionalItemSchema,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
yupSchema = getYupType(schema);
|
|
218
|
-
}
|
|
219
|
-
if (type === "null")
|
|
220
|
-
yupSchema.nullable();
|
|
221
|
-
// Apply JSON Schema validation keywords based on type
|
|
222
|
-
if (type === "string") {
|
|
223
|
-
let stringSchema = yupSchema;
|
|
224
|
-
if (schema.minLength !== undefined) {
|
|
225
|
-
stringSchema = stringSchema.min(schema.minLength, getErrorMessage("minLength", fieldUiSchema, { limit: schema.minLength }));
|
|
226
|
-
}
|
|
227
|
-
if (schema.maxLength !== undefined) {
|
|
228
|
-
stringSchema = stringSchema.max(schema.maxLength, getErrorMessage("maxLength", fieldUiSchema, { limit: schema.maxLength }));
|
|
229
|
-
}
|
|
230
|
-
if (schema.pattern !== undefined) {
|
|
231
|
-
stringSchema = stringSchema.matches(new RegExp(schema.pattern), getErrorMessage("pattern", fieldUiSchema));
|
|
232
|
-
}
|
|
233
|
-
yupSchema = stringSchema;
|
|
234
|
-
}
|
|
235
|
-
if (type === "number" || type === "integer") {
|
|
236
|
-
let numberSchema = yupSchema;
|
|
237
|
-
if (schema.minimum !== undefined) {
|
|
238
|
-
numberSchema = numberSchema.min(schema.minimum, getErrorMessage("minimum", fieldUiSchema, { min: schema.minimum }));
|
|
239
|
-
}
|
|
240
|
-
if (schema.maximum !== undefined) {
|
|
241
|
-
numberSchema = numberSchema.max(schema.maximum, getErrorMessage("maximum", fieldUiSchema, { max: schema.maximum }));
|
|
242
|
-
}
|
|
243
|
-
if (schema.exclusiveMinimum !== undefined) {
|
|
244
|
-
numberSchema = numberSchema.moreThan(schema.exclusiveMinimum, getErrorMessage("exclusiveMinimum", fieldUiSchema, { min: schema.exclusiveMinimum }));
|
|
245
|
-
}
|
|
246
|
-
if (schema.exclusiveMaximum !== undefined) {
|
|
247
|
-
numberSchema = numberSchema.lessThan(schema.exclusiveMaximum, getErrorMessage("exclusiveMaximum", fieldUiSchema, { max: schema.exclusiveMaximum }));
|
|
248
|
-
}
|
|
249
|
-
if (schema.multipleOf !== undefined) {
|
|
250
|
-
numberSchema = numberSchema.test("multipleOf", getErrorMessage("multipleOf", fieldUiSchema, { multipleOf: schema.multipleOf }), (value) => value === undefined ||
|
|
251
|
-
value === null ||
|
|
252
|
-
value % schema.multipleOf === 0);
|
|
253
|
-
}
|
|
254
|
-
yupSchema = numberSchema;
|
|
255
|
-
}
|
|
256
|
-
if (type === "array") {
|
|
257
|
-
const applyArrayTests = (s) => {
|
|
258
|
-
let result = s;
|
|
259
|
-
if (schema.minItems !== undefined) {
|
|
260
|
-
result = result.test("minItems", getErrorMessage("minItems", fieldUiSchema, { min: schema.minItems }), (value) => !value || value.length >= schema.minItems);
|
|
261
|
-
}
|
|
262
|
-
if (schema.maxItems !== undefined) {
|
|
263
|
-
result = result.test("maxItems", getErrorMessage("maxItems", fieldUiSchema, { max: schema.maxItems }), (value) => !value || value.length <= schema.maxItems);
|
|
264
|
-
}
|
|
265
|
-
if (schema.uniqueItems === true) {
|
|
266
|
-
result = result.test("uniqueItems", getErrorMessage("uniqueItems", fieldUiSchema), (value) => {
|
|
267
|
-
if (!value)
|
|
268
|
-
return true;
|
|
269
|
-
return new Set(value).size === value.length;
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
return result;
|
|
273
|
-
};
|
|
274
|
-
if (yupSchema.test) {
|
|
275
|
-
yupSchema = applyArrayTests(yupSchema);
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
// It's likely a Lazy schema (from mixedOf). Wrap it to apply tests.
|
|
279
|
-
const originalLazy = yupSchema;
|
|
280
|
-
yupSchema = Yup.lazy((value, options) => {
|
|
281
|
-
return applyArrayTests(originalLazy.resolve(options));
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
const isOptionEnum = schema.enum !== undefined;
|
|
286
|
-
const isOptionConst = schema.const !== undefined;
|
|
287
|
-
if (isOptionEnum || isOptionConst) {
|
|
288
|
-
// Check for $data reference (cross-field validation)
|
|
289
|
-
const constValue = schema.const;
|
|
290
|
-
const isDataRef = typeof constValue === "object" && constValue?.$data;
|
|
291
|
-
if (isDataRef) {
|
|
292
|
-
// Cross-field reference: const: { $data: "1/otherFieldName" }
|
|
293
|
-
// JSON Pointer format: "1/fieldName" means go up 1 level and reference fieldName
|
|
294
|
-
const dataPath = constValue.$data;
|
|
295
|
-
const pathParts = dataPath.split("/");
|
|
296
|
-
const refFieldName = pathParts[pathParts.length - 1]; // Get the field name (last part)
|
|
297
|
-
yupSchema = yupSchema.oneOf([Yup.ref(refFieldName)], getErrorMessage("const", fieldUiSchema));
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
// Standard const or enum validation
|
|
301
|
-
const allowedValues = isOptionConst ? [schema.const] : schema.enum;
|
|
302
|
-
const errorKey = isOptionConst ? "const" : "enum";
|
|
303
|
-
yupSchema = yupSchema.oneOf(allowedValues, getErrorMessage(errorKey, fieldUiSchema));
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
if (schema.not &&
|
|
307
|
-
typeof schema.not !== "boolean" &&
|
|
308
|
-
schema.not.const !== undefined) {
|
|
309
|
-
yupSchema = yupSchema.notOneOf([schema.not.const], getErrorMessage("notConst", fieldUiSchema));
|
|
310
|
-
}
|
|
311
|
-
// JSON Schema validation keywords
|
|
312
|
-
if (isRequired && type !== "array") {
|
|
313
|
-
yupSchema = yupSchema.required(getErrorMessage("required", fieldUiSchema));
|
|
314
|
-
}
|
|
315
|
-
if (!condition) {
|
|
316
|
-
return yupSchema;
|
|
317
|
-
}
|
|
318
|
-
const existing = conditionsContext[key] ?? [];
|
|
319
|
-
conditionsContext[key] = [...existing, { yupSchema, condition }];
|
|
320
|
-
// TODO: The latest given type for duplicate field is used.
|
|
321
|
-
// This might become a problem at some point, but testing has not
|
|
322
|
-
// shown any problems so far.
|
|
323
|
-
const yupType = getYupType(schema).when(condition.dependentKeys, {
|
|
324
|
-
is: condition.conditionFn,
|
|
325
|
-
then: () => yupSchema,
|
|
326
|
-
});
|
|
327
|
-
// If there are existing conditions for the field with same name
|
|
328
|
-
// for example definition or duplicate field, add those clauses in.
|
|
329
|
-
// Otherwise the validation would be overwritten by the latest one
|
|
330
|
-
// breaking the earlier validations.
|
|
331
|
-
return existing.reduce((result, context) => {
|
|
332
|
-
const { condition: ctxCondition, yupSchema: ctxYupSchema } = context;
|
|
333
|
-
return result.when(ctxCondition.dependentKeys, {
|
|
334
|
-
is: ctxCondition.conditionFn,
|
|
335
|
-
then: () => ctxYupSchema,
|
|
336
|
-
});
|
|
337
|
-
}, yupType);
|
|
338
|
-
}
|
|
339
|
-
const baseValidationSchema = Object.keys(schema.properties).reduce((validationSchema, key) => {
|
|
340
|
-
const value = schema.properties?.[key];
|
|
341
|
-
return validationSchema.concat(Yup.object().shape({ [key]: getValue(value, key) }));
|
|
342
|
-
}, Yup.object().shape({}));
|
|
343
|
-
return getConditionalValidations(schema).reduce((validationSchema, conditionalValidation) => {
|
|
344
|
-
const solvedSchemas = solveReferences(conditionalValidation.schema, schemaDefinitions, {}, {});
|
|
345
|
-
/*
|
|
346
|
-
"Only schemas of the same type can be concatenated. concat is not
|
|
347
|
-
a "merge" function in the sense that all settings from the provided schema,
|
|
348
|
-
override ones in the base, including type, presence and nullability."
|
|
349
|
-
Source: https://github.com/jquense/yup?tab=readme-ov-file#schemaconcatschema-schema-schema
|
|
350
|
-
*/
|
|
351
|
-
return validationSchema.concat(createValidationSchema({
|
|
352
|
-
schema: solvedSchemas.schema,
|
|
353
|
-
uiSchema
|
|
354
|
-
}, {
|
|
355
|
-
localize,
|
|
356
|
-
definitions: schemaDefinitions,
|
|
357
|
-
conditionsContext,
|
|
358
|
-
condition: conditionalValidation.condition
|
|
359
|
-
}));
|
|
360
|
-
}, baseValidationSchema);
|
|
361
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { isObject } from "./getTypes";
|
|
2
|
-
export const deepOverlap = (object1, object2) => {
|
|
3
|
-
const keys1 = Object.keys(object1);
|
|
4
|
-
for (const key of keys1) {
|
|
5
|
-
const val1 = object1[key];
|
|
6
|
-
const val2 = object2[key];
|
|
7
|
-
const areObjects = isObject(val1) && isObject(val2);
|
|
8
|
-
if ((areObjects && !deepOverlap(val1, val2)) ||
|
|
9
|
-
(!areObjects && val1 !== val2)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return true;
|
|
14
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const extractUiSchema = (props = {}) => {
|
|
2
|
-
// props is frozen by React, so it needs to be copied
|
|
3
|
-
const schema = { ...props };
|
|
4
|
-
if (schema.props !== undefined) {
|
|
5
|
-
schema["ui:props"] = {
|
|
6
|
-
...(schema["ui:props"] ?? {}),
|
|
7
|
-
...(schema.props ?? {}),
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
const { "ui:options": options = {}, ...uiSchema } = schema;
|
|
11
|
-
return {
|
|
12
|
-
...Object.keys(uiSchema || {}).reduce((result, key) => ({
|
|
13
|
-
...result,
|
|
14
|
-
[key.replace("ui:", "")]: uiSchema[key],
|
|
15
|
-
}), {}),
|
|
16
|
-
...options,
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export var EnumsTypes;
|
|
2
|
-
(function (EnumsTypes) {
|
|
3
|
-
EnumsTypes["SELECT"] = "select";
|
|
4
|
-
EnumsTypes["MULTI_SELECT"] = "multiSelect";
|
|
5
|
-
})(EnumsTypes || (EnumsTypes = {}));
|
|
6
|
-
//TODO: Add some proper typing
|
|
7
|
-
export const getEnums = ({ schema }) => {
|
|
8
|
-
if (!schema) {
|
|
9
|
-
return { values: [] };
|
|
10
|
-
}
|
|
11
|
-
const numberOfDefined = [schema.enum, schema.oneOf, schema.anyOf].filter((x) => x).length;
|
|
12
|
-
if (numberOfDefined === 0) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (numberOfDefined > 1) {
|
|
16
|
-
throw new Error('Only one of "enum", "oneOf" or "anyOf" can be defined!');
|
|
17
|
-
}
|
|
18
|
-
if (schema.enum) {
|
|
19
|
-
return {
|
|
20
|
-
type: EnumsTypes.SELECT,
|
|
21
|
-
values: schema.enum.map((option) => ({
|
|
22
|
-
const: option,
|
|
23
|
-
title: `${option}`,
|
|
24
|
-
})),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (schema.oneOf) {
|
|
28
|
-
return {
|
|
29
|
-
type: EnumsTypes.SELECT,
|
|
30
|
-
values: schema.oneOf,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
if (schema.anyOf) {
|
|
34
|
-
return {
|
|
35
|
-
type: EnumsTypes.MULTI_SELECT,
|
|
36
|
-
values: schema.anyOf,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export const getSelectedEnum = (selected, enums) => {
|
|
41
|
-
if (Array.isArray(selected)) {
|
|
42
|
-
const stuff = selected
|
|
43
|
-
.map((v) => enums?.values.find((e) => e.const === v))
|
|
44
|
-
.filter((e) => !!e);
|
|
45
|
-
return stuff.length > 0 ? stuff : undefined;
|
|
46
|
-
}
|
|
47
|
-
if (typeof selected === "string" || typeof selected === "number") {
|
|
48
|
-
return enums?.values.filter((e) => e.const === selected);
|
|
49
|
-
}
|
|
50
|
-
return undefined;
|
|
51
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const getHiddenProperties = (order, properties) => {
|
|
2
|
-
if (!order || order.includes("*")) {
|
|
3
|
-
return [];
|
|
4
|
-
}
|
|
5
|
-
const propertiesInOrder = order.flatMap((entry) => typeof entry === "string" ? entry : entry.fields);
|
|
6
|
-
return properties.filter((key) => !propertiesInOrder.includes(key));
|
|
7
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function getStyle(key) {
|
|
2
|
-
const style = {};
|
|
3
|
-
if (key === "inline") {
|
|
4
|
-
style.flexDirection = "row";
|
|
5
|
-
}
|
|
6
|
-
if (key === "oneColumn") {
|
|
7
|
-
style.display = "grid";
|
|
8
|
-
}
|
|
9
|
-
if (key === "twoColumns") {
|
|
10
|
-
style.display = "grid";
|
|
11
|
-
style["gridTemplateColumns"] = "1fr 1fr";
|
|
12
|
-
}
|
|
13
|
-
if (key === "threeColumns") {
|
|
14
|
-
style.display = "grid";
|
|
15
|
-
style["gridTemplateColumns"] = "1fr 1fr 1fr";
|
|
16
|
-
}
|
|
17
|
-
return style;
|
|
18
|
-
}
|