@dnb/eufemia 10.45.0 → 10.46.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 +26 -0
- package/cjs/components/CopyOnClick.d.ts +12 -0
- package/cjs/components/CopyOnClick.js +24 -0
- package/cjs/components/CopyOnClick.js.map +1 -0
- package/cjs/components/copy-on-click/CopyOnClick.d.ts +9 -0
- package/cjs/components/copy-on-click/CopyOnClick.js +72 -0
- package/cjs/components/copy-on-click/CopyOnClick.js.map +1 -0
- package/cjs/components/copy-on-click/CopyOnClickDocs.d.ts +2 -0
- package/cjs/components/copy-on-click/CopyOnClickDocs.js +25 -0
- package/cjs/components/copy-on-click/CopyOnClickDocs.js.map +1 -0
- package/cjs/components/copy-on-click/index.d.ts +7 -0
- package/cjs/components/copy-on-click/index.js +24 -0
- package/cjs/components/copy-on-click/index.js.map +1 -0
- package/cjs/components/copy-on-click/style/dnb-copy-on-click.css +7 -0
- package/cjs/components/copy-on-click/style/dnb-copy-on-click.min.css +1 -0
- package/cjs/components/copy-on-click/style/dnb-copy-on-click.scss +10 -0
- package/cjs/components/copy-on-click/style/index.d.ts +5 -0
- package/cjs/components/copy-on-click/style/index.js +4 -0
- package/cjs/components/copy-on-click/style/index.js.map +1 -0
- package/cjs/components/copy-on-click/style.d.ts +5 -0
- package/cjs/components/copy-on-click/style.js +4 -0
- package/cjs/components/copy-on-click/style.js.map +1 -0
- package/cjs/components/copy-on-click/types.d.ts +19 -0
- package/cjs/components/copy-on-click/types.js +1 -0
- package/cjs/components/copy-on-click/types.js.map +1 -0
- package/cjs/components/index.d.ts +2 -1
- package/cjs/components/index.js +7 -0
- package/cjs/components/index.js.map +1 -1
- package/cjs/components/lib.d.ts +6 -1
- package/cjs/components/lib.js +8 -0
- package/cjs/components/lib.js.map +1 -1
- package/cjs/components/pagination/Pagination.d.ts +27 -1
- package/cjs/components/pagination/Pagination.js +3 -1
- package/cjs/components/pagination/Pagination.js.map +1 -1
- package/cjs/components/pagination/PaginationInfinity.js +20 -8
- package/cjs/components/pagination/PaginationInfinity.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Context.d.ts +2 -2
- package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Provider/Provider.d.ts +1 -5
- package/cjs/extensions/forms/DataContext/Provider/Provider.js +26 -19
- package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Provider/ProviderDocs.js +2 -7
- package/cjs/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +15 -3
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js +12 -3
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +10 -0
- package/cjs/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/Email/Email.js +1 -1
- package/cjs/extensions/forms/Field/Email/Email.js.map +1 -1
- package/cjs/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js +22 -3
- package/cjs/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
- package/cjs/extensions/forms/Field/Number/Number.d.ts +2 -2
- package/cjs/extensions/forms/Field/Number/Number.js +33 -31
- package/cjs/extensions/forms/Field/Number/Number.js.map +1 -1
- package/cjs/extensions/forms/Field/SelectCountry/SelectCountryDocs.d.ts +3 -1
- package/cjs/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +11 -3
- package/cjs/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/Selection/Selection.d.ts +1 -1
- package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/cjs/extensions/forms/Field/Selection/SelectionDocs.js +6 -1
- package/cjs/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
- package/cjs/extensions/forms/Form/Handler/Handler.d.ts +1 -1
- package/cjs/extensions/forms/Form/Handler/Handler.js +1 -3
- package/cjs/extensions/forms/Form/Handler/Handler.js.map +1 -1
- package/cjs/extensions/forms/Form/Isolation/Isolation.d.ts +1 -1
- package/cjs/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js +0 -1
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/cjs/extensions/forms/Form/Section/Section.js.map +1 -1
- package/cjs/extensions/forms/Form/data-context/useData.js +9 -7
- package/cjs/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/cjs/extensions/forms/Value/SelectCountry/SelectCountry.d.ts +7 -0
- package/cjs/extensions/forms/Value/SelectCountry/SelectCountry.js +54 -0
- package/cjs/extensions/forms/Value/SelectCountry/SelectCountry.js.map +1 -0
- package/cjs/extensions/forms/Value/SelectCountry/index.d.ts +2 -0
- package/cjs/extensions/forms/Value/SelectCountry/index.js +27 -0
- package/cjs/extensions/forms/Value/SelectCountry/index.js.map +1 -0
- package/cjs/extensions/forms/Value/Selection/SelectionDocs.js +1 -1
- package/cjs/extensions/forms/Value/Selection/SelectionDocs.js.map +1 -1
- package/cjs/extensions/forms/Value/index.d.ts +1 -0
- package/cjs/extensions/forms/Value/index.js +7 -0
- package/cjs/extensions/forms/Value/index.js.map +1 -1
- package/cjs/extensions/forms/ValueBlock/ValueBlock.js +4 -3
- package/cjs/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.css +3 -0
- package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
- package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.scss +3 -0
- package/cjs/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js +4 -4
- package/cjs/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js.map +1 -1
- package/cjs/extensions/forms/constants/locales/en-GB.d.ts +2 -0
- package/cjs/extensions/forms/constants/locales/en-GB.js +3 -1
- package/cjs/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/cjs/extensions/forms/constants/locales/en-US.d.ts +2 -0
- package/cjs/extensions/forms/constants/locales/index.d.ts +4 -0
- package/cjs/extensions/forms/constants/locales/nb-NO.d.ts +2 -0
- package/cjs/extensions/forms/constants/locales/nb-NO.js +3 -1
- package/cjs/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/cjs/extensions/forms/hooks/DataValueDocs.js +3 -3
- package/cjs/extensions/forms/hooks/DataValueDocs.js.map +1 -1
- package/cjs/extensions/forms/style/dnb-forms.css +3 -0
- package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
- package/cjs/extensions/forms/types.d.ts +5 -2
- package/cjs/extensions/forms/types.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +7 -0
- package/cjs/index.js.map +1 -1
- package/cjs/shared/Context.js +4 -6
- 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/locales/en-GB.d.ts +3 -0
- package/cjs/shared/locales/en-GB.js +3 -0
- package/cjs/shared/locales/en-GB.js.map +1 -1
- package/cjs/shared/locales/en-US.d.ts +3 -0
- package/cjs/shared/locales/index.d.ts +6 -0
- package/cjs/shared/locales/nb-NO.d.ts +3 -0
- package/cjs/shared/locales/nb-NO.js +3 -0
- package/cjs/shared/locales/nb-NO.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 +11 -0
- package/cjs/style/dnb-ui-components.min.css +2 -2
- package/cjs/style/dnb-ui-components.scss +1 -0
- 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 +3 -0
- package/cjs/style/dnb-ui-extensions.min.css +1 -1
- package/cjs/style/dnb-ui-forms.css +3 -0
- package/cjs/style/dnb-ui-forms.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +14 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +2 -2
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +3 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +3 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +14 -0
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +2 -2
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +3 -0
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +3 -0
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +14 -0
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +2 -2
- package/cjs/style/themes/theme-ui/ui-theme-extensions.css +3 -0
- package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-forms.css +3 -0
- package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/components/CopyOnClick.d.ts +12 -0
- package/components/CopyOnClick.js +4 -0
- package/components/CopyOnClick.js.map +1 -0
- package/components/copy-on-click/CopyOnClick.d.ts +9 -0
- package/components/copy-on-click/CopyOnClick.js +62 -0
- package/components/copy-on-click/CopyOnClick.js.map +1 -0
- package/components/copy-on-click/CopyOnClickDocs.d.ts +2 -0
- package/components/copy-on-click/CopyOnClickDocs.js +18 -0
- package/components/copy-on-click/CopyOnClickDocs.js.map +1 -0
- package/components/copy-on-click/index.d.ts +7 -0
- package/components/copy-on-click/index.js +4 -0
- package/components/copy-on-click/index.js.map +1 -0
- package/components/copy-on-click/style/dnb-copy-on-click.css +7 -0
- package/components/copy-on-click/style/dnb-copy-on-click.min.css +1 -0
- package/components/copy-on-click/style/dnb-copy-on-click.scss +10 -0
- package/components/copy-on-click/style/index.d.ts +5 -0
- package/components/copy-on-click/style/index.js +1 -0
- package/components/copy-on-click/style/index.js.map +1 -0
- package/components/copy-on-click/style.d.ts +5 -0
- package/components/copy-on-click/style.js +1 -0
- package/components/copy-on-click/style.js.map +1 -0
- package/components/copy-on-click/types.d.ts +19 -0
- package/components/copy-on-click/types.js +1 -0
- package/components/copy-on-click/types.js.map +1 -0
- package/components/index.d.ts +2 -1
- package/components/index.js +2 -1
- package/components/index.js.map +1 -1
- package/components/lib.d.ts +6 -1
- package/components/lib.js +3 -1
- package/components/lib.js.map +1 -1
- package/components/pagination/Pagination.d.ts +27 -1
- package/components/pagination/Pagination.js +3 -1
- package/components/pagination/Pagination.js.map +1 -1
- package/components/pagination/PaginationInfinity.js +20 -8
- package/components/pagination/PaginationInfinity.js.map +1 -1
- package/es/components/CopyOnClick.d.ts +12 -0
- package/es/components/CopyOnClick.js +4 -0
- package/es/components/CopyOnClick.js.map +1 -0
- package/es/components/copy-on-click/CopyOnClick.d.ts +9 -0
- package/es/components/copy-on-click/CopyOnClick.js +62 -0
- package/es/components/copy-on-click/CopyOnClick.js.map +1 -0
- package/es/components/copy-on-click/CopyOnClickDocs.d.ts +2 -0
- package/es/components/copy-on-click/CopyOnClickDocs.js +18 -0
- package/es/components/copy-on-click/CopyOnClickDocs.js.map +1 -0
- package/es/components/copy-on-click/index.d.ts +7 -0
- package/es/components/copy-on-click/index.js +4 -0
- package/es/components/copy-on-click/index.js.map +1 -0
- package/es/components/copy-on-click/style/dnb-copy-on-click.css +7 -0
- package/es/components/copy-on-click/style/dnb-copy-on-click.min.css +1 -0
- package/es/components/copy-on-click/style/dnb-copy-on-click.scss +10 -0
- package/es/components/copy-on-click/style/index.d.ts +5 -0
- package/es/components/copy-on-click/style/index.js +1 -0
- package/es/components/copy-on-click/style/index.js.map +1 -0
- package/es/components/copy-on-click/style.d.ts +5 -0
- package/es/components/copy-on-click/style.js +1 -0
- package/es/components/copy-on-click/style.js.map +1 -0
- package/es/components/copy-on-click/types.d.ts +19 -0
- package/es/components/copy-on-click/types.js +1 -0
- package/es/components/copy-on-click/types.js.map +1 -0
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/index.js.map +1 -1
- package/es/components/lib.d.ts +6 -1
- package/es/components/lib.js +3 -1
- package/es/components/lib.js.map +1 -1
- package/es/components/pagination/Pagination.d.ts +27 -1
- package/es/components/pagination/Pagination.js +3 -1
- package/es/components/pagination/Pagination.js.map +1 -1
- package/es/components/pagination/PaginationInfinity.js +20 -8
- package/es/components/pagination/PaginationInfinity.js.map +1 -1
- package/es/extensions/forms/DataContext/Context.d.ts +2 -2
- package/es/extensions/forms/DataContext/Context.js.map +1 -1
- package/es/extensions/forms/DataContext/Provider/Provider.d.ts +1 -5
- package/es/extensions/forms/DataContext/Provider/Provider.js +25 -18
- package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/es/extensions/forms/DataContext/Provider/ProviderDocs.js +2 -7
- package/es/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +15 -3
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.js +12 -3
- package/es/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/es/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +10 -0
- package/es/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
- package/es/extensions/forms/Field/Email/Email.js +1 -1
- package/es/extensions/forms/Field/Email/Email.js.map +1 -1
- package/es/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js +23 -4
- package/es/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
- package/es/extensions/forms/Field/Number/Number.d.ts +2 -2
- package/es/extensions/forms/Field/Number/Number.js +33 -31
- package/es/extensions/forms/Field/Number/Number.js.map +1 -1
- package/es/extensions/forms/Field/SelectCountry/SelectCountryDocs.d.ts +3 -1
- package/es/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +8 -1
- package/es/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
- package/es/extensions/forms/Field/Selection/Selection.d.ts +1 -1
- package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/es/extensions/forms/Field/Selection/SelectionDocs.js +6 -1
- package/es/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
- package/es/extensions/forms/Form/Handler/Handler.d.ts +1 -1
- package/es/extensions/forms/Form/Handler/Handler.js +1 -3
- package/es/extensions/forms/Form/Handler/Handler.js.map +1 -1
- package/es/extensions/forms/Form/Isolation/Isolation.d.ts +1 -1
- package/es/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js +0 -1
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/es/extensions/forms/Form/Section/Section.js.map +1 -1
- package/es/extensions/forms/Form/data-context/useData.js +9 -7
- package/es/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/es/extensions/forms/Value/SelectCountry/SelectCountry.d.ts +7 -0
- package/es/extensions/forms/Value/SelectCountry/SelectCountry.js +44 -0
- package/es/extensions/forms/Value/SelectCountry/SelectCountry.js.map +1 -0
- package/es/extensions/forms/Value/SelectCountry/index.d.ts +2 -0
- package/es/extensions/forms/Value/SelectCountry/index.js +3 -0
- package/es/extensions/forms/Value/SelectCountry/index.js.map +1 -0
- package/es/extensions/forms/Value/Selection/SelectionDocs.js +1 -1
- package/es/extensions/forms/Value/Selection/SelectionDocs.js.map +1 -1
- package/es/extensions/forms/Value/index.d.ts +1 -0
- package/es/extensions/forms/Value/index.js +1 -0
- package/es/extensions/forms/Value/index.js.map +1 -1
- package/es/extensions/forms/ValueBlock/ValueBlock.js +4 -3
- package/es/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/es/extensions/forms/ValueBlock/style/dnb-value-block.css +3 -0
- package/es/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
- package/es/extensions/forms/ValueBlock/style/dnb-value-block.scss +3 -0
- package/es/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js +4 -4
- package/es/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js.map +1 -1
- package/es/extensions/forms/constants/locales/en-GB.d.ts +2 -0
- package/es/extensions/forms/constants/locales/en-GB.js +3 -1
- package/es/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/es/extensions/forms/constants/locales/en-US.d.ts +2 -0
- package/es/extensions/forms/constants/locales/index.d.ts +4 -0
- package/es/extensions/forms/constants/locales/nb-NO.d.ts +2 -0
- package/es/extensions/forms/constants/locales/nb-NO.js +3 -1
- package/es/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/es/extensions/forms/hooks/DataValueDocs.js +3 -3
- package/es/extensions/forms/hooks/DataValueDocs.js.map +1 -1
- package/es/extensions/forms/style/dnb-forms.css +3 -0
- package/es/extensions/forms/style/dnb-forms.min.css +1 -1
- package/es/extensions/forms/types.d.ts +5 -2
- package/es/extensions/forms/types.js.map +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/index.js.map +1 -1
- package/es/shared/Context.js +4 -6
- 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/locales/en-GB.d.ts +3 -0
- package/es/shared/locales/en-GB.js +3 -0
- package/es/shared/locales/en-GB.js.map +1 -1
- package/es/shared/locales/en-US.d.ts +3 -0
- package/es/shared/locales/index.d.ts +6 -0
- package/es/shared/locales/nb-NO.d.ts +3 -0
- package/es/shared/locales/nb-NO.js +3 -0
- package/es/shared/locales/nb-NO.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 +11 -0
- package/es/style/dnb-ui-components.min.css +2 -2
- package/es/style/dnb-ui-components.scss +1 -0
- 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 +3 -0
- package/es/style/dnb-ui-extensions.min.css +1 -1
- package/es/style/dnb-ui-forms.css +3 -0
- package/es/style/dnb-ui-forms.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +14 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +2 -2
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +3 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +3 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +14 -0
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +2 -2
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +3 -0
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +3 -0
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +14 -0
- package/es/style/themes/theme-ui/ui-theme-components.min.css +2 -2
- package/es/style/themes/theme-ui/ui-theme-extensions.css +3 -0
- package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-forms.css +3 -0
- 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 +2 -2
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/DataContext/Context.d.ts +2 -2
- package/extensions/forms/DataContext/Context.js.map +1 -1
- package/extensions/forms/DataContext/Provider/Provider.d.ts +1 -5
- package/extensions/forms/DataContext/Provider/Provider.js +26 -19
- package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/extensions/forms/DataContext/Provider/ProviderDocs.js +2 -7
- package/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +15 -3
- package/extensions/forms/Field/ArraySelection/ArraySelection.js +12 -3
- package/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
- package/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +10 -0
- package/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
- package/extensions/forms/Field/Email/Email.js +1 -1
- package/extensions/forms/Field/Email/Email.js.map +1 -1
- package/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js +23 -4
- package/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
- package/extensions/forms/Field/Number/Number.d.ts +2 -2
- package/extensions/forms/Field/Number/Number.js +33 -31
- package/extensions/forms/Field/Number/Number.js.map +1 -1
- package/extensions/forms/Field/SelectCountry/SelectCountryDocs.d.ts +3 -1
- package/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +8 -1
- package/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
- package/extensions/forms/Field/Selection/Selection.d.ts +1 -1
- package/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/extensions/forms/Field/Selection/SelectionDocs.js +6 -1
- package/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
- package/extensions/forms/Form/Handler/Handler.d.ts +1 -1
- package/extensions/forms/Form/Handler/Handler.js +1 -3
- package/extensions/forms/Form/Handler/Handler.js.map +1 -1
- package/extensions/forms/Form/Isolation/Isolation.d.ts +1 -1
- package/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
- package/extensions/forms/Form/Isolation/IsolationDocs.js +0 -1
- package/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/extensions/forms/Form/Section/Section.js.map +1 -1
- package/extensions/forms/Form/data-context/useData.js +9 -7
- package/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/extensions/forms/Value/SelectCountry/SelectCountry.d.ts +7 -0
- package/extensions/forms/Value/SelectCountry/SelectCountry.js +44 -0
- package/extensions/forms/Value/SelectCountry/SelectCountry.js.map +1 -0
- package/extensions/forms/Value/SelectCountry/index.d.ts +2 -0
- package/extensions/forms/Value/SelectCountry/index.js +3 -0
- package/extensions/forms/Value/SelectCountry/index.js.map +1 -0
- package/extensions/forms/Value/Selection/SelectionDocs.js +1 -1
- package/extensions/forms/Value/Selection/SelectionDocs.js.map +1 -1
- package/extensions/forms/Value/index.d.ts +1 -0
- package/extensions/forms/Value/index.js +1 -0
- package/extensions/forms/Value/index.js.map +1 -1
- package/extensions/forms/ValueBlock/ValueBlock.js +4 -3
- package/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/extensions/forms/ValueBlock/style/dnb-value-block.css +3 -0
- package/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
- package/extensions/forms/ValueBlock/style/dnb-value-block.scss +3 -0
- package/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js +4 -4
- package/extensions/forms/blocks/ChildrenWithAge/ChildrenWithAge.js.map +1 -1
- package/extensions/forms/constants/locales/en-GB.d.ts +2 -0
- package/extensions/forms/constants/locales/en-GB.js +3 -1
- package/extensions/forms/constants/locales/en-GB.js.map +1 -1
- package/extensions/forms/constants/locales/en-US.d.ts +2 -0
- package/extensions/forms/constants/locales/index.d.ts +4 -0
- package/extensions/forms/constants/locales/nb-NO.d.ts +2 -0
- package/extensions/forms/constants/locales/nb-NO.js +3 -1
- package/extensions/forms/constants/locales/nb-NO.js.map +1 -1
- package/extensions/forms/hooks/DataValueDocs.js +3 -3
- package/extensions/forms/hooks/DataValueDocs.js.map +1 -1
- package/extensions/forms/style/dnb-forms.css +3 -0
- package/extensions/forms/style/dnb-forms.min.css +1 -1
- package/extensions/forms/types.d.ts +5 -2
- package/extensions/forms/types.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/package.json +2 -1
- package/shared/Context.js +4 -6
- 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/locales/en-GB.d.ts +3 -0
- package/shared/locales/en-GB.js +3 -0
- package/shared/locales/en-GB.js.map +1 -1
- package/shared/locales/en-US.d.ts +3 -0
- package/shared/locales/index.d.ts +6 -0
- package/shared/locales/nb-NO.d.ts +3 -0
- package/shared/locales/nb-NO.js +3 -0
- package/shared/locales/nb-NO.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 +11 -0
- package/style/dnb-ui-components.min.css +2 -2
- package/style/dnb-ui-components.scss +1 -0
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/style/dnb-ui-extensions.css +3 -0
- package/style/dnb-ui-extensions.min.css +1 -1
- package/style/dnb-ui-forms.css +3 -0
- package/style/dnb-ui-forms.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +14 -0
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +2 -2
- package/style/themes/theme-eiendom/eiendom-theme-extensions.css +3 -0
- package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-forms.css +3 -0
- package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +14 -0
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +2 -2
- package/style/themes/theme-sbanken/sbanken-theme-extensions.css +3 -0
- package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-forms.css +3 -0
- package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +14 -0
- package/style/themes/theme-ui/ui-theme-components.min.css +2 -2
- package/style/themes/theme-ui/ui-theme-extensions.css +3 -0
- package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-forms.css +3 -0
- 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 +2 -2
- package/umd/dnb-ui-lib.min.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Handler.js","names":["React","useContext","DataContextProvider","DataContext","FormElement","FormStatus","useId","combineLabelledBy","FormHandler","_ref","children","defaultData","data","schema","ajvInstance","errorMessages","globalStatusId","filterSubmitData","
|
|
1
|
+
{"version":3,"file":"Handler.js","names":["React","useContext","DataContextProvider","DataContext","FormElement","FormStatus","useId","combineLabelledBy","FormHandler","_ref","children","defaultData","data","schema","ajvInstance","errorMessages","globalStatusId","filterSubmitData","transformIn","onChange","onPathChange","onSubmit","onSubmitRequest","onSubmitComplete","onClear","minimumAsyncBehaviorTime","asyncSubmitTimeout","scrollTopOnSubmit","sessionStorageId","autoComplete","locale","translations","disabled","required","rest","_objectWithoutProperties","_excluded","providerProps","id","createElement","FormElementWithState","_ref2","_excluded2","submitState","states","Object","entries","filter","value","_extends","map","key","undefined","state","className","show","Boolean","no_animation","shellSpace","top","bottom","String"],"sources":["../../../../../../src/extensions/forms/Form/Handler/Handler.tsx"],"sourcesContent":["import React, { useContext } from 'react'\nimport { JsonObject } from 'json-pointer'\nimport DataContextProvider, {\n Props as ProviderProps,\n} from '../../DataContext/Provider'\nimport DataContext from '../../DataContext/Context'\nimport FormElement from '../Element'\nimport type { ElementAllProps } from '../../../../elements/Element'\nimport FormStatus from '../../../../components/FormStatus'\nimport useId from '../../../../shared/helpers/useId'\nimport { combineLabelledBy } from '../../../../shared/component-helper'\n\nexport type Props = Omit<\n ElementAllProps,\n 'data' | 'as' | 'autoComplete'\n> & {\n /**\n * Will enable autoComplete for all nested Field.String fields\n */\n autoComplete?: boolean\n}\n\nexport default function FormHandler<Data extends JsonObject>({\n children,\n defaultData,\n data,\n schema,\n ajvInstance,\n errorMessages,\n globalStatusId,\n filterSubmitData,\n transformIn,\n onChange,\n onPathChange,\n onSubmit,\n onSubmitRequest,\n onSubmitComplete,\n onClear,\n minimumAsyncBehaviorTime,\n asyncSubmitTimeout,\n scrollTopOnSubmit,\n sessionStorageId,\n autoComplete,\n locale,\n translations,\n disabled,\n required,\n ...rest\n}: ProviderProps<Data> & Omit<Props, keyof ProviderProps<Data>>) {\n const providerProps = {\n id: rest.id,\n defaultData,\n data,\n schema,\n ajvInstance,\n errorMessages,\n globalStatusId,\n filterSubmitData,\n transformIn,\n onChange,\n onPathChange,\n onSubmit,\n onSubmitRequest,\n onSubmitComplete,\n onClear,\n minimumAsyncBehaviorTime,\n asyncSubmitTimeout,\n scrollTopOnSubmit,\n sessionStorageId,\n autoComplete,\n locale,\n translations,\n disabled,\n required,\n }\n\n return (\n <DataContextProvider {...providerProps}>\n <FormElementWithState {...rest}>{children}</FormElementWithState>\n </DataContextProvider>\n )\n}\n\nfunction FormElementWithState({ children, ...rest }) {\n const id = useId()\n const { submitState } = useContext(DataContext) || {}\n const states = Object.entries(submitState || {}).filter(\n ([, value]) => value\n )\n\n return (\n <FormElement\n {...rest}\n aria-labelledby={\n combineLabelledBy(\n rest,\n states.map(([key]) => {\n return `${id}-form-status-${key}`\n })\n ) || undefined\n }\n >\n {children}\n\n {['error', 'warning', 'info'].map((key) => {\n const value = submitState?.[key]\n return (\n <FormStatus\n key={key}\n state={key}\n id={`${id}-form-status-${key}`}\n className=\"dnb-forms-status\"\n show={Boolean(value)}\n no_animation={false}\n shellSpace={{ top: 'small', bottom: 'medium' }}\n >\n {String(value?.['message'] || value || '')}\n </FormStatus>\n )\n })}\n </FormElement>\n )\n}\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,OAAOC,mBAAmB,MAEnB,4BAA4B;AACnC,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,WAAW,MAAM,YAAY;AAEpC,OAAOC,UAAU,MAAM,mCAAmC;AAC1D,OAAOC,KAAK,MAAM,kCAAkC;AACpD,SAASC,iBAAiB,QAAQ,qCAAqC;AAYvE,eAAe,SAASC,WAAWA,CAAAC,IAAA,EA0B8B;EAAA,IA1BJ;MAC3DC,QAAQ;MACRC,WAAW;MACXC,IAAI;MACJC,MAAM;MACNC,WAAW;MACXC,aAAa;MACbC,cAAc;MACdC,gBAAgB;MAChBC,WAAW;MACXC,QAAQ;MACRC,YAAY;MACZC,QAAQ;MACRC,eAAe;MACfC,gBAAgB;MAChBC,OAAO;MACPC,wBAAwB;MACxBC,kBAAkB;MAClBC,iBAAiB;MACjBC,gBAAgB;MAChBC,YAAY;MACZC,MAAM;MACNC,YAAY;MACZC,QAAQ;MACRC;IAE4D,CAAC,GAAAxB,IAAA;IAD1DyB,IAAI,GAAAC,wBAAA,CAAA1B,IAAA,EAAA2B,SAAA;EAEP,MAAMC,aAAa,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AM,CAAC,CAACwC,GAAG,CAAEC,GAAG,IAAK;IACzC,MAAMH,KAAK,GAAGL,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAGQ,GAAG,CAAC;IAChC,OACEnD,KAAA,CAAAuC,aAAA,CAAClC,UAAU;MACT8C,GAAG,EAAEA,GAAI;MACTE,KAAK,EAAEF,GAAI;MACXb,EAAE,EAAG,GAAEA,EAAG,gBAAea,GAAI,EAAE;MAC/BG,SAAS,EAAC,kBAAkB;MAC5BC,IAAI,EAAEC,OAAO,CAACR,KAAK,CAAE;MACrBS,YAAY,EAAE,KAAM;MACpBC,UAAU,EAAE;QAAEC,GAAG,EAAE,OAAO;QAAEC,MAAM,EAAE;MAAS;IAAE,GAE9CC,MAAM,CAAC,CAAAb,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAG,SAAS,CAAC,KAAIA,KAAK,IAAI,EAAE,CAC/B,CAAC;EAEjB,CAAC,CACU,CAAC;AAElB"}
|
|
@@ -27,7 +27,7 @@ export type IsolationProviderProps<Data> = {
|
|
|
27
27
|
*/
|
|
28
28
|
isolate?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export type IsolationProps<Data> = Omit<ProviderProps<Data>, 'onSubmit' | 'onSubmitRequest' | 'onSubmitComplete' | 'minimumAsyncBehaviorTime' | 'asyncSubmitTimeout' | 'scrollTopOnSubmit' | 'sessionStorageId' | '
|
|
30
|
+
export type IsolationProps<Data> = Omit<ProviderProps<Data>, 'onSubmit' | 'onSubmitRequest' | 'onSubmitComplete' | 'minimumAsyncBehaviorTime' | 'asyncSubmitTimeout' | 'scrollTopOnSubmit' | 'sessionStorageId' | 'globalStatusId'> & {
|
|
31
31
|
/**
|
|
32
32
|
* A ref (function) that you can call in order to commit the data programmatically to the outer context.
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Isolation.js","names":["React","useCallback","useContext","useEffect","useMemo","useReducer","useRef","pointer","extendDeep","useDataValue","Context","Provider","SectionContext","IsolationCommitButton","clearedData","structuredClone","IsolationProvider","props","children","onPathChange","onCommit","onCommitProp","onClear","onClearProp","transformOnCommit","transformOnCommitProp","commitHandleRef","data","defaultData","forceUpdate","internalDataRef","localDataRef","dataContextRef","outerContext","path","pathSection","handlePathChange","handlePathChangeOuter","dataOuter","moveValueToPath","onPathChangeHandler","value","current","set","replace","removeSectionPath","has","get","getMountedData","_dataContextRef$curre","mounterData","mountedFieldPathsRef","forEach","localData","Object","assign","additionalArgs","_props$path","mountedData","outerData","isolatedData","providerProps","_objectSpread","undefined","isolate","createElement","Consumer","dataContext","handleSubmit","CommitButton","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Form/Isolation/Isolation.tsx"],"sourcesContent":["import React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport pointer, { JsonObject } from 'json-pointer'\nimport { extendDeep } from '../../../../shared/component-helper'\nimport useDataValue from '../../hooks/useDataValue'\nimport { Context, ContextState, Provider } from '../../DataContext'\nimport SectionContext from '../Section/SectionContext'\nimport IsolationCommitButton from './IsolationCommitButton'\nimport {\n clearedData,\n type Props as ProviderProps,\n} from '../../DataContext/Provider'\nimport type { OnCommit, Path } from '../../types'\n\n/**\n * Deprecated, as it is supported by all major browsers and Node.js >=v18\n * So its a question of time, when we will remove this polyfill\n */\nimport structuredClone from '@ungap/structured-clone'\n\nexport type IsolationProviderProps<Data> = {\n /**\n * Form.Isolation: Will be called when the isolated context is committed.\n */\n onCommit?: OnCommit<Data>\n /**\n * Form.Isolation: Will be called when the form is cleared via Form.clearData\n */\n onClear?: () => void\n /**\n * Form.Isolation: A function that will be called when the isolated context is committed.\n * It will receive the data from the isolated context and the data from the outer context.\n * You can use this to transform the data before it is committed.\n */\n transformOnCommit?: (isolatedData: Data, handlerData: Data) => Data\n /**\n * Used internally by the Form.Isolation component\n */\n path?: Path\n /**\n * Used internally by the Form.Isolation component\n */\n isolate?: boolean\n}\n\nexport type IsolationProps<Data> = Omit<\n ProviderProps<Data>,\n | 'onSubmit'\n | 'onSubmitRequest'\n | 'onSubmitComplete'\n | 'minimumAsyncBehaviorTime'\n | 'asyncSubmitTimeout'\n | 'scrollTopOnSubmit'\n | 'sessionStorageId'\n | 'filterSubmitData'\n | 'globalStatusId'\n> & {\n /**\n * A ref (function) that you can call in order to commit the data programmatically to the outer context.\n */\n commitHandleRef?: React.MutableRefObject<() => void>\n}\n\nfunction IsolationProvider<Data extends JsonObject>(\n props: IsolationProps<Data>\n) {\n const {\n children,\n onPathChange,\n onCommit: onCommitProp,\n onClear: onClearProp,\n transformOnCommit: transformOnCommitProp,\n commitHandleRef,\n data,\n defaultData,\n } = props\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const internalDataRef = useRef<Data>()\n const localDataRef = useRef<Partial<Data>>({})\n const dataContextRef = useRef<ContextState>(null)\n const outerContext = useContext(Context)\n const { path: pathSection } = useContext(SectionContext) || {}\n const { handlePathChange: handlePathChangeOuter, data: dataOuter } =\n outerContext || {}\n const { moveValueToPath } = useDataValue()\n\n const onPathChangeHandler = useCallback(\n async (path: Path, value: unknown) => {\n if (localDataRef.current === clearedData) {\n localDataRef.current = {}\n }\n\n pointer.set(localDataRef.current, path, value)\n\n if (pathSection) {\n path = path.replace(pathSection, '')\n }\n\n return await onPathChange?.(path, value)\n },\n [onPathChange, pathSection]\n )\n\n const removeSectionPath = useCallback(\n (data: Data) => {\n return pathSection && pointer.has(data, pathSection)\n ? pointer.get(data, pathSection)\n : data\n },\n [pathSection]\n )\n\n const getMountedData = useCallback((data: Data) => {\n const mounterData = {} as Data\n dataContextRef.current?.mountedFieldPathsRef.current.forEach(\n (path) => {\n if (pointer.has(data, path)) {\n pointer.set(mounterData, path, pointer.get(data, path))\n }\n }\n )\n return mounterData\n }, [])\n\n useEffect(() => {\n localDataRef.current = getMountedData(internalDataRef.current)\n }, [getMountedData])\n\n // Update the isolated data with the outside context data\n useMemo(() => {\n if (localDataRef.current === clearedData) {\n return // stop here\n }\n\n let localData = data ?? defaultData\n\n if (\n localData &&\n pathSection &&\n !pointer.has(localDataRef.current, pathSection)\n ) {\n localData = moveValueToPath<Data>(pathSection, localData)\n }\n\n internalDataRef.current = Object.assign(\n {},\n localData || dataOuter || {},\n localDataRef.current\n )\n }, [data, defaultData, pathSection, dataOuter, moveValueToPath])\n\n const onCommit: IsolationProps<Data>['onCommit'] = useCallback(\n async (data: Data, additionalArgs) => {\n const mountedData = getMountedData(data)\n const path = props.path ?? '/'\n const outerData =\n props.path && pointer.has(dataOuter, path)\n ? pointer.get(dataOuter, path)\n : dataOuter\n\n localDataRef.current = mountedData\n let isolatedData = structuredClone(mountedData) as Data\n\n if (typeof transformOnCommitProp === 'function') {\n isolatedData = transformOnCommitProp(isolatedData, outerData)\n }\n\n // Commit the internal data to the nested context data\n handlePathChangeOuter?.(\n path,\n extendDeep({}, outerData, isolatedData)\n )\n\n return await onCommitProp?.(\n removeSectionPath(isolatedData),\n additionalArgs\n )\n },\n [\n getMountedData,\n props.path,\n dataOuter,\n transformOnCommitProp,\n handlePathChangeOuter,\n onCommitProp,\n removeSectionPath,\n ]\n )\n\n const onClear = useCallback(() => {\n localDataRef.current = clearedData\n internalDataRef.current = clearedData as Data\n forceUpdate()\n onClearProp?.()\n }, [onClearProp])\n\n const providerProps: IsolationProps<Data> = {\n ...props,\n data: internalDataRef.current,\n defaultData: undefined,\n onPathChange: onPathChangeHandler,\n onCommit,\n onClear,\n isolate: true,\n }\n\n return (\n <Provider {...providerProps}>\n <Context.Consumer>\n {(dataContext) => {\n dataContextRef.current = dataContext\n\n if (commitHandleRef) {\n commitHandleRef.current = dataContext?.handleSubmit\n }\n\n return children\n }}\n </Context.Consumer>\n </Provider>\n )\n}\n\nIsolationProvider.CommitButton = IsolationCommitButton\nIsolationProvider._supportsSpacingProps = undefined\n\nexport default IsolationProvider\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,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D,QAAQ;EACjB,CACgB,CACV,CAAC;AAEf;AAEAF,iBAAiB,CAACqD,YAAY,GAAGxD,qBAAqB;AACtDG,iBAAiB,CAACsD,qBAAqB,GAAGP,SAAS;AAEnD,eAAe/C,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"Isolation.js","names":["React","useCallback","useContext","useEffect","useMemo","useReducer","useRef","pointer","extendDeep","useDataValue","Context","Provider","SectionContext","IsolationCommitButton","clearedData","structuredClone","IsolationProvider","props","children","onPathChange","onCommit","onCommitProp","onClear","onClearProp","transformOnCommit","transformOnCommitProp","commitHandleRef","data","defaultData","forceUpdate","internalDataRef","localDataRef","dataContextRef","outerContext","path","pathSection","handlePathChange","handlePathChangeOuter","dataOuter","moveValueToPath","onPathChangeHandler","value","current","set","replace","removeSectionPath","has","get","getMountedData","_dataContextRef$curre","mounterData","mountedFieldPathsRef","forEach","localData","Object","assign","additionalArgs","_props$path","mountedData","outerData","isolatedData","providerProps","_objectSpread","undefined","isolate","createElement","Consumer","dataContext","handleSubmit","CommitButton","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Form/Isolation/Isolation.tsx"],"sourcesContent":["import React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport pointer, { JsonObject } from 'json-pointer'\nimport { extendDeep } from '../../../../shared/component-helper'\nimport useDataValue from '../../hooks/useDataValue'\nimport { Context, ContextState, Provider } from '../../DataContext'\nimport SectionContext from '../Section/SectionContext'\nimport IsolationCommitButton from './IsolationCommitButton'\nimport {\n clearedData,\n type Props as ProviderProps,\n} from '../../DataContext/Provider'\nimport type { OnCommit, Path } from '../../types'\n\n/**\n * Deprecated, as it is supported by all major browsers and Node.js >=v18\n * So its a question of time, when we will remove this polyfill\n */\nimport structuredClone from '@ungap/structured-clone'\n\nexport type IsolationProviderProps<Data> = {\n /**\n * Form.Isolation: Will be called when the isolated context is committed.\n */\n onCommit?: OnCommit<Data>\n /**\n * Form.Isolation: Will be called when the form is cleared via Form.clearData\n */\n onClear?: () => void\n /**\n * Form.Isolation: A function that will be called when the isolated context is committed.\n * It will receive the data from the isolated context and the data from the outer context.\n * You can use this to transform the data before it is committed.\n */\n transformOnCommit?: (isolatedData: Data, handlerData: Data) => Data\n /**\n * Used internally by the Form.Isolation component\n */\n path?: Path\n /**\n * Used internally by the Form.Isolation component\n */\n isolate?: boolean\n}\n\nexport type IsolationProps<Data> = Omit<\n ProviderProps<Data>,\n | 'onSubmit'\n | 'onSubmitRequest'\n | 'onSubmitComplete'\n | 'minimumAsyncBehaviorTime'\n | 'asyncSubmitTimeout'\n | 'scrollTopOnSubmit'\n | 'sessionStorageId'\n | 'globalStatusId'\n> & {\n /**\n * A ref (function) that you can call in order to commit the data programmatically to the outer context.\n */\n commitHandleRef?: React.MutableRefObject<() => void>\n}\n\nfunction IsolationProvider<Data extends JsonObject>(\n props: IsolationProps<Data>\n) {\n const {\n children,\n onPathChange,\n onCommit: onCommitProp,\n onClear: onClearProp,\n transformOnCommit: transformOnCommitProp,\n commitHandleRef,\n data,\n defaultData,\n } = props\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const internalDataRef = useRef<Data>()\n const localDataRef = useRef<Partial<Data>>({})\n const dataContextRef = useRef<ContextState>(null)\n const outerContext = useContext(Context)\n const { path: pathSection } = useContext(SectionContext) || {}\n const { handlePathChange: handlePathChangeOuter, data: dataOuter } =\n outerContext || {}\n const { moveValueToPath } = useDataValue()\n\n const onPathChangeHandler = useCallback(\n async (path: Path, value: unknown) => {\n if (localDataRef.current === clearedData) {\n localDataRef.current = {}\n }\n\n pointer.set(localDataRef.current, path, value)\n\n if (pathSection) {\n path = path.replace(pathSection, '')\n }\n\n return await onPathChange?.(path, value)\n },\n [onPathChange, pathSection]\n )\n\n const removeSectionPath = useCallback(\n (data: Data) => {\n return pathSection && pointer.has(data, pathSection)\n ? pointer.get(data, pathSection)\n : data\n },\n [pathSection]\n )\n\n const getMountedData = useCallback((data: Data) => {\n const mounterData = {} as Data\n dataContextRef.current?.mountedFieldPathsRef.current.forEach(\n (path) => {\n if (pointer.has(data, path)) {\n pointer.set(mounterData, path, pointer.get(data, path))\n }\n }\n )\n return mounterData\n }, [])\n\n useEffect(() => {\n localDataRef.current = getMountedData(internalDataRef.current)\n }, [getMountedData])\n\n // Update the isolated data with the outside context data\n useMemo(() => {\n if (localDataRef.current === clearedData) {\n return // stop here\n }\n\n let localData = data ?? defaultData\n\n if (\n localData &&\n pathSection &&\n !pointer.has(localDataRef.current, pathSection)\n ) {\n localData = moveValueToPath<Data>(pathSection, localData)\n }\n\n internalDataRef.current = Object.assign(\n {},\n localData || dataOuter || {},\n localDataRef.current\n )\n }, [data, defaultData, pathSection, dataOuter, moveValueToPath])\n\n const onCommit: IsolationProps<Data>['onCommit'] = useCallback(\n async (data: Data, additionalArgs) => {\n const mountedData = getMountedData(data)\n const path = props.path ?? '/'\n const outerData =\n props.path && pointer.has(dataOuter, path)\n ? pointer.get(dataOuter, path)\n : dataOuter\n\n localDataRef.current = mountedData\n let isolatedData = structuredClone(mountedData) as Data\n\n if (typeof transformOnCommitProp === 'function') {\n isolatedData = transformOnCommitProp(isolatedData, outerData)\n }\n\n // Commit the internal data to the nested context data\n handlePathChangeOuter?.(\n path,\n extendDeep({}, outerData, isolatedData)\n )\n\n return await onCommitProp?.(\n removeSectionPath(isolatedData),\n additionalArgs\n )\n },\n [\n getMountedData,\n props.path,\n dataOuter,\n transformOnCommitProp,\n handlePathChangeOuter,\n onCommitProp,\n removeSectionPath,\n ]\n )\n\n const onClear = useCallback(() => {\n localDataRef.current = clearedData\n internalDataRef.current = clearedData as Data\n forceUpdate()\n onClearProp?.()\n }, [onClearProp])\n\n const providerProps: IsolationProps<Data> = {\n ...props,\n data: internalDataRef.current,\n defaultData: undefined,\n onPathChange: onPathChangeHandler,\n onCommit,\n onClear,\n isolate: true,\n }\n\n return (\n <Provider {...providerProps}>\n <Context.Consumer>\n {(dataContext) => {\n dataContextRef.current = dataContext\n\n if (commitHandleRef) {\n commitHandleRef.current = dataContext?.handleSubmit\n }\n\n return children\n }}\n </Context.Consumer>\n </Provider>\n )\n}\n\nIsolationProvider.CommitButton = IsolationCommitButton\nIsolationProvider._supportsSpacingProps = undefined\n\nexport default IsolationProvider\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,MAAM,QACD,OAAO;AACd,OAAOC,OAAO,MAAsB,cAAc;AAClD,SAASC,UAAU,QAAQ,qCAAqC;AAChE,OAAOC,YAAY,MAAM,0BAA0B;AACnD,SAASC,OAAO,EAAgBC,QAAQ,QAAQ,mBAAmB;AACnE,OAAOC,cAAc,MAAM,2BAA2B;AACtD,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,SACEC,WAAW,QAEN,4BAA4B;AAOnC,OAAOC,eAAe,MAAM,yBAAyB;AA4CrD,SAASC,iBAAiBA,CACxBC,KAA2B,EAC3B;EACA,MAAM;IACJC,QAAQ;IACRC,YAAY;IACZC,QAAQ,EAAEC,YAAY;IACtBC,OAAO,EAAEC,WAAW;IACpBC,iBAAiB,EAAEC,qBAAqB;IACxCC,eAAe;IACfC,IAAI;IACJC;EACF,CAAC,GAAGX,KAAK;EAET,MAAM,GAAGY,WAAW,CAAC,GAAGxB,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAClD,MAAMyB,eAAe,GAAGxB,MAAM,CAAO,CAAC;EACtC,MAAMyB,YAAY,GAAGzB,MAAM,CAAgB,CAAC,CAAC,CAAC;EAC9C,MAAM0B,cAAc,GAAG1B,MAAM,CAAe,IAAI,CAAC;EACjD,MAAM2B,YAAY,GAAG/B,UAAU,CAACQ,OAAO,CAAC;EACxC,MAAM;IAAEwB,IAAI,EAAEC;EAAY,CAAC,GAAGjC,UAAU,CAACU,cAAc,CAAC,IAAI,CAAC,CAAC;EAC9D,MAAM;IAAEwB,gBAAgB,EAAEC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EACzB7D,KAAA,CAAAiE,aAAA,CAACvD,OAAO,CAACwD,QAAQ,QACbC,WAAW,IAAK;IAChBnC,cAAc,CAACU,OAAO,GAAGyB,WAAW;IAEpC,IAAIzC,eAAe,EAAE;MACnBA,eAAe,CAACgB,OAAO,GAAGyB,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEC,YAAY;IACrD;IAEA,OAAOlD,QAAQ;EACjB,CACgB,CACV,CAAC;AAEf;AAEAF,iBAAiB,CAACqD,YAAY,GAAGxD,qBAAqB;AACtDG,iBAAiB,CAACsD,qBAAqB,GAAGP,SAAS;AAEnD,eAAe/C,iBAAiB"}
|
|
@@ -23,7 +23,6 @@ export const IsolationProperties = _objectSpread(_objectSpread({
|
|
|
23
23
|
asyncSubmitTimeout: undefined,
|
|
24
24
|
scrollTopOnSubmit: undefined,
|
|
25
25
|
sessionStorageId: undefined,
|
|
26
|
-
filterSubmitData: undefined,
|
|
27
26
|
globalStatusId: undefined
|
|
28
27
|
});
|
|
29
28
|
export const IsolationEvents = _objectSpread(_objectSpread({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsolationDocs.js","names":["ProviderEvents","ProviderProperties","IsolationProperties","_objectSpread","path","doc","type","status","transformOnCommit","commitHandleRef","minimumAsyncBehaviorTime","undefined","asyncSubmitTimeout","scrollTopOnSubmit","sessionStorageId","
|
|
1
|
+
{"version":3,"file":"IsolationDocs.js","names":["ProviderEvents","ProviderProperties","IsolationProperties","_objectSpread","path","doc","type","status","transformOnCommit","commitHandleRef","minimumAsyncBehaviorTime","undefined","asyncSubmitTimeout","scrollTopOnSubmit","sessionStorageId","globalStatusId","IsolationEvents","onCommit","onSubmit","onSubmitRequest","onSubmitComplete"],"sources":["../../../../../../src/extensions/forms/Form/Isolation/IsolationDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../../shared/types'\nimport {\n ProviderEvents,\n ProviderProperties,\n} from '../../DataContext/Provider/ProviderDocs'\n\nexport const IsolationProperties: PropertiesTableProps = {\n path: {\n doc: 'JSON Pointer to define the object key for all the generated nested field data.',\n type: 'string',\n status: 'optional',\n },\n transformOnCommit: {\n doc: 'Transform the data before it gets committed to the form. The first parameter is the isolated data object. The second parameter is the outer context data object (Form.Handler).',\n type: 'function',\n status: 'optional',\n },\n commitHandleRef: {\n doc: 'Provide a ref to a function that can be called from any location to commit the data to the form.',\n type: 'React.Ref',\n status: 'optional',\n },\n ...ProviderProperties,\n minimumAsyncBehaviorTime: undefined,\n asyncSubmitTimeout: undefined,\n scrollTopOnSubmit: undefined,\n sessionStorageId: undefined,\n globalStatusId: undefined,\n}\n\nexport const IsolationEvents: PropertiesTableProps = {\n onCommit: {\n doc: 'Will be called on a nested form context commit – if validation has passed. The first parameter is the committed data object. The second parameter is an object containing a method to clear the internal data `{ clearData }`.',\n type: 'function',\n status: 'optional',\n },\n ...ProviderEvents,\n onSubmit: undefined,\n onSubmitRequest: undefined,\n onSubmitComplete: undefined,\n}\n"],"mappings":";;;AACA,SACEA,cAAc,EACdC,kBAAkB,QACb,yCAAyC;AAEhD,OAAO,MAAMC,mBAAyC,GAAAC,aAAA,CAAAA,aAAA;EACpDC,IAAI,EAAE;IACJC,GAAG,EAAE,gFAAgF;IACrFC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,iBAAiB,EAAE;IACjBH,GAAG,EAAE,iLAAiL;IACtLC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDE,eAAe,EAAE;IACfJ,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,WAAW;IACjBC,MAAM,EAAE;EACV;AAAC,GACEN,kBAAkB;EACrBS,wBAAwB,EAAEC,SAAS;EACnCC,kBAAkB,EAAED,SAAS;EAC7BE,iBAAiB,EAAEF,SAAS;EAC5BG,gBAAgB,EAAEH,SAAS;EAC3BI,cAAc,EAAEJ;AAAS,EAC1B;AAED,OAAO,MAAMK,eAAqC,GAAAb,aAAA,CAAAA,aAAA;EAChDc,QAAQ,EAAE;IACRZ,GAAG,EAAE,gOAAgO;IACrOC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AAAC,GACEP,cAAc;EACjBkB,QAAQ,EAAEP,SAAS;EACnBQ,eAAe,EAAER,SAAS;EAC1BS,gBAAgB,EAAET;AAAS,EAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","names":["React","useCallback","useContext","useMemo","SectionContext","DataContext","Provider","FieldPropsProvider","SectionContainerProvider","ViewContainer","EditContainer","SectionComponent","props","_path$startsWith","_nestedProps$overwrit","path","overwriteProps","translations","required","data","defaultData","containerMode","onChange","errorPrioritization","children","startsWith","call","Error","hasContext","addOnChangeHandler","nestedPath","nestedProps","handleChange","args","identifier","fieldProps","undefined","createElement","value","_extends","_objectSpread","substring","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Form/Section/Section.tsx"],"sourcesContent":["import React, { useCallback, useContext, useMemo } from 'react'\nimport SectionContext, { SectionContextState } from './SectionContext'\nimport DataContext from '../../DataContext/Context'\nimport Provider from '../../DataContext/Provider/Provider'\nimport FieldPropsProvider from '../FieldProps'\nimport SectionContainerProvider from './containers/SectionContainerProvider'\nimport ViewContainer from './ViewContainer'\nimport EditContainer from './EditContainer'\n\nimport type { Props as DataContextProps } from '../../DataContext/Provider'\nimport type { ContainerMode } from './containers/SectionContainer'\nimport type {\n FieldBlockProps,\n Path,\n FieldProps,\n OnChange,\n} from '../../types'\n\nexport type OverwritePropsDefaults = {\n [key: Path]: (FieldProps & FieldBlockProps) | OverwritePropsDefaults\n}\nexport type SectionProps<overwriteProps = OverwritePropsDefaults> = {\n /**\n * Path to the section.\n * When defined, fields inside the section will get this path as a prefix of their own path.\n */\n path?: Path\n\n /**\n * Overwrite field props for the section.\n */\n overwriteProps?: overwriteProps | OverwritePropsDefaults\n\n /**\n * Makes all fields inside it required.\n */\n required?: boolean\n\n /**\n * Defines the container mode. Can be `view` or `edit`.\n * Defaults to `view`.\n */\n containerMode?: ContainerMode\n\n /**\n * Only for internal use and undocumented for now.\n * Prioritize error techniques for the section.\n * Can be `fieldSchema`, `sectionSchema` or `contextSchema.\n */\n errorPrioritization?: SectionContextState['errorPrioritization']\n} & Pick<\n DataContextProps<unknown>,\n 'data' | 'defaultData' | 'onChange' | 'translations'\n>\n\nexport type LocalProps = SectionProps & {\n children: React.ReactNode\n}\n\nfunction SectionComponent(props: LocalProps) {\n const {\n path,\n overwriteProps,\n translations,\n required,\n data,\n defaultData,\n containerMode = 'view',\n onChange,\n errorPrioritization = ['contextSchema'],\n children,\n } = props\n\n if (path && !path.startsWith?.('/')) {\n throw new Error(`path=\"${path}\" must start with a slash`)\n }\n\n const { hasContext, addOnChangeHandler } = useContext(DataContext)\n\n const { path: nestedPath, props: nestedProps } =\n useContext(SectionContext) || {}\n\n const handleChange = useCallback<OnChange
|
|
1
|
+
{"version":3,"file":"Section.js","names":["React","useCallback","useContext","useMemo","SectionContext","DataContext","Provider","FieldPropsProvider","SectionContainerProvider","ViewContainer","EditContainer","SectionComponent","props","_path$startsWith","_nestedProps$overwrit","path","overwriteProps","translations","required","data","defaultData","containerMode","onChange","errorPrioritization","children","startsWith","call","Error","hasContext","addOnChangeHandler","nestedPath","nestedProps","handleChange","args","identifier","fieldProps","undefined","createElement","value","_extends","_objectSpread","substring","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Form/Section/Section.tsx"],"sourcesContent":["import React, { useCallback, useContext, useMemo } from 'react'\nimport SectionContext, { SectionContextState } from './SectionContext'\nimport DataContext from '../../DataContext/Context'\nimport Provider from '../../DataContext/Provider/Provider'\nimport FieldPropsProvider from '../FieldProps'\nimport SectionContainerProvider from './containers/SectionContainerProvider'\nimport ViewContainer from './ViewContainer'\nimport EditContainer from './EditContainer'\n\nimport type { Props as DataContextProps } from '../../DataContext/Provider'\nimport type { ContainerMode } from './containers/SectionContainer'\nimport type {\n FieldBlockProps,\n Path,\n FieldProps,\n OnChange,\n} from '../../types'\n\nexport type OverwritePropsDefaults = {\n [key: Path]: (FieldProps & FieldBlockProps) | OverwritePropsDefaults\n}\nexport type SectionProps<overwriteProps = OverwritePropsDefaults> = {\n /**\n * Path to the section.\n * When defined, fields inside the section will get this path as a prefix of their own path.\n */\n path?: Path\n\n /**\n * Overwrite field props for the section.\n */\n overwriteProps?: overwriteProps | OverwritePropsDefaults\n\n /**\n * Makes all fields inside it required.\n */\n required?: boolean\n\n /**\n * Defines the container mode. Can be `view` or `edit`.\n * Defaults to `view`.\n */\n containerMode?: ContainerMode\n\n /**\n * Only for internal use and undocumented for now.\n * Prioritize error techniques for the section.\n * Can be `fieldSchema`, `sectionSchema` or `contextSchema.\n */\n errorPrioritization?: SectionContextState['errorPrioritization']\n} & Pick<\n DataContextProps<unknown>,\n 'data' | 'defaultData' | 'onChange' | 'translations'\n>\n\nexport type LocalProps = SectionProps & {\n children: React.ReactNode\n}\n\nfunction SectionComponent(props: LocalProps) {\n const {\n path,\n overwriteProps,\n translations,\n required,\n data,\n defaultData,\n containerMode = 'view',\n onChange,\n errorPrioritization = ['contextSchema'],\n children,\n } = props\n\n if (path && !path.startsWith?.('/')) {\n throw new Error(`path=\"${path}\" must start with a slash`)\n }\n\n const { hasContext, addOnChangeHandler } = useContext(DataContext)\n\n const { path: nestedPath, props: nestedProps } =\n useContext(SectionContext) || {}\n\n const handleChange = useCallback<OnChange>(\n (...args) => onChange?.(...args),\n [onChange]\n )\n addOnChangeHandler?.(handleChange)\n\n const identifier = useMemo(() => {\n return `${nestedPath && nestedPath !== '/' ? nestedPath : ''}${\n path || ''\n }`\n }, [path, nestedPath])\n const fieldProps = required ? { required: true } : undefined\n\n if (!hasContext) {\n return (\n <Provider data={data} defaultData={defaultData}>\n <SectionComponent {...props} />\n </Provider>\n )\n }\n\n return (\n <SectionContext.Provider\n value={{\n path: identifier,\n errorPrioritization,\n props,\n }}\n >\n <SectionContainerProvider containerMode={containerMode}>\n <FieldPropsProvider\n overwriteProps={{\n ...overwriteProps,\n ...(nestedProps?.overwriteProps?.[\n path.substring(1)\n ] as OverwritePropsDefaults),\n }}\n translations={translations}\n {...fieldProps}\n >\n {children}\n </FieldPropsProvider>\n </SectionContainerProvider>\n </SectionContext.Provider>\n )\n}\n\nSectionComponent.ViewContainer = ViewContainer\nSectionComponent.EditContainer = EditContainer\n\nSectionComponent._supportsSpacingProps = undefined\nexport default SectionComponent\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC/D,OAAOC,cAAc,MAA+B,kBAAkB;AACtE,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,QAAQ,MAAM,qCAAqC;AAC1D,OAAOC,kBAAkB,MAAM,eAAe;AAC9C,OAAOC,wBAAwB,MAAM,uCAAuC;AAC5E,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,aAAa,MAAM,iBAAiB;AAoD3C,SAASC,gBAAgBA,CAACC,KAAiB,EAAE;EAAA,IAAAC,gBAAA,EAAAC,qBAAA;EAC3C,MAAM;IACJC,IAAI;IACJC,cAAc;IACdC,YAAY;IACZC,QAAQ;IACRC,IAAI;IACJC,WAAW;IACXC,aAAa,GAAG,MAAM;IACtBC,QAAQ;IACRC,mBAAmB,GAAG,CAAC,eAAe,CAAC;IACvCC;EACF,CAAC,GAAGZ,KAAK;EAET,IAAIG,IAAI,IAAI,GAAAF,gBAAA,GAACE,IAAI,CAACU,UAAU,cAAAZ,gBAAA,eAAfA,gBAAA,CAAAa,IAAA,CAAAX,IAAI,EAAc,GAAG,CAAC,GAAE;IACnC,MAAM,IAAIY,KAAK,CAAE,SAAQZ,IAAK,2BAA0B,CAAC;EAC3D;EAEA,MAAM;IAAEa,UAAU;IAAEC;EAAmB,CAAC,GAAG3B,UAAU,CAACG,WAAW,CAAC;EAElE,MAAM;IAAEU,IAAI,EAAEe,UAAU;IAAElB,KAAK,EAAEmB;EAAY,CAAC,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AC0B,SAAS,CAAC,CAAC,CAAC,CAClB,CACD;IACFxB,YAAY,EAAEA;EAAa,GACvBkB,UAAU,GAEbX,QACiB,CACI,CACH,CAAC;AAE9B;AAEAb,gBAAgB,CAACF,aAAa,GAAGA,aAAa;AAC9CE,gBAAgB,CAACD,aAAa,GAAGA,aAAa;AAE9CC,gBAAgB,CAAC+B,qBAAqB,GAAGN,SAAS;AAClD,eAAezB,gBAAgB"}
|
|
@@ -10,19 +10,21 @@ export default function useData(id = undefined, initialData = undefined) {
|
|
|
10
10
|
const sharedAttachmentsRef = useRef(null);
|
|
11
11
|
const [, forceUpdate] = useReducer(() => ({}), {});
|
|
12
12
|
sharedDataRef.current = useSharedState(id, initialData, forceUpdate);
|
|
13
|
+
sharedAttachmentsRef.current = useSharedState(id + '-attachments', {
|
|
14
|
+
rerenderUseDataHook: forceUpdate
|
|
15
|
+
});
|
|
13
16
|
const context = useContext(DataContext);
|
|
14
17
|
if (!id) {
|
|
15
|
-
if (context !== null && context !== void 0 && context.
|
|
16
|
-
sharedDataRef.current.data = context.data;
|
|
17
|
-
} else if (!(context !== null && context !== void 0 && context.hasContext)) {
|
|
18
|
+
if (!(context !== null && context !== void 0 && context.hasContext)) {
|
|
18
19
|
throw new Error('useData needs to run inside DataContext (Form.Handler) or have a valid id');
|
|
19
20
|
}
|
|
21
|
+
if (context) {
|
|
22
|
+
sharedDataRef.current.data = context.data;
|
|
23
|
+
sharedAttachmentsRef.current.data.filterDataHandler = context.filterDataHandler;
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
const updateDataValue = context === null || context === void 0 ? void 0 : context.updateDataValue;
|
|
22
27
|
const setData = context === null || context === void 0 ? void 0 : context.setData;
|
|
23
|
-
sharedAttachmentsRef.current = useSharedState(id + '-attachments', {
|
|
24
|
-
rerenderUseDataHook: forceUpdate
|
|
25
|
-
});
|
|
26
28
|
const setHandler = useCallback(newData => {
|
|
27
29
|
if (id) {
|
|
28
30
|
sharedDataRef.current.update(newData);
|
|
@@ -70,6 +72,6 @@ export default function useData(id = undefined, initialData = undefined) {
|
|
|
70
72
|
set: setHandler,
|
|
71
73
|
getValue,
|
|
72
74
|
filterData
|
|
73
|
-
}), [data,
|
|
75
|
+
}), [data, getValue, setHandler, updateHandler, filterData]);
|
|
74
76
|
}
|
|
75
77
|
//# sourceMappingURL=useData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useData.js","names":["useCallback","useContext","useMemo","useReducer","useRef","pointer","useSharedState","useMountEffect","DataContext","useData","id","undefined","initialData","sharedDataRef","sharedAttachmentsRef","forceUpdate","current","
|
|
1
|
+
{"version":3,"file":"useData.js","names":["useCallback","useContext","useMemo","useReducer","useRef","pointer","useSharedState","useMountEffect","DataContext","useData","id","undefined","initialData","sharedDataRef","sharedAttachmentsRef","forceUpdate","current","rerenderUseDataHook","context","hasContext","Error","data","filterDataHandler","updateDataValue","setData","setHandler","newData","update","updateHandler","path","value","existingData","existingValue","has","get","newValue","set","extend","filterData","filter","_sharedAttachmentsRef","_sharedAttachmentsRef2","call","getValue","hadInitialData"],"sources":["../../../../../../src/extensions/forms/Form/data-context/useData.tsx"],"sourcesContent":["import {\n useCallback,\n useContext,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport pointer from 'json-pointer'\nimport {\n SharedStateId,\n useSharedState,\n} from '../../../../shared/helpers/useSharedState'\nimport useMountEffect from '../../../../shared/helpers/useMountEffect'\nimport type { Path } from '../../types'\nimport DataContext, {\n FilterData,\n FilterDataHandler,\n} from '../../DataContext/Context'\n\ntype PathImpl<T, P extends string> = P extends `${infer Key}/${infer Rest}`\n ? Key extends keyof T\n ? Rest extends ''\n ? T[Key]\n : PathImpl<T[Key], Rest>\n : never\n : T[P & keyof T]\n\ntype PathType<T, P extends string> = P extends `/${infer Rest}`\n ? PathImpl<T, Rest>\n : never\n\ntype UseDataReturnUpdate<Data> = <P extends Path>(\n path: P,\n value: ((value: PathType<Data, P>) => unknown) | unknown\n) => void\n\nexport type UseDataReturnGetValue<Data> = <P extends Path>(\n path: P\n) => PathType<Data, P>\n\nexport type UseDataReturnFilterData<Data> = (\n filterDataHandler: FilterData,\n data?: Data\n) => Partial<Data>\n\ntype UseDataReturn<Data> = {\n data: Data\n set: (newData: Data) => void\n update: UseDataReturnUpdate<Data>\n getValue: UseDataReturnGetValue<Data>\n filterData: UseDataReturnFilterData<Data>\n}\n\ntype SharedAttachment<Data> = {\n rerenderUseDataHook: () => void\n filterDataHandler?: FilterDataHandler<Data>\n}\n\n/**\n * Custom hook that provides form data management functionality.\n *\n * @template Data - The type of data being managed.\n * @param {SharedStateId} id - The identifier for the data.\n * @param {Data} initialData - The initial data value (optional).\n * @returns {UseDataReturn<Data>} An object containing the data and data management functions.\n */\nexport default function useData<Data>(\n id: SharedStateId = undefined,\n initialData: Data = undefined\n): UseDataReturn<Data> {\n const sharedDataRef =\n useRef<ReturnType<typeof useSharedState<Data>>>(null)\n const sharedAttachmentsRef =\n useRef<ReturnType<typeof useSharedState<SharedAttachment<Data>>>>(null)\n const [, forceUpdate] = useReducer(() => ({}), {})\n\n sharedDataRef.current = useSharedState<Data>(\n id,\n initialData,\n forceUpdate\n )\n\n sharedAttachmentsRef.current = useSharedState<SharedAttachment<Data>>(\n id + '-attachments',\n { rerenderUseDataHook: forceUpdate }\n )\n\n // If no id is provided, use the context data\n const context = useContext(DataContext)\n if (!id) {\n if (!context?.hasContext) {\n throw new Error(\n 'useData needs to run inside DataContext (Form.Handler) or have a valid id'\n )\n }\n\n if (context) {\n sharedDataRef.current.data = context.data\n sharedAttachmentsRef.current.data.filterDataHandler =\n context.filterDataHandler\n }\n }\n\n const updateDataValue = context?.updateDataValue\n const setData = context?.setData\n\n const setHandler = useCallback(\n (newData: Data) => {\n if (id) {\n sharedDataRef.current.update(newData)\n } else {\n setData?.(newData)\n }\n },\n [id, setData]\n )\n\n const updateHandler = useCallback<UseDataReturnUpdate<Data>>(\n (path, value = undefined) => {\n const existingData = sharedDataRef.current.data || ({} as Data)\n const existingValue = pointer.has(existingData, path)\n ? pointer.get(existingData, path)\n : undefined\n\n // get new value\n const newValue =\n typeof value === 'function' ? value(existingValue) : value\n\n if (newValue !== existingValue) {\n // update existing data\n pointer.set(existingData, path, newValue)\n\n // update provider\n if (id) {\n sharedDataRef.current.extend(existingData)\n } else {\n updateDataValue(path, newValue)\n }\n }\n },\n [id, updateDataValue]\n )\n\n const filterData = useCallback<UseDataReturn<Data>['filterData']>(\n (filter, data = sharedDataRef.current.data) => {\n if (id) {\n return sharedAttachmentsRef.current.data?.filterDataHandler?.(\n data,\n filter\n )\n }\n\n return context?.filterDataHandler(data, filter)\n },\n [context, id]\n )\n\n const getValue = useCallback<UseDataReturn<Data>['getValue']>((path) => {\n if (pointer.has(sharedDataRef.current.data, path)) {\n return pointer.get(sharedDataRef.current.data, path)\n }\n\n return undefined\n }, [])\n\n useMountEffect(() => {\n if (id && !sharedDataRef.current.hadInitialData && initialData) {\n sharedDataRef.current.extend(initialData)\n }\n })\n\n const { data } = sharedDataRef.current\n\n return useMemo(\n () => ({\n data,\n update: updateHandler,\n set: setHandler,\n getValue,\n filterData,\n }),\n [data, getValue, setHandler, updateHandler, filterData]\n )\n}\n"],"mappings":";;AAAA,SACEA,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,MAAM,QACD,OAAO;AACd,OAAOC,OAAO,MAAM,cAAc;AAClC,SAEEC,cAAc,QACT,2CAA2C;AAClD,OAAOC,cAAc,MAAM,2CAA2C;AAEtE,OAAOC,WAAW,MAGX,2BAA2B;AAiDlC,eAAe,SAASC,OAAOA,CAC7BC,EAAiB,GAAGC,SAAS,EAC7BC,WAAiB,GAAGD,SAAS,EACR;EACrB,MAAME,aAAa,GACjBT,MAAM,CAA0C,IAAI,CAAC;EACvD,MAAMU,oBAAoB,GACxBV,MAAM,CAA4D,IAAI,CAAC;EACzE,MAAM,GAAGW,WAAW,CAAC,GAAGZ,UAAU,CAAC,OAAO,CAAC,CAAC,CA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E;MACjD,OAAOxB,OAAO,CAAC6B,GAAG,CAACrB,aAAa,CAACG,OAAO,CAACK,IAAI,EAAEQ,IAAI,CAAC;IACtD;IAEA,OAAOlB,SAAS;EAClB,CAAC,EAAE,EAAE,CAAC;EAENJ,cAAc,CAAC,MAAM;IACnB,IAAIG,EAAE,IAAI,CAACG,aAAa,CAACG,OAAO,CAAC4B,cAAc,IAAIhC,WAAW,EAAE;MAC9DC,aAAa,CAACG,OAAO,CAACqB,MAAM,CAACzB,WAAW,CAAC;IAC3C;EACF,CAAC,CAAC;EAEF,MAAM;IAAES;EAAK,CAAC,GAAGR,aAAa,CAACG,OAAO;EAEtC,OAAOd,OAAO,CACZ,OAAO;IACLmB,IAAI;IACJM,MAAM,EAAEC,aAAa;IACrBQ,GAAG,EAAEX,UAAU;IACfkB,QAAQ;IACRL;EACF,CAAC,CAAC,EACF,CAACjB,IAAI,EAAEsB,QAAQ,EAAElB,UAAU,EAAEG,aAAa,EAAEU,UAAU,CACxD,CAAC;AACH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValueProps } from '../../types';
|
|
2
|
+
export type Props = ValueProps<string>;
|
|
3
|
+
declare function SelectCountry(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare namespace SelectCountry {
|
|
5
|
+
var _supportsSpacingProps: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default SelectCountry;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["value", "className", "label"];
|
|
6
|
+
import React, { useContext, useMemo } from 'react';
|
|
7
|
+
import classnames from 'classnames';
|
|
8
|
+
import { useTranslation, useValueProps } from '../../hooks';
|
|
9
|
+
import ValueBlock from '../../ValueBlock';
|
|
10
|
+
import SharedContext from '../../../../shared/Context';
|
|
11
|
+
import { getCountryData } from '../../Field/SelectCountry';
|
|
12
|
+
function SelectCountry(props) {
|
|
13
|
+
const {
|
|
14
|
+
locale
|
|
15
|
+
} = useContext(SharedContext);
|
|
16
|
+
const translations = useTranslation().SelectCountry;
|
|
17
|
+
const _useValueProps = useValueProps(props),
|
|
18
|
+
{
|
|
19
|
+
value,
|
|
20
|
+
className,
|
|
21
|
+
label = translations.label
|
|
22
|
+
} = _useValueProps,
|
|
23
|
+
rest = _objectWithoutProperties(_useValueProps, _excluded);
|
|
24
|
+
const countryName = useMemo(() => {
|
|
25
|
+
var _getCountryData$at;
|
|
26
|
+
if (!value) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const lang = locale === null || locale === void 0 ? void 0 : locale.split('-')[0];
|
|
30
|
+
return (_getCountryData$at = getCountryData({
|
|
31
|
+
lang,
|
|
32
|
+
filter: country => {
|
|
33
|
+
return country.iso === value;
|
|
34
|
+
}
|
|
35
|
+
}).at(0)) === null || _getCountryData$at === void 0 ? void 0 : _getCountryData$at.content;
|
|
36
|
+
}, [locale, value]);
|
|
37
|
+
return React.createElement(ValueBlock, _extends({
|
|
38
|
+
label: label,
|
|
39
|
+
className: classnames('dnb-forms-value-select-country', className)
|
|
40
|
+
}, rest), countryName);
|
|
41
|
+
}
|
|
42
|
+
SelectCountry._supportsSpacingProps = true;
|
|
43
|
+
export default SelectCountry;
|
|
44
|
+
//# sourceMappingURL=SelectCountry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectCountry.js","names":["React","useContext","useMemo","classnames","useTranslation","useValueProps","ValueBlock","SharedContext","getCountryData","SelectCountry","props","locale","translations","_useValueProps","value","className","label","rest","_objectWithoutProperties","_excluded","countryName","_getCountryData$at","lang","split","filter","country","iso","at","content","createElement","_extends","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Value/SelectCountry/SelectCountry.tsx"],"sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation, useValueProps } from '../../hooks'\nimport { ValueProps } from '../../types'\nimport ValueBlock from '../../ValueBlock'\nimport SharedContext from '../../../../shared/Context'\nimport { getCountryData } from '../../Field/SelectCountry'\nimport { CountryLang } from '../../constants/countries'\n\nexport type Props = ValueProps<string>\n\nfunction SelectCountry(props: Props) {\n const { locale } = useContext(SharedContext)\n const translations = useTranslation().SelectCountry\n const {\n value,\n className,\n label = translations.label,\n ...rest\n } = useValueProps(props)\n\n const countryName = useMemo(() => {\n if (!value) {\n return null\n }\n\n const lang = locale?.split('-')[0] as CountryLang\n return getCountryData({\n lang,\n filter: (country) => {\n return country.iso === value\n },\n }).at(0)?.content\n }, [locale, value])\n\n return (\n <ValueBlock\n label={label}\n className={classnames('dnb-forms-value-select-country', className)}\n {...rest}\n >\n {countryName}\n </ValueBlock>\n )\n}\n\nSelectCountry._supportsSpacingProps = true\nexport default SelectCountry\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAClD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,cAAc,EAAEC,aAAa,QAAQ,aAAa;AAE3D,OAAOC,UAAU,MAAM,kBAAkB;AACzC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,SAASC,cAAc,QAAQ,2BAA2B;AAK1D,SAASC,aAAaA,CAACC,KAAY,EAAE;EACnC,MAAM;IAAEC;EAAO,CAAC,GAAGV,UAAU,CAACM,aAAa,CAAC;EAC5C,MAAMK,YAAY,GAAGR,cAAc,CAAC,CAAC,CAACK,aAAa;EACnD,MAAAI,cAAA,GAKIR,aAAa,CAACK,KAAK,CAAC;IALlB;MACJI,KAAK;MACLC,SAAS;MACTC,KAAK,GAAGJ,YAAY,CAACI;IAEvB,CAAC,GAAAH,cAAA;IADII,IAAI,GAAAC,wBAAA,CAAAL,cAAA,EAAAM,SAAA;EAGT,MAAMC,WAAW,GAAGlB,OAAO,CAAC,MAAM;IAAA,IAAAmB,kBAAA;IAChC,IAAI,CAACP,KAAK,EAAE;MACV,OAAO,IAAI;IACb;IAEA,MAAMQ,IAAI,GAAGX,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEY,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAgB;IACjD,QAAAF,kBAAA,GAAOb,cAAc,CAAC;MACpBc,IAAI;MACJE,MAAM,EAAGC,OAAO,IAAK;QACnB,OAAOA,OAAO,CAACC,GAAG,KAAKZ,KAAK;MAC9B;IACF,CAAC,CAAC,CAACa,EAAE,CAAC,CAAC,CAAC,cAAAN,kBAAA,uBALDA,kBAAA,CAKGO,OAAO;EACnB,CAAC,EAAE,CAACjB,MAAM,EAAEG,KAAK,CAAC,CAAC;EAEnB,OACEd,KAAA,CAAA6B,aAAA,CAACvB,UAAU,EAAAwB,QAAA;IACTd,KAAK,EAAEA,KAAM;IACbD,SAAS,EAAEZ,UAAU,CAAC,gCAAgC,EAAEY,SAAS;EAAE,GAC/DE,IAAI,GAEPG,WACS,CAAC;AAEjB;AAEAX,aAAa,CAACsB,qBAAqB,GAAG,IAAI;AAC1C,eAAetB,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../../../src/extensions/forms/Value/SelectCountry/index.ts"],"sourcesContent":["export { default } from './SelectCountry'\nexport * from './SelectCountry'\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iBAAiB;AACzC,cAAc,iBAAiB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const SelectionProperties = {
|
|
2
2
|
dataPath: {
|
|
3
|
-
doc: 'The path to the context data (Form.Handler). The object needs to have a `value` and a `title` property. The generated options will be placed above given JSX based children.',
|
|
3
|
+
doc: 'The path to the context data (Form.Handler). The context data object needs to have a `value` and a `title` property. The generated options will be placed above given JSX based children.',
|
|
4
4
|
type: 'string',
|
|
5
5
|
status: 'optional'
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionDocs.js","names":["SelectionProperties","dataPath","doc","type","status"],"sources":["../../../../../../src/extensions/forms/Value/Selection/SelectionDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../../shared/types'\n\nexport const SelectionProperties: PropertiesTableProps = {\n dataPath: {\n doc: 'The path to the context data (Form.Handler). The object needs to have a `value` and a `title` property. The generated options will be placed above given JSX based children.',\n type: 'string',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAyC,GAAG;EACvDC,QAAQ,EAAE;IACRC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"SelectionDocs.js","names":["SelectionProperties","dataPath","doc","type","status"],"sources":["../../../../../../src/extensions/forms/Value/Selection/SelectionDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../../shared/types'\n\nexport const SelectionProperties: PropertiesTableProps = {\n dataPath: {\n doc: 'The path to the context data (Form.Handler). The context data object needs to have a `value` and a `title` property. The generated options will be placed above given JSX based children.',\n type: 'string',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAyC,GAAG;EACvDC,QAAQ,EAAE;IACRC,GAAG,EAAE,2LAA2L;IAChMC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV;AACF,CAAC"}
|
|
@@ -12,5 +12,6 @@ export { default as BankAccountNumber } from './BankAccountNumber';
|
|
|
12
12
|
export { default as OrganizationNumber } from './OrganizationNumber';
|
|
13
13
|
export { default as SummaryList } from './SummaryList';
|
|
14
14
|
export { default as Composition } from './Composition';
|
|
15
|
+
export { default as SelectCountry } from './SelectCountry';
|
|
15
16
|
export { default as ArraySelection } from './ArraySelection';
|
|
16
17
|
export { default as Selection } from './Selection';
|
|
@@ -12,6 +12,7 @@ export { default as BankAccountNumber } from './BankAccountNumber';
|
|
|
12
12
|
export { default as OrganizationNumber } from './OrganizationNumber';
|
|
13
13
|
export { default as SummaryList } from './SummaryList';
|
|
14
14
|
export { default as Composition } from './Composition';
|
|
15
|
+
export { default as SelectCountry } from './SelectCountry';
|
|
15
16
|
export { default as ArraySelection } from './ArraySelection';
|
|
16
17
|
export { default as Selection } from './Selection';
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","String","Number","Boolean","Currency","Date","Email","Name","NationalIdentityNumber","PostalCodeAndCity","PhoneNumber","BankAccountNumber","OrganizationNumber","SummaryList","Composition","ArraySelection","Selection"],"sources":["../../../../../src/extensions/forms/Value/index.ts"],"sourcesContent":["export { default as String } from './String'\nexport { default as Number } from './Number'\nexport { default as Boolean } from './Boolean'\nexport { default as Currency } from './Currency'\nexport { default as Date } from './Date'\nexport { default as Email } from './Email'\nexport { default as Name } from './Name'\nexport { default as NationalIdentityNumber } from './NationalIdentityNumber'\nexport { default as PostalCodeAndCity } from './PostalCodeAndCity'\nexport { default as PhoneNumber } from './PhoneNumber'\nexport { default as BankAccountNumber } from './BankAccountNumber'\nexport { default as OrganizationNumber } from './OrganizationNumber'\nexport { default as SummaryList } from './SummaryList'\nexport { default as Composition } from './Composition'\nexport { default as ArraySelection } from './ArraySelection'\nexport { default as Selection } from './Selection'\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM,QAAQ,UAAU;AAC5C,SAASD,OAAO,IAAIE,MAAM,QAAQ,UAAU;AAC5C,SAASF,OAAO,IAAIG,OAAO,QAAQ,WAAW;AAC9C,SAASH,OAAO,IAAII,QAAQ,QAAQ,YAAY;AAChD,SAASJ,OAAO,IAAIK,IAAI,QAAQ,QAAQ;AACxC,SAASL,OAAO,IAAIM,KAAK,QAAQ,SAAS;AAC1C,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AACxC,SAASP,OAAO,IAAIQ,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASR,OAAO,IAAIS,iBAAiB,QAAQ,qBAAqB;AAClE,SAAST,OAAO,IAAIU,WAAW,QAAQ,eAAe;AACtD,SAASV,OAAO,IAAIW,iBAAiB,QAAQ,qBAAqB;AAClE,SAASX,OAAO,IAAIY,kBAAkB,QAAQ,sBAAsB;AACpE,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,cAAc,QAAQ,kBAAkB;AAC5D,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","String","Number","Boolean","Currency","Date","Email","Name","NationalIdentityNumber","PostalCodeAndCity","PhoneNumber","BankAccountNumber","OrganizationNumber","SummaryList","Composition","SelectCountry","ArraySelection","Selection"],"sources":["../../../../../src/extensions/forms/Value/index.ts"],"sourcesContent":["export { default as String } from './String'\nexport { default as Number } from './Number'\nexport { default as Boolean } from './Boolean'\nexport { default as Currency } from './Currency'\nexport { default as Date } from './Date'\nexport { default as Email } from './Email'\nexport { default as Name } from './Name'\nexport { default as NationalIdentityNumber } from './NationalIdentityNumber'\nexport { default as PostalCodeAndCity } from './PostalCodeAndCity'\nexport { default as PhoneNumber } from './PhoneNumber'\nexport { default as BankAccountNumber } from './BankAccountNumber'\nexport { default as OrganizationNumber } from './OrganizationNumber'\nexport { default as SummaryList } from './SummaryList'\nexport { default as Composition } from './Composition'\nexport { default as SelectCountry } from './SelectCountry'\nexport { default as ArraySelection } from './ArraySelection'\nexport { default as Selection } from './Selection'\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM,QAAQ,UAAU;AAC5C,SAASD,OAAO,IAAIE,MAAM,QAAQ,UAAU;AAC5C,SAASF,OAAO,IAAIG,OAAO,QAAQ,WAAW;AAC9C,SAASH,OAAO,IAAII,QAAQ,QAAQ,YAAY;AAChD,SAASJ,OAAO,IAAIK,IAAI,QAAQ,QAAQ;AACxC,SAASL,OAAO,IAAIM,KAAK,QAAQ,SAAS;AAC1C,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AACxC,SAASP,OAAO,IAAIQ,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASR,OAAO,IAAIS,iBAAiB,QAAQ,qBAAqB;AAClE,SAAST,OAAO,IAAIU,WAAW,QAAQ,eAAe;AACtD,SAASV,OAAO,IAAIW,iBAAiB,QAAQ,qBAAqB;AAClE,SAASX,OAAO,IAAIY,kBAAkB,QAAQ,sBAAsB;AACpE,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,aAAa,QAAQ,iBAAiB;AAC1D,SAASf,OAAO,IAAIgB,cAAc,QAAQ,kBAAkB;AAC5D,SAAShB,OAAO,IAAIiB,SAAS,QAAQ,aAAa"}
|
|
@@ -50,12 +50,13 @@ function ValueBlock(props) {
|
|
|
50
50
|
}
|
|
51
51
|
let content = null;
|
|
52
52
|
const compositionClass = composition && `dnb-forms-value-block__composition--${composition === true ? 'horizontal' : composition}`;
|
|
53
|
+
const defaultClass = `dnb-forms-value-block__content dnb-forms-value-block__content--gap-${gap === false ? 'none' : gap}`;
|
|
53
54
|
if (summaryListContext) {
|
|
54
55
|
const Item = summaryListContext.isNested ? Dl : summaryListContext.layout === 'horizontal' ? Dl.Item : Fragment;
|
|
55
56
|
if (!label && valueBlockContext !== null && valueBlockContext !== void 0 && valueBlockContext.composition) {
|
|
56
57
|
var _span;
|
|
57
58
|
content = (_span = React.createElement("span", {
|
|
58
|
-
className:
|
|
59
|
+
className: defaultClass
|
|
59
60
|
}, children)) !== null && _span !== void 0 ? _span : React.createElement("span", {
|
|
60
61
|
className: "dnb-forms-value-block__placeholder"
|
|
61
62
|
}, placeholder);
|
|
@@ -69,7 +70,7 @@ function ValueBlock(props) {
|
|
|
69
70
|
}, label && React.createElement("strong", null, label)), React.createElement(Dd, {
|
|
70
71
|
className: classnames(compositionClass, summaryListContext.layout !== 'grid' && !summaryListContext.isNested && maxWidth && `dnb-forms-value-block--max-width-${maxWidth}`)
|
|
71
72
|
}, children ? React.createElement("span", {
|
|
72
|
-
className:
|
|
73
|
+
className: defaultClass
|
|
73
74
|
}, children) : React.createElement("span", {
|
|
74
75
|
className: "dnb-forms-value-block__placeholder"
|
|
75
76
|
}, placeholder))));
|
|
@@ -83,7 +84,7 @@ function ValueBlock(props) {
|
|
|
83
84
|
className: "dnb-forms-value-block__label",
|
|
84
85
|
labelDirection: inline ? 'horizontal' : 'vertical'
|
|
85
86
|
}, label), children ? React.createElement("span", {
|
|
86
|
-
className:
|
|
87
|
+
className: defaultClass
|
|
87
88
|
}, children) : React.createElement("span", {
|
|
88
89
|
className: "dnb-forms-value-block__placeholder"
|
|
89
90
|
}, placeholder));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueBlock.js","names":["React","Fragment","useContext","useEffect","useMemo","useRef","classnames","warn","Dd","Dl","Dt","Span","FormLabel","SummaryListContext","ValueBlockContext","DataContext","pickSpacingProps","IterateElementContext","convertJsxToString","ValueBlock","props","summaryListContext","valueBlockContext","dataContext","iterateItemContext","index","iterateIndex","className","label","labelProp","inline","maxWidth","composition","placeholder","showEmpty","children","gap","undefined","replace","String","ref","useNotInSummaryList","prerenderFieldProps","content","compositionClass","Item","isNested","layout","_span","createElement","Provider","value","_objectSpread","_extends","element","labelDirection","current","sibling","previousElementSibling","classList","contains","closest","apply","filter","Boolean","error","_supportsSpacingProps"],"sources":["../../../../../src/extensions/forms/ValueBlock/ValueBlock.tsx"],"sourcesContent":["import React, {\n Fragment,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react'\nimport classnames from 'classnames'\nimport { warn } from '../../../shared/helpers'\nimport { Dd, Dl, Dt, Span } from '../../../elements'\nimport { FormLabel } from '../../../components'\nimport SummaryListContext from '../Value/SummaryList/SummaryListContext'\nimport ValueBlockContext from './ValueBlockContext'\nimport DataContext from '../DataContext/Context'\nimport { ValueProps } from '../types'\nimport { pickSpacingProps } from '../../../components/flex/utils'\nimport IterateElementContext from '../Iterate/IterateItemContext'\nimport { convertJsxToString } from '../../../shared/component-helper'\n\n/**\n * Props are documented in ValueDocs.ts\n */\nexport type Props = Omit<ValueProps<unknown>, 'value'> & {\n children?: React.ReactNode\n\n /**\n * Used internally by the Composition component\n */\n composition?: boolean\n\n /**\n * Used internally by the Composition component\n */\n gap?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | false\n}\n\nfunction ValueBlock(props: Props) {\n const summaryListContext = useContext(SummaryListContext)\n const valueBlockContext = useContext(ValueBlockContext)\n const dataContext = useContext(DataContext)\n const iterateItemContext = useContext(IterateElementContext)\n const { index: iterateIndex } = iterateItemContext ?? {}\n\n const {\n className,\n label: labelProp,\n inline,\n maxWidth = props.composition ? props.maxWidth : 'large',\n placeholder,\n showEmpty,\n children,\n composition,\n gap = 'xx-small',\n } = props\n\n const label = useMemo(() => {\n if (inline) {\n return null\n }\n if (iterateIndex !== undefined) {\n return convertJsxToString(labelProp).replace(\n '{itemNr}',\n String(iterateIndex + 1)\n )\n }\n return labelProp\n }, [inline, iterateIndex, labelProp])\n\n const ref = useRef<HTMLElement>(null)\n useNotInSummaryList(valueBlockContext?.composition ? null : ref, label)\n\n if (\n ((children === undefined || children === null || children === false) &&\n !showEmpty &&\n !placeholder) ||\n dataContext?.prerenderFieldProps\n ) {\n return null\n }\n\n let content = null\n\n const compositionClass =\n composition &&\n classnames(\n `dnb-forms-value-block__composition--${\n composition === true ? 'horizontal' : composition\n }`\n )\n\n if (summaryListContext) {\n const Item = summaryListContext.isNested\n ? Dl\n : summaryListContext.layout === 'horizontal'\n ? Dl.Item\n : Fragment\n\n if (!label && valueBlockContext?.composition) {\n content = (\n <span\n className={classnames(\n 'dnb-forms-value-block__content',\n gap && `dnb-forms-value-block__content--gap-${gap}`\n )}\n >\n {children}\n </span>\n ) ?? (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )\n } else {\n content = (\n <SummaryListContext.Provider\n value={{ ...summaryListContext, isNested: true }}\n >\n <Item>\n <Dt className=\"dnb-forms-value-block__label\">\n {label && <strong>{label}</strong>}\n </Dt>\n <Dd\n className={classnames(\n summaryListContext.layout !== 'grid' &&\n !summaryListContext.isNested &&\n maxWidth &&\n `dnb-forms-value-block--max-width-${maxWidth}`,\n compositionClass\n )}\n >\n {children ? (\n <span\n className={classnames(\n 'dnb-forms-value-block__content',\n gap && `dnb-forms-value-block__content--gap-${gap}`\n )}\n >\n {children}\n </span>\n ) : (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )}\n </Dd>\n </Item>\n </SummaryListContext.Provider>\n )\n }\n } else {\n content = (\n <Span\n ref={ref}\n className={classnames(\n 'dnb-forms-value-block',\n inline && 'dnb-forms-value-block--inline',\n maxWidth && `dnb-forms-value-block--max-width-${maxWidth}`,\n compositionClass,\n className\n )}\n {...pickSpacingProps(props)}\n >\n {label && (\n <FormLabel\n element=\"strong\" // enhance a11y: https://www.w3.org/WAI/WCAG21/Techniques/html/H49\n className=\"dnb-forms-value-block__label\"\n labelDirection={inline ? 'horizontal' : 'vertical'}\n >\n {label}\n </FormLabel>\n )}\n {children ? (\n <span\n className={classnames(\n 'dnb-forms-value-block__content',\n gap && `dnb-forms-value-block__content--gap-${gap}`\n )}\n >\n {children}\n </span>\n ) : (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )}\n </Span>\n )\n }\n\n return (\n <ValueBlockContext.Provider value={props}>\n {content}\n </ValueBlockContext.Provider>\n )\n}\n\nfunction useNotInSummaryList(\n ref: React.RefObject<HTMLElement>,\n label?: React.ReactNode\n) {\n useEffect(() => {\n if (ref?.current) {\n try {\n const sibling = ref.current.previousElementSibling\n\n if (\n sibling?.classList.contains('dnb-forms-value-block') &&\n !ref.current.closest('.dnb-forms-summary-list')\n ) {\n warn.apply(\n warn,\n [\n 'Value components as siblings should be wrapped inside a Value.SummaryList!',\n label,\n ].filter(Boolean)\n )\n }\n } catch (error) {\n //\n }\n }\n }, [label, ref])\n}\n\nValueBlock._supportsSpacingProps = true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AC,8BAA8B;MACxC4B,cAAc,EAAEzB,MAAM,GAAG,YAAY,GAAG;IAAW,GAElDF,KACQ,CACZ,EACAO,QAAQ,GACPnC,KAAA,CAAAiD,aAAA;MACEtB,SAAS,EACP,gCAAgC,IAChCS,GAAG,2CAA2CA,GAAI;IAClD,GAEDD,QACG,CAAC,GAEPnC,KAAA,CAAAiD,aAAA;MAAMtB,SAAS,EAAC;IAAoC,GACjDM,WACG,CAEJ,CACP;EACH;EAEA,OACEjC,KAAA,CAAAiD,aAAA,CAACnC,iBAAiB,CAACoC,QAAQ;IAACC,KAAK,EAAE/B;EAAM,GACtCuB,OACyB,CAAC;AAEjC;AAEA,SAASF,mBAAmBA,CAC1BD,GAAiC,EACjCZ,KAAuB,EACvB;EACAzB,SAAS,CAAC,MAAM;IACd,IAAIqC,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEgB,OAAO,EAAE;MAChB,IAAI;QACF,MAAMC,OAAO,GAAGjB,GAAG,CAACgB,OAAO,CAACE,sBAAsB;QAElD,IACED,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEE,SAAS,CAACC,QAAQ,CAAC,uBAAuB,CAAC,IACpD,CAACpB,GAAG,CAACgB,OAAO,CAACK,OAAO,CAAC,yBAAyB,CAAC,EAC/C;UACAtD,IAAI,CAACuD,KAAK,CACRvD,IAAI,EACJ,CACE,4EAA4E,EAC5EqB,KAAK,CACN,CAACmC,MAAM,CAACC,OAAO,CAClB,CAAC;QACH;MACF,CAAC,CAAC,OAAOC,KAAK,EAAE,CAEhB;IACF;EACF,CAAC,EAAE,CAACrC,KAAK,EAAEY,GAAG,CAAC,CAAC;AAClB;AAEArB,UAAU,CAAC+C,qBAAqB,GAAG,IAAI;AACvC,eAAe/C,UAAU"}
|
|
1
|
+
{"version":3,"file":"ValueBlock.js","names":["React","Fragment","useContext","useEffect","useMemo","useRef","classnames","warn","Dd","Dl","Dt","Span","FormLabel","SummaryListContext","ValueBlockContext","DataContext","pickSpacingProps","IterateElementContext","convertJsxToString","ValueBlock","props","summaryListContext","valueBlockContext","dataContext","iterateItemContext","index","iterateIndex","className","label","labelProp","inline","maxWidth","composition","placeholder","showEmpty","children","gap","undefined","replace","String","ref","useNotInSummaryList","prerenderFieldProps","content","compositionClass","defaultClass","Item","isNested","layout","_span","createElement","Provider","value","_objectSpread","_extends","element","labelDirection","current","sibling","previousElementSibling","classList","contains","closest","apply","filter","Boolean","error","_supportsSpacingProps"],"sources":["../../../../../src/extensions/forms/ValueBlock/ValueBlock.tsx"],"sourcesContent":["import React, {\n Fragment,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react'\nimport classnames from 'classnames'\nimport { warn } from '../../../shared/helpers'\nimport { Dd, Dl, Dt, Span } from '../../../elements'\nimport { FormLabel } from '../../../components'\nimport SummaryListContext from '../Value/SummaryList/SummaryListContext'\nimport ValueBlockContext from './ValueBlockContext'\nimport DataContext from '../DataContext/Context'\nimport { ValueProps } from '../types'\nimport { pickSpacingProps } from '../../../components/flex/utils'\nimport IterateElementContext from '../Iterate/IterateItemContext'\nimport { convertJsxToString } from '../../../shared/component-helper'\n\n/**\n * Props are documented in ValueDocs.ts\n */\nexport type Props = Omit<ValueProps<unknown>, 'value'> & {\n children?: React.ReactNode\n\n /**\n * Used internally by the Composition component\n */\n composition?: boolean\n\n /**\n * Used internally by the Composition component\n */\n gap?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | false\n}\n\nfunction ValueBlock(props: Props) {\n const summaryListContext = useContext(SummaryListContext)\n const valueBlockContext = useContext(ValueBlockContext)\n const dataContext = useContext(DataContext)\n const iterateItemContext = useContext(IterateElementContext)\n const { index: iterateIndex } = iterateItemContext ?? {}\n\n const {\n className,\n label: labelProp,\n inline,\n maxWidth = props.composition ? props.maxWidth : 'large',\n placeholder,\n showEmpty,\n children,\n composition,\n gap = 'xx-small',\n } = props\n\n const label = useMemo(() => {\n if (inline) {\n return null\n }\n if (iterateIndex !== undefined) {\n return convertJsxToString(labelProp).replace(\n '{itemNr}',\n String(iterateIndex + 1)\n )\n }\n return labelProp\n }, [inline, iterateIndex, labelProp])\n\n const ref = useRef<HTMLElement>(null)\n useNotInSummaryList(valueBlockContext?.composition ? null : ref, label)\n\n if (\n ((children === undefined || children === null || children === false) &&\n !showEmpty &&\n !placeholder) ||\n dataContext?.prerenderFieldProps\n ) {\n return null\n }\n\n let content = null\n\n const compositionClass =\n composition &&\n classnames(\n `dnb-forms-value-block__composition--${\n composition === true ? 'horizontal' : composition\n }`\n )\n const defaultClass = classnames(\n 'dnb-forms-value-block__content',\n `dnb-forms-value-block__content--gap-${gap === false ? 'none' : gap}`\n )\n\n if (summaryListContext) {\n const Item = summaryListContext.isNested\n ? Dl\n : summaryListContext.layout === 'horizontal'\n ? Dl.Item\n : Fragment\n\n if (!label && valueBlockContext?.composition) {\n content = <span className={defaultClass}>{children}</span> ?? (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )\n } else {\n content = (\n <SummaryListContext.Provider\n value={{ ...summaryListContext, isNested: true }}\n >\n <Item>\n <Dt className=\"dnb-forms-value-block__label\">\n {label && <strong>{label}</strong>}\n </Dt>\n <Dd\n className={classnames(\n summaryListContext.layout !== 'grid' &&\n !summaryListContext.isNested &&\n maxWidth &&\n `dnb-forms-value-block--max-width-${maxWidth}`,\n compositionClass\n )}\n >\n {children ? (\n <span className={defaultClass}>{children}</span>\n ) : (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )}\n </Dd>\n </Item>\n </SummaryListContext.Provider>\n )\n }\n } else {\n content = (\n <Span\n ref={ref}\n className={classnames(\n 'dnb-forms-value-block',\n inline && 'dnb-forms-value-block--inline',\n maxWidth && `dnb-forms-value-block--max-width-${maxWidth}`,\n compositionClass,\n className\n )}\n {...pickSpacingProps(props)}\n >\n {label && (\n <FormLabel\n element=\"strong\" // enhance a11y: https://www.w3.org/WAI/WCAG21/Techniques/html/H49\n className=\"dnb-forms-value-block__label\"\n labelDirection={inline ? 'horizontal' : 'vertical'}\n >\n {label}\n </FormLabel>\n )}\n {children ? (\n <span className={defaultClass}>{children}</span>\n ) : (\n <span className=\"dnb-forms-value-block__placeholder\">\n {placeholder}\n </span>\n )}\n </Span>\n )\n }\n\n return (\n <ValueBlockContext.Provider value={props}>\n {content}\n </ValueBlockContext.Provider>\n )\n}\n\nfunction useNotInSummaryList(\n ref: React.RefObject<HTMLElement>,\n label?: React.ReactNode\n) {\n useEffect(() => {\n if (ref?.current) {\n try {\n const sibling = ref.current.previousElementSibling\n\n if (\n sibling?.classList.contains('dnb-forms-value-block') &&\n !ref.current.closest('.dnb-forms-summary-list')\n ) {\n warn.apply(\n warn,\n [\n 'Value components as siblings should be wrapped inside a Value.SummaryList!',\n label,\n ].filter(Boolean)\n )\n }\n } catch (error) {\n //\n }\n }\n }, [label, ref])\n}\n\nValueBlock._supportsSpacingProps = true\nexport default ValueBlock\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IACVC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,IAAI,QAAQ,mBAAmB;AACpD,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,OAAOC,kBAAkB,MAAM,yCAAyC;AACxE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,WAAW,MAAM,wBAAwB;AAEhD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,OAAOC,qBAAqB,MAAM,+BAA+B;AACjE,SAASC,kBAAkB,QAAQ,kCAAkC;AAmBrE,SAASC,UAAUA,CAACC,KAAY,EAAE;EAChC,MAAMC,kBAAkB,GAAGnB,UAAU,CAACW,kBAAkB,CAAC;EACzD,MAAMS,iBAAiB,GAAGpB,UAAU,CAACY,iBAAiB,CAAC;EACvD,MAAMS,WAAW,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AAQ,CAAC,uBAAuB,CAAC,IACpD,CAACrB,GAAG,CAACiB,OAAO,CAACK,OAAO,CAAC,yBAAyB,CAAC,EAC/C;UACAvD,IAAI,CAACwD,KAAK,CACRxD,IAAI,EACJ,CACE,4EAA4E,EAC5EqB,KAAK,CACN,CAACoC,MAAM,CAACC,OAAO,CAClB,CAAC;QACH;MACF,CAAC,CAAC,OAAOC,KAAK,EAAE,CAEhB;IACF;EACF,CAAC,EAAE,CAACtC,KAAK,EAAEY,GAAG,CAAC,CAAC;AAClB;AAEArB,UAAU,CAACgD,qBAAqB,GAAG,IAAI;AACvC,eAAehD,UAAU"}
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
/* stylelint-disable */
|
|
56
56
|
/* stylelint-enable */
|
|
57
57
|
}
|
|
58
|
+
.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-none {
|
|
59
|
+
--column-gap: 0;
|
|
60
|
+
}
|
|
58
61
|
.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-xx-small {
|
|
59
62
|
--column-gap: var(--spacing-xx-small);
|
|
60
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dt,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not([class*=dnb-space])>.dnb-dd>.dnb-dl,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal)>.dnb-dd>.dnb-dl{margin:0}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd{margin-bottom:var(--spacing-medium)}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd:last-of-type{margin-bottom:0}.dnb-forms-value-block{display:block;font-size:var(--font-size-basis)}.dnb-forms-value-block--inline:not([class*=__composition]){display:inline-block;font-size:inherit}.dnb-forms-value-block--inline:not([class*=__composition]):after,.dnb-forms-value-block--inline:not([class*=__composition]):before{content:" "}.dnb-forms-value-block+.dnb-forms-value-block--inline:not([class*=__composition]):before{content:none}.dnb-forms-value-block__label,.dnb-forms-value-block__label strong{font-weight:var(--font-weight-medium)}.dnb-forms-value-block__placeholder{color:var(--color-black-80)}.dnb-forms-value-block--max-width-stretch{width:100%}@media screen and (min-width:25em){.dnb-forms-value-block--max-width-small{max-width:var(--forms-field-width--small)}.dnb-forms-value-block--max-width-medium{max-width:var(--forms-field-width--medium)}.dnb-forms-value-block--max-width-large{max-width:var(--forms-field-width--large)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{-moz-column-gap:var(--column-gap,0);column-gap:var(--column-gap,0);display:flex;flex-flow:row;row-gap:var(--row-gap,var(--spacing-medium))}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-xx-small{--column-gap:var(--spacing-xx-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-x-small{--column-gap:var(--spacing-x-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-small{--column-gap:var(--spacing-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-medium{--column-gap:var(--spacing-medium)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-large{--column-gap:var(--spacing-large)}@media screen and (min-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{align-items:flex-start}}@media screen and (max-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{flex-flow:column}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not(:has(.dnb-forms-value-block__label)){--row-gap:var(--spacing-x-small)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not([class*=dnb-space])>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dd,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dt{margin:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl>.dnb-dd{margin-bottom:0}
|
|
1
|
+
@charset "UTF-8";.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dt,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not([class*=dnb-space])>.dnb-dd>.dnb-dl,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal)>.dnb-dd>.dnb-dl{margin:0}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd{margin-bottom:var(--spacing-medium)}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd:last-of-type{margin-bottom:0}.dnb-forms-value-block{display:block;font-size:var(--font-size-basis)}.dnb-forms-value-block--inline:not([class*=__composition]){display:inline-block;font-size:inherit}.dnb-forms-value-block--inline:not([class*=__composition]):after,.dnb-forms-value-block--inline:not([class*=__composition]):before{content:" "}.dnb-forms-value-block+.dnb-forms-value-block--inline:not([class*=__composition]):before{content:none}.dnb-forms-value-block__label,.dnb-forms-value-block__label strong{font-weight:var(--font-weight-medium)}.dnb-forms-value-block__placeholder{color:var(--color-black-80)}.dnb-forms-value-block--max-width-stretch{width:100%}@media screen and (min-width:25em){.dnb-forms-value-block--max-width-small{max-width:var(--forms-field-width--small)}.dnb-forms-value-block--max-width-medium{max-width:var(--forms-field-width--medium)}.dnb-forms-value-block--max-width-large{max-width:var(--forms-field-width--large)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{-moz-column-gap:var(--column-gap,0);column-gap:var(--column-gap,0);display:flex;flex-flow:row;row-gap:var(--row-gap,var(--spacing-medium))}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-none{--column-gap:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-xx-small{--column-gap:var(--spacing-xx-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-x-small{--column-gap:var(--spacing-x-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-small{--column-gap:var(--spacing-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-medium{--column-gap:var(--spacing-medium)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-large{--column-gap:var(--spacing-large)}@media screen and (min-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{align-items:flex-start}}@media screen and (max-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{flex-flow:column}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not(:has(.dnb-forms-value-block__label)){--row-gap:var(--spacing-x-small)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not([class*=dnb-space])>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dd,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dt{margin:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl>.dnb-dd{margin-bottom:0}
|
|
@@ -65,7 +65,8 @@ function EditContent({
|
|
|
65
65
|
defaultValue: 1,
|
|
66
66
|
minimum: 1,
|
|
67
67
|
maximum: 20,
|
|
68
|
-
showStepControls: true
|
|
68
|
+
showStepControls: true,
|
|
69
|
+
decimalLimit: 0
|
|
69
70
|
}), React.createElement(Iterate.Array, {
|
|
70
71
|
countPath: "/countChildren",
|
|
71
72
|
countPathTransform: transformAgeItem,
|
|
@@ -80,11 +81,10 @@ function EditContent({
|
|
|
80
81
|
required: tr.ChildrenWithAge.childrenAge.required
|
|
81
82
|
},
|
|
82
83
|
placeholder: "0",
|
|
83
|
-
startWith: -1,
|
|
84
84
|
width: "small",
|
|
85
85
|
minimum: 0,
|
|
86
|
-
maximum:
|
|
87
|
-
|
|
86
|
+
maximum: 17,
|
|
87
|
+
decimalLimit: 0
|
|
88
88
|
}), React.createElement(Form.Visibility, {
|
|
89
89
|
pathTrue: "/hasJointResponsibility"
|
|
90
90
|
}, React.createElement(Field.Boolean, {
|