@pega/cosmos-react-core 4.0.0-dev.13.0 → 4.0.0-dev.14.1
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/README.md +2 -2
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +0 -2
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +10 -16
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +12 -11
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +1 -1
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -2
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +31 -11
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts.map +1 -1
- package/lib/components/AppShell/Operator.js +1 -3
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +9 -21
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +0 -2
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +3 -3
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.js +2 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts +1 -1
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/Button.d.ts +7 -9
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +168 -142
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +1 -1
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.js +5 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +2 -10
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.js +2 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +8 -10
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.js +5 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +2 -6
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +9 -27
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +5 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/CreditCard/utils.d.ts +1 -1
- package/lib/components/CreditCard/utils.d.ts.map +1 -1
- package/lib/components/CreditCard/utils.js +1 -1
- package/lib/components/CreditCard/utils.js.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/Currency.test-ids.js +5 -1
- package/lib/components/Currency/Currency.test-ids.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +3 -7
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +4 -10
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +25 -32
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +3 -0
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +20 -27
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +11 -17
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +3 -3
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts +4 -6
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +1 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts +2 -4
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -3
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.d.ts +1 -3
- package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +1 -1
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +1 -1
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +8 -6
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
- package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.styles.js +29 -2
- package/lib/components/Dialog/Dialog.styles.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +34 -34
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js +0 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts +4 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +4 -5
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.d.ts +0 -1
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +15 -13
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.styles.d.ts +6 -0
- package/lib/components/Dialog/InfoDialog.styles.d.ts.map +1 -0
- package/lib/components/Dialog/InfoDialog.styles.js +18 -0
- package/lib/components/Dialog/InfoDialog.styles.js.map +1 -0
- package/lib/components/Drawer/Drawer.d.ts +9 -9
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +1 -1
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.styles.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.styles.js +2 -7
- package/lib/components/EmojiPicker/EmojiPicker.styles.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts +6 -6
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +1 -3
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +5 -3
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +1 -1
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/File.test-ids.d.ts +1 -1
- package/lib/components/File/File.test-ids.d.ts.map +1 -1
- package/lib/components/File/File.test-ids.js +6 -1
- package/lib/components/File/File.test-ids.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +2 -2
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +1 -3
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +1 -1
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +7 -1
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +37 -10
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +3 -2
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +4 -3
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +10 -14
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +2 -1
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.test-ids.js +3 -2
- package/lib/components/FormField/FormField.test-ids.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +0 -3
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +6 -6
- package/lib/components/Grid/Grid.types.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +2 -2
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge.icon.js.map +1 -0
- package/lib/components/IconPicker/IconPicker.js +2 -2
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +1 -1
- package/lib/components/Input/Input.js +1 -1
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +1 -1
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
- package/lib/components/Input/Input.test-ids.js +2 -1
- package/lib/components/Input/Input.test-ids.js.map +1 -1
- package/lib/components/Label/Label.d.ts +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +49 -17
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +3 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +2 -3
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +2 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +7 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +32 -9
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/helpers.d.ts +10 -0
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -0
- package/lib/components/ListToolbar/helpers.js +46 -0
- package/lib/components/ListToolbar/helpers.js.map +1 -0
- package/lib/components/ListToolbar/index.d.ts +1 -0
- package/lib/components/ListToolbar/index.d.ts.map +1 -1
- package/lib/components/ListToolbar/index.js +1 -0
- package/lib/components/ListToolbar/index.js.map +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.js +17 -16
- package/lib/components/LiveLog/LiveLog.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +1 -1
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
- package/lib/components/Location/Location.test-ids.js +5 -1
- package/lib/components/Location/Location.test-ids.js.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts +1 -1
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +1 -1
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/utils.d.ts +1 -1
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +1 -1
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +1 -4
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
- package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +6 -12
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -0
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -3
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -4
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +2 -0
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js +3 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js.map +1 -0
- package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +3 -5
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.js +1 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +25 -71
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -2
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.js +4 -0
- package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +2 -2
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
- package/lib/components/Number/Number.test-ids.js +8 -2
- package/lib/components/Number/Number.test-ids.js.map +1 -1
- package/lib/components/Number/NumberInput.js +1 -1
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +1 -1
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +2 -2
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
- package/lib/components/Phone/Phone.test-ids.js +3 -1
- package/lib/components/Phone/Phone.test-ids.js.map +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts +1 -1
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.js +2 -2
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +4 -3
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +36 -24
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
- package/lib/components/Popover/PopoverManager.js +11 -10
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +1 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +116 -1
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +25 -20
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +2 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +1 -9
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
- package/lib/components/Select/Select.test-ids.js +2 -1
- package/lib/components/Select/Select.test-ids.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.d.ts +2 -2
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.d.ts +3 -3
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +114 -128
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
- package/lib/components/Slider/Slider.test-ids.js +2 -1
- package/lib/components/Slider/Slider.test-ids.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +3 -9
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +0 -1
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +2 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +21 -18
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +1 -1
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/Text/Text.d.ts +2 -4
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.test-ids.js +2 -1
- package/lib/components/TextArea/TextArea.test-ids.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -3
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +1 -1
- package/lib/components/URL/URLDisplay.js +2 -2
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useArrows.js +1 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +4 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useChToPxConversionFactor.d.ts +3 -0
- package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -0
- package/lib/hooks/useChToPxConversionFactor.js +13 -0
- package/lib/hooks/useChToPxConversionFactor.js.map +1 -0
- package/lib/hooks/useElement.d.ts +1 -1
- package/lib/hooks/useElement.d.ts.map +1 -1
- package/lib/hooks/useI18n.d.ts +13 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +0 -1
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js +3 -0
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/i18n/default.d.ts +13 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +14 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +13 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.d.ts +2 -6
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js.map +1 -1
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/types/types.d.ts +7 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/createTestIds.d.ts +1 -6
- package/lib/utils/createTestIds.d.ts.map +1 -1
- package/lib/utils/createTestIds.js +2 -4
- package/lib/utils/createTestIds.js.map +1 -1
- package/lib/utils/debounce.d.ts +2 -2
- package/lib/utils/debounce.d.ts.map +1 -1
- package/lib/utils/debounce.js +9 -10
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/getEdge.d.ts +7 -0
- package/lib/utils/getEdge.d.ts.map +1 -0
- package/lib/utils/getEdge.js +9 -0
- package/lib/utils/getEdge.js.map +1 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/kebabToCamel.d.ts +1 -3
- package/lib/utils/kebabToCamel.d.ts.map +1 -1
- package/lib/utils/kebabToCamel.js +1 -3
- package/lib/utils/kebabToCamel.js.map +1 -1
- package/lib/utils/throttle.d.ts +4 -0
- package/lib/utils/throttle.d.ts.map +1 -0
- package/lib/utils/throttle.js +15 -0
- package/lib/utils/throttle.js.map +1 -0
- package/package.json +2 -2
|
@@ -9,15 +9,11 @@ export default interface CurrencyInputProps extends OmitStrict<NumberInputProps,
|
|
|
9
9
|
currencyISOCode?: string;
|
|
10
10
|
/** Always show ISO code
|
|
11
11
|
* @default false
|
|
12
|
-
* */
|
|
13
|
-
alwaysShowISOCode?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Fraction digits consistent with ISO
|
|
16
12
|
*/
|
|
13
|
+
alwaysShowISOCode?: boolean;
|
|
14
|
+
/** Fraction digits consistent with ISO */
|
|
17
15
|
minimumFractionDigits?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Fixed number of maximum fraction digits.
|
|
20
|
-
*/
|
|
16
|
+
/** Fixed number of maximum fraction digits. */
|
|
21
17
|
maximumFractionDigits?: number;
|
|
22
18
|
}
|
|
23
19
|
//# sourceMappingURL=CurrencyInput.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,kBACvB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EACtD,cAAc,EACd,UAAU;IACZ,mDAAmD;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;
|
|
1
|
+
{"version":3,"file":"CurrencyInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,kBACvB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EACtD,cAAc,EACd,UAAU;IACZ,mDAAmD;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0CAA0C;IAC1C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,+CAA+C;IAC/C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.types.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport type { NumberInputProps } from '../Number/NumberInput.types';\n\nexport default interface CurrencyInputProps\n extends OmitStrict<NumberInputProps, 'numberOfDecimals'>,\n NoChildrenProp,\n TestIdProp {\n /** Callback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as NumberInput */\n currencyISOCode?: string;\n /** Always show ISO code\n * @default false\n
|
|
1
|
+
{"version":3,"file":"CurrencyInput.types.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport type { NumberInputProps } from '../Number/NumberInput.types';\n\nexport default interface CurrencyInputProps\n extends OmitStrict<NumberInputProps, 'numberOfDecimals'>,\n NoChildrenProp,\n TestIdProp {\n /** Callback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as NumberInput */\n currencyISOCode?: string;\n /** Always show ISO code\n * @default false\n */\n alwaysShowISOCode?: boolean;\n /** Fraction digits consistent with ISO */\n minimumFractionDigits?: number;\n /** Fixed number of maximum fraction digits. */\n maximumFractionDigits?: number;\n}\n"]}
|
|
@@ -3,22 +3,16 @@ import { BaseProps, ForwardProps } from '../../types';
|
|
|
3
3
|
import { DateTimeFormat, DateTimeVariant } from './DateTime.types';
|
|
4
4
|
import { ClockFormat } from './Input/utils';
|
|
5
5
|
export interface DateTimeDisplayProps extends BaseProps {
|
|
6
|
-
/**
|
|
7
|
-
* Date as ISO8601 string, timestamp or native Date object.
|
|
8
|
-
*/
|
|
6
|
+
/** Date as ISO8601 string, timestamp or native Date object. */
|
|
9
7
|
value?: Date | string | number;
|
|
10
|
-
/**
|
|
11
|
-
* Controls date time variant.
|
|
12
|
-
*/
|
|
8
|
+
/** Controls date time variant. */
|
|
13
9
|
variant: DateTimeVariant;
|
|
14
10
|
/**
|
|
15
11
|
* Controls display format.
|
|
16
|
-
* @default
|
|
12
|
+
* @default 'short'
|
|
17
13
|
*/
|
|
18
14
|
format?: DateTimeFormat;
|
|
19
|
-
/**
|
|
20
|
-
* Defines clock format that overrides locale based format
|
|
21
|
-
*/
|
|
15
|
+
/** Defines clock format that overrides locale based format */
|
|
22
16
|
clockFormat?: ClockFormat;
|
|
23
17
|
/** Ref for the wrapping element. */
|
|
24
18
|
ref?: Ref<HTMLSpanElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAe,MAAM,eAAe,CAAC;AAIzD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD
|
|
1
|
+
{"version":3,"file":"DateTimeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAe,MAAM,eAAe,CAAC;AAIzD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,kCAAkC;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,0GAAgB,CAAC;AAEnD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CA+B3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeDisplay.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAe,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeDisplay.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAe,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkBzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAEnD,MAAM,eAAe,GAA2D,UAAU,CACxF,CACE,EACE,KAAK,EACL,OAAO,EACP,MAAM,GAAG,OAAO,EAChB,WAAW,EACX,GAAG,SAAS,EAC0B,EACxC,GAAgC,EAChC,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,KAAC,qBAAqB,IAAC,GAAG,EAAE,GAAG,KAAM,SAAS,YAC3C,CAAC,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3D,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;YACjC,CAAC;YACD,MAAM;YACN,MAAM;YACN,OAAO;YACP,WAAW;YACX,QAAQ,EAAE,KAAK;SAChB,CAAC,CACH,CAAC,CAAC,CAAC,CACF,8BAAkB,MAAM,6BAAsB,CAC/C,GACqB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConfiguration, useI18n } from '../../hooks';\n\nimport { DateTimeFormat, DateTimeVariant } from './DateTime.types';\nimport { ClockFormat, parseToDate } from './Input/utils';\nimport { isValidDate } from './Picker/utils';\nimport { formatDateTime } from './utils';\n\nexport interface DateTimeDisplayProps extends BaseProps {\n /** Date as ISO8601 string, timestamp or native Date object. */\n value?: Date | string | number;\n /** Controls date time variant. */\n variant: DateTimeVariant;\n /**\n * Controls display format.\n * @default 'short'\n */\n format?: DateTimeFormat;\n /** Defines clock format that overrides locale based format */\n clockFormat?: ClockFormat;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLSpanElement>;\n}\n\nexport const StyledDateTimeDisplay = styled.span``;\n\nconst DateTimeDisplay: FunctionComponent<DateTimeDisplayProps & ForwardProps> = forwardRef(\n (\n {\n value,\n variant,\n format = 'short',\n clockFormat,\n ...restProps\n }: PropsWithoutRef<DateTimeDisplayProps>,\n ref: DateTimeDisplayProps['ref']\n ) => {\n const { locale } = useConfiguration();\n const t = useI18n();\n\n return (\n <StyledDateTimeDisplay ref={ref} {...restProps}>\n {(value || value === 0) && isValidDate(parseToDate(value)) ? (\n formatDateTime(parseToDate(value), {\n t,\n locale,\n format,\n variant,\n clockFormat,\n timeZone: 'UTC'\n })\n ) : (\n <span aria-hidden='true'>––</span>\n )}\n </StyledDateTimeDisplay>\n );\n }\n);\n\nexport default DateTimeDisplay;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMjB,QAAQ,EACR,cAAc,EAGd,aAAa,EACd,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMjB,QAAQ,EACR,cAAc,EAGd,aAAa,EACd,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;AACxE,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAuB7E,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC;IAClC,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,aAAa,CAAC;QACxB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;KACzD,CAAC;IACF,8EAA8E;IAC9E,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,eAAe,qHAE3B,CAAC;AAoCF,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CA0U/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,11 +9,11 @@ import Button from '../../Button';
|
|
|
9
9
|
import Icon, { registerIcon } from '../../Icon';
|
|
10
10
|
import * as calendarIcon from '../../Icon/icons/calendar.icon';
|
|
11
11
|
import DatePicker from '../Picker/DatePicker';
|
|
12
|
-
import Popover from '../../Popover';
|
|
13
12
|
import { StyledFormControl } from '../../FormControl';
|
|
14
13
|
import { cap } from '../../../utils';
|
|
14
|
+
import Dialog from '../../Dialog/Dialog';
|
|
15
15
|
import { getDateFormat, parsePastedTextToDate, parseToDate, validateDate, generatePickerButtonAriaLabel } from './utils';
|
|
16
|
-
import StyledDateTime, { StyledClearNowButtonsContainer, StyledInputContainer } from './DateTime.styles';
|
|
16
|
+
import StyledDateTime, { StyledClearNowButtonsContainer, StyledDialogContent, StyledInputContainer } from './DateTime.styles';
|
|
17
17
|
import useAutoFocusNextInput from './useAutoFocusNextInput';
|
|
18
18
|
import PartInput from './PartInput';
|
|
19
19
|
import usePickerButton from './usePickerButton';
|
|
@@ -100,7 +100,7 @@ const DateInput = forwardRef((props, ref) => {
|
|
|
100
100
|
if (dayInputRef.current && monthInputRef.current && yearInputRef.current) {
|
|
101
101
|
dayInputRef.current.value = newValue?.getUTCDate().toString().padStart(2, '0') ?? '';
|
|
102
102
|
monthInputRef.current.value =
|
|
103
|
-
(newValue && (newValue
|
|
103
|
+
(newValue && (newValue.getUTCMonth() + 1).toString().padStart(2, '0')) ?? '';
|
|
104
104
|
yearInputRef.current.value = newValue?.getUTCFullYear().toString() ?? '';
|
|
105
105
|
}
|
|
106
106
|
};
|
|
@@ -120,7 +120,7 @@ const DateInput = forwardRef((props, ref) => {
|
|
|
120
120
|
});
|
|
121
121
|
const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });
|
|
122
122
|
const DayInput = (_jsx(PartInput, { placeholder: t('day_placeholder'), "aria-label": displayNames.of('day'), value: date?.getUTCDate(), onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 31, ref: dayInputRef }, 'day'));
|
|
123
|
-
const MonthInput = (_jsx(PartInput, { placeholder: t('month_placeholder'), "aria-label": displayNames.of('month'), value: date ? date
|
|
123
|
+
const MonthInput = (_jsx(PartInput, { placeholder: t('month_placeholder'), "aria-label": displayNames.of('month'), value: date ? date.getUTCMonth() + 1 : undefined, onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 12, ref: monthInputRef }, 'month'));
|
|
124
124
|
const YearInput = (_jsx(PartInput, { placeholder: t('year_placeholder'), "aria-label": displayNames.of('year'), value: date?.getUTCFullYear(), onChange: onInputChange, size: 4, maxLength: 4, padWithZeros: false, readOnly: readOnly, min: 1, ref: yearInputRef }, 'year'));
|
|
125
125
|
useFocusWithin([containerRef], onFocusChange);
|
|
126
126
|
useImperativeHandle(handle, () => ({
|
|
@@ -141,34 +141,27 @@ const DateInput = forwardRef((props, ref) => {
|
|
|
141
141
|
return currentlySelectedDate();
|
|
142
142
|
}
|
|
143
143
|
}));
|
|
144
|
-
const PickerButton = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: 'calendar' }) }), open && (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
now.setUTCHours(now.getHours());
|
|
166
|
-
now.setUTCSeconds(now.getSeconds());
|
|
167
|
-
setInputValue(now);
|
|
168
|
-
setOpen(false);
|
|
169
|
-
setTimeout(() => buttonEl?.focus());
|
|
170
|
-
onInputChange();
|
|
171
|
-
}, children: cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day')) })] })] }))] }));
|
|
144
|
+
const PickerButton = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: 'calendar' }) }), open && buttonEl && (_jsx(Dialog, { ref: setPopoverRef, target: buttonEl, placement: 'bottom-end', ariaLabel: t('choose_date'), children: _jsxs(Flex, { container: { direction: 'column' }, as: StyledDialogContent, children: [_jsx(PickerComp, { selected: currentlySelectedDate(), min: min, max: max, showWeekNumber: showWeekNumber, ...rendererProps, onChange: selected => {
|
|
145
|
+
setInputValue(selected);
|
|
146
|
+
setOpen(false);
|
|
147
|
+
setTimeout(() => buttonEl?.focus());
|
|
148
|
+
onInputChange();
|
|
149
|
+
rendererProps?.onChange?.(selected);
|
|
150
|
+
} }), _jsxs(Flex, { as: StyledClearNowButtonsContainer, container: { justify: 'between' }, children: [_jsx(Button, { "aria-label": t('clear_current_date'), onClick: () => {
|
|
151
|
+
setInputValue(undefined);
|
|
152
|
+
setOpen(false);
|
|
153
|
+
setTimeout(() => buttonEl?.focus());
|
|
154
|
+
onInputChange();
|
|
155
|
+
}, children: t('clear') }), _jsx(Button, { "aria-label": t('set_current_date_a11y'), onClick: () => {
|
|
156
|
+
const now = new Date();
|
|
157
|
+
now.setUTCMinutes(now.getMinutes());
|
|
158
|
+
now.setUTCHours(now.getHours());
|
|
159
|
+
now.setUTCSeconds(now.getSeconds());
|
|
160
|
+
setInputValue(now);
|
|
161
|
+
setOpen(false);
|
|
162
|
+
setTimeout(() => buttonEl?.focus());
|
|
163
|
+
onInputChange();
|
|
164
|
+
}, children: cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day')) })] })] }) }))] }));
|
|
172
165
|
const orderedRefs = [];
|
|
173
166
|
const Comp = (_jsxs(Flex, { as: StyledDateInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
174
167
|
if (e.target === containerRef.current)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateIn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\n Dispatch,\n SetStateAction,\n useImperativeHandle,\n useEffect,\n ComponentType\n} from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { useConfiguration, useFocusWithin, useI18n, useOuterEvent } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport DatePicker from '../Picker/DatePicker';\nimport type DatePickerProps from '../Picker/DatePicker.types';\nimport Popover from '../../Popover';\nimport { FormControlProps, StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\nimport { cap } from '../../../utils';\n\nimport {\n getDateFormat,\n parsePastedTextToDate,\n parseToDate,\n validateDate,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, {\n StyledClearNowButtonsContainer,\n StyledInputContainer\n} from './DateTime.styles';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\nimport type { DateParts } from './DateTimeInput.types';\n\nregisterIcon(calendarIcon);\n\nexport interface DateInputProps extends DateTimeProps {\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n /** Changes default date picker */\n picker?: {\n renderer: ComponentType;\n rendererProps?: Partial<DatePickerProps> & ForwardProps;\n };\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n}\n\nexport interface DateInputRefObject {\n readonly value: Date | undefined;\n setOpen: Dispatch<SetStateAction<boolean>>;\n buttonEl: HTMLElement | null;\n}\n\nexport const StyledDateInput = styled(StyledDateTime)<DateInputProps>`\n padding-inline-end: 0;\n`;\n\nStyledDateInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n { year, month: monthIndex, day }: DateParts<string | undefined>\n): DateTimeCallbackParameter => {\n if ([year, monthIndex, day].every(Boolean)) {\n if (!validateDate(Number(year), Number(monthIndex) + 1, Number(day))) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCFullYear(Number(year), Number(monthIndex), Number(day));\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if ([year, monthIndex, day].every(p => !p)) {\n return {\n valueAsISOString: undefined,\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst DateInput: FunctionComponent<DateInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DateInputProps>, ref: Ref<DateInputRefObject>) => {\n const { locale } = useConfiguration();\n const {\n value,\n min,\n max,\n id,\n label,\n labelHidden,\n info = getDateFormat(locale).join(''),\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n showWeekNumber,\n picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {},\n autoFocus,\n additionalInfo,\n handle,\n ...restProps\n } = props;\n\n const t = useI18n();\n const containerRef = useRef<HTMLElement>(null);\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [yearInputRef, monthInputRef, dayInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n const pickParts = (): DateParts<string | undefined> => {\n return {\n day: dayInputRef.current?.value || undefined,\n month: monthInputRef.current?.value\n ? (Number(monthInputRef.current.value) - 1).toString()\n : undefined,\n year: yearInputRef.current?.value || undefined\n };\n };\n\n const currentlySelectedDate = () => {\n const parts = pickParts();\n if (Object.values(parts).every(Boolean)) {\n const year = Number(parts.year);\n const monthIndex = Number(parts.month);\n const day = Number(parts.day);\n\n return validateDate(year, monthIndex + 1, day)\n ? new Date(Date.UTC(year, monthIndex, day))\n : undefined;\n }\n };\n\n const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts()\n );\n if (onFocus && focused) onFocus(callbackParam);\n if (!focused) {\n if (inputContainerRef.current) inputContainerRef.current.scrollTop = 0;\n onBlur?.(callbackParam);\n }\n };\n\n const onInputChange = () => {\n onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open)\n );\n };\n\n const setInputValue = (newValue?: Date) => {\n if (dayInputRef.current && monthInputRef.current && yearInputRef.current) {\n dayInputRef.current.value = newValue?.getUTCDate().toString().padStart(2, '0') ?? '';\n monthInputRef.current.value =\n (newValue && (newValue?.getUTCMonth() + 1).toString().padStart(2, '0')) ?? '';\n yearInputRef.current.value = newValue?.getUTCFullYear().toString() ?? '';\n }\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text');\n const newDate = parsePastedTextToDate(text, locale, date || new Date());\n if (newDate) {\n e.preventDefault();\n setInputValue(newDate);\n onInputChange();\n }\n };\n\n // autoclose picker on focusing out\n useOuterEvent('focusin', [containerRef], e => {\n if (containerRef.current?.contains(e.relatedTarget as HTMLElement)) setOpen(false);\n });\n\n const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });\n\n const DayInput = (\n <PartInput\n key='day'\n placeholder={t('day_placeholder')}\n aria-label={displayNames.of('day')}\n value={date?.getUTCDate()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={31}\n ref={dayInputRef}\n />\n );\n\n const MonthInput = (\n <PartInput\n key='month'\n placeholder={t('month_placeholder')}\n aria-label={displayNames.of('month')}\n value={date ? date?.getUTCMonth() + 1 : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={12}\n ref={monthInputRef}\n />\n );\n\n const YearInput = (\n <PartInput\n key='year'\n placeholder={t('year_placeholder')}\n aria-label={displayNames.of('year')}\n value={date?.getUTCFullYear()}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n padWithZeros={false}\n readOnly={readOnly}\n min={1}\n ref={yearInputRef}\n />\n );\n\n useFocusWithin([containerRef], onFocusChange);\n\n useImperativeHandle(\n handle,\n () => ({\n clear: () => {\n if (dayInputRef.current) dayInputRef.current.value = '';\n if (monthInputRef.current) monthInputRef.current.value = '';\n if (yearInputRef.current) yearInputRef.current.value = '';\n onInputChange();\n }\n }),\n [onInputChange]\n );\n\n useImperativeHandle(ref, () => ({\n setOpen,\n buttonEl,\n get value() {\n return currentlySelectedDate();\n }\n }));\n\n const PickerButton = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'date',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name='calendar' />\n </Button>\n {open && (\n <Popover\n ref={setPopoverRef}\n target={buttonEl}\n placement='bottom-end'\n strategy='fixed'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end', 'right', 'left']\n }\n }\n ]}\n >\n <PickerComp\n selected={currentlySelectedDate()}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n {...rendererProps}\n onChange={selected => {\n setInputValue(selected);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n rendererProps?.onChange?.(selected);\n }}\n />\n <Flex as={StyledClearNowButtonsContainer} container={{ justify: 'between' }}>\n <Button\n aria-label={t('clear_current_date')}\n onClick={() => {\n setInputValue(undefined);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n >\n {t('clear')}\n </Button>\n <Button\n aria-label={t('set_current_date_a11y')}\n onClick={() => {\n const now = new Date();\n now.setUTCMinutes(now.getMinutes());\n now.setUTCHours(now.getHours());\n now.setUTCSeconds(now.getSeconds());\n setInputValue(now);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n >\n {cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day'))}\n </Button>\n </Flex>\n </Popover>\n )}\n </>\n );\n\n const orderedRefs: RefObject<HTMLInputElement>[] = [];\n\n const Comp = (\n <Flex\n as={StyledDateInput}\n forwardedAs={StyledFormControl}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) orderedRefs[0].current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n onPaste={onPaste}\n >\n {getDateFormat(locale).map(part => {\n switch (part) {\n case 'DD':\n orderedRefs.push(dayInputRef);\n return DayInput;\n case 'MM':\n orderedRefs.push(monthInputRef);\n return MonthInput;\n case 'YYYY':\n orderedRefs.push(yearInputRef);\n return YearInput;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && PickerButton}\n </Flex>\n );\n\n useEffect(() => {\n if (autoFocus) orderedRefs[0].current?.focus();\n }, [autoFocus]);\n\n useAutoFocusNextInput(orderedRefs);\n\n return label ? (\n <FormField\n as='fieldset'\n aria-labelledby={id}\n labelAs='legend'\n {...{\n label,\n labelHidden,\n id,\n info,\n status,\n required,\n disabled,\n onResolveSuggestion,\n additionalInfo\n }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default DateInput;\n"]}
|
|
1
|
+
{"version":3,"file":"DateInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,M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EAAE,OAAO,YAEf,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBAChC,QAAQ,IAAI,EAAE;wBACZ,KAAK,IAAI;4BACP,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;4BAC9B,OAAO,QAAQ,CAAC;wBAClB,KAAK,IAAI;4BACP,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;4BAChC,OAAO,UAAU,CAAC;wBACpB,KAAK,MAAM;4BACT,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;4BAC/B,OAAO,SAAS,CAAC;wBACnB;4BACE,OAAO,IAAI,CAAC;qBACf;gBACH,CAAC,CAAC,GACG,EACN,CAAC,QAAQ,IAAI,YAAY,IACrB,CACR,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS;YAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IACjD,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAEnC,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,EAAE,EAAC,UAAU,qBACI,EAAE,EACnB,OAAO,EAAC,QAAQ,KACZ;YACF,KAAK;YACL,WAAW;YACX,EAAE;YACF,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,QAAQ;YACR,mBAAmB;YACnB,cAAc;SACf,EACD,GAAG,EAAE,GAAG,YAEP,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n ClipboardEvent,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useRef,\n RefObject,\n Dispatch,\n SetStateAction,\n useImperativeHandle,\n useEffect,\n ComponentType\n} from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { useConfiguration, useFocusWithin, useI18n, useOuterEvent } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport DatePicker from '../Picker/DatePicker';\nimport type DatePickerProps from '../Picker/DatePicker.types';\nimport { FormControlProps, StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\nimport { cap } from '../../../utils';\nimport Dialog from '../../Dialog/Dialog';\n\nimport {\n getDateFormat,\n parsePastedTextToDate,\n parseToDate,\n validateDate,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, {\n StyledClearNowButtonsContainer,\n StyledDialogContent,\n StyledInputContainer\n} from './DateTime.styles';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\nimport type { DateParts } from './DateTimeInput.types';\n\nregisterIcon(calendarIcon);\n\nexport interface DateInputProps extends DateTimeProps {\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n /** Changes default date picker */\n picker?: {\n renderer: ComponentType;\n rendererProps?: Partial<DatePickerProps> & ForwardProps;\n };\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n}\n\nexport interface DateInputRefObject {\n readonly value: Date | undefined;\n setOpen: Dispatch<SetStateAction<boolean>>;\n buttonEl: HTMLElement | null;\n}\n\nexport const StyledDateInput = styled(StyledDateTime)<DateInputProps>`\n padding-inline-end: 0;\n`;\n\nStyledDateInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n { year, month: monthIndex, day }: DateParts<string | undefined>\n): DateTimeCallbackParameter => {\n if ([year, monthIndex, day].every(Boolean)) {\n if (!validateDate(Number(year), Number(monthIndex) + 1, Number(day))) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCFullYear(Number(year), Number(monthIndex), Number(day));\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if ([year, monthIndex, day].every(p => !p)) {\n return {\n valueAsISOString: undefined,\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst DateInput: FunctionComponent<DateInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DateInputProps>, ref: Ref<DateInputRefObject>) => {\n const { locale } = useConfiguration();\n const {\n value,\n min,\n max,\n id,\n label,\n labelHidden,\n info = getDateFormat(locale).join(''),\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n showWeekNumber,\n picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {},\n autoFocus,\n additionalInfo,\n handle,\n ...restProps\n } = props;\n\n const t = useI18n();\n const containerRef = useRef<HTMLElement>(null);\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [yearInputRef, monthInputRef, dayInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n const pickParts = (): DateParts<string | undefined> => {\n return {\n day: dayInputRef.current?.value || undefined,\n month: monthInputRef.current?.value\n ? (Number(monthInputRef.current.value) - 1).toString()\n : undefined,\n year: yearInputRef.current?.value || undefined\n };\n };\n\n const currentlySelectedDate = () => {\n const parts = pickParts();\n if (Object.values(parts).every(Boolean)) {\n const year = Number(parts.year);\n const monthIndex = Number(parts.month);\n const day = Number(parts.day);\n\n return validateDate(year, monthIndex + 1, day)\n ? new Date(Date.UTC(year, monthIndex, day))\n : undefined;\n }\n };\n\n const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts()\n );\n if (onFocus && focused) onFocus(callbackParam);\n if (!focused) {\n if (inputContainerRef.current) inputContainerRef.current.scrollTop = 0;\n onBlur?.(callbackParam);\n }\n };\n\n const onInputChange = () => {\n onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open)\n );\n };\n\n const setInputValue = (newValue?: Date) => {\n if (dayInputRef.current && monthInputRef.current && yearInputRef.current) {\n dayInputRef.current.value = newValue?.getUTCDate().toString().padStart(2, '0') ?? '';\n monthInputRef.current.value =\n (newValue && (newValue.getUTCMonth() + 1).toString().padStart(2, '0')) ?? '';\n yearInputRef.current.value = newValue?.getUTCFullYear().toString() ?? '';\n }\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text');\n const newDate = parsePastedTextToDate(text, locale, date || new Date());\n if (newDate) {\n e.preventDefault();\n setInputValue(newDate);\n onInputChange();\n }\n };\n\n // autoclose picker on focusing out\n useOuterEvent('focusin', [containerRef], e => {\n if (containerRef.current?.contains(e.relatedTarget as HTMLElement)) setOpen(false);\n });\n\n const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });\n\n const DayInput = (\n <PartInput\n key='day'\n placeholder={t('day_placeholder')}\n aria-label={displayNames.of('day')}\n value={date?.getUTCDate()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={31}\n ref={dayInputRef}\n />\n );\n\n const MonthInput = (\n <PartInput\n key='month'\n placeholder={t('month_placeholder')}\n aria-label={displayNames.of('month')}\n value={date ? date.getUTCMonth() + 1 : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={12}\n ref={monthInputRef}\n />\n );\n\n const YearInput = (\n <PartInput\n key='year'\n placeholder={t('year_placeholder')}\n aria-label={displayNames.of('year')}\n value={date?.getUTCFullYear()}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n padWithZeros={false}\n readOnly={readOnly}\n min={1}\n ref={yearInputRef}\n />\n );\n\n useFocusWithin([containerRef], onFocusChange);\n\n useImperativeHandle(\n handle,\n () => ({\n clear: () => {\n if (dayInputRef.current) dayInputRef.current.value = '';\n if (monthInputRef.current) monthInputRef.current.value = '';\n if (yearInputRef.current) yearInputRef.current.value = '';\n onInputChange();\n }\n }),\n [onInputChange]\n );\n\n useImperativeHandle(ref, () => ({\n setOpen,\n buttonEl,\n get value() {\n return currentlySelectedDate();\n }\n }));\n\n const PickerButton = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'date',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name='calendar' />\n </Button>\n {open && buttonEl && (\n <Dialog\n ref={setPopoverRef}\n target={buttonEl}\n placement='bottom-end'\n ariaLabel={t('choose_date')}\n >\n <Flex container={{ direction: 'column' }} as={StyledDialogContent}>\n <PickerComp\n selected={currentlySelectedDate()}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n {...rendererProps}\n onChange={selected => {\n setInputValue(selected);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n rendererProps?.onChange?.(selected);\n }}\n />\n <Flex as={StyledClearNowButtonsContainer} container={{ justify: 'between' }}>\n <Button\n aria-label={t('clear_current_date')}\n onClick={() => {\n setInputValue(undefined);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n >\n {t('clear')}\n </Button>\n <Button\n aria-label={t('set_current_date_a11y')}\n onClick={() => {\n const now = new Date();\n now.setUTCMinutes(now.getMinutes());\n now.setUTCHours(now.getHours());\n now.setUTCSeconds(now.getSeconds());\n setInputValue(now);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n >\n {cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day'))}\n </Button>\n </Flex>\n </Flex>\n </Dialog>\n )}\n </>\n );\n\n const orderedRefs: RefObject<HTMLInputElement>[] = [];\n\n const Comp = (\n <Flex\n as={StyledDateInput}\n forwardedAs={StyledFormControl}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) orderedRefs[0].current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n onPaste={onPaste}\n >\n {getDateFormat(locale).map(part => {\n switch (part) {\n case 'DD':\n orderedRefs.push(dayInputRef);\n return DayInput;\n case 'MM':\n orderedRefs.push(monthInputRef);\n return MonthInput;\n case 'YYYY':\n orderedRefs.push(yearInputRef);\n return YearInput;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && PickerButton}\n </Flex>\n );\n\n useEffect(() => {\n if (autoFocus) orderedRefs[0].current?.focus();\n }, [autoFocus]);\n\n useAutoFocusNextInput(orderedRefs);\n\n return label ? (\n <FormField\n as='fieldset'\n aria-labelledby={id}\n labelAs='legend'\n {...{\n label,\n labelHidden,\n id,\n info,\n status,\n required,\n disabled,\n onResolveSuggestion,\n additionalInfo\n }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default DateInput;\n"]}
|
|
@@ -3,4 +3,5 @@ export declare const StyledInputContainer: import("styled-components").StyledCom
|
|
|
3
3
|
declare const StyledDateTime: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export default StyledDateTime;
|
|
5
5
|
export declare const StyledClearNowButtonsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledDialogContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
7
|
//# sourceMappingURL=DateTime.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTime.styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS,2GA0CpB,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAwBhC,CAAC;AAEF,QAAA,MAAM,cAAc,yGAuDlB,CAAC;AAIH,eAAe,cAAc,CAAC;AAE9B,eAAO,MAAM,8BAA8B,yGAOzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"DateTime.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTime.styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS,2GA0CpB,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAwBhC,CAAC;AAEF,QAAA,MAAM,cAAc,yGAuDlB,CAAC;AAIH,eAAe,cAAc,CAAC;AAE9B,eAAO,MAAM,8BAA8B,yGAOzC,CAAC;AAIH,eAAO,MAAM,mBAAmB,yGAE/B,CAAC"}
|
|
@@ -120,4 +120,7 @@ export const StyledClearNowButtonsContainer = styled.div(({ theme }) => {
|
|
|
120
120
|
`;
|
|
121
121
|
});
|
|
122
122
|
StyledClearNowButtonsContainer.defaultProps = defaultThemeProp;
|
|
123
|
+
export const StyledDialogContent = styled.div `
|
|
124
|
+
overflow: auto;
|
|
125
|
+
`;
|
|
123
126
|
//# sourceMappingURL=DateTime.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTime.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;A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gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,EACrE,EACF,EACF,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;cAEE,MAAM;kBACF,OAAO,CAAC,WAAW,CAAC;;iBAErB,OAAO;;;oBAGJ,OAAO,CAAC,YAAY,CAAC;;;;sBAInB,gBAAgB;oBAClB,MAAM;;;QAGlB,YAAY;4BACQ,gBAAgB,MAAM,gBAAgB;;;;iBAIjD,OAAO;;yBAEC,MAAM,UAAU,WAAW;qBAC/B,MAAM,UAAU,WAAW;;2BAErB,OAAO,CAAC,YAAY,CAAC,UAAU,WAAW;;;;MAI/D,aAAa;MACb,YAAY;qBACG,UAAU;;GAE5B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,eAAe,cAAc,CAAC;AAE9B,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAEnC,OAAO,GAAG,CAAA;0BACc,OAAO;2BACN,OAAO;GAC/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,8BAA8B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { StyledButton } from '../../Button';\nimport { StyledPopover } from '../../Popover/Popover.styles';\nimport { StyledSelect } from '../../Select/Select';\n\nexport const BareInput = styled.input(({ theme, size }) => {\n return css`\n color: ${theme.components['form-control']['foreground-color']};\n border: 0;\n outline: none;\n width: ${size}ch;\n background-color: transparent;\n text-align: end;\n margin-inline-end: 0.125rem;\n height: inherit;\n\n &::placeholder {\n font-size: 0.6em;\n text-align: center;\n transform: translateY(-0.35ex);\n }\n\n &:last-child {\n text-align: start;\n }\n\n &:nth-child(3) {\n text-align: start;\n &::placeholder {\n text-align: start;\n }\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n\n :not(:first-child) {\n margin-inline-start: 0.125rem;\n }\n `;\n});\n\nBareInput.defaultProps = defaultThemeProp;\n\nexport const StyledInputContainer = styled.div`\n height: inherit;\n overflow: hidden;\n\n > ${StyledSelect} {\n border: 0;\n background-color: transparent;\n color: currentcolor;\n opacity: 1;\n width: max-content;\n\n &:focus:not([readonly]):enabled {\n box-shadow: none;\n font-weight: ${p => p.theme.base['font-weight']['semi-bold']};\n }\n\n option {\n font-weight: ${p => p.theme.base['font-weight'].normal};\n }\n\n @media (pointer: coarse) {\n min-height: inherit;\n }\n }\n`;\n\nconst StyledDateTime = styled.div(props => {\n const {\n theme: {\n base: {\n 'font-family': fontFamily,\n spacing,\n 'border-radius': baseBorderRadius,\n 'hit-area': hitArea\n },\n components: {\n input: { height },\n 'form-control': {\n 'border-radius': formBorderRadius,\n 'foreground-color': fgColor,\n 'border-width': borderWidth,\n ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow }\n }\n }\n }\n } = props;\n return css`\n min-width: min-content;\n height: ${height};\n min-height: ${hitArea['mouse-min']};\n outline: none;\n padding: 0 ${spacing};\n\n @media (pointer: coarse) {\n min-height: ${hitArea['finger-min']};\n }\n\n &:focus-within:not([disabled]) {\n border-color: ${focusBorderColor};\n box-shadow: ${shadow};\n }\n\n > ${StyledButton} {\n border-radius: calc(${baseBorderRadius} * ${formBorderRadius});\n margin-inline-start: auto;\n border: 0;\n &:enabled {\n color: ${fgColor};\n }\n min-height: calc(${height} - 2 * ${borderWidth});\n height: calc(${height} - 2 * ${borderWidth});\n @media (pointer: coarse) {\n min-height: calc(${hitArea['finger-min']} - 2 * ${borderWidth});\n }\n }\n\n ${StyledPopover},\n ${StyledSelect} {\n font-family: ${fontFamily};\n }\n `;\n});\n\nStyledDateTime.defaultProps = defaultThemeProp;\n\nexport default StyledDateTime;\n\nexport const StyledClearNowButtonsContainer = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n\n return css`\n padding-block: calc(${spacing} * 1.5);\n padding-inline: calc(${spacing} * 1.5);\n `;\n});\n\nStyledClearNowButtonsContainer.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"DateTime.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTime.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,kBAAkB,CAAC;;;aAGpD,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;MAIxC,YAAY;;;;;;;;;qBASG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;;qBAI7C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM;;;;;;;CAO3D,CAAC;AAEF,MAAM,cAAc,GAAG,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,MAAM,CAAC,GAAG,CAAA;;CAE5C,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { StyledButton } from '../../Button';\nimport { StyledPopover } from '../../Popover/Popover.styles';\nimport { StyledSelect } from '../../Select/Select';\n\nexport const BareInput = styled.input(({ theme, size }) => {\n return css`\n color: ${theme.components['form-control']['foreground-color']};\n border: 0;\n outline: none;\n width: ${size}ch;\n background-color: transparent;\n text-align: end;\n margin-inline-end: 0.125rem;\n height: inherit;\n\n &::placeholder {\n font-size: 0.6em;\n text-align: center;\n transform: translateY(-0.35ex);\n }\n\n &:last-child {\n text-align: start;\n }\n\n &:nth-child(3) {\n text-align: start;\n &::placeholder {\n text-align: start;\n }\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n\n :not(:first-child) {\n margin-inline-start: 0.125rem;\n }\n `;\n});\n\nBareInput.defaultProps = defaultThemeProp;\n\nexport const StyledInputContainer = styled.div`\n height: inherit;\n overflow: hidden;\n\n > ${StyledSelect} {\n border: 0;\n background-color: transparent;\n color: currentcolor;\n opacity: 1;\n width: max-content;\n\n &:focus:not([readonly]):enabled {\n box-shadow: none;\n font-weight: ${p => p.theme.base['font-weight']['semi-bold']};\n }\n\n option {\n font-weight: ${p => p.theme.base['font-weight'].normal};\n }\n\n @media (pointer: coarse) {\n min-height: inherit;\n }\n }\n`;\n\nconst StyledDateTime = styled.div(props => {\n const {\n theme: {\n base: {\n 'font-family': fontFamily,\n spacing,\n 'border-radius': baseBorderRadius,\n 'hit-area': hitArea\n },\n components: {\n input: { height },\n 'form-control': {\n 'border-radius': formBorderRadius,\n 'foreground-color': fgColor,\n 'border-width': borderWidth,\n ':focus': { 'border-color': focusBorderColor, 'box-shadow': shadow }\n }\n }\n }\n } = props;\n return css`\n min-width: min-content;\n height: ${height};\n min-height: ${hitArea['mouse-min']};\n outline: none;\n padding: 0 ${spacing};\n\n @media (pointer: coarse) {\n min-height: ${hitArea['finger-min']};\n }\n\n &:focus-within:not([disabled]) {\n border-color: ${focusBorderColor};\n box-shadow: ${shadow};\n }\n\n > ${StyledButton} {\n border-radius: calc(${baseBorderRadius} * ${formBorderRadius});\n margin-inline-start: auto;\n border: 0;\n &:enabled {\n color: ${fgColor};\n }\n min-height: calc(${height} - 2 * ${borderWidth});\n height: calc(${height} - 2 * ${borderWidth});\n @media (pointer: coarse) {\n min-height: calc(${hitArea['finger-min']} - 2 * ${borderWidth});\n }\n }\n\n ${StyledPopover},\n ${StyledSelect} {\n font-family: ${fontFamily};\n }\n `;\n});\n\nStyledDateTime.defaultProps = defaultThemeProp;\n\nexport default StyledDateTime;\n\nexport const StyledClearNowButtonsContainer = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n\n return css`\n padding-block: calc(${spacing} * 1.5);\n padding-inline: calc(${spacing} * 1.5);\n `;\n});\n\nStyledClearNowButtonsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledDialogContent = styled.div`\n overflow: auto;\n`;\n"]}
|
|
@@ -20,9 +20,7 @@ export interface DateTimeInputProps extends DateTimeProps {
|
|
|
20
20
|
* @default 30
|
|
21
21
|
*/
|
|
22
22
|
pickerInterval?: MinuteInterval;
|
|
23
|
-
/**
|
|
24
|
-
* Defines clock format that overrides locale based format.
|
|
25
|
-
*/
|
|
23
|
+
/** Defines clock format that overrides locale based format. */
|
|
26
24
|
clockFormat?: ClockFormat;
|
|
27
25
|
/** Pass a heading and content to show additional information on the field. */
|
|
28
26
|
additionalInfo?: FormControlProps['additionalInfo'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;AAexE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAS7E,OAAO,EACL,WAAW,EASZ,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,mBAAmB,yHAK9B,CAAC;AA6GH,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAmiBvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -9,10 +9,10 @@ import Flex from '../../Flex';
|
|
|
9
9
|
import Button from '../../Button';
|
|
10
10
|
import Icon, { registerIcon } from '../../Icon';
|
|
11
11
|
import * as calendarIcon from '../../Icon/icons/calendar.icon';
|
|
12
|
-
import Popover from '../../Popover';
|
|
13
12
|
import DatePicker from '../Picker/DatePicker';
|
|
14
13
|
import { hasProp, cap } from '../../../utils';
|
|
15
|
-
import
|
|
14
|
+
import Dialog from '../../Dialog/Dialog';
|
|
15
|
+
import StyledDateTime, { StyledClearNowButtonsContainer, StyledDialogContent, StyledInputContainer } from './DateTime.styles';
|
|
16
16
|
import { generatePickerButtonAriaLabel, getDateFormat, getTimeOptions, is12HClockFormat, parsePastedTextToDate, parseToDate, validateDate, validateTime } from './utils';
|
|
17
17
|
import useAutoFocusNextInput from './useAutoFocusNextInput';
|
|
18
18
|
import PartInput from './PartInput';
|
|
@@ -319,31 +319,24 @@ const DateTimeInput = forwardRef((props, ref) => {
|
|
|
319
319
|
useFocusWithin([containerRef], onFocusChange);
|
|
320
320
|
const Picker = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => {
|
|
321
321
|
setOpen(cur => !cur);
|
|
322
|
-
}, "aria-label": generatePickerButtonAriaLabel(currentlySelectedDateTime(), 'datetime', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: 'calendar' }) }), open && (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
now.setUTCHours(now.getHours());
|
|
341
|
-
now.setUTCSeconds(now.getSeconds());
|
|
342
|
-
setInputValue(now);
|
|
343
|
-
setOpen(false);
|
|
344
|
-
setTimeout(() => buttonEl?.focus());
|
|
345
|
-
onInputChange();
|
|
346
|
-
}, children: cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'second')) })] })] }))] }));
|
|
322
|
+
}, "aria-label": generatePickerButtonAriaLabel(currentlySelectedDateTime(), 'datetime', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: 'calendar' }) }), open && buttonEl && (_jsx(Dialog, { ref: setPopoverRef, target: buttonEl, placement: 'bottom-end', ariaLabel: t('choose_date_and_time'), children: _jsxs(Flex, { container: { direction: 'column' }, as: StyledDialogContent, children: [_jsx(DatePicker, { mode: 'datetime', selected: currentlySelectedDateTime(), onChange: selected => {
|
|
323
|
+
setInputValue(selected);
|
|
324
|
+
onInputChange();
|
|
325
|
+
}, min: min, max: max, showWeekNumber: showWeekNumber, pickerInterval: pickerInterval, withSeconds: withSeconds, clockFormat: clockFormat }), _jsxs(Flex, { as: StyledClearNowButtonsContainer, container: { justify: 'between' }, children: [_jsx(Button, { "aria-label": t('clear_current_date_and_time'), onClick: () => {
|
|
326
|
+
setInputValue(undefined);
|
|
327
|
+
setOpen(false);
|
|
328
|
+
setTimeout(() => buttonEl?.focus());
|
|
329
|
+
onInputChange();
|
|
330
|
+
}, children: t('clear') }), _jsx(Button, { "aria-label": t('set_current_date_and_time_a11y'), onClick: () => {
|
|
331
|
+
const now = new Date();
|
|
332
|
+
now.setUTCMinutes(now.getMinutes());
|
|
333
|
+
now.setUTCHours(now.getHours());
|
|
334
|
+
now.setUTCSeconds(now.getSeconds());
|
|
335
|
+
setInputValue(now);
|
|
336
|
+
setOpen(false);
|
|
337
|
+
setTimeout(() => buttonEl?.focus());
|
|
338
|
+
onInputChange();
|
|
339
|
+
}, children: cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'second')) })] })] }) }))] }));
|
|
347
340
|
const Comp = (_jsxs(Flex, { as: StyledDateTimeInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
348
341
|
if (e.target === containerRef.current)
|
|
349
342
|
orderedRefs[0].current?.focus();
|