@dnb/eufemia 10.34.0 → 10.35.0
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/CHANGELOG.md +50 -0
- package/assets/images/sbanken/sbanken-compact-horizontal.svg +3 -0
- package/assets/images/sbanken/sbanken-compact.svg +3 -0
- package/assets/images/sbanken/sbanken.svg +3 -0
- package/cjs/components/accordion/Accordion.d.ts +0 -2
- package/cjs/components/accordion/Accordion.js +2 -3
- package/cjs/components/accordion/Accordion.js.map +1 -1
- package/cjs/components/accordion/AccordionGroup.js +2 -3
- package/cjs/components/accordion/AccordionGroup.js.map +1 -1
- package/cjs/components/anchor/Anchor.d.ts +3 -0
- package/cjs/components/anchor/Anchor.js +22 -15
- package/cjs/components/anchor/Anchor.js.map +1 -1
- package/cjs/components/autocomplete/Autocomplete.js +2 -4
- package/cjs/components/autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.css +1 -1
- package/cjs/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.scss +1 -1
- package/cjs/components/button/Button.d.ts +0 -4
- package/cjs/components/button/Button.js +2 -5
- package/cjs/components/button/Button.js.map +1 -1
- package/cjs/components/date-picker/DatePicker.d.ts +0 -1
- package/cjs/components/date-picker/DatePicker.js +2 -5
- package/cjs/components/date-picker/DatePicker.js.map +1 -1
- package/cjs/components/dropdown/Dropdown.js +2 -5
- package/cjs/components/dropdown/Dropdown.js.map +1 -1
- package/cjs/components/form-row/FormRow.d.ts +0 -1
- package/cjs/components/form-row/FormRow.js +2 -5
- package/cjs/components/form-row/FormRow.js.map +1 -1
- package/cjs/components/form-set/FormSet.d.ts +0 -1
- package/cjs/components/form-set/FormSet.js +3 -4
- package/cjs/components/form-set/FormSet.js.map +1 -1
- package/cjs/components/form-status/FormStatus.d.ts +0 -1
- package/cjs/components/form-status/FormStatus.js +2 -5
- package/cjs/components/form-status/FormStatus.js.map +1 -1
- package/cjs/components/global-status/GlobalStatus.d.ts +0 -1
- package/cjs/components/global-status/GlobalStatus.js +2 -5
- package/cjs/components/global-status/GlobalStatus.js.map +1 -1
- package/cjs/components/global-status/GlobalStatusController.js.map +1 -1
- package/cjs/components/global-status/GlobalStatusProvider.js.map +1 -1
- package/cjs/components/help-button/HelpButton.js +3 -0
- package/cjs/components/help-button/HelpButton.js.map +1 -1
- package/cjs/components/help-button/HelpButtonInstance.js +3 -4
- package/cjs/components/help-button/HelpButtonInstance.js.map +1 -1
- package/cjs/components/help-button/style/dnb-help-button.css +4 -1
- package/cjs/components/help-button/style/dnb-help-button.min.css +1 -0
- package/cjs/components/help-button/style/dnb-help-button.scss +6 -0
- package/cjs/components/icon/Icon.js +2 -3
- package/cjs/components/icon/Icon.js.map +1 -1
- package/cjs/components/icon-primary/IconPrimary.js.map +1 -1
- package/cjs/components/input/Input.d.ts +0 -1
- package/cjs/components/input/Input.js +2 -5
- package/cjs/components/input/Input.js.map +1 -1
- package/cjs/components/input-masked/InputMasked.d.ts +0 -1
- package/cjs/components/input-masked/InputMasked.js.map +1 -1
- package/cjs/components/logo/Logo.d.ts +47 -43
- package/cjs/components/logo/Logo.js +77 -224
- package/cjs/components/logo/Logo.js.map +1 -1
- package/cjs/components/logo/LogoDocs.d.ts +2 -0
- package/cjs/components/logo/LogoDocs.js +50 -0
- package/cjs/components/logo/LogoDocs.js.map +1 -0
- package/cjs/components/logo/LogoSvg.d.ts +7 -0
- package/cjs/components/logo/LogoSvg.js +81 -0
- package/cjs/components/logo/LogoSvg.js.map +1 -0
- package/cjs/components/modal/Modal.d.ts +2 -1
- package/cjs/components/modal/Modal.js +26 -12
- package/cjs/components/modal/Modal.js.map +1 -1
- package/cjs/components/modal/types.d.ts +0 -4
- package/cjs/components/modal/types.js.map +1 -1
- package/cjs/components/number-format/NumberFormat.d.ts +4 -0
- package/cjs/components/number-format/NumberFormat.js +5 -5
- package/cjs/components/number-format/NumberFormat.js.map +1 -1
- package/cjs/components/number-format/style/dnb-number-format.css +3 -0
- package/cjs/components/number-format/style/dnb-number-format.min.css +1 -1
- package/cjs/components/number-format/style/dnb-number-format.scss +4 -0
- package/cjs/components/pagination/Pagination.d.ts +0 -3
- package/cjs/components/pagination/Pagination.js +2 -5
- package/cjs/components/pagination/Pagination.js.map +1 -1
- package/cjs/components/pagination/PaginationHelpers.js.map +1 -1
- package/cjs/components/pagination/PaginationInfinity.js.map +1 -1
- package/cjs/components/pagination/PaginationProvider.js.map +1 -1
- package/cjs/components/progress-indicator/ProgressIndicatorDocs.js +1 -1
- package/cjs/components/progress-indicator/ProgressIndicatorDocs.js.map +1 -1
- package/cjs/components/progress-indicator/types.d.ts +1 -1
- package/cjs/components/progress-indicator/types.js.map +1 -1
- package/cjs/components/radio/Radio.d.ts +0 -1
- package/cjs/components/radio/Radio.js +2 -5
- package/cjs/components/radio/Radio.js.map +1 -1
- package/cjs/components/radio/RadioGroup.d.ts +0 -1
- package/cjs/components/radio/RadioGroup.js +2 -5
- package/cjs/components/radio/RadioGroup.js.map +1 -1
- package/cjs/components/skeleton/Skeleton.d.ts +0 -1
- package/cjs/components/skeleton/Skeleton.js +2 -5
- package/cjs/components/skeleton/Skeleton.js.map +1 -1
- package/cjs/components/switch/Switch.d.ts +0 -1
- package/cjs/components/switch/Switch.js +2 -5
- package/cjs/components/switch/Switch.js.map +1 -1
- package/cjs/components/table/Table.d.ts +6 -0
- package/cjs/components/table/Table.js +15 -3
- package/cjs/components/table/Table.js.map +1 -1
- package/cjs/components/table/TableAccordion.d.ts +7 -11
- package/cjs/components/table/TableAccordion.js +32 -21
- package/cjs/components/table/TableAccordion.js.map +1 -1
- package/cjs/components/table/TableTr.js +24 -25
- package/cjs/components/table/TableTr.js.map +1 -1
- package/cjs/components/tabs/Tabs.d.ts +0 -1
- package/cjs/components/tabs/Tabs.js +1 -7
- package/cjs/components/tabs/Tabs.js.map +1 -1
- package/cjs/components/tabs/TabsCustomContent.d.ts +0 -1
- package/cjs/components/tabs/TabsCustomContent.js +5 -8
- package/cjs/components/tabs/TabsCustomContent.js.map +1 -1
- package/cjs/components/tabs/TabsDocs.js +1 -1
- package/cjs/components/tabs/TabsDocs.js.map +1 -1
- package/cjs/components/textarea/Textarea.d.ts +0 -1
- package/cjs/components/textarea/Textarea.js +2 -5
- package/cjs/components/textarea/Textarea.js.map +1 -1
- package/cjs/components/toggle-button/ToggleButton.d.ts +0 -1
- package/cjs/components/toggle-button/ToggleButton.js +2 -5
- package/cjs/components/toggle-button/ToggleButton.js.map +1 -1
- package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +0 -1
- package/cjs/components/toggle-button/ToggleButtonGroup.js +2 -5
- package/cjs/components/toggle-button/ToggleButtonGroup.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Context.d.ts +2 -0
- package/cjs/extensions/forms/DataContext/Context.js +1 -0
- package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
- package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +17 -1
- package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
- package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +5 -3
- package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Provider/Provider.js +50 -4
- package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +2 -2
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js +7 -1
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/cjs/extensions/forms/Field/Boolean/Boolean.d.ts +2 -2
- package/cjs/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
- package/cjs/extensions/forms/Field/Number/style/dnb-number.css +10 -0
- package/cjs/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/cjs/extensions/forms/Field/Number/style/dnb-number.scss +11 -0
- package/cjs/extensions/forms/Field/Option/Option.d.ts +2 -2
- package/cjs/extensions/forms/Field/Option/Option.js.map +1 -1
- package/cjs/extensions/forms/Field/Password/Password.js +2 -1
- package/cjs/extensions/forms/Field/Password/Password.js.map +1 -1
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js +6 -6
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/cjs/extensions/forms/Field/Selection/Selection.js +7 -2
- package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/cjs/extensions/forms/Field/Toggle/Toggle.d.ts +2 -2
- package/cjs/extensions/forms/Field/Toggle/Toggle.js +13 -1
- package/cjs/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/cjs/extensions/forms/Form/Appearance/Appearance.d.ts +3 -0
- package/cjs/extensions/forms/Form/Appearance/Appearance.js +1 -0
- package/cjs/extensions/forms/Form/Appearance/Appearance.js.map +1 -1
- package/cjs/extensions/forms/Form/FieldProps/FieldProps.d.ts +5 -1
- package/cjs/extensions/forms/Form/FieldProps/FieldProps.js +20 -37
- package/cjs/extensions/forms/Form/FieldProps/FieldProps.js.map +1 -1
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainer.d.ts +12 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainer.js +44 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainer.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainerDocs.d.ts +3 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js +27 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditToolbarTools.d.ts +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js +67 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/index.d.ts +2 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/index.js +27 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/index.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useContainerDataStore.d.ts +3 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js +54 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.d.ts +1 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js +25 -0
- package/cjs/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/Section.d.ts +9 -1
- package/cjs/extensions/forms/Form/Section/Section.js +10 -2
- package/cjs/extensions/forms/Form/Section/Section.js.map +1 -1
- package/cjs/extensions/forms/Form/Section/SectionContext.d.ts +1 -2
- package/cjs/extensions/forms/Form/Section/SectionContext.js.map +1 -1
- package/cjs/extensions/forms/Form/Section/SectionDocs.js +6 -1
- package/cjs/extensions/forms/Form/Section/SectionDocs.js.map +1 -1
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainer.d.ts +12 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainer.js +43 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainer.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.d.ts +3 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js +27 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.d.ts +1 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js +34 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/index.d.ts +2 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/index.js +27 -0
- package/cjs/extensions/forms/Form/Section/ViewContainer/index.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainer.d.ts +19 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainer.js +93 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainer.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerContext.d.ts +8 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerContext.js +12 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerContext.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerProvider.d.ts +8 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerProvider.js +33 -0
- package/cjs/extensions/forms/Form/Section/containers/SectionContainerProvider.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/containers/Toolbar.d.ts +7 -0
- package/cjs/extensions/forms/Form/Section/containers/Toolbar.js +35 -0
- package/cjs/extensions/forms/Form/Section/containers/Toolbar.js.map +1 -0
- package/cjs/extensions/forms/Form/Section/style/dnb-form-section.css +45 -0
- package/cjs/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -0
- package/{extensions/forms/Iterate/style/dnb-form-iterate.scss → cjs/extensions/forms/Form/Section/style/dnb-form-section.scss} +4 -12
- package/cjs/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js +8 -8
- package/cjs/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js.map +1 -1
- package/cjs/extensions/forms/Iterate/Array/Array.js +1 -1
- package/cjs/extensions/forms/Iterate/Array/Array.js.map +1 -1
- package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -1
- package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
- package/cjs/extensions/forms/Iterate/EditContainer/EditToolbarTools.js +17 -8
- package/cjs/extensions/forms/Iterate/EditContainer/EditToolbarTools.js.map +1 -1
- package/cjs/extensions/forms/Iterate/RemoveButton/RemoveButton.js +1 -1
- package/cjs/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
- package/cjs/extensions/forms/Iterate/ViewContainer/ViewContainer.js +1 -1
- package/cjs/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
- package/cjs/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js +1 -1
- package/cjs/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js.map +1 -1
- package/cjs/extensions/forms/Iterate/style/dnb-iterate.css +6 -0
- package/cjs/extensions/forms/Iterate/style/dnb-iterate.min.css +1 -0
- package/cjs/extensions/forms/Iterate/style/dnb-iterate.scss +12 -0
- package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +1 -1
- package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/cjs/extensions/forms/Wizard/Step/Step.js +1 -1
- package/cjs/extensions/forms/Wizard/Step/Step.js.map +1 -1
- package/cjs/extensions/forms/constants/locales/en-GB.d.ts +2 -1
- package/cjs/extensions/forms/constants/locales/en-GB.js +3 -2
- package/cjs/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/cjs/extensions/forms/constants/locales/en-US.d.ts +2 -1
- package/cjs/extensions/forms/constants/locales/index.d.ts +4 -2
- package/cjs/extensions/forms/constants/locales/nb-NO.d.ts +2 -1
- package/cjs/extensions/forms/constants/locales/nb-NO.js +3 -2
- package/cjs/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/cjs/extensions/forms/hooks/useDataValue.d.ts +4 -0
- package/cjs/extensions/forms/hooks/useDataValue.js +30 -5
- package/cjs/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/cjs/extensions/forms/hooks/useFieldProps.js +14 -9
- package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/cjs/extensions/forms/hooks/useTranslation.js +6 -11
- package/cjs/extensions/forms/hooks/useTranslation.js.map +1 -1
- package/cjs/extensions/forms/style/dnb-forms.css +56 -44
- package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
- package/cjs/extensions/payment-card/PaymentCard.js +0 -2
- package/cjs/extensions/payment-card/PaymentCard.js.map +1 -1
- package/cjs/fragments/drawer-list/DrawerList.d.ts +0 -1
- package/cjs/fragments/drawer-list/DrawerList.js +6 -13
- package/cjs/fragments/drawer-list/DrawerList.js.map +1 -1
- package/cjs/fragments/drawer-list/DrawerListHelpers.d.ts +43 -46
- package/cjs/fragments/drawer-list/DrawerListHelpers.js +0 -2
- package/cjs/fragments/drawer-list/DrawerListHelpers.js.map +1 -1
- package/cjs/fragments/drawer-list/DrawerListPortal.js.map +1 -1
- package/cjs/fragments/drawer-list/DrawerListProvider.js.map +1 -1
- package/cjs/fragments/drawer-list/style/dnb-drawer-list.scss +4 -0
- package/cjs/fragments/text-counter/TextCounter.js +3 -2
- package/cjs/fragments/text-counter/TextCounter.js.map +1 -1
- package/cjs/shared/Context.d.ts +9 -5
- package/cjs/shared/Context.js +40 -35
- package/cjs/shared/Context.js.map +1 -1
- package/cjs/shared/Eufemia.d.ts +1 -1
- package/cjs/shared/Eufemia.js +2 -2
- package/cjs/shared/Eufemia.js.map +1 -1
- package/cjs/shared/Provider.d.ts +1 -1
- package/cjs/shared/Provider.js +49 -42
- package/cjs/shared/Provider.js.map +1 -1
- package/cjs/shared/Translation.d.ts +5 -5
- package/cjs/shared/Translation.js +6 -11
- package/cjs/shared/Translation.js.map +1 -1
- package/cjs/shared/index.d.ts +1 -0
- package/cjs/shared/index.js +26 -1
- package/cjs/shared/index.js.map +1 -1
- package/cjs/shared/locales/en-GB.d.ts +0 -3
- package/cjs/shared/locales/en-GB.js +0 -3
- package/cjs/shared/locales/en-GB.js.map +1 -1
- package/cjs/shared/locales/en-US.d.ts +0 -3
- package/cjs/shared/locales/index.d.ts +0 -6
- package/cjs/shared/locales/nb-NO.d.ts +0 -3
- package/cjs/shared/locales/nb-NO.js +0 -3
- package/cjs/shared/locales/nb-NO.js.map +1 -1
- package/cjs/shared/useTranslation.d.ts +5 -4
- package/cjs/shared/useTranslation.js +14 -12
- package/cjs/shared/useTranslation.js.map +1 -1
- package/cjs/style/core/scopes.scss +1 -1
- package/cjs/style/dnb-ui-basis.css +1 -1
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-body.css +1 -1
- package/cjs/style/dnb-ui-body.min.css +1 -1
- package/cjs/style/dnb-ui-components.css +67 -44
- package/cjs/style/dnb-ui-components.min.css +2 -2
- package/cjs/style/dnb-ui-core.css +1 -1
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/cjs/style/dnb-ui-extensions.css +56 -44
- package/cjs/style/dnb-ui-extensions.min.css +1 -1
- package/cjs/style/dnb-ui-forms.css +56 -44
- package/cjs/style/dnb-ui-forms.min.css +1 -1
- package/cjs/style/dnb-ui-forms.scss +2 -1
- package/cjs/style/dnb-ui-fragments.css +4 -0
- package/cjs/style/dnb-ui-fragments.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.css +2 -2
- package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +123 -88
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +3 -3
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +56 -44
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +56 -44
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/globals.scss +3 -2
- package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.css +2 -2
- package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +124 -89
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +3 -3
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +56 -44
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +56 -44
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-ui/globals.scss +3 -2
- package/cjs/style/themes/theme-ui/ui-theme-basis.css +2 -2
- package/cjs/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +123 -88
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +3 -3
- package/cjs/style/themes/theme-ui/ui-theme-extensions.css +56 -44
- package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-forms.css +56 -44
- package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/components/accordion/Accordion.d.ts +0 -2
- package/components/accordion/Accordion.js +2 -3
- package/components/accordion/Accordion.js.map +1 -1
- package/components/accordion/AccordionGroup.js +2 -3
- package/components/accordion/AccordionGroup.js.map +1 -1
- package/components/anchor/Anchor.d.ts +3 -0
- package/components/anchor/Anchor.js +21 -15
- package/components/anchor/Anchor.js.map +1 -1
- package/components/autocomplete/Autocomplete.js +2 -4
- package/components/autocomplete/Autocomplete.js.map +1 -1
- package/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.css +1 -1
- package/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.scss +1 -1
- package/components/button/Button.d.ts +0 -4
- package/components/button/Button.js +2 -5
- package/components/button/Button.js.map +1 -1
- package/components/date-picker/DatePicker.d.ts +0 -1
- package/components/date-picker/DatePicker.js +2 -5
- package/components/date-picker/DatePicker.js.map +1 -1
- package/components/dropdown/Dropdown.js +2 -5
- package/components/dropdown/Dropdown.js.map +1 -1
- package/components/form-row/FormRow.d.ts +0 -1
- package/components/form-row/FormRow.js +2 -5
- package/components/form-row/FormRow.js.map +1 -1
- package/components/form-set/FormSet.d.ts +0 -1
- package/components/form-set/FormSet.js +3 -4
- package/components/form-set/FormSet.js.map +1 -1
- package/components/form-status/FormStatus.d.ts +0 -1
- package/components/form-status/FormStatus.js +2 -5
- package/components/form-status/FormStatus.js.map +1 -1
- package/components/global-status/GlobalStatus.d.ts +0 -1
- package/components/global-status/GlobalStatus.js +2 -5
- package/components/global-status/GlobalStatus.js.map +1 -1
- package/components/global-status/GlobalStatusController.js.map +1 -1
- package/components/global-status/GlobalStatusProvider.js.map +1 -1
- package/components/help-button/HelpButton.js +3 -0
- package/components/help-button/HelpButton.js.map +1 -1
- package/components/help-button/HelpButtonInstance.js +3 -4
- package/components/help-button/HelpButtonInstance.js.map +1 -1
- package/components/help-button/style/dnb-help-button.css +4 -1
- package/components/help-button/style/dnb-help-button.min.css +1 -0
- package/components/help-button/style/dnb-help-button.scss +6 -0
- package/components/icon/Icon.js +2 -3
- package/components/icon/Icon.js.map +1 -1
- package/components/icon-primary/IconPrimary.js.map +1 -1
- package/components/input/Input.d.ts +0 -1
- package/components/input/Input.js +2 -5
- package/components/input/Input.js.map +1 -1
- package/components/input-masked/InputMasked.d.ts +0 -1
- package/components/input-masked/InputMasked.js.map +1 -1
- package/components/logo/Logo.d.ts +47 -43
- package/components/logo/Logo.js +75 -224
- package/components/logo/Logo.js.map +1 -1
- package/components/logo/LogoDocs.d.ts +2 -0
- package/components/logo/LogoDocs.js +43 -0
- package/components/logo/LogoDocs.js.map +1 -0
- package/components/logo/LogoSvg.d.ts +7 -0
- package/components/logo/LogoSvg.js +73 -0
- package/components/logo/LogoSvg.js.map +1 -0
- package/components/modal/Modal.d.ts +2 -1
- package/components/modal/Modal.js +26 -12
- package/components/modal/Modal.js.map +1 -1
- package/components/modal/types.d.ts +0 -4
- package/components/modal/types.js.map +1 -1
- package/components/number-format/NumberFormat.d.ts +4 -0
- package/components/number-format/NumberFormat.js +5 -5
- package/components/number-format/NumberFormat.js.map +1 -1
- package/components/number-format/style/dnb-number-format.css +3 -0
- package/components/number-format/style/dnb-number-format.min.css +1 -1
- package/components/number-format/style/dnb-number-format.scss +4 -0
- package/components/pagination/Pagination.d.ts +0 -3
- package/components/pagination/Pagination.js +2 -5
- package/components/pagination/Pagination.js.map +1 -1
- package/components/pagination/PaginationHelpers.js.map +1 -1
- package/components/pagination/PaginationInfinity.js.map +1 -1
- package/components/pagination/PaginationProvider.js.map +1 -1
- package/components/progress-indicator/ProgressIndicatorDocs.js +1 -1
- package/components/progress-indicator/ProgressIndicatorDocs.js.map +1 -1
- package/components/progress-indicator/types.d.ts +1 -1
- package/components/progress-indicator/types.js.map +1 -1
- package/components/radio/Radio.d.ts +0 -1
- package/components/radio/Radio.js +2 -5
- package/components/radio/Radio.js.map +1 -1
- package/components/radio/RadioGroup.d.ts +0 -1
- package/components/radio/RadioGroup.js +2 -5
- package/components/radio/RadioGroup.js.map +1 -1
- package/components/skeleton/Skeleton.d.ts +0 -1
- package/components/skeleton/Skeleton.js +2 -5
- package/components/skeleton/Skeleton.js.map +1 -1
- package/components/switch/Switch.d.ts +0 -1
- package/components/switch/Switch.js +2 -5
- package/components/switch/Switch.js.map +1 -1
- package/components/table/Table.d.ts +6 -0
- package/components/table/Table.js +13 -3
- package/components/table/Table.js.map +1 -1
- package/components/table/TableAccordion.d.ts +7 -11
- package/components/table/TableAccordion.js +29 -20
- package/components/table/TableAccordion.js.map +1 -1
- package/components/table/TableTr.js +25 -26
- package/components/table/TableTr.js.map +1 -1
- package/components/tabs/Tabs.d.ts +0 -1
- package/components/tabs/Tabs.js +1 -7
- package/components/tabs/Tabs.js.map +1 -1
- package/components/tabs/TabsCustomContent.d.ts +0 -1
- package/components/tabs/TabsCustomContent.js +5 -8
- package/components/tabs/TabsCustomContent.js.map +1 -1
- package/components/tabs/TabsDocs.js +1 -1
- package/components/tabs/TabsDocs.js.map +1 -1
- package/components/textarea/Textarea.d.ts +0 -1
- package/components/textarea/Textarea.js +2 -5
- package/components/textarea/Textarea.js.map +1 -1
- package/components/toggle-button/ToggleButton.d.ts +0 -1
- package/components/toggle-button/ToggleButton.js +2 -5
- package/components/toggle-button/ToggleButton.js.map +1 -1
- package/components/toggle-button/ToggleButtonGroup.d.ts +0 -1
- package/components/toggle-button/ToggleButtonGroup.js +2 -5
- package/components/toggle-button/ToggleButtonGroup.js.map +1 -1
- package/es/components/accordion/Accordion.d.ts +0 -2
- package/es/components/accordion/Accordion.js +2 -3
- package/es/components/accordion/Accordion.js.map +1 -1
- package/es/components/accordion/AccordionGroup.js +2 -3
- package/es/components/accordion/AccordionGroup.js.map +1 -1
- package/es/components/anchor/Anchor.d.ts +3 -0
- package/es/components/anchor/Anchor.js +21 -15
- package/es/components/anchor/Anchor.js.map +1 -1
- package/es/components/autocomplete/Autocomplete.js +2 -4
- package/es/components/autocomplete/Autocomplete.js.map +1 -1
- package/es/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.css +1 -1
- package/es/components/autocomplete/style/themes/dnb-autocomplete-theme-sbanken.scss +1 -1
- package/es/components/button/Button.d.ts +0 -4
- package/es/components/button/Button.js +2 -5
- package/es/components/button/Button.js.map +1 -1
- package/es/components/date-picker/DatePicker.d.ts +0 -1
- package/es/components/date-picker/DatePicker.js +2 -5
- package/es/components/date-picker/DatePicker.js.map +1 -1
- package/es/components/dropdown/Dropdown.js +2 -5
- package/es/components/dropdown/Dropdown.js.map +1 -1
- package/es/components/form-row/FormRow.d.ts +0 -1
- package/es/components/form-row/FormRow.js +2 -5
- package/es/components/form-row/FormRow.js.map +1 -1
- package/es/components/form-set/FormSet.d.ts +0 -1
- package/es/components/form-set/FormSet.js +3 -4
- package/es/components/form-set/FormSet.js.map +1 -1
- package/es/components/form-status/FormStatus.d.ts +0 -1
- package/es/components/form-status/FormStatus.js +2 -5
- package/es/components/form-status/FormStatus.js.map +1 -1
- package/es/components/global-status/GlobalStatus.d.ts +0 -1
- package/es/components/global-status/GlobalStatus.js +2 -5
- package/es/components/global-status/GlobalStatus.js.map +1 -1
- package/es/components/global-status/GlobalStatusController.js.map +1 -1
- package/es/components/global-status/GlobalStatusProvider.js.map +1 -1
- package/es/components/help-button/HelpButton.js +3 -0
- package/es/components/help-button/HelpButton.js.map +1 -1
- package/es/components/help-button/HelpButtonInstance.js +3 -4
- package/es/components/help-button/HelpButtonInstance.js.map +1 -1
- package/es/components/help-button/style/dnb-help-button.css +4 -1
- package/es/components/help-button/style/dnb-help-button.min.css +1 -0
- package/es/components/help-button/style/dnb-help-button.scss +6 -0
- package/es/components/icon/Icon.js +2 -3
- package/es/components/icon/Icon.js.map +1 -1
- package/es/components/icon-primary/IconPrimary.js.map +1 -1
- package/es/components/input/Input.d.ts +0 -1
- package/es/components/input/Input.js +2 -5
- package/es/components/input/Input.js.map +1 -1
- package/es/components/input-masked/InputMasked.d.ts +0 -1
- package/es/components/input-masked/InputMasked.js.map +1 -1
- package/es/components/logo/Logo.d.ts +47 -43
- package/es/components/logo/Logo.js +75 -224
- package/es/components/logo/Logo.js.map +1 -1
- package/es/components/logo/LogoDocs.d.ts +2 -0
- package/es/components/logo/LogoDocs.js +43 -0
- package/es/components/logo/LogoDocs.js.map +1 -0
- package/es/components/logo/LogoSvg.d.ts +7 -0
- package/es/components/logo/LogoSvg.js +72 -0
- package/es/components/logo/LogoSvg.js.map +1 -0
- package/es/components/modal/Modal.d.ts +2 -1
- package/es/components/modal/Modal.js +26 -12
- package/es/components/modal/Modal.js.map +1 -1
- package/es/components/modal/types.d.ts +0 -4
- package/es/components/modal/types.js.map +1 -1
- package/es/components/number-format/NumberFormat.d.ts +4 -0
- package/es/components/number-format/NumberFormat.js +5 -5
- package/es/components/number-format/NumberFormat.js.map +1 -1
- package/es/components/number-format/style/dnb-number-format.css +3 -0
- package/es/components/number-format/style/dnb-number-format.min.css +1 -1
- package/es/components/number-format/style/dnb-number-format.scss +4 -0
- package/es/components/pagination/Pagination.d.ts +0 -3
- package/es/components/pagination/Pagination.js +2 -5
- package/es/components/pagination/Pagination.js.map +1 -1
- package/es/components/pagination/PaginationHelpers.js.map +1 -1
- package/es/components/pagination/PaginationInfinity.js.map +1 -1
- package/es/components/pagination/PaginationProvider.js.map +1 -1
- package/es/components/progress-indicator/ProgressIndicatorDocs.js +1 -1
- package/es/components/progress-indicator/ProgressIndicatorDocs.js.map +1 -1
- package/es/components/progress-indicator/types.d.ts +1 -1
- package/es/components/progress-indicator/types.js.map +1 -1
- package/es/components/radio/Radio.d.ts +0 -1
- package/es/components/radio/Radio.js +2 -5
- package/es/components/radio/Radio.js.map +1 -1
- package/es/components/radio/RadioGroup.d.ts +0 -1
- package/es/components/radio/RadioGroup.js +2 -5
- package/es/components/radio/RadioGroup.js.map +1 -1
- package/es/components/skeleton/Skeleton.d.ts +0 -1
- package/es/components/skeleton/Skeleton.js +2 -5
- package/es/components/skeleton/Skeleton.js.map +1 -1
- package/es/components/switch/Switch.d.ts +0 -1
- package/es/components/switch/Switch.js +2 -5
- package/es/components/switch/Switch.js.map +1 -1
- package/es/components/table/Table.d.ts +6 -0
- package/es/components/table/Table.js +13 -3
- package/es/components/table/Table.js.map +1 -1
- package/es/components/table/TableAccordion.d.ts +7 -11
- package/es/components/table/TableAccordion.js +29 -19
- package/es/components/table/TableAccordion.js.map +1 -1
- package/es/components/table/TableTr.js +25 -26
- package/es/components/table/TableTr.js.map +1 -1
- package/es/components/tabs/Tabs.d.ts +0 -1
- package/es/components/tabs/Tabs.js +1 -7
- package/es/components/tabs/Tabs.js.map +1 -1
- package/es/components/tabs/TabsCustomContent.d.ts +0 -1
- package/es/components/tabs/TabsCustomContent.js +5 -8
- package/es/components/tabs/TabsCustomContent.js.map +1 -1
- package/es/components/tabs/TabsDocs.js +1 -1
- package/es/components/tabs/TabsDocs.js.map +1 -1
- package/es/components/textarea/Textarea.d.ts +0 -1
- package/es/components/textarea/Textarea.js +2 -5
- package/es/components/textarea/Textarea.js.map +1 -1
- package/es/components/toggle-button/ToggleButton.d.ts +0 -1
- package/es/components/toggle-button/ToggleButton.js +2 -5
- package/es/components/toggle-button/ToggleButton.js.map +1 -1
- package/es/components/toggle-button/ToggleButtonGroup.d.ts +0 -1
- package/es/components/toggle-button/ToggleButtonGroup.js +2 -5
- package/es/components/toggle-button/ToggleButtonGroup.js.map +1 -1
- package/es/extensions/forms/DataContext/Context.d.ts +2 -0
- package/es/extensions/forms/DataContext/Context.js +1 -0
- package/es/extensions/forms/DataContext/Context.js.map +1 -1
- package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +17 -1
- package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
- package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +5 -3
- package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
- package/es/extensions/forms/DataContext/Provider/Provider.js +46 -1
- package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +2 -2
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.js +8 -2
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/es/extensions/forms/Field/Boolean/Boolean.d.ts +2 -2
- package/es/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
- package/es/extensions/forms/Field/Number/style/dnb-number.css +10 -0
- package/es/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/es/extensions/forms/Field/Number/style/dnb-number.scss +11 -0
- package/es/extensions/forms/Field/Option/Option.d.ts +2 -2
- package/es/extensions/forms/Field/Option/Option.js.map +1 -1
- package/es/extensions/forms/Field/Password/Password.js +2 -1
- package/es/extensions/forms/Field/Password/Password.js.map +1 -1
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js +6 -6
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/es/extensions/forms/Field/Selection/Selection.js +7 -2
- package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/es/extensions/forms/Field/Toggle/Toggle.d.ts +2 -2
- package/es/extensions/forms/Field/Toggle/Toggle.js +14 -2
- package/es/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/es/extensions/forms/Form/Appearance/Appearance.d.ts +3 -0
- package/es/extensions/forms/Form/Appearance/Appearance.js +1 -0
- package/es/extensions/forms/Form/Appearance/Appearance.js.map +1 -1
- package/es/extensions/forms/Form/FieldProps/FieldProps.d.ts +5 -1
- package/es/extensions/forms/Form/FieldProps/FieldProps.js +19 -37
- package/es/extensions/forms/Form/FieldProps/FieldProps.js.map +1 -1
- package/es/extensions/forms/Form/Section/EditContainer/EditContainer.d.ts +12 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditContainer.js +33 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditContainer.js.map +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditContainerDocs.d.ts +3 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js +19 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js.map +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditToolbarTools.d.ts +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js +59 -0
- package/es/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js.map +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/index.d.ts +2 -0
- package/es/extensions/forms/Form/Section/EditContainer/index.js +3 -0
- package/es/extensions/forms/Form/Section/EditContainer/index.js.map +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/useContainerDataStore.d.ts +3 -0
- package/es/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js +46 -0
- package/es/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js.map +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.d.ts +1 -0
- package/es/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js +19 -0
- package/es/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js.map +1 -0
- package/es/extensions/forms/Form/Section/Section.d.ts +9 -1
- package/es/extensions/forms/Form/Section/Section.js +10 -2
- package/es/extensions/forms/Form/Section/Section.js.map +1 -1
- package/es/extensions/forms/Form/Section/SectionContext.d.ts +1 -2
- package/es/extensions/forms/Form/Section/SectionContext.js.map +1 -1
- package/es/extensions/forms/Form/Section/SectionDocs.js +6 -1
- package/es/extensions/forms/Form/Section/SectionDocs.js.map +1 -1
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainer.d.ts +12 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainer.js +32 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainer.js.map +1 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.d.ts +3 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js +19 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js.map +1 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.d.ts +1 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js +26 -0
- package/es/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js.map +1 -0
- package/es/extensions/forms/Form/Section/ViewContainer/index.d.ts +2 -0
- package/es/extensions/forms/Form/Section/ViewContainer/index.js +3 -0
- package/es/extensions/forms/Form/Section/ViewContainer/index.js.map +1 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainer.d.ts +19 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainer.js +83 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainer.js.map +1 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerContext.d.ts +8 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerContext.js +4 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerContext.js.map +1 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerProvider.d.ts +8 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerProvider.js +24 -0
- package/es/extensions/forms/Form/Section/containers/SectionContainerProvider.js.map +1 -0
- package/es/extensions/forms/Form/Section/containers/Toolbar.d.ts +7 -0
- package/es/extensions/forms/Form/Section/containers/Toolbar.js +27 -0
- package/es/extensions/forms/Form/Section/containers/Toolbar.js.map +1 -0
- package/es/extensions/forms/Form/Section/style/dnb-form-section.css +45 -0
- package/es/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -0
- package/es/extensions/forms/{Iterate/style/dnb-form-iterate.scss → Form/Section/style/dnb-form-section.scss} +4 -12
- package/es/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js +8 -8
- package/es/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js.map +1 -1
- package/es/extensions/forms/Iterate/Array/Array.js +1 -1
- package/es/extensions/forms/Iterate/Array/Array.js.map +1 -1
- package/es/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -1
- package/es/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
- package/es/extensions/forms/Iterate/EditContainer/EditToolbarTools.js +19 -10
- package/es/extensions/forms/Iterate/EditContainer/EditToolbarTools.js.map +1 -1
- package/es/extensions/forms/Iterate/RemoveButton/RemoveButton.js +1 -1
- package/es/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
- package/es/extensions/forms/Iterate/ViewContainer/ViewContainer.js +1 -1
- package/es/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
- package/es/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js +1 -1
- package/es/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js.map +1 -1
- package/es/extensions/forms/Iterate/style/dnb-iterate.css +6 -0
- package/es/extensions/forms/Iterate/style/dnb-iterate.min.css +1 -0
- package/es/extensions/forms/Iterate/style/dnb-iterate.scss +12 -0
- package/es/extensions/forms/Wizard/Container/WizardContainer.js +1 -1
- package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/es/extensions/forms/Wizard/Step/Step.js +1 -1
- package/es/extensions/forms/Wizard/Step/Step.js.map +1 -1
- package/es/extensions/forms/constants/locales/en-GB.d.ts +2 -1
- package/es/extensions/forms/constants/locales/en-GB.js +3 -2
- package/es/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/es/extensions/forms/constants/locales/en-US.d.ts +2 -1
- package/es/extensions/forms/constants/locales/index.d.ts +4 -2
- package/es/extensions/forms/constants/locales/nb-NO.d.ts +2 -1
- package/es/extensions/forms/constants/locales/nb-NO.js +3 -2
- package/es/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/es/extensions/forms/hooks/useDataValue.d.ts +4 -0
- package/es/extensions/forms/hooks/useDataValue.js +30 -5
- package/es/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/es/extensions/forms/hooks/useFieldProps.js +14 -9
- package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/es/extensions/forms/hooks/useTranslation.js +7 -12
- package/es/extensions/forms/hooks/useTranslation.js.map +1 -1
- package/es/extensions/forms/style/dnb-forms.css +56 -44
- package/es/extensions/forms/style/dnb-forms.min.css +1 -1
- package/es/extensions/payment-card/PaymentCard.js +0 -2
- package/es/extensions/payment-card/PaymentCard.js.map +1 -1
- package/es/fragments/drawer-list/DrawerList.d.ts +0 -1
- package/es/fragments/drawer-list/DrawerList.js +6 -13
- package/es/fragments/drawer-list/DrawerList.js.map +1 -1
- package/es/fragments/drawer-list/DrawerListHelpers.d.ts +43 -46
- package/es/fragments/drawer-list/DrawerListHelpers.js +0 -2
- package/es/fragments/drawer-list/DrawerListHelpers.js.map +1 -1
- package/es/fragments/drawer-list/DrawerListPortal.js.map +1 -1
- package/es/fragments/drawer-list/DrawerListProvider.js.map +1 -1
- package/es/fragments/drawer-list/style/dnb-drawer-list.scss +4 -0
- package/es/fragments/text-counter/TextCounter.js +3 -2
- package/es/fragments/text-counter/TextCounter.js.map +1 -1
- package/es/shared/Context.d.ts +9 -5
- package/es/shared/Context.js +39 -35
- package/es/shared/Context.js.map +1 -1
- package/es/shared/Eufemia.d.ts +1 -1
- package/es/shared/Eufemia.js +2 -2
- package/es/shared/Eufemia.js.map +1 -1
- package/es/shared/Provider.d.ts +1 -1
- package/es/shared/Provider.js +49 -41
- package/es/shared/Provider.js.map +1 -1
- package/es/shared/Translation.d.ts +5 -5
- package/es/shared/Translation.js +8 -10
- package/es/shared/Translation.js.map +1 -1
- package/es/shared/index.d.ts +1 -0
- package/es/shared/index.js +1 -0
- package/es/shared/index.js.map +1 -1
- package/es/shared/locales/en-GB.d.ts +0 -3
- package/es/shared/locales/en-GB.js +0 -3
- package/es/shared/locales/en-GB.js.map +1 -1
- package/es/shared/locales/en-US.d.ts +0 -3
- package/es/shared/locales/index.d.ts +0 -6
- package/es/shared/locales/nb-NO.d.ts +0 -3
- package/es/shared/locales/nb-NO.js +0 -3
- package/es/shared/locales/nb-NO.js.map +1 -1
- package/es/shared/useTranslation.d.ts +5 -4
- package/es/shared/useTranslation.js +13 -11
- package/es/shared/useTranslation.js.map +1 -1
- package/es/style/core/scopes.scss +1 -1
- package/es/style/dnb-ui-basis.css +1 -1
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-body.css +1 -1
- package/es/style/dnb-ui-body.min.css +1 -1
- package/es/style/dnb-ui-components.css +67 -44
- package/es/style/dnb-ui-components.min.css +2 -2
- package/es/style/dnb-ui-core.css +1 -1
- package/es/style/dnb-ui-core.min.css +1 -1
- package/es/style/dnb-ui-extensions.css +56 -44
- package/es/style/dnb-ui-extensions.min.css +1 -1
- package/es/style/dnb-ui-forms.css +56 -44
- package/es/style/dnb-ui-forms.min.css +1 -1
- package/es/style/dnb-ui-forms.scss +2 -1
- package/es/style/dnb-ui-fragments.css +4 -0
- package/es/style/dnb-ui-fragments.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-basis.css +2 -2
- package/es/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +123 -88
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +3 -3
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +56 -44
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +56 -44
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/es/style/themes/theme-sbanken/globals.scss +3 -2
- package/es/style/themes/theme-sbanken/sbanken-theme-basis.css +2 -2
- package/es/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +124 -89
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +3 -3
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +56 -44
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +56 -44
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/es/style/themes/theme-ui/globals.scss +3 -2
- package/es/style/themes/theme-ui/ui-theme-basis.css +2 -2
- package/es/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +123 -88
- package/es/style/themes/theme-ui/ui-theme-components.min.css +3 -3
- package/es/style/themes/theme-ui/ui-theme-extensions.css +56 -44
- package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-forms.css +56 -44
- package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +5 -5
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/DataContext/Context.d.ts +2 -0
- package/extensions/forms/DataContext/Context.js +1 -0
- package/extensions/forms/DataContext/Context.js.map +1 -1
- package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +17 -1
- package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
- package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +5 -3
- package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
- package/extensions/forms/DataContext/Provider/Provider.js +50 -4
- package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +2 -2
- package/extensions/forms/Field/ArraySelection/ArraySelection.js +8 -2
- package/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/extensions/forms/Field/Boolean/Boolean.d.ts +2 -2
- package/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
- package/extensions/forms/Field/Number/style/dnb-number.css +10 -0
- package/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/extensions/forms/Field/Number/style/dnb-number.scss +11 -0
- package/extensions/forms/Field/Option/Option.d.ts +2 -2
- package/extensions/forms/Field/Option/Option.js.map +1 -1
- package/extensions/forms/Field/Password/Password.js +2 -1
- package/extensions/forms/Field/Password/Password.js.map +1 -1
- package/extensions/forms/Field/PhoneNumber/PhoneNumber.js +6 -6
- package/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/extensions/forms/Field/Selection/Selection.js +7 -2
- package/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/extensions/forms/Field/Toggle/Toggle.d.ts +2 -2
- package/extensions/forms/Field/Toggle/Toggle.js +14 -2
- package/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/extensions/forms/Form/Appearance/Appearance.d.ts +3 -0
- package/extensions/forms/Form/Appearance/Appearance.js +1 -0
- package/extensions/forms/Form/Appearance/Appearance.js.map +1 -1
- package/extensions/forms/Form/FieldProps/FieldProps.d.ts +5 -1
- package/extensions/forms/Form/FieldProps/FieldProps.js +19 -37
- package/extensions/forms/Form/FieldProps/FieldProps.js.map +1 -1
- package/extensions/forms/Form/Section/EditContainer/EditContainer.d.ts +12 -0
- package/extensions/forms/Form/Section/EditContainer/EditContainer.js +33 -0
- package/extensions/forms/Form/Section/EditContainer/EditContainer.js.map +1 -0
- package/extensions/forms/Form/Section/EditContainer/EditContainerDocs.d.ts +3 -0
- package/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js +19 -0
- package/extensions/forms/Form/Section/EditContainer/EditContainerDocs.js.map +1 -0
- package/extensions/forms/Form/Section/EditContainer/EditToolbarTools.d.ts +1 -0
- package/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js +59 -0
- package/extensions/forms/Form/Section/EditContainer/EditToolbarTools.js.map +1 -0
- package/extensions/forms/Form/Section/EditContainer/index.d.ts +2 -0
- package/extensions/forms/Form/Section/EditContainer/index.js +3 -0
- package/extensions/forms/Form/Section/EditContainer/index.js.map +1 -0
- package/extensions/forms/Form/Section/EditContainer/useContainerDataStore.d.ts +3 -0
- package/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js +46 -0
- package/extensions/forms/Form/Section/EditContainer/useContainerDataStore.js.map +1 -0
- package/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.d.ts +1 -0
- package/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js +19 -0
- package/extensions/forms/Form/Section/EditContainer/useEditContainerToolbar.js.map +1 -0
- package/extensions/forms/Form/Section/Section.d.ts +9 -1
- package/extensions/forms/Form/Section/Section.js +10 -2
- package/extensions/forms/Form/Section/Section.js.map +1 -1
- package/extensions/forms/Form/Section/SectionContext.d.ts +1 -2
- package/extensions/forms/Form/Section/SectionContext.js.map +1 -1
- package/extensions/forms/Form/Section/SectionDocs.js +6 -1
- package/extensions/forms/Form/Section/SectionDocs.js.map +1 -1
- package/extensions/forms/Form/Section/ViewContainer/ViewContainer.d.ts +12 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewContainer.js +32 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewContainer.js.map +1 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.d.ts +3 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js +19 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewContainerDocs.js.map +1 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.d.ts +1 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js +26 -0
- package/extensions/forms/Form/Section/ViewContainer/ViewToolbarTools.js.map +1 -0
- package/extensions/forms/Form/Section/ViewContainer/index.d.ts +2 -0
- package/extensions/forms/Form/Section/ViewContainer/index.js +3 -0
- package/extensions/forms/Form/Section/ViewContainer/index.js.map +1 -0
- package/extensions/forms/Form/Section/containers/SectionContainer.d.ts +19 -0
- package/extensions/forms/Form/Section/containers/SectionContainer.js +83 -0
- package/extensions/forms/Form/Section/containers/SectionContainer.js.map +1 -0
- package/extensions/forms/Form/Section/containers/SectionContainerContext.d.ts +8 -0
- package/extensions/forms/Form/Section/containers/SectionContainerContext.js +4 -0
- package/extensions/forms/Form/Section/containers/SectionContainerContext.js.map +1 -0
- package/extensions/forms/Form/Section/containers/SectionContainerProvider.d.ts +8 -0
- package/extensions/forms/Form/Section/containers/SectionContainerProvider.js +24 -0
- package/extensions/forms/Form/Section/containers/SectionContainerProvider.js.map +1 -0
- package/extensions/forms/Form/Section/containers/Toolbar.d.ts +7 -0
- package/extensions/forms/Form/Section/containers/Toolbar.js +27 -0
- package/extensions/forms/Form/Section/containers/Toolbar.js.map +1 -0
- package/extensions/forms/Form/Section/style/dnb-form-section.css +45 -0
- package/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -0
- package/{cjs/extensions/forms/Iterate/style/dnb-form-iterate.scss → extensions/forms/Form/Section/style/dnb-form-section.scss} +4 -12
- package/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js +8 -8
- package/extensions/forms/Iterate/AnimatedContainer/ElementBlock.js.map +1 -1
- package/extensions/forms/Iterate/Array/Array.js +1 -1
- package/extensions/forms/Iterate/Array/Array.js.map +1 -1
- package/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -1
- package/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
- package/extensions/forms/Iterate/EditContainer/EditToolbarTools.js +19 -10
- package/extensions/forms/Iterate/EditContainer/EditToolbarTools.js.map +1 -1
- package/extensions/forms/Iterate/RemoveButton/RemoveButton.js +1 -1
- package/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
- package/extensions/forms/Iterate/ViewContainer/ViewContainer.js +1 -1
- package/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
- package/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js +1 -1
- package/extensions/forms/Iterate/ViewContainer/ViewToolbarTools.js.map +1 -1
- package/extensions/forms/Iterate/style/dnb-iterate.css +6 -0
- package/extensions/forms/Iterate/style/dnb-iterate.min.css +1 -0
- package/extensions/forms/Iterate/style/dnb-iterate.scss +12 -0
- package/extensions/forms/Wizard/Container/WizardContainer.js +1 -1
- package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/extensions/forms/Wizard/Step/Step.js +1 -1
- package/extensions/forms/Wizard/Step/Step.js.map +1 -1
- package/extensions/forms/constants/locales/en-GB.d.ts +2 -1
- package/extensions/forms/constants/locales/en-GB.js +3 -2
- package/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/extensions/forms/constants/locales/en-US.d.ts +2 -1
- package/extensions/forms/constants/locales/index.d.ts +4 -2
- package/extensions/forms/constants/locales/nb-NO.d.ts +2 -1
- package/extensions/forms/constants/locales/nb-NO.js +3 -2
- package/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/extensions/forms/hooks/useDataValue.d.ts +4 -0
- package/extensions/forms/hooks/useDataValue.js +30 -5
- package/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/extensions/forms/hooks/useFieldProps.js +14 -9
- package/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/extensions/forms/hooks/useTranslation.js +7 -12
- package/extensions/forms/hooks/useTranslation.js.map +1 -1
- package/extensions/forms/style/dnb-forms.css +56 -44
- package/extensions/forms/style/dnb-forms.min.css +1 -1
- package/extensions/payment-card/PaymentCard.js +0 -2
- package/extensions/payment-card/PaymentCard.js.map +1 -1
- package/fragments/drawer-list/DrawerList.d.ts +0 -1
- package/fragments/drawer-list/DrawerList.js +6 -13
- package/fragments/drawer-list/DrawerList.js.map +1 -1
- package/fragments/drawer-list/DrawerListHelpers.d.ts +43 -46
- package/fragments/drawer-list/DrawerListHelpers.js +0 -2
- package/fragments/drawer-list/DrawerListHelpers.js.map +1 -1
- package/fragments/drawer-list/DrawerListPortal.js.map +1 -1
- package/fragments/drawer-list/DrawerListProvider.js.map +1 -1
- package/fragments/drawer-list/style/dnb-drawer-list.scss +4 -0
- package/fragments/text-counter/TextCounter.js +3 -2
- package/fragments/text-counter/TextCounter.js.map +1 -1
- package/package.json +1 -1
- package/shared/Context.d.ts +9 -5
- package/shared/Context.js +40 -35
- package/shared/Context.js.map +1 -1
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +1 -1
- package/shared/Provider.d.ts +1 -1
- package/shared/Provider.js +49 -41
- package/shared/Provider.js.map +1 -1
- package/shared/Translation.d.ts +5 -5
- package/shared/Translation.js +8 -10
- package/shared/Translation.js.map +1 -1
- package/shared/index.d.ts +1 -0
- package/shared/index.js +1 -0
- package/shared/index.js.map +1 -1
- package/shared/locales/en-GB.d.ts +0 -3
- package/shared/locales/en-GB.js +0 -3
- package/shared/locales/en-GB.js.map +1 -1
- package/shared/locales/en-US.d.ts +0 -3
- package/shared/locales/index.d.ts +0 -6
- package/shared/locales/nb-NO.d.ts +0 -3
- package/shared/locales/nb-NO.js +0 -3
- package/shared/locales/nb-NO.js.map +1 -1
- package/shared/useTranslation.d.ts +5 -4
- package/shared/useTranslation.js +13 -11
- package/shared/useTranslation.js.map +1 -1
- package/style/core/scopes.scss +1 -1
- package/style/dnb-ui-basis.css +1 -1
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-body.css +1 -1
- package/style/dnb-ui-body.min.css +1 -1
- package/style/dnb-ui-components.css +67 -44
- package/style/dnb-ui-components.min.css +2 -2
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/style/dnb-ui-extensions.css +56 -44
- package/style/dnb-ui-extensions.min.css +1 -1
- package/style/dnb-ui-forms.css +56 -44
- package/style/dnb-ui-forms.min.css +1 -1
- package/style/dnb-ui-forms.scss +2 -1
- package/style/dnb-ui-fragments.css +4 -0
- package/style/dnb-ui-fragments.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-basis.css +2 -2
- package/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +123 -88
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +3 -3
- package/style/themes/theme-eiendom/eiendom-theme-extensions.css +56 -44
- package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-forms.css +56 -44
- package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/style/themes/theme-sbanken/globals.scss +3 -2
- package/style/themes/theme-sbanken/sbanken-theme-basis.css +2 -2
- package/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +124 -89
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +3 -3
- package/style/themes/theme-sbanken/sbanken-theme-extensions.css +56 -44
- package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-forms.css +56 -44
- package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/style/themes/theme-ui/globals.scss +3 -2
- package/style/themes/theme-ui/ui-theme-basis.css +2 -2
- package/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +123 -88
- package/style/themes/theme-ui/ui-theme-components.min.css +3 -3
- package/style/themes/theme-ui/ui-theme-extensions.css +56 -44
- package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-forms.css +56 -44
- package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +1 -1
- package/umd/dnb-ui-extensions.min.js +5 -5
- package/umd/dnb-ui-lib.min.js +1 -1
- package/cjs/extensions/forms/Iterate/style/dnb-form-iterate.css +0 -50
- package/cjs/extensions/forms/Iterate/style/dnb-form-iterate.min.css +0 -1
- package/es/extensions/forms/Iterate/style/dnb-form-iterate.css +0 -50
- package/es/extensions/forms/Iterate/style/dnb-form-iterate.min.css +0 -1
- package/extensions/forms/Iterate/style/dnb-form-iterate.css +0 -50
- package/extensions/forms/Iterate/style/dnb-form-iterate.min.css +0 -1
|
@@ -5,5 +5,9 @@ export type Props<Value> = {
|
|
|
5
5
|
};
|
|
6
6
|
export default function useDataValue<Value>({ path: pathProp, value, }?: Props<Value>): {
|
|
7
7
|
getValue: (source: Path | Value) => any;
|
|
8
|
+
getValueByPath: (path: Path) => any;
|
|
9
|
+
getData: (path: Path, options?: {
|
|
10
|
+
includeCurrentPath?: boolean;
|
|
11
|
+
}) => any;
|
|
8
12
|
value: Value;
|
|
9
13
|
};
|
|
@@ -13,20 +13,45 @@ export default function useDataValue({
|
|
|
13
13
|
const {
|
|
14
14
|
makePath
|
|
15
15
|
} = usePath();
|
|
16
|
+
const getValueByPath = useCallback(path => {
|
|
17
|
+
if (isPath(path)) {
|
|
18
|
+
var _dataContextRef$curre2;
|
|
19
|
+
const selector = makePath(path);
|
|
20
|
+
if (selector === '/') {
|
|
21
|
+
var _dataContextRef$curre;
|
|
22
|
+
return (_dataContextRef$curre = dataContextRef.current) === null || _dataContextRef$curre === void 0 ? void 0 : _dataContextRef$curre.data;
|
|
23
|
+
}
|
|
24
|
+
return pointer.has((_dataContextRef$curre2 = dataContextRef.current) === null || _dataContextRef$curre2 === void 0 ? void 0 : _dataContextRef$curre2.data, selector) ? pointer.get(dataContextRef.current.data, selector) : undefined;
|
|
25
|
+
}
|
|
26
|
+
}, [makePath]);
|
|
27
|
+
const getData = useCallback((path, options) => {
|
|
28
|
+
if (isPath(path)) {
|
|
29
|
+
const value = getValueByPath(path);
|
|
30
|
+
if (options !== null && options !== void 0 && options.includeCurrentPath && path !== '/') {
|
|
31
|
+
const data = {};
|
|
32
|
+
pointer.set(data, path, value);
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
}, [getValueByPath]);
|
|
16
38
|
const getValue = useCallback(source => {
|
|
17
|
-
if (typeof source === 'string') {
|
|
18
|
-
|
|
19
|
-
const path = makePath(source);
|
|
20
|
-
return pointer.has((_dataContextRef$curre = dataContextRef.current) === null || _dataContextRef$curre === void 0 ? void 0 : _dataContextRef$curre.data, path) ? pointer.get(dataContextRef.current.data, path) : undefined;
|
|
39
|
+
if (typeof source === 'string' && isPath(source)) {
|
|
40
|
+
return getValueByPath(source);
|
|
21
41
|
}
|
|
22
42
|
return source;
|
|
23
|
-
}, [
|
|
43
|
+
}, [getValueByPath]);
|
|
24
44
|
if (pathProp) {
|
|
25
45
|
value = getValue(pathProp);
|
|
26
46
|
}
|
|
27
47
|
return {
|
|
28
48
|
getValue,
|
|
49
|
+
getValueByPath,
|
|
50
|
+
getData,
|
|
29
51
|
value
|
|
30
52
|
};
|
|
31
53
|
}
|
|
54
|
+
function isPath(path) {
|
|
55
|
+
return typeof path === 'string' && path.startsWith('/');
|
|
56
|
+
}
|
|
32
57
|
//# sourceMappingURL=useDataValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataValue.js","names":["useCallback","useContext","useRef","pointer","DataContext","usePath","useDataValue","path","pathProp","value","dataContextRef","current","makePath","
|
|
1
|
+
{"version":3,"file":"useDataValue.js","names":["useCallback","useContext","useRef","pointer","DataContext","usePath","useDataValue","path","pathProp","value","dataContextRef","current","makePath","getValueByPath","isPath","_dataContextRef$curre2","selector","_dataContextRef$curre","data","has","get","undefined","getData","options","includeCurrentPath","set","getValue","source","startsWith"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import { useCallback, useContext, useRef } from 'react'\nimport pointer from 'json-pointer'\nimport { Path } from '../types'\nimport DataContext, { ContextState } from '../DataContext/Context'\nimport usePath from './usePath'\n\nexport type Props<Value> = {\n path?: Path | undefined\n value?: Value\n}\n\nexport default function useDataValue<Value>({\n path: pathProp,\n value,\n}: Props<Value> = {}) {\n const dataContextRef = useRef<ContextState>()\n dataContextRef.current = useContext<ContextState>(DataContext)\n\n const { makePath } = usePath()\n\n const getValueByPath = useCallback(\n (path: Path) => {\n if (isPath(path)) {\n const selector = makePath(path)\n if (selector === '/') {\n return dataContextRef.current?.data\n }\n return pointer.has(dataContextRef.current?.data, selector)\n ? pointer.get(dataContextRef.current.data, selector)\n : undefined\n }\n },\n [makePath]\n )\n\n const getData = useCallback(\n (path: Path, options?: { includeCurrentPath?: boolean }) => {\n if (isPath(path)) {\n const value = getValueByPath(path)\n\n if (options?.includeCurrentPath && path !== '/') {\n const data = {}\n pointer.set(data, path, value)\n return data\n }\n\n return value\n }\n },\n [getValueByPath]\n )\n\n const getValue = useCallback(\n (source: Path | Value) => {\n if (typeof source === 'string' && isPath(source)) {\n return getValueByPath(source)\n }\n\n return source\n },\n [getValueByPath]\n )\n\n if (pathProp) {\n value = getValue(pathProp)\n }\n\n return { getValue, getValueByPath, getData, value }\n}\n\nfunction isPath(path: Path | unknown) {\n return typeof path === 'string' && path.startsWith('/')\n}\n"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACvD,OAAOC,OAAO,MAAM,cAAc;AAElC,OAAOC,WAAW,MAAwB,wBAAwB;AAClE,OAAOC,OAAO,MAAM,WAAW;AAO/B,eAAe,SAASC,YAAYA,CAAQ;EAC1CC,I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OAAOT,KAAK;IACd;EACF,CAAC,EACD,CAACI,cAAc,CACjB,CAAC;EAED,MAAMa,QAAQ,GAAG1B,WAAW,CACzB2B,MAAoB,IAAK;IACxB,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIb,MAAM,CAACa,MAAM,CAAC,EAAE;MAChD,OAAOd,cAAc,CAACc,MAAM,CAAC;IAC/B;IAEA,OAAOA,MAAM;EACf,CAAC,EACD,CAACd,cAAc,CACjB,CAAC;EAED,IAAIL,QAAQ,EAAE;IACZC,KAAK,GAAGiB,QAAQ,CAAClB,QAAQ,CAAC;EAC5B;EAEA,OAAO;IAAEkB,QAAQ;IAAEb,cAAc;IAAES,OAAO;IAAEb;EAAM,CAAC;AACrD;AAEA,SAASK,MAAMA,CAACP,IAAoB,EAAE;EACpC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACqB,UAAU,CAAC,GAAG,CAAC;AACzD"}
|
|
@@ -97,6 +97,7 @@ export default function useFieldProps(localeProps) {
|
|
|
97
97
|
setFieldState: setFieldStateDataContext,
|
|
98
98
|
setFieldError: setFieldErrorDataContext,
|
|
99
99
|
setFieldProps: setPropsDataContext,
|
|
100
|
+
setHasVisibleError: setHasVisibleErrorDataContext,
|
|
100
101
|
errors: dataContextErrors,
|
|
101
102
|
contextErrorMessages
|
|
102
103
|
} = dataContext !== null && dataContext !== void 0 ? dataContext : {};
|
|
@@ -178,6 +179,12 @@ export default function useFieldProps(localeProps) {
|
|
|
178
179
|
onBlurValidatorRef.current = onBlurValidator;
|
|
179
180
|
}, [onBlurValidator]);
|
|
180
181
|
const schemaValidatorRef = useRef(schema ? (_dataContext$ajvInsta = dataContext.ajvInstance) === null || _dataContext$ajvInsta === void 0 ? void 0 : _dataContext$ajvInsta.compile(schema) : undefined);
|
|
182
|
+
const errorMessagesRef = useRef(null);
|
|
183
|
+
errorMessagesRef.current = useMemo(() => {
|
|
184
|
+
return _objectSpread({
|
|
185
|
+
required: translation.Field.errorRequired
|
|
186
|
+
}, errorMessages);
|
|
187
|
+
}, [errorMessages, translation.Field.errorRequired]);
|
|
181
188
|
const asyncBehaviorIsEnabled = useMemo(() => {
|
|
182
189
|
return isAsync(onChange) || isAsync(onChangeContext);
|
|
183
190
|
}, [onChangeContext, onChange]);
|
|
@@ -246,11 +253,15 @@ export default function useFieldProps(localeProps) {
|
|
|
246
253
|
const showError = useCallback(() => {
|
|
247
254
|
showErrorRef.current = true;
|
|
248
255
|
showFieldErrorFieldBlock === null || showFieldErrorFieldBlock === void 0 ? void 0 : showFieldErrorFieldBlock(identifier, true);
|
|
249
|
-
|
|
256
|
+
if (localErrorRef.current) {
|
|
257
|
+
setHasVisibleErrorDataContext === null || setHasVisibleErrorDataContext === void 0 ? void 0 : setHasVisibleErrorDataContext(identifier, true);
|
|
258
|
+
}
|
|
259
|
+
}, [showFieldErrorFieldBlock, identifier, setHasVisibleErrorDataContext]);
|
|
250
260
|
const hideError = useCallback(() => {
|
|
251
261
|
showErrorRef.current = false;
|
|
252
262
|
showFieldErrorFieldBlock === null || showFieldErrorFieldBlock === void 0 ? void 0 : showFieldErrorFieldBlock(identifier, false);
|
|
253
|
-
|
|
263
|
+
setHasVisibleErrorDataContext === null || setHasVisibleErrorDataContext === void 0 ? void 0 : setHasVisibleErrorDataContext(identifier, false);
|
|
264
|
+
}, [setHasVisibleErrorDataContext, identifier, showFieldErrorFieldBlock]);
|
|
254
265
|
const prepareError = useCallback(error => {
|
|
255
266
|
if (error instanceof FormError) {
|
|
256
267
|
var _error$messageValues;
|
|
@@ -288,12 +299,6 @@ export default function useFieldProps(localeProps) {
|
|
|
288
299
|
var _ref2;
|
|
289
300
|
return Boolean((_ref2 = errorProp !== null && errorProp !== void 0 ? errorProp : localErrorRef.current) !== null && _ref2 !== void 0 ? _ref2 : contextErrorRef.current);
|
|
290
301
|
}, [errorProp]);
|
|
291
|
-
const errorMessagesRef = useRef(null);
|
|
292
|
-
errorMessagesRef.current = useMemo(() => {
|
|
293
|
-
return _objectSpread({
|
|
294
|
-
required: translation.Field.errorRequired
|
|
295
|
-
}, errorMessages);
|
|
296
|
-
}, [errorMessages, translation.Field.errorRequired]);
|
|
297
302
|
const stateId = useId();
|
|
298
303
|
const persistErrorState = useCallback((method, errorArg = undefined) => {
|
|
299
304
|
const error = prepareError(errorArg);
|
|
@@ -556,7 +561,7 @@ export default function useFieldProps(localeProps) {
|
|
|
556
561
|
}
|
|
557
562
|
}
|
|
558
563
|
forceUpdate();
|
|
559
|
-
}, [asyncBehaviorIsEnabled, hasPath,
|
|
564
|
+
}, [asyncBehaviorIsEnabled, hasPath, yieldAsyncProcess, identifier, onChangeContext, defineAsyncProcess, hasError, setEventResult, handlePathChangeDataContext]);
|
|
560
565
|
const updateValue = useCallback(async newValue => {
|
|
561
566
|
if (newValue === valueRef.current) {
|
|
562
567
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldProps.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","DataContext","FieldPropsContext","combineDescribedBy","useId","useUpdateEffect","useMountEffect","useUnmountEffect","FieldBlockContext","IterateElementContext","SectionContext","FieldBoundaryContext","useProcessManager","usePath","createSharedState","useSharedState","isAsync","useTranslation","useExternalValue","useFieldProps","localeProps","_dataContext$props","_useExternalValue","_dataContext$ajvInsta","_localErrorRef$curren","_ref","_props$path","_props$autoComplete","extend","props","path","pathProp","value","valueProp","defaultValue","itemPath","emptyValue","required","requiredProp","disabled","disabledProp","info","warning","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","transformIn","transformOut","toInput","fromInput","toEvent","transformValue","fromExternal","validateRequired","res","undefined","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sectionContext","fieldBoundaryContext","translation","transformers","handlePathChangeUnvalidated","handlePathChangeUnvalidatedDataContext","handlePathChange","handlePathChangeDataContext","updateDataValue","updateDataValueDataContext","validateData","validateDataDataContext","setFieldState","setFieldStateDataContext","setFieldError","setFieldErrorDataContext","setFieldProps","setPropsDataContext","errors","dataContextErrors","contextErrorMessages","onChangeContext","readOnly","inFieldBlock","Boolean","setFieldStateFieldBlock","showFieldError","showFieldErrorFieldBlock","mountedFieldsRef","mountedFieldsRefFieldBlock","handleChange","handleChangeIterateContext","sectionPath","errorPrioritization","hasPath","identifier","makeIteratePath","defaultValueRef","externalValue","current","valueRef","changedRef","hasFocusRef","paths","split","length","requiredList","schemaPath","slice","join","schemaPart","has","get","push","substring","collected","flatMap","v","filter","some","p","c","includes","showErrorRef","errorMethodRef","localErrorRef","hasLocalErrorRef","dataContextError","contextErrorRef","validatorRef","onBlurValidatorRef","schemaValidatorRef","ajvInstance","compile","asyncBehaviorIsEnabled","validatedValue","changeEventResultRef","asyncProcessRef","defineAsyncProcess","name","asyncBufferRef","key","resolve","validateProcesses","window","requestAnimationFrame","eventPool","onChangeLocal","addToPool","fn","runAsync","runPool","cb","pending","fieldStateRef","state","resolveValidatingState","showError","hideError","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","errorMessagesRef","messageWithValues","Object","entries","messageValues","reduce","replace","hasVisibleError","hasErrorProp","hasError","_ref2","_objectSpread","Field","errorRequired","stateId","persistErrorState","method","errorArg","keys","type","content","showInitially","clearErrorState","callValidator","opts","tmpValue","result","unchangedValue","Error","callOnBlurValidator","valueOverride","prioritizeContextSchema","hasContextSchema","indexOf","validateValue","isProcessActive","requiredError","isChanged","handleError","setHasFocus","hasFocus","yieldAsyncProcess","waitFor","Promise","processName","withStates","withValue","hasMatchingValue","handleChangeEventResult","warningRef","infoRef","success","setEventResult","callOnChangeContext","updateValue","newValue","argFromInput","additionalArgs","currentValue","transformedValue","getArgs","args","apply","handleFocus","handleBlur","handleMountField","handleUnMountField","_dataContext$ajvInsta2","hasValue","data","existingValue","sharedState","sharedValue","showAllErrors","formState","onSubmitHandler","_dataContext$setField","setFieldEventListener","call","show","htmlAttributes","acc","cur","startsWith","_fieldBlockContext$fi","stateIds","fieldStateIdsRef","ids","fieldSectionProps","fieldState","sharedData","set","autoComplete"],"sources":["../../../../../src/extensions/forms/hooks/useFieldProps.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n AriaAttributes,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport {\n FormError,\n FieldProps,\n AdditionalEventArgs,\n SubmitState,\n EventReturnWithStateObjectAndSuccess,\n EventStateObjectWithSuccess,\n} from '../types'\nimport { Context as DataContext, ContextState } from '../DataContext'\nimport FieldPropsContext from '../Form/FieldProps/FieldPropsContext'\nimport { combineDescribedBy } from '../../../shared/component-helper'\nimport useId from '../../../shared/helpers/useId'\nimport useUpdateEffect from '../../../shared/helpers/useUpdateEffect'\nimport useMountEffect from '../../../shared/helpers/useMountEffect'\nimport useUnmountEffect from '../../../shared/helpers/useUnmountEffect'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport SectionContext from '../Form/Section/SectionContext'\nimport FieldBoundaryContext from '../DataContext/FieldBoundary/FieldBoundaryContext'\nimport useProcessManager from './useProcessManager'\nimport usePath from './usePath'\nimport {\n createSharedState,\n useSharedState,\n} from '../../../shared/helpers/useSharedState'\nimport { isAsync } from '../../../shared/helpers/isAsync'\nimport useTranslation from './useTranslation'\nimport useExternalValue from './useExternalValue'\n\ntype SubmitStateWithValidating = SubmitState | 'validating'\ntype AsyncProcesses =\n | 'validator'\n | 'onBlurValidator'\n | 'onChangeLocal'\n | 'onChangeContext'\ntype PersistErrorStateMethod =\n /**\n * Add or remove the error regardless\n */\n | 'weak'\n /**\n * Check if there is an existing error, and if so, keep it\n */\n | 'gracefully'\n /**\n * Remove the error, if any\n */\n | 'wipe'\ntype AsyncProcessesBuffer = {\n resolve: () => void\n validateProcesses: () => boolean\n}\n\nexport type DataAttributes = {\n [property: `data-${string}`]: string | boolean | number\n}\n\n// Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n// useEffect depend on them (like the external `value`)\n\nexport default function useFieldProps<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(\n localeProps: Props\n): Props & FieldProps<Value> & ReturnAdditional<Value> {\n const { extend } = useContext(FieldPropsContext)\n const props = extend<Props>(localeProps)\n\n const {\n path: pathProp,\n value: valueProp,\n defaultValue,\n itemPath,\n emptyValue,\n required: requiredProp,\n disabled: disabledProp,\n info,\n warning,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n transformIn = (value: Value) => value,\n transformOut = (value: Value) => value,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n\n return res\n },\n } = props\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(DataContext)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sectionContext = useContext(SectionContext)\n const fieldBoundaryContext = useContext(FieldBoundaryContext)\n const translation = useTranslation()\n\n const transformers = useRef({\n transformIn,\n transformOut,\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChangeUnvalidated: handlePathChangeUnvalidatedDataContext,\n handlePathChange: handlePathChangeDataContext,\n updateDataValue: updateDataValueDataContext,\n validateData: validateDataDataContext,\n setFieldState: setFieldStateDataContext,\n setFieldError: setFieldErrorDataContext,\n setFieldProps: setPropsDataContext,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n const onChangeContext = dataContext?.props?.onChange\n\n const disabled = disabledProp ?? props.readOnly\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setFieldState: setFieldStateFieldBlock,\n showFieldError: showFieldErrorFieldBlock,\n mountedFieldsRef: mountedFieldsRefFieldBlock,\n } = fieldBlockContext ?? {}\n const { handleChange: handleChangeIterateContext } =\n iterateElementContext ?? {}\n const { path: sectionPath, errorPrioritization } = sectionContext ?? {}\n const { setFieldError } = fieldBoundaryContext ?? {}\n\n const hasPath = Boolean(pathProp)\n const { path, identifier, makeIteratePath } = usePath({\n id,\n path: pathProp,\n itemPath,\n })\n\n const defaultValueRef = useRef(defaultValue)\n const externalValue =\n useExternalValue<Value>({\n path,\n itemPath,\n value: valueProp,\n transformers,\n emptyValue,\n }) ?? defaultValueRef.current\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n const required = useMemo(() => {\n if (requiredProp) {\n return requiredProp\n }\n\n const paths = identifier.split('/')\n if (paths.length > 0 && (schema || dataContext?.schema)) {\n const requiredList = [schema?.['required']]\n\n if (paths.length > 1) {\n const schema = dataContext.schema\n const schemaPath = paths.slice(0, -1).join('/properties/')\n const schemaPart = pointer.has(schema, schemaPath)\n ? pointer.get(schema, schemaPath)\n : schema\n\n requiredList.push(schemaPart?.required)\n }\n\n if (sectionPath) {\n paths.push(sectionPath.substring(1))\n }\n\n const collected = requiredList.flatMap((v) => v).filter(Boolean)\n if (\n paths\n .filter(Boolean)\n .some((p) => collected.some((c) => c.includes(p)))\n ) {\n return true\n }\n }\n }, [sectionPath, dataContext.schema, identifier, requiredProp, schema])\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorRef = useRef<boolean>(\n Boolean(validateInitially || errorProp)\n )\n // - Local errors are errors based on validation instructions received by\n const errorMethodRef = useRef<\n Partial<Record<PersistErrorStateMethod, Error | FormError>>\n >({})\n const localErrorRef = useRef<Error | FormError | undefined>()\n const hasLocalErrorRef = useRef(false)\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const dataContextError = useMemo(() => {\n return path ? dataContextErrors?.[identifier] : undefined\n }, [dataContextErrors, identifier, path])\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n const onBlurValidatorRef = useRef(onBlurValidator)\n useUpdateEffect(() => {\n onBlurValidatorRef.current = onBlurValidator\n }, [onBlurValidator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n // - Async behavior\n const asyncBehaviorIsEnabled = useMemo(() => {\n return isAsync(onChange) || isAsync(onChangeContext)\n }, [onChangeContext, onChange])\n const validatedValue = useRef<Value>()\n const changeEventResultRef = useRef<EventStateObjectWithSuccess>(null)\n const asyncProcessRef = useRef<AsyncProcesses>(null)\n const defineAsyncProcess = useCallback((name: AsyncProcesses) => {\n asyncProcessRef.current = name\n }, [])\n\n // When both an async onChange and async validators are used,\n // we buffer the onChange calls to avoid race conditions.\n const asyncBufferRef = useRef<\n Record<AsyncProcesses, AsyncProcessesBuffer> | Record<string, unknown>\n >({})\n\n for (const key in asyncBufferRef.current) {\n const { resolve, validateProcesses } = (asyncBufferRef.current[key] ||\n {}) as AsyncProcessesBuffer\n if (validateProcesses?.() === false) {\n delete asyncBufferRef.current[key]\n if (typeof resolve === 'function') {\n window.requestAnimationFrame(resolve)\n }\n }\n }\n\n const eventPool = useRef({\n validator: null,\n onBlurValidator: null,\n onChangeContext: null,\n onChangeLocal: null,\n })\n\n const addToPool = useCallback(\n (name: keyof typeof eventPool.current, fn, runAsync) => {\n if (!eventPool.current[name]) {\n eventPool.current[name] = { fn, runAsync }\n }\n },\n []\n )\n\n const runPool = useCallback(async (cb = null) => {\n for (const key in eventPool.current) {\n if (!eventPool.current[key] || eventPool.current[key].pending) {\n continue\n }\n\n const { fn, runAsync } = eventPool.current[key] || {}\n if (fn) {\n eventPool.current[key].pending = true\n eventPool.current[key] = null\n\n if (runAsync) {\n await fn()\n } else {\n fn()\n }\n }\n }\n\n // use a callback in order to avoid any async/await,\n // because it will delay the execution of the following code\n cb?.()\n }, [])\n\n const fieldStateRef = useRef<SubmitStateWithValidating>()\n const setFieldState = useCallback(\n (state: SubmitStateWithValidating) => {\n fieldStateRef.current = state\n setFieldStateDataContext(identifier, resolveValidatingState(state))\n if (!validateInitially) {\n forceUpdate()\n }\n },\n [setFieldStateDataContext, identifier, validateInitially]\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n showFieldErrorFieldBlock?.(identifier, true)\n }, [showFieldErrorFieldBlock, identifier])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n showFieldErrorFieldBlock?.(identifier, false)\n }, [showFieldErrorFieldBlock, identifier])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n error.message = messageWithValues\n\n return error\n }\n\n return error\n },\n []\n )\n\n contextErrorRef.current = useMemo(() => {\n if (!dataContextError) {\n return undefined\n }\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n return error\n }\n }, [dataContextError, prepareError])\n\n const error =\n showErrorRef.current ||\n // If the error is a type error, we want to show it even if the field as not been used\n localErrorRef.current?.['validationRule'] === 'type'\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const hasVisibleError =\n Boolean(error) || (inFieldBlock && fieldBlockContext.hasErrorProp)\n const hasError = useCallback(() => {\n return Boolean(\n errorProp ?? localErrorRef.current ?? contextErrorRef.current\n )\n }, [errorProp])\n\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: translation.Field.errorRequired,\n ...errorMessages,\n }\n }, [errorMessages, translation.Field.errorRequired])\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const stateId = useId()\n const persistErrorState = useCallback(\n (\n method: PersistErrorStateMethod,\n errorArg: Error | FormError | undefined = undefined\n ) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n if (method === 'wipe') {\n errorMethodRef.current = {}\n } else {\n errorMethodRef.current[method] = error\n }\n\n if (\n !error &&\n method === 'gracefully' &&\n Object.keys(errorMethodRef.current).filter(Boolean).length > 0\n ) {\n // If the error is removed, we need to check if there are other errors that still should be shown\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n setFieldErrorDataContext?.(identifier, error)\n setFieldError?.(identifier, error)\n\n // Set the visual states\n setFieldStateDataContext?.(identifier, error ? 'error' : undefined)\n setFieldStateFieldBlock?.({\n stateId,\n identifier,\n type: 'error',\n content: error,\n showInitially: Boolean(inFieldBlock && validateInitially),\n })\n\n forceUpdate()\n },\n [\n prepareError,\n setFieldErrorDataContext,\n identifier,\n setFieldError,\n setFieldStateDataContext,\n setFieldStateFieldBlock,\n stateId,\n inFieldBlock,\n validateInitially,\n ]\n )\n\n const clearErrorState = useCallback(() => {\n persistErrorState('wipe')\n hasLocalErrorRef.current = false\n }, [persistErrorState])\n\n const callValidator = useCallback(async () => {\n if (typeof validatorRef.current !== 'function') {\n return\n }\n\n const runAsync = isAsync(validatorRef.current)\n\n if (runAsync) {\n defineAsyncProcess('validator')\n setFieldState('validating')\n hideError()\n }\n\n const opts = {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n }\n\n const tmpValue = valueRef.current\n\n // Run async regardless to support Promise based validators\n const result = await validatorRef.current(valueRef.current, opts)\n\n const unchangedValue = tmpValue === valueRef.current\n\n // Don't show the error if the value has changed in the meantime\n if (unchangedValue) {\n persistErrorState('gracefully', result as Error)\n\n // Because its a better UX to show the error when the validation is async/delayed\n if (continuousValidation || runAsync) {\n // Because we first need to throw the error to be able to display it, we delay the showError call\n window.requestAnimationFrame(() => {\n showError()\n forceUpdate()\n })\n }\n }\n\n if (runAsync) {\n defineAsyncProcess(undefined)\n\n if (unchangedValue) {\n setFieldState(result instanceof Error ? 'error' : 'complete')\n } else {\n setFieldState('pending')\n }\n }\n\n return result\n }, [\n contextErrorMessages,\n continuousValidation,\n hideError,\n persistErrorState,\n defineAsyncProcess,\n setFieldState,\n showError,\n ])\n\n const callOnBlurValidator = useCallback(\n async ({ valueOverride = null } = {}) => {\n if (typeof onBlurValidatorRef.current !== 'function') {\n return\n }\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n\n const runAsync = isAsync(onBlurValidatorRef.current)\n\n if (runAsync) {\n defineAsyncProcess('onBlurValidator')\n setFieldState('validating')\n }\n\n // Run async regardless to support Promise based validators\n const result = await onBlurValidatorRef.current(value)\n\n persistErrorState('gracefully', result as Error)\n\n if (runAsync) {\n defineAsyncProcess(undefined)\n setFieldState(result instanceof Error ? 'error' : 'complete')\n }\n\n showError()\n forceUpdate()\n },\n [persistErrorState, defineAsyncProcess, setFieldState, showError]\n )\n\n const prioritizeContextSchema = useMemo(() => {\n if (errorPrioritization) {\n const schemaPath = identifier.split('/').join('/properties/')\n const hasContextSchema = pointer.has(\n dataContext?.schema || {},\n schemaPath\n )\n return (\n hasContextSchema &&\n errorPrioritization?.indexOf('contextSchema') === 0\n )\n }\n }, [dataContext?.schema, errorPrioritization, identifier])\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n setFieldState(undefined)\n return // stop here\n }\n\n const value = valueRef.current\n changeEventResultRef.current = null\n validatedValue.current = null\n\n try {\n const requiredError = transformers.current.validateRequired(value, {\n emptyValue,\n required: requiredProp ?? required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n })\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n value !== undefined &&\n !schemaValidatorRef.current(value) &&\n !prioritizeContextSchema\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors,\n valueRef.current\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (\n validatorRef.current &&\n (changedRef.current || validateInitially)\n ) {\n const result = await callValidator()\n\n if (result instanceof Error) {\n throw result\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n\n validatedValue.current = value\n } catch (error: unknown) {\n if (isProcessActive()) {\n hasLocalErrorRef.current = true\n persistErrorState('weak', error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n setFieldState,\n clearErrorState,\n emptyValue,\n requiredProp,\n required,\n prioritizeContextSchema,\n validateInitially,\n callValidator,\n persistErrorState,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n async (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n addToPool(\n 'onBlurValidator',\n async () => await callOnBlurValidator({ valueOverride }),\n isAsync(onBlurValidatorRef.current)\n )\n\n await runPool(() => {\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n })\n }\n },\n [\n addToPool,\n callOnBlurValidator,\n onBlur,\n onFocus,\n runPool,\n showError,\n validateUnchanged,\n ]\n )\n\n // Await an async operation to run after criteria are fulfilled\n const yieldAsyncProcess = useCallback(\n async ({\n name,\n waitFor,\n }: {\n name: 'onChangeLocal' | 'onChangeContext' | 'onSubmitContext'\n waitFor: Array<{\n processName?: AsyncProcesses\n withStates: Array<SubmitStateWithValidating>\n withValue?: Value\n }>\n }) => {\n return new Promise<void>((resolve) => {\n const validateProcesses = () => {\n const result = waitFor.some(\n ({ processName, withStates, withValue }) => {\n const hasMatchingValue =\n // If the value has changed during the async process, we don't want to resolve anymore\n withValue === validatedValue.current\n\n const result =\n (typeof withValue === 'undefined'\n ? false\n : !hasMatchingValue) ||\n ((processName\n ? processName === asyncProcessRef.current\n : true) &&\n withStates?.some((state) => {\n return state === fieldStateRef.current\n }))\n\n return result\n }\n )\n\n return result\n }\n\n if (validateProcesses() === true) {\n asyncBufferRef.current[name] = { resolve, validateProcesses }\n } else {\n resolve()\n setFieldState('pending')\n }\n })\n },\n [setFieldState]\n )\n\n const handleChangeEventResult = useCallback(async () => {\n const result: EventStateObjectWithSuccess =\n changeEventResultRef.current\n\n if (typeof result?.error !== 'undefined') {\n persistErrorState('gracefully', result.error)\n showError()\n }\n if (typeof result?.warning !== 'undefined') {\n warningRef.current = result.warning\n }\n if (typeof result?.info !== 'undefined') {\n infoRef.current = result.info\n }\n\n if (asyncBehaviorIsEnabled) {\n await yieldAsyncProcess({\n name: 'onSubmitContext',\n waitFor: [{ withStates: ['validating'] }],\n })\n }\n\n defineAsyncProcess(undefined)\n\n if (result?.success === 'saved') {\n setFieldState('success')\n } else if (result?.error) {\n setFieldState('error')\n } else if (asyncBehaviorIsEnabled) {\n setFieldState('complete')\n }\n }, [\n asyncBehaviorIsEnabled,\n defineAsyncProcess,\n persistErrorState,\n setFieldState,\n showError,\n yieldAsyncProcess,\n ])\n\n const setEventResult = useCallback(\n (result: EventReturnWithStateObjectAndSuccess) => {\n if (result instanceof Error) {\n result = { error: result }\n }\n changeEventResultRef.current = {\n ...changeEventResultRef.current,\n ...result,\n } as EventStateObjectWithSuccess\n\n handleChangeEventResult()\n },\n [handleChangeEventResult]\n )\n\n const callOnChangeContext = useCallback(async () => {\n if (asyncBehaviorIsEnabled) {\n await yieldAsyncProcess({\n name: 'onChangeContext',\n waitFor: [\n {\n processName: 'validator',\n withStates: ['validating', 'error'],\n withValue: valueRef.current,\n },\n {\n processName: 'onBlurValidator',\n withStates: ['validating', 'error'],\n withValue: valueRef.current,\n },\n ],\n })\n }\n\n if (hasPath) {\n if (isAsync(onChangeContext)) {\n defineAsyncProcess('onChangeContext')\n\n // Skip sync errors, such as required\n if (!hasError()) {\n setEventResult(\n (await handlePathChangeDataContext?.(\n identifier\n )) as EventReturnWithStateObjectAndSuccess\n )\n } else {\n setEventResult(null)\n }\n } else {\n setEventResult(\n handlePathChangeDataContext?.(\n identifier\n ) as EventReturnWithStateObjectAndSuccess\n )\n }\n }\n\n forceUpdate()\n }, [\n asyncBehaviorIsEnabled,\n hasPath,\n identifier,\n hasError,\n yieldAsyncProcess,\n onChangeContext,\n defineAsyncProcess,\n setEventResult,\n handlePathChangeDataContext,\n ])\n\n const updateValue = useCallback(\n async (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n if (hasPath) {\n handlePathChangeUnvalidatedDataContext(identifier, newValue)\n }\n\n addToPool('validator', validateValue, isAsync(validatorRef.current))\n\n addToPool(\n 'onChangeContext',\n callOnChangeContext,\n isAsync(onChangeContext)\n )\n\n await runPool(() => {\n handleError()\n })\n },\n [\n hasPath,\n addToPool,\n validateValue,\n callOnChangeContext,\n onChangeContext,\n runPool,\n handlePathChangeUnvalidatedDataContext,\n identifier,\n handleError,\n ]\n )\n\n const handleChange = useCallback(\n async (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n const fromInput = transformers.current.fromInput(argFromInput)\n\n if (fromInput === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n const transformedValue = transformers.current.transformOut(\n transformers.current.transformValue(fromInput, currentValue)\n )\n\n // Must be set before validation\n changedRef.current = true\n\n // Run in sync, before any async operations to avoid lag in UX\n if (itemPath) {\n handleChangeIterateContext?.(makeIteratePath(), transformedValue)\n }\n\n if (asyncBehaviorIsEnabled) {\n hideError()\n await updateValue(transformedValue)\n } else {\n updateValue(transformedValue)\n }\n\n const getArgs = (): [Value] | [Value, AdditionalEventArgs] => {\n const value = transformers.current.toEvent(\n valueRef.current,\n 'onChange'\n )\n\n return typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n }\n\n if (isAsync(onChange)) {\n addToPool(\n 'onChangeLocal',\n async () => {\n const args = getArgs()\n\n await yieldAsyncProcess({\n name: 'onChangeLocal',\n waitFor: [\n {\n processName: 'validator',\n withStates: ['validating', 'error'],\n withValue: args[0],\n },\n {\n processName: 'onBlurValidator',\n withStates: ['validating', 'error'],\n withValue: args[0],\n },\n {\n processName: 'onChangeContext',\n withStates: ['pending', 'error'],\n withValue: args[0],\n },\n ],\n })\n\n defineAsyncProcess('onChangeLocal')\n\n // Skip sync errors, such as required\n if (!hasError()) {\n // If the value has changed during the async process, we don't want to call the onChange anymore\n setEventResult(await onChange?.apply(this, args))\n } else {\n setEventResult(null)\n }\n },\n true\n )\n } else {\n setEventResult(onChange?.apply(this, getArgs()))\n }\n\n await runPool()\n },\n [\n itemPath,\n asyncBehaviorIsEnabled,\n onChange,\n runPool,\n handleChangeIterateContext,\n makeIteratePath,\n hideError,\n updateValue,\n addToPool,\n yieldAsyncProcess,\n defineAsyncProcess,\n hasError,\n setEventResult,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n // Put props into the surrounding data context as early as possible\n setPropsDataContext?.(identifier, props)\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n validateValue()\n })\n useUnmountEffect(() => {\n dataContext?.handleUnMountField(identifier)\n setFieldErrorDataContext?.(identifier, undefined)\n setFieldError?.(identifier, undefined)\n localErrorRef.current = undefined\n })\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n if (valueRef.current !== externalValue) {\n valueRef.current = externalValue\n validateValue()\n }\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n // Check against the local error state,\n // so we prioritize the local error state over the context error state\n if (!hasLocalErrorRef.current) {\n const error = prepareError(dataContextError)\n if (error) {\n persistErrorState('weak', error)\n if (validateInitially) {\n handleError()\n }\n } else {\n clearErrorState()\n }\n }\n }, [\n clearErrorState,\n dataContextError,\n handleError,\n persistErrorState,\n prepareError,\n validateInitially,\n ])\n\n useEffect(() => {\n if (hasPath) {\n let value = valueProp\n\n // First, look for existing data in the context\n const hasValue = pointer.has(dataContext.data, identifier)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, identifier)\n : undefined\n\n // If no data where found in the dataContext, look for shared data\n if (\n dataContext.id &&\n !hasValue &&\n typeof existingValue === 'undefined' &&\n typeof value === 'undefined'\n ) {\n const sharedState = createSharedState(dataContext.id)\n const hasValue = pointer.has(sharedState.data, identifier)\n if (hasValue) {\n const sharedValue = pointer.get(sharedState.data, identifier)\n if (sharedValue) {\n value = sharedValue\n }\n }\n }\n\n if (\n typeof defaultValueRef.current !== 'undefined' &&\n typeof value === 'undefined'\n ) {\n value = defaultValueRef.current\n defaultValueRef.current = undefined\n }\n\n if (\n !hasValue ||\n (value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n updateDataValueDataContext?.(identifier, value)\n validateDataDataContext?.()\n }\n }\n }, [\n dataContext.data,\n dataContext.id,\n hasPath,\n identifier,\n updateDataValueDataContext,\n validateDataDataContext,\n valueProp,\n ])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // In case of async validation, we don't want to show existing errors before the validation has been completed\n if (fieldStateRef.current !== 'validating') {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (\n dataContext.formState === 'pending' &&\n (validatorRef.current || onBlurValidatorRef.current)\n ) {\n hideError()\n forceUpdate()\n }\n }, [dataContext.formState, hideError])\n\n const onSubmitHandler = useCallback(async () => {\n if (hasError()) {\n return // stop here\n }\n\n addToPool('validator', callValidator, isAsync(validatorRef.current))\n addToPool(\n 'onBlurValidator',\n callOnBlurValidator,\n isAsync(onBlurValidatorRef.current)\n )\n\n await runPool()\n }, [addToPool, callOnBlurValidator, callValidator, hasError, runPool])\n\n // Validate/call validator functions during submit of the form\n useMountEffect(() => {\n dataContext?.setFieldEventListener?.(\n identifier,\n 'onSubmit',\n onSubmitHandler\n )\n })\n\n // Set the error in the field block context if this field is inside a field block\n useMountEffect(() => {\n if (inFieldBlock) {\n if (errorProp) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'error',\n content: errorProp,\n showInitially: true,\n show: true,\n })\n }\n if (warning) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'warning',\n content: warning,\n showInitially: true,\n show: true,\n })\n }\n if (info) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'info',\n content: info,\n showInitially: true,\n show: true,\n })\n }\n\n return () => {\n // Unmount procedure\n if (mountedFieldsRefFieldBlock) {\n mountedFieldsRefFieldBlock.current[identifier] = true\n }\n }\n }\n })\n\n const infoRef = useRef<React.ReactNode>(info)\n const warningRef = useRef<React.ReactNode>(warning)\n useUpdateEffect(() => {\n infoRef.current = info\n warningRef.current = warning\n forceUpdate()\n }, [info, warning])\n\n // - Handle htmlAttributes\n const htmlAttributes = useMemo(() => {\n return Object.keys(props).reduce<AriaAttributes>(\n (acc, cur) => {\n if (cur.startsWith('aria-') || cur.startsWith('data-')) {\n acc[cur] = props[cur]\n }\n return acc\n },\n { ...props.htmlAttributes }\n )\n }, [props])\n\n if (error) {\n htmlAttributes['aria-invalid'] = error ? 'true' : 'false'\n }\n if (required) {\n htmlAttributes['aria-required'] = 'true'\n }\n if (inFieldBlock) {\n // Mount the field in the field block context\n if (mountedFieldsRefFieldBlock) {\n mountedFieldsRefFieldBlock.current[identifier] = true\n }\n\n // Check if there are any state IDs to be added to the aria-describedby attribute\n const stateIds = fieldBlockContext.fieldStateIdsRef?.current\n\n if (stateIds) {\n htmlAttributes['aria-describedby'] = combineDescribedBy(\n htmlAttributes,\n [\n error && stateIds.error,\n warning && stateIds.warning,\n info && stateIds.info,\n ].filter(Boolean)\n )\n }\n } else {\n const ids = [\n (error || errorProp) && `${id}-form-status--error`,\n warning && `${id}-form-status--warning`,\n info && `${id}-form-status--info`,\n ].filter(Boolean)\n\n if (ids.length) {\n htmlAttributes['aria-describedby'] = combineDescribedBy(\n htmlAttributes,\n ids\n )\n }\n }\n\n const fieldSectionProps = {\n /** Documented APIs */\n info: !inFieldBlock ? infoRef.current : undefined,\n warning: !inFieldBlock ? warningRef.current : undefined,\n error: !inFieldBlock ? error : undefined,\n\n /** HTML Attributes */\n disabled:\n onBlurValidator &&\n asyncProcessRef.current === 'onBlurValidator' &&\n fieldStateRef.current === 'validating'\n ? true\n : disabled,\n\n /** Internal */\n fieldState: resolveValidatingState(fieldStateRef.current),\n }\n\n const sharedData = useSharedState(id)\n sharedData.set(fieldSectionProps)\n\n return {\n ...props,\n ...fieldSectionProps,\n\n /** HTML Attributes */\n name: props.name || props.path?.replace('/', '') || id,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : undefined),\n\n /** Documented APIs */\n id,\n value: transformers.current.transformIn(\n transformers.current.toInput(valueRef.current)\n ),\n hasError: hasVisibleError,\n isChanged: changedRef.current,\n htmlAttributes,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n\n /** Internal */\n dataContext,\n }\n}\n\nexport interface ReturnAdditional<Value> {\n /** Documented APIs */\n value: Value\n isChanged: boolean\n htmlAttributes: AriaAttributes | DataAttributes\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: (\n value: Value,\n additionalArgs?: AdditionalEventArgs\n ) => void\n updateValue: (value: Value) => void\n forceUpdate: () => void\n hasError?: boolean\n\n /** Internal */\n dataContext: ContextState\n fieldState: SubmitState\n}\n\nfunction resolveValidatingState(state: SubmitStateWithValidating) {\n return state === 'validating' ? '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,GAAGA,KAAK;AACnD"}
|
|
1
|
+
{"version":3,"file":"useFieldProps.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","DataContext","FieldPropsContext","combineDescribedBy","useId","useUpdateEffect","useMountEffect","useUnmountEffect","FieldBlockContext","IterateElementContext","SectionContext","FieldBoundaryContext","useProcessManager","usePath","createSharedState","useSharedState","isAsync","useTranslation","useExternalValue","useFieldProps","localeProps","_dataContext$props","_useExternalValue","_dataContext$ajvInsta","_localErrorRef$curren","_ref","_props$path","_props$autoComplete","extend","props","path","pathProp","value","valueProp","defaultValue","itemPath","emptyValue","required","requiredProp","disabled","disabledProp","info","warning","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","transformIn","transformOut","toInput","fromInput","toEvent","transformValue","fromExternal","validateRequired","res","undefined","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sectionContext","fieldBoundaryContext","translation","transformers","handlePathChangeUnvalidated","handlePathChangeUnvalidatedDataContext","handlePathChange","handlePathChangeDataContext","updateDataValue","updateDataValueDataContext","validateData","validateDataDataContext","setFieldState","setFieldStateDataContext","setFieldError","setFieldErrorDataContext","setFieldProps","setPropsDataContext","setHasVisibleError","setHasVisibleErrorDataContext","errors","dataContextErrors","contextErrorMessages","onChangeContext","readOnly","inFieldBlock","Boolean","setFieldStateFieldBlock","showFieldError","showFieldErrorFieldBlock","mountedFieldsRef","mountedFieldsRefFieldBlock","handleChange","handleChangeIterateContext","sectionPath","errorPrioritization","hasPath","identifier","makeIteratePath","defaultValueRef","externalValue","current","valueRef","changedRef","hasFocusRef","paths","split","length","requiredList","schemaPath","slice","join","schemaPart","has","get","push","substring","collected","flatMap","v","filter","some","p","c","includes","showErrorRef","errorMethodRef","localErrorRef","hasLocalErrorRef","dataContextError","contextErrorRef","validatorRef","onBlurValidatorRef","schemaValidatorRef","ajvInstance","compile","errorMessagesRef","_objectSpread","Field","errorRequired","asyncBehaviorIsEnabled","validatedValue","changeEventResultRef","asyncProcessRef","defineAsyncProcess","name","asyncBufferRef","key","resolve","validateProcesses","window","requestAnimationFrame","eventPool","onChangeLocal","addToPool","fn","runAsync","runPool","cb","pending","fieldStateRef","state","resolveValidatingState","showError","hideError","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","messageWithValues","Object","entries","messageValues","reduce","replace","hasVisibleError","hasErrorProp","hasError","_ref2","stateId","persistErrorState","method","errorArg","keys","type","content","showInitially","clearErrorState","callValidator","opts","tmpValue","result","unchangedValue","Error","callOnBlurValidator","valueOverride","prioritizeContextSchema","hasContextSchema","indexOf","validateValue","isProcessActive","requiredError","isChanged","handleError","setHasFocus","hasFocus","yieldAsyncProcess","waitFor","Promise","processName","withStates","withValue","hasMatchingValue","handleChangeEventResult","warningRef","infoRef","success","setEventResult","callOnChangeContext","updateValue","newValue","argFromInput","additionalArgs","currentValue","transformedValue","getArgs","args","apply","handleFocus","handleBlur","handleMountField","handleUnMountField","_dataContext$ajvInsta2","hasValue","data","existingValue","sharedState","sharedValue","showAllErrors","formState","onSubmitHandler","_dataContext$setField","setFieldEventListener","call","show","htmlAttributes","acc","cur","startsWith","_fieldBlockContext$fi","stateIds","fieldStateIdsRef","ids","fieldSectionProps","fieldState","sharedData","set","autoComplete"],"sources":["../../../../../src/extensions/forms/hooks/useFieldProps.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n AriaAttributes,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport {\n FormError,\n FieldProps,\n AdditionalEventArgs,\n SubmitState,\n EventReturnWithStateObjectAndSuccess,\n EventStateObjectWithSuccess,\n} from '../types'\nimport { Context as DataContext, ContextState } from '../DataContext'\nimport FieldPropsContext from '../Form/FieldProps/FieldPropsContext'\nimport { combineDescribedBy } from '../../../shared/component-helper'\nimport useId from '../../../shared/helpers/useId'\nimport useUpdateEffect from '../../../shared/helpers/useUpdateEffect'\nimport useMountEffect from '../../../shared/helpers/useMountEffect'\nimport useUnmountEffect from '../../../shared/helpers/useUnmountEffect'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport SectionContext from '../Form/Section/SectionContext'\nimport FieldBoundaryContext from '../DataContext/FieldBoundary/FieldBoundaryContext'\nimport useProcessManager from './useProcessManager'\nimport usePath from './usePath'\nimport {\n createSharedState,\n useSharedState,\n} from '../../../shared/helpers/useSharedState'\nimport { isAsync } from '../../../shared/helpers/isAsync'\nimport useTranslation from './useTranslation'\nimport useExternalValue from './useExternalValue'\n\ntype SubmitStateWithValidating = SubmitState | 'validating'\ntype AsyncProcesses =\n | 'validator'\n | 'onBlurValidator'\n | 'onChangeLocal'\n | 'onChangeContext'\ntype PersistErrorStateMethod =\n /**\n * Add or remove the error regardless\n */\n | 'weak'\n /**\n * Check if there is an existing error, and if so, keep it\n */\n | 'gracefully'\n /**\n * Remove the error, if any\n */\n | 'wipe'\ntype AsyncProcessesBuffer = {\n resolve: () => void\n validateProcesses: () => boolean\n}\n\nexport type DataAttributes = {\n [property: `data-${string}`]: string | boolean | number\n}\n\n// Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n// useEffect depend on them (like the external `value`)\n\nexport default function useFieldProps<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(\n localeProps: Props\n): Props & FieldProps<Value> & ReturnAdditional<Value> {\n const { extend } = useContext(FieldPropsContext)\n const props = extend<Props>(localeProps)\n\n const {\n path: pathProp,\n value: valueProp,\n defaultValue,\n itemPath,\n emptyValue,\n required: requiredProp,\n disabled: disabledProp,\n info,\n warning,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n transformIn = (value: Value) => value,\n transformOut = (value: Value) => value,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n\n return res\n },\n } = props\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(DataContext)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sectionContext = useContext(SectionContext)\n const fieldBoundaryContext = useContext(FieldBoundaryContext)\n const translation = useTranslation()\n\n const transformers = useRef({\n transformIn,\n transformOut,\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChangeUnvalidated: handlePathChangeUnvalidatedDataContext,\n handlePathChange: handlePathChangeDataContext,\n updateDataValue: updateDataValueDataContext,\n validateData: validateDataDataContext,\n setFieldState: setFieldStateDataContext,\n setFieldError: setFieldErrorDataContext,\n setFieldProps: setPropsDataContext,\n setHasVisibleError: setHasVisibleErrorDataContext,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n const onChangeContext = dataContext?.props?.onChange\n\n const disabled = disabledProp ?? props.readOnly\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setFieldState: setFieldStateFieldBlock,\n showFieldError: showFieldErrorFieldBlock,\n mountedFieldsRef: mountedFieldsRefFieldBlock,\n } = fieldBlockContext ?? {}\n const { handleChange: handleChangeIterateContext } =\n iterateElementContext ?? {}\n const { path: sectionPath, errorPrioritization } = sectionContext ?? {}\n const { setFieldError } = fieldBoundaryContext ?? {}\n\n const hasPath = Boolean(pathProp)\n const { path, identifier, makeIteratePath } = usePath({\n id,\n path: pathProp,\n itemPath,\n })\n\n const defaultValueRef = useRef(defaultValue)\n const externalValue =\n useExternalValue<Value>({\n path,\n itemPath,\n value: valueProp,\n transformers,\n emptyValue,\n }) ?? defaultValueRef.current\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n const required = useMemo(() => {\n if (requiredProp) {\n return requiredProp\n }\n\n const paths = identifier.split('/')\n if (paths.length > 0 && (schema || dataContext?.schema)) {\n const requiredList = [schema?.['required']]\n\n if (paths.length > 1) {\n const schema = dataContext.schema\n const schemaPath = paths.slice(0, -1).join('/properties/')\n const schemaPart = pointer.has(schema, schemaPath)\n ? pointer.get(schema, schemaPath)\n : schema\n\n requiredList.push(schemaPart?.required)\n }\n\n if (sectionPath) {\n paths.push(sectionPath.substring(1))\n }\n\n const collected = requiredList.flatMap((v) => v).filter(Boolean)\n if (\n paths\n .filter(Boolean)\n .some((p) => collected.some((c) => c.includes(p)))\n ) {\n return true\n }\n }\n }, [sectionPath, dataContext.schema, identifier, requiredProp, schema])\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorRef = useRef<boolean>(\n Boolean(validateInitially || errorProp)\n )\n // - Local errors are errors based on validation instructions received by\n const errorMethodRef = useRef<\n Partial<Record<PersistErrorStateMethod, Error | FormError>>\n >({})\n const localErrorRef = useRef<Error | FormError | undefined>()\n const hasLocalErrorRef = useRef(false)\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const dataContextError = useMemo(() => {\n return path ? dataContextErrors?.[identifier] : undefined\n }, [dataContextErrors, identifier, path])\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n const onBlurValidatorRef = useRef(onBlurValidator)\n useUpdateEffect(() => {\n onBlurValidatorRef.current = onBlurValidator\n }, [onBlurValidator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n // Needs to be placed before \"prepareError\"\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: translation.Field.errorRequired,\n ...errorMessages,\n }\n }, [errorMessages, translation.Field.errorRequired])\n\n // - Async behavior\n const asyncBehaviorIsEnabled = useMemo(() => {\n return isAsync(onChange) || isAsync(onChangeContext)\n }, [onChangeContext, onChange])\n const validatedValue = useRef<Value>()\n const changeEventResultRef = useRef<EventStateObjectWithSuccess>(null)\n const asyncProcessRef = useRef<AsyncProcesses>(null)\n const defineAsyncProcess = useCallback((name: AsyncProcesses) => {\n asyncProcessRef.current = name\n }, [])\n\n // When both an async onChange and async validators are used,\n // we buffer the onChange calls to avoid race conditions.\n const asyncBufferRef = useRef<\n Record<AsyncProcesses, AsyncProcessesBuffer> | Record<string, unknown>\n >({})\n\n for (const key in asyncBufferRef.current) {\n const { resolve, validateProcesses } = (asyncBufferRef.current[key] ||\n {}) as AsyncProcessesBuffer\n if (validateProcesses?.() === false) {\n delete asyncBufferRef.current[key]\n if (typeof resolve === 'function') {\n window.requestAnimationFrame(resolve)\n }\n }\n }\n\n const eventPool = useRef({\n validator: null,\n onBlurValidator: null,\n onChangeContext: null,\n onChangeLocal: null,\n })\n\n const addToPool = useCallback(\n (name: keyof typeof eventPool.current, fn, runAsync) => {\n if (!eventPool.current[name]) {\n eventPool.current[name] = { fn, runAsync }\n }\n },\n []\n )\n\n const runPool = useCallback(async (cb = null) => {\n for (const key in eventPool.current) {\n if (!eventPool.current[key] || eventPool.current[key].pending) {\n continue\n }\n\n const { fn, runAsync } = eventPool.current[key] || {}\n if (fn) {\n eventPool.current[key].pending = true\n eventPool.current[key] = null\n\n if (runAsync) {\n await fn()\n } else {\n fn()\n }\n }\n }\n\n // use a callback in order to avoid any async/await,\n // because it will delay the execution of the following code\n cb?.()\n }, [])\n\n const fieldStateRef = useRef<SubmitStateWithValidating>()\n const setFieldState = useCallback(\n (state: SubmitStateWithValidating) => {\n fieldStateRef.current = state\n setFieldStateDataContext(identifier, resolveValidatingState(state))\n if (!validateInitially) {\n forceUpdate()\n }\n },\n [setFieldStateDataContext, identifier, validateInitially]\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n showFieldErrorFieldBlock?.(identifier, true)\n if (localErrorRef.current) {\n setHasVisibleErrorDataContext?.(identifier, true)\n }\n }, [showFieldErrorFieldBlock, identifier, setHasVisibleErrorDataContext])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n showFieldErrorFieldBlock?.(identifier, false)\n setHasVisibleErrorDataContext?.(identifier, false)\n }, [setHasVisibleErrorDataContext, identifier, showFieldErrorFieldBlock])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n error.message = messageWithValues\n\n return error\n }\n\n return error\n },\n []\n )\n\n contextErrorRef.current = useMemo(() => {\n if (!dataContextError) {\n return undefined\n }\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n return error\n }\n }, [dataContextError, prepareError])\n\n const error =\n showErrorRef.current ||\n // If the error is a type error, we want to show it even if the field as not been used\n localErrorRef.current?.['validationRule'] === 'type'\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const hasVisibleError =\n Boolean(error) || (inFieldBlock && fieldBlockContext.hasErrorProp)\n const hasError = useCallback(() => {\n return Boolean(\n errorProp ?? localErrorRef.current ?? contextErrorRef.current\n )\n }, [errorProp])\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const stateId = useId()\n const persistErrorState = useCallback(\n (\n method: PersistErrorStateMethod,\n errorArg: Error | FormError | undefined = undefined\n ) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n if (method === 'wipe') {\n errorMethodRef.current = {}\n } else {\n errorMethodRef.current[method] = error\n }\n\n if (\n !error &&\n method === 'gracefully' &&\n Object.keys(errorMethodRef.current).filter(Boolean).length > 0\n ) {\n // If the error is removed, we need to check if there are other errors that still should be shown\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n setFieldErrorDataContext?.(identifier, error)\n setFieldError?.(identifier, error)\n\n // Set the visual states\n setFieldStateDataContext?.(identifier, error ? 'error' : undefined)\n setFieldStateFieldBlock?.({\n stateId,\n identifier,\n type: 'error',\n content: error,\n showInitially: Boolean(inFieldBlock && validateInitially),\n })\n\n forceUpdate()\n },\n [\n prepareError,\n setFieldErrorDataContext,\n identifier,\n setFieldError,\n setFieldStateDataContext,\n setFieldStateFieldBlock,\n stateId,\n inFieldBlock,\n validateInitially,\n ]\n )\n\n const clearErrorState = useCallback(() => {\n persistErrorState('wipe')\n hasLocalErrorRef.current = false\n }, [persistErrorState])\n\n const callValidator = useCallback(async () => {\n if (typeof validatorRef.current !== 'function') {\n return\n }\n\n const runAsync = isAsync(validatorRef.current)\n\n if (runAsync) {\n defineAsyncProcess('validator')\n setFieldState('validating')\n hideError()\n }\n\n const opts = {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n }\n\n const tmpValue = valueRef.current\n\n // Run async regardless to support Promise based validators\n const result = await validatorRef.current(valueRef.current, opts)\n\n const unchangedValue = tmpValue === valueRef.current\n\n // Don't show the error if the value has changed in the meantime\n if (unchangedValue) {\n persistErrorState('gracefully', result as Error)\n\n // Because its a better UX to show the error when the validation is async/delayed\n if (continuousValidation || runAsync) {\n // Because we first need to throw the error to be able to display it, we delay the showError call\n window.requestAnimationFrame(() => {\n showError()\n forceUpdate()\n })\n }\n }\n\n if (runAsync) {\n defineAsyncProcess(undefined)\n\n if (unchangedValue) {\n setFieldState(result instanceof Error ? 'error' : 'complete')\n } else {\n setFieldState('pending')\n }\n }\n\n return result\n }, [\n contextErrorMessages,\n continuousValidation,\n hideError,\n persistErrorState,\n defineAsyncProcess,\n setFieldState,\n showError,\n ])\n\n const callOnBlurValidator = useCallback(\n async ({ valueOverride = null } = {}) => {\n if (typeof onBlurValidatorRef.current !== 'function') {\n return\n }\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n\n const runAsync = isAsync(onBlurValidatorRef.current)\n\n if (runAsync) {\n defineAsyncProcess('onBlurValidator')\n setFieldState('validating')\n }\n\n // Run async regardless to support Promise based validators\n const result = await onBlurValidatorRef.current(value)\n\n persistErrorState('gracefully', result as Error)\n\n if (runAsync) {\n defineAsyncProcess(undefined)\n setFieldState(result instanceof Error ? 'error' : 'complete')\n }\n\n showError()\n forceUpdate()\n },\n [persistErrorState, defineAsyncProcess, setFieldState, showError]\n )\n\n const prioritizeContextSchema = useMemo(() => {\n if (errorPrioritization) {\n const schemaPath = identifier.split('/').join('/properties/')\n const hasContextSchema = pointer.has(\n dataContext?.schema || {},\n schemaPath\n )\n return (\n hasContextSchema &&\n errorPrioritization?.indexOf('contextSchema') === 0\n )\n }\n }, [dataContext?.schema, errorPrioritization, identifier])\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n setFieldState(undefined)\n return // stop here\n }\n\n const value = valueRef.current\n changeEventResultRef.current = null\n validatedValue.current = null\n\n try {\n const requiredError = transformers.current.validateRequired(value, {\n emptyValue,\n required: requiredProp ?? required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n })\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n value !== undefined &&\n !schemaValidatorRef.current(value) &&\n !prioritizeContextSchema\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors,\n valueRef.current\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (\n validatorRef.current &&\n (changedRef.current || validateInitially)\n ) {\n const result = await callValidator()\n\n if (result instanceof Error) {\n throw result\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n\n validatedValue.current = value\n } catch (error: unknown) {\n if (isProcessActive()) {\n hasLocalErrorRef.current = true\n persistErrorState('weak', error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n setFieldState,\n clearErrorState,\n emptyValue,\n requiredProp,\n required,\n prioritizeContextSchema,\n validateInitially,\n callValidator,\n persistErrorState,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n async (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n addToPool(\n 'onBlurValidator',\n async () => await callOnBlurValidator({ valueOverride }),\n isAsync(onBlurValidatorRef.current)\n )\n\n await runPool(() => {\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n })\n }\n },\n [\n addToPool,\n callOnBlurValidator,\n onBlur,\n onFocus,\n runPool,\n showError,\n validateUnchanged,\n ]\n )\n\n // Await an async operation to run after criteria are fulfilled\n const yieldAsyncProcess = useCallback(\n async ({\n name,\n waitFor,\n }: {\n name: 'onChangeLocal' | 'onChangeContext' | 'onSubmitContext'\n waitFor: Array<{\n processName?: AsyncProcesses\n withStates: Array<SubmitStateWithValidating>\n withValue?: Value\n }>\n }) => {\n return new Promise<void>((resolve) => {\n const validateProcesses = () => {\n const result = waitFor.some(\n ({ processName, withStates, withValue }) => {\n const hasMatchingValue =\n // If the value has changed during the async process, we don't want to resolve anymore\n withValue === validatedValue.current\n\n const result =\n (typeof withValue === 'undefined'\n ? false\n : !hasMatchingValue) ||\n ((processName\n ? processName === asyncProcessRef.current\n : true) &&\n withStates?.some((state) => {\n return state === fieldStateRef.current\n }))\n\n return result\n }\n )\n\n return result\n }\n\n if (validateProcesses() === true) {\n asyncBufferRef.current[name] = { resolve, validateProcesses }\n } else {\n resolve()\n setFieldState('pending')\n }\n })\n },\n [setFieldState]\n )\n\n const handleChangeEventResult = useCallback(async () => {\n const result: EventStateObjectWithSuccess =\n changeEventResultRef.current\n\n if (typeof result?.error !== 'undefined') {\n persistErrorState('gracefully', result.error)\n showError()\n }\n if (typeof result?.warning !== 'undefined') {\n warningRef.current = result.warning\n }\n if (typeof result?.info !== 'undefined') {\n infoRef.current = result.info\n }\n\n if (asyncBehaviorIsEnabled) {\n await yieldAsyncProcess({\n name: 'onSubmitContext',\n waitFor: [{ withStates: ['validating'] }],\n })\n }\n\n defineAsyncProcess(undefined)\n\n if (result?.success === 'saved') {\n setFieldState('success')\n } else if (result?.error) {\n setFieldState('error')\n } else if (asyncBehaviorIsEnabled) {\n setFieldState('complete')\n }\n }, [\n asyncBehaviorIsEnabled,\n defineAsyncProcess,\n persistErrorState,\n setFieldState,\n showError,\n yieldAsyncProcess,\n ])\n\n const setEventResult = useCallback(\n (result: EventReturnWithStateObjectAndSuccess) => {\n if (result instanceof Error) {\n result = { error: result }\n }\n changeEventResultRef.current = {\n ...changeEventResultRef.current,\n ...result,\n } as EventStateObjectWithSuccess\n\n handleChangeEventResult()\n },\n [handleChangeEventResult]\n )\n\n const callOnChangeContext = useCallback(async () => {\n if (asyncBehaviorIsEnabled) {\n await yieldAsyncProcess({\n name: 'onChangeContext',\n waitFor: [\n {\n processName: 'validator',\n withStates: ['validating', 'error'],\n withValue: valueRef.current,\n },\n {\n processName: 'onBlurValidator',\n withStates: ['validating', 'error'],\n withValue: valueRef.current,\n },\n ],\n })\n }\n\n if (hasPath) {\n if (isAsync(onChangeContext)) {\n defineAsyncProcess('onChangeContext')\n\n // Skip sync errors, such as required\n if (!hasError()) {\n setEventResult(\n (await handlePathChangeDataContext?.(\n identifier\n )) as EventReturnWithStateObjectAndSuccess\n )\n } else {\n setEventResult(null)\n }\n } else {\n setEventResult(\n handlePathChangeDataContext?.(\n identifier\n ) as EventReturnWithStateObjectAndSuccess\n )\n }\n }\n\n forceUpdate()\n }, [\n asyncBehaviorIsEnabled,\n hasPath,\n yieldAsyncProcess,\n identifier,\n onChangeContext,\n defineAsyncProcess,\n hasError,\n setEventResult,\n handlePathChangeDataContext,\n ])\n\n const updateValue = useCallback(\n async (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n if (hasPath) {\n handlePathChangeUnvalidatedDataContext(identifier, newValue)\n }\n\n addToPool('validator', validateValue, isAsync(validatorRef.current))\n\n addToPool(\n 'onChangeContext',\n callOnChangeContext,\n isAsync(onChangeContext)\n )\n\n await runPool(() => {\n handleError()\n })\n },\n [\n hasPath,\n addToPool,\n validateValue,\n callOnChangeContext,\n onChangeContext,\n runPool,\n handlePathChangeUnvalidatedDataContext,\n identifier,\n handleError,\n ]\n )\n\n const handleChange = useCallback(\n async (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n const fromInput = transformers.current.fromInput(argFromInput)\n\n if (fromInput === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n const transformedValue = transformers.current.transformOut(\n transformers.current.transformValue(fromInput, currentValue)\n )\n\n // Must be set before validation\n changedRef.current = true\n\n // Run in sync, before any async operations to avoid lag in UX\n if (itemPath) {\n handleChangeIterateContext?.(makeIteratePath(), transformedValue)\n }\n\n if (asyncBehaviorIsEnabled) {\n hideError()\n await updateValue(transformedValue)\n } else {\n updateValue(transformedValue)\n }\n\n const getArgs = (): [Value] | [Value, AdditionalEventArgs] => {\n const value = transformers.current.toEvent(\n valueRef.current,\n 'onChange'\n )\n\n return typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n }\n\n if (isAsync(onChange)) {\n addToPool(\n 'onChangeLocal',\n async () => {\n const args = getArgs()\n\n await yieldAsyncProcess({\n name: 'onChangeLocal',\n waitFor: [\n {\n processName: 'validator',\n withStates: ['validating', 'error'],\n withValue: args[0],\n },\n {\n processName: 'onBlurValidator',\n withStates: ['validating', 'error'],\n withValue: args[0],\n },\n {\n processName: 'onChangeContext',\n withStates: ['pending', 'error'],\n withValue: args[0],\n },\n ],\n })\n\n defineAsyncProcess('onChangeLocal')\n\n // Skip sync errors, such as required\n if (!hasError()) {\n // If the value has changed during the async process, we don't want to call the onChange anymore\n setEventResult(await onChange?.apply(this, args))\n } else {\n setEventResult(null)\n }\n },\n true\n )\n } else {\n setEventResult(onChange?.apply(this, getArgs()))\n }\n\n await runPool()\n },\n [\n itemPath,\n asyncBehaviorIsEnabled,\n onChange,\n runPool,\n handleChangeIterateContext,\n makeIteratePath,\n hideError,\n updateValue,\n addToPool,\n yieldAsyncProcess,\n defineAsyncProcess,\n hasError,\n setEventResult,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n // Put props into the surrounding data context as early as possible\n setPropsDataContext?.(identifier, props)\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n validateValue()\n })\n useUnmountEffect(() => {\n dataContext?.handleUnMountField(identifier)\n setFieldErrorDataContext?.(identifier, undefined)\n setFieldError?.(identifier, undefined)\n localErrorRef.current = undefined\n })\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n if (valueRef.current !== externalValue) {\n valueRef.current = externalValue\n validateValue()\n }\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n // Check against the local error state,\n // so we prioritize the local error state over the context error state\n if (!hasLocalErrorRef.current) {\n const error = prepareError(dataContextError)\n if (error) {\n persistErrorState('weak', error)\n if (validateInitially) {\n handleError()\n }\n } else {\n clearErrorState()\n }\n }\n }, [\n clearErrorState,\n dataContextError,\n handleError,\n persistErrorState,\n prepareError,\n validateInitially,\n ])\n\n useEffect(() => {\n if (hasPath) {\n let value = valueProp\n\n // First, look for existing data in the context\n const hasValue = pointer.has(dataContext.data, identifier)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, identifier)\n : undefined\n\n // If no data where found in the dataContext, look for shared data\n if (\n dataContext.id &&\n !hasValue &&\n typeof existingValue === 'undefined' &&\n typeof value === 'undefined'\n ) {\n const sharedState = createSharedState(dataContext.id)\n const hasValue = pointer.has(sharedState.data, identifier)\n if (hasValue) {\n const sharedValue = pointer.get(sharedState.data, identifier)\n if (sharedValue) {\n value = sharedValue\n }\n }\n }\n\n if (\n typeof defaultValueRef.current !== 'undefined' &&\n typeof value === 'undefined'\n ) {\n value = defaultValueRef.current\n defaultValueRef.current = undefined\n }\n\n if (\n !hasValue ||\n (value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n updateDataValueDataContext?.(identifier, value)\n validateDataDataContext?.()\n }\n }\n }, [\n dataContext.data,\n dataContext.id,\n hasPath,\n identifier,\n updateDataValueDataContext,\n validateDataDataContext,\n valueProp,\n ])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // In case of async validation, we don't want to show existing errors before the validation has been completed\n if (fieldStateRef.current !== 'validating') {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (\n dataContext.formState === 'pending' &&\n (validatorRef.current || onBlurValidatorRef.current)\n ) {\n hideError()\n forceUpdate()\n }\n }, [dataContext.formState, hideError])\n\n const onSubmitHandler = useCallback(async () => {\n if (hasError()) {\n return // stop here\n }\n\n addToPool('validator', callValidator, isAsync(validatorRef.current))\n addToPool(\n 'onBlurValidator',\n callOnBlurValidator,\n isAsync(onBlurValidatorRef.current)\n )\n\n await runPool()\n }, [addToPool, callOnBlurValidator, callValidator, hasError, runPool])\n\n // Validate/call validator functions during submit of the form\n useMountEffect(() => {\n dataContext?.setFieldEventListener?.(\n identifier,\n 'onSubmit',\n onSubmitHandler\n )\n })\n\n // Set the error in the field block context if this field is inside a field block\n useMountEffect(() => {\n if (inFieldBlock) {\n if (errorProp) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'error',\n content: errorProp,\n showInitially: true,\n show: true,\n })\n }\n if (warning) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'warning',\n content: warning,\n showInitially: true,\n show: true,\n })\n }\n if (info) {\n setFieldStateFieldBlock?.({\n identifier,\n type: 'info',\n content: info,\n showInitially: true,\n show: true,\n })\n }\n\n return () => {\n // Unmount procedure\n if (mountedFieldsRefFieldBlock) {\n mountedFieldsRefFieldBlock.current[identifier] = true\n }\n }\n }\n })\n\n const infoRef = useRef<React.ReactNode>(info)\n const warningRef = useRef<React.ReactNode>(warning)\n useUpdateEffect(() => {\n infoRef.current = info\n warningRef.current = warning\n forceUpdate()\n }, [info, warning])\n\n // - Handle htmlAttributes\n const htmlAttributes = useMemo(() => {\n return Object.keys(props).reduce<AriaAttributes>(\n (acc, cur) => {\n if (cur.startsWith('aria-') || cur.startsWith('data-')) {\n acc[cur] = props[cur]\n }\n return acc\n },\n { ...props.htmlAttributes }\n )\n }, [props])\n\n if (error) {\n htmlAttributes['aria-invalid'] = error ? 'true' : 'false'\n }\n if (required) {\n htmlAttributes['aria-required'] = 'true'\n }\n if (inFieldBlock) {\n // Mount the field in the field block context\n if (mountedFieldsRefFieldBlock) {\n mountedFieldsRefFieldBlock.current[identifier] = true\n }\n\n // Check if there are any state IDs to be added to the aria-describedby attribute\n const stateIds = fieldBlockContext.fieldStateIdsRef?.current\n\n if (stateIds) {\n htmlAttributes['aria-describedby'] = combineDescribedBy(\n htmlAttributes,\n [\n error && stateIds.error,\n warning && stateIds.warning,\n info && stateIds.info,\n ].filter(Boolean)\n )\n }\n } else {\n const ids = [\n (error || errorProp) && `${id}-form-status--error`,\n warning && `${id}-form-status--warning`,\n info && `${id}-form-status--info`,\n ].filter(Boolean)\n\n if (ids.length) {\n htmlAttributes['aria-describedby'] = combineDescribedBy(\n htmlAttributes,\n ids\n )\n }\n }\n\n const fieldSectionProps = {\n /** Documented APIs */\n info: !inFieldBlock ? infoRef.current : undefined,\n warning: !inFieldBlock ? warningRef.current : undefined,\n error: !inFieldBlock ? error : undefined,\n\n /** HTML Attributes */\n disabled:\n onBlurValidator &&\n asyncProcessRef.current === 'onBlurValidator' &&\n fieldStateRef.current === 'validating'\n ? true\n : disabled,\n\n /** Internal */\n fieldState: resolveValidatingState(fieldStateRef.current),\n }\n\n const sharedData = useSharedState(id)\n sharedData.set(fieldSectionProps)\n\n return {\n ...props,\n ...fieldSectionProps,\n\n /** HTML Attributes */\n name: props.name || props.path?.replace('/', '') || id,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : undefined),\n\n /** Documented APIs */\n id,\n value: transformers.current.transformIn(\n transformers.current.toInput(valueRef.current)\n ),\n hasError: hasVisibleError,\n isChanged: changedRef.current,\n htmlAttributes,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n\n /** Internal */\n dataContext,\n }\n}\n\nexport interface ReturnAdditional<Value> {\n /** Documented APIs */\n value: Value\n isChanged: boolean\n htmlAttributes: AriaAttributes | DataAttributes\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: (\n value: Value,\n additionalArgs?: AdditionalEventArgs\n ) => void\n updateValue: (value: Value) => void\n forceUpdate: () => void\n hasError?: boolean\n\n /** Internal */\n dataContext: ContextState\n fieldState: SubmitState\n}\n\nfunction resolveValidatingState(state: SubmitStateWithValidating) {\n return state === 'validating' ? 'pending' : state\n}\n"],"mappings":";;;;;AAAA,SACEA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,UAAU,QAEL,OAAO;AACd,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,uBAAuB,QAAQ,cAAc;AACtD,SACEC,SAAS,QAMJ,UAAU;AACjB,SAASC,OAAO,IAAIC,WAAW,QAAsB,gBAAgB;AACrE,OAAOC,iBAAiB,MAAM,sC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2,22 @@
|
|
|
2
2
|
|
|
3
3
|
import { useMemo, useContext } from 'react';
|
|
4
4
|
import SharedContext from '../../../shared/Context';
|
|
5
|
-
import {
|
|
5
|
+
import { combineWithExternalTranslations } from '../../../shared/useTranslation';
|
|
6
|
+
import { extendDeep } from '../../../shared/component-helper';
|
|
6
7
|
import { LOCALE } from '../../../shared/defaults';
|
|
7
8
|
import formsLocales from '../constants/locales';
|
|
8
9
|
export default function useTranslation(messages) {
|
|
9
10
|
const {
|
|
10
11
|
locale,
|
|
11
|
-
translation
|
|
12
|
+
translation: globalTranslation
|
|
12
13
|
} = useContext(SharedContext);
|
|
13
14
|
return useMemo(() => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
for (const key in Forms) {
|
|
18
|
-
tr[key] = Object.assign((tr === null || tr === void 0 ? void 0 : tr[key]) || {}, Forms[key]);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return combineTranslations({
|
|
22
|
-
translation: tr,
|
|
15
|
+
const translation = extendDeep({}, formsLocales[locale] || formsLocales[LOCALE], globalTranslation);
|
|
16
|
+
return combineWithExternalTranslations({
|
|
17
|
+
translation,
|
|
23
18
|
messages,
|
|
24
19
|
locale
|
|
25
20
|
});
|
|
26
|
-
}, [locale, messages
|
|
21
|
+
}, [globalTranslation, locale, messages]);
|
|
27
22
|
}
|
|
28
23
|
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.js","names":["useMemo","useContext","SharedContext","
|
|
1
|
+
{"version":3,"file":"useTranslation.js","names":["useMemo","useContext","SharedContext","combineWithExternalTranslations","extendDeep","LOCALE","formsLocales","useTranslation","messages","locale","translation","globalTranslation"],"sources":["../../../../../src/extensions/forms/hooks/useTranslation.tsx"],"sourcesContent":["import { useMemo, useContext } from 'react'\nimport SharedContext from '../../../shared/Context'\nimport { combineWithExternalTranslations } from '../../../shared/useTranslation'\nimport { extendDeep } from '../../../shared/component-helper'\nimport { DeepPartial } from '../../../shared/types'\nimport { LOCALE } from '../../../shared/defaults'\nimport formsLocales from '../constants/locales'\n\nexport type FormsTranslationDefaultLocales = typeof formsLocales\nexport type FormsTranslationLocale = keyof FormsTranslationDefaultLocales\nexport type FormsTranslationKeys =\n keyof FormsTranslationDefaultLocales[FormsTranslationLocale]\nexport type FormsTranslationValues =\n FormsTranslationDefaultLocales[FormsTranslationLocale]\nexport type FormsTranslation = DeepPartial<\n FormsTranslationDefaultLocales[FormsTranslationLocale]\n>\n\ntype CustomLocales = Partial<\n Record<FormsTranslationLocale, FormsTranslation>\n>\n\nexport default function useTranslation<T = FormsTranslation>(\n messages?:\n | FormsTranslation\n | CustomLocales\n | Record<FormsTranslationLocale, T>\n) {\n const { locale, translation: globalTranslation } =\n useContext(SharedContext)\n\n return useMemo(() => {\n const translation = extendDeep(\n {},\n formsLocales[locale] || formsLocales[LOCALE],\n globalTranslation\n )\n\n return combineWithExternalTranslations({\n translation,\n messages,\n locale,\n }) as T\n }, [globalTranslation, locale, messages])\n}\n"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,UAAU,QAAQ,OAAO;AAC3C,OAAOC,aAAa,MAAM,yBAAyB;AACnD,SAASC,+BAA+B,QAAQ,gCAAgC;AAChF,SAASC,UAAU,QAAQ,kCAAkC;AAE7D,SAASC,MAAM,QAAQ,0BAA0B;AACjD,OAAOC,YAAY,MAAM,sBAAsB;AAgB/C,eAAe,SAASC,cAAcA,CACpCC,QAGqC,EACrC;EACA,MAAM;IAAEC,MAAM;IAAEC,WAAW,EAAEC;EAAkB,CAAC,GAC9CV,UAAU,CAACC,aAAa,CAAC;EAE3B,OAAOF,OAAO,CAAC,MAAM;IACnB,MAAMU,WAAW,GAAGN,UAAU,CAC5B,CAAC,CAAC,EACFE,YAAY,CAACG,MAAM,CAAC,IAAIH,YAAY,CAACD,MAAM,CAAC,EAC5CM,iBACF,CAAC;IAED,OAAOR,+BAA+B,CAAC;MACrCO,WAAW;MACXF,QAAQ;MACRC;IACF,CAAC,CAAC;EACJ,CAAC,EAAE,CAACE,iBAAiB,EAAEF,MAAM,EAAED,QAAQ,CAAC,CAAC;AAC3C"}
|