@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
|
@@ -54,7 +54,6 @@ function DatePickerProvider(externalProps) {
|
|
|
54
54
|
const {
|
|
55
55
|
dates,
|
|
56
56
|
updateDates,
|
|
57
|
-
hasHadValidDate,
|
|
58
57
|
previousDateProps
|
|
59
58
|
} = (0, _useDates.default)({
|
|
60
59
|
date,
|
|
@@ -148,7 +147,6 @@ function DatePickerProvider(externalProps) {
|
|
|
148
147
|
props
|
|
149
148
|
}, dates), {}, {
|
|
150
149
|
previousDateProps,
|
|
151
|
-
hasHadValidDate,
|
|
152
150
|
views,
|
|
153
151
|
setViews,
|
|
154
152
|
setHasClickedCalendarDay
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerProvider.js","names":["_react","_interopRequireWildcard","require","_isValid","_interopRequireDefault","_format","_differenceInCalendarDays","_Context","_DatePickerCalc","_DatePickerContext","_useViews","_useDates","_useLastEventCallCache","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","length","indexOf","propertyIsEnumerable","ownKeys","keys","filter","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","defaultProps","returnFormat","DatePickerProvider","externalProps","props","date","startDate","endDate","startMonth","endMonth","minDate","maxDate","dateFormat","range","correctInvalidDate","attributes","returnFormatProp","children","onChange","setReturnObject","hidePicker","sharedContext","useContext","SharedContext","dates","updateDates","hasHadValidDate","previousDateProps","useDates","isRange","shouldCorrectDate","views","setViews","setHasClickedCalendarDay","useViews","lastEventCallCache","setLastEventCallCache","useLastEventCallCache","getReturnObject","useCallback","_ref","undefined","event","rest","partialStartDate","partialEndDate","invalidStartDate","invalidEndDate","correctV1Format","startDateIsValid","Boolean","isValid","endDateIsValid","hasMinOrMaxDates","returnObject","days_between","differenceInCalendarDays","start_date","format","end_date","is_valid_start_date","isDisabled","is_valid_end_date","partialDate","invalidDate","is_valid","callOnChangeHandler","createElement","Provider","translation","_default","exports"],"sources":["../../../../src/components/date-picker/DatePickerProvider.tsx"],"sourcesContent":["/**\n * Web DatePicker Provider\n *\n */\n\nimport React, { useCallback, useContext } from 'react'\nimport type {\n DatePickerEventAttributes,\n DatePickerAllProps,\n DatePickerProps,\n} from './DatePicker'\n\nimport isValid from 'date-fns/isValid'\nimport format from 'date-fns/format'\nimport differenceInCalendarDays from 'date-fns/differenceInCalendarDays'\n\nimport SharedContext from '../../shared/Context'\nimport { correctV1Format, isDisabled } from './DatePickerCalc'\nimport DatePickerContext, {\n DatePickerContextValues,\n} from './DatePickerContext'\nimport useViews, { CalendarView } from './hooks/useViews'\nimport useDates, { DatePickerDates } from './hooks/useDates'\nimport useLastEventCallCache, {\n LastEventCallCache,\n} from './hooks/useLastEventCallCache'\nimport { InvalidDates } from './DatePickerInput'\nimport { PartialDates } from './hooks/usePartialDates'\n\ntype DatePickerProviderProps = DatePickerAllProps & {\n setReturnObject: (\n func: DatePickerContextValues['getReturnObject']\n ) => DatePickerContextValues['getReturnObject']\n hidePicker?: DatePickerContextValues['hidePicker']\n attributes?: DatePickerEventAttributes\n children: React.ReactNode\n}\n\nexport type DatePickerChangeEvent<E> = DatePickerDates &\n InvalidDates & {\n nr?: number\n hidePicker?: boolean\n event?: E\n }\n\nexport type GetReturnObjectParams<E> = DatePickerDates &\n PartialDates &\n InvalidDates & {\n event?: E\n }\n\n// TODO: convert properties on event handler return objects to camelCase, constitutes a breaking change\nexport type ReturnObject<E> = InvalidDates &\n PartialDates & {\n event?: E\n attributes?: Record<string, unknown>\n days_between?: number\n date?: string | null\n start_date?: string | null\n end_date?: string | null\n is_valid?: boolean\n is_valid_start_date?: boolean\n is_valid_end_date?: boolean\n }\n\nexport type DatePickerProviderState = DatePickerDates &\n Array<CalendarView> &\n LastEventCallCache\n\nconst defaultProps: Partial<DatePickerProps> = {\n returnFormat: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD\n}\n\nfunction DatePickerProvider(externalProps: DatePickerProviderProps) {\n const props = { ...defaultProps, ...externalProps }\n\n const {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n dateFormat,\n range,\n correctInvalidDate,\n attributes,\n returnFormat: returnFormatProp,\n children,\n onChange,\n setReturnObject,\n hidePicker,\n } = props\n\n const sharedContext = useContext(SharedContext)\n\n const { dates, updateDates, hasHadValidDate, previousDateProps } =\n useDates(\n {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n },\n {\n dateFormat: dateFormat,\n isRange: range,\n shouldCorrectDate: correctInvalidDate,\n }\n )\n\n const { views, setViews, setHasClickedCalendarDay } = useViews({\n startMonth: dates.startMonth,\n endMonth: dates.endMonth,\n isRange: range,\n })\n\n const [lastEventCallCache, setLastEventCallCache] =\n useLastEventCallCache({\n startDate: dates.startDate,\n endDate: dates.endDate,\n })\n\n const getReturnObject = useCallback(\n <E,>({ event = null, ...rest }: GetReturnObjectParams<E> = {}) => {\n const {\n startDate,\n endDate,\n partialStartDate,\n partialEndDate,\n invalidStartDate,\n invalidEndDate,\n } = {\n ...views,\n ...dates,\n ...rest,\n }\n\n const returnFormat = correctV1Format(returnFormatProp)\n const startDateIsValid = Boolean(startDate && isValid(startDate))\n const endDateIsValid = Boolean(endDate && isValid(endDate))\n const hasMinOrMaxDates = minDate || maxDate\n\n const returnObject: ReturnObject<E> = {\n event,\n attributes: attributes || {},\n }\n\n // Handle range props\n if (range) {\n return {\n ...returnObject,\n days_between:\n startDateIsValid && endDateIsValid\n ? differenceInCalendarDays(endDate, startDate)\n : null,\n start_date: startDateIsValid\n ? format(startDate, returnFormat)\n : null,\n end_date: endDateIsValid ? format(endDate, returnFormat) : null,\n is_valid_start_date:\n hasMinOrMaxDates &&\n startDateIsValid &&\n isDisabled(startDate, dates.minDate, dates.maxDate)\n ? false\n : startDateIsValid,\n is_valid_end_date:\n hasMinOrMaxDates &&\n endDateIsValid &&\n isDisabled(endDate, dates.minDate, dates.maxDate)\n ? false\n : endDateIsValid,\n partialStartDate,\n partialEndDate,\n invalidStartDate,\n invalidEndDate,\n }\n }\n\n return {\n ...returnObject,\n date: startDateIsValid ? format(startDate, returnFormat) : null,\n partialDate: partialStartDate,\n // Can be removed in v11, in favor to partialDate,\n // to keep the naming logic the same as with date and invalidDate when not in range mode\n partialStartDate,\n invalidDate: invalidStartDate,\n is_valid:\n hasMinOrMaxDates &&\n startDateIsValid &&\n isDisabled(startDate, dates.minDate, dates.maxDate)\n ? false\n : startDateIsValid,\n }\n },\n [dates, views, attributes, maxDate, minDate, range, returnFormatProp]\n )\n\n const callOnChangeHandler = useCallback(\n <E,>(event: E & DatePickerDates) => {\n /**\n * Prevent on_change to be fired twice if date not has actually changed\n */\n if (\n lastEventCallCache &&\n lastEventCallCache.startDate === event.startDate &&\n lastEventCallCache.endDate === event.endDate\n ) {\n return // stop here\n }\n\n onChange?.(getReturnObject({ ...dates, ...event }))\n\n setLastEventCallCache({\n startDate: event.startDate,\n endDate: event.endDate,\n })\n },\n [\n getReturnObject,\n dates,\n onChange,\n lastEventCallCache,\n setLastEventCallCache,\n ]\n )\n\n // Is this at any point something other than a function?\n if (typeof setReturnObject === 'function') {\n setReturnObject(getReturnObject)\n }\n\n return (\n <DatePickerContext.Provider\n value={{\n translation: sharedContext.translation,\n updateDates,\n getReturnObject,\n callOnChangeHandler,\n hidePicker: hidePicker,\n props,\n ...dates,\n previousDateProps,\n hasHadValidDate,\n views,\n setViews,\n setHasClickedCalendarDay,\n }}\n >\n {children}\n </DatePickerContext.Provider>\n )\n}\n\nexport default DatePickerProvider\n"],"mappings":";;;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,yBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AAC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BAAkB,CAAC5B,OAAO,KAAKmC,KAAK,CAACnC,OAAO,EAC5C;MACA;IACF;IAEAW,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGoB,eAAe,CAAAtD,aAAA,CAAAA,aAAA,KAAMwC,KAAK,GAAKkB,KAAK,CAAE,CAAC,CAAC;IAEnDN,qBAAqB,CAAC;MACpB9B,SAAS,EAAEoC,KAAK,CAACpC,SAAS;MAC1BC,OAAO,EAAEmC,KAAK,CAACnC;IACjB,CAAC,CAAC;EACJ,CAAC,EACD,CACE+B,eAAe,EACfd,KAAK,EACLN,QAAQ,EACRiB,kBAAkB,EAClBC,qBAAqB,CAEzB,CAAC;EAGD,IAAI,OAAOjB,eAAe,KAAK,UAAU,EAAE;IACzCA,eAAe,CAACmB,eAAe,CAAC;EAClC;EAEA,OACErG,MAAA,CAAAgB,OAAA,CAAAkH,aAAA,CAACzH,kBAAA,CAAAO,OAAiB,CAACmH,QAAQ;IACzB7E,KAAK,EAAAP,aAAA,CAAAA,aAAA;MACHqF,WAAW,EAAEhD,aAAa,CAACgD,WAAW;MACtC5C,WAAW;MACXa,eAAe;MACf4B,mBAAmB;MACnB9C,UAAU,EAAEA,UAAU;MACtBhB;IAAK,GACFoB,KAAK;MACRG,iBAAiB;MACjBD,eAAe;MACfK,KAAK;MACLC,QAAQ;MACRC;IAAwB;EACxB,GAEDhB,QACyB,CAAC;AAEjC;AAAC,IAAAqD,QAAA,GAAAC,OAAA,CAAAtH,OAAA,GAEciD,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DatePickerProvider.js","names":["_react","_interopRequireWildcard","require","_isValid","_interopRequireDefault","_format","_differenceInCalendarDays","_Context","_DatePickerCalc","_DatePickerContext","_useViews","_useDates","_useLastEventCallCache","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","length","indexOf","propertyIsEnumerable","ownKeys","keys","filter","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","defaultProps","returnFormat","DatePickerProvider","externalProps","props","date","startDate","endDate","startMonth","endMonth","minDate","maxDate","dateFormat","range","correctInvalidDate","attributes","returnFormatProp","children","onChange","setReturnObject","hidePicker","sharedContext","useContext","SharedContext","dates","updateDates","previousDateProps","useDates","isRange","shouldCorrectDate","views","setViews","setHasClickedCalendarDay","useViews","lastEventCallCache","setLastEventCallCache","useLastEventCallCache","getReturnObject","useCallback","_ref","undefined","event","rest","partialStartDate","partialEndDate","invalidStartDate","invalidEndDate","correctV1Format","startDateIsValid","Boolean","isValid","endDateIsValid","hasMinOrMaxDates","returnObject","days_between","differenceInCalendarDays","start_date","format","end_date","is_valid_start_date","isDisabled","is_valid_end_date","partialDate","invalidDate","is_valid","callOnChangeHandler","createElement","Provider","translation","_default","exports"],"sources":["../../../../src/components/date-picker/DatePickerProvider.tsx"],"sourcesContent":["/**\n * Web DatePicker Provider\n *\n */\n\nimport React, { useCallback, useContext } from 'react'\nimport type {\n DatePickerEventAttributes,\n DatePickerAllProps,\n DatePickerProps,\n} from './DatePicker'\n\nimport isValid from 'date-fns/isValid'\nimport format from 'date-fns/format'\nimport differenceInCalendarDays from 'date-fns/differenceInCalendarDays'\n\nimport SharedContext from '../../shared/Context'\nimport { correctV1Format, isDisabled } from './DatePickerCalc'\nimport DatePickerContext, {\n DatePickerContextValues,\n} from './DatePickerContext'\nimport useViews, { CalendarView } from './hooks/useViews'\nimport useDates, { DatePickerDates } from './hooks/useDates'\nimport useLastEventCallCache, {\n LastEventCallCache,\n} from './hooks/useLastEventCallCache'\nimport { InvalidDates } from './DatePickerInput'\nimport { PartialDates } from './hooks/usePartialDates'\n\ntype DatePickerProviderProps = DatePickerAllProps & {\n setReturnObject: (\n func: DatePickerContextValues['getReturnObject']\n ) => DatePickerContextValues['getReturnObject']\n hidePicker?: DatePickerContextValues['hidePicker']\n attributes?: DatePickerEventAttributes\n children: React.ReactNode\n}\n\nexport type DatePickerChangeEvent<E> = DatePickerDates &\n InvalidDates & {\n nr?: number\n hidePicker?: boolean\n event?: E\n }\n\nexport type GetReturnObjectParams<E> = DatePickerDates &\n PartialDates &\n InvalidDates & {\n event?: E\n }\n\n// TODO: convert properties on event handler return objects to camelCase, constitutes a breaking change\nexport type ReturnObject<E> = InvalidDates &\n PartialDates & {\n event?: E\n attributes?: Record<string, unknown>\n days_between?: number\n date?: string | null\n start_date?: string | null\n end_date?: string | null\n is_valid?: boolean\n is_valid_start_date?: boolean\n is_valid_end_date?: boolean\n }\n\nexport type DatePickerProviderState = DatePickerDates &\n Array<CalendarView> &\n LastEventCallCache\n\nconst defaultProps: Partial<DatePickerProps> = {\n returnFormat: 'yyyy-MM-dd', // used in date-fns v1: YYYY-MM-DD\n}\n\nfunction DatePickerProvider(externalProps: DatePickerProviderProps) {\n const props = { ...defaultProps, ...externalProps }\n\n const {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n dateFormat,\n range,\n correctInvalidDate,\n attributes,\n returnFormat: returnFormatProp,\n children,\n onChange,\n setReturnObject,\n hidePicker,\n } = props\n\n const sharedContext = useContext(SharedContext)\n\n const { dates, updateDates, previousDateProps } = useDates(\n {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n },\n {\n dateFormat: dateFormat,\n isRange: range,\n shouldCorrectDate: correctInvalidDate,\n }\n )\n\n const { views, setViews, setHasClickedCalendarDay } = useViews({\n startMonth: dates.startMonth,\n endMonth: dates.endMonth,\n isRange: range,\n })\n\n const [lastEventCallCache, setLastEventCallCache] =\n useLastEventCallCache({\n startDate: dates.startDate,\n endDate: dates.endDate,\n })\n\n const getReturnObject = useCallback(\n <E,>({ event = null, ...rest }: GetReturnObjectParams<E> = {}) => {\n const {\n startDate,\n endDate,\n partialStartDate,\n partialEndDate,\n invalidStartDate,\n invalidEndDate,\n } = {\n ...views,\n ...dates,\n ...rest,\n }\n\n const returnFormat = correctV1Format(returnFormatProp)\n const startDateIsValid = Boolean(startDate && isValid(startDate))\n const endDateIsValid = Boolean(endDate && isValid(endDate))\n const hasMinOrMaxDates = minDate || maxDate\n\n const returnObject: ReturnObject<E> = {\n event,\n attributes: attributes || {},\n }\n\n // Handle range props\n if (range) {\n return {\n ...returnObject,\n days_between:\n startDateIsValid && endDateIsValid\n ? differenceInCalendarDays(endDate, startDate)\n : null,\n start_date: startDateIsValid\n ? format(startDate, returnFormat)\n : null,\n end_date: endDateIsValid ? format(endDate, returnFormat) : null,\n is_valid_start_date:\n hasMinOrMaxDates &&\n startDateIsValid &&\n isDisabled(startDate, dates.minDate, dates.maxDate)\n ? false\n : startDateIsValid,\n is_valid_end_date:\n hasMinOrMaxDates &&\n endDateIsValid &&\n isDisabled(endDate, dates.minDate, dates.maxDate)\n ? false\n : endDateIsValid,\n partialStartDate,\n partialEndDate,\n invalidStartDate,\n invalidEndDate,\n }\n }\n\n return {\n ...returnObject,\n date: startDateIsValid ? format(startDate, returnFormat) : null,\n partialDate: partialStartDate,\n // Can be removed in v11, in favor to partialDate,\n // to keep the naming logic the same as with date and invalidDate when not in range mode\n partialStartDate,\n invalidDate: invalidStartDate,\n is_valid:\n hasMinOrMaxDates &&\n startDateIsValid &&\n isDisabled(startDate, dates.minDate, dates.maxDate)\n ? false\n : startDateIsValid,\n }\n },\n [dates, views, attributes, maxDate, minDate, range, returnFormatProp]\n )\n\n const callOnChangeHandler = useCallback(\n <E,>(event: E & DatePickerDates) => {\n /**\n * Prevent on_change to be fired twice if date not has actually changed\n */\n if (\n lastEventCallCache &&\n lastEventCallCache.startDate === event.startDate &&\n lastEventCallCache.endDate === event.endDate\n ) {\n return // stop here\n }\n\n onChange?.(getReturnObject({ ...dates, ...event }))\n\n setLastEventCallCache({\n startDate: event.startDate,\n endDate: event.endDate,\n })\n },\n [\n getReturnObject,\n dates,\n onChange,\n lastEventCallCache,\n setLastEventCallCache,\n ]\n )\n\n // Is this at any point something other than a function?\n if (typeof setReturnObject === 'function') {\n setReturnObject(getReturnObject)\n }\n\n return (\n <DatePickerContext.Provider\n value={{\n translation: sharedContext.translation,\n updateDates,\n getReturnObject,\n callOnChangeHandler,\n hidePicker: hidePicker,\n props,\n ...dates,\n previousDateProps,\n views,\n setViews,\n setHasClickedCalendarDay,\n }}\n >\n {children}\n </DatePickerContext.Provider>\n )\n}\n\nexport default DatePickerProvider\n"],"mappings":";;;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,yBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAGA,IAAAQ,SAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,sBAAA,GAAAR,sBAAA,CAAAF,OAAA;AAEsC,MAAAW,SAAA;AAAA,SAAAT,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAb,wBAAAa,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CA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;MACHoF,WAAW,EAAE/C,aAAa,CAAC+C,WAAW;MACtC3C,WAAW;MACXY,eAAe;MACf4B,mBAAmB;MACnB7C,UAAU,EAAEA,UAAU;MACtBhB;IAAK,GACFoB,KAAK;MACRE,iBAAiB;MACjBI,KAAK;MACLC,QAAQ;MACRC;IAAwB;EACxB,GAEDf,QACyB,CAAC;AAEjC;AAAC,IAAAoD,QAAA,GAAAC,OAAA,CAAArH,OAAA,GAEciD,kBAAkB","ignoreList":[]}
|
|
@@ -30,13 +30,11 @@ export type DatePickerDates = {
|
|
|
30
30
|
maxDate?: Date;
|
|
31
31
|
startMonth?: Date;
|
|
32
32
|
endMonth?: Date;
|
|
33
|
-
hasHadValidDate?: boolean;
|
|
34
33
|
hoverDate?: Date;
|
|
35
34
|
} & DatePickerInputDates;
|
|
36
35
|
export default function useDates(dateProps: DatePickerDateProps, { dateFormat, isRange, shouldCorrectDate, }: UseDatesOptions): {
|
|
37
36
|
readonly dates: DatePickerDates;
|
|
38
37
|
readonly updateDates: (newDates: DatePickerDates, callback?: (dates: DatePickerDates) => void) => void;
|
|
39
|
-
readonly hasHadValidDate: boolean;
|
|
40
38
|
readonly previousDateProps: DatePickerDateProps;
|
|
41
39
|
};
|
|
42
40
|
export declare function pad(date: string, size: number): string;
|
|
@@ -7,17 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = useDates;
|
|
8
8
|
exports.pad = pad;
|
|
9
9
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
-
var _react = require("react");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _DatePickerCalc = require("../DatePickerCalc");
|
|
12
12
|
var _isValid = _interopRequireDefault(require("date-fns/isValid"));
|
|
13
13
|
var _format = _interopRequireDefault(require("date-fns/format"));
|
|
14
14
|
var _dateFns = require("date-fns");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
22
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
const useLayoutEffect = typeof window === 'undefined' ? _react.default.useEffect : _react.default.useLayoutEffect;
|
|
21
24
|
function useDates(dateProps, _ref) {
|
|
22
25
|
let {
|
|
23
26
|
dateFormat,
|
|
@@ -55,7 +58,6 @@ function useDates(dateProps, _ref) {
|
|
|
55
58
|
setDates(currentDates => _objectSpread(_objectSpread({}, currentDates), derivedDates));
|
|
56
59
|
setPreviousDateProps(dateProps);
|
|
57
60
|
}
|
|
58
|
-
const hasHadValidDate = (0, _react.useRef)(false);
|
|
59
61
|
const updateDates = (0, _react.useCallback)((newDates, callback) => {
|
|
60
62
|
var _newDates$startDate, _newDates$endDate;
|
|
61
63
|
const correctedDates = shouldCorrectDate ? correctDates({
|
|
@@ -74,16 +76,14 @@ function useDates(dateProps, _ref) {
|
|
|
74
76
|
});
|
|
75
77
|
callback === null || callback === void 0 ? void 0 : callback(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dates), newDates), months), correctedDates));
|
|
76
78
|
}, [dates, shouldCorrectDate, isRange]);
|
|
77
|
-
(
|
|
79
|
+
useLayoutEffect(() => {
|
|
78
80
|
const startDates = updateInputDates('start', dates.startDate);
|
|
79
81
|
const endDates = updateInputDates('end', dates.endDate);
|
|
80
|
-
hasHadValidDate.current = (0, _isValid.default)(dates.startDate) || (0, _isValid.default)(dates.endDate);
|
|
81
82
|
setDates(currentDates => _objectSpread(_objectSpread(_objectSpread({}, currentDates), startDates), endDates));
|
|
82
83
|
}, [dates.startDate, dates.endDate]);
|
|
83
84
|
return {
|
|
84
85
|
dates,
|
|
85
86
|
updateDates,
|
|
86
|
-
hasHadValidDate: hasHadValidDate.current,
|
|
87
87
|
previousDateProps
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDates.js","names":["_react","require","_DatePickerCalc","_isValid","_interopRequireDefault","_format","_dateFns","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","useDates","dateProps","_ref","dateFormat","isRange","shouldCorrectDate","previousDateProps","setPreviousDateProps","useState","dates","setDates","mapDates","hasDatePropChanges","useMemo","some","date","dateProp","previousDate","convertedDateProp","convertStringToDate","convertedPreviousDate","Date","isSameDay","derivedDates","deriveDatesFromProps","currentDates","hasHadValidDate","useRef","updateDates","useCallback","newDates","callback","_newDates$startDate","_newDates$endDate","correctedDates","correctDates","startDate","endDate","minDate","maxDate","months","updateMonths","useEffect","startDates","updateInputDates","endDates","current","isValid","type","updatedDates","pad","format","undefined","_ref2","_ref3","_convertStringToDate","_convertStringToDate2","getDate","startMonth","endMonth","addMonths","hasValidStartDate","hasValidEndDate","__startDay","__startMonth","__startYear","__endDay","__endMonth","__endYear","_ref4","getStartDate","_ref5","isDisabled","_ref6","_ref7","_newDates$startMonth","_ref8","_newDates$endMonth","size","dateWithPadding","substring"],"sources":["../../../../../src/components/date-picker/hooks/useDates.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { convertStringToDate, isDisabled } from '../DatePickerCalc'\nimport isValid from 'date-fns/isValid'\nimport format from 'date-fns/format'\nimport { addMonths, isSameDay } from 'date-fns'\nimport { DateType } from '../DatePickerContext'\n\nexport type DatePickerDateProps = {\n date?: DateType\n startDate?: DateType\n endDate?: DateType\n startMonth?: DateType\n endMonth?: DateType\n minDate?: DateType\n maxDate?: DateType\n hoverDate?: DateType | null\n}\n\ntype UseDatesOptions = {\n dateFormat: string\n isRange: boolean\n shouldCorrectDate: boolean\n}\n// TODO: Move to DatePickerInput\nexport type DatePickerInputDates = {\n __startDay?: string\n __startMonth?: string\n __startYear?: string\n __endDay?: string\n __endMonth?: string\n __endYear?: string\n}\n\nexport type DatePickerDates = {\n date?: DateType\n startDate?: Date\n endDate?: Date\n minDate?: Date\n maxDate?: Date\n startMonth?: Date\n endMonth?: Date\n hasHadValidDate?: boolean\n hoverDate?: Date\n} & DatePickerInputDates\n\nexport default function useDates(\n dateProps: DatePickerDateProps,\n {\n dateFormat,\n isRange = false,\n shouldCorrectDate = false,\n }: UseDatesOptions\n) {\n const [previousDateProps, setPreviousDateProps] = useState(dateProps)\n const [dates, setDates] = useState<DatePickerDates>({\n ...mapDates(dateProps, {\n dateFormat,\n isRange,\n shouldCorrectDate,\n }),\n })\n\n const hasDatePropChanges = useMemo(\n () =>\n Object.keys(dateProps).some((date) => {\n const dateProp = dateProps[date]\n const previousDate = previousDateProps[date]\n\n const convertedDateProp = convertStringToDate(dateProp, {\n dateFormat,\n })\n const convertedPreviousDate = convertStringToDate(previousDate, {\n dateFormat,\n })\n // Make sure that same dates does not trigger a change\n // i.e. 2021-01-01 and new Date('2021-01-01')\n if (\n convertedDateProp instanceof Date &&\n convertedPreviousDate instanceof Date\n ) {\n return !isSameDay(convertedDateProp, convertedPreviousDate)\n }\n\n return dateProp !== previousDate\n }),\n [dateProps, previousDateProps, dateFormat]\n )\n\n // Update dates on prop change\n if (hasDatePropChanges) {\n const derivedDates = deriveDatesFromProps({\n dates,\n dateProps,\n previousDateProps,\n dateFormat,\n isRange,\n })\n\n setDates((currentDates) => ({ ...currentDates, ...derivedDates }))\n setPreviousDateProps(dateProps)\n }\n\n const hasHadValidDate = useRef<boolean>(false)\n\n const updateDates = useCallback(\n (\n newDates: DatePickerDates,\n callback?: (dates: DatePickerDates) => void\n ) => {\n // Correct dates based on min and max date\n const correctedDates = shouldCorrectDate\n ? correctDates({\n startDate: newDates.startDate ?? dates.startDate,\n endDate: newDates.endDate ?? dates.endDate,\n minDate: dates.minDate,\n maxDate: dates.maxDate,\n isRange,\n })\n : {}\n\n // Update months based on month or start/end date changes\n const months = updateMonths({\n newDates,\n currentDates: dates,\n })\n\n setDates((currentDates) => {\n return {\n ...currentDates,\n ...newDates,\n ...months,\n ...correctedDates,\n }\n })\n\n callback?.({\n ...dates,\n ...newDates,\n ...months,\n ...correctedDates,\n })\n },\n [dates, shouldCorrectDate, isRange]\n )\n\n // Updated input dates based on start and end dates, move to DatePickerInput\n // TODO: Move to DatePickerInput\n useEffect(() => {\n const startDates = updateInputDates('start', dates.startDate)\n const endDates = updateInputDates('end', dates.endDate)\n\n hasHadValidDate.current =\n isValid(dates.startDate) || isValid(dates.endDate)\n\n setDates((currentDates) => ({\n ...currentDates,\n ...startDates,\n ...endDates,\n }))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dates.startDate, dates.endDate])\n\n return {\n dates,\n updateDates,\n hasHadValidDate: hasHadValidDate.current,\n previousDateProps,\n } as const\n}\n\n// TODO: Move to DatePickerInput\nfunction updateInputDates(type: 'start' | 'end', date: Date | undefined) {\n const updatedDates = {}\n\n if (isValid(date)) {\n updatedDates[`__${type}Day`] = pad(format(date, 'dd'), 2)\n updatedDates[`__${type}Month`] = pad(format(date, 'MM'), 2)\n updatedDates[`__${type}Year`] = format(date, 'yyyy')\n } else if (date === undefined) {\n updatedDates[`__${type}Day`] = null\n updatedDates[`__${type}Month`] = null\n updatedDates[`__${type}Year`] = null\n }\n\n return updatedDates\n}\n\nfunction mapDates(\n dateProps: DatePickerDateProps,\n {\n dateFormat,\n isRange,\n shouldCorrectDate,\n }: Omit<UseDatesOptions, 'isLinked'>\n) {\n const date = dateProps.date\n\n const startDate =\n typeof dateProps?.startDate !== 'undefined'\n ? getDate(dateProps.startDate, dateFormat)\n : typeof date !== 'undefined'\n ? getDate(date, dateFormat)\n : undefined\n\n const endDate = !isRange\n ? startDate\n : convertStringToDate(dateProps?.endDate, {\n dateFormat,\n }) || undefined\n\n // Ensure that the calendar view displays the correct start and end months, and to prevent date flickering bug\n const startMonth =\n convertStringToDate(dateProps.startMonth, {\n dateFormat,\n }) ??\n startDate ??\n new Date()\n\n const endMonth =\n convertStringToDate(dateProps.endMonth, {\n dateFormat: dateFormat,\n }) ?? (isRange ? endDate ?? addMonths(startMonth, 1) : startMonth)\n\n const minDate = convertStringToDate(dateProps.minDate, {\n dateFormat,\n })\n\n const maxDate = convertStringToDate(dateProps.maxDate, {\n dateFormat,\n })\n\n const correctedDates = shouldCorrectDate\n ? correctDates({ startDate, endDate, minDate, maxDate, isRange })\n : {}\n\n const dates = {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n ...correctedDates,\n }\n\n const hasValidStartDate = isValid(dates.startDate)\n const hasValidEndDate = isValid(dates.endDate)\n\n return {\n ...dates,\n __startDay: hasValidStartDate\n ? pad(format(dates.startDate, 'dd'), 2)\n : null,\n __startMonth: hasValidStartDate\n ? pad(format(dates.startDate, 'MM'), 2)\n : null,\n __startYear: hasValidStartDate\n ? format(dates.startDate, 'yyyy')\n : null,\n __endDay: hasValidEndDate ? pad(format(dates.endDate, 'dd'), 2) : null,\n __endMonth: hasValidEndDate\n ? pad(format(dates.endDate, 'MM'), 2)\n : null,\n __endYear: hasValidEndDate ? format(dates.endDate, 'yyyy') : null,\n }\n}\n\nfunction deriveDatesFromProps({\n dates,\n dateProps,\n previousDateProps,\n dateFormat,\n isRange,\n}: {\n dates: DatePickerDates\n dateProps: DatePickerDateProps\n previousDateProps: DatePickerDateProps\n dateFormat: UseDatesOptions['dateFormat']\n isRange: UseDatesOptions['isRange']\n}) {\n const derivedDates: DatePickerDates = {}\n\n const startDate = getStartDate(dateProps, previousDateProps)\n\n // Handle updates related to date and startDate changes when not in range mode\n if (typeof startDate !== 'undefined' && startDate !== dates.startDate) {\n derivedDates.startDate =\n convertStringToDate(startDate, {\n dateFormat,\n }) || undefined\n\n // Set endDate and startMonth to startDate if not in range mode\n if (!isRange) {\n derivedDates.startMonth =\n convertStringToDate(startDate, {\n dateFormat,\n }) || undefined\n\n derivedDates.endDate = derivedDates.startDate\n }\n }\n\n // update endDate based on endDate prop if in range mode\n if (\n isRange &&\n typeof dateProps.endDate !== 'undefined' &&\n dateProps.endDate !== dates.endDate\n ) {\n derivedDates.endDate =\n convertStringToDate(dateProps.endDate, {\n dateFormat,\n }) || undefined\n }\n\n // Handle startMonth/endMonth\n if (\n typeof dateProps.startMonth !== 'undefined' &&\n dateProps.startMonth !== previousDateProps.startMonth\n ) {\n derivedDates.startMonth = convertStringToDate(dateProps.startMonth, {\n dateFormat,\n })\n }\n if (\n typeof dateProps.endMonth !== 'undefined' &&\n dateProps.endMonth !== previousDateProps.endMonth\n ) {\n derivedDates.endMonth = convertStringToDate(dateProps.endMonth, {\n dateFormat,\n })\n }\n\n // Handle minDate/maxDate\n if (\n typeof dateProps.minDate !== 'undefined' &&\n dateProps.minDate !== previousDateProps.minDate\n ) {\n derivedDates.minDate = convertStringToDate(dateProps.minDate, {\n dateFormat,\n })\n }\n if (\n typeof dateProps.maxDate !== 'undefined' &&\n dateProps.maxDate !== previousDateProps.maxDate\n ) {\n derivedDates.maxDate = convertStringToDate(dateProps.maxDate, {\n dateFormat,\n })\n }\n\n return derivedDates\n}\n\nfunction correctDates({\n startDate,\n endDate,\n minDate,\n maxDate,\n isRange,\n}: {\n startDate: Date\n endDate: Date\n minDate: Date\n maxDate: Date\n isRange: boolean\n}) {\n const correctedDates = {}\n\n if (isDisabled(startDate, minDate, maxDate)) {\n correctedDates['startDate'] = minDate\n }\n if (isDisabled(endDate, minDate, maxDate)) {\n // state.endDate is only used by the input if range is set to true.\n // this is done to make maxDate correction work if the input is not a range and only maxDate is defined.\n if (!isRange && !minDate) {\n correctedDates['startDate'] = maxDate\n } else {\n correctedDates['endDate'] = maxDate\n }\n }\n\n return correctedDates\n}\n\nfunction updateMonths({\n newDates,\n currentDates,\n}: {\n newDates: DatePickerDates\n currentDates: DatePickerDates\n}) {\n const startMonth =\n newDates.startMonth ?? newDates.startDate ?? currentDates.startMonth\n const endMonth =\n newDates.endMonth ?? newDates.endDate ?? currentDates.endMonth\n\n return {\n startMonth,\n endMonth,\n }\n}\n\nfunction getDate(date: DateType, dateFormat: string) {\n return date instanceof Date\n ? date\n : convertStringToDate(date ?? '', {\n dateFormat,\n })\n}\n\nfunction getStartDate(\n dateProps: DatePickerDateProps,\n previousDateProps: DatePickerDateProps\n) {\n // prioritize startDate over date if provided\n if (\n typeof dateProps.startDate !== 'undefined' &&\n dateProps.startDate !== previousDateProps.startDate\n ) {\n return dateProps.startDate\n }\n\n if (\n typeof dateProps.date !== 'undefined' &&\n dateProps.date !== previousDateProps.date\n ) {\n return dateProps.date\n }\n\n return undefined\n}\n\nexport function pad(date: string, size: number) {\n const dateWithPadding = '000000000' + date\n\n return dateWithPadding.substring(dateWithPadding.length - size)\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA+C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ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EA,IACE,OAAOnC,SAAS,CAACc,IAAI,KAAK,WAAW,IACrCd,SAAS,CAACc,IAAI,KAAKT,iBAAiB,CAACS,IAAI,EACzC;IACA,OAAOd,SAAS,CAACc,IAAI;EACvB;EAEA,OAAOqC,SAAS;AAClB;AAEO,SAASF,GAAGA,CAACnC,IAAY,EAAE+D,IAAY,EAAE;EAC9C,MAAMC,eAAe,GAAG,WAAW,GAAGhE,IAAI;EAE1C,OAAOgE,eAAe,CAACC,SAAS,CAACD,eAAe,CAACjG,MAAM,GAAGgG,IAAI,CAAC;AACjE","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useDates.js","names":["_react","_interopRequireWildcard","require","_DatePickerCalc","_isValid","_interopRequireDefault","_format","_dateFns","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","useLayoutEffect","window","React","useEffect","useDates","dateProps","_ref","dateFormat","isRange","shouldCorrectDate","previousDateProps","setPreviousDateProps","useState","dates","setDates","mapDates","hasDatePropChanges","useMemo","some","date","dateProp","previousDate","convertedDateProp","convertStringToDate","convertedPreviousDate","Date","isSameDay","derivedDates","deriveDatesFromProps","currentDates","updateDates","useCallback","newDates","callback","_newDates$startDate","_newDates$endDate","correctedDates","correctDates","startDate","endDate","minDate","maxDate","months","updateMonths","startDates","updateInputDates","endDates","type","updatedDates","isValid","pad","format","undefined","_ref2","_ref3","_convertStringToDate","_convertStringToDate2","getDate","startMonth","endMonth","addMonths","hasValidStartDate","hasValidEndDate","__startDay","__startMonth","__startYear","__endDay","__endMonth","__endYear","_ref4","getStartDate","_ref5","isDisabled","_ref6","_ref7","_newDates$startMonth","_ref8","_newDates$endMonth","size","dateWithPadding","substring"],"sources":["../../../../../src/components/date-picker/hooks/useDates.ts"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react'\nimport { convertStringToDate, isDisabled } from '../DatePickerCalc'\nimport isValid from 'date-fns/isValid'\nimport format from 'date-fns/format'\nimport { addMonths, isSameDay } from 'date-fns'\nimport { DateType } from '../DatePickerContext'\n\n// SSR warning fix: https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\nconst useLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect\n\nexport type DatePickerDateProps = {\n date?: DateType\n startDate?: DateType\n endDate?: DateType\n startMonth?: DateType\n endMonth?: DateType\n minDate?: DateType\n maxDate?: DateType\n hoverDate?: DateType | null\n}\n\ntype UseDatesOptions = {\n dateFormat: string\n isRange: boolean\n shouldCorrectDate: boolean\n}\n// TODO: Move to DatePickerInput\nexport type DatePickerInputDates = {\n __startDay?: string\n __startMonth?: string\n __startYear?: string\n __endDay?: string\n __endMonth?: string\n __endYear?: string\n}\n\nexport type DatePickerDates = {\n date?: DateType\n startDate?: Date\n endDate?: Date\n minDate?: Date\n maxDate?: Date\n startMonth?: Date\n endMonth?: Date\n hoverDate?: Date\n} & DatePickerInputDates\n\nexport default function useDates(\n dateProps: DatePickerDateProps,\n {\n dateFormat,\n isRange = false,\n shouldCorrectDate = false,\n }: UseDatesOptions\n) {\n const [previousDateProps, setPreviousDateProps] = useState(dateProps)\n const [dates, setDates] = useState<DatePickerDates>({\n ...mapDates(dateProps, {\n dateFormat,\n isRange,\n shouldCorrectDate,\n }),\n })\n\n const hasDatePropChanges = useMemo(\n () =>\n Object.keys(dateProps).some((date) => {\n const dateProp = dateProps[date]\n const previousDate = previousDateProps[date]\n\n const convertedDateProp = convertStringToDate(dateProp, {\n dateFormat,\n })\n const convertedPreviousDate = convertStringToDate(previousDate, {\n dateFormat,\n })\n // Make sure that same dates does not trigger a change\n // i.e. 2021-01-01 and new Date('2021-01-01')\n if (\n convertedDateProp instanceof Date &&\n convertedPreviousDate instanceof Date\n ) {\n return !isSameDay(convertedDateProp, convertedPreviousDate)\n }\n\n return dateProp !== previousDate\n }),\n [dateProps, previousDateProps, dateFormat]\n )\n\n // Update dates on prop change\n if (hasDatePropChanges) {\n const derivedDates = deriveDatesFromProps({\n dates,\n dateProps,\n previousDateProps,\n dateFormat,\n isRange,\n })\n\n setDates((currentDates) => ({ ...currentDates, ...derivedDates }))\n setPreviousDateProps(dateProps)\n }\n\n const updateDates = useCallback(\n (\n newDates: DatePickerDates,\n callback?: (dates: DatePickerDates) => void\n ) => {\n // Correct dates based on min and max date\n const correctedDates = shouldCorrectDate\n ? correctDates({\n startDate: newDates.startDate ?? dates.startDate,\n endDate: newDates.endDate ?? dates.endDate,\n minDate: dates.minDate,\n maxDate: dates.maxDate,\n isRange,\n })\n : {}\n\n // Update months based on month or start/end date changes\n const months = updateMonths({\n newDates,\n currentDates: dates,\n })\n\n setDates((currentDates) => {\n return {\n ...currentDates,\n ...newDates,\n ...months,\n ...correctedDates,\n }\n })\n\n callback?.({\n ...dates,\n ...newDates,\n ...months,\n ...correctedDates,\n })\n },\n [dates, shouldCorrectDate, isRange]\n )\n\n // Updated input dates based on start and end dates, move to DatePickerInput\n // TODO: Move to DatePickerInput\n useLayoutEffect(() => {\n const startDates = updateInputDates('start', dates.startDate)\n const endDates = updateInputDates('end', dates.endDate)\n\n setDates((currentDates) => ({\n ...currentDates,\n ...startDates,\n ...endDates,\n }))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dates.startDate, dates.endDate])\n\n return {\n dates,\n updateDates,\n previousDateProps,\n } as const\n}\n\n// TODO: Move to DatePickerInput\nfunction updateInputDates(type: 'start' | 'end', date: Date | undefined) {\n const updatedDates = {}\n\n if (isValid(date)) {\n updatedDates[`__${type}Day`] = pad(format(date, 'dd'), 2)\n updatedDates[`__${type}Month`] = pad(format(date, 'MM'), 2)\n updatedDates[`__${type}Year`] = format(date, 'yyyy')\n } else if (date === undefined) {\n updatedDates[`__${type}Day`] = null\n updatedDates[`__${type}Month`] = null\n updatedDates[`__${type}Year`] = null\n }\n\n return updatedDates\n}\n\nfunction mapDates(\n dateProps: DatePickerDateProps,\n {\n dateFormat,\n isRange,\n shouldCorrectDate,\n }: Omit<UseDatesOptions, 'isLinked'>\n) {\n const date = dateProps.date\n\n const startDate =\n typeof dateProps?.startDate !== 'undefined'\n ? getDate(dateProps.startDate, dateFormat)\n : typeof date !== 'undefined'\n ? getDate(date, dateFormat)\n : undefined\n\n const endDate = !isRange\n ? startDate\n : convertStringToDate(dateProps?.endDate, {\n dateFormat,\n }) || undefined\n\n // Ensure that the calendar view displays the correct start and end months, and to prevent date flickering bug\n const startMonth =\n convertStringToDate(dateProps.startMonth, {\n dateFormat,\n }) ??\n startDate ??\n new Date()\n\n const endMonth =\n convertStringToDate(dateProps.endMonth, {\n dateFormat: dateFormat,\n }) ?? (isRange ? endDate ?? addMonths(startMonth, 1) : startMonth)\n\n const minDate = convertStringToDate(dateProps.minDate, {\n dateFormat,\n })\n\n const maxDate = convertStringToDate(dateProps.maxDate, {\n dateFormat,\n })\n\n const correctedDates = shouldCorrectDate\n ? correctDates({ startDate, endDate, minDate, maxDate, isRange })\n : {}\n\n const dates = {\n date,\n startDate,\n endDate,\n startMonth,\n endMonth,\n minDate,\n maxDate,\n ...correctedDates,\n }\n\n const hasValidStartDate = isValid(dates.startDate)\n const hasValidEndDate = isValid(dates.endDate)\n\n return {\n ...dates,\n __startDay: hasValidStartDate\n ? pad(format(dates.startDate, 'dd'), 2)\n : null,\n __startMonth: hasValidStartDate\n ? pad(format(dates.startDate, 'MM'), 2)\n : null,\n __startYear: hasValidStartDate\n ? format(dates.startDate, 'yyyy')\n : null,\n __endDay: hasValidEndDate ? pad(format(dates.endDate, 'dd'), 2) : null,\n __endMonth: hasValidEndDate\n ? pad(format(dates.endDate, 'MM'), 2)\n : null,\n __endYear: hasValidEndDate ? format(dates.endDate, 'yyyy') : null,\n }\n}\n\nfunction deriveDatesFromProps({\n dates,\n dateProps,\n previousDateProps,\n dateFormat,\n isRange,\n}: {\n dates: DatePickerDates\n dateProps: DatePickerDateProps\n previousDateProps: DatePickerDateProps\n dateFormat: UseDatesOptions['dateFormat']\n isRange: UseDatesOptions['isRange']\n}) {\n const derivedDates: DatePickerDates = {}\n\n const startDate = getStartDate(dateProps, previousDateProps)\n\n // Handle updates related to date and startDate changes when not in range mode\n if (typeof startDate !== 'undefined' && startDate !== dates.startDate) {\n derivedDates.startDate =\n convertStringToDate(startDate, {\n dateFormat,\n }) || undefined\n\n // Set endDate and startMonth to startDate if not in range mode\n if (!isRange) {\n derivedDates.startMonth =\n convertStringToDate(startDate, {\n dateFormat,\n }) || undefined\n\n derivedDates.endDate = derivedDates.startDate\n }\n }\n\n // update endDate based on endDate prop if in range mode\n if (\n isRange &&\n typeof dateProps.endDate !== 'undefined' &&\n dateProps.endDate !== dates.endDate\n ) {\n derivedDates.endDate =\n convertStringToDate(dateProps.endDate, {\n dateFormat,\n }) || undefined\n }\n\n // Handle startMonth/endMonth\n if (\n typeof dateProps.startMonth !== 'undefined' &&\n dateProps.startMonth !== previousDateProps.startMonth\n ) {\n derivedDates.startMonth = convertStringToDate(dateProps.startMonth, {\n dateFormat,\n })\n }\n if (\n typeof dateProps.endMonth !== 'undefined' &&\n dateProps.endMonth !== previousDateProps.endMonth\n ) {\n derivedDates.endMonth = convertStringToDate(dateProps.endMonth, {\n dateFormat,\n })\n }\n\n // Handle minDate/maxDate\n if (\n typeof dateProps.minDate !== 'undefined' &&\n dateProps.minDate !== previousDateProps.minDate\n ) {\n derivedDates.minDate = convertStringToDate(dateProps.minDate, {\n dateFormat,\n })\n }\n if (\n typeof dateProps.maxDate !== 'undefined' &&\n dateProps.maxDate !== previousDateProps.maxDate\n ) {\n derivedDates.maxDate = convertStringToDate(dateProps.maxDate, {\n dateFormat,\n })\n }\n\n return derivedDates\n}\n\nfunction correctDates({\n startDate,\n endDate,\n minDate,\n maxDate,\n isRange,\n}: {\n startDate: Date\n endDate: Date\n minDate: Date\n maxDate: Date\n isRange: boolean\n}) {\n const correctedDates = {}\n\n if (isDisabled(startDate, minDate, maxDate)) {\n correctedDates['startDate'] = minDate\n }\n if (isDisabled(endDate, minDate, maxDate)) {\n // state.endDate is only used by the input if range is set to true.\n // this is done to make maxDate correction work if the input is not a range and only maxDate is defined.\n if (!isRange && !minDate) {\n correctedDates['startDate'] = maxDate\n } else {\n correctedDates['endDate'] = maxDate\n }\n }\n\n return correctedDates\n}\n\nfunction updateMonths({\n newDates,\n currentDates,\n}: {\n newDates: DatePickerDates\n currentDates: DatePickerDates\n}) {\n const startMonth =\n newDates.startMonth ?? newDates.startDate ?? currentDates.startMonth\n const endMonth =\n newDates.endMonth ?? newDates.endDate ?? currentDates.endMonth\n\n return {\n startMonth,\n endMonth,\n }\n}\n\nfunction getDate(date: DateType, dateFormat: string) {\n return date instanceof Date\n ? date\n : convertStringToDate(date ?? '', {\n dateFormat,\n })\n}\n\nfunction getStartDate(\n dateProps: DatePickerDateProps,\n previousDateProps: DatePickerDateProps\n) {\n // prioritize startDate over date if provided\n if (\n typeof dateProps.startDate !== 'undefined' &&\n dateProps.startDate !== previousDateProps.startDate\n ) {\n return dateProps.startDate\n }\n\n if (\n typeof dateProps.date !== 'undefined' &&\n dateProps.date !== previousDateProps.date\n ) {\n return dateProps.date\n }\n\n return undefined\n}\n\nexport function pad(date: string, size: number) {\n const dateWithPadding = '000000000' + date\n\n return dateWithPadding.substring(dateWithPadding.length - size)\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA+C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,G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A,IAAI,cAAJA,IAAI,GAAI,EAAE,EAAE;IAC9BZ;EACF,CAAC,CAAC;AACR;AAEA,SAAS+D,YAAYA,CACnBjE,SAA8B,EAC9BK,iBAAsC,EACtC;EAEA,IACE,OAAOL,SAAS,CAACiC,SAAS,KAAK,WAAW,IAC1CjC,SAAS,CAACiC,SAAS,KAAK5B,iBAAiB,CAAC4B,SAAS,EACnD;IACA,OAAOjC,SAAS,CAACiC,SAAS;EAC5B;EAEA,IACE,OAAOjC,SAAS,CAACc,IAAI,KAAK,WAAW,IACrCd,SAAS,CAACc,IAAI,KAAKT,iBAAiB,CAACS,IAAI,EACzC;IACA,OAAOd,SAAS,CAACc,IAAI;EACvB;EAEA,OAAOiC,SAAS;AAClB;AAEO,SAASF,GAAGA,CAAC/B,IAAY,EAAE2D,IAAY,EAAE;EAC9C,MAAMC,eAAe,GAAG,WAAW,GAAG5D,IAAI;EAE1C,OAAO4D,eAAe,CAACC,SAAS,CAACD,eAAe,CAAC9F,MAAM,GAAG6F,IAAI,CAAC;AACjE","ignoreList":[]}
|
|
@@ -146,6 +146,10 @@ html[data-whatinput=keyboard] .dnb-date-picker__container table.dnb-no-focus:foc
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
@supports (-webkit-touch-callout: none) {
|
|
149
|
+
.dnb-date-picker__input,
|
|
150
|
+
.dnb-date-picker .dnb-input__input.dnb-date-picker__input, .dnb-core-style .dnb-date-picker__input {
|
|
151
|
+
text-indent: -2px;
|
|
152
|
+
}
|
|
149
153
|
.dnb-date-picker__input:not(*:root),
|
|
150
154
|
.dnb-date-picker .dnb-input__input.dnb-date-picker__input:not(*:root), .dnb-core-style .dnb-date-picker__input:not(*:root) {
|
|
151
155
|
margin: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dnb-date-picker{--date-picker-input-height:2rem;--date-picker-day-width:2rem;--date-picker-day-horizontal-spacing:4px;align-items:center;display:inline-flex;font-size:var(--font-size-small);line-height:var(--line-height-basis)}.dnb-date-picker__inner{display:inline-flex;flex-direction:column;line-height:var(--date-picker-input-height)}.dnb-date-picker__row{display:inline-flex}.dnb-date-picker__shell{display:inline-flex;flex-direction:column;position:relative;top:0}.dnb-date-picker__input__wrapper{display:inline-flex;height:inherit;white-space:nowrap}.dnb-date-picker__triangle{margin:0 1.5rem;overflow:hidden;pointer-events:none;right:auto;top:calc(2px - var(--date-picker-input-height)/2)}.dnb-date-picker__triangle,.dnb-date-picker__triangle:before{height:calc(var(--date-picker-input-height)/2);left:0;position:absolute;width:calc(var(--date-picker-input-height)/2)}.dnb-date-picker__triangle:before{background-color:var(--color-white);border:1px solid var(--color-black-border);content:"";top:0;transform:translateY(60%) rotate(45deg)}.dnb-date-picker__container{display:block;left:-1rem;position:absolute;top:var(--date-picker-input-height);z-index:3}.dnb-date-picker__container--small{top:1.5rem}.dnb-date-picker__container--medium{top:2.5rem}.dnb-date-picker__container--large{top:3rem}.dnb-date-picker__container--show-input{left:0}.dnb-date-picker__container--right{left:auto;right:-1rem}.dnb-date-picker__container--show-input.dnb-date-picker__container--right{left:auto;right:0}.dnb-date-picker__container--opened{z-index:100}.dnb-date-picker__container--opened:not(.dnb-date-picker__container--opened--no-animation){animation:date-picker-slide-down .2s ease-out 1 forwards}.dnb-date-picker__container--opened--no-animation,html[data-visual-test] .dnb-date-picker__container--opened{animation:date-picker-slide-down 1ms ease-out 1 forwards}.dnb-date-picker__container--hidden{display:none}.dnb-date-picker__container--closed:not(.dnb-date-picker__container--closed--no-animation){animation:date-picker-slide-up .15s ease-out 1 forwards}.dnb-date-picker__container--closed--no-animation,html[data-visual-test] .dnb-date-picker__container--closed{animation:date-picker-slide-up 1ms ease-out 1 forwards}.dnb-date-picker__container--right .dnb-date-picker__triangle{left:auto;right:0}.dnb-date-picker__container table{margin:0;position:relative;z-index:1}.dnb-date-picker__container table.dnb-no-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-date-picker__container table.dnb-no-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{background:transparent;border:none;display:inline-block;font-family:var(--font-family-monospace);margin:0;outline:none;overflow:visible;padding:0 .125rem;text-align:center;transform:translateY(0);white-space:nowrap;width:auto}@supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) and (not (-moz-appearance:none)){.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{margin:0 -4px}}@supports (-ms-ime-align:auto){.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{margin:0 -5px}}@supports (-webkit-touch-callout:none){.dnb-core-style .dnb-date-picker__input:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:not(:root),.dnb-date-picker__input:not(:root){margin:0}}@supports (-webkit-appearance:none) and (stroke-color:transparent) and (not (-webkit-touch-callout:none)){.dnb-core-style .dnb-date-picker__input:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:not(:root),.dnb-date-picker__input:not(:root){margin:0 -4px}.dnb-core-style .dnb-date-picker__input:first-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:first-of-type:not(:root),.dnb-date-picker__input:first-of-type:not(:root){margin-left:.8rem}.dnb-core-style .dnb-date-picker__input:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:last-of-type:not(:root),.dnb-date-picker__input:last-of-type:not(:root){margin-right:2.2rem}}.dnb-core-style .dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-core-style .dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small.dnb-date-picker__input--small,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small.dnb-date-picker__input--small,.dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-date-picker__input--small.dnb-date-picker__input--small{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--small:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small:last-of-type:not(:root),.dnb-date-picker__input--small:last-of-type:not(:root){margin-right:2.2rem}.dnb-core-style .dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-core-style .dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium.dnb-date-picker__input--medium,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium.dnb-date-picker__input--medium,.dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-date-picker__input--medium.dnb-date-picker__input--medium{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--medium:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium:last-of-type:not(:root),.dnb-date-picker__input--medium:last-of-type:not(:root){margin-right:3.2rem}.dnb-core-style .dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-core-style .dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large.dnb-date-picker__input--large,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large.dnb-date-picker__input--large,.dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-date-picker__input--large.dnb-date-picker__input--large{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--large:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large:last-of-type:not(:root),.dnb-date-picker__input--large:last-of-type:not(:root){margin-right:4rem}.dnb-date-picker .dnb-input__input.dnb-date-picker__input:first-of-type,.dnb-date-picker__input:first-of-type{margin-left:.8rem}.dnb-date-picker .dnb-input__input.dnb-date-picker__input:last-of-type,.dnb-date-picker__input:last-of-type{margin-right:2.2rem}.dnb-date-picker .dnb-input__shell{display:none}.dnb-date-picker--show-input .dnb-input__shell{display:flex}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__status--error .dnb-input__shell{box-shadow:none}.dnb-input__submit-button button:focus~.dnb-date-picker__input__wrapper{display:block}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__submit-element,.dnb-input__submit-element>.dnb-date-picker .dnb-input__submit-element{margin-left:0}.dnb-date-picker__views{display:flex;user-select:none;-webkit-user-select:none}@media screen and (max-width:60em){.dnb-date-picker__views{flex-direction:column}}.dnb-date-picker__calendar{padding:1rem;position:relative}.dnb-date-picker__calendar:after{bottom:0;content:"";height:1px;position:absolute;width:calc(100% - 2rem)}.dnb-date-picker:not(.dnb-date-picker--show-footer) .dnb-date-picker__calendar:after{content:none}.dnb-date-picker__header{height:2.5rem;line-height:var(--line-height-basis)}.dnb-date-picker__addon,.dnb-date-picker__header{display:flex;justify-content:space-between;padding-bottom:1rem;position:relative}.dnb-date-picker__addon:after,.dnb-date-picker__header:after{bottom:0;content:"";height:1px;position:absolute;width:100%}.dnb-date-picker__addon{display:flex;flex-flow:row wrap;gap:1rem;justify-content:flex-start;padding:1rem}.dnb-date-picker__addon:after{left:1rem;width:calc(100% - 2rem)}.dnb-date-picker__footer{display:flex;justify-content:space-between;padding:1rem;position:relative}.dnb-date-picker__labels__day{padding-bottom:.5rem;padding-top:1.5rem}.dnb-date-picker__days,.dnb-date-picker__labels{display:flex;flex-wrap:wrap;list-style:none;margin:0;max-width:18rem;min-width:18rem;padding:0}.dnb-date-picker__day,.dnb-date-picker__labels__day{display:flex;flex-basis:14.2857142857%;justify-content:center}.dnb-date-picker__day{margin:var(--date-picker-day-horizontal-spacing) 0;position:relative}.dnb-date-picker__day,.dnb-date-picker__day .dnb-button{height:var(--date-picker-day-width);width:var(--date-picker-day-width)}.dnb-date-picker__day .dnb-button{box-shadow:none;position:absolute;top:0;white-space:nowrap}.dnb-date-picker__day .dnb-button__bounding{border-radius:0;transform:scale(1.28)}.dnb-date-picker__day .dnb-button__text{transform:translateY(0)}.dnb-date-picker__day--selectable:hover{z-index:2}.dnb-date-picker__day--end-date .dnb-button,.dnb-date-picker__day--start-date .dnb-button{z-index:1}.dnb-date-picker__day--end-date,.dnb-date-picker__day--start-date{position:relative}.dnb-date-picker__day--end-date:after,.dnb-date-picker__day--start-date:after{content:"";height:100%;position:absolute;top:0;width:calc(var(--date-picker-day-width)/2)}.dnb-date-picker__day--start-date:after{left:auto;right:0}.dnb-date-picker__day--end-date:after{left:0;right:auto}.dnb-date-picker__day--start-date.dnb-date-picker__day--end-date:after{content:none}.dnb-date-picker .rtl{direction:rtl}.dnb-date-picker .rtl .dnb-date-picker__next:before,.dnb-date-picker .rtl .dnb-date-picker__prev:before{transform:scaleX(-1)}.dnb-date-picker__inner>.dnb-form-status{margin-top:.5rem;order:2}.dnb-date-picker--vertical{align-items:flex-start;display:flex;flex-direction:column}.dnb-date-picker>.dnb-form-label{line-height:var(--line-height-basis)}@media screen and (max-width:40em){.dnb-date-picker{flex-wrap:wrap}.dnb-date-picker>.dnb-form-label{margin-bottom:.5rem;margin-top:.5rem}}.dnb-date-picker--stretch{display:flex;flex-grow:1}.dnb-date-picker--stretch .dnb-date-picker__inner,.dnb-date-picker--stretch .dnb-date-picker__shell,.dnb-form-row--horizontal .dnb-date-picker--stretch{width:100%}.dnb-date-picker:not(.dnb-date-picker--vertical)[class*=__status]{align-items:flex-start}.dnb-date-picker:not(.dnb-date-picker--vertical)[class*=__status]>.dnb-form-label{margin-top:.25rem}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__submit-button .dnb-button{border-radius:50%}@media screen and (max-width:40em){.dnb-responsive-component .dnb-date-picker{align-items:flex-start;display:flex;flex-direction:column;margin-bottom:.5rem}.dnb-responsive-component .dnb-date-picker>.dnb-form-label{margin-bottom:.5rem}.dnb-responsive-component .dnb-date-picker__helper{display:none}}.dnb-date-picker .dnb-input__submit-button .dnb-button.dnb-skeleton{visibility:hidden}.dnb-core-style .dnb-date-picker__fieldset,.dnb-date-picker__fieldset{border:none;padding:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__top]),.dnb-date-picker__fieldset:not([class*=space__top]){margin-top:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__bottom]),.dnb-date-picker__fieldset:not([class*=space__bottom]){margin-bottom:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__left]),.dnb-date-picker__fieldset:not([class*=space__left]){margin-left:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__right]),.dnb-date-picker__fieldset:not([class*=space__right]){margin-right:0}.dnb-date-picker__portal{--date-picker-input-height:2rem;--date-picker-day-width:2rem;--date-picker-day-horizontal-spacing:4px;left:0;line-height:var(--date-picker-input-height);position:absolute;z-index:calc(var(--modal-z-index) + 10)}@keyframes date-picker-slide-down{0%{opacity:0}to{opacity:1}}@keyframes date-picker-slide-up{0%{opacity:1}to{opacity:0}}
|
|
1
|
+
.dnb-date-picker{--date-picker-input-height:2rem;--date-picker-day-width:2rem;--date-picker-day-horizontal-spacing:4px;align-items:center;display:inline-flex;font-size:var(--font-size-small);line-height:var(--line-height-basis)}.dnb-date-picker__inner{display:inline-flex;flex-direction:column;line-height:var(--date-picker-input-height)}.dnb-date-picker__row{display:inline-flex}.dnb-date-picker__shell{display:inline-flex;flex-direction:column;position:relative;top:0}.dnb-date-picker__input__wrapper{display:inline-flex;height:inherit;white-space:nowrap}.dnb-date-picker__triangle{margin:0 1.5rem;overflow:hidden;pointer-events:none;right:auto;top:calc(2px - var(--date-picker-input-height)/2)}.dnb-date-picker__triangle,.dnb-date-picker__triangle:before{height:calc(var(--date-picker-input-height)/2);left:0;position:absolute;width:calc(var(--date-picker-input-height)/2)}.dnb-date-picker__triangle:before{background-color:var(--color-white);border:1px solid var(--color-black-border);content:"";top:0;transform:translateY(60%) rotate(45deg)}.dnb-date-picker__container{display:block;left:-1rem;position:absolute;top:var(--date-picker-input-height);z-index:3}.dnb-date-picker__container--small{top:1.5rem}.dnb-date-picker__container--medium{top:2.5rem}.dnb-date-picker__container--large{top:3rem}.dnb-date-picker__container--show-input{left:0}.dnb-date-picker__container--right{left:auto;right:-1rem}.dnb-date-picker__container--show-input.dnb-date-picker__container--right{left:auto;right:0}.dnb-date-picker__container--opened{z-index:100}.dnb-date-picker__container--opened:not(.dnb-date-picker__container--opened--no-animation){animation:date-picker-slide-down .2s ease-out 1 forwards}.dnb-date-picker__container--opened--no-animation,html[data-visual-test] .dnb-date-picker__container--opened{animation:date-picker-slide-down 1ms ease-out 1 forwards}.dnb-date-picker__container--hidden{display:none}.dnb-date-picker__container--closed:not(.dnb-date-picker__container--closed--no-animation){animation:date-picker-slide-up .15s ease-out 1 forwards}.dnb-date-picker__container--closed--no-animation,html[data-visual-test] .dnb-date-picker__container--closed{animation:date-picker-slide-up 1ms ease-out 1 forwards}.dnb-date-picker__container--right .dnb-date-picker__triangle{left:auto;right:0}.dnb-date-picker__container table{margin:0;position:relative;z-index:1}.dnb-date-picker__container table.dnb-no-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-date-picker__container table.dnb-no-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{background:transparent;border:none;display:inline-block;font-family:var(--font-family-monospace);margin:0;outline:none;overflow:visible;padding:0 .125rem;text-align:center;transform:translateY(0);white-space:nowrap;width:auto}@supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) and (not (-moz-appearance:none)){.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{margin:0 -4px}}@supports (-ms-ime-align:auto){.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{margin:0 -5px}}@supports (-webkit-touch-callout:none){.dnb-core-style .dnb-date-picker__input,.dnb-date-picker .dnb-input__input.dnb-date-picker__input,.dnb-date-picker__input{text-indent:-2px}.dnb-core-style .dnb-date-picker__input:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:not(:root),.dnb-date-picker__input:not(:root){margin:0}}@supports (-webkit-appearance:none) and (stroke-color:transparent) and (not (-webkit-touch-callout:none)){.dnb-core-style .dnb-date-picker__input:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:not(:root),.dnb-date-picker__input:not(:root){margin:0 -4px}.dnb-core-style .dnb-date-picker__input:first-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:first-of-type:not(:root),.dnb-date-picker__input:first-of-type:not(:root){margin-left:.8rem}.dnb-core-style .dnb-date-picker__input:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input:last-of-type:not(:root),.dnb-date-picker__input:last-of-type:not(:root){margin-right:2.2rem}}.dnb-core-style .dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-core-style .dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small--has-submit-element .dnb-date-picker__input--small__input,.dnb-core-style .dnb-date-picker__input--small.dnb-date-picker__input--small,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small.dnb-date-picker__input--small,.dnb-date-picker__input--small .dnb-date-picker .dnb-input__input.dnb-date-picker__input--small,.dnb-date-picker__input--small.dnb-date-picker__input--small{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--small:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--small:last-of-type:not(:root),.dnb-date-picker__input--small:last-of-type:not(:root){margin-right:2.2rem}.dnb-core-style .dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-core-style .dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium--has-submit-element .dnb-date-picker__input--medium__input,.dnb-core-style .dnb-date-picker__input--medium.dnb-date-picker__input--medium,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium.dnb-date-picker__input--medium,.dnb-date-picker__input--medium .dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium,.dnb-date-picker__input--medium.dnb-date-picker__input--medium{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--medium:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--medium:last-of-type:not(:root),.dnb-date-picker__input--medium:last-of-type:not(:root){margin-right:3.2rem}.dnb-core-style .dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-core-style .dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large--has-submit-element .dnb-date-picker__input--large__input,.dnb-core-style .dnb-date-picker__input--large.dnb-date-picker__input--large,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large.dnb-date-picker__input--large,.dnb-date-picker__input--large .dnb-date-picker .dnb-input__input.dnb-date-picker__input--large,.dnb-date-picker__input--large.dnb-date-picker__input--large{padding-right:.125rem}.dnb-core-style .dnb-date-picker__input--large:last-of-type:not(:root),.dnb-date-picker .dnb-input__input.dnb-date-picker__input--large:last-of-type:not(:root),.dnb-date-picker__input--large:last-of-type:not(:root){margin-right:4rem}.dnb-date-picker .dnb-input__input.dnb-date-picker__input:first-of-type,.dnb-date-picker__input:first-of-type{margin-left:.8rem}.dnb-date-picker .dnb-input__input.dnb-date-picker__input:last-of-type,.dnb-date-picker__input:last-of-type{margin-right:2.2rem}.dnb-date-picker .dnb-input__shell{display:none}.dnb-date-picker--show-input .dnb-input__shell{display:flex}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__status--error .dnb-input__shell{box-shadow:none}.dnb-input__submit-button button:focus~.dnb-date-picker__input__wrapper{display:block}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__submit-element,.dnb-input__submit-element>.dnb-date-picker .dnb-input__submit-element{margin-left:0}.dnb-date-picker__views{display:flex;user-select:none;-webkit-user-select:none}@media screen and (max-width:60em){.dnb-date-picker__views{flex-direction:column}}.dnb-date-picker__calendar{padding:1rem;position:relative}.dnb-date-picker__calendar:after{bottom:0;content:"";height:1px;position:absolute;width:calc(100% - 2rem)}.dnb-date-picker:not(.dnb-date-picker--show-footer) .dnb-date-picker__calendar:after{content:none}.dnb-date-picker__header{height:2.5rem;line-height:var(--line-height-basis)}.dnb-date-picker__addon,.dnb-date-picker__header{display:flex;justify-content:space-between;padding-bottom:1rem;position:relative}.dnb-date-picker__addon:after,.dnb-date-picker__header:after{bottom:0;content:"";height:1px;position:absolute;width:100%}.dnb-date-picker__addon{display:flex;flex-flow:row wrap;gap:1rem;justify-content:flex-start;padding:1rem}.dnb-date-picker__addon:after{left:1rem;width:calc(100% - 2rem)}.dnb-date-picker__footer{display:flex;justify-content:space-between;padding:1rem;position:relative}.dnb-date-picker__labels__day{padding-bottom:.5rem;padding-top:1.5rem}.dnb-date-picker__days,.dnb-date-picker__labels{display:flex;flex-wrap:wrap;list-style:none;margin:0;max-width:18rem;min-width:18rem;padding:0}.dnb-date-picker__day,.dnb-date-picker__labels__day{display:flex;flex-basis:14.2857142857%;justify-content:center}.dnb-date-picker__day{margin:var(--date-picker-day-horizontal-spacing) 0;position:relative}.dnb-date-picker__day,.dnb-date-picker__day .dnb-button{height:var(--date-picker-day-width);width:var(--date-picker-day-width)}.dnb-date-picker__day .dnb-button{box-shadow:none;position:absolute;top:0;white-space:nowrap}.dnb-date-picker__day .dnb-button__bounding{border-radius:0;transform:scale(1.28)}.dnb-date-picker__day .dnb-button__text{transform:translateY(0)}.dnb-date-picker__day--selectable:hover{z-index:2}.dnb-date-picker__day--end-date .dnb-button,.dnb-date-picker__day--start-date .dnb-button{z-index:1}.dnb-date-picker__day--end-date,.dnb-date-picker__day--start-date{position:relative}.dnb-date-picker__day--end-date:after,.dnb-date-picker__day--start-date:after{content:"";height:100%;position:absolute;top:0;width:calc(var(--date-picker-day-width)/2)}.dnb-date-picker__day--start-date:after{left:auto;right:0}.dnb-date-picker__day--end-date:after{left:0;right:auto}.dnb-date-picker__day--start-date.dnb-date-picker__day--end-date:after{content:none}.dnb-date-picker .rtl{direction:rtl}.dnb-date-picker .rtl .dnb-date-picker__next:before,.dnb-date-picker .rtl .dnb-date-picker__prev:before{transform:scaleX(-1)}.dnb-date-picker__inner>.dnb-form-status{margin-top:.5rem;order:2}.dnb-date-picker--vertical{align-items:flex-start;display:flex;flex-direction:column}.dnb-date-picker>.dnb-form-label{line-height:var(--line-height-basis)}@media screen and (max-width:40em){.dnb-date-picker{flex-wrap:wrap}.dnb-date-picker>.dnb-form-label{margin-bottom:.5rem;margin-top:.5rem}}.dnb-date-picker--stretch{display:flex;flex-grow:1}.dnb-date-picker--stretch .dnb-date-picker__inner,.dnb-date-picker--stretch .dnb-date-picker__shell,.dnb-form-row--horizontal .dnb-date-picker--stretch{width:100%}.dnb-date-picker:not(.dnb-date-picker--vertical)[class*=__status]{align-items:flex-start}.dnb-date-picker:not(.dnb-date-picker--vertical)[class*=__status]>.dnb-form-label{margin-top:.25rem}.dnb-date-picker:not(.dnb-date-picker--show-input) .dnb-input__submit-button .dnb-button{border-radius:50%}@media screen and (max-width:40em){.dnb-responsive-component .dnb-date-picker{align-items:flex-start;display:flex;flex-direction:column;margin-bottom:.5rem}.dnb-responsive-component .dnb-date-picker>.dnb-form-label{margin-bottom:.5rem}.dnb-responsive-component .dnb-date-picker__helper{display:none}}.dnb-date-picker .dnb-input__submit-button .dnb-button.dnb-skeleton{visibility:hidden}.dnb-core-style .dnb-date-picker__fieldset,.dnb-date-picker__fieldset{border:none;padding:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__top]),.dnb-date-picker__fieldset:not([class*=space__top]){margin-top:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__bottom]),.dnb-date-picker__fieldset:not([class*=space__bottom]){margin-bottom:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__left]),.dnb-date-picker__fieldset:not([class*=space__left]){margin-left:0}.dnb-core-style .dnb-date-picker__fieldset:not([class*=space__right]),.dnb-date-picker__fieldset:not([class*=space__right]){margin-right:0}.dnb-date-picker__portal{--date-picker-input-height:2rem;--date-picker-day-width:2rem;--date-picker-day-horizontal-spacing:4px;left:0;line-height:var(--date-picker-input-height);position:absolute;z-index:calc(var(--modal-z-index) + 10)}@keyframes date-picker-slide-down{0%{opacity:0}to{opacity:1}}@keyframes date-picker-slide-up{0%{opacity:1}to{opacity:0}}
|
|
@@ -107,12 +107,17 @@ const DialogProperties = exports.DialogProperties = {
|
|
|
107
107
|
},
|
|
108
108
|
scrollRef: {
|
|
109
109
|
doc: 'To get the scroll Element, pass in your own React ref.',
|
|
110
|
-
type: 'React.
|
|
110
|
+
type: 'React.RefObject',
|
|
111
111
|
status: 'optional'
|
|
112
112
|
},
|
|
113
113
|
contentRef: {
|
|
114
114
|
doc: 'To get the inner content Element, pass in your own React ref.',
|
|
115
|
-
type: 'React.
|
|
115
|
+
type: 'React.RefObject',
|
|
116
|
+
status: 'optional'
|
|
117
|
+
},
|
|
118
|
+
'[Space](/uilib/layout/space/properties)': {
|
|
119
|
+
doc: 'Spacing properties like `top` or `bottom` are supported.',
|
|
120
|
+
type: ['string', 'object'],
|
|
116
121
|
status: 'optional'
|
|
117
122
|
}
|
|
118
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogDocs.js","names":["DialogProperties","exports","variant","doc","type","status","title","minWidth","maxWidth","className","spacing","preventCoreStyle","navContent","headerContent","modalContent","description","verticalAlignment","alignContent","fullscreen","icon","confirmType","declineText","confirmText","hideDecline","hideConfirm","scrollRef","contentRef","DialogEvents","onConfirm","onDecline"],"sources":["../../../../src/components/dialog/DialogDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const DialogProperties: PropertiesTableProps = {\n variant: {\n doc: 'The dialog variant. Can either be `information` or `confirmation`. Defaults to `information`.',\n type: 'string',\n status: 'optional',\n },\n title: {\n doc: 'The dialog title. Displays on the very top of the content.',\n type: 'string',\n status: 'optional',\n },\n minWidth: {\n doc: \"The minimum Dialog content width, defined by a CSS width value like `50vw` (50% of the viewport). Be careful on using fixed `minWidth` so you don't break responsiveness. Defaults to `30rem` (average width is set to `60vw`).\",\n type: 'string',\n status: 'optional',\n },\n maxWidth: {\n doc: 'The maximum Dialog content width, defined by a CSS width value like `20rem`. Defaults to `60rem` (average width is set to `60vw`).',\n type: 'string',\n status: 'optional',\n },\n className: {\n doc: 'Give the Dialog content a class name (maps to `dnb-dialog`).',\n type: 'string',\n status: 'optional',\n },\n spacing: {\n doc: 'If set to `false` then the dialog content will be shown without any spacing. Defaults to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n preventCoreStyle: {\n doc: 'By default the dialog content gets added the core style class `dnb-core-style`. Use `false` to disable this behavior.',\n type: 'boolean',\n status: 'optional',\n },\n navContent: {\n doc: 'The content which will appear in the navigation, above the header, and side-by-side the close button.',\n type: 'React.Node',\n status: 'optional',\n },\n headerContent: {\n doc: 'The content which will appear in the header of the dialog.',\n type: 'React.Node',\n status: 'optional',\n },\n modalContent: {\n doc: 'The content which will appear when triggering the dialog.',\n type: 'React.Node',\n status: 'optional',\n },\n description: {\n doc: 'A description will be positioned below the title, but before the content. Used for Dialog variant `confirmation` to further describe what the actions will do.',\n type: 'string',\n status: 'optional',\n },\n verticalAlignment: {\n doc: 'Define the vertical alignment of the container. Can be set to `top` or `center`. Defaults to `center`.',\n type: 'string',\n status: 'optional',\n },\n alignContent: {\n doc: 'Define the inner horizontal alignment of the content. Can be set to `left`, `center`, `right` and `centered`. If `centered`, then the content will also be centered vertically. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n fullscreen: {\n doc: 'If set to `true` then the dialog content will be shown as fullscreen, without showing the original content behind. Can be set to `false` to omit the auto fullscreen. Defaults to `auto`.',\n type: 'boolean',\n status: 'optional',\n },\n icon: {\n doc: 'An icon to display at the top of the component. Should be of size medium, so make sure you import the `_medium` version of the Eufemia icon.',\n type: 'React.Node',\n status: 'optional',\n },\n confirmType: {\n doc: 'For variant confirmation, the dialog is either an informational (`info`) or a warning (`warning`) message. Defaults to `info`.',\n type: 'string',\n status: 'optional',\n },\n declineText: {\n doc: 'For dialog actions, give a custom text for the decline button.',\n type: 'string',\n status: 'optional',\n },\n confirmText: {\n doc: 'For dialog actions, give a custom text for the confirmation button.',\n type: 'string',\n status: 'optional',\n },\n hideDecline: {\n doc: 'For variant confirmation, hide the default decline button and only show the confirmation button.',\n type: 'boolean',\n status: 'optional',\n },\n hideConfirm: {\n doc: 'For variant confirmation, hide the default confirm button and only show the decline button.',\n type: 'boolean',\n status: 'optional',\n },\n scrollRef: {\n doc: 'To get the scroll Element, pass in your own React ref.',\n type: 'React.
|
|
1
|
+
{"version":3,"file":"DialogDocs.js","names":["DialogProperties","exports","variant","doc","type","status","title","minWidth","maxWidth","className","spacing","preventCoreStyle","navContent","headerContent","modalContent","description","verticalAlignment","alignContent","fullscreen","icon","confirmType","declineText","confirmText","hideDecline","hideConfirm","scrollRef","contentRef","DialogEvents","onConfirm","onDecline"],"sources":["../../../../src/components/dialog/DialogDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const DialogProperties: PropertiesTableProps = {\n variant: {\n doc: 'The dialog variant. Can either be `information` or `confirmation`. Defaults to `information`.',\n type: 'string',\n status: 'optional',\n },\n title: {\n doc: 'The dialog title. Displays on the very top of the content.',\n type: 'string',\n status: 'optional',\n },\n minWidth: {\n doc: \"The minimum Dialog content width, defined by a CSS width value like `50vw` (50% of the viewport). Be careful on using fixed `minWidth` so you don't break responsiveness. Defaults to `30rem` (average width is set to `60vw`).\",\n type: 'string',\n status: 'optional',\n },\n maxWidth: {\n doc: 'The maximum Dialog content width, defined by a CSS width value like `20rem`. Defaults to `60rem` (average width is set to `60vw`).',\n type: 'string',\n status: 'optional',\n },\n className: {\n doc: 'Give the Dialog content a class name (maps to `dnb-dialog`).',\n type: 'string',\n status: 'optional',\n },\n spacing: {\n doc: 'If set to `false` then the dialog content will be shown without any spacing. Defaults to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n preventCoreStyle: {\n doc: 'By default the dialog content gets added the core style class `dnb-core-style`. Use `false` to disable this behavior.',\n type: 'boolean',\n status: 'optional',\n },\n navContent: {\n doc: 'The content which will appear in the navigation, above the header, and side-by-side the close button.',\n type: 'React.Node',\n status: 'optional',\n },\n headerContent: {\n doc: 'The content which will appear in the header of the dialog.',\n type: 'React.Node',\n status: 'optional',\n },\n modalContent: {\n doc: 'The content which will appear when triggering the dialog.',\n type: 'React.Node',\n status: 'optional',\n },\n description: {\n doc: 'A description will be positioned below the title, but before the content. Used for Dialog variant `confirmation` to further describe what the actions will do.',\n type: 'string',\n status: 'optional',\n },\n verticalAlignment: {\n doc: 'Define the vertical alignment of the container. Can be set to `top` or `center`. Defaults to `center`.',\n type: 'string',\n status: 'optional',\n },\n alignContent: {\n doc: 'Define the inner horizontal alignment of the content. Can be set to `left`, `center`, `right` and `centered`. If `centered`, then the content will also be centered vertically. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n fullscreen: {\n doc: 'If set to `true` then the dialog content will be shown as fullscreen, without showing the original content behind. Can be set to `false` to omit the auto fullscreen. Defaults to `auto`.',\n type: 'boolean',\n status: 'optional',\n },\n icon: {\n doc: 'An icon to display at the top of the component. Should be of size medium, so make sure you import the `_medium` version of the Eufemia icon.',\n type: 'React.Node',\n status: 'optional',\n },\n confirmType: {\n doc: 'For variant confirmation, the dialog is either an informational (`info`) or a warning (`warning`) message. Defaults to `info`.',\n type: 'string',\n status: 'optional',\n },\n declineText: {\n doc: 'For dialog actions, give a custom text for the decline button.',\n type: 'string',\n status: 'optional',\n },\n confirmText: {\n doc: 'For dialog actions, give a custom text for the confirmation button.',\n type: 'string',\n status: 'optional',\n },\n hideDecline: {\n doc: 'For variant confirmation, hide the default decline button and only show the confirmation button.',\n type: 'boolean',\n status: 'optional',\n },\n hideConfirm: {\n doc: 'For variant confirmation, hide the default confirm button and only show the decline button.',\n type: 'boolean',\n status: 'optional',\n },\n scrollRef: {\n doc: 'To get the scroll Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n contentRef: {\n doc: 'To get the inner content Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const DialogEvents: PropertiesTableProps = {\n onConfirm: {\n doc: 'For variant confirmation, handle the confirm action click. Provided with the mouse event and the Modal function `close` as arguments.',\n type: 'function',\n status: 'optional',\n },\n onDecline: {\n doc: 'For variant confirmation, handle the decline action click. Provided with the mouse event and the Modal function `close` as arguments.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,gBAAsC,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EACpDE,OAAO,EAAE;IACPC,GAAG,EAAE,+FAA+F;IACpGC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLH,GAAG,EAAE,4DAA4D;IACjEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDE,QAAQ,EAAE;IACRJ,GAAG,EAAE,iOAAiO;IACtOC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDG,QAAQ,EAAE;IACRL,GAAG,EAAE,oIAAoI;IACzIC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDI,SAAS,EAAE;IACTN,GAAG,EAAE,8DAA8D;IACnEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDK,OAAO,EAAE;IACPP,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDM,gBA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pB,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDmB,WAAW,EAAE;IACXrB,GAAG,EAAE,6FAA6F;IAClGC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDoB,SAAS,EAAE;IACTtB,GAAG,EAAE,wDAAwD;IAC7DC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDqB,UAAU,EAAE;IACVvB,GAAG,EAAE,+DAA+D;IACpEC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,0DAA0D;IAC/DC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1BC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMsB,YAAkC,GAAA1B,OAAA,CAAA0B,YAAA,GAAG;EAChDC,SAAS,EAAE;IACTzB,GAAG,EAAE,uIAAuI;IAC5IC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDwB,SAAS,EAAE;IACT1B,GAAG,EAAE,uIAAuI;IAC5IC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -20,81 +20,81 @@ type DropdownAlignDropdown = 'left' | 'right';
|
|
|
20
20
|
type DropdownTriggerElement = ((...args: any[]) => any) | React.ReactNode;
|
|
21
21
|
export interface DropdownProps {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* give a title to let the users know what they have to do. Defaults to `Valgmeny`.
|
|
24
24
|
*/
|
|
25
25
|
title?: DropdownTitle;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* defines the kind of dropdown. Possible values are `primary`, `secondary`, `tertiary` and `signal`. Defaults to `secondary`.
|
|
28
28
|
*/
|
|
29
29
|
variant?: ButtonVariant;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* icon to be included in the dropdown.
|
|
32
32
|
*/
|
|
33
33
|
icon?: IconIcon;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* change the size of the icon pragmatically.
|
|
36
36
|
*/
|
|
37
37
|
icon_size?: IconSize;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* position of the icon inside the dropdown. Set to `left` or `right`. Defaults to `right`.
|
|
40
40
|
*/
|
|
41
41
|
icon_position?: ButtonIconPosition;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* prepends the Form Label component. If no ID is provided, a random ID is created.
|
|
44
44
|
*/
|
|
45
45
|
label?: React.ReactNode;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* use `label_direction="vertical"` to change the label layout direction. Defaults to `horizontal`.
|
|
48
48
|
*/
|
|
49
49
|
label_direction?: FormLabelLabelDirection;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* use `true` to make the label only readable by screen readers.
|
|
52
52
|
*/
|
|
53
53
|
label_sr_only?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message.
|
|
56
56
|
*/
|
|
57
57
|
status?: FormStatusText;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* defines the state of the status. It's two statuses `[error, info]`. Defaults to `error`.
|
|
60
60
|
*/
|
|
61
61
|
status_state?: FormStatusState;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* use an object to define additional FormStatus properties.
|
|
64
64
|
*/
|
|
65
65
|
status_props?: FormStatusProps;
|
|
66
66
|
status_no_animation?: boolean;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* the [configuration](/uilib/components/global-status/properties/#configuration-object) used for the target [GlobalStatus](/uilib/components/global-status).
|
|
69
69
|
*/
|
|
70
70
|
globalStatus?: GlobalStatusConfigObject;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* by providing a React.ref you can get the internally used main element (DOM). E.g. `innerRef={myRef}` by using `React.createRef()` or `React.useRef()`.
|
|
73
73
|
*/
|
|
74
74
|
innerRef?: React.Ref;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* by providing a React.ref you can get the internally used button element (DOM). E.g. `buttonRef={myRef}` by using `React.createRef()` or `React.useRef()`.
|
|
77
77
|
*/
|
|
78
78
|
buttonRef?: React.Ref;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* same as `prevent_selection`, but the "selection area" (given title) will not be visible and the icon `more` (three dots) is used. Defaults to `false`.
|
|
81
81
|
*/
|
|
82
82
|
more_menu?: boolean;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* use `right` to change the options alignment direction. Makes only sense to use in combination with `prevent_selection` or `more_menu`. Defaults to `left`.
|
|
85
85
|
*/
|
|
86
86
|
align_dropdown?: DropdownAlignDropdown;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* lets you provide a custom React element as the trigger HTML element.
|
|
89
89
|
*/
|
|
90
90
|
trigger_element?: DropdownTriggerElement;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* if set to `true`, the Dropdown will be opened when the users enter the trigger button with a focus action.
|
|
93
93
|
*/
|
|
94
94
|
open_on_focus?: boolean;
|
|
95
95
|
disabled?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* if set to `true`, then the dropdown will be 100% in available `width`.
|
|
98
98
|
*/
|
|
99
99
|
stretch?: boolean;
|
|
100
100
|
/**
|
|
@@ -102,7 +102,7 @@ export interface DropdownProps {
|
|
|
102
102
|
*/
|
|
103
103
|
skeleton?: SkeletonShow;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* text describing the content of the Dropdown more than the label. You can also send in a React component, so it gets wrapped inside the Dropdown component.
|
|
106
106
|
*/
|
|
107
107
|
suffix?: DrawerListSuffix;
|
|
108
108
|
on_show_focus?: (...args: any[]) => any;
|