@gravity-ui/dynamic-forms 5.18.0 → 5.19.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/build/cjs/index.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/Controller/Controller.d.ts +11 -0
- package/build/cjs/lib/core/components/Form/Controller/index.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/Controller/types.d.ts +98 -0
- package/build/cjs/lib/core/components/Form/Controller/utils.d.ts +27 -0
- package/build/cjs/lib/core/components/Form/DynamicField.d.ts +19 -0
- package/build/cjs/lib/core/components/Form/constants.d.ts +4 -0
- package/build/cjs/lib/core/components/Form/hooks/index.d.ts +17 -0
- package/build/cjs/lib/core/components/Form/hooks/useControllerMirror.d.ts +2 -0
- package/build/cjs/lib/core/components/Form/hooks/useCreateContext.d.ts +3 -0
- package/build/cjs/lib/core/components/Form/hooks/useCreateSearchContext.d.ts +3 -0
- package/build/cjs/lib/core/components/Form/hooks/useDynamicFieldMirror.d.ts +2 -0
- package/build/cjs/lib/core/components/Form/hooks/useDynamicFormsCtx.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useFormShared.d.ts +4 -0
- package/build/cjs/lib/core/components/Form/hooks/useFormSharedStore.d.ts +4 -0
- package/build/cjs/lib/core/components/Form/hooks/useGenerateRandomValue.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useIntegrationFF.d.ts +10 -0
- package/build/cjs/lib/core/components/Form/hooks/useMonaco.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useMutateDFState.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useMutators.d.ts +5 -0
- package/build/cjs/lib/core/components/Form/hooks/useSearch/index.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useSearch/useSearch.d.ts +4 -0
- package/build/cjs/lib/core/components/Form/hooks/useSearchContext.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/hooks/useSearchStore.d.ts +6 -0
- package/build/cjs/lib/core/components/Form/hooks/useStore.d.ts +10 -0
- package/build/cjs/lib/core/components/Form/hooks/useStoreValue.d.ts +1 -0
- package/build/cjs/lib/core/components/Form/index.d.ts +6 -0
- package/build/cjs/lib/core/components/Form/types/array.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/boolean.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/config.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/context.d.ts +23 -0
- package/build/cjs/lib/core/components/Form/types/field.d.ts +33 -0
- package/build/cjs/lib/core/components/Form/types/index.d.ts +16 -0
- package/build/cjs/lib/core/components/Form/types/input.d.ts +23 -0
- package/build/cjs/lib/core/components/Form/types/layout.d.ts +9 -0
- package/build/cjs/lib/core/components/Form/types/mirror.d.ts +15 -0
- package/build/cjs/lib/core/components/Form/types/mutators.d.ts +29 -0
- package/build/cjs/lib/core/components/Form/types/number.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/object.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/search.d.ts +8 -0
- package/build/cjs/lib/core/components/Form/types/store.d.ts +7 -0
- package/build/cjs/lib/core/components/Form/types/string.d.ts +14 -0
- package/build/cjs/lib/core/components/Form/types/validators.d.ts +8 -0
- package/build/cjs/lib/core/components/Form/types/value.d.ts +8 -0
- package/build/cjs/lib/core/components/Form/utils/common.d.ts +6 -0
- package/build/cjs/lib/core/components/Form/utils/index.d.ts +2 -0
- package/build/cjs/lib/core/components/Form/utils/search.d.ts +3 -0
- package/build/cjs/lib/core/components/View/DynamicView.d.ts +17 -0
- package/build/cjs/lib/core/components/View/ViewController.d.ts +7 -0
- package/build/cjs/lib/core/components/View/helpers.d.ts +1 -0
- package/build/cjs/lib/core/components/View/hooks/index.d.ts +7 -0
- package/build/cjs/lib/core/components/View/hooks/useComponents.d.ts +6 -0
- package/build/cjs/lib/core/components/View/hooks/useCreateContext.d.ts +3 -0
- package/build/cjs/lib/core/components/View/hooks/useDynamicFormsCtx.d.ts +1 -0
- package/build/cjs/lib/core/components/View/hooks/useMonaco.d.ts +1 -0
- package/build/cjs/lib/core/components/View/hooks/useRender.d.ts +15 -0
- package/build/cjs/lib/core/components/View/hooks/useViewShared.d.ts +4 -0
- package/build/cjs/lib/core/components/View/hooks/useViewSharedStore.d.ts +4 -0
- package/build/cjs/lib/core/components/View/index.d.ts +5 -0
- package/build/cjs/lib/core/components/View/types/array.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/boolean.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/config.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/context.d.ts +18 -0
- package/build/cjs/lib/core/components/View/types/index.d.ts +9 -0
- package/build/cjs/lib/core/components/View/types/layout.d.ts +8 -0
- package/build/cjs/lib/core/components/View/types/number.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/object.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/string.d.ts +13 -0
- package/build/cjs/lib/core/components/View/types/views.d.ts +23 -0
- package/build/cjs/lib/core/components/index.d.ts +2 -0
- package/build/cjs/lib/core/constants.d.ts +8 -0
- package/build/cjs/lib/core/helpers.d.ts +7 -0
- package/build/cjs/lib/core/index.d.ts +4 -0
- package/build/cjs/lib/core/types/index.d.ts +2 -0
- package/build/cjs/lib/core/types/specs.d.ts +194 -0
- package/build/cjs/lib/core/types/value.d.ts +5 -0
- package/build/cjs/lib/index.d.ts +2 -0
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.d.ts +16 -0
- package/build/cjs/lib/kit/components/AccordeonCard/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Card/Card.d.ts +14 -0
- package/build/cjs/lib/kit/components/Card/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/CopyButton/CopyButton.d.ts +11 -0
- package/build/cjs/lib/kit/components/CopyButton/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ErrorWrapper/ErrorWrapper.d.ts +10 -0
- package/build/cjs/lib/kit/components/ErrorWrapper/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.d.ts +8 -0
- package/build/cjs/lib/kit/components/GenerateRandomValueButton/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/GroupIndent/GroupIndent.d.ts +5 -0
- package/build/cjs/lib/kit/components/GroupIndent/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/HTMLContent/HTMLContent.d.ts +6 -0
- package/build/cjs/lib/kit/components/HTMLContent/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/ArrayBase/ArrayBase.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/ArrayBase/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/CardOneOf/CardOneOf.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/CardOneOf/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/Checkbox/Checkbox.d.ts +5 -0
- package/build/cjs/lib/kit/components/Inputs/Checkbox/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.d.ts +5 -0
- package/build/cjs/lib/kit/components/Inputs/CheckboxGroup/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/ColorPicker/ColorPicker.d.ts +21 -0
- package/build/cjs/lib/kit/components/Inputs/ColorPicker/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/DateInput/DateInput.d.ts +8 -0
- package/build/cjs/lib/kit/components/Inputs/DateInput/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.d.ts +3 -0
- package/build/cjs/lib/kit/components/Inputs/FileInput/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/FileInput/utils.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.d.ts +11 -0
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoInputBase.d.ts +9 -0
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoInputDialog.d.ts +20 -0
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/useMonacoOptions.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.d.ts +7 -0
- package/build/cjs/lib/kit/components/Inputs/MultiOneOf/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/MultiSelect/MultiSelect.d.ts +6 -0
- package/build/cjs/lib/kit/components/Inputs/MultiSelect/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/Number/Number.d.ts +6 -0
- package/build/cjs/lib/kit/components/Inputs/Number/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/NumberWithScale/NumberWithScale.d.ts +3 -0
- package/build/cjs/lib/kit/components/Inputs/NumberWithScale/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/NumberWithScale/useInitial.d.ts +5 -0
- package/build/cjs/lib/kit/components/Inputs/ObjectBase/ObjectBase.d.ts +7 -0
- package/build/cjs/lib/kit/components/Inputs/ObjectBase/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/ObjectValueInput/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/OneOf/OneOf.d.ts +7 -0
- package/build/cjs/lib/kit/components/Inputs/OneOf/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/RadioGroup/RadioGroup.d.ts +6 -0
- package/build/cjs/lib/kit/components/Inputs/RadioGroup/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/RangeInputPicker/RangeInputPicker.d.ts +4 -0
- package/build/cjs/lib/kit/components/Inputs/RangeInputPicker/RangeInputPickerNumber.d.ts +4 -0
- package/build/cjs/lib/kit/components/Inputs/RangeInputPicker/index.d.ts +3 -0
- package/build/cjs/lib/kit/components/Inputs/RangeInputPicker/types.d.ts +15 -0
- package/build/cjs/lib/kit/components/Inputs/Secret/Secret.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/Secret/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/Select/Select.d.ts +6 -0
- package/build/cjs/lib/kit/components/Inputs/Select/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/Switch/Switch.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/Switch/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/TableArrayInput/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/Text/Text.d.ts +6 -0
- package/build/cjs/lib/kit/components/Inputs/Text/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TextArea/TextArea.d.ts +5 -0
- package/build/cjs/lib/kit/components/Inputs/TextArea/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.d.ts +12 -0
- package/build/cjs/lib/kit/components/Inputs/TextContent/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TextContent/utils.d.ts +4 -0
- package/build/cjs/lib/kit/components/Inputs/TextLink/TextLink.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/TextLink/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/TimeRangeSelector.d.ts +2 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.d.ts +13 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/components/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/utils.d.ts +16 -0
- package/build/cjs/lib/kit/components/Inputs/index.d.ts +26 -0
- package/build/cjs/lib/kit/components/Layouts/Accordeon/Accordeon.d.ts +8 -0
- package/build/cjs/lib/kit/components/Layouts/Accordeon/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/AccordeonCard/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/CardAccordeon.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/CardSection.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/Column/Column.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/Column/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/Row/Row.d.ts +4 -0
- package/build/cjs/lib/kit/components/Layouts/Row/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/Section/Section.d.ts +15 -0
- package/build/cjs/lib/kit/components/Layouts/Section/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/TableCell/TableCell.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/TableCell/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/Transparent/Transparent.d.ts +3 -0
- package/build/cjs/lib/kit/components/Layouts/Transparent/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Layouts/index.d.ts +9 -0
- package/build/cjs/lib/kit/components/LazyLoader/LazyLoader.d.ts +6 -0
- package/build/cjs/lib/kit/components/LazyLoader/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/LongValue/LongValue.d.ts +7 -0
- package/build/cjs/lib/kit/components/LongValue/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/RemoveButton/RemoveButton.d.ts +7 -0
- package/build/cjs/lib/kit/components/RemoveButton/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.d.ts +44 -0
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/TogglerCard/TogglerCard.d.ts +11 -0
- package/build/cjs/lib/kit/components/TogglerCard/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.d.ts +8 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeon/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewCardAccordeon.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewCardSection.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewColumn/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewSection/ViewSection.d.ts +6 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewSection/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewTableCell/ViewTableCell.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewTableCell/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewTransparent/ViewTransparent.d.ts +3 -0
- package/build/cjs/lib/kit/components/ViewLayouts/ViewTransparent/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/ViewLayouts/index.d.ts +9 -0
- package/build/cjs/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/ArrayBaseView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/BaseView/BaseView.d.ts +3 -0
- package/build/cjs/lib/kit/components/Views/BaseView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/CardOneOfView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/CheckboxGroupView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/ColorPickerView/ColorPickerView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/ColorPickerView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/DateView/DateView.d.ts +3 -0
- package/build/cjs/lib/kit/components/Views/DateView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/FileInputView/FileInputView.d.ts +3 -0
- package/build/cjs/lib/kit/components/Views/FileInputView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/MonacoInputView/MonacoBaseView.d.ts +3 -0
- package/build/cjs/lib/kit/components/Views/MonacoInputView/MonacoViewDialog.d.ts +15 -0
- package/build/cjs/lib/kit/components/Views/MonacoInputView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.d.ts +7 -0
- package/build/cjs/lib/kit/components/Views/MultiOneOfView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/MultiSelectView/MultiSelectView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/MultiSelectView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.d.ts +3 -0
- package/build/cjs/lib/kit/components/Views/NumberWithScaleView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.d.ts +7 -0
- package/build/cjs/lib/kit/components/Views/ObjectBaseView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/ObjectValueInputView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/OneOfView/OneOfView.d.ts +7 -0
- package/build/cjs/lib/kit/components/Views/OneOfView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/RangeInputPickerView/RangeInputPickerNumberView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/RangeInputPickerView/RangeInputPickerView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/RangeInputPickerView/index.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TableArrayView/TableArrayView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TableArrayView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/TextAreaView/TextAreaView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TextAreaView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/TextContentView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TextLinkView/TextLinkView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TextLinkView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/TimeRangeSelectorView/TimeRangeSelectorView.d.ts +2 -0
- package/build/cjs/lib/kit/components/Views/TimeRangeSelectorView/index.d.ts +1 -0
- package/build/cjs/lib/kit/components/Views/index.d.ts +20 -0
- package/build/cjs/lib/kit/components/index.d.ts +14 -0
- package/build/cjs/lib/kit/constants/common.d.ts +13 -0
- package/build/cjs/lib/kit/constants/config.d.ts +3 -0
- package/build/cjs/lib/kit/constants/index.d.ts +2 -0
- package/build/cjs/lib/kit/hooks/index.d.ts +2 -0
- package/build/cjs/lib/kit/hooks/useErrorChecker.d.ts +8 -0
- package/build/cjs/lib/kit/hooks/useOneOf/index.d.ts +1 -0
- package/build/cjs/lib/kit/hooks/useOneOf/useOneOf.d.ts +12 -0
- package/build/cjs/lib/kit/i18n/configure.d.ts +12 -0
- package/build/cjs/lib/kit/i18n/index.d.ts +2 -0
- package/build/cjs/lib/kit/index.d.ts +6 -0
- package/build/cjs/lib/kit/utils/bigIntMath.d.ts +2 -0
- package/build/cjs/lib/kit/utils/cn.d.ts +2 -0
- package/build/cjs/lib/kit/utils/common.d.ts +6 -0
- package/build/cjs/lib/kit/utils/index.d.ts +5 -0
- package/build/cjs/lib/kit/utils/objectInline.d.ts +4 -0
- package/build/cjs/lib/kit/utils/objectKeys.d.ts +4 -0
- package/build/cjs/lib/kit/validators/helpers.d.ts +7 -0
- package/build/cjs/lib/kit/validators/index.d.ts +2 -0
- package/build/cjs/lib/kit/validators/messages.d.ts +2 -0
- package/build/cjs/lib/kit/validators/types.d.ts +20 -0
- package/build/cjs/lib/kit/validators/validators.d.ts +42 -0
- package/build/cjs/lib/unstable/core/Entity/Entity.d.ts +10 -0
- package/build/cjs/lib/unstable/core/Entity/Entity.js +78 -0
- package/build/cjs/lib/unstable/core/Entity/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/Entity/index.js +5 -0
- package/build/cjs/lib/unstable/core/Entity/types.d.ts +27 -0
- package/build/cjs/lib/unstable/core/Entity/types.js +2 -0
- package/build/cjs/lib/unstable/core/Entity/utils.d.ts +3 -0
- package/build/cjs/lib/unstable/core/Entity/utils.js +40 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/SchemaRenderer.d.ts +5 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/SchemaRenderer.js +12 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/index.d.ts +1 -0
- package/build/cjs/lib/unstable/core/SchemaRenderer/index.js +5 -0
- package/build/cjs/lib/unstable/core/constants.d.ts +22 -0
- package/build/cjs/lib/unstable/core/constants.js +28 -0
- package/build/cjs/lib/unstable/core/index.d.ts +5 -0
- package/build/cjs/lib/unstable/core/index.js +15 -0
- package/build/cjs/lib/unstable/core/types/components.d.ts +29 -0
- package/build/cjs/lib/unstable/core/types/components.js +2 -0
- package/build/cjs/lib/unstable/core/types/config.d.ts +36 -0
- package/build/cjs/lib/unstable/core/types/config.js +2 -0
- package/build/cjs/lib/unstable/core/types/helpers.d.ts +18 -0
- package/build/cjs/lib/unstable/core/types/helpers.js +2 -0
- package/build/cjs/lib/unstable/core/types/index.d.ts +5 -0
- package/build/cjs/lib/unstable/core/types/index.js +8 -0
- package/build/cjs/lib/unstable/core/types/schema.d.ts +1186 -0
- package/build/cjs/lib/unstable/core/types/schema.js +2 -0
- package/build/cjs/lib/unstable/core/types/validation.d.ts +39 -0
- package/build/cjs/lib/unstable/core/types/validation.js +2 -0
- package/build/cjs/lib/unstable/core/types/values.d.ts +4 -0
- package/build/cjs/lib/unstable/core/types/values.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/constants.d.ts +1 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/constants.js +4 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/index.js +7 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.d.ts +7 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.js +25 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.d.ts +10 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.js +17 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/index.d.ts +3 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/index.js +10 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.d.ts +3 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.js +35 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.d.ts +34 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.d.ts +3 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.js +60 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.d.ts +25 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/index.d.ts +13 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/index.js +16 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.d.ts +3 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.js +81 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.d.ts +26 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.js +5 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.js +12 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.d.ts +6 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/types.d.ts +22 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/types.js +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.d.ts +37 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +86 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/common.d.ts +1 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/common.js +11 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.d.ts +11 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.js +39 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-validate.d.ts +14 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/get-validate.js +67 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/index.d.ts +2 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/index.js +7 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.d.ts +10 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.js +51 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.d.ts +20 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.js +43 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.d.ts +15 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.js +36 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.d.ts +12 -0
- package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.js +17 -0
- package/build/cjs/lib/unstable/core/utils/common.d.ts +49 -0
- package/build/cjs/lib/unstable/core/utils/common.js +180 -0
- package/build/cjs/lib/unstable/core/utils/index.d.ts +1 -0
- package/build/cjs/lib/unstable/core/utils/index.js +4 -0
- package/build/cjs/lib/unstable/kit/Accordeon.d.ts +3 -0
- package/build/cjs/lib/unstable/kit/Accordeon.js +31 -0
- package/build/cjs/lib/unstable/kit/Any.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/Any.js +21 -0
- package/build/cjs/lib/unstable/kit/ArrayBase.css +23 -0
- package/build/cjs/lib/unstable/kit/ArrayBase.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/ArrayBase.js +101 -0
- package/build/cjs/lib/unstable/kit/MultiSelect.css +6 -0
- package/build/cjs/lib/unstable/kit/MultiSelect.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/MultiSelect.js +66 -0
- package/build/cjs/lib/unstable/kit/ObjectBase.css +10 -0
- package/build/cjs/lib/unstable/kit/ObjectBase.d.ts +7 -0
- package/build/cjs/lib/unstable/kit/ObjectBase.js +71 -0
- package/build/cjs/lib/unstable/kit/Row.css +73 -0
- package/build/cjs/lib/unstable/kit/Row.d.ts +10 -0
- package/build/cjs/lib/unstable/kit/Row.js +50 -0
- package/build/cjs/lib/unstable/kit/Text.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/Text.js +259 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.d.ts +5 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +29 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/ArrayRemoveButton/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.css +33 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/ControlError.js +15 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/ControlError/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.js +11 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/components/HTMLContent/index.js +5 -0
- package/build/cjs/lib/unstable/kit/components/index.d.ts +3 -0
- package/build/cjs/lib/unstable/kit/components/index.js +9 -0
- package/build/cjs/lib/unstable/kit/config.d.ts +95 -0
- package/build/cjs/lib/unstable/kit/config.js +68 -0
- package/build/cjs/lib/unstable/kit/constants/config.d.ts +112 -0
- package/build/cjs/lib/unstable/kit/constants/config.js +62 -0
- package/build/cjs/lib/unstable/kit/constants/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/constants/index.js +6 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/ArrayBase.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +46 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/ArrayBase/index.js +4 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.css +5 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/Checkbox.js +16 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Checkbox/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.d.ts +9 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +37 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/CheckboxGroup/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +24 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/ColorPicker/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/DateInput.js +55 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/DateInput/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/MultiSelect.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +35 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/MultiSelect/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/Number.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/Number.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/NumberBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/ObjectBase.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +33 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/ObjectBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Password/Password.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/Password/Password.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/Password/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Password/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.d.ts +8 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +24 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/RadioGroup/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.d.ts +7 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +33 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/RangeSlider/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Select/Select.d.ts +9 -0
- package/build/cjs/lib/unstable/kit/controls/Select/Select.js +32 -0
- package/build/cjs/lib/unstable/kit/controls/Select/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Select/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.css +3 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/Slider.js +19 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Slider/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/StringBase.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/StringBase/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.css +5 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/Switch.js +16 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/Switch/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/TextArea.js +12 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/controls/TextArea/index.js +5 -0
- package/build/cjs/lib/unstable/kit/controls/index.d.ts +16 -0
- package/build/cjs/lib/unstable/kit/controls/index.js +35 -0
- package/build/cjs/lib/unstable/kit/styles/functions.css +0 -0
- package/build/cjs/lib/unstable/kit/styles/variables.css +0 -0
- package/build/cjs/lib/unstable/kit/utils/cn.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/utils/cn.js +6 -0
- package/build/cjs/lib/unstable/kit/utils/common.d.ts +7 -0
- package/build/cjs/lib/unstable/kit/utils/common.js +27 -0
- package/build/cjs/lib/unstable/kit/utils/index.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/utils/index.js +11 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.css +27 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.d.ts +6 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/Row.js +34 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/wrappers/Row/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.css +6 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.d.ts +3 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/Transparent.js +15 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/index.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/wrappers/Transparent/index.js +5 -0
- package/build/cjs/lib/unstable/kit/wrappers/index.d.ts +2 -0
- package/build/cjs/lib/unstable/kit/wrappers/index.js +7 -0
- package/build/cjs/unstable.d.ts +4 -0
- package/build/cjs/unstable.js +10 -0
- package/build/esm/lib/unstable/core/Entity/Entity.d.ts +10 -0
- package/build/esm/lib/unstable/core/Entity/Entity.js +74 -0
- package/build/esm/lib/unstable/core/Entity/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/Entity/index.js +1 -0
- package/build/esm/lib/unstable/core/Entity/types.d.ts +27 -0
- package/build/esm/lib/unstable/core/Entity/types.js +1 -0
- package/build/esm/lib/unstable/core/Entity/utils.d.ts +3 -0
- package/build/esm/lib/unstable/core/Entity/utils.js +35 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/SchemaRenderer.d.ts +5 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/SchemaRenderer.js +8 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/index.d.ts +1 -0
- package/build/esm/lib/unstable/core/SchemaRenderer/index.js +1 -0
- package/build/esm/lib/unstable/core/constants.d.ts +22 -0
- package/build/esm/lib/unstable/core/constants.js +25 -0
- package/build/esm/lib/unstable/core/index.d.ts +5 -0
- package/build/esm/lib/unstable/core/index.js +4 -0
- package/build/esm/lib/unstable/core/types/components.d.ts +29 -0
- package/build/esm/lib/unstable/core/types/components.js +1 -0
- package/build/esm/lib/unstable/core/types/config.d.ts +36 -0
- package/build/esm/lib/unstable/core/types/config.js +1 -0
- package/build/esm/lib/unstable/core/types/helpers.d.ts +18 -0
- package/build/esm/lib/unstable/core/types/helpers.js +1 -0
- package/build/esm/lib/unstable/core/types/index.d.ts +5 -0
- package/build/esm/lib/unstable/core/types/index.js +5 -0
- package/build/esm/lib/unstable/core/types/schema.d.ts +1186 -0
- package/build/esm/lib/unstable/core/types/schema.js +1 -0
- package/build/esm/lib/unstable/core/types/validation.d.ts +39 -0
- package/build/esm/lib/unstable/core/types/validation.js +1 -0
- package/build/esm/lib/unstable/core/types/values.d.ts +4 -0
- package/build/esm/lib/unstable/core/types/values.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/constants.d.ts +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/constants.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.d.ts +7 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useEntitiesState.js +20 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.d.ts +10 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/hooks/useSchemaRendererMutators.js +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/index.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/index.js +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/async-validation.js +29 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.d.ts +34 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/async-validation/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/external-errors.js +54 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.d.ts +25 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/external-errors/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/index.d.ts +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/index.js +13 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.d.ts +3 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/schema-mutators.js +75 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.d.ts +26 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/schema-mutators/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/trigger-fields.js +8 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.d.ts +6 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/mutators/trigger-fields/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/types.d.ts +22 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/types.js +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.d.ts +37 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +81 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/common.d.ts +1 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/common.js +7 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.d.ts +11 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-ajv-validate.js +34 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-validate.d.ts +14 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/get-validate.js +62 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/index.d.ts +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/index.js +2 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.d.ts +10 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-error.js +46 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.d.ts +20 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-ajv-validate-errors.js +39 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.d.ts +15 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.js +31 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.d.ts +12 -0
- package/build/esm/lib/unstable/core/useSchemaRenderer/utils/process-errors-state.js +12 -0
- package/build/esm/lib/unstable/core/utils/common.d.ts +49 -0
- package/build/esm/lib/unstable/core/utils/common.js +165 -0
- package/build/esm/lib/unstable/core/utils/index.d.ts +1 -0
- package/build/esm/lib/unstable/core/utils/index.js +1 -0
- package/build/esm/lib/unstable/kit/Accordeon.d.ts +3 -0
- package/build/esm/lib/unstable/kit/Accordeon.js +26 -0
- package/build/esm/lib/unstable/kit/Any.d.ts +2 -0
- package/build/esm/lib/unstable/kit/Any.js +16 -0
- package/build/esm/lib/unstable/kit/ArrayBase.css +23 -0
- package/build/esm/lib/unstable/kit/ArrayBase.d.ts +3 -0
- package/build/esm/lib/unstable/kit/ArrayBase.js +97 -0
- package/build/esm/lib/unstable/kit/MultiSelect.css +6 -0
- package/build/esm/lib/unstable/kit/MultiSelect.d.ts +7 -0
- package/build/esm/lib/unstable/kit/MultiSelect.js +62 -0
- package/build/esm/lib/unstable/kit/ObjectBase.css +10 -0
- package/build/esm/lib/unstable/kit/ObjectBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/ObjectBase.js +66 -0
- package/build/esm/lib/unstable/kit/Row.css +73 -0
- package/build/esm/lib/unstable/kit/Row.d.ts +11 -0
- package/build/esm/lib/unstable/kit/Row.js +47 -0
- package/build/esm/lib/unstable/kit/Text.d.ts +6 -0
- package/build/esm/lib/unstable/kit/Text.js +255 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.d.ts +5 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/ArrayRemoveButton.js +24 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ArrayRemoveButton/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.css +33 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.d.ts +9 -0
- package/build/esm/lib/unstable/kit/components/ControlError/ControlError.js +11 -0
- package/build/esm/lib/unstable/kit/components/ControlError/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/ControlError/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +6 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.js +7 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/components/HTMLContent/index.js +1 -0
- package/build/esm/lib/unstable/kit/components/index.d.ts +3 -0
- package/build/esm/lib/unstable/kit/components/index.js +3 -0
- package/build/esm/lib/unstable/kit/config.d.ts +95 -0
- package/build/esm/lib/unstable/kit/config.js +65 -0
- package/build/esm/lib/unstable/kit/constants/config.d.ts +112 -0
- package/build/esm/lib/unstable/kit/constants/config.js +59 -0
- package/build/esm/lib/unstable/kit/constants/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/constants/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/ArrayBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/ArrayBase.js +42 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ArrayBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.css +5 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/Checkbox.js +13 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Checkbox/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.css +3 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.d.ts +10 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/CheckboxGroup.js +34 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/CheckboxGroup/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/ColorPicker.js +21 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ColorPicker/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.css +3 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/DateInput.js +53 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/DateInput/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/MultiSelect.js +32 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/MultiSelect/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/Number.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/Number.js +8 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/NumberBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/ObjectBase.js +29 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/ObjectBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/Password/Password.js +8 -0
- package/build/esm/lib/unstable/kit/controls/Password/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Password/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.css +3 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/RadioGroup.js +22 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/RadioGroup/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.css +3 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.d.ts +8 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/RangeSlider.js +31 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/RangeSlider/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Select/Select.d.ts +9 -0
- package/build/esm/lib/unstable/kit/controls/Select/Select.js +29 -0
- package/build/esm/lib/unstable/kit/controls/Select/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Select/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.css +3 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Slider/Slider.js +16 -0
- package/build/esm/lib/unstable/kit/controls/Slider/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Slider/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/StringBase.js +8 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/StringBase/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.css +5 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.d.ts +7 -0
- package/build/esm/lib/unstable/kit/controls/Switch/Switch.js +13 -0
- package/build/esm/lib/unstable/kit/controls/Switch/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/Switch/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.d.ts +6 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/TextArea.js +8 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/controls/TextArea/index.js +1 -0
- package/build/esm/lib/unstable/kit/controls/index.d.ts +16 -0
- package/build/esm/lib/unstable/kit/controls/index.js +16 -0
- package/build/esm/lib/unstable/kit/styles/functions.css +0 -0
- package/build/esm/lib/unstable/kit/styles/variables.css +0 -0
- package/build/esm/lib/unstable/kit/utils/cn.d.ts +1 -0
- package/build/esm/lib/unstable/kit/utils/cn.js +3 -0
- package/build/esm/lib/unstable/kit/utils/common.d.ts +7 -0
- package/build/esm/lib/unstable/kit/utils/common.js +19 -0
- package/build/esm/lib/unstable/kit/utils/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/utils/index.js +2 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.css +27 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.d.ts +7 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/Row.js +31 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Row/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.css +6 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.d.ts +4 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/Transparent.js +12 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/index.d.ts +1 -0
- package/build/esm/lib/unstable/kit/wrappers/Transparent/index.js +1 -0
- package/build/esm/lib/unstable/kit/wrappers/index.d.ts +2 -0
- package/build/esm/lib/unstable/kit/wrappers/index.js +2 -0
- package/build/esm/unstable.d.ts +4 -0
- package/build/esm/unstable.js +4 -0
- package/package.json +24 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FieldValidator } from 'final-form';
|
|
2
|
+
import { type SchemaRendererMode } from '../constants';
|
|
3
|
+
import type { ErrorMessages, FieldValue, JsonSchema, SchemaRendererConfig } from '../types';
|
|
4
|
+
export interface UseSchemaRendererParams {
|
|
5
|
+
config: SchemaRendererConfig;
|
|
6
|
+
connectValidate?: boolean;
|
|
7
|
+
errorMessages?: ErrorMessages;
|
|
8
|
+
mode: SchemaRendererMode;
|
|
9
|
+
/**
|
|
10
|
+
* The `name` prop must be a non-empty string.
|
|
11
|
+
*
|
|
12
|
+
* In `final-form` and `react-final-form`, the `name` is used as a key to register
|
|
13
|
+
* the field within the form. If you pass an empty string (`name=""`), the field will
|
|
14
|
+
* not be registered, its value will not be tracked, and validation will not work.
|
|
15
|
+
*
|
|
16
|
+
* This can lead to:
|
|
17
|
+
* - the field being missing from the form `values`;
|
|
18
|
+
* - the `validate` function not being called;
|
|
19
|
+
* - no error or touched state updates;
|
|
20
|
+
* - inconsistent or broken form behavior.
|
|
21
|
+
*
|
|
22
|
+
* Always provide a unique, non-empty string for the field name.
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
schema: JsonSchema;
|
|
26
|
+
}
|
|
27
|
+
export type UseSchemaRendererReturn = {
|
|
28
|
+
schema: JsonSchema | undefined;
|
|
29
|
+
validate: FieldValidator<FieldValue> | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const useSchemaRenderer: ({ config, connectValidate, errorMessages, mode, name, schema: originalSchema, }: UseSchemaRendererParams) => {
|
|
32
|
+
schema: JsonSchema | undefined;
|
|
33
|
+
validate?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
schema: JsonSchema | undefined;
|
|
36
|
+
validate: (value?: FieldValue) => any;
|
|
37
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSchemaRenderer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
7
|
+
const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
|
|
8
|
+
const react_final_form_1 = require("react-final-form");
|
|
9
|
+
const constants_1 = require("../constants");
|
|
10
|
+
const constants_2 = require("./constants");
|
|
11
|
+
const hooks_1 = require("./hooks");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
13
|
+
const useSchemaRenderer = ({ config, connectValidate = true, errorMessages = constants_1.EMPTY_OBJECT, mode, name, schema: originalSchema, }) => {
|
|
14
|
+
const form = (0, react_final_form_1.useForm)();
|
|
15
|
+
const { setAsyncValidationCache, setAsyncValidationWaiters, triggerFields } = (0, hooks_1.useSchemaRendererMutators)();
|
|
16
|
+
const errorsRef = react_1.default.useRef({});
|
|
17
|
+
const schemaRef = react_1.default.useRef(undefined);
|
|
18
|
+
const [schema, setSchema] = react_1.default.useState(undefined);
|
|
19
|
+
const [fieldsToTrigger, setFieldsToTrigger] = react_1.default.useState([]);
|
|
20
|
+
const setErrors = react_1.default.useCallback((errors) => {
|
|
21
|
+
const formState = form.getState();
|
|
22
|
+
const fieldsToTrigger = Object.keys(Object.assign(Object.assign({}, errorsRef.current), errors)).filter((key) => {
|
|
23
|
+
if (errorsRef.current[key] !== errors[key]) {
|
|
24
|
+
const field = form.getFieldState(key);
|
|
25
|
+
if ((field === null || field === void 0 ? void 0 : field.touched) || formState.submitFailed) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
});
|
|
31
|
+
errorsRef.current = errors;
|
|
32
|
+
if (fieldsToTrigger.length) {
|
|
33
|
+
setFieldsToTrigger(fieldsToTrigger);
|
|
34
|
+
}
|
|
35
|
+
}, [form]);
|
|
36
|
+
const validate = react_1.default.useMemo(() => (0, utils_1.getValidate)({
|
|
37
|
+
config,
|
|
38
|
+
errorMessages,
|
|
39
|
+
name,
|
|
40
|
+
setAsyncValidationCache,
|
|
41
|
+
setAsyncValidationWaiters,
|
|
42
|
+
setErrors,
|
|
43
|
+
}), [
|
|
44
|
+
config,
|
|
45
|
+
errorMessages,
|
|
46
|
+
name,
|
|
47
|
+
setAsyncValidationCache,
|
|
48
|
+
setAsyncValidationWaiters,
|
|
49
|
+
setErrors,
|
|
50
|
+
]);
|
|
51
|
+
const returnValue = react_1.default.useMemo(() => {
|
|
52
|
+
if (connectValidate) {
|
|
53
|
+
return { schema };
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
schema,
|
|
57
|
+
validate: (value) => {
|
|
58
|
+
const allValues = form.getState().values;
|
|
59
|
+
const meta = form.getFieldState(name);
|
|
60
|
+
return validate(value, allValues, meta);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}, [connectValidate, form, name, schema, validate]);
|
|
64
|
+
react_1.default.useEffect(() => {
|
|
65
|
+
schemaRef.current = (0, cloneDeep_1.default)(originalSchema);
|
|
66
|
+
setSchema(schemaRef.current);
|
|
67
|
+
}, [originalSchema]);
|
|
68
|
+
react_1.default.useEffect(() => {
|
|
69
|
+
const data = { originalSchema, schema: schemaRef.current };
|
|
70
|
+
const getValidator = connectValidate ? () => validate : undefined;
|
|
71
|
+
const unsubscribe = form.registerField(name, noop_1.default, constants_1.EMPTY_OBJECT, { data, getValidator });
|
|
72
|
+
return () => unsubscribe();
|
|
73
|
+
}, [connectValidate, form, name, originalSchema, validate]);
|
|
74
|
+
react_1.default.useEffect(() => {
|
|
75
|
+
const data = { config, errorsRef, headName: name, mode, schema: schemaRef.current };
|
|
76
|
+
const unsubscribe = form.registerField(`${constants_2.ENTITY_SERVICE_FIELD}.${name}`, noop_1.default, constants_1.EMPTY_OBJECT, { data });
|
|
77
|
+
return () => unsubscribe();
|
|
78
|
+
}, [config, form, mode, name]);
|
|
79
|
+
react_1.default.useEffect(() => {
|
|
80
|
+
if (fieldsToTrigger.length) {
|
|
81
|
+
triggerFields === null || triggerFields === void 0 ? void 0 : triggerFields({ fields: fieldsToTrigger });
|
|
82
|
+
}
|
|
83
|
+
}, [fieldsToTrigger, triggerFields]);
|
|
84
|
+
return returnValue;
|
|
85
|
+
};
|
|
86
|
+
exports.useSchemaRenderer = useSchemaRenderer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const guessHeadName: (registeredFields: string[], name: string) => string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.guessHeadName = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const guessHeadName = (registeredFields, name) => {
|
|
6
|
+
const registeredServiceFields = registeredFields
|
|
7
|
+
.filter((n) => n.startsWith(constants_1.ENTITY_SERVICE_FIELD))
|
|
8
|
+
.map((n) => n.slice(`${constants_1.ENTITY_SERVICE_FIELD}.`.length));
|
|
9
|
+
return registeredServiceFields.find((n) => name === n || name.startsWith(`${n}.`) || name.startsWith(`${n}[`));
|
|
10
|
+
};
|
|
11
|
+
exports.guessHeadName = guessHeadName;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ErrorObject, ValidateFunction } from 'ajv';
|
|
2
|
+
import type { JsonSchema, SchemaRendererConfig } from '../../types';
|
|
3
|
+
import type { EntityParametersError } from '../types';
|
|
4
|
+
export interface GetAjvValidateParams {
|
|
5
|
+
config: SchemaRendererConfig;
|
|
6
|
+
schema: JsonSchema;
|
|
7
|
+
}
|
|
8
|
+
export interface GetAjvValidateReturn extends ValidateFunction {
|
|
9
|
+
errors?: (ErrorObject | EntityParametersError)[];
|
|
10
|
+
}
|
|
11
|
+
export declare const getAjvValidate: ({ config, schema }: GetAjvValidateParams) => GetAjvValidateReturn;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAjvValidate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ajv_1 = tslib_1.__importDefault(require("ajv"));
|
|
6
|
+
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
7
|
+
const getAjvValidate = ({ config, schema }) => {
|
|
8
|
+
function entityParametersValidate(_, value, schema) {
|
|
9
|
+
if (schema && schema.entityParameters) {
|
|
10
|
+
const entityType = (0, get_1.default)(schema, 'entityParameters.type');
|
|
11
|
+
const validatorType = schema.entityParameters.validatorType;
|
|
12
|
+
const validator = (0, get_1.default)(config, `${entityType}.validators.${validatorType}`);
|
|
13
|
+
if (validator) {
|
|
14
|
+
const error = {
|
|
15
|
+
keyword: 'entityParameters',
|
|
16
|
+
message: '',
|
|
17
|
+
params: { validator, value, schema },
|
|
18
|
+
};
|
|
19
|
+
entityParametersValidate.errors = [error];
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
const ajv = new ajv_1.default({
|
|
26
|
+
allErrors: true,
|
|
27
|
+
allowMatchingProperties: true,
|
|
28
|
+
keywords: [
|
|
29
|
+
{
|
|
30
|
+
errors: true,
|
|
31
|
+
keyword: 'entityParameters',
|
|
32
|
+
validate: entityParametersValidate,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
const ajvValidate = ajv.compile(schema);
|
|
37
|
+
return ajvValidate;
|
|
38
|
+
};
|
|
39
|
+
exports.getAjvValidate = getAjvValidate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FieldValidator } from 'final-form';
|
|
2
|
+
import type { ErrorMessages, FieldValue, SchemaRendererConfig, SyncValidateError } from '../../types';
|
|
3
|
+
import type { SetAsyncValidationCacheMutator, SetAsyncValidationWaitersMutator } from '../mutators';
|
|
4
|
+
export type GetValidateParams = {
|
|
5
|
+
config: SchemaRendererConfig;
|
|
6
|
+
errorMessages: ErrorMessages;
|
|
7
|
+
name: string;
|
|
8
|
+
setAsyncValidationCache?: SetAsyncValidationCacheMutator;
|
|
9
|
+
setAsyncValidationWaiters?: SetAsyncValidationWaitersMutator;
|
|
10
|
+
setErrors: (errors: Record<string, SyncValidateError>) => void;
|
|
11
|
+
};
|
|
12
|
+
type GetValidateReturn = FieldValidator<FieldValue>;
|
|
13
|
+
export declare const getValidate: ({ config, errorMessages, name, setAsyncValidationCache, setAsyncValidationWaiters, setErrors, }: GetValidateParams) => GetValidateReturn;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValidate = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
6
|
+
const isBoolean_1 = tslib_1.__importDefault(require("lodash/isBoolean"));
|
|
7
|
+
const isObjectLike_1 = tslib_1.__importDefault(require("lodash/isObjectLike"));
|
|
8
|
+
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const get_ajv_validate_1 = require("./get-ajv-validate");
|
|
11
|
+
const process_ajv_validate_errors_1 = require("./process-ajv-validate-errors");
|
|
12
|
+
const process_errors_state_1 = require("./process-errors-state");
|
|
13
|
+
const getValidate = ({ config, errorMessages, name, setAsyncValidationCache, setAsyncValidationWaiters, setErrors, }) => {
|
|
14
|
+
let schema;
|
|
15
|
+
let ajvValidate;
|
|
16
|
+
return (value, allValues, meta) => {
|
|
17
|
+
const data = meta === null || meta === void 0 ? void 0 : meta.data;
|
|
18
|
+
if (!(data === null || data === void 0 ? void 0 : data.schema)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (schema !== data.schema) {
|
|
22
|
+
schema = data.schema;
|
|
23
|
+
ajvValidate = (0, get_ajv_validate_1.getAjvValidate)({ config, schema });
|
|
24
|
+
}
|
|
25
|
+
ajvValidate(value);
|
|
26
|
+
const { ajvErrorItems, entityParametersErrorItems, waiters } = (0, process_ajv_validate_errors_1.processAjvValidateErrors)({
|
|
27
|
+
ajvValidateErrors: ajvValidate.errors || [],
|
|
28
|
+
allValues: allValues,
|
|
29
|
+
errorMessages,
|
|
30
|
+
name,
|
|
31
|
+
schema,
|
|
32
|
+
setAsyncValidationCache,
|
|
33
|
+
validationState: data,
|
|
34
|
+
});
|
|
35
|
+
const { externalPriorityErrorItems, externalRegularErrorItems } = (0, process_errors_state_1.processErrorsState)({
|
|
36
|
+
errorsState: data,
|
|
37
|
+
name,
|
|
38
|
+
});
|
|
39
|
+
if (Object.keys(waiters).length) {
|
|
40
|
+
setAsyncValidationWaiters === null || setAsyncValidationWaiters === void 0 ? void 0 : setAsyncValidationWaiters({ headName: name, waiters });
|
|
41
|
+
}
|
|
42
|
+
const result = { errors: {} };
|
|
43
|
+
[
|
|
44
|
+
...externalRegularErrorItems,
|
|
45
|
+
...ajvErrorItems,
|
|
46
|
+
...entityParametersErrorItems,
|
|
47
|
+
...externalPriorityErrorItems,
|
|
48
|
+
].forEach((item) => {
|
|
49
|
+
if (!item.error) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if ((0, isObjectLike_1.default)(item.error)) {
|
|
53
|
+
(0, utils_1.getValuePaths)(item.error).forEach((childPath) => {
|
|
54
|
+
result.errors[(0, utils_1.formatFinalFormPath)([name, ...item.path, ...childPath])] = (0, get_1.default)(item.error, childPath);
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if ((0, isBoolean_1.default)(item.error) || (0, isString_1.default)(item.error)) {
|
|
59
|
+
result.errors[(0, utils_1.formatFinalFormPath)([name, ...item.path])] = item.error;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
setErrors(result.errors);
|
|
64
|
+
return Object.keys(result.errors).length ? 'error' : false;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
exports.getValidate = getValidate;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValidate = exports.guessHeadName = void 0;
|
|
4
|
+
var common_1 = require("./common");
|
|
5
|
+
Object.defineProperty(exports, "guessHeadName", { enumerable: true, get: function () { return common_1.guessHeadName; } });
|
|
6
|
+
var get_validate_1 = require("./get-validate");
|
|
7
|
+
Object.defineProperty(exports, "getValidate", { enumerable: true, get: function () { return get_validate_1.getValidate; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ErrorObject } from 'ajv';
|
|
2
|
+
import type { ErrorMessages, JsonSchema } from '../../types';
|
|
3
|
+
import type { ValidateErrorItem } from '../types';
|
|
4
|
+
export interface ProcessAjvErrorParams<Schema extends JsonSchema> {
|
|
5
|
+
error: ErrorObject;
|
|
6
|
+
errorMessages: ErrorMessages;
|
|
7
|
+
schema: Schema;
|
|
8
|
+
onError: (error: ValidateErrorItem) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const processAjvError: <Schema extends JsonSchema>({ error, errorMessages, schema, onError, }: ProcessAjvErrorParams<Schema>) => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAjvError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
6
|
+
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const processAjvError = ({ error, errorMessages, schema, onError, }) => {
|
|
9
|
+
let instancePath = error.instancePath;
|
|
10
|
+
let keyword = error.keyword;
|
|
11
|
+
let schemaPath = error.schemaPath;
|
|
12
|
+
if (keyword === 'anyOf' ||
|
|
13
|
+
(keyword === 'if' &&
|
|
14
|
+
(error.params.failingKeyword === 'then' || error.params.failingKeyword === 'else')) ||
|
|
15
|
+
keyword === 'false schema') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (error.propertyName) {
|
|
19
|
+
instancePath += `/${error.propertyName}`;
|
|
20
|
+
}
|
|
21
|
+
if (keyword === 'required') {
|
|
22
|
+
instancePath += `/${error.params.missingProperty}`;
|
|
23
|
+
}
|
|
24
|
+
else if (keyword === 'dependencies') {
|
|
25
|
+
instancePath += `/${error.params.missingProperty}`;
|
|
26
|
+
schemaPath =
|
|
27
|
+
schemaPath.slice(0, -'dependencies'.length) +
|
|
28
|
+
`properties/${error.params.missingProperty}/dependencies`;
|
|
29
|
+
}
|
|
30
|
+
else if (keyword === 'if') {
|
|
31
|
+
keyword = error.params.failingKeyword;
|
|
32
|
+
schemaPath = schemaPath.slice(0, -'if'.length) + error.params.failingKeyword;
|
|
33
|
+
}
|
|
34
|
+
const getErrorMessageBySchema = (schema) => {
|
|
35
|
+
const propertyName = instancePath.split('/').pop();
|
|
36
|
+
const errorOrMap = (0, get_1.default)(schema, `entityParameters.errorMessages.${keyword}`);
|
|
37
|
+
const message = (0, isString_1.default)(errorOrMap)
|
|
38
|
+
? errorOrMap
|
|
39
|
+
: (0, get_1.default)(errorOrMap, propertyName);
|
|
40
|
+
return message;
|
|
41
|
+
};
|
|
42
|
+
onError({
|
|
43
|
+
path: (0, utils_1.parseInstancePath)(instancePath),
|
|
44
|
+
error: getErrorMessageBySchema((0, utils_1.getSchemaBySchemaPath)(schemaPath, schema)) ||
|
|
45
|
+
getErrorMessageBySchema((0, utils_1.getSchemaBySchemaPath)(schemaPath.slice(0, -`/${keyword}`.length), schema)) ||
|
|
46
|
+
getErrorMessageBySchema((0, utils_1.getSchemaByInstancePath)(instancePath, schema)) ||
|
|
47
|
+
errorMessages[keyword] ||
|
|
48
|
+
error.message,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.processAjvError = processAjvError;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ErrorObject } from 'ajv';
|
|
2
|
+
import type { ErrorMessages, JsonSchema, ObjectValue } from '../../types';
|
|
3
|
+
import type { AsyncValidationState, AsyncValidationWaiter, SetAsyncValidationCacheMutator } from '../mutators';
|
|
4
|
+
import type { EntityParametersError, ValidateErrorItem } from '../types';
|
|
5
|
+
export interface ProcessAjvValidateErrorsParams<Schema extends JsonSchema> {
|
|
6
|
+
ajvValidateErrors: (ErrorObject | EntityParametersError)[];
|
|
7
|
+
allValues: ObjectValue;
|
|
8
|
+
errorMessages: ErrorMessages;
|
|
9
|
+
name: string;
|
|
10
|
+
schema: Schema;
|
|
11
|
+
setAsyncValidationCache?: SetAsyncValidationCacheMutator;
|
|
12
|
+
validationState: AsyncValidationState | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface ProcessAjvValidateErrorsReturn {
|
|
15
|
+
ajvErrorItems: ValidateErrorItem[];
|
|
16
|
+
entityParametersErrorItems: ValidateErrorItem[];
|
|
17
|
+
waiters: Record<string, AsyncValidationWaiter>;
|
|
18
|
+
}
|
|
19
|
+
export declare const processAjvValidateErrors: <Schema extends JsonSchema>({ ajvValidateErrors, allValues, errorMessages, name, schema, setAsyncValidationCache, validationState, }: ProcessAjvValidateErrorsParams<Schema>) => ProcessAjvValidateErrorsReturn;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAjvValidateErrors = void 0;
|
|
4
|
+
const process_ajv_error_1 = require("./process-ajv-error");
|
|
5
|
+
const process_entity_parameters_error_1 = require("./process-entity-parameters-error");
|
|
6
|
+
const processAjvValidateErrors = ({ ajvValidateErrors, allValues, errorMessages, name, schema, setAsyncValidationCache, validationState, }) => {
|
|
7
|
+
const waiters = {};
|
|
8
|
+
const ajvErrorItems = [];
|
|
9
|
+
const entityParametersErrorItems = [];
|
|
10
|
+
ajvValidateErrors.forEach((ajvOrEntityParametersError) => {
|
|
11
|
+
if (ajvOrEntityParametersError.keyword === 'entityParameters') {
|
|
12
|
+
const error = ajvOrEntityParametersError;
|
|
13
|
+
(0, process_entity_parameters_error_1.processEntityParametersError)({
|
|
14
|
+
allValues,
|
|
15
|
+
error,
|
|
16
|
+
onAsyncError: (w) => {
|
|
17
|
+
waiters[w.instancePath] = w.params;
|
|
18
|
+
w.promise.then((result) => {
|
|
19
|
+
setAsyncValidationCache === null || setAsyncValidationCache === void 0 ? void 0 : setAsyncValidationCache({
|
|
20
|
+
headName: name,
|
|
21
|
+
cache: {
|
|
22
|
+
[w.instancePath]: Object.assign(Object.assign({}, w.params), { result }),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
onError: (e) => entityParametersErrorItems.push(e),
|
|
28
|
+
validationState,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const error = ajvOrEntityParametersError;
|
|
33
|
+
(0, process_ajv_error_1.processAjvError)({
|
|
34
|
+
error,
|
|
35
|
+
errorMessages,
|
|
36
|
+
schema,
|
|
37
|
+
onError: (e) => ajvErrorItems.push(e),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return { ajvErrorItems, entityParametersErrorItems, waiters };
|
|
42
|
+
};
|
|
43
|
+
exports.processAjvValidateErrors = processAjvValidateErrors;
|
package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AsyncValidateError, ObjectValue } from '../../types';
|
|
2
|
+
import type { AsyncValidationState } from '../mutators';
|
|
3
|
+
import type { EntityParametersError, ValidateErrorItem } from '../types';
|
|
4
|
+
export interface ProcessEntityParametersErrorParams {
|
|
5
|
+
allValues: ObjectValue;
|
|
6
|
+
error: EntityParametersError;
|
|
7
|
+
onAsyncError: (waiter: {
|
|
8
|
+
instancePath: string;
|
|
9
|
+
params: EntityParametersError['params'];
|
|
10
|
+
promise: AsyncValidateError;
|
|
11
|
+
}) => void;
|
|
12
|
+
onError: (error: ValidateErrorItem) => void;
|
|
13
|
+
validationState: AsyncValidationState | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const processEntityParametersError: ({ allValues, error, onAsyncError, onError, validationState, }: ProcessEntityParametersErrorParams) => void;
|
package/build/cjs/lib/unstable/core/useSchemaRenderer/utils/process-entity-parameters-error.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processEntityParametersError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
6
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const processEntityParametersError = ({ allValues, error, onAsyncError, onError, validationState, }) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const waiter = (_a = validationState === null || validationState === void 0 ? void 0 : validationState.waiters) === null || _a === void 0 ? void 0 : _a[error.instancePath];
|
|
11
|
+
const cache = (_b = validationState === null || validationState === void 0 ? void 0 : validationState.cache) === null || _b === void 0 ? void 0 : _b[error.instancePath];
|
|
12
|
+
const cacheItem = cache === null || cache === void 0 ? void 0 : cache.find((item) => (0, isEqual_1.default)(error.params, (0, omit_1.default)(item, 'result')));
|
|
13
|
+
if (cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.result) {
|
|
14
|
+
onError({
|
|
15
|
+
error: cacheItem.result,
|
|
16
|
+
path: (0, utils_1.parseInstancePath)(error.instancePath),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else if (!waiter || !(0, isEqual_1.default)(error.params, waiter)) {
|
|
20
|
+
const errorOrPromise = error.params.validator(error.params.value, allValues);
|
|
21
|
+
if (errorOrPromise instanceof Promise) {
|
|
22
|
+
onAsyncError({
|
|
23
|
+
instancePath: error.instancePath,
|
|
24
|
+
params: error.params,
|
|
25
|
+
promise: errorOrPromise,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
onError({
|
|
30
|
+
error: errorOrPromise,
|
|
31
|
+
path: (0, utils_1.parseInstancePath)(error.instancePath),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.processEntityParametersError = processEntityParametersError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExternalErrorsState } from '../mutators';
|
|
2
|
+
import type { ValidateErrorItem } from '../types';
|
|
3
|
+
interface ProcessErrorsStateParams {
|
|
4
|
+
errorsState: ExternalErrorsState | undefined;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
interface ProcessErrorsStateReturn {
|
|
8
|
+
externalPriorityErrorItems: ValidateErrorItem[];
|
|
9
|
+
externalRegularErrorItems: ValidateErrorItem[];
|
|
10
|
+
}
|
|
11
|
+
export declare const processErrorsState: ({ errorsState, name, }: ProcessErrorsStateParams) => ProcessErrorsStateReturn;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processErrorsState = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const mapValues_1 = tslib_1.__importDefault(require("lodash/mapValues"));
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const processErrorsState = ({ errorsState, name, }) => {
|
|
8
|
+
const getErrorItems = (errors) => Object.values((0, mapValues_1.default)(errors, (value, key) => ({
|
|
9
|
+
path: (0, utils_1.parseFinalFormName)(key).slice((0, utils_1.parseFinalFormName)(name).length),
|
|
10
|
+
error: value,
|
|
11
|
+
})));
|
|
12
|
+
return {
|
|
13
|
+
externalPriorityErrorItems: getErrorItems(errorsState === null || errorsState === void 0 ? void 0 : errorsState.priorityErrors),
|
|
14
|
+
externalRegularErrorItems: getErrorItems(errorsState === null || errorsState === void 0 ? void 0 : errorsState.regularErrors),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.processErrorsState = processErrorsState;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { JsonSchema } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses an AJV `schemaPath` (JSON Pointer) into an array of path segments
|
|
4
|
+
* suitable for lodash `get`.
|
|
5
|
+
*
|
|
6
|
+
* Strips the `#/` prefix, decodes URI-encoded characters, splits on `/`,
|
|
7
|
+
* and unescapes JSON Pointer tokens (`~1` → `/`, `~0` → `~`).
|
|
8
|
+
*
|
|
9
|
+
* Returns all segments unchanged; stripping a trailing validation keyword
|
|
10
|
+
* (e.g. `minLength`) before lookup is the caller's responsibility.
|
|
11
|
+
*
|
|
12
|
+
* @param schemaPath - JSON Pointer string, e.g. `"#/properties/name/minLength"`.
|
|
13
|
+
* @returns Path segments, e.g. `['properties', 'name', 'minLength']`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const parseSchemaPath: (schemaPath: string) => string[];
|
|
16
|
+
export declare const parseInstancePath: (instancePath: string) => string[];
|
|
17
|
+
export declare const parseFinalFormName: (finalFormName: string) => string[];
|
|
18
|
+
export declare const formatFinalFormPath: (finalFormPath: string[]) => string;
|
|
19
|
+
export declare const getSchemaPath: (finalFormNameOrPath: string | string[], finalFormHeadName: string, schema: JsonSchema) => string[] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves a sub-schema from the root schema by an AJV `schemaPath`.
|
|
22
|
+
*
|
|
23
|
+
* Parses `schemaPath` via `parseSchemaPath` and looks up the node with lodash `get`.
|
|
24
|
+
* The path must point to a schema object, not to a validation keyword — callers
|
|
25
|
+
* should strip the trailing keyword first (see `processAjvError`).
|
|
26
|
+
*
|
|
27
|
+
* @param schemaPath - JSON Pointer string pointing to a schema node,
|
|
28
|
+
* e.g. `"#/properties/name"`.
|
|
29
|
+
* @param schema - The root JSON schema object.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const nameSchema = {
|
|
33
|
+
* minLength: 5,
|
|
34
|
+
* };
|
|
35
|
+
* const objectSchema = {
|
|
36
|
+
* properties: {
|
|
37
|
+
* name: nameSchema,
|
|
38
|
+
* },
|
|
39
|
+
* };
|
|
40
|
+
* getSchemaBySchemaPath("#/properties/name", objectSchema); // returns nameSchema
|
|
41
|
+
*
|
|
42
|
+
* @returns The sub-schema at the given path, or the root schema when the path is empty.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getSchemaBySchemaPath: (schemaPath: string, schema: JsonSchema) => JsonSchema | undefined;
|
|
45
|
+
export declare const getSchemaByInstancePath: (instancePath: string, schema: JsonSchema) => JsonSchema | undefined;
|
|
46
|
+
export declare const getSchemaByFinalFormPath: (finalFormNameOrPath: string | string[], finalFormHeadName: string, schema: JsonSchema) => JsonSchema | undefined;
|
|
47
|
+
export declare const getValuePaths: (value: unknown, path?: string[]) => string[][];
|
|
48
|
+
export declare const smartSet: (object: object, path: string[], value: unknown) => object;
|
|
49
|
+
export declare const smartMerge: (first: object, second: object, deep?: boolean) => {};
|