@dnb/eufemia 10.70.0 → 10.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/cjs/components/autocomplete/AutocompleteDocs.js +3 -3
- package/cjs/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/cjs/components/avatar/Avatar.js +3 -8
- package/cjs/components/avatar/Avatar.js.map +1 -1
- package/cjs/components/checkbox/CheckboxDocs.js +2 -2
- package/cjs/components/checkbox/CheckboxDocs.js.map +1 -1
- package/cjs/components/date-picker/DatePickerContext.d.ts +0 -1
- package/cjs/components/date-picker/DatePickerContext.js.map +1 -1
- package/cjs/components/date-picker/DatePickerDocs.js +1 -1
- package/cjs/components/date-picker/DatePickerDocs.js.map +1 -1
- package/cjs/components/date-picker/DatePickerInput.js +110 -136
- package/cjs/components/date-picker/DatePickerInput.js.map +1 -1
- package/cjs/components/date-picker/DatePickerProvider.js +0 -2
- package/cjs/components/date-picker/DatePickerProvider.js.map +1 -1
- package/cjs/components/date-picker/hooks/useDates.d.ts +0 -2
- package/cjs/components/date-picker/hooks/useDates.js +5 -5
- package/cjs/components/date-picker/hooks/useDates.js.map +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.css +4 -0
- package/cjs/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/cjs/components/dialog/DialogDocs.js +7 -2
- package/cjs/components/dialog/DialogDocs.js.map +1 -1
- package/cjs/components/dropdown/Dropdown.d.ts +20 -20
- package/cjs/components/dropdown/DropdownDocs.d.ts +1 -0
- package/cjs/components/dropdown/DropdownDocs.js +158 -1
- package/cjs/components/dropdown/DropdownDocs.js.map +1 -1
- package/cjs/components/flex/ContainerDocs.js +1 -1
- package/cjs/components/flex/ContainerDocs.js.map +1 -1
- package/cjs/components/flex/ItemDocs.d.ts +2 -0
- package/cjs/components/flex/ItemDocs.js +39 -0
- package/cjs/components/flex/ItemDocs.js.map +1 -0
- package/cjs/components/grid/ItemDocs.d.ts +2 -0
- package/cjs/components/grid/ItemDocs.js +19 -0
- package/cjs/components/grid/ItemDocs.js.map +1 -0
- package/cjs/components/input/InputDocs.js +3 -3
- package/cjs/components/input/InputDocs.js.map +1 -1
- package/cjs/components/input-masked/InputMasked.d.ts +0 -3
- package/cjs/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/cjs/components/input-masked/InputMaskedDocs.js +58 -1
- package/cjs/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/cjs/components/input-masked/InputMaskedHooks.js +11 -7
- package/cjs/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/cjs/components/input-masked/InputMaskedUtils.d.ts +1 -1
- package/cjs/components/input-masked/InputMaskedUtils.js +2 -1
- package/cjs/components/input-masked/InputMaskedUtils.js.map +1 -1
- package/cjs/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/cjs/components/input-masked/MultiInputMaskedDocs.js +70 -1
- package/cjs/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.css +9 -0
- package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/cjs/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/cjs/components/input-masked/text-mask/InputModeNumber.js +32 -9
- package/cjs/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/cjs/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/cjs/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/cjs/components/modal/ModalDocs.d.ts +5 -0
- package/cjs/components/modal/ModalDocs.js +201 -0
- package/cjs/components/modal/ModalDocs.js.map +1 -0
- package/cjs/components/radio/RadioDocs.js +2 -2
- package/cjs/components/radio/RadioDocs.js.map +1 -1
- package/cjs/components/section/Section.js +2 -7
- package/cjs/components/section/Section.js.map +1 -1
- package/cjs/components/section/SectionDocs.js +1 -1
- package/cjs/components/section/SectionDocs.js.map +1 -1
- package/cjs/components/slider/SliderDocs.js +2 -2
- package/cjs/components/slider/SliderDocs.js.map +1 -1
- package/cjs/components/space/SpaceDocs.d.ts +3 -0
- package/cjs/components/space/SpaceDocs.js +61 -0
- package/cjs/components/space/SpaceDocs.js.map +1 -0
- package/cjs/components/switch/SwitchDocs.js +2 -2
- package/cjs/components/switch/SwitchDocs.js.map +1 -1
- package/cjs/components/textarea/TextareaDocs.js +3 -3
- package/cjs/components/textarea/TextareaDocs.js.map +1 -1
- package/cjs/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/cjs/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/cjs/components/tooltip/TooltipDocs.js +1 -1
- package/cjs/components/tooltip/TooltipDocs.js.map +1 -1
- package/cjs/components/upload/Upload.js +6 -3
- package/cjs/components/upload/Upload.js.map +1 -1
- package/cjs/components/upload/UploadDocs.d.ts +1 -0
- package/cjs/components/upload/UploadDocs.js +43 -1
- package/cjs/components/upload/UploadDocs.js.map +1 -1
- package/cjs/components/upload/UploadFileListCell.js +32 -12
- package/cjs/components/upload/UploadFileListCell.js.map +1 -1
- package/cjs/components/upload/types.d.ts +7 -0
- package/cjs/components/upload/types.js.map +1 -1
- package/cjs/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/cjs/extensions/forms/DataContext/At/AtDocs.js +24 -0
- package/cjs/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/cjs/extensions/forms/DataContext/Provider/ProviderDocs.js +1 -1
- package/cjs/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/Number/Number.js +3 -6
- package/cjs/extensions/forms/Field/Number/Number.js.map +1 -1
- package/cjs/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/cjs/extensions/forms/Field/Password/PasswordDocs.js +14 -2
- package/cjs/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +6 -4
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js +33 -25
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.d.ts +2 -2
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +8 -3
- package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
- package/cjs/extensions/forms/Field/String/StringDocs.js +1 -1
- package/cjs/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/Upload/Upload.d.ts +1 -1
- package/cjs/extensions/forms/Field/Upload/Upload.js +3 -1
- package/cjs/extensions/forms/Field/Upload/Upload.js.map +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlock.js +11 -4
- package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
- package/cjs/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +19 -0
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.js +14 -0
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/cjs/extensions/forms/hooks/DataValueWritePropsDocs.js +1 -1
- package/cjs/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
- package/cjs/extensions/forms/hooks/useFieldProps.js +55 -18
- package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/cjs/extensions/forms/types.d.ts +8 -5
- package/cjs/extensions/forms/types.js.map +1 -1
- package/cjs/extensions/forms/utils/FormError.d.ts +20 -16
- package/cjs/extensions/forms/utils/FormError.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/helpers.d.ts +1 -0
- package/cjs/shared/helpers.js +7 -0
- package/cjs/shared/helpers.js.map +1 -1
- package/cjs/shared/locales/sv-SE.js +2 -2
- package/cjs/shared/locales/sv-SE.js.map +1 -1
- package/cjs/style/core/scopes.scss +1 -1
- package/cjs/style/dnb-ui-basis.css +1 -1
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-body.css +1 -1
- package/cjs/style/dnb-ui-body.min.css +1 -1
- package/cjs/style/dnb-ui-components.css +13 -0
- package/cjs/style/dnb-ui-components.min.css +1 -1
- package/cjs/style/dnb-ui-core.css +1 -1
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +1 -1
- package/components/autocomplete/AutocompleteDocs.js +3 -3
- package/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/components/avatar/Avatar.js +1 -6
- package/components/avatar/Avatar.js.map +1 -1
- package/components/checkbox/CheckboxDocs.js +2 -2
- package/components/checkbox/CheckboxDocs.js.map +1 -1
- package/components/date-picker/DatePickerContext.d.ts +0 -1
- package/components/date-picker/DatePickerContext.js.map +1 -1
- package/components/date-picker/DatePickerDocs.js +1 -1
- package/components/date-picker/DatePickerDocs.js.map +1 -1
- package/components/date-picker/DatePickerInput.js +111 -137
- package/components/date-picker/DatePickerInput.js.map +1 -1
- package/components/date-picker/DatePickerProvider.js +0 -2
- package/components/date-picker/DatePickerProvider.js.map +1 -1
- package/components/date-picker/hooks/useDates.d.ts +0 -2
- package/components/date-picker/hooks/useDates.js +3 -5
- package/components/date-picker/hooks/useDates.js.map +1 -1
- package/components/date-picker/style/dnb-date-picker.css +4 -0
- package/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/components/dialog/DialogDocs.js +7 -2
- package/components/dialog/DialogDocs.js.map +1 -1
- package/components/dropdown/Dropdown.d.ts +20 -20
- package/components/dropdown/DropdownDocs.d.ts +1 -0
- package/components/dropdown/DropdownDocs.js +157 -0
- package/components/dropdown/DropdownDocs.js.map +1 -1
- package/components/flex/ContainerDocs.js +1 -1
- package/components/flex/ContainerDocs.js.map +1 -1
- package/components/flex/ItemDocs.d.ts +2 -0
- package/components/flex/ItemDocs.js +33 -0
- package/components/flex/ItemDocs.js.map +1 -0
- package/components/grid/ItemDocs.d.ts +2 -0
- package/components/grid/ItemDocs.js +13 -0
- package/components/grid/ItemDocs.js.map +1 -0
- package/components/input/InputDocs.js +3 -3
- package/components/input/InputDocs.js.map +1 -1
- package/components/input-masked/InputMasked.d.ts +0 -3
- package/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/components/input-masked/InputMaskedDocs.js +57 -0
- package/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/components/input-masked/InputMaskedHooks.js +11 -7
- package/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/components/input-masked/InputMaskedUtils.d.ts +1 -1
- package/components/input-masked/InputMaskedUtils.js +2 -1
- package/components/input-masked/InputMaskedUtils.js.map +1 -1
- package/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/components/input-masked/MultiInputMaskedDocs.js +69 -0
- package/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/components/input-masked/style/dnb-input-masked.css +9 -0
- package/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/components/input-masked/text-mask/InputModeNumber.js +32 -9
- package/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/components/modal/ModalDocs.d.ts +5 -0
- package/components/modal/ModalDocs.js +195 -0
- package/components/modal/ModalDocs.js.map +1 -0
- package/components/radio/RadioDocs.js +2 -2
- package/components/radio/RadioDocs.js.map +1 -1
- package/components/section/Section.js +1 -6
- package/components/section/Section.js.map +1 -1
- package/components/section/SectionDocs.js +1 -1
- package/components/section/SectionDocs.js.map +1 -1
- package/components/slider/SliderDocs.js +2 -2
- package/components/slider/SliderDocs.js.map +1 -1
- package/components/space/SpaceDocs.d.ts +3 -0
- package/components/space/SpaceDocs.js +55 -0
- package/components/space/SpaceDocs.js.map +1 -0
- package/components/switch/SwitchDocs.js +2 -2
- package/components/switch/SwitchDocs.js.map +1 -1
- package/components/textarea/TextareaDocs.js +3 -3
- package/components/textarea/TextareaDocs.js.map +1 -1
- package/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/components/tooltip/TooltipDocs.js +1 -1
- package/components/tooltip/TooltipDocs.js.map +1 -1
- package/components/upload/Upload.js +6 -3
- package/components/upload/Upload.js.map +1 -1
- package/components/upload/UploadDocs.d.ts +1 -0
- package/components/upload/UploadDocs.js +42 -0
- package/components/upload/UploadDocs.js.map +1 -1
- package/components/upload/UploadFileListCell.js +32 -12
- package/components/upload/UploadFileListCell.js.map +1 -1
- package/components/upload/types.d.ts +7 -0
- package/components/upload/types.js.map +1 -1
- package/es/components/autocomplete/AutocompleteDocs.js +3 -3
- package/es/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/es/components/avatar/Avatar.js +1 -6
- package/es/components/avatar/Avatar.js.map +1 -1
- package/es/components/checkbox/CheckboxDocs.js +2 -2
- package/es/components/checkbox/CheckboxDocs.js.map +1 -1
- package/es/components/date-picker/DatePickerContext.d.ts +0 -1
- package/es/components/date-picker/DatePickerContext.js.map +1 -1
- package/es/components/date-picker/DatePickerDocs.js +1 -1
- package/es/components/date-picker/DatePickerDocs.js.map +1 -1
- package/es/components/date-picker/DatePickerInput.js +103 -130
- package/es/components/date-picker/DatePickerInput.js.map +1 -1
- package/es/components/date-picker/DatePickerProvider.js +0 -2
- package/es/components/date-picker/DatePickerProvider.js.map +1 -1
- package/es/components/date-picker/hooks/useDates.d.ts +0 -2
- package/es/components/date-picker/hooks/useDates.js +3 -5
- package/es/components/date-picker/hooks/useDates.js.map +1 -1
- package/es/components/date-picker/style/dnb-date-picker.css +4 -0
- package/es/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/es/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/es/components/dialog/DialogDocs.js +7 -2
- package/es/components/dialog/DialogDocs.js.map +1 -1
- package/es/components/dropdown/Dropdown.d.ts +20 -20
- package/es/components/dropdown/DropdownDocs.d.ts +1 -0
- package/es/components/dropdown/DropdownDocs.js +157 -0
- package/es/components/dropdown/DropdownDocs.js.map +1 -1
- package/es/components/flex/ContainerDocs.js +1 -1
- package/es/components/flex/ContainerDocs.js.map +1 -1
- package/es/components/flex/ItemDocs.d.ts +2 -0
- package/es/components/flex/ItemDocs.js +33 -0
- package/es/components/flex/ItemDocs.js.map +1 -0
- package/es/components/grid/ItemDocs.d.ts +2 -0
- package/es/components/grid/ItemDocs.js +13 -0
- package/es/components/grid/ItemDocs.js.map +1 -0
- package/es/components/input/InputDocs.js +3 -3
- package/es/components/input/InputDocs.js.map +1 -1
- package/es/components/input-masked/InputMasked.d.ts +0 -3
- package/es/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/es/components/input-masked/InputMaskedDocs.js +57 -0
- package/es/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/es/components/input-masked/InputMaskedHooks.js +11 -7
- package/es/components/input-masked/InputMaskedHooks.js.map +1 -1
- package/es/components/input-masked/InputMaskedUtils.d.ts +1 -1
- package/es/components/input-masked/InputMaskedUtils.js +2 -1
- package/es/components/input-masked/InputMaskedUtils.js.map +1 -1
- package/es/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/es/components/input-masked/MultiInputMaskedDocs.js +69 -0
- package/es/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/es/components/input-masked/style/dnb-input-masked.css +9 -0
- package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/es/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/es/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/es/components/input-masked/text-mask/InputModeNumber.js +39 -9
- package/es/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/es/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/es/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/es/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/es/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/es/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/es/components/modal/ModalDocs.d.ts +5 -0
- package/es/components/modal/ModalDocs.js +191 -0
- package/es/components/modal/ModalDocs.js.map +1 -0
- package/es/components/radio/RadioDocs.js +2 -2
- package/es/components/radio/RadioDocs.js.map +1 -1
- package/es/components/section/Section.js +1 -6
- package/es/components/section/Section.js.map +1 -1
- package/es/components/section/SectionDocs.js +1 -1
- package/es/components/section/SectionDocs.js.map +1 -1
- package/es/components/slider/SliderDocs.js +2 -2
- package/es/components/slider/SliderDocs.js.map +1 -1
- package/es/components/space/SpaceDocs.d.ts +3 -0
- package/es/components/space/SpaceDocs.js +55 -0
- package/es/components/space/SpaceDocs.js.map +1 -0
- package/es/components/switch/SwitchDocs.js +2 -2
- package/es/components/switch/SwitchDocs.js.map +1 -1
- package/es/components/textarea/TextareaDocs.js +3 -3
- package/es/components/textarea/TextareaDocs.js.map +1 -1
- package/es/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/es/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/es/components/tooltip/TooltipDocs.js +1 -1
- package/es/components/tooltip/TooltipDocs.js.map +1 -1
- package/es/components/upload/Upload.js +6 -3
- package/es/components/upload/Upload.js.map +1 -1
- package/es/components/upload/UploadDocs.d.ts +1 -0
- package/es/components/upload/UploadDocs.js +42 -0
- package/es/components/upload/UploadDocs.js.map +1 -1
- package/es/components/upload/UploadFileListCell.js +32 -12
- package/es/components/upload/UploadFileListCell.js.map +1 -1
- package/es/components/upload/types.d.ts +7 -0
- package/es/components/upload/types.js.map +1 -1
- package/es/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/es/extensions/forms/DataContext/At/AtDocs.js +18 -0
- package/es/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/es/extensions/forms/DataContext/Provider/ProviderDocs.js +1 -1
- package/es/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/es/extensions/forms/Field/Number/Number.js +3 -6
- package/es/extensions/forms/Field/Number/Number.js.map +1 -1
- package/es/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/es/extensions/forms/Field/Password/PasswordDocs.js +13 -1
- package/es/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +6 -4
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js +24 -16
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.d.ts +2 -2
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +7 -2
- package/es/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
- package/es/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
- package/es/extensions/forms/Field/String/StringDocs.js +1 -1
- package/es/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/es/extensions/forms/Field/Upload/Upload.d.ts +1 -1
- package/es/extensions/forms/Field/Upload/Upload.js +3 -1
- package/es/extensions/forms/Field/Upload/Upload.js.map +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlock.js +11 -4
- package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
- package/es/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +13 -0
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.js +8 -0
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/es/extensions/forms/hooks/DataValueWritePropsDocs.js +1 -1
- package/es/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
- package/es/extensions/forms/hooks/useFieldProps.js +56 -19
- package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/es/extensions/forms/types.d.ts +8 -5
- package/es/extensions/forms/types.js.map +1 -1
- package/es/extensions/forms/utils/FormError.d.ts +20 -16
- package/es/extensions/forms/utils/FormError.js +1 -0
- package/es/extensions/forms/utils/FormError.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/helpers.d.ts +1 -0
- package/es/shared/helpers.js +6 -0
- package/es/shared/helpers.js.map +1 -1
- package/es/shared/locales/sv-SE.js +2 -2
- package/es/shared/locales/sv-SE.js.map +1 -1
- package/es/style/core/scopes.scss +1 -1
- package/es/style/dnb-ui-basis.css +1 -1
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-body.css +1 -1
- package/es/style/dnb-ui-body.min.css +1 -1
- package/es/style/dnb-ui-components.css +13 -0
- package/es/style/dnb-ui-components.min.css +1 -1
- package/es/style/dnb-ui-core.css +1 -1
- package/es/style/dnb-ui-core.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/es/style/themes/theme-ui/ui-theme-components.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 +1 -1
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/extensions/forms/DataContext/At/AtDocs.js +18 -0
- package/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/extensions/forms/DataContext/Provider/ProviderDocs.js +1 -1
- package/extensions/forms/DataContext/Provider/ProviderDocs.js.map +1 -1
- package/extensions/forms/Field/Number/Number.js +3 -6
- package/extensions/forms/Field/Number/Number.js.map +1 -1
- package/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/extensions/forms/Field/Password/PasswordDocs.js +13 -1
- package/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +6 -4
- package/extensions/forms/Field/PhoneNumber/PhoneNumber.js +33 -25
- package/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
- package/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.d.ts +2 -2
- package/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +7 -2
- package/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
- package/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
- package/extensions/forms/Field/String/StringDocs.js +1 -1
- package/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/extensions/forms/Field/Upload/Upload.d.ts +1 -1
- package/extensions/forms/Field/Upload/Upload.js +3 -1
- package/extensions/forms/Field/Upload/Upload.js.map +1 -1
- package/extensions/forms/FieldBlock/FieldBlock.js +11 -4
- package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
- package/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
- package/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +13 -0
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.js +8 -0
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/extensions/forms/hooks/DataValueWritePropsDocs.js +1 -1
- package/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
- package/extensions/forms/hooks/useFieldProps.js +56 -19
- package/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/extensions/forms/types.d.ts +8 -5
- package/extensions/forms/types.js.map +1 -1
- package/extensions/forms/utils/FormError.d.ts +20 -16
- package/extensions/forms/utils/FormError.js.map +1 -1
- package/package.json +1 -1
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +1 -1
- package/shared/helpers.d.ts +1 -0
- package/shared/helpers.js +6 -0
- package/shared/helpers.js.map +1 -1
- package/shared/locales/sv-SE.js +2 -2
- package/shared/locales/sv-SE.js.map +1 -1
- package/style/core/scopes.scss +1 -1
- package/style/dnb-ui-basis.css +1 -1
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-body.css +1 -1
- package/style/dnb-ui-body.min.css +1 -1
- package/style/dnb-ui-components.css +13 -0
- package/style/dnb-ui-components.min.css +1 -1
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/style/themes/theme-ui/ui-theme-components.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 +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataValueWritePropsDocs.js","names":["DataValueWritePropsProperties","value","doc","type","status","defaultValue","path","info","warning","error","disabled","emptyValue","required","labelSuffix","schema","validateInitially","validateUnchanged","validateContinuously","errorMessages","onChangeValidator","onBlurValidator","transformIn","transformOut","DataValueWritePropsEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueWritePropsDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const DataValueWritePropsProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the field. Will take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n defaultValue: {\n doc: 'Default source data value for the field. Will not take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for the field 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 info: {\n doc: \"Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n warning: {\n doc: \"Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n error: {\n doc: \"Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['Error', 'FormError', 'Array<Error | FormError>', 'function'],\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: ['{valueType}', 'undefined'],\n status: 'optional',\n },\n required: {\n doc: 'When set to `true`, the field will give an error if the value fails the required validation. When set to `false`, the field will not be required, but will add a \"(optional)\" suffix to the label.',\n type: 'boolean',\n status: 'optional',\n },\n labelSuffix: {\n doc: 'Will append an additional text to the label, like \"(optional)\". When using `inheritLabel`, the suffix will not be inherited. NB: The visual appearance of the `labelSuffix` may change in the future.',\n type: 'React.Node',\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 to `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 to `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 validateContinuously: {\n doc: 'Set to `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 onChangeValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n transformIn: {\n doc: 'Transforms the `value` before its displayed in the field (e.g. input).',\n type: 'function',\n status: 'optional',\n },\n transformOut: {\n doc: 'Transforms the value before it gets forwarded to the form data object (context) or returned as the `onChange` value parameter. The first parameter is the internal value. Some fields to support a second parameter, like the SelectCountry, where the country object is given.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const DataValueWritePropsEvents: PropertiesTableProps = {\n onChange: {\n doc: \"Will be called on value changes made by the user, with the new value as argument. When an `async` function is used, the corresponding [FieldBlock](/uilib/extensions/forms/create-component/FieldBlock/) will show an indicator on the field label. You can return `{ success: 'saved' } as const` to show a success symbol, or an error or an object with these keys `{ info: 'Info message', warning: 'Warning message', error: Error('My error') } as const`. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).\",\n type: '(value) => void',\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. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).',\n type: '(value) => void',\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. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).',\n type: '(value) => void',\n status: 'optional',\n },\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DataValueWritePropsDocs.js","names":["DataValueWritePropsProperties","value","doc","type","status","defaultValue","path","info","warning","error","disabled","emptyValue","required","labelSuffix","schema","validateInitially","validateUnchanged","validateContinuously","errorMessages","onChangeValidator","onBlurValidator","transformIn","transformOut","DataValueWritePropsEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueWritePropsDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const DataValueWritePropsProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the field. Will take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n defaultValue: {\n doc: 'Default source data value for the field. Will not take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for the field 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 info: {\n doc: \"Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n warning: {\n doc: \"Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n error: {\n doc: \"Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['Error', 'FormError', 'Array<Error | FormError>', 'function'],\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: ['{valueType}', 'undefined'],\n status: 'optional',\n },\n required: {\n doc: 'When set to `true`, the field will give an error if the value fails the required validation. When set to `false`, the field will not be required, but will add a \"(optional)\" suffix to the label.',\n type: 'boolean',\n status: 'optional',\n },\n labelSuffix: {\n doc: 'Will append an additional text to the label, like \"(optional)\". When using `inheritLabel`, the suffix will not be inherited. NB: The visual appearance of the `labelSuffix` may change in the future.',\n type: 'React.Node',\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 to `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 to `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 validateContinuously: {\n doc: 'Set to `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. The messages can be a React.ReactNode or a string.',\n type: 'object',\n status: 'optional',\n },\n onChangeValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n transformIn: {\n doc: 'Transforms the `value` before its displayed in the field (e.g. input).',\n type: 'function',\n status: 'optional',\n },\n transformOut: {\n doc: 'Transforms the value before it gets forwarded to the form data object (context) or returned as the `onChange` value parameter. The first parameter is the internal value. Some fields to support a second parameter, like the SelectCountry, where the country object is given.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const DataValueWritePropsEvents: PropertiesTableProps = {\n onChange: {\n doc: \"Will be called on value changes made by the user, with the new value as argument. When an `async` function is used, the corresponding [FieldBlock](/uilib/extensions/forms/create-component/FieldBlock/) will show an indicator on the field label. You can return `{ success: 'saved' } as const` to show a success symbol, or an error or an object with these keys `{ info: 'Info message', warning: 'Warning message', error: Error('My error') } as const`. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).\",\n type: '(value) => void',\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. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).',\n type: '(value) => void',\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. The second parameter is an object that e.g. contains `props` (all given `Field.*` properties).',\n type: '(value) => void',\n status: 'optional',\n },\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ import { ajvErrorsToOneFormError, errorChanged, overwriteErrorMessagesWithGivenA
|
|
|
11
11
|
import { Context as DataContext } from '../DataContext';
|
|
12
12
|
import { clearedData } from '../DataContext/Provider/Provider';
|
|
13
13
|
import FieldProviderContext from '../Field/Provider/FieldProviderContext';
|
|
14
|
-
import { combineDescribedBy, warn } from '../../../shared/component-helper';
|
|
14
|
+
import { combineDescribedBy, convertJsxToString, warn } from '../../../shared/component-helper';
|
|
15
15
|
import useId from '../../../shared/helpers/useId';
|
|
16
16
|
import useUpdateEffect from '../../../shared/helpers/useUpdateEffect';
|
|
17
17
|
import FieldBlockContext from '../FieldBlock/FieldBlockContext';
|
|
@@ -256,6 +256,28 @@ export default function useFieldProps(localProps) {
|
|
|
256
256
|
id: undefined
|
|
257
257
|
};
|
|
258
258
|
}, [fieldInternalsRef]);
|
|
259
|
+
const errorMessageCacheRef = useRef(new Map());
|
|
260
|
+
const ensureErrorMessageObject = useCallback(error => {
|
|
261
|
+
let key = null;
|
|
262
|
+
let returnValue = error;
|
|
263
|
+
if (typeof error === 'string') {
|
|
264
|
+
key = error;
|
|
265
|
+
returnValue = new Error(error);
|
|
266
|
+
} else if (error && React.isValidElement(error)) {
|
|
267
|
+
key = error.key || convertJsxToString(error);
|
|
268
|
+
returnValue = new FormError('Error', {
|
|
269
|
+
formattedMessage: error
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
if (key) {
|
|
273
|
+
if (errorMessageCacheRef.current.has(key)) {
|
|
274
|
+
return errorMessageCacheRef.current.get(key);
|
|
275
|
+
} else {
|
|
276
|
+
errorMessageCacheRef.current.set(key, returnValue);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return returnValue;
|
|
280
|
+
}, []);
|
|
259
281
|
const messageCacheRef = useRef({
|
|
260
282
|
isSet: false,
|
|
261
283
|
message: undefined
|
|
@@ -271,7 +293,7 @@ export default function useFieldProps(localProps) {
|
|
|
271
293
|
if (options !== null && options !== void 0 && options.showInitially) {
|
|
272
294
|
currentMode |= INITIALLY;
|
|
273
295
|
}
|
|
274
|
-
return callback();
|
|
296
|
+
return executeMessage(callback());
|
|
275
297
|
},
|
|
276
298
|
getValueByPath,
|
|
277
299
|
getFieldByPath
|
|
@@ -301,8 +323,8 @@ export default function useFieldProps(localProps) {
|
|
|
301
323
|
return undefined;
|
|
302
324
|
}
|
|
303
325
|
}
|
|
304
|
-
return message;
|
|
305
|
-
}, [getFieldByPath, getValueByPath]);
|
|
326
|
+
return ensureErrorMessageObject(message);
|
|
327
|
+
}, [getFieldByPath, getValueByPath, ensureErrorMessageObject]);
|
|
306
328
|
const errorProp = initialErrorProp === 'initial' ? undefined : initialErrorProp;
|
|
307
329
|
const error = executeMessage(errorProp);
|
|
308
330
|
const warning = executeMessage(warningProp);
|
|
@@ -330,7 +352,7 @@ export default function useFieldProps(localProps) {
|
|
|
330
352
|
const asyncBehaviorIsEnabled = useMemo(() => {
|
|
331
353
|
return isAsync(onChange) || isAsync(onChangeContext);
|
|
332
354
|
}, [onChangeContext, onChange]);
|
|
333
|
-
const
|
|
355
|
+
const validatedValueRef = useRef();
|
|
334
356
|
const changeEventResultRef = useRef(null);
|
|
335
357
|
const asyncProcessRef = useRef(null);
|
|
336
358
|
const defineAsyncProcess = useCallback(name => {
|
|
@@ -432,8 +454,8 @@ export default function useFieldProps(localProps) {
|
|
|
432
454
|
return extendedErrorMessages;
|
|
433
455
|
}, [contextErrorMessages, errorMessages, identifier]);
|
|
434
456
|
const prepareError = useCallback(error => {
|
|
435
|
-
|
|
436
|
-
|
|
457
|
+
const prepare = error => {
|
|
458
|
+
if (error instanceof FormError) {
|
|
437
459
|
let message = error.message;
|
|
438
460
|
const {
|
|
439
461
|
ajvKeyword
|
|
@@ -464,9 +486,20 @@ export default function useFieldProps(localProps) {
|
|
|
464
486
|
} else if (message.includes('.')) {
|
|
465
487
|
message = formatMessage(message, error.messageValues);
|
|
466
488
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
489
|
+
if (React.isValidElement(message)) {
|
|
490
|
+
error.formattedMessage = message;
|
|
491
|
+
} else {
|
|
492
|
+
error.message = message;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return ensureErrorMessageObject(error);
|
|
496
|
+
};
|
|
497
|
+
if (Array.isArray(error)) {
|
|
498
|
+
return new FormError('Error', {
|
|
499
|
+
errors: error.map(prepare)
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
if (error instanceof FormError) {
|
|
470
503
|
if (Array.isArray(error.errors)) {
|
|
471
504
|
error.errors = error.errors.map(prepare);
|
|
472
505
|
return error;
|
|
@@ -474,7 +507,7 @@ export default function useFieldProps(localProps) {
|
|
|
474
507
|
return prepare(error);
|
|
475
508
|
}
|
|
476
509
|
return error;
|
|
477
|
-
}, [combinedErrorMessages, formatMessage]);
|
|
510
|
+
}, [combinedErrorMessages, ensureErrorMessageObject, formatMessage]);
|
|
478
511
|
contextErrorRef.current = useMemo(() => {
|
|
479
512
|
const dataContextError = dataContextErrors === null || dataContextErrors === void 0 ? void 0 : dataContextErrors[path];
|
|
480
513
|
if (!dataContextError) {
|
|
@@ -570,9 +603,9 @@ export default function useFieldProps(localProps) {
|
|
|
570
603
|
}
|
|
571
604
|
callStackRef.current = [];
|
|
572
605
|
} else {
|
|
573
|
-
return result;
|
|
606
|
+
return ensureErrorMessageObject(result);
|
|
574
607
|
}
|
|
575
|
-
}, [additionalArgs, hasBeenCalledRef]);
|
|
608
|
+
}, [additionalArgs, hasBeenCalledRef, ensureErrorMessageObject]);
|
|
576
609
|
const callValidatorFnSync = useCallback(function (validator) {
|
|
577
610
|
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : valueRef.current;
|
|
578
611
|
if (typeof validator !== 'function') {
|
|
@@ -607,9 +640,9 @@ export default function useFieldProps(localProps) {
|
|
|
607
640
|
}
|
|
608
641
|
callStackRef.current = [];
|
|
609
642
|
} else {
|
|
610
|
-
return result;
|
|
643
|
+
return ensureErrorMessageObject(result);
|
|
611
644
|
}
|
|
612
|
-
}, [additionalArgs, callValidatorFnAsync, hasBeenCalledRef]);
|
|
645
|
+
}, [additionalArgs, callValidatorFnAsync, hasBeenCalledRef, ensureErrorMessageObject]);
|
|
613
646
|
const stateId = useId();
|
|
614
647
|
const persistErrorState = useCallback(function (method, initiator) {
|
|
615
648
|
var _errorMethodRef$curre, _errorMethodRef$curre2;
|
|
@@ -833,7 +866,7 @@ export default function useFieldProps(localProps) {
|
|
|
833
866
|
}
|
|
834
867
|
const value = valueRef.current;
|
|
835
868
|
changeEventResultRef.current = null;
|
|
836
|
-
|
|
869
|
+
validatedValueRef.current = null;
|
|
837
870
|
let initiator = null;
|
|
838
871
|
try {
|
|
839
872
|
const requiredError = transformers.current.validateRequired(value, {
|
|
@@ -846,6 +879,10 @@ export default function useFieldProps(localProps) {
|
|
|
846
879
|
initiator = 'required';
|
|
847
880
|
throw requiredError;
|
|
848
881
|
}
|
|
882
|
+
if (error instanceof Error) {
|
|
883
|
+
initiator = 'errorProp';
|
|
884
|
+
throw error;
|
|
885
|
+
}
|
|
849
886
|
if (value !== undefined && !prioritizeContextSchema && typeof schemaValidatorRef.current === 'function') {
|
|
850
887
|
if (!schemaValidatorRef.current(value)) {
|
|
851
888
|
const error = ajvErrorsToOneFormError(schemaValidatorRef.current.errors, value);
|
|
@@ -874,13 +911,13 @@ export default function useFieldProps(localProps) {
|
|
|
874
911
|
if (isProcessActive()) {
|
|
875
912
|
clearErrorState();
|
|
876
913
|
}
|
|
877
|
-
|
|
914
|
+
validatedValueRef.current = value;
|
|
878
915
|
} catch (error) {
|
|
879
916
|
if (isProcessActive()) {
|
|
880
917
|
persistErrorState('weak', initiator, error);
|
|
881
918
|
}
|
|
882
919
|
}
|
|
883
|
-
}, [clearErrorState, disabled, emptyValue, hideError, persistErrorState, prioritizeContextSchema, required, setFieldState, startOnBlurValidatorProcess, startOnChangeValidatorValidation, startProcess, validateInitially, validateUnchanged]);
|
|
920
|
+
}, [clearErrorState, disabled, emptyValue, error, hideError, persistErrorState, prioritizeContextSchema, required, setFieldState, startOnBlurValidatorProcess, startOnChangeValidatorValidation, startProcess, validateInitially, validateUnchanged]);
|
|
884
921
|
const removeError = useCallback(() => {
|
|
885
922
|
setChanged(false);
|
|
886
923
|
hideError();
|
|
@@ -951,7 +988,7 @@ export default function useFieldProps(localProps) {
|
|
|
951
988
|
withStates,
|
|
952
989
|
hasValue
|
|
953
990
|
} = _ref9;
|
|
954
|
-
const hasMatchingValue = hasValue ===
|
|
991
|
+
const hasMatchingValue = hasValue === validatedValueRef.current;
|
|
955
992
|
const result = (typeof hasValue === 'undefined' ? false : !hasMatchingValue) || (processName ? processName === asyncProcessRef.current : true) && (withStates === null || withStates === void 0 ? void 0 : withStates.some(state => {
|
|
956
993
|
return state === fieldStateRef.current;
|
|
957
994
|
}));
|