@dnb/eufemia 10.20.0 → 10.22.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 +54 -0
- package/cjs/components/aria-live/useAriaLive.d.ts +1 -1
- package/cjs/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/cjs/components/breadcrumb/Breadcrumb.js +3 -3
- package/cjs/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/cjs/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
- package/cjs/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/cjs/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
- package/cjs/components/button/Button.js +2 -2
- package/cjs/components/button/Button.js.map +1 -1
- package/cjs/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
- package/cjs/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
- package/cjs/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
- package/cjs/components/card/style/dnb-card.css +11 -2
- package/cjs/components/card/style/dnb-card.min.css +1 -1
- package/cjs/components/card/style/dnb-card.scss +12 -2
- package/cjs/components/date-picker/DatePicker.d.ts +10 -1
- package/cjs/components/date-picker/DatePicker.js +5 -2
- package/cjs/components/date-picker/DatePicker.js.map +1 -1
- package/cjs/components/form-label/style/dnb-form-label.css +4 -8
- package/cjs/components/form-label/style/dnb-form-label.min.css +1 -1
- package/cjs/components/form-label/style/dnb-form-label.scss +5 -8
- package/cjs/components/form-status/style/dnb-form-status.css +11 -0
- package/cjs/components/form-status/style/dnb-form-status.min.css +1 -1
- package/cjs/components/form-status/style/dnb-form-status.scss +11 -0
- package/cjs/components/global-status/GlobalStatus.d.ts +1 -1
- package/cjs/components/global-status/GlobalStatusProvider.d.ts +1 -1
- package/cjs/components/height-animation/HeightAnimationInstance.d.ts +5 -6
- package/cjs/components/height-animation/HeightAnimationInstance.js +12 -12
- package/cjs/components/height-animation/HeightAnimationInstance.js.map +1 -1
- package/cjs/components/height-animation/useHeightAnimation.js +11 -10
- package/cjs/components/height-animation/useHeightAnimation.js.map +1 -1
- package/cjs/components/info-card/InfoCard.d.ts +6 -0
- package/cjs/components/info-card/InfoCard.js +4 -2
- package/cjs/components/info-card/InfoCard.js.map +1 -1
- package/cjs/components/info-card/style/dnb-info-card.css +3 -1
- package/cjs/components/info-card/style/dnb-info-card.min.css +1 -1
- package/cjs/components/info-card/style/dnb-info-card.scss +4 -2
- package/cjs/components/input/Input.d.ts +9 -9
- package/cjs/components/input/InputDocs.d.ts +2 -0
- package/cjs/components/input/InputDocs.js +165 -0
- package/cjs/components/input/InputDocs.js.map +1 -0
- package/cjs/components/input/InputPassword.d.ts +6 -17
- package/cjs/components/input/InputPassword.js +4 -85
- package/cjs/components/input/InputPassword.js.map +1 -1
- package/cjs/components/input-masked/InputMasked.d.ts +6 -93
- package/cjs/components/input-masked/InputMasked.js +3 -1
- package/cjs/components/input-masked/InputMasked.js.map +1 -1
- package/cjs/components/input-masked/InputMaskedDocs.d.ts +2 -0
- package/cjs/components/input-masked/InputMaskedDocs.js +85 -0
- package/cjs/components/input-masked/InputMaskedDocs.js.map +1 -0
- package/cjs/components/input-masked/InputMaskedHooks.js +7 -4
- package/cjs/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/cjs/components/input-masked/MultiInputMask.js +2 -6
- package/cjs/components/input-masked/MultiInputMask.js.map +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.css +3 -0
- package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.scss +5 -0
- package/cjs/components/number-format/NumberFormat.d.ts +1 -1
- package/cjs/components/number-format/NumberUtils.js +22 -14
- package/cjs/components/number-format/NumberUtils.js.map +1 -1
- package/cjs/components/pagination/InfinityScroller.d.ts +1 -1
- package/cjs/components/progress-indicator/ProgressIndicator.js +5 -7
- package/cjs/components/progress-indicator/ProgressIndicator.js.map +1 -1
- package/cjs/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
- package/cjs/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
- package/cjs/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
- package/cjs/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
- package/cjs/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
- package/cjs/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
- package/cjs/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
- package/cjs/components/slider/Slider.d.ts +1 -0
- package/cjs/components/slider/Slider.js +10 -1
- package/cjs/components/slider/Slider.js.map +1 -1
- package/cjs/components/slider/SliderInstance.js +20 -6
- package/cjs/components/slider/SliderInstance.js.map +1 -1
- package/cjs/components/slider/SliderMarker.d.ts +7 -0
- package/cjs/components/slider/SliderMarker.js +62 -0
- package/cjs/components/slider/SliderMarker.js.map +1 -0
- package/cjs/components/slider/SliderProvider.js +2 -1
- package/cjs/components/slider/SliderProvider.js.map +1 -1
- package/cjs/components/slider/style/dnb-slider.css +43 -2
- package/cjs/components/slider/style/dnb-slider.min.css +1 -1
- package/cjs/components/slider/style/dnb-slider.scss +44 -1
- package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
- package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
- package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
- package/cjs/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
- package/cjs/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
- package/cjs/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
- package/cjs/components/slider/types.d.ts +6 -0
- package/cjs/components/slider/types.js.map +1 -1
- package/cjs/components/space/SpacingHelper.d.ts +5 -5
- package/cjs/components/table/Table.js +2 -2
- package/cjs/components/table/Table.js.map +1 -1
- package/cjs/components/table/TableAccordion.js +42 -58
- package/cjs/components/table/TableAccordion.js.map +1 -1
- package/cjs/components/table/TableAccordionTd.d.ts +9 -0
- package/cjs/components/table/{TableAccordionContent.js → TableAccordionTd.js} +18 -56
- package/cjs/components/table/TableAccordionTd.js.map +1 -0
- package/cjs/components/table/TableAccordionTr.d.ts +13 -0
- package/cjs/components/table/TableAccordionTr.js +61 -0
- package/cjs/components/table/TableAccordionTr.js.map +1 -0
- package/cjs/components/table/TableContext.d.ts +2 -2
- package/cjs/components/table/TableContext.js +4 -3
- package/cjs/components/table/TableContext.js.map +1 -1
- package/cjs/components/table/TableTd.d.ts +2 -2
- package/cjs/components/table/TableTd.js +2 -2
- package/cjs/components/table/TableTd.js.map +1 -1
- package/cjs/components/table/TableTr.d.ts +6 -1
- package/cjs/components/table/TableTr.js +10 -5
- package/cjs/components/table/TableTr.js.map +1 -1
- package/cjs/components/table/style/dnb-table.css +226 -139
- package/cjs/components/table/style/dnb-table.min.css +1 -1
- package/cjs/components/table/style/dnb-table.scss +60 -4
- package/cjs/components/table/style/table-accordion.scss +83 -98
- package/cjs/components/table/style/table-container.scss +9 -9
- package/cjs/components/table/style/table-mixins.scss +19 -2
- package/cjs/components/table/style/table-td.scss +82 -60
- package/cjs/components/table/style/table-th.scss +5 -30
- package/cjs/components/table/style/table-tr.scss +0 -20
- package/cjs/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
- package/cjs/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
- package/cjs/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
- package/cjs/components/table/style/themes/dnb-table-theme-ui.css +14 -9
- package/cjs/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/cjs/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
- package/cjs/components/table/useTableAnimationHandler.d.ts +20 -0
- package/cjs/components/table/useTableAnimationHandler.js +73 -0
- package/cjs/components/table/useTableAnimationHandler.js.map +1 -0
- package/cjs/components/textarea/Textarea.d.ts +4 -10
- package/cjs/components/textarea/TextareaDocs.d.ts +2 -0
- package/cjs/components/textarea/TextareaDocs.js +105 -0
- package/cjs/components/textarea/TextareaDocs.js.map +1 -0
- package/cjs/components/textarea/style/dnb-textarea.css +1 -0
- package/cjs/components/textarea/style/dnb-textarea.min.css +1 -1
- package/cjs/components/textarea/style/dnb-textarea.scss +3 -0
- package/cjs/components/upload/UploadInfo.js +1 -1
- package/cjs/components/upload/UploadInfo.js.map +1 -1
- package/cjs/core/jest/jestSetupScreenshots.css +7 -0
- package/cjs/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
- package/cjs/elements/lib.d.ts +1 -1
- package/cjs/elements/lists/Dl.d.ts +5 -1
- package/cjs/elements/lists/Dl.js +5 -4
- package/cjs/elements/lists/Dl.js.map +1 -1
- package/cjs/elements/lists/style/lists-mixins.scss +24 -1
- package/cjs/extensions/forms/DataContext/Context.d.ts +1 -2
- package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
- package/cjs/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
- package/cjs/extensions/forms/DataContext/Provider/Provider.js +54 -40
- package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/cjs/extensions/forms/Field/Currency/Currency.js +1 -1
- package/cjs/extensions/forms/Field/Currency/Currency.js.map +1 -1
- package/cjs/extensions/forms/Field/Expiry/Expiry.js +1 -0
- package/cjs/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
- package/cjs/extensions/forms/Field/FieldDocs.d.ts +3 -0
- package/cjs/extensions/forms/Field/FieldDocs.js +18 -0
- package/cjs/extensions/forms/Field/FieldDocs.js.map +1 -0
- package/cjs/extensions/forms/Field/Number/Number.d.ts +1 -0
- package/cjs/extensions/forms/Field/Number/Number.js +13 -7
- package/cjs/extensions/forms/Field/Number/Number.js.map +1 -1
- package/cjs/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
- package/cjs/extensions/forms/Field/Number/NumberDocs.js +92 -0
- package/cjs/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
- package/cjs/extensions/forms/Field/Number/style/dnb-number.css +3 -1
- package/cjs/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/cjs/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
- package/cjs/extensions/forms/Field/Password/Password.d.ts +45 -0
- package/cjs/extensions/forms/Field/Password/Password.js +111 -0
- package/cjs/extensions/forms/Field/Password/Password.js.map +1 -0
- package/cjs/extensions/forms/Field/Password/index.d.ts +2 -0
- package/cjs/extensions/forms/Field/Password/index.js +27 -0
- package/cjs/extensions/forms/Field/Password/index.js.map +1 -0
- package/cjs/extensions/forms/Field/Password/style/dnb-password.css +6 -0
- package/cjs/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
- package/cjs/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
- package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
- package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
- package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
- package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
- package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
- package/cjs/extensions/forms/Field/Selection/Selection.d.ts +0 -1
- package/cjs/extensions/forms/Field/Selection/Selection.js +1 -9
- package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/cjs/extensions/forms/Field/String/String.d.ts +20 -9
- package/cjs/extensions/forms/Field/String/String.js +52 -31
- package/cjs/extensions/forms/Field/String/String.js.map +1 -1
- package/cjs/extensions/forms/Field/String/StringDocs.d.ts +2 -0
- package/cjs/extensions/forms/Field/String/StringDocs.js +106 -0
- package/cjs/extensions/forms/Field/String/StringDocs.js.map +1 -0
- package/cjs/extensions/forms/Field/Toggle/Toggle.js +1 -1
- package/cjs/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/cjs/extensions/forms/Field/index.d.ts +1 -0
- package/cjs/extensions/forms/Field/index.js +7 -0
- package/cjs/extensions/forms/Field/index.js.map +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
- package/cjs/extensions/forms/FieldBlock/FieldBlock.js +204 -62
- package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
- package/cjs/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
- package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.js +60 -0
- package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
- package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
- package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
- package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
- package/cjs/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
- package/cjs/extensions/forms/Form/Appearance/Appearance.js +38 -0
- package/cjs/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
- package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
- package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.js +15 -0
- package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
- package/cjs/extensions/forms/Form/Appearance/index.d.ts +2 -0
- package/cjs/extensions/forms/Form/Appearance/index.js +27 -0
- package/cjs/extensions/forms/Form/Appearance/index.js.map +1 -0
- package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
- package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
- package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
- package/cjs/extensions/forms/Form/data-context/useData.d.ts +1 -1
- package/cjs/extensions/forms/Form/data-context/useData.js +2 -18
- package/cjs/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/cjs/extensions/forms/Form/data-context/useError.d.ts +2 -1
- package/cjs/extensions/forms/Form/data-context/useError.js +4 -2
- package/cjs/extensions/forms/Form/data-context/useError.js.map +1 -1
- package/cjs/extensions/forms/Form/index.d.ts +1 -0
- package/cjs/extensions/forms/Form/index.js +7 -0
- package/cjs/extensions/forms/Form/index.js.map +1 -1
- package/cjs/extensions/forms/Value/Currency/Currency.js +2 -2
- package/cjs/extensions/forms/Value/Currency/Currency.js.map +1 -1
- package/cjs/extensions/forms/Value/Number/Number.d.ts +2 -2
- package/cjs/extensions/forms/Value/Number/Number.js +1 -1
- package/cjs/extensions/forms/Value/Number/Number.js.map +1 -1
- package/cjs/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
- package/cjs/extensions/forms/Value/SummaryList/SummaryList.js +35 -0
- package/cjs/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
- package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
- package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.js +12 -0
- package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
- package/cjs/extensions/forms/Value/SummaryList/index.d.ts +2 -0
- package/cjs/extensions/forms/Value/SummaryList/index.js +27 -0
- package/cjs/extensions/forms/Value/SummaryList/index.js.map +1 -0
- package/cjs/extensions/forms/Value/ValueDocs.d.ts +2 -0
- package/cjs/extensions/forms/Value/ValueDocs.js +40 -0
- package/cjs/extensions/forms/Value/ValueDocs.js.map +1 -0
- 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 +13 -3
- package/cjs/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/cjs/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
- package/cjs/extensions/forms/hooks/DataValueDocs.js +118 -0
- package/cjs/extensions/forms/hooks/DataValueDocs.js.map +1 -0
- package/cjs/extensions/forms/hooks/useDataValue.d.ts +6 -14
- package/cjs/extensions/forms/hooks/useDataValue.js +90 -21
- package/cjs/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/cjs/extensions/forms/hooks/useId.js +1 -1
- package/cjs/extensions/forms/hooks/useId.js.map +1 -1
- package/cjs/extensions/forms/hooks/useMountEffect.js +1 -1
- package/cjs/extensions/forms/hooks/useMountEffect.js.map +1 -1
- package/cjs/extensions/forms/hooks/useMounted.d.ts +2 -0
- package/cjs/extensions/forms/hooks/useMounted.js +19 -0
- package/cjs/extensions/forms/hooks/useMounted.js.map +1 -0
- package/cjs/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
- package/cjs/extensions/forms/hooks/useUnmountEffect.js +14 -0
- package/cjs/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
- package/cjs/extensions/forms/style/dnb-forms.css +45 -15
- package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
- package/cjs/extensions/forms/types.d.ts +6 -4
- package/cjs/extensions/forms/types.js.map +1 -1
- package/cjs/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
- package/cjs/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
- package/cjs/shared/Context.d.ts +2 -0
- 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/Theme.d.ts +7 -1
- package/cjs/shared/Theme.js +20 -7
- package/cjs/shared/Theme.js.map +1 -1
- package/cjs/shared/component-helper.d.ts +1 -0
- package/cjs/shared/component-helper.js +10 -0
- package/cjs/shared/component-helper.js.map +1 -1
- package/cjs/shared/helpers/debounce.d.ts +37 -0
- package/cjs/shared/helpers/debounce.js +92 -0
- package/cjs/shared/helpers/debounce.js.map +1 -0
- package/cjs/shared/helpers/filterValidProps.d.ts +2 -2
- package/cjs/shared/helpers/filterValidProps.js +2 -2
- package/cjs/shared/helpers/filterValidProps.js.map +1 -1
- package/cjs/shared/helpers/useSharedState.d.ts +1 -0
- package/cjs/shared/helpers/useSharedState.js +52 -20
- package/cjs/shared/helpers/useSharedState.js.map +1 -1
- package/cjs/shared/helpers/withCamelCaseProps.d.ts +14 -1
- package/cjs/shared/helpers/withCamelCaseProps.js.map +1 -1
- package/cjs/shared/helpers.d.ts +1 -25
- package/cjs/shared/helpers.js +15 -37
- package/cjs/shared/helpers.js.map +1 -1
- package/cjs/shared/locales/en-GB.d.ts +5 -3
- package/cjs/shared/locales/en-GB.js +7 -5
- package/cjs/shared/locales/en-GB.js.map +1 -1
- package/cjs/shared/locales/en-US.d.ts +5 -3
- package/cjs/shared/locales/index.d.ts +10 -6
- package/cjs/shared/locales/nb-NO.d.ts +5 -3
- package/cjs/shared/locales/nb-NO.js +7 -5
- package/cjs/shared/locales/nb-NO.js.map +1 -1
- package/cjs/shared/types.d.ts +5 -0
- package/cjs/shared/types.js.map +1 -1
- package/cjs/shared/useTheme.d.ts +1 -0
- package/cjs/style/dnb-ui-components.css +359 -171
- package/cjs/style/dnb-ui-components.min.css +3 -3
- package/cjs/style/dnb-ui-elements.css +25 -5
- package/cjs/style/dnb-ui-elements.min.css +1 -1
- package/cjs/style/dnb-ui-extensions.css +45 -15
- package/cjs/style/dnb-ui-extensions.min.css +1 -1
- package/cjs/style/dnb-ui-forms.css +45 -15
- package/cjs/style/dnb-ui-forms.min.css +1 -1
- package/cjs/style/dnb-ui-forms.scss +1 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
- package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
- package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
- package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
- package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
- package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
- package/cjs/style/themes/theme-ui/ui-theme-basis.css +25 -5
- package/cjs/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +421 -195
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/cjs/style/themes/theme-ui/ui-theme-elements.css +25 -5
- package/cjs/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-extensions.css +45 -15
- package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-forms.css +45 -15
- package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-tags.css +25 -5
- package/cjs/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
- package/components/aria-live/useAriaLive.d.ts +1 -1
- package/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/components/breadcrumb/Breadcrumb.js +3 -3
- package/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
- package/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
- package/components/button/Button.js +2 -2
- package/components/button/Button.js.map +1 -1
- package/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
- package/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
- package/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
- package/components/card/style/dnb-card.css +11 -2
- package/components/card/style/dnb-card.min.css +1 -1
- package/components/card/style/dnb-card.scss +12 -2
- package/components/date-picker/DatePicker.d.ts +10 -1
- package/components/date-picker/DatePicker.js +5 -2
- package/components/date-picker/DatePicker.js.map +1 -1
- package/components/form-label/style/dnb-form-label.css +4 -8
- package/components/form-label/style/dnb-form-label.min.css +1 -1
- package/components/form-label/style/dnb-form-label.scss +5 -8
- package/components/form-status/style/dnb-form-status.css +11 -0
- package/components/form-status/style/dnb-form-status.min.css +1 -1
- package/components/form-status/style/dnb-form-status.scss +11 -0
- package/components/global-status/GlobalStatus.d.ts +1 -1
- package/components/global-status/GlobalStatusProvider.d.ts +1 -1
- package/components/height-animation/HeightAnimationInstance.d.ts +5 -6
- package/components/height-animation/HeightAnimationInstance.js +12 -12
- package/components/height-animation/HeightAnimationInstance.js.map +1 -1
- package/components/height-animation/useHeightAnimation.js +11 -10
- package/components/height-animation/useHeightAnimation.js.map +1 -1
- package/components/info-card/InfoCard.d.ts +6 -0
- package/components/info-card/InfoCard.js +4 -2
- package/components/info-card/InfoCard.js.map +1 -1
- package/components/info-card/style/dnb-info-card.css +3 -1
- package/components/info-card/style/dnb-info-card.min.css +1 -1
- package/components/info-card/style/dnb-info-card.scss +4 -2
- package/components/input/Input.d.ts +9 -9
- package/components/input/InputDocs.d.ts +2 -0
- package/components/input/InputDocs.js +158 -0
- package/components/input/InputDocs.js.map +1 -0
- package/components/input/InputPassword.d.ts +6 -17
- package/components/input/InputPassword.js +3 -81
- package/components/input/InputPassword.js.map +1 -1
- package/components/input-masked/InputMasked.d.ts +6 -93
- package/components/input-masked/InputMasked.js +3 -1
- package/components/input-masked/InputMasked.js.map +1 -1
- package/components/input-masked/InputMaskedDocs.d.ts +2 -0
- package/components/input-masked/InputMaskedDocs.js +78 -0
- package/components/input-masked/InputMaskedDocs.js.map +1 -0
- package/components/input-masked/InputMaskedHooks.js +7 -4
- package/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/components/input-masked/MultiInputMask.js +2 -6
- package/components/input-masked/MultiInputMask.js.map +1 -1
- package/components/input-masked/style/dnb-input-masked.css +3 -0
- package/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/components/input-masked/style/dnb-input-masked.scss +5 -0
- package/components/number-format/NumberFormat.d.ts +1 -1
- package/components/number-format/NumberUtils.js +22 -14
- package/components/number-format/NumberUtils.js.map +1 -1
- package/components/pagination/InfinityScroller.d.ts +1 -1
- package/components/progress-indicator/ProgressIndicator.js +5 -7
- package/components/progress-indicator/ProgressIndicator.js.map +1 -1
- package/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
- package/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
- package/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
- package/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
- package/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
- package/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
- package/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
- package/components/slider/Slider.d.ts +1 -0
- package/components/slider/Slider.js +1 -0
- package/components/slider/Slider.js.map +1 -1
- package/components/slider/SliderInstance.js +18 -5
- package/components/slider/SliderInstance.js.map +1 -1
- package/components/slider/SliderMarker.d.ts +7 -0
- package/components/slider/SliderMarker.js +53 -0
- package/components/slider/SliderMarker.js.map +1 -0
- package/components/slider/SliderProvider.js +2 -1
- package/components/slider/SliderProvider.js.map +1 -1
- package/components/slider/style/dnb-slider.css +43 -2
- package/components/slider/style/dnb-slider.min.css +1 -1
- package/components/slider/style/dnb-slider.scss +44 -1
- package/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
- package/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
- package/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
- package/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
- package/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
- package/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
- package/components/slider/types.d.ts +6 -0
- package/components/slider/types.js.map +1 -1
- package/components/space/SpacingHelper.d.ts +5 -5
- package/components/table/Table.js +1 -1
- package/components/table/Table.js.map +1 -1
- package/components/table/TableAccordion.js +40 -54
- package/components/table/TableAccordion.js.map +1 -1
- package/components/table/TableAccordionTd.d.ts +9 -0
- package/{es/components/table/TableAccordionContent.js → components/table/TableAccordionTd.js} +16 -50
- package/components/table/TableAccordionTd.js.map +1 -0
- package/components/table/TableAccordionTr.d.ts +13 -0
- package/components/table/TableAccordionTr.js +51 -0
- package/components/table/TableAccordionTr.js.map +1 -0
- package/components/table/TableContext.d.ts +2 -2
- package/components/table/TableContext.js +2 -2
- package/components/table/TableContext.js.map +1 -1
- package/components/table/TableTd.d.ts +2 -2
- package/components/table/TableTd.js +2 -2
- package/components/table/TableTd.js.map +1 -1
- package/components/table/TableTr.d.ts +6 -1
- package/components/table/TableTr.js +9 -4
- package/components/table/TableTr.js.map +1 -1
- package/components/table/style/dnb-table.css +226 -139
- package/components/table/style/dnb-table.min.css +1 -1
- package/components/table/style/dnb-table.scss +60 -4
- package/components/table/style/table-accordion.scss +83 -98
- package/components/table/style/table-container.scss +9 -9
- package/components/table/style/table-mixins.scss +19 -2
- package/components/table/style/table-td.scss +82 -60
- package/components/table/style/table-th.scss +5 -30
- package/components/table/style/table-tr.scss +0 -20
- package/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
- package/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
- package/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
- package/components/table/style/themes/dnb-table-theme-ui.css +14 -9
- package/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
- package/components/table/useTableAnimationHandler.d.ts +20 -0
- package/components/table/useTableAnimationHandler.js +63 -0
- package/components/table/useTableAnimationHandler.js.map +1 -0
- package/components/textarea/Textarea.d.ts +4 -10
- package/components/textarea/TextareaDocs.d.ts +2 -0
- package/components/textarea/TextareaDocs.js +98 -0
- package/components/textarea/TextareaDocs.js.map +1 -0
- package/components/textarea/style/dnb-textarea.css +1 -0
- package/components/textarea/style/dnb-textarea.min.css +1 -1
- package/components/textarea/style/dnb-textarea.scss +3 -0
- package/components/upload/UploadInfo.js +1 -1
- package/components/upload/UploadInfo.js.map +1 -1
- package/core/jest/jestSetupScreenshots.css +7 -0
- package/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
- package/elements/lib.d.ts +1 -1
- package/elements/lists/Dl.d.ts +5 -1
- package/elements/lists/Dl.js +5 -4
- package/elements/lists/Dl.js.map +1 -1
- package/elements/lists/style/lists-mixins.scss +24 -1
- package/es/components/aria-live/useAriaLive.d.ts +1 -1
- package/es/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/es/components/breadcrumb/Breadcrumb.js +3 -3
- package/es/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/es/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
- package/es/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/es/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
- package/es/components/button/Button.js +2 -2
- package/es/components/button/Button.js.map +1 -1
- package/es/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
- package/es/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
- package/es/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
- package/es/components/card/style/dnb-card.css +11 -2
- package/es/components/card/style/dnb-card.min.css +1 -1
- package/es/components/card/style/dnb-card.scss +12 -2
- package/es/components/date-picker/DatePicker.d.ts +10 -1
- package/es/components/date-picker/DatePicker.js +5 -2
- package/es/components/date-picker/DatePicker.js.map +1 -1
- package/es/components/form-label/style/dnb-form-label.css +4 -8
- package/es/components/form-label/style/dnb-form-label.min.css +1 -1
- package/es/components/form-label/style/dnb-form-label.scss +5 -8
- package/es/components/form-status/style/dnb-form-status.css +11 -0
- package/es/components/form-status/style/dnb-form-status.min.css +1 -1
- package/es/components/form-status/style/dnb-form-status.scss +11 -0
- package/es/components/global-status/GlobalStatus.d.ts +1 -1
- package/es/components/global-status/GlobalStatusProvider.d.ts +1 -1
- package/es/components/height-animation/HeightAnimationInstance.d.ts +5 -6
- package/es/components/height-animation/HeightAnimationInstance.js +12 -12
- package/es/components/height-animation/HeightAnimationInstance.js.map +1 -1
- package/es/components/height-animation/useHeightAnimation.js +11 -10
- package/es/components/height-animation/useHeightAnimation.js.map +1 -1
- package/es/components/info-card/InfoCard.d.ts +6 -0
- package/es/components/info-card/InfoCard.js +4 -2
- package/es/components/info-card/InfoCard.js.map +1 -1
- package/es/components/info-card/style/dnb-info-card.css +3 -1
- package/es/components/info-card/style/dnb-info-card.min.css +1 -1
- package/es/components/info-card/style/dnb-info-card.scss +4 -2
- package/es/components/input/Input.d.ts +9 -9
- package/es/components/input/InputDocs.d.ts +2 -0
- package/es/components/input/InputDocs.js +158 -0
- package/es/components/input/InputDocs.js.map +1 -0
- package/es/components/input/InputPassword.d.ts +6 -17
- package/es/components/input/InputPassword.js +3 -81
- package/es/components/input/InputPassword.js.map +1 -1
- package/es/components/input-masked/InputMasked.d.ts +6 -93
- package/es/components/input-masked/InputMasked.js +3 -1
- package/es/components/input-masked/InputMasked.js.map +1 -1
- package/es/components/input-masked/InputMaskedDocs.d.ts +2 -0
- package/es/components/input-masked/InputMaskedDocs.js +78 -0
- package/es/components/input-masked/InputMaskedDocs.js.map +1 -0
- package/es/components/input-masked/InputMaskedHooks.js +7 -4
- package/es/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/es/components/input-masked/MultiInputMask.js +2 -6
- package/es/components/input-masked/MultiInputMask.js.map +1 -1
- package/es/components/input-masked/style/dnb-input-masked.css +3 -0
- package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/es/components/input-masked/style/dnb-input-masked.scss +5 -0
- package/es/components/number-format/NumberFormat.d.ts +1 -1
- package/es/components/number-format/NumberUtils.js +23 -14
- package/es/components/number-format/NumberUtils.js.map +1 -1
- package/es/components/pagination/InfinityScroller.d.ts +1 -1
- package/es/components/progress-indicator/ProgressIndicator.js +5 -7
- package/es/components/progress-indicator/ProgressIndicator.js.map +1 -1
- package/es/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
- package/es/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
- package/es/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
- package/es/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
- package/es/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
- package/es/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
- package/es/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
- package/es/components/slider/Slider.d.ts +1 -0
- package/es/components/slider/Slider.js +1 -0
- package/es/components/slider/Slider.js.map +1 -1
- package/es/components/slider/SliderInstance.js +17 -5
- package/es/components/slider/SliderInstance.js.map +1 -1
- package/es/components/slider/SliderMarker.d.ts +7 -0
- package/es/components/slider/SliderMarker.js +52 -0
- package/es/components/slider/SliderMarker.js.map +1 -0
- package/es/components/slider/SliderProvider.js +2 -1
- package/es/components/slider/SliderProvider.js.map +1 -1
- package/es/components/slider/style/dnb-slider.css +43 -2
- package/es/components/slider/style/dnb-slider.min.css +1 -1
- package/es/components/slider/style/dnb-slider.scss +44 -1
- package/es/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
- package/es/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
- package/es/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
- package/es/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
- package/es/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
- package/es/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
- package/es/components/slider/types.d.ts +6 -0
- package/es/components/slider/types.js.map +1 -1
- package/es/components/space/SpacingHelper.d.ts +5 -5
- package/es/components/table/Table.js +1 -1
- package/es/components/table/Table.js.map +1 -1
- package/es/components/table/TableAccordion.js +40 -55
- package/es/components/table/TableAccordion.js.map +1 -1
- package/es/components/table/TableAccordionTd.d.ts +9 -0
- package/{components/table/TableAccordionContent.js → es/components/table/TableAccordionTd.js} +16 -51
- package/es/components/table/TableAccordionTd.js.map +1 -0
- package/es/components/table/TableAccordionTr.d.ts +13 -0
- package/es/components/table/TableAccordionTr.js +51 -0
- package/es/components/table/TableAccordionTr.js.map +1 -0
- package/es/components/table/TableContext.d.ts +2 -2
- package/es/components/table/TableContext.js +2 -2
- package/es/components/table/TableContext.js.map +1 -1
- package/es/components/table/TableTd.d.ts +2 -2
- package/es/components/table/TableTd.js +2 -2
- package/es/components/table/TableTd.js.map +1 -1
- package/es/components/table/TableTr.d.ts +6 -1
- package/es/components/table/TableTr.js +9 -4
- package/es/components/table/TableTr.js.map +1 -1
- package/es/components/table/style/dnb-table.css +226 -139
- package/es/components/table/style/dnb-table.min.css +1 -1
- package/es/components/table/style/dnb-table.scss +60 -4
- package/es/components/table/style/table-accordion.scss +83 -98
- package/es/components/table/style/table-container.scss +9 -9
- package/es/components/table/style/table-mixins.scss +19 -2
- package/es/components/table/style/table-td.scss +82 -60
- package/es/components/table/style/table-th.scss +5 -30
- package/es/components/table/style/table-tr.scss +0 -20
- package/es/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
- package/es/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
- package/es/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
- package/es/components/table/style/themes/dnb-table-theme-ui.css +14 -9
- package/es/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/es/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
- package/es/components/table/useTableAnimationHandler.d.ts +20 -0
- package/es/components/table/useTableAnimationHandler.js +62 -0
- package/es/components/table/useTableAnimationHandler.js.map +1 -0
- package/es/components/textarea/Textarea.d.ts +4 -10
- package/es/components/textarea/TextareaDocs.d.ts +2 -0
- package/es/components/textarea/TextareaDocs.js +98 -0
- package/es/components/textarea/TextareaDocs.js.map +1 -0
- package/es/components/textarea/style/dnb-textarea.css +1 -0
- package/es/components/textarea/style/dnb-textarea.min.css +1 -1
- package/es/components/textarea/style/dnb-textarea.scss +3 -0
- package/es/components/upload/UploadInfo.js +1 -1
- package/es/components/upload/UploadInfo.js.map +1 -1
- package/es/core/jest/jestSetupScreenshots.css +7 -0
- package/es/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
- package/es/elements/lib.d.ts +1 -1
- package/es/elements/lists/Dl.d.ts +5 -1
- package/es/elements/lists/Dl.js +5 -4
- package/es/elements/lists/Dl.js.map +1 -1
- package/es/elements/lists/style/lists-mixins.scss +24 -1
- package/es/extensions/forms/DataContext/Context.d.ts +1 -2
- package/es/extensions/forms/DataContext/Context.js.map +1 -1
- package/es/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
- package/es/extensions/forms/DataContext/Provider/Provider.js +54 -40
- package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/es/extensions/forms/Field/Currency/Currency.js +1 -1
- package/es/extensions/forms/Field/Currency/Currency.js.map +1 -1
- package/es/extensions/forms/Field/Expiry/Expiry.js +1 -0
- package/es/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
- package/es/extensions/forms/Field/FieldDocs.d.ts +3 -0
- package/es/extensions/forms/Field/FieldDocs.js +8 -0
- package/es/extensions/forms/Field/FieldDocs.js.map +1 -0
- package/es/extensions/forms/Field/Number/Number.d.ts +1 -0
- package/es/extensions/forms/Field/Number/Number.js +13 -7
- package/es/extensions/forms/Field/Number/Number.js.map +1 -1
- package/es/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
- package/es/extensions/forms/Field/Number/NumberDocs.js +85 -0
- package/es/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
- package/es/extensions/forms/Field/Number/style/dnb-number.css +3 -1
- package/es/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/es/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
- package/es/extensions/forms/Field/Password/Password.d.ts +45 -0
- package/es/extensions/forms/Field/Password/Password.js +99 -0
- package/es/extensions/forms/Field/Password/Password.js.map +1 -0
- package/es/extensions/forms/Field/Password/index.d.ts +2 -0
- package/es/extensions/forms/Field/Password/index.js +3 -0
- package/es/extensions/forms/Field/Password/index.js.map +1 -0
- package/es/extensions/forms/Field/Password/style/dnb-password.css +6 -0
- package/es/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
- package/es/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
- package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
- package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
- package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
- package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
- package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
- package/es/extensions/forms/Field/Selection/Selection.d.ts +0 -1
- package/es/extensions/forms/Field/Selection/Selection.js +2 -11
- package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/es/extensions/forms/Field/String/String.d.ts +20 -9
- package/es/extensions/forms/Field/String/String.js +52 -31
- package/es/extensions/forms/Field/String/String.js.map +1 -1
- package/es/extensions/forms/Field/String/StringDocs.d.ts +2 -0
- package/es/extensions/forms/Field/String/StringDocs.js +99 -0
- package/es/extensions/forms/Field/String/StringDocs.js.map +1 -0
- package/es/extensions/forms/Field/Toggle/Toggle.js +1 -1
- package/es/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/es/extensions/forms/Field/index.d.ts +1 -0
- package/es/extensions/forms/Field/index.js +1 -0
- package/es/extensions/forms/Field/index.js.map +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
- package/es/extensions/forms/FieldBlock/FieldBlock.js +195 -58
- package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
- package/es/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
- package/es/extensions/forms/FieldBlock/FieldBlockDocs.js +53 -0
- package/es/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
- package/es/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
- package/es/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
- package/es/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
- package/es/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
- package/es/extensions/forms/Form/Appearance/Appearance.js +30 -0
- package/es/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
- package/es/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
- package/es/extensions/forms/Form/Appearance/AppearanceDocs.js +8 -0
- package/es/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
- package/es/extensions/forms/Form/Appearance/index.d.ts +2 -0
- package/es/extensions/forms/Form/Appearance/index.js +3 -0
- package/es/extensions/forms/Form/Appearance/index.js.map +1 -0
- package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
- package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
- package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
- package/es/extensions/forms/Form/data-context/useData.d.ts +1 -1
- package/es/extensions/forms/Form/data-context/useData.js +3 -19
- package/es/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/es/extensions/forms/Form/data-context/useError.d.ts +2 -1
- package/es/extensions/forms/Form/data-context/useError.js +4 -2
- package/es/extensions/forms/Form/data-context/useError.js.map +1 -1
- package/es/extensions/forms/Form/index.d.ts +1 -0
- package/es/extensions/forms/Form/index.js +1 -0
- package/es/extensions/forms/Form/index.js.map +1 -1
- package/es/extensions/forms/Value/Currency/Currency.js +2 -2
- package/es/extensions/forms/Value/Currency/Currency.js.map +1 -1
- package/es/extensions/forms/Value/Number/Number.d.ts +2 -2
- package/es/extensions/forms/Value/Number/Number.js +1 -1
- package/es/extensions/forms/Value/Number/Number.js.map +1 -1
- package/es/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
- package/es/extensions/forms/Value/SummaryList/SummaryList.js +26 -0
- package/es/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
- package/es/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
- package/es/extensions/forms/Value/SummaryList/SummaryListContext.js +4 -0
- package/es/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
- package/es/extensions/forms/Value/SummaryList/index.d.ts +2 -0
- package/es/extensions/forms/Value/SummaryList/index.js +3 -0
- package/es/extensions/forms/Value/SummaryList/index.js.map +1 -0
- package/es/extensions/forms/Value/ValueDocs.d.ts +2 -0
- package/es/extensions/forms/Value/ValueDocs.js +33 -0
- package/es/extensions/forms/Value/ValueDocs.js.map +1 -0
- 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 +12 -4
- package/es/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/es/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
- package/es/extensions/forms/hooks/DataValueDocs.js +110 -0
- package/es/extensions/forms/hooks/DataValueDocs.js.map +1 -0
- package/es/extensions/forms/hooks/useDataValue.d.ts +6 -14
- package/es/extensions/forms/hooks/useDataValue.js +92 -23
- package/es/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/es/extensions/forms/hooks/useId.js +1 -1
- package/es/extensions/forms/hooks/useId.js.map +1 -1
- package/es/extensions/forms/hooks/useMountEffect.js +1 -1
- package/es/extensions/forms/hooks/useMountEffect.js.map +1 -1
- package/es/extensions/forms/hooks/useMounted.d.ts +2 -0
- package/es/extensions/forms/hooks/useMounted.js +14 -0
- package/es/extensions/forms/hooks/useMounted.js.map +1 -0
- package/es/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
- package/es/extensions/forms/hooks/useUnmountEffect.js +9 -0
- package/es/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
- package/es/extensions/forms/style/dnb-forms.css +45 -15
- package/es/extensions/forms/style/dnb-forms.min.css +1 -1
- package/es/extensions/forms/types.d.ts +6 -4
- package/es/extensions/forms/types.js.map +1 -1
- package/es/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
- package/es/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
- package/es/shared/Context.d.ts +2 -0
- 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/Theme.d.ts +7 -1
- package/es/shared/Theme.js +20 -7
- package/es/shared/Theme.js.map +1 -1
- package/es/shared/component-helper.d.ts +1 -0
- package/es/shared/component-helper.js +6 -0
- package/es/shared/component-helper.js.map +1 -1
- package/es/shared/helpers/debounce.d.ts +37 -0
- package/es/shared/helpers/debounce.js +76 -0
- package/es/shared/helpers/debounce.js.map +1 -0
- package/es/shared/helpers/filterValidProps.d.ts +2 -2
- package/es/shared/helpers/filterValidProps.js +2 -2
- package/es/shared/helpers/filterValidProps.js.map +1 -1
- package/es/shared/helpers/useSharedState.d.ts +1 -0
- package/es/shared/helpers/useSharedState.js +49 -20
- package/es/shared/helpers/useSharedState.js.map +1 -1
- package/es/shared/helpers/withCamelCaseProps.d.ts +14 -1
- package/es/shared/helpers/withCamelCaseProps.js.map +1 -1
- package/es/shared/helpers.d.ts +1 -25
- package/es/shared/helpers.js +1 -29
- package/es/shared/helpers.js.map +1 -1
- package/es/shared/locales/en-GB.d.ts +5 -3
- package/es/shared/locales/en-GB.js +7 -5
- package/es/shared/locales/en-GB.js.map +1 -1
- package/es/shared/locales/en-US.d.ts +5 -3
- package/es/shared/locales/index.d.ts +10 -6
- package/es/shared/locales/nb-NO.d.ts +5 -3
- package/es/shared/locales/nb-NO.js +7 -5
- package/es/shared/locales/nb-NO.js.map +1 -1
- package/es/shared/types.d.ts +5 -0
- package/es/shared/types.js.map +1 -1
- package/es/shared/useTheme.d.ts +1 -0
- package/es/style/dnb-ui-components.css +359 -171
- package/es/style/dnb-ui-components.min.css +3 -3
- package/es/style/dnb-ui-elements.css +25 -5
- package/es/style/dnb-ui-elements.min.css +1 -1
- package/es/style/dnb-ui-extensions.css +45 -15
- package/es/style/dnb-ui-extensions.min.css +1 -1
- package/es/style/dnb-ui-forms.css +45 -15
- package/es/style/dnb-ui-forms.min.css +1 -1
- package/es/style/dnb-ui-forms.scss +1 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
- package/es/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/es/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
- package/es/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
- package/es/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
- package/es/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
- package/es/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/es/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
- package/es/style/themes/theme-ui/ui-theme-basis.css +25 -5
- package/es/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +421 -195
- package/es/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/es/style/themes/theme-ui/ui-theme-elements.css +25 -5
- package/es/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-extensions.css +45 -15
- package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-forms.css +45 -15
- package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-tags.css +25 -5
- package/es/style/themes/theme-ui/ui-theme-tags.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 +3 -3
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/DataContext/Context.d.ts +1 -2
- package/extensions/forms/DataContext/Context.js.map +1 -1
- package/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
- package/extensions/forms/DataContext/Provider/Provider.js +54 -40
- package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
- package/extensions/forms/Field/Currency/Currency.js +1 -1
- package/extensions/forms/Field/Currency/Currency.js.map +1 -1
- package/extensions/forms/Field/Expiry/Expiry.js +1 -0
- package/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
- package/extensions/forms/Field/FieldDocs.d.ts +3 -0
- package/extensions/forms/Field/FieldDocs.js +8 -0
- package/extensions/forms/Field/FieldDocs.js.map +1 -0
- package/extensions/forms/Field/Number/Number.d.ts +1 -0
- package/extensions/forms/Field/Number/Number.js +13 -7
- package/extensions/forms/Field/Number/Number.js.map +1 -1
- package/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
- package/extensions/forms/Field/Number/NumberDocs.js +85 -0
- package/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
- package/extensions/forms/Field/Number/style/dnb-number.css +3 -1
- package/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
- package/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
- package/extensions/forms/Field/Password/Password.d.ts +45 -0
- package/extensions/forms/Field/Password/Password.js +99 -0
- package/extensions/forms/Field/Password/Password.js.map +1 -0
- package/extensions/forms/Field/Password/index.d.ts +2 -0
- package/extensions/forms/Field/Password/index.js +3 -0
- package/extensions/forms/Field/Password/index.js.map +1 -0
- package/extensions/forms/Field/Password/style/dnb-password.css +6 -0
- package/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
- package/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
- package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
- package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
- package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
- package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
- package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
- package/extensions/forms/Field/Selection/Selection.d.ts +0 -1
- package/extensions/forms/Field/Selection/Selection.js +2 -11
- package/extensions/forms/Field/Selection/Selection.js.map +1 -1
- package/extensions/forms/Field/String/String.d.ts +20 -9
- package/extensions/forms/Field/String/String.js +52 -31
- package/extensions/forms/Field/String/String.js.map +1 -1
- package/extensions/forms/Field/String/StringDocs.d.ts +2 -0
- package/extensions/forms/Field/String/StringDocs.js +99 -0
- package/extensions/forms/Field/String/StringDocs.js.map +1 -0
- package/extensions/forms/Field/Toggle/Toggle.js +1 -1
- package/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
- package/extensions/forms/Field/index.d.ts +1 -0
- package/extensions/forms/Field/index.js +1 -0
- package/extensions/forms/Field/index.js.map +1 -1
- package/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
- package/extensions/forms/FieldBlock/FieldBlock.js +203 -64
- package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
- package/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
- package/extensions/forms/FieldBlock/FieldBlockDocs.js +53 -0
- package/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
- package/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
- package/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
- package/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
- package/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
- package/extensions/forms/Form/Appearance/Appearance.js +30 -0
- package/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
- package/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
- package/extensions/forms/Form/Appearance/AppearanceDocs.js +8 -0
- package/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
- package/extensions/forms/Form/Appearance/index.d.ts +2 -0
- package/extensions/forms/Form/Appearance/index.js +3 -0
- package/extensions/forms/Form/Appearance/index.js.map +1 -0
- package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
- package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
- package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
- package/extensions/forms/Form/data-context/useData.d.ts +1 -1
- package/extensions/forms/Form/data-context/useData.js +3 -19
- package/extensions/forms/Form/data-context/useData.js.map +1 -1
- package/extensions/forms/Form/data-context/useError.d.ts +2 -1
- package/extensions/forms/Form/data-context/useError.js +4 -2
- package/extensions/forms/Form/data-context/useError.js.map +1 -1
- package/extensions/forms/Form/index.d.ts +1 -0
- package/extensions/forms/Form/index.js +1 -0
- package/extensions/forms/Form/index.js.map +1 -1
- package/extensions/forms/Value/Currency/Currency.js +2 -2
- package/extensions/forms/Value/Currency/Currency.js.map +1 -1
- package/extensions/forms/Value/Number/Number.d.ts +2 -2
- package/extensions/forms/Value/Number/Number.js +1 -1
- package/extensions/forms/Value/Number/Number.js.map +1 -1
- package/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
- package/extensions/forms/Value/SummaryList/SummaryList.js +26 -0
- package/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
- package/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
- package/extensions/forms/Value/SummaryList/SummaryListContext.js +4 -0
- package/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
- package/extensions/forms/Value/SummaryList/index.d.ts +2 -0
- package/extensions/forms/Value/SummaryList/index.js +3 -0
- package/extensions/forms/Value/SummaryList/index.js.map +1 -0
- package/extensions/forms/Value/ValueDocs.d.ts +2 -0
- package/extensions/forms/Value/ValueDocs.js +33 -0
- package/extensions/forms/Value/ValueDocs.js.map +1 -0
- 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 +12 -4
- package/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
- package/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
- package/extensions/forms/hooks/DataValueDocs.js +110 -0
- package/extensions/forms/hooks/DataValueDocs.js.map +1 -0
- package/extensions/forms/hooks/useDataValue.d.ts +6 -14
- package/extensions/forms/hooks/useDataValue.js +92 -23
- package/extensions/forms/hooks/useDataValue.js.map +1 -1
- package/extensions/forms/hooks/useId.js +1 -1
- package/extensions/forms/hooks/useId.js.map +1 -1
- package/extensions/forms/hooks/useMountEffect.js +1 -1
- package/extensions/forms/hooks/useMountEffect.js.map +1 -1
- package/extensions/forms/hooks/useMounted.d.ts +2 -0
- package/extensions/forms/hooks/useMounted.js +14 -0
- package/extensions/forms/hooks/useMounted.js.map +1 -0
- package/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
- package/extensions/forms/hooks/useUnmountEffect.js +9 -0
- package/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
- package/extensions/forms/style/dnb-forms.css +45 -15
- package/extensions/forms/style/dnb-forms.min.css +1 -1
- package/extensions/forms/types.d.ts +6 -4
- package/extensions/forms/types.js.map +1 -1
- package/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
- package/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
- package/package.json +1 -1
- package/shared/Context.d.ts +2 -0
- 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/Theme.d.ts +7 -1
- package/shared/Theme.js +20 -7
- package/shared/Theme.js.map +1 -1
- package/shared/component-helper.d.ts +1 -0
- package/shared/component-helper.js +9 -0
- package/shared/component-helper.js.map +1 -1
- package/shared/helpers/debounce.d.ts +37 -0
- package/shared/helpers/debounce.js +83 -0
- package/shared/helpers/debounce.js.map +1 -0
- package/shared/helpers/filterValidProps.d.ts +2 -2
- package/shared/helpers/filterValidProps.js +2 -2
- package/shared/helpers/filterValidProps.js.map +1 -1
- package/shared/helpers/useSharedState.d.ts +1 -0
- package/shared/helpers/useSharedState.js +49 -20
- package/shared/helpers/useSharedState.js.map +1 -1
- package/shared/helpers/withCamelCaseProps.d.ts +14 -1
- package/shared/helpers/withCamelCaseProps.js.map +1 -1
- package/shared/helpers.d.ts +1 -25
- package/shared/helpers.js +3 -36
- package/shared/helpers.js.map +1 -1
- package/shared/locales/en-GB.d.ts +5 -3
- package/shared/locales/en-GB.js +7 -5
- package/shared/locales/en-GB.js.map +1 -1
- package/shared/locales/en-US.d.ts +5 -3
- package/shared/locales/index.d.ts +10 -6
- package/shared/locales/nb-NO.d.ts +5 -3
- package/shared/locales/nb-NO.js +7 -5
- package/shared/locales/nb-NO.js.map +1 -1
- package/shared/types.d.ts +5 -0
- package/shared/types.js.map +1 -1
- package/shared/useTheme.d.ts +1 -0
- package/style/dnb-ui-components.css +359 -171
- package/style/dnb-ui-components.min.css +3 -3
- package/style/dnb-ui-elements.css +25 -5
- package/style/dnb-ui-elements.min.css +1 -1
- package/style/dnb-ui-extensions.css +45 -15
- package/style/dnb-ui-extensions.min.css +1 -1
- package/style/dnb-ui-forms.css +45 -15
- package/style/dnb-ui-forms.min.css +1 -1
- package/style/dnb-ui-forms.scss +1 -0
- package/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
- package/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
- package/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
- package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
- package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
- package/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
- package/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
- package/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
- package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
- package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
- package/style/themes/theme-ui/ui-theme-basis.css +25 -5
- package/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +421 -195
- package/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/style/themes/theme-ui/ui-theme-elements.css +25 -5
- package/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-extensions.css +45 -15
- package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-forms.css +45 -15
- package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-tags.css +25 -5
- package/style/themes/theme-ui/ui-theme-tags.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 +3 -3
- package/umd/dnb-ui-lib.min.js +1 -1
- package/cjs/components/table/TableAccordionContent.d.ts +0 -18
- package/cjs/components/table/TableAccordionContent.js.map +0 -1
- package/components/table/TableAccordionContent.d.ts +0 -18
- package/components/table/TableAccordionContent.js.map +0 -1
- package/es/components/table/TableAccordionContent.d.ts +0 -18
- package/es/components/table/TableAccordionContent.js.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export const dataValueProperties = {
|
|
2
|
+
value: {
|
|
3
|
+
doc: 'Source data value for the input.',
|
|
4
|
+
type: '{valueType}',
|
|
5
|
+
status: 'optional'
|
|
6
|
+
},
|
|
7
|
+
path: {
|
|
8
|
+
doc: 'JSON Pointer for where the data for this input is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',
|
|
9
|
+
type: 'string',
|
|
10
|
+
status: 'optional'
|
|
11
|
+
},
|
|
12
|
+
id: {
|
|
13
|
+
doc: 'Unique id for connecting Form.Handler and helper tools such as Form.useData.',
|
|
14
|
+
type: 'string',
|
|
15
|
+
status: 'optional'
|
|
16
|
+
},
|
|
17
|
+
info: {
|
|
18
|
+
doc: 'Info message shown below / after the input.',
|
|
19
|
+
type: 'React.Node',
|
|
20
|
+
status: 'optional'
|
|
21
|
+
},
|
|
22
|
+
warning: {
|
|
23
|
+
doc: 'Warning message shown below / after the input.',
|
|
24
|
+
type: 'React.Node',
|
|
25
|
+
status: 'optional'
|
|
26
|
+
},
|
|
27
|
+
error: {
|
|
28
|
+
doc: 'Error message shown below / after the input.',
|
|
29
|
+
type: 'Error',
|
|
30
|
+
status: 'optional'
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
doc: 'Set `true` to show the field but without the possibility of changing the value.',
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
status: 'optional'
|
|
36
|
+
},
|
|
37
|
+
emptyValue: {
|
|
38
|
+
doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',
|
|
39
|
+
type: 'any',
|
|
40
|
+
status: 'optional'
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
doc: 'When set `true`, the input will give an error if the value cannot be empty.',
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
status: 'optional'
|
|
46
|
+
},
|
|
47
|
+
schema: {
|
|
48
|
+
doc: 'Custom JSON Schema for validating the value.',
|
|
49
|
+
type: 'object',
|
|
50
|
+
status: 'optional'
|
|
51
|
+
},
|
|
52
|
+
validateInitially: {
|
|
53
|
+
doc: 'Set `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',
|
|
54
|
+
type: 'boolean',
|
|
55
|
+
status: 'optional'
|
|
56
|
+
},
|
|
57
|
+
validateUnchanged: {
|
|
58
|
+
doc: 'Set `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
status: 'optional'
|
|
61
|
+
},
|
|
62
|
+
continuousValidation: {
|
|
63
|
+
doc: 'Set `true` to show validation based errors continuously while writing, not just when blurring the field.',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
status: 'optional'
|
|
66
|
+
},
|
|
67
|
+
errorMessages: {
|
|
68
|
+
doc: 'Custom error messages for each type of error, overriding default messages.',
|
|
69
|
+
type: 'object',
|
|
70
|
+
status: 'optional'
|
|
71
|
+
},
|
|
72
|
+
validator: {
|
|
73
|
+
doc: 'Custom validator function that will be called for every change done by the user. Can be asynchronous or synchronous.',
|
|
74
|
+
type: 'function',
|
|
75
|
+
status: 'optional'
|
|
76
|
+
},
|
|
77
|
+
onBlurValidator: {
|
|
78
|
+
doc: 'Custom validator function that will be called when the user leaves the field (blurring a text input, closing a dropdown etc). Can be asynchronous or synchronous.',
|
|
79
|
+
type: 'function',
|
|
80
|
+
status: 'optional'
|
|
81
|
+
},
|
|
82
|
+
toInput: {
|
|
83
|
+
doc: 'Derivate called when the received / active value is sent to the input. Can be used for casting, changing syntax etc.',
|
|
84
|
+
type: 'function',
|
|
85
|
+
status: 'optional'
|
|
86
|
+
},
|
|
87
|
+
fromInput: {
|
|
88
|
+
doc: 'Derivate called when changes is made by the user, to cast or change syntax back to the original (opposite of `toInput`).',
|
|
89
|
+
type: 'function',
|
|
90
|
+
status: 'optional'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
export const dataValueEvents = {
|
|
94
|
+
onChange: {
|
|
95
|
+
doc: ' Will be called on value changes made by the user, with the new value as argument.',
|
|
96
|
+
type: 'function',
|
|
97
|
+
status: 'optional'
|
|
98
|
+
},
|
|
99
|
+
onFocus: {
|
|
100
|
+
doc: ' Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',
|
|
101
|
+
type: 'function',
|
|
102
|
+
status: 'optional'
|
|
103
|
+
},
|
|
104
|
+
onBlur: {
|
|
105
|
+
doc: ' Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',
|
|
106
|
+
type: 'function',
|
|
107
|
+
status: 'optional'
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=DataValueDocs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataValueDocs.js","names":["dataValueProperties","value","doc","type","status","path","id","info","warning","error","disabled","emptyValue","required","schema","validateInitially","validateUnchanged","continuousValidation","errorMessages","validator","onBlurValidator","toInput","fromInput","dataValueEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const dataValueProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the input.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for this input is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',\n type: 'string',\n status: 'optional',\n },\n id: {\n doc: 'Unique id for connecting Form.Handler and helper tools such as Form.useData.',\n type: 'string',\n status: 'optional',\n },\n info: {\n doc: 'Info message shown below / after the input.',\n type: 'React.Node',\n status: 'optional',\n },\n warning: {\n doc: 'Warning message shown below / after the input.',\n type: 'React.Node',\n status: 'optional',\n },\n error: {\n doc: 'Error message shown below / after the input.',\n type: 'Error',\n status: 'optional',\n },\n disabled: {\n doc: 'Set `true` to show the field but without the possibility of changing the value.',\n type: 'boolean',\n status: 'optional',\n },\n emptyValue: {\n doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',\n type: 'any',\n status: 'optional',\n },\n required: {\n doc: 'When set `true`, the input will give an error if the value cannot be empty.',\n type: 'boolean',\n status: 'optional',\n },\n schema: {\n doc: 'Custom JSON Schema for validating the value.',\n type: 'object',\n status: 'optional',\n },\n validateInitially: {\n doc: 'Set `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',\n type: 'boolean',\n status: 'optional',\n },\n validateUnchanged: {\n doc: 'Set `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',\n type: 'boolean',\n status: 'optional',\n },\n continuousValidation: {\n doc: 'Set `true` to show validation based errors continuously while writing, not just when blurring the field.',\n type: 'boolean',\n status: 'optional',\n },\n errorMessages: {\n doc: 'Custom error messages for each type of error, overriding default messages.',\n type: 'object',\n status: 'optional',\n },\n validator: {\n doc: 'Custom validator function that will be called for every change done by the user. Can be asynchronous or synchronous.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function that will be called when the user leaves the field (blurring a text input, closing a dropdown etc). Can be asynchronous or synchronous.',\n type: 'function',\n status: 'optional',\n },\n toInput: {\n doc: 'Derivate called when the received / active value is sent to the input. Can be used for casting, changing syntax etc.',\n type: 'function',\n status: 'optional',\n },\n fromInput: {\n doc: 'Derivate called when changes is made by the user, to cast or change syntax back to the original (opposite of `toInput`).',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const dataValueEvents: PropertiesTableProps = {\n onChange: {\n doc: ' Will be called on value changes made by the user, with the new value as argument.',\n type: 'function',\n status: 'optional',\n },\n onFocus: {\n doc: ' Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',\n type: 'function',\n status: 'optional',\n },\n onBlur: {\n doc: ' Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAyC,GAAG;EACvDC,KAAK,EAAE;IACLC,GAAG,EAAE,kCAAkC;IACvCC,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJH,GAAG,EAAE,oPAAoP;IACzPC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDE,EAAE,EAAE;IACFJ,GAAG,EAAE,8EAA8E;IACnFC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDG,IAAI,EAAE;IACJL,GAAG,EAAE,6CAA6C;IAClDC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDI,OAAO,EAAE;IACPN,GAAG,EAAE,gDAAgD;IACrDC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDK,KAAK,EAAE;IACLP,GAAG,EAAE,8CAA8C;IACnDC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE;EACV,CAAC;EACDM,QAAQ,EAAE;IACRR,GAAG,EAAE,iFAAiF;IACtFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDO,UAAU,EAAE;IACVT,GAAG,EAAE,kMAAkM;IACvMC,IAAI,EAAE,KAAK;IACXC,MAAM,EAAE;EACV,CAAC;EACDQ,QAAQ,EAAE;IACRV,GAAG,EAAE,6EAA6E;IAClFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDS,MAAM,EAAE;IACNX,GAAG,EAAE,8CAA8C;IACnDC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACD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riaAttributes } from 'react';
|
|
2
|
+
import { FieldProps } from '../types';
|
|
2
3
|
import { ContextState } from '../DataContext';
|
|
3
|
-
export default function useDataValue<Value = unknown, Props extends FieldProps<Value> = FieldProps<Value>>(props: Props): Props & ReturnAdditional<Value>;
|
|
4
|
+
export default function useDataValue<Value = unknown, Props extends FieldProps<Value> = FieldProps<Value>>(props: Props): Props & FieldProps<Value> & ReturnAdditional<Value>;
|
|
4
5
|
interface ReturnAdditional<Value> {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
6
|
value: Value;
|
|
8
|
-
error: Error | FormError | undefined;
|
|
9
|
-
autoComplete: HTMLInputElement['autocomplete'];
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
hasError: boolean;
|
|
12
7
|
isChanged: boolean;
|
|
8
|
+
ariaAttributes: AriaAttributes;
|
|
13
9
|
dataContext: ContextState;
|
|
14
|
-
ariaAttributes: {
|
|
15
|
-
'aria-invalid'?: 'true' | 'false';
|
|
16
|
-
'aria-required'?: 'true' | 'false';
|
|
17
|
-
};
|
|
18
10
|
setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void;
|
|
19
11
|
handleFocus: () => void;
|
|
20
12
|
handleBlur: () => void;
|
|
21
|
-
handleChange: FieldProps<
|
|
13
|
+
handleChange: FieldProps<Value>['onChange'];
|
|
22
14
|
updateValue: (value: Value) => void;
|
|
23
15
|
forceUpdate: () => void;
|
|
24
16
|
}
|
|
25
|
-
export declare function omitDataValueProps<
|
|
17
|
+
export declare function omitDataValueProps<Props extends FieldProps<unknown> & ReturnAdditional<unknown>>(props: Props): Omit<Props, "error" | "info" | "autoComplete" | "name" | "hasError" | "warning" | "forceUpdate" | "isChanged" | "handleChange" | "ariaAttributes" | "dataContext" | "setHasFocus" | "handleFocus" | "handleBlur" | "updateValue">;
|
|
26
18
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
const _excluded = ["name", "error", "hasError", "isChanged", "autoComplete", "ariaAttributes", "dataContext", "setHasFocus", "handleFocus", "handleBlur", "handleChange", "updateValue", "forceUpdate"];
|
|
5
|
+
const _excluded = ["name", "error", "warning", "info", "hasError", "isChanged", "autoComplete", "ariaAttributes", "dataContext", "setHasFocus", "handleFocus", "handleBlur", "handleChange", "updateValue", "forceUpdate"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import { useRef, useEffect, useContext, useCallback, useMemo, useReducer } from 'react';
|
|
@@ -10,11 +10,13 @@ import pointer from 'json-pointer';
|
|
|
10
10
|
import { errorChanged } from '../utils';
|
|
11
11
|
import { ajvErrorsToOneFormError } from '../utils/ajv';
|
|
12
12
|
import { FormError } from '../types';
|
|
13
|
-
import { Context } from '../DataContext';
|
|
13
|
+
import { Context as DataContext } from '../DataContext';
|
|
14
|
+
import { combineDescribedBy } from '../../../shared/component-helper';
|
|
14
15
|
import SharedContext from '../../../shared/Context';
|
|
15
16
|
import FieldBlockContext from '../FieldBlock/FieldBlockContext';
|
|
16
17
|
import IterateElementContext from '../Iterate/IterateElementContext';
|
|
17
18
|
import useMountEffect from './useMountEffect';
|
|
19
|
+
import useUnmountEffect from './useUnmountEffect';
|
|
18
20
|
import useUpdateEffect from './useUpdateEffect';
|
|
19
21
|
import useProcessManager from './useProcessManager';
|
|
20
22
|
import useId from './useId';
|
|
@@ -25,6 +27,8 @@ export default function useDataValue(props) {
|
|
|
25
27
|
itemPath,
|
|
26
28
|
emptyValue,
|
|
27
29
|
required,
|
|
30
|
+
info,
|
|
31
|
+
warning,
|
|
28
32
|
error: errorProp,
|
|
29
33
|
errorMessages,
|
|
30
34
|
onFocus,
|
|
@@ -56,7 +60,7 @@ export default function useDataValue(props) {
|
|
|
56
60
|
startProcess
|
|
57
61
|
} = useProcessManager();
|
|
58
62
|
const id = useId(props.id);
|
|
59
|
-
const dataContext = useContext(
|
|
63
|
+
const dataContext = useContext(DataContext);
|
|
60
64
|
const fieldBlockContext = useContext(FieldBlockContext);
|
|
61
65
|
const iterateElementContext = useContext(IterateElementContext);
|
|
62
66
|
const sharedContext = useContext(SharedContext);
|
|
@@ -81,8 +85,8 @@ export default function useDataValue(props) {
|
|
|
81
85
|
const dataContextError = path ? dataContextErrors === null || dataContextErrors === void 0 ? void 0 : dataContextErrors[path] : undefined;
|
|
82
86
|
const inFieldBlock = Boolean(fieldBlockContext);
|
|
83
87
|
const {
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
setFieldState: setFieldBlockState,
|
|
89
|
+
showFieldError: showFieldBlockError
|
|
86
90
|
} = fieldBlockContext !== null && fieldBlockContext !== void 0 ? fieldBlockContext : {};
|
|
87
91
|
const inIterate = Boolean(iterateElementContext);
|
|
88
92
|
const {
|
|
@@ -135,12 +139,12 @@ export default function useDataValue(props) {
|
|
|
135
139
|
const schemaValidatorRef = useRef(schema ? (_dataContext$ajvInsta = dataContext.ajvInstance) === null || _dataContext$ajvInsta === void 0 ? void 0 : _dataContext$ajvInsta.compile(schema) : undefined);
|
|
136
140
|
const showError = useCallback(() => {
|
|
137
141
|
showErrorRef.current = true;
|
|
138
|
-
|
|
139
|
-
}, [
|
|
142
|
+
showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, true);
|
|
143
|
+
}, [showFieldBlockError, identifier]);
|
|
140
144
|
const hideError = useCallback(() => {
|
|
141
145
|
showErrorRef.current = false;
|
|
142
|
-
|
|
143
|
-
}, [
|
|
146
|
+
showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, false);
|
|
147
|
+
}, [showFieldBlockError, identifier]);
|
|
144
148
|
const errorMessagesRef = useRef(null);
|
|
145
149
|
errorMessagesRef.current = useMemo(() => {
|
|
146
150
|
return _objectSpread({
|
|
@@ -171,6 +175,7 @@ export default function useDataValue(props) {
|
|
|
171
175
|
}
|
|
172
176
|
return error;
|
|
173
177
|
}, []);
|
|
178
|
+
const stateId = useId();
|
|
174
179
|
const persistErrorState = useCallback(errorArg => {
|
|
175
180
|
const error = prepareError(errorArg);
|
|
176
181
|
if (!errorChanged(error, localErrorRef.current)) {
|
|
@@ -178,9 +183,15 @@ export default function useDataValue(props) {
|
|
|
178
183
|
}
|
|
179
184
|
localErrorRef.current = error;
|
|
180
185
|
dataContextSetValueWithError === null || dataContextSetValueWithError === void 0 ? void 0 : dataContextSetValueWithError(identifier, Boolean(error));
|
|
181
|
-
|
|
186
|
+
setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
|
|
187
|
+
stateId,
|
|
188
|
+
identifier,
|
|
189
|
+
type: 'error',
|
|
190
|
+
state: error,
|
|
191
|
+
showInitially: Boolean(inFieldBlock && validateInitially)
|
|
192
|
+
});
|
|
182
193
|
forceUpdate();
|
|
183
|
-
}, [
|
|
194
|
+
}, [stateId, prepareError, dataContextSetValueWithError, identifier, setFieldBlockState, inFieldBlock, validateInitially]);
|
|
184
195
|
const clearErrorState = useCallback(() => persistErrorState(undefined), [persistErrorState]);
|
|
185
196
|
const validateValue = useCallback(async () => {
|
|
186
197
|
const isProcessActive = startProcess();
|
|
@@ -318,30 +329,86 @@ export default function useDataValue(props) {
|
|
|
318
329
|
useMountEffect(() => {
|
|
319
330
|
dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleMountField(identifier);
|
|
320
331
|
validateValue();
|
|
321
|
-
|
|
322
|
-
|
|
332
|
+
});
|
|
333
|
+
useUnmountEffect(() => {
|
|
334
|
+
dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
|
|
335
|
+
});
|
|
336
|
+
useMountEffect(() => {
|
|
337
|
+
if (inFieldBlock) {
|
|
338
|
+
if (errorProp) {
|
|
339
|
+
setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
|
|
340
|
+
identifier,
|
|
341
|
+
type: 'error',
|
|
342
|
+
state: errorProp,
|
|
343
|
+
showInitially: true,
|
|
344
|
+
show: true
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
if (warning) {
|
|
348
|
+
setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
|
|
349
|
+
identifier,
|
|
350
|
+
type: 'warning',
|
|
351
|
+
state: warning,
|
|
352
|
+
showInitially: true,
|
|
353
|
+
show: true
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
if (info) {
|
|
357
|
+
setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
|
|
358
|
+
identifier,
|
|
359
|
+
type: 'info',
|
|
360
|
+
state: info,
|
|
361
|
+
showInitially: true,
|
|
362
|
+
show: true
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return () => {
|
|
366
|
+
if (fieldBlockContext.mountedFieldsRef) {
|
|
367
|
+
fieldBlockContext.mountedFieldsRef.current[identifier] = true;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
323
370
|
}
|
|
324
|
-
return () => {
|
|
325
|
-
dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
|
|
326
|
-
};
|
|
327
371
|
});
|
|
328
372
|
const error = showErrorRef.current ? (_ref = errorProp !== null && errorProp !== void 0 ? errorProp : localErrorRef.current) !== null && _ref !== void 0 ? _ref : contextErrorRef.current : undefined;
|
|
329
|
-
const
|
|
373
|
+
const hasError = Boolean(error) || inFieldBlock && fieldBlockContext.hasErrorProp;
|
|
374
|
+
const ariaAttributes = useMemo(() => {
|
|
375
|
+
return Object.keys(props).reduce((acc, cur) => {
|
|
376
|
+
if (!cur.startsWith('aria-')) {
|
|
377
|
+
return acc;
|
|
378
|
+
}
|
|
379
|
+
acc[cur] = props[cur];
|
|
380
|
+
return acc;
|
|
381
|
+
}, {});
|
|
382
|
+
}, [props]);
|
|
330
383
|
if (error) {
|
|
331
|
-
ariaAttributes['aria-invalid'] =
|
|
384
|
+
ariaAttributes['aria-invalid'] = error ? 'true' : 'false';
|
|
332
385
|
}
|
|
333
386
|
if (required) {
|
|
334
|
-
ariaAttributes['aria-required'] =
|
|
387
|
+
ariaAttributes['aria-required'] = required ? 'true' : 'false';
|
|
388
|
+
}
|
|
389
|
+
if (inFieldBlock) {
|
|
390
|
+
var _fieldBlockContext$fi;
|
|
391
|
+
if (fieldBlockContext.mountedFieldsRef) {
|
|
392
|
+
fieldBlockContext.mountedFieldsRef.current[identifier] = true;
|
|
393
|
+
}
|
|
394
|
+
const stateIds = (_fieldBlockContext$fi = fieldBlockContext.fieldStateIdsRef) === null || _fieldBlockContext$fi === void 0 ? void 0 : _fieldBlockContext$fi.current;
|
|
395
|
+
if (stateIds) {
|
|
396
|
+
ariaAttributes['aria-describedby'] = combineDescribedBy(props, [error && stateIds.error, warning && stateIds.warning, info && stateIds.info].filter(Boolean));
|
|
397
|
+
}
|
|
398
|
+
} else {
|
|
399
|
+
ariaAttributes['aria-describedby'] = combineDescribedBy(props, [(error || errorProp) && `${id}-form-status--error`, warning && `${id}-form-status--warning`, info && `${id}-form-status--info`].filter(Boolean));
|
|
335
400
|
}
|
|
336
401
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
337
402
|
id,
|
|
338
403
|
name: props.name || ((_props$path = props.path) === null || _props$path === void 0 ? void 0 : _props$path.replace('/', '')) || id,
|
|
339
404
|
value: transformers.current.toInput(valueRef.current),
|
|
405
|
+
info: !inFieldBlock ? info : undefined,
|
|
406
|
+
warning: !inFieldBlock ? warning : undefined,
|
|
340
407
|
error: !inFieldBlock ? error : undefined,
|
|
341
|
-
hasError
|
|
342
|
-
isChanged: changedRef.current,
|
|
343
|
-
autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
|
|
408
|
+
hasError,
|
|
344
409
|
disabled,
|
|
410
|
+
autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
|
|
411
|
+
isChanged: changedRef.current,
|
|
345
412
|
ariaAttributes,
|
|
346
413
|
dataContext,
|
|
347
414
|
setHasFocus,
|
|
@@ -356,6 +423,8 @@ export function omitDataValueProps(props) {
|
|
|
356
423
|
const {
|
|
357
424
|
name,
|
|
358
425
|
error,
|
|
426
|
+
warning,
|
|
427
|
+
info,
|
|
359
428
|
hasError,
|
|
360
429
|
isChanged,
|
|
361
430
|
autoComplete,
|
|
@@ -369,6 +438,6 @@ export function omitDataValueProps(props) {
|
|
|
369
438
|
forceUpdate
|
|
370
439
|
} = props,
|
|
371
440
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
372
|
-
return
|
|
441
|
+
return restProps;
|
|
373
442
|
}
|
|
374
443
|
//# sourceMappingURL=useDataValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataValue.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","SharedContext","FieldBlockContext","IterateElementContext","useMountEffect","useUpdateEffect","useProcessManager","useId","useDataValue","props","_props$disabled","_dataContext$ajvInsta","_ref","_props$path","_props$autoComplete","path","itemPath","emptyValue","required","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","toInput","value","fromInput","toEvent","transformValue","fromExternal","validateRequired","res","undefined","disabled","readOnly","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sharedContext","tr","translation","Forms","transformers","handlePathChange","dataContextHandlePathChange","updateDataValue","dataContextUpdateDataValue","validateData","dataContextValidateData","setValueWithError","dataContextSetValueWithError","setProps","dataContextSetProps","errors","dataContextErrors","contextErrorMessages","dataContextError","inFieldBlock","Boolean","setError","setFieldBlockError","setShowError","setShowFieldBlockError","inIterate","index","iterateElementIndex","iterateElementValue","handleChange","handleIterateElementChange","substring","Error","identifier","externalValue","current","has","get","data","valueRef","changedRef","hasFocusRef","showErrorInitially","localErrorRef","contextErrorRef","showErrorRef","validatorRef","schemaValidatorRef","ajvInstance","compile","showError","hideError","errorMessagesRef","_objectSpread","fieldErrorRequired","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","messageWithValues","Object","entries","messageValues","reduce","key","replace","persistErrorState","errorArg","clearErrorState","validateValue","isProcessActive","requiredError","isChanged","_validatorRef$current","call","_dataContext$ajvInsta2","showAllErrors","hasValue","existingValue","handleError","setHasFocus","hasFocus","valueOverride","Promise","resolve","then","updateValue","newValue","argFromInput","additionalArgs","currentValue","apply","iterateValuePath","handleFocus","handleBlur","handleMountField","handleUnMountField","ariaAttributes","String","name","hasError","autoComplete","omitDataValueProps","restProps","_objectWithoutProperties","_excluded","freeze"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport { FormError, FieldProps, AdditionalEventArgs } from '../types'\nimport { Context, ContextState } from '../DataContext'\nimport SharedContext from '../../../shared/Context'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport useMountEffect from './useMountEffect'\nimport useUpdateEffect from './useUpdateEffect'\nimport useProcessManager from './useProcessManager'\nimport useId from './useId'\n\nexport default function useDataValue<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(props: Props): Props & ReturnAdditional<Value> {\n const {\n path,\n itemPath,\n emptyValue,\n required,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n return res\n },\n } = props\n\n const disabled = props.disabled ?? props.readOnly\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(Context)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sharedContext = useContext(SharedContext)\n const tr = sharedContext?.translation.Forms\n\n const transformers = useRef({\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChange: dataContextHandlePathChange,\n updateDataValue: dataContextUpdateDataValue,\n validateData: dataContextValidateData,\n setValueWithError: dataContextSetValueWithError,\n setProps: dataContextSetProps,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n\n const dataContextError = path ? dataContextErrors?.[path] : undefined\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setError: setFieldBlockError,\n setShowError: setShowFieldBlockError,\n } = fieldBlockContext ?? {}\n const inIterate = Boolean(iterateElementContext)\n const {\n index: iterateElementIndex,\n value: iterateElementValue,\n handleChange: handleIterateElementChange,\n } = iterateElementContext ?? {}\n\n if (path && path.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid path. Data value path JSON Pointers must be from root (starting with a /).'\n )\n }\n if (itemPath && itemPath.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid itemPath. Item pathJSON Pointers must be from root of iterate element (starting with a /).'\n )\n }\n if (itemPath && !iterateElementContext) {\n throw new Error(\n 'itemPath cannot be used when not inside an iterate element context. Wrap the component in an Iterate.Loop.'\n )\n }\n\n const identifier = useMemo(() => {\n // Identifier is used is registries of multiple fields, like in the DataContext keeping track of errors\n return path ?? id\n }, [path, id])\n\n const externalValue = useMemo(() => {\n if (props.value !== undefined) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers.current.fromExternal(props.value)\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return iterateElementValue\n }\n\n return pointer.has(iterateElementValue, itemPath)\n ? pointer.get(iterateElementValue, itemPath)\n : undefined\n }\n\n if (dataContext.data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return dataContext.data\n }\n\n return pointer.has(dataContext.data, path)\n ? pointer.get(dataContext.data, path)\n : undefined\n }\n return undefined\n }, [\n props.value,\n inIterate,\n itemPath,\n dataContext.data,\n path,\n iterateElementValue,\n ])\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorInitially = validateInitially || errorProp\n // - Local errors are errors based on validation instructions received by\n const localErrorRef = useRef<Error | FormError | undefined>()\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n // Put props into the surrounding data context\n dataContextSetProps?.(identifier, props)\n\n const showErrorRef = useRef<boolean>(Boolean(showErrorInitially))\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n setShowFieldBlockError?.(path ?? id, true)\n }, [path, id, setShowFieldBlockError])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n setShowFieldBlockError?.(path ?? id, false)\n }, [path, id, setShowFieldBlockError])\n\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: tr.fieldErrorRequired,\n ...errorMessages,\n }\n }, [errorMessages, tr.fieldErrorRequired])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error === undefined) {\n return\n }\n\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n return new FormError(messageWithValues)\n }\n\n return error\n },\n []\n )\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const persistErrorState = useCallback(\n (errorArg: FormError | undefined) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n dataContextSetValueWithError?.(identifier, Boolean(error))\n\n setFieldBlockError?.(path ?? id, error)\n forceUpdate()\n },\n [\n path,\n identifier,\n id,\n prepareError,\n dataContextSetValueWithError,\n setFieldBlockError,\n forceUpdate,\n ]\n )\n\n const clearErrorState = useCallback(\n () => persistErrorState(undefined),\n [persistErrorState]\n )\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n return\n }\n\n try {\n // Validate required\n const requiredError = transformers.current.validateRequired(\n valueRef.current,\n {\n emptyValue,\n required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n }\n )\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n valueRef.current !== undefined &&\n !schemaValidatorRef.current(valueRef.current)\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (validatorRef.current) {\n const res = await validatorRef.current?.(valueRef.current, {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n })\n if (res instanceof Error) {\n throw res\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n } catch (error: unknown) {\n if (isProcessActive()) {\n persistErrorState(error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n clearErrorState,\n emptyValue,\n required,\n contextErrorMessages,\n persistErrorState,\n ])\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n valueRef.current = externalValue\n validateValue()\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n contextErrorRef.current = error\n forceUpdate()\n }\n }, [dataContextError, prepareError])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (path) {\n const hasValue = pointer.has(dataContext.data, path)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, path)\n : undefined\n\n if (\n !hasValue ||\n (props.value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n dataContextUpdateDataValue?.(path, props.value, { disabled })\n dataContextValidateData?.()\n }\n }\n }, [\n dataContext.data,\n dataContextUpdateDataValue,\n dataContextValidateData,\n disabled,\n path,\n props.value,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n if (typeof onBlurValidator === 'function') {\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n Promise.resolve(onBlurValidator(value)).then(persistErrorState)\n }\n\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n }\n },\n [\n onBlur,\n onBlurValidator,\n onFocus,\n persistErrorState,\n showError,\n validateUnchanged,\n ]\n )\n\n const updateValue = useCallback(\n (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n // Always validate the value immediately when it is changed\n validateValue()\n\n handleError()\n\n if (path) {\n // setTimeout(() => {\n dataContextHandlePathChange?.(path, newValue)\n // forceUpdate()\n // }, 1e3)\n }\n\n forceUpdate()\n },\n [dataContextHandlePathChange, handleError, path, validateValue]\n )\n\n const handleChange = useCallback(\n (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n let newValue = transformers.current.fromInput(argFromInput)\n\n if (newValue === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n newValue = transformers.current.transformValue(\n newValue,\n currentValue\n )\n\n updateValue(newValue)\n\n changedRef.current = true\n\n const value = transformers.current.toEvent(newValue, 'onChange')\n onChange?.apply(\n this,\n typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n )\n\n if (itemPath) {\n const iterateValuePath = `/${iterateElementIndex}${\n itemPath && itemPath !== '/' ? itemPath : ''\n }`\n handleIterateElementChange?.(iterateValuePath, newValue)\n }\n },\n [\n updateValue,\n onChange,\n itemPath,\n iterateElementIndex,\n handleIterateElementChange,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n\n validateValue()\n\n if (showErrorInitially) {\n showError()\n }\n\n return () => {\n // Unmount procedure\n dataContext?.handleUnMountField(identifier)\n }\n })\n\n const error = showErrorRef.current\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const ariaAttributes = {}\n if (error) {\n ariaAttributes['aria-invalid'] = String(Boolean(error))\n }\n if (required) {\n ariaAttributes['aria-required'] = String(required)\n }\n\n return {\n ...props,\n id,\n name: props.name || props.path?.replace('/', '') || id,\n value: transformers.current.toInput(valueRef.current),\n error: !inFieldBlock ? error : undefined,\n hasError: Boolean(error),\n isChanged: changedRef.current,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : 'off'),\n disabled,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n }\n}\n\ninterface ReturnAdditional<Value> {\n id: string\n name: string\n value: Value\n error: Error | FormError | undefined\n autoComplete: HTMLInputElement['autocomplete']\n disabled: boolean\n hasError: boolean\n isChanged: boolean\n dataContext: ContextState\n ariaAttributes: {\n 'aria-invalid'?: 'true' | 'false'\n 'aria-required'?: 'true' | 'false'\n }\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: FieldProps<unknown>['onChange']\n updateValue: (value: Value) => void\n forceUpdate: () => void\n}\n\nexport function omitDataValueProps<\n OmittedProps extends ReturnAdditional<unknown>,\n>(props: OmittedProps) {\n // Do not include typical HTML attributes\n const {\n name,\n error,\n hasError,\n isChanged,\n autoComplete,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n ...restProps\n } = props\n return Object.freeze(restProps) as Omit<\n OmittedProps,\n keyof ReturnAdditional<unknown>\n >\n}\n"],"mappings":";;;;;;;AAAA,SACEA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC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
1
|
+
{"version":3,"file":"useDataValue.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","DataContext","combineDescribedBy","SharedContext","FieldBlockContext","IterateElementContext","useMountEffect","useUnmountEffect","useUpdateEffect","useProcessManager","useId","useDataValue","props","_props$disabled","_dataContext$ajvInsta","_ref","_props$path","_props$autoComplete","path","itemPath","emptyValue","required","info","warning","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","toInput","value","fromInput","toEvent","transformValue","fromExternal","validateRequired","res","undefined","disabled","readOnly","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sharedContext","tr","translation","Forms","transformers","handlePathChange","dataContextHandlePathChange","updateDataValue","dataContextUpdateDataValue","validateData","dataContextValidateData","setValueWithError","dataContextSetValueWithError","setProps","dataContextSetProps","errors","dataContextErrors","contextErrorMessages","dataContextError","inFieldBlock","Boolean","setFieldState","setFieldBlockState","showFieldError","showFieldBlockError","inIterate","index","iterateElementIndex","iterateElementValue","handleChange","handleIterateElementChange","substring","Error","identifier","externalValue","current","has","get","data","valueRef","changedRef","hasFocusRef","showErrorInitially","localErrorRef","contextErrorRef","showErrorRef","validatorRef","schemaValidatorRef","ajvInstance","compile","showError","hideError","errorMessagesRef","_objectSpread","fieldErrorRequired","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","messageWithValues","Object","entries","messageValues","reduce","key","replace","stateId","persistErrorState","errorArg","type","state","showInitially","clearErrorState","validateValue","isProcessActive","requiredError","isChanged","_validatorRef$current","call","_dataContext$ajvInsta2","showAllErrors","hasValue","existingValue","handleError","setHasFocus","hasFocus","valueOverride","Promise","resolve","then","updateValue","newValue","argFromInput","additionalArgs","currentValue","apply","iterateValuePath","handleFocus","handleBlur","handleMountField","handleUnMountField","show","mountedFieldsRef","hasError","hasErrorProp","ariaAttributes","keys","acc","cur","startsWith","_fieldBlockContext$fi","stateIds","fieldStateIdsRef","filter","name","autoComplete","omitDataValueProps","restProps","_objectWithoutProperties","_excluded"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n AriaAttributes,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport { FormError, FieldProps, AdditionalEventArgs } from '../types'\nimport { Context as DataContext, ContextState } from '../DataContext'\nimport { combineDescribedBy } from '../../../shared/component-helper'\nimport SharedContext from '../../../shared/Context'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport useMountEffect from './useMountEffect'\nimport useUnmountEffect from './useUnmountEffect'\nimport useUpdateEffect from './useUpdateEffect'\nimport useProcessManager from './useProcessManager'\nimport useId from './useId'\n\nexport default function useDataValue<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(props: Props): Props & FieldProps<Value> & ReturnAdditional<Value> {\n const {\n path,\n itemPath,\n emptyValue,\n required,\n info,\n warning,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n return res\n },\n } = props\n\n const disabled = props.disabled ?? props.readOnly\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(DataContext)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sharedContext = useContext(SharedContext)\n const tr = sharedContext?.translation.Forms\n\n const transformers = useRef({\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChange: dataContextHandlePathChange,\n updateDataValue: dataContextUpdateDataValue,\n validateData: dataContextValidateData,\n setValueWithError: dataContextSetValueWithError,\n setProps: dataContextSetProps,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n\n const dataContextError = path ? dataContextErrors?.[path] : undefined\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setFieldState: setFieldBlockState,\n showFieldError: showFieldBlockError,\n } = fieldBlockContext ?? {}\n const inIterate = Boolean(iterateElementContext)\n const {\n index: iterateElementIndex,\n value: iterateElementValue,\n handleChange: handleIterateElementChange,\n } = iterateElementContext ?? {}\n\n if (path && path.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid path. Data value path JSON Pointers must be from root (starting with a /).'\n )\n }\n if (itemPath && itemPath.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid itemPath. Item pathJSON Pointers must be from root of iterate element (starting with a /).'\n )\n }\n if (itemPath && !iterateElementContext) {\n throw new Error(\n 'itemPath cannot be used when not inside an iterate element context. Wrap the component in an Iterate.Loop.'\n )\n }\n\n const identifier = useMemo(() => {\n // Identifier is used is registries of multiple fields, like in the DataContext keeping track of errors\n return path ?? id\n }, [path, id])\n\n const externalValue = useMemo(() => {\n if (props.value !== undefined) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers.current.fromExternal(props.value)\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return iterateElementValue\n }\n\n return pointer.has(iterateElementValue, itemPath)\n ? pointer.get(iterateElementValue, itemPath)\n : undefined\n }\n\n if (dataContext.data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return dataContext.data\n }\n\n return pointer.has(dataContext.data, path)\n ? pointer.get(dataContext.data, path)\n : undefined\n }\n return undefined\n }, [\n props.value,\n inIterate,\n itemPath,\n dataContext.data,\n path,\n iterateElementValue,\n ])\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorInitially = validateInitially || errorProp\n // - Local errors are errors based on validation instructions received by\n const localErrorRef = useRef<Error | FormError | undefined>()\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n // Put props into the surrounding data context\n dataContextSetProps?.(identifier, props)\n\n const showErrorRef = useRef<boolean>(Boolean(showErrorInitially))\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n showFieldBlockError?.(identifier, true)\n }, [showFieldBlockError, identifier])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n showFieldBlockError?.(identifier, false)\n }, [showFieldBlockError, identifier])\n\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: tr.fieldErrorRequired,\n ...errorMessages,\n }\n }, [errorMessages, tr.fieldErrorRequired])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error === undefined) {\n return\n }\n\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n return new FormError(messageWithValues)\n }\n\n return error\n },\n []\n )\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const stateId = useId()\n const persistErrorState = useCallback(\n (errorArg: FormError | undefined) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n dataContextSetValueWithError?.(identifier, Boolean(error))\n\n setFieldBlockState?.({\n stateId,\n identifier,\n type: 'error',\n state: error,\n showInitially: Boolean(inFieldBlock && validateInitially),\n })\n\n forceUpdate()\n },\n [\n stateId,\n prepareError,\n dataContextSetValueWithError,\n identifier,\n setFieldBlockState,\n inFieldBlock,\n validateInitially,\n ]\n )\n\n const clearErrorState = useCallback(\n () => persistErrorState(undefined),\n [persistErrorState]\n )\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n return\n }\n\n try {\n // Validate required\n const requiredError = transformers.current.validateRequired(\n valueRef.current,\n {\n emptyValue,\n required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n }\n )\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n valueRef.current !== undefined &&\n !schemaValidatorRef.current(valueRef.current)\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (validatorRef.current) {\n const res = await validatorRef.current?.(valueRef.current, {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n })\n if (res instanceof Error) {\n throw res\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n } catch (error: unknown) {\n if (isProcessActive()) {\n persistErrorState(error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n clearErrorState,\n emptyValue,\n required,\n contextErrorMessages,\n persistErrorState,\n ])\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n valueRef.current = externalValue\n validateValue()\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n contextErrorRef.current = error\n forceUpdate()\n }\n }, [dataContextError, prepareError])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (path) {\n const hasValue = pointer.has(dataContext.data, path)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, path)\n : undefined\n\n if (\n !hasValue ||\n (props.value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n dataContextUpdateDataValue?.(path, props.value, { disabled })\n dataContextValidateData?.()\n }\n }\n }, [\n dataContext.data,\n dataContextUpdateDataValue,\n dataContextValidateData,\n disabled,\n path,\n props.value,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n if (typeof onBlurValidator === 'function') {\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n Promise.resolve(onBlurValidator(value)).then(persistErrorState)\n }\n\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n }\n },\n [\n onBlur,\n onBlurValidator,\n onFocus,\n persistErrorState,\n showError,\n validateUnchanged,\n ]\n )\n\n const updateValue = useCallback(\n (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n // Always validate the value immediately when it is changed\n validateValue()\n\n handleError()\n\n if (path) {\n dataContextHandlePathChange?.(path, newValue)\n }\n\n forceUpdate()\n },\n [dataContextHandlePathChange, handleError, path, validateValue]\n )\n\n const handleChange = useCallback(\n (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n let newValue = transformers.current.fromInput(argFromInput)\n\n if (newValue === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n newValue = transformers.current.transformValue(\n newValue,\n currentValue\n )\n\n updateValue(newValue)\n\n changedRef.current = true\n\n const value = transformers.current.toEvent(newValue, 'onChange')\n onChange?.apply(\n this,\n typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n )\n\n if (itemPath) {\n const iterateValuePath = `/${iterateElementIndex}${\n itemPath && itemPath !== '/' ? itemPath : ''\n }`\n handleIterateElementChange?.(iterateValuePath, newValue)\n }\n },\n [\n updateValue,\n onChange,\n itemPath,\n iterateElementIndex,\n handleIterateElementChange,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n\n validateValue()\n })\n useUnmountEffect(() => {\n dataContext?.handleUnMountField(identifier)\n })\n\n // Set the error in the field block context if this field is inside a field block\n useMountEffect(() => {\n if (inFieldBlock) {\n if (errorProp) {\n setFieldBlockState?.({\n identifier,\n type: 'error',\n state: errorProp,\n showInitially: true,\n show: true,\n })\n }\n if (warning) {\n setFieldBlockState?.({\n identifier,\n type: 'warning',\n state: warning,\n showInitially: true,\n show: true,\n })\n }\n if (info) {\n setFieldBlockState?.({\n identifier,\n type: 'info',\n state: info,\n showInitially: true,\n show: true,\n })\n }\n\n return () => {\n // Unmount procedure\n if (fieldBlockContext.mountedFieldsRef) {\n fieldBlockContext.mountedFieldsRef.current[identifier] = true\n }\n }\n }\n })\n\n const error = showErrorRef.current\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const hasError =\n Boolean(error) || (inFieldBlock && fieldBlockContext.hasErrorProp)\n\n // - Handle ariaAttributes\n const ariaAttributes = useMemo(() => {\n return Object.keys(props).reduce<AriaAttributes>((acc, cur) => {\n if (!cur.startsWith('aria-')) {\n return acc\n }\n acc[cur] = props[cur]\n return acc\n }, {})\n }, [props])\n if (error) {\n ariaAttributes['aria-invalid'] = error ? 'true' : 'false'\n }\n if (required) {\n ariaAttributes['aria-required'] = required ? 'true' : 'false'\n }\n if (inFieldBlock) {\n // Mount the field in the field block context\n if (fieldBlockContext.mountedFieldsRef) {\n fieldBlockContext.mountedFieldsRef.current[identifier] = true\n }\n\n // Check if there are any state IDs to be added to the aria-describedby attribute\n const stateIds = fieldBlockContext.fieldStateIdsRef?.current\n\n if (stateIds) {\n ariaAttributes['aria-describedby'] = combineDescribedBy(\n props,\n [\n error && stateIds.error,\n warning && stateIds.warning,\n info && stateIds.info,\n ].filter(Boolean)\n )\n }\n } else {\n ariaAttributes['aria-describedby'] = combineDescribedBy(\n props,\n [\n (error || errorProp) && `${id}-form-status--error`,\n warning && `${id}-form-status--warning`,\n info && `${id}-form-status--info`,\n ].filter(Boolean)\n )\n }\n\n return {\n ...props,\n id,\n name: props.name || props.path?.replace('/', '') || id,\n value: transformers.current.toInput(valueRef.current),\n info: !inFieldBlock ? info : undefined,\n warning: !inFieldBlock ? warning : undefined,\n error: !inFieldBlock ? error : undefined,\n hasError,\n disabled,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : 'off'),\n\n // Return additional hook related props (ReturnAdditional)\n isChanged: changedRef.current,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n }\n}\n\ninterface ReturnAdditional<Value> {\n value: Value\n isChanged: boolean\n ariaAttributes: AriaAttributes\n dataContext: ContextState\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: FieldProps<Value>['onChange']\n updateValue: (value: Value) => void\n forceUpdate: () => void\n}\n\nexport function omitDataValueProps<\n Props extends FieldProps<unknown> & ReturnAdditional<unknown>,\n>(props: Props) {\n // Do not include typical HTML attributes\n const {\n name, // eslint-disable-line\n error, // eslint-disable-line\n warning, // eslint-disable-line\n info, // eslint-disable-line\n hasError, // eslint-disable-line\n isChanged, // eslint-disable-line\n autoComplete, // eslint-disable-line\n ariaAttributes, // eslint-disable-line\n dataContext, // eslint-disable-line\n setHasFocus, // eslint-disable-line\n handleFocus, // eslint-disable-line\n handleBlur, // eslint-disable-line\n handleChange, // eslint-disable-line\n updateValue, // eslint-disable-line\n forceUpdate, // eslint-disable-line\n ...restProps\n } = props\n\n return restProps\n}\n"],"mappings":";;;;;;;AAAA,SACEA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,UAAU,QAEL,OAAO;AACd,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,uBAAuB,QAAQ,cAAc;AACtD,SAASC,SAAS,QAAyC,UAAU;AACrE,SAASC,OAAO,IAAIC,WAAW,QAAsB,gBAAgB;AACrE,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,OAAOC,aAAa,MAAM,yBAAyB;AACnD,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,KAAK,MAAM,SAAS;AAE3B,eAAe,SAASC,YAAYA,CAGlCC,KAAY,EAAuD;EAAA,IAAAC,eAAA,EAAAC,qBAAA,EAAAC,IAAA,EAAAC,WAAA,EAAAC,mBAAA;EACnE,MAAM;IACJC,IAAI;IACJC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,IAAI;IACJC,OAAO;IACPC,KAAK,EAAEC,SAAS;IAChBC,aAAa;IACbC,OAAO;IACPC,MAAM;IACNC,QAAQ;IACRC,eAAe;IACfC,SAAS;IACTC,MAAM;IACNC,iBAAiB;IACjBC,iBAAiB;IACjBC,oBAAoB;IAC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SAAS;MACTuC,YAAY;MACZV,cAAc;MACd9G,WAAW;MACXyF,WAAW;MACXa,WAAW;MACXC,UAAU;MACVvE,YAAY;MACZ+D,WAAW;MACXlG;IAEF,CAAC,GAAGnC,KAAK;IADJgK,SAAS,GAAAC,wBAAA,CACVjK,KAAK,EAAAkK,SAAA;EAET,OAAOF,SAAS;AAClB"}
|
|
@@ -5,7 +5,7 @@ export default function useId(customId) {
|
|
|
5
5
|
const id = React === null || React === void 0 ? void 0 : (_React$useId = React.useId) === null || _React$useId === void 0 ? void 0 : _React$useId.call(React);
|
|
6
6
|
return React.useMemo(() => {
|
|
7
7
|
var _ref;
|
|
8
|
-
return (_ref = customId !== null && customId !== void 0 ? customId : id) !== null && _ref !== void 0 ? _ref : makeUniqueId();
|
|
8
|
+
return (_ref = customId !== null && customId !== void 0 ? customId : id === null || id === void 0 ? void 0 : id.replace(/:/, 'id-').replace(/:/, '')) !== null && _ref !== void 0 ? _ref : makeUniqueId();
|
|
9
9
|
}, [customId, id]);
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=useId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.js","names":["React","makeUniqueId","useId","customId","_React$useId","id","call","useMemo","_ref"],"sources":["../../../../../src/extensions/forms/hooks/useId.ts"],"sourcesContent":["import React from 'react'\nimport { makeUniqueId } from '../../../shared/component-helper'\n\nexport default function useId(customId?: string) {\n const id = React?.useId?.()\n return React.useMemo(\n ()
|
|
1
|
+
{"version":3,"file":"useId.js","names":["React","makeUniqueId","useId","customId","_React$useId","id","call","useMemo","_ref","replace"],"sources":["../../../../../src/extensions/forms/hooks/useId.ts"],"sourcesContent":["import React from 'react'\nimport { makeUniqueId } from '../../../shared/component-helper'\n\nexport default function useId(customId?: string) {\n const id = React?.useId?.()\n return React.useMemo(\n () =>\n customId ??\n id?.replace(/:/, 'id-').replace(/:/, '') ??\n makeUniqueId(),\n [customId, id]\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,kCAAkC;AAE/D,eAAe,SAASC,KAAKA,CAACC,QAAiB,EAAE;EAAA,IAAAC,YAAA;EAC/C,MAAMC,EAAE,GAAGL,KAAK,aAALA,KAAK,wBAAAI,YAAA,GAALJ,KAAK,CAAEE,KAAK,cAAAE,YAAA,uBAAZA,YAAA,CAAAE,IAAA,CAAAN,KAAe,CAAC;EAC3B,OAAOA,KAAK,CAACO,OAAO,CAClB;IAAA,IAAAC,IAAA;IAAA,QAAAA,IAAA,GACEL,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GACRE,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEI,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,cAAAD,IAAA,cAAAA,IAAA,GACxCP,YAAY,CAAC,CAAC;EAAA,GAChB,CAACE,QAAQ,EAAEE,EAAE,CACf,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","args"],"sources":["../../../../../src/extensions/forms/hooks/useMountEffect.ts"],"sourcesContent":["import { useEffect, EffectCallback } from 'react'\n\n/**\n * UseEffect that only run on the initial mount\n */\nexport default function useMountEffect(callback: EffectCallback) {\n useEffect((...args) => {\n callback(...args)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"],"mappings":";;AAAA,SAASA,SAAS,QAAwB,OAAO;AAKjD,eAAe,SAASC,cAAcA,CAACC,QAAwB,EAAE;EAC/DF,SAAS,CAAC,CAAC,GAAGG,IAAI,KAAK;
|
|
1
|
+
{"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","args"],"sources":["../../../../../src/extensions/forms/hooks/useMountEffect.ts"],"sourcesContent":["import { useEffect, EffectCallback } from 'react'\n\n/**\n * UseEffect that only run on the initial mount\n */\nexport default function useMountEffect(callback: EffectCallback) {\n useEffect((...args) => {\n return callback(...args)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"],"mappings":";;AAAA,SAASA,SAAS,QAAwB,OAAO;AAKjD,eAAe,SAASC,cAAcA,CAACC,QAAwB,EAAE;EAC/DF,SAAS,CAAC,CAAC,GAAGG,IAAI,KAAK;IACrB,OAAOD,QAAQ,CAAC,GAAGC,IAAI,CAAC;EAE1B,CAAC,EAAE,EAAE,CAAC;AACR"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
export default function useMounted() {
|
|
5
|
+
const mounted = useRef(false);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
mounted.current = true;
|
|
8
|
+
return () => {
|
|
9
|
+
mounted.current = false;
|
|
10
|
+
};
|
|
11
|
+
}, []);
|
|
12
|
+
return mounted;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=useMounted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMounted.js","names":["useEffect","useRef","useMounted","mounted","current"],"sources":["../../../../../src/extensions/forms/hooks/useMounted.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport default function useMounted() {\n const mounted = useRef(false)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n return mounted\n}\n"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGF,MAAM,CAAC,KAAK,CAAC;EAE7BD,SAAS,CAAC,MAAM;IACdG,OAAO,CAACC,OAAO,GAAG,IAAI;IACtB,OAAO,MAAM;MACXD,OAAO,CAACC,OAAO,GAAG,KAAK;IACzB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOD,OAAO;AAChB"}
|