@pega/cosmos-react-core 3.0.0-dev.8.0 → 3.0.0-rc.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/lib/components/Actions/Actions.d.ts +5 -0
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +2 -2
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +11 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.js +25 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -0
- package/lib/components/AdditionalInfo/index.d.ts +2 -0
- package/lib/components/AdditionalInfo/index.d.ts.map +1 -0
- package/lib/components/AdditionalInfo/index.js +2 -0
- package/lib/components/AdditionalInfo/index.js.map +1 -0
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +16 -8
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppHeader.styles.js +155 -0
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +88 -217
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +7 -48
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +48 -527
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +27 -21
- 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 +12 -6
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +10 -5
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +2 -2
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +3 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellList.styles.js +141 -0
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.d.ts +9 -0
- package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.js +39 -0
- package/lib/components/AppShell/AppShellSearch.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.js +193 -0
- package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
- package/lib/components/AppShell/Drawer.d.ts +3 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +14 -11
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
- package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
- package/lib/components/AppShell/Drawer.styles.js +153 -0
- package/lib/components/AppShell/Drawer.styles.js.map +1 -0
- package/lib/components/AppShell/NavigationList.d.ts +6 -0
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationList.js +121 -0
- package/lib/components/AppShell/NavigationList.js.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js +157 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
- package/lib/components/AppShell/Operator.js +4 -4
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +2 -3
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -2
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +4 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +37 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts +9 -0
- package/lib/components/Badges/Keyboard.d.ts.map +1 -0
- package/lib/components/Badges/Keyboard.js +56 -0
- package/lib/components/Badges/Keyboard.js.map +1 -0
- package/lib/components/Badges/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +4 -2
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/index.d.ts +2 -0
- package/lib/components/Badges/index.d.ts.map +1 -1
- package/lib/components/Badges/index.js +1 -0
- package/lib/components/Badges/index.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +8 -2
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +4 -12
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +44 -13
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
- package/lib/components/Button/BareRoleButton.js +3 -1
- package/lib/components/Button/BareRoleButton.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -1
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -0
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +1 -1
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +68 -13
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +11 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.d.ts +7 -0
- package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js +5 -2
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +116 -31
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +10 -0
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +5 -0
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.js +62 -0
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.styles.d.ts +5 -0
- package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.styles.js +57 -0
- package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +52 -0
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.types.js +2 -0
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -0
- package/lib/components/CompositeInput/index.d.ts +3 -0
- package/lib/components/CompositeInput/index.d.ts.map +1 -0
- package/lib/components/CompositeInput/index.js +2 -0
- package/lib/components/CompositeInput/index.js.map +1 -0
- package/lib/components/Configuration/Configuration.d.ts +14 -13
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +25 -14
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/index.d.ts +0 -1
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +0 -1
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +45 -0
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +6 -0
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -0
- package/lib/components/CreditCard/CreditCardInput.js +39 -0
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -0
- package/lib/components/CreditCard/index.d.ts +3 -1
- package/lib/components/CreditCard/index.d.ts.map +1 -1
- package/lib/components/CreditCard/index.js +2 -0
- package/lib/components/CreditCard/index.js.map +1 -1
- package/lib/components/CreditCard/utils.d.ts +11 -0
- package/lib/components/CreditCard/utils.d.ts.map +1 -1
- package/lib/components/CreditCard/utils.js +20 -2
- package/lib/components/CreditCard/utils.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js +2 -2
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +92 -25
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +9 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/Currency/utils.d.ts +7 -17
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/Currency/utils.js +50 -51
- package/lib/components/Currency/utils.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +15 -9
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +3 -3
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +9 -2
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +27 -15
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +18 -23
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +98 -83
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +28 -12
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +10 -2
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -0
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +30 -33
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js +5 -4
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +3 -0
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +23 -26
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +3 -0
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +24 -25
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +21 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +46 -0
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js +74 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -0
- package/lib/components/DateTime/Input/WeekInput.d.ts +3 -2
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +12 -7
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +6 -6
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +2 -1
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +20 -16
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -4
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +13 -55
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +2 -1
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +3 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.js +39 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -0
- package/lib/components/DateTime/Picker/DateRangePicker.js +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +10 -5
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +14 -6
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/index.d.ts +4 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +3 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +2 -2
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +18 -4
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +32 -0
- package/lib/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/components/Dialog/Dialog.js +149 -0
- package/lib/components/Dialog/Dialog.js.map +1 -0
- package/lib/components/Dialog/index.d.ts +3 -0
- package/lib/components/Dialog/index.d.ts.map +1 -0
- package/lib/components/Dialog/index.js +3 -0
- package/lib/components/Dialog/index.js.map +1 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts +7 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +45 -41
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +6 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +13 -7
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +41 -13
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +3 -5
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js +2 -4
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/utils.d.ts +1 -1
- package/lib/components/File/utils.d.ts.map +1 -1
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +11 -10
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +5 -16
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +14 -11
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +12 -2
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +60 -35
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +5 -0
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +87 -16
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +11 -10
- package/lib/components/Grid/Grid.types.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.js.map +1 -1
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js +61 -17
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Icon/Icon.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 -1
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/ai-assist.icon.js +1 -1
- package/lib/components/Icon/icons/ai-assist.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-center.icon.js +1 -1
- package/lib/components/Icon/icons/align-center.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-left.icon.js +1 -1
- package/lib/components/Icon/icons/align-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-right.icon.js +1 -1
- package/lib/components/Icon/icons/align-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-left.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-left.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-right.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-up-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-up-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-up.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-up-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-up-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/bars.icon.js +1 -1
- package/lib/components/Icon/icons/bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/bell-solid.icon.js +1 -1
- package/lib/components/Icon/icons/bell-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/bell.icon.js +1 -1
- package/lib/components/Icon/icons/bell.icon.js.map +1 -1
- package/lib/components/Icon/icons/box-4-solid.icon.js +1 -1
- package/lib/components/Icon/icons/box-4-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/box-4.icon.js +1 -1
- package/lib/components/Icon/icons/box-4.icon.js.map +1 -1
- package/lib/components/Icon/icons/calendar-range.icon.js +1 -1
- package/lib/components/Icon/icons/calendar-range.icon.js.map +1 -1
- package/lib/components/Icon/icons/calendar-solid.icon.js +1 -1
- package/lib/components/Icon/icons/calendar-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-down.icon.js +1 -1
- package/lib/components/Icon/icons/caret-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-left.icon.js +1 -1
- package/lib/components/Icon/icons/caret-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-right.icon.js +1 -1
- package/lib/components/Icon/icons/caret-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-up.icon.js +1 -1
- package/lib/components/Icon/icons/caret-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/{script-solid.icon.d.ts → carrot.icon.d.ts} +2 -2
- package/lib/components/Icon/icons/carrot.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/carrot.icon.js +6 -0
- package/lib/components/Icon/icons/carrot.icon.js.map +1 -0
- package/lib/components/Icon/icons/case-solid.icon.js +1 -1
- package/lib/components/Icon/icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/case.icon.js +1 -1
- package/lib/components/Icon/icons/case.icon.js.map +1 -1
- package/lib/components/Icon/icons/chain.icon.js +1 -1
- package/lib/components/Icon/icons/chain.icon.js.map +1 -1
- package/lib/components/Icon/icons/chat-solid.icon.js +1 -1
- package/lib/components/Icon/icons/chat-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/chat.icon.js +1 -1
- package/lib/components/Icon/icons/chat.icon.js.map +1 -1
- package/lib/components/Icon/icons/check.icon.js +1 -1
- package/lib/components/Icon/icons/check.icon.js.map +1 -1
- package/lib/components/Icon/icons/clipboard-plus-solid.icon.js +1 -1
- package/lib/components/Icon/icons/clipboard-plus-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/clipboard-plus.icon.js +1 -1
- package/lib/components/Icon/icons/clipboard-plus.icon.js.map +1 -1
- package/lib/components/Icon/icons/clock-solid.icon.js +1 -1
- package/lib/components/Icon/icons/clock-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/clock.icon.js +1 -1
- package/lib/components/Icon/icons/clock.icon.js.map +1 -1
- package/lib/components/Icon/icons/code.icon.js +1 -1
- package/lib/components/Icon/icons/code.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js +2 -2
- package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
- package/lib/components/Icon/icons/dock.icon.js +1 -1
- package/lib/components/Icon/icons/dock.icon.js.map +1 -1
- package/lib/components/Icon/icons/dot-9-solid.icon.js +1 -1
- package/lib/components/Icon/icons/dot-9-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dot-9.icon.js +1 -1
- package/lib/components/Icon/icons/dot-9.icon.js.map +1 -1
- package/lib/components/Icon/icons/download.icon.js +1 -1
- package/lib/components/Icon/icons/download.icon.js.map +1 -1
- package/lib/components/Icon/icons/drag.icon.js +1 -1
- package/lib/components/Icon/icons/drag.icon.js.map +1 -1
- package/lib/components/Icon/icons/eye-off-solid.icon.js +1 -1
- package/lib/components/Icon/icons/eye-off-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/eye-off.icon.js +1 -1
- package/lib/components/Icon/icons/eye-off.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-blank.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-blank.icon.js +1 -1
- package/lib/components/Icon/icons/face-blank.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-happy.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-happy.icon.js +1 -1
- package/lib/components/Icon/icons/face-happy.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-sad.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-sad.icon.js +1 -1
- package/lib/components/Icon/icons/face-sad.icon.js.map +1 -1
- package/lib/components/Icon/icons/fast-forward-solid.icon.js +1 -1
- package/lib/components/Icon/icons/fast-forward-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/filetype-text.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/filetype-text.icon.js +2 -2
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/filter-on.icon.js +1 -1
- package/lib/components/Icon/icons/filter-on.icon.js.map +1 -1
- package/lib/components/Icon/icons/filter.icon.js +1 -1
- package/lib/components/Icon/icons/filter.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-hierarchy.icon.js +1 -1
- package/lib/components/Icon/icons/folder-hierarchy.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-all-solid.icon.js +1 -1
- package/lib/components/Icon/icons/forward-all-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-all.icon.js +1 -1
- package/lib/components/Icon/icons/forward-all.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-solid.icon.js +1 -1
- package/lib/components/Icon/icons/forward-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward.icon.js +1 -1
- package/lib/components/Icon/icons/forward.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +2 -2
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/globe-solid.icon.js +1 -1
- package/lib/components/Icon/icons/globe-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/globe.icon.js +1 -1
- package/lib/components/Icon/icons/globe.icon.js.map +1 -1
- package/lib/components/Icon/icons/hand.icon.js +1 -1
- package/lib/components/Icon/icons/hand.icon.js.map +1 -1
- package/lib/components/Icon/icons/help-solid.icon.js +1 -1
- package/lib/components/Icon/icons/help-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/help.icon.js +1 -1
- package/lib/components/Icon/icons/help.icon.js.map +1 -1
- package/lib/components/Icon/icons/home-solid.icon.js +1 -1
- package/lib/components/Icon/icons/home-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/home.icon.js +1 -1
- package/lib/components/Icon/icons/home.icon.js.map +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/information.icon.js +1 -1
- package/lib/components/Icon/icons/information.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +2 -2
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +2 -2
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/mail-solid.icon.js +1 -1
- package/lib/components/Icon/icons/mail-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/mail.icon.js +1 -1
- package/lib/components/Icon/icons/mail.icon.js.map +1 -1
- package/lib/components/Icon/icons/minus.icon.js +1 -1
- package/lib/components/Icon/icons/minus.icon.js.map +1 -1
- package/lib/components/Icon/icons/more.icon.js +1 -1
- package/lib/components/Icon/icons/more.icon.js.map +1 -1
- package/lib/components/Icon/icons/move-left-solid.icon.js +1 -1
- package/lib/components/Icon/icons/move-left-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/move-right-solid.icon.js +1 -1
- package/lib/components/Icon/icons/move-right-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/open.icon.js +1 -1
- package/lib/components/Icon/icons/open.icon.js.map +1 -1
- package/lib/components/Icon/icons/paper-clip.icon.js +1 -1
- package/lib/components/Icon/icons/paper-clip.icon.js.map +1 -1
- package/lib/components/Icon/icons/phone-solid.icon.js +1 -1
- package/lib/components/Icon/icons/phone-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/phone.icon.js +1 -1
- package/lib/components/Icon/icons/phone.icon.js.map +1 -1
- package/lib/components/Icon/icons/picture-solid.icon.js +1 -1
- package/lib/components/Icon/icons/picture-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/picture.icon.js +1 -1
- package/lib/components/Icon/icons/picture.icon.js.map +1 -1
- package/lib/components/Icon/icons/placeholder.icon.d.ts +4 -0
- package/lib/components/Icon/icons/placeholder.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/placeholder.icon.js +6 -0
- package/lib/components/Icon/icons/placeholder.icon.js.map +1 -0
- package/lib/components/Icon/icons/plus.icon.js +1 -1
- package/lib/components/Icon/icons/plus.icon.js.map +1 -1
- package/lib/components/Icon/icons/polaris-solid.icon.js +1 -1
- package/lib/components/Icon/icons/polaris-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/polaris.icon.js +1 -1
- package/lib/components/Icon/icons/polaris.icon.js.map +1 -1
- package/lib/components/Icon/icons/qr.icon.js +1 -1
- package/lib/components/Icon/icons/qr.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-all-solid.icon.js +1 -1
- package/lib/components/Icon/icons/reply-all-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-all.icon.js +1 -1
- package/lib/components/Icon/icons/reply-all.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-solid.icon.js +1 -1
- package/lib/components/Icon/icons/reply-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply.icon.js +1 -1
- package/lib/components/Icon/icons/reply.icon.js.map +1 -1
- package/lib/components/Icon/icons/reset.icon.js +1 -1
- package/lib/components/Icon/icons/reset.icon.js.map +1 -1
- package/lib/components/Icon/icons/robot-happy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/robot-happy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/robot-happy.icon.js +1 -1
- package/lib/components/Icon/icons/robot-happy.icon.js.map +1 -1
- package/lib/components/Icon/icons/row-insert.icon.js +1 -1
- package/lib/components/Icon/icons/row-insert.icon.js.map +1 -1
- package/lib/components/Icon/icons/row.icon.js +1 -1
- package/lib/components/Icon/icons/row.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-down.icon.js +1 -1
- package/lib/components/Icon/icons/scale-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-up-solid.icon.js +1 -1
- package/lib/components/Icon/icons/scale-up-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-up.icon.js +1 -1
- package/lib/components/Icon/icons/scale-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/script.icon.js +1 -1
- package/lib/components/Icon/icons/script.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-analytics-solid.icon.js +1 -1
- package/lib/components/Icon/icons/search-analytics-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-analytics.icon.js +1 -1
- package/lib/components/Icon/icons/search-analytics.icon.js.map +1 -1
- package/lib/components/Icon/icons/search.icon.js +1 -1
- package/lib/components/Icon/icons/search.icon.js.map +1 -1
- package/lib/components/Icon/icons/send-solid.icon.js +1 -1
- package/lib/components/Icon/icons/send-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/send.icon.js +1 -1
- package/lib/components/Icon/icons/send.icon.js.map +1 -1
- package/lib/components/Icon/icons/slideshow-solid.icon.js +1 -1
- package/lib/components/Icon/icons/slideshow-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/slideshow.icon.js +1 -1
- package/lib/components/Icon/icons/slideshow.icon.js.map +1 -1
- package/lib/components/Icon/icons/snow.icon.js +1 -1
- package/lib/components/Icon/icons/snow.icon.js.map +1 -1
- package/lib/components/Icon/icons/speaker-solid.icon.js +1 -1
- package/lib/components/Icon/icons/speaker-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/speaker.icon.js +1 -1
- package/lib/components/Icon/icons/speaker.icon.js.map +1 -1
- package/lib/components/Icon/icons/star-solid.icon.js +1 -1
- package/lib/components/Icon/icons/star-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/star.icon.js +1 -1
- package/lib/components/Icon/icons/star.icon.js.map +1 -1
- package/lib/components/Icon/icons/target-solid.icon.js +1 -1
- package/lib/components/Icon/icons/target-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/target.icon.js +1 -1
- package/lib/components/Icon/icons/target.icon.js.map +1 -1
- package/lib/components/Icon/icons/thumbs-up-solid.icon.js +1 -1
- package/lib/components/Icon/icons/thumbs-up-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/thumbs-up.icon.js +1 -1
- package/lib/components/Icon/icons/thumbs-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/times.icon.js +1 -1
- package/lib/components/Icon/icons/times.icon.js.map +1 -1
- package/lib/components/Icon/icons/trash-solid.icon.js +1 -1
- package/lib/components/Icon/icons/trash-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/trash.icon.js +1 -1
- package/lib/components/Icon/icons/trash.icon.js.map +1 -1
- package/lib/components/Icon/icons/twitter.icon.js +1 -1
- package/lib/components/Icon/icons/twitter.icon.js.map +1 -1
- package/lib/components/Icon/icons/undock.icon.js +1 -1
- package/lib/components/Icon/icons/undock.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-solid.icon.js +1 -1
- package/lib/components/Icon/icons/user-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-star-solid.icon.js +1 -1
- package/lib/components/Icon/icons/user-star-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-star.icon.js +1 -1
- package/lib/components/Icon/icons/user-star.icon.js.map +1 -1
- package/lib/components/Icon/icons/user.icon.js +1 -1
- package/lib/components/Icon/icons/user.icon.js.map +1 -1
- package/lib/components/Icon/icons/warn-solid.icon.js +1 -1
- package/lib/components/Icon/icons/warn-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/warn.icon.js +1 -1
- package/lib/components/Icon/icons/warn.icon.js.map +1 -1
- package/lib/components/Icon/index.d.ts +1 -1
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +14 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.d.ts +1 -0
- package/lib/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/components/Input/Input.styles.js +31 -0
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Link/Link.d.ts +4 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +65 -26
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
- package/lib/components/List/CommaSeparatedList.js +6 -14
- package/lib/components/List/CommaSeparatedList.js.map +1 -1
- package/lib/components/List/List.d.ts +2 -2
- 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.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +108 -53
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +1 -0
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +38 -2
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +28 -10
- 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/PresetMenuPopover.d.ts +12 -0
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -0
- package/lib/components/ListToolbar/PresetMenuPopover.js +36 -0
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -0
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/QueryOptionPopover.js +14 -44
- package/lib/components/ListToolbar/QueryOptionPopover.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +3 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +2 -2
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +16 -10
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.d.ts +3 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +17 -9
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +10 -6
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +4 -2
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +13 -0
- 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/MenuGroup.d.ts.map +1 -1
- package/lib/components/Menu/MenuGroup.js +3 -3
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +4 -8
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +23 -14
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts +2 -2
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +12 -7
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +7 -7
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/index.d.ts +1 -1
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -1
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +13 -10
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js +2 -3
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +1 -2
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +3 -5
- package/lib/components/Modal/MinimizedModal.js.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.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +1 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +2 -6
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js +1 -2
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts +8 -2
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +14 -20
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/Modal/index.d.ts +0 -1
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +0 -1
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.d.ts +10 -0
- package/lib/components/MultiStepForm/FormProgress.d.ts.map +1 -0
- package/lib/components/{MultiStep/MultiStep.js → MultiStepForm/FormProgress.js} +8 -22
- package/lib/components/MultiStepForm/FormProgress.js.map +1 -0
- package/lib/components/{MultiStep/MultiStep.styles.d.ts → MultiStepForm/FormProgress.styles.d.ts} +2 -4
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -0
- package/lib/components/{MultiStep/MultiStep.styles.js → MultiStepForm/FormProgress.styles.js} +3 -4
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.d.ts +9 -0
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.js +50 -0
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +48 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.js +2 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -0
- package/lib/components/MultiStepForm/index.d.ts +2 -0
- package/lib/components/MultiStepForm/index.d.ts.map +1 -0
- package/lib/components/MultiStepForm/index.js +2 -0
- package/lib/components/MultiStepForm/index.js.map +1 -0
- package/lib/components/Number/NumberDisplay.d.ts +0 -5
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +8 -12
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +70 -40
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +8 -5
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.styles.js +6 -3
- package/lib/components/Number/NumberInput.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +56 -19
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +6 -0
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -0
- package/lib/components/Number/NumberRangeInput.js +30 -0
- package/lib/components/Number/NumberRangeInput.js.map +1 -0
- package/lib/components/Number/index.d.ts +3 -2
- package/lib/components/Number/index.d.ts.map +1 -1
- package/lib/components/Number/index.js +1 -0
- package/lib/components/Number/index.js.map +1 -1
- package/lib/components/Number/utils.d.ts +4 -5
- package/lib/components/Number/utils.d.ts.map +1 -1
- package/lib/components/Number/utils.js +47 -41
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +1 -4
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -2
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +29 -36
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.d.ts +1 -2
- package/lib/components/Phone/utils.d.ts.map +1 -1
- package/lib/components/Phone/utils.js +3 -26
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +0 -6
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +12 -57
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +3 -1
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -0
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +2 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +3 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/index.js +1 -1
- package/lib/components/RadioCheckGroup/index.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +24 -8
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +127 -94
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +16 -0
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/lib/components/SearchInput/SearchInput.styles.js +129 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -0
- package/lib/components/SearchInput/index.d.ts +1 -1
- package/lib/components/SearchInput/index.d.ts.map +1 -1
- package/lib/components/SearchInput/index.js +1 -1
- package/lib/components/SearchInput/index.js.map +1 -1
- package/lib/components/Select/Select.d.ts +4 -0
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +5 -3
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js +2 -2
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.d.ts +15 -0
- package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -0
- package/lib/components/SkipLinks/SkipLinks.js +67 -0
- package/lib/components/SkipLinks/SkipLinks.js.map +1 -0
- package/lib/components/SkipLinks/index.d.ts +4 -0
- package/lib/components/SkipLinks/index.d.ts.map +1 -0
- package/lib/components/SkipLinks/index.js +3 -0
- package/lib/components/SkipLinks/index.js.map +1 -0
- package/lib/components/Slider/Slider.styles.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +6 -2
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +0 -1
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +1 -7
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Text/Text.js +2 -2
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +5 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Context.d.ts +7 -0
- package/lib/components/Toaster/Context.d.ts.map +1 -0
- package/lib/components/Toaster/Context.js +6 -0
- package/lib/components/Toaster/Context.js.map +1 -0
- package/lib/components/Toaster/Toaster.d.ts +8 -40
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +12 -12
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +31 -0
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -0
- package/lib/components/Toaster/Toaster.types.js +2 -0
- package/lib/components/Toaster/Toaster.types.js.map +1 -0
- package/lib/components/Toaster/index.d.ts +1 -2
- package/lib/components/Toaster/index.d.ts.map +1 -1
- package/lib/components/Toaster/index.js +0 -1
- package/lib/components/Toaster/index.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +23 -5
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js +27 -13
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js +3 -3
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/StandardTree.types.d.ts +1 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.types.js.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +5 -1
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +174 -93
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +14 -6
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts +3 -2
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +10 -13
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useConfiguration.d.ts +1 -0
- package/lib/hooks/useConfiguration.d.ts.map +1 -1
- package/lib/hooks/useConfiguration.js +9 -2
- package/lib/hooks/useConfiguration.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +1 -1
- package/lib/hooks/useDraggable.d.ts.map +1 -1
- package/lib/hooks/useDraggable.js +4 -2
- package/lib/hooks/useDraggable.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +0 -8
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +130 -34
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useI18n.js +2 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useInputFormatter.d.ts +12 -0
- package/lib/hooks/useInputFormatter.d.ts.map +1 -0
- package/lib/hooks/useInputFormatter.js +89 -0
- package/lib/hooks/useInputFormatter.js.map +1 -0
- package/lib/hooks/useLongPress.d.ts +1 -1
- package/lib/hooks/useLongPress.d.ts.map +1 -1
- package/lib/hooks/useModalContext.d.ts +7 -0
- package/lib/hooks/useModalContext.d.ts.map +1 -0
- package/lib/hooks/useModalContext.js +12 -0
- package/lib/hooks/useModalContext.js.map +1 -0
- package/lib/hooks/useModalManager.d.ts +8 -0
- package/lib/hooks/useModalManager.d.ts.map +1 -0
- package/lib/hooks/useModalManager.js +16 -0
- package/lib/hooks/useModalManager.js.map +1 -0
- package/lib/hooks/useOS.d.ts +7 -0
- package/lib/hooks/useOS.d.ts.map +1 -0
- package/lib/hooks/useOS.js +27 -0
- package/lib/hooks/useOS.js.map +1 -0
- package/lib/hooks/useScrollStick.d.ts +1 -1
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/hooks/useToaster.d.ts +8 -0
- package/lib/hooks/useToaster.d.ts.map +1 -0
- package/lib/hooks/useToaster.js +16 -0
- package/lib/hooks/useToaster.js.map +1 -0
- package/lib/hooks/useTransitionState.js +1 -1
- package/lib/hooks/useTransitionState.js.map +1 -1
- package/lib/i18n/default.d.ts +130 -34
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +153 -47
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +126 -698
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.d.ts +3 -0
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js.map +1 -1
- package/lib/index.d.ts +9 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +1 -1
- package/lib/init.d.ts +8 -0
- package/lib/init.d.ts.map +1 -0
- package/lib/init.js +5 -0
- package/lib/init.js.map +1 -0
- package/lib/register-contexts.d.ts +2 -0
- package/lib/register-contexts.d.ts.map +1 -0
- package/lib/register-contexts.js +10 -0
- package/lib/register-contexts.js.map +1 -0
- package/lib/styles/gradients.d.ts +4 -1
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js +46 -3
- package/lib/styles/gradients.js.map +1 -1
- package/lib/styles/utils.d.ts +1 -1
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts +11 -3
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js +28 -26
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +72 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +43 -1
- package/lib/theme/themeOverrides.schema.json +9 -0
- package/lib/theme/themes/buildTheme.json +0 -3
- package/lib/theme/themes/darkTheme.json +9 -1
- package/lib/theme/themes/legacyBuildTheme.json +0 -3
- package/lib/theme/themes/wssTheme.json +6 -0
- package/lib/types/types.d.ts +3 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +5 -0
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +23 -0
- package/lib/utils/utils.js.map +1 -1
- package/package.json +11 -6
- package/lib/components/AppShell/SkipNavigation.d.ts +0 -4
- package/lib/components/AppShell/SkipNavigation.d.ts.map +0 -1
- package/lib/components/AppShell/SkipNavigation.js +0 -61
- package/lib/components/AppShell/SkipNavigation.js.map +0 -1
- package/lib/components/Currency/currencyCodes.d.ts +0 -3
- package/lib/components/Currency/currencyCodes.d.ts.map +0 -1
- package/lib/components/Currency/currencyCodes.js +0 -182
- package/lib/components/Currency/currencyCodes.js.map +0 -1
- package/lib/components/DateTime/types.d.ts +0 -9
- package/lib/components/DateTime/types.d.ts.map +0 -1
- package/lib/components/DateTime/types.js +0 -2
- package/lib/components/DateTime/types.js.map +0 -1
- package/lib/components/Icon/icons/script-solid.icon.d.ts.map +0 -1
- package/lib/components/Icon/icons/script-solid.icon.js +0 -6
- package/lib/components/Icon/icons/script-solid.icon.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.d.ts +0 -6
- package/lib/components/MultiStep/MultiStep.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.styles.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.styles.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +0 -36
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.types.js +0 -2
- package/lib/components/MultiStep/MultiStep.types.js.map +0 -1
- package/lib/components/MultiStep/index.d.ts +0 -3
- package/lib/components/MultiStep/index.d.ts.map +0 -1
- package/lib/components/MultiStep/index.js +0 -2
- package/lib/components/MultiStep/index.js.map +0 -1
|
@@ -72,7 +72,7 @@ const convertToCallbackParameter = (date, parts, meridiem) => {
|
|
|
72
72
|
};
|
|
73
73
|
const TimeInput = forwardRef((props, ref) => {
|
|
74
74
|
const { locale } = useConfiguration();
|
|
75
|
-
const { defaultValue, value = defaultValue, id, label, labelHidden, status, withSeconds = false, pickerInterval = 30, clockFormat, info = getDateFormat(locale, getTimeOptions(withSeconds), true).join(''), required, readOnly, disabled, onChange, onFocus, onBlur, autoFocus, ...restProps } = props;
|
|
75
|
+
const { defaultValue, value = defaultValue, id, label, labelHidden, status, withSeconds = false, pickerInterval = 30, clockFormat, info = getDateFormat(locale, getTimeOptions(withSeconds), true).join(''), required, readOnly, disabled, onChange, onFocus, onBlur, onResolveSuggestion, autoFocus, additionalInfo, ...restProps } = props;
|
|
76
76
|
const date = value !== undefined ? parseToDate(value) : undefined;
|
|
77
77
|
const is12h = clockFormat ? clockFormat === 12 : is12HClockFormat(locale);
|
|
78
78
|
const [meridiem, setMeridiem] = useState(is12h ? () => (date ? getMeridiem(date.getUTCHours()) : 'AM') : undefined);
|
|
@@ -99,6 +99,7 @@ const TimeInput = forwardRef((props, ref) => {
|
|
|
99
99
|
: undefined;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
+
const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();
|
|
102
103
|
const inputContainerRef = useRef(null);
|
|
103
104
|
const onFocusChange = (focused) => {
|
|
104
105
|
const currentMeridiem = meridiemSelectRef.current?.value || undefined;
|
|
@@ -109,6 +110,7 @@ const TimeInput = forwardRef((props, ref) => {
|
|
|
109
110
|
if (inputContainerRef.current)
|
|
110
111
|
inputContainerRef.current.scrollTop = 0;
|
|
111
112
|
onBlur?.(callbackParam);
|
|
113
|
+
setOpen(false);
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
116
|
const onInputChange = () => {
|
|
@@ -116,15 +118,15 @@ const TimeInput = forwardRef((props, ref) => {
|
|
|
116
118
|
onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts(), is12h ? currentMeridiem : undefined));
|
|
117
119
|
};
|
|
118
120
|
const t = useI18n();
|
|
121
|
+
const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });
|
|
119
122
|
const hour = date && is12h ? convertTo12h(date.getUTCHours()) : date?.getUTCHours();
|
|
120
|
-
const HourInput = (_jsx(PartInput, { placeholder: t('hour_placeholder'), "aria-label":
|
|
121
|
-
const MinuteInput = (_jsx(PartInput, { placeholder: t('minute_placeholder'), "aria-label":
|
|
122
|
-
const SecondInput = (_jsx(PartInput, { placeholder: t('second_placeholder'), "aria-label":
|
|
123
|
-
const Period = (_jsxs(Select, { ref: meridiemSelectRef, "aria-label":
|
|
123
|
+
const HourInput = (_jsx(PartInput, { placeholder: t('hour_placeholder'), "aria-label": displayNames.of('hour'), value: hour, onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: is12h ? 1 : 0, max: is12h ? 12 : 23, ref: hourInputRef, autoFocus: autoFocus }, 'hour'));
|
|
124
|
+
const MinuteInput = (_jsx(PartInput, { placeholder: t('minute_placeholder'), "aria-label": displayNames.of('minute'), value: date?.getUTCMinutes(), onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, max: 59, ref: minuteInputRef }, 'minute'));
|
|
125
|
+
const SecondInput = (_jsx(PartInput, { placeholder: t('second_placeholder'), "aria-label": displayNames.of('second'), value: date?.getUTCSeconds(), onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, max: 59, ref: secondInputRef }, 'second'));
|
|
126
|
+
const Period = (_jsxs(Select, { ref: meridiemSelectRef, "aria-label": displayNames.of('dayPeriod'), value: meridiem, required: required, disabled: disabled, onChange: (ev) => {
|
|
124
127
|
setMeridiem(ev.target.value);
|
|
125
128
|
onInputChange();
|
|
126
129
|
}, readOnly: readOnly, children: [_jsx(Option, { value: 'AM', children: t('meridiem_value_am') }), _jsx(Option, { value: 'PM', children: t('meridiem_value_pm') })] }, 'period'));
|
|
127
|
-
const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();
|
|
128
130
|
const containerRef = useConsolidatedRef(ref);
|
|
129
131
|
useFocusWithin([containerRef], onFocusChange);
|
|
130
132
|
const Picker = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": t(open ? 'close_time_button_a11y' : 'open_time_button_a11y'), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: open ? 'times' : 'clock' }) }), _jsx(Popover, { show: open, ref: setPopoverRef, target: containerRef.current, placement: 'bottom-end', strategy: 'fixed', modifiers: [
|
|
@@ -150,10 +152,10 @@ const TimeInput = forwardRef((props, ref) => {
|
|
|
150
152
|
}
|
|
151
153
|
setMeridiem(getMeridiem(selected.getUTCHours()));
|
|
152
154
|
setOpen(false);
|
|
153
|
-
buttonEl?.focus();
|
|
155
|
+
setTimeout(() => buttonEl?.focus());
|
|
154
156
|
onInputChange();
|
|
155
157
|
}, clockFormat: clockFormat }) })] }));
|
|
156
|
-
const Comp = (_jsxs(Flex, { as: StyledTimeInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
158
|
+
const Comp = (_jsxs(Flex, { as: StyledTimeInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
157
159
|
if (e.target === containerRef.current)
|
|
158
160
|
hourInputRef.current?.focus();
|
|
159
161
|
}, ...restProps, children: [_jsx(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, children: getDateFormat(locale, getTimeOptions(withSeconds, is12h)).map(part => {
|
|
@@ -171,7 +173,17 @@ const TimeInput = forwardRef((props, ref) => {
|
|
|
171
173
|
return part;
|
|
172
174
|
}
|
|
173
175
|
}) }), !readOnly && Picker] }));
|
|
174
|
-
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{
|
|
176
|
+
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{
|
|
177
|
+
label,
|
|
178
|
+
labelHidden,
|
|
179
|
+
id,
|
|
180
|
+
info,
|
|
181
|
+
status,
|
|
182
|
+
required,
|
|
183
|
+
disabled,
|
|
184
|
+
onResolveSuggestion,
|
|
185
|
+
additionalInfo
|
|
186
|
+
}, ref: ref, children: Comp })) : (Comp);
|
|
175
187
|
});
|
|
176
188
|
export default TimeInput;
|
|
177
189
|
//# sourceMappingURL=TimeInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,MAAM,EACN,QAAQ,EAER,UAAU,EAGX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,UAA8B,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM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AAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACpE,QAAQ,IAAI,EAAE;wBACZ,KAAK,IAAI;4BACP,OAAO,SAAS,CAAC;wBACnB,KAAK,IAAI;4BACP,OAAO,WAAW,CAAC;wBACrB,KAAK,IAAI;4BACP,OAAO,WAAW,CAAC;wBACrB,KAAK,IAAI,CAAC;wBACV,KAAK,IAAI;4BACP,OAAO,MAAM,CAAC;wBAChB;4BACE,OAAO,IAAI,CAAC;qBACf;gBACH,CAAC,CAAC,GACG,EACN,CAAC,QAAQ,IAAI,MAAM,IACf,CACR,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,EAAE,EAAC,UAAU,EACb,OAAO,EAAC,QAAQ,KACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAChE,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 FunctionComponent,\n useRef,\n useState,\n ChangeEvent,\n forwardRef,\n Ref,\n PropsWithoutRef\n} from 'react';\nimport styled from 'styled-components';\n\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Select, { Option } from '../../Select';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as clockIcon from '../../Icon/icons/clock.icon';\nimport Popover from '../../Popover';\nimport TimePicker, { MinuteInterval } from '../Picker/TimePicker';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\nimport { sameWidth } from '../../Popover/modifiers';\n\nimport {\n getDateFormat,\n parseToDate,\n is12HClockFormat,\n validateTime,\n ClockFormat,\n getTimeOptions\n} from './utils';\nimport StyledDateTime, { StyledInputContainer } from './DateTime.styles';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\n\nregisterIcon(timesIcon, clockIcon);\n\nexport interface TimeInputProps extends DateTimeProps {\n /**\n * Display the time with seconds.\n * @default false\n */\n withSeconds?: boolean;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n pickerInterval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nexport const StyledTimeInput = styled(StyledDateTime)<TimeInputProps>`\n padding-inline-end: 0;\n`;\n\nfunction getMeridiem(hour: number) {\n return hour >= 12 ? 'PM' : 'AM';\n}\n\nconst convertTo12h = (hour: number) => {\n let converted: number = hour;\n if (hour > 12) converted = hour - 12;\n else if (hour === 0) converted = 12;\n return converted;\n};\n\nconst convertTo24h = (hour: number, meridiem: string) => {\n let converted: number = hour;\n if (meridiem === 'PM' && hour < 12) converted = hour + 12;\n else if (meridiem === 'AM' && hour === 12) converted = 0;\n return converted;\n};\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[],\n meridiem?: string\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [hour, minute, second = date.getUTCSeconds()] = parts.map(Number);\n\n const is12h = meridiem !== undefined;\n\n if (!validateTime(hour, minute, second, is12h)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCHours(is12h ? convertTo24h(hour, meridiem!) : hour, minute, second);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst TimeInput: FunctionComponent<TimeInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<TimeInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n id,\n label,\n labelHidden,\n status,\n withSeconds = false,\n pickerInterval = 30,\n clockFormat,\n info = getDateFormat(locale, getTimeOptions(withSeconds), true).join(''),\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n ...restProps\n } = props;\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const is12h = clockFormat ? clockFormat === 12 : is12HClockFormat(locale);\n const [meridiem, setMeridiem] = useState<'AM' | 'PM' | undefined>(\n is12h ? () => (date ? getMeridiem(date.getUTCHours()) : 'AM') : undefined\n );\n\n const [hourInputRef, minuteInputRef, secondInputRef, meridiemSelectRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLSelectElement>(null)\n ];\n\n useAutoFocusNextInput([hourInputRef, minuteInputRef, secondInputRef]);\n\n const pickParts = () => {\n return [\n hourInputRef.current?.value || undefined,\n minuteInputRef.current?.value || undefined\n ].concat(withSeconds ? [secondInputRef.current?.value] : []);\n };\n\n const currentlySelectedTime = () => {\n const parts = pickParts();\n\n if (parts.every(Boolean)) {\n const [hour, minute, second = 0] = parts.map(Number);\n const current = date ?? new Date();\n return validateTime(hour, minute, second, is12h)\n ? new Date(\n current.setUTCHours(is12h ? convertTo24h(hour, meridiem!) : hour, minute, second)\n )\n : undefined;\n }\n };\n\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const onFocusChange = (focused: boolean) => {\n const currentMeridiem = meridiemSelectRef.current?.value || undefined;\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts(),\n is12h ? currentMeridiem : undefined\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 const currentMeridiem = meridiemSelectRef.current?.value || undefined;\n onChange?.(\n convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts(),\n is12h ? currentMeridiem : undefined\n )\n );\n };\n\n const t = useI18n();\n\n const hour = date && is12h ? convertTo12h(date.getUTCHours()) : date?.getUTCHours();\n const HourInput = (\n <PartInput\n key='hour'\n placeholder={t('hour_placeholder')}\n aria-label={t('hour_label_a11y')}\n value={hour}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={is12h ? 1 : 0}\n max={is12h ? 12 : 23}\n ref={hourInputRef}\n autoFocus={autoFocus}\n />\n );\n\n const MinuteInput = (\n <PartInput\n key='minute'\n placeholder={t('minute_placeholder')}\n aria-label={t('minute_label_a11y')}\n value={date?.getUTCMinutes()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={minuteInputRef}\n />\n );\n\n const SecondInput = (\n <PartInput\n key='second'\n placeholder={t('second_placeholder')}\n aria-label={t('second_label_a11y')}\n value={date?.getUTCSeconds()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={secondInputRef}\n />\n );\n\n const Period = (\n <Select\n ref={meridiemSelectRef}\n aria-label={t('meridiem_label_a11y')}\n key='period'\n value={meridiem}\n required={required}\n disabled={disabled}\n onChange={(ev: ChangeEvent<HTMLSelectElement>) => {\n setMeridiem(ev.target.value as 'AM' | 'PM');\n onInputChange();\n }}\n readOnly={readOnly}\n >\n <Option value='AM'>{t('meridiem_value_am')}</Option>\n <Option value='PM'>{t('meridiem_value_pm')}</Option>\n </Select>\n );\n\n const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const Picker = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={t(open ? 'close_time_button_a11y' : 'open_time_button_a11y')}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'clock'} />\n </Button>\n\n <Popover\n show={open}\n ref={setPopoverRef}\n target={containerRef.current}\n placement='bottom-end'\n strategy='fixed'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end']\n }\n },\n sameWidth\n ]}\n >\n <TimePicker\n selected={currentlySelectedTime()}\n interval={pickerInterval}\n onSelect={selected => {\n hourInputRef.current!.value = (\n is12h ? convertTo12h(selected.getUTCHours()) : selected.getUTCHours()\n )\n .toString()\n .padStart(2, '0');\n minuteInputRef.current!.value = selected.getUTCMinutes().toString().padStart(2, '0');\n if (withSeconds)\n secondInputRef.current!.value = selected\n .getUTCSeconds()\n .toString()\n .padStart(2, '0');\n if (meridiemSelectRef.current) {\n meridiemSelectRef.current!.value = getMeridiem(selected.getUTCHours());\n }\n setMeridiem(getMeridiem(selected.getUTCHours()));\n setOpen(false);\n buttonEl?.focus();\n onInputChange();\n }}\n clockFormat={clockFormat}\n />\n </Popover>\n </>\n );\n\n const Comp = (\n <Flex\n as={StyledTimeInput}\n forwardedAs={StyledFormControl}\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) hourInputRef.current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n >\n {getDateFormat(locale, getTimeOptions(withSeconds, is12h)).map(part => {\n switch (part) {\n case 'hh':\n return HourInput;\n case 'mm':\n return MinuteInput;\n case 'ss':\n return SecondInput;\n case 'AM':\n case 'PM':\n return Period;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && Picker}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default TimeInput;\n"]}
|
|
1
|
+
{"version":3,"file":"TimeInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,MAAM,EACN,QAAQ,EAER,UAAU,EAGX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,UAA8B,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAoB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EAEZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,EAAE,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,YAAY,CAAC,SAAS,EAAE,S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M,EAAE,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACpE,QAAQ,IAAI,EAAE;wBACZ,KAAK,IAAI;4BACP,OAAO,SAAS,CAAC;wBACnB,KAAK,IAAI;4BACP,OAAO,WAAW,CAAC;wBACrB,KAAK,IAAI;4BACP,OAAO,WAAW,CAAC;wBACrB,KAAK,IAAI,CAAC;wBACV,KAAK,IAAI;4BACP,OAAO,MAAM,CAAC;wBAChB;4BACE,OAAO,IAAI,CAAC;qBACf;gBACH,CAAC,CAAC,GACG,EACN,CAAC,QAAQ,IAAI,MAAM,IACf,CACR,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,EAAE,EAAC,UAAU,EACb,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 FunctionComponent,\n useRef,\n useState,\n ChangeEvent,\n forwardRef,\n Ref,\n PropsWithoutRef\n} from 'react';\nimport styled from 'styled-components';\n\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Select, { Option } from '../../Select';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as clockIcon from '../../Icon/icons/clock.icon';\nimport Popover from '../../Popover';\nimport TimePicker, { MinuteInterval } from '../Picker/TimePicker';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { FormControlProps, StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\nimport { sameWidth } from '../../Popover/modifiers';\n\nimport {\n getDateFormat,\n parseToDate,\n is12HClockFormat,\n validateTime,\n ClockFormat,\n getTimeOptions\n} from './utils';\nimport StyledDateTime, { StyledInputContainer } from './DateTime.styles';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\n\nregisterIcon(timesIcon, clockIcon);\n\nexport interface TimeInputProps extends DateTimeProps {\n /**\n * Display the time with seconds.\n * @default false\n */\n withSeconds?: boolean;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n pickerInterval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n}\n\nexport const StyledTimeInput = styled(StyledDateTime)<TimeInputProps>`\n padding-inline-end: 0;\n`;\n\nfunction getMeridiem(hour: number) {\n return hour >= 12 ? 'PM' : 'AM';\n}\n\nconst convertTo12h = (hour: number) => {\n let converted: number = hour;\n if (hour > 12) converted = hour - 12;\n else if (hour === 0) converted = 12;\n return converted;\n};\n\nconst convertTo24h = (hour: number, meridiem: string) => {\n let converted: number = hour;\n if (meridiem === 'PM' && hour < 12) converted = hour + 12;\n else if (meridiem === 'AM' && hour === 12) converted = 0;\n return converted;\n};\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[],\n meridiem?: string\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [hour, minute, second = date.getUTCSeconds()] = parts.map(Number);\n\n const is12h = meridiem !== undefined;\n\n if (!validateTime(hour, minute, second, is12h)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCHours(is12h ? convertTo24h(hour, meridiem!) : hour, minute, second);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst TimeInput: FunctionComponent<TimeInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<TimeInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n id,\n label,\n labelHidden,\n status,\n withSeconds = false,\n pickerInterval = 30,\n clockFormat,\n info = getDateFormat(locale, getTimeOptions(withSeconds), true).join(''),\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n autoFocus,\n additionalInfo,\n ...restProps\n } = props;\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const is12h = clockFormat ? clockFormat === 12 : is12HClockFormat(locale);\n const [meridiem, setMeridiem] = useState<'AM' | 'PM' | undefined>(\n is12h ? () => (date ? getMeridiem(date.getUTCHours()) : 'AM') : undefined\n );\n\n const [hourInputRef, minuteInputRef, secondInputRef, meridiemSelectRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLSelectElement>(null)\n ];\n\n useAutoFocusNextInput([hourInputRef, minuteInputRef, secondInputRef]);\n\n const pickParts = () => {\n return [\n hourInputRef.current?.value || undefined,\n minuteInputRef.current?.value || undefined\n ].concat(withSeconds ? [secondInputRef.current?.value] : []);\n };\n\n const currentlySelectedTime = () => {\n const parts = pickParts();\n\n if (parts.every(Boolean)) {\n const [hour, minute, second = 0] = parts.map(Number);\n const current = date ?? new Date();\n return validateTime(hour, minute, second, is12h)\n ? new Date(\n current.setUTCHours(is12h ? convertTo24h(hour, meridiem!) : hour, minute, second)\n )\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 currentMeridiem = meridiemSelectRef.current?.value || undefined;\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts(),\n is12h ? currentMeridiem : undefined\n );\n if (onFocus && focused) onFocus(callbackParam);\n if (!focused) {\n if (inputContainerRef.current) inputContainerRef.current.scrollTop = 0;\n onBlur?.(callbackParam);\n setOpen(false);\n }\n };\n\n const onInputChange = () => {\n const currentMeridiem = meridiemSelectRef.current?.value || undefined;\n onChange?.(\n convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts(),\n is12h ? currentMeridiem : undefined\n )\n );\n };\n\n const t = useI18n();\n\n const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });\n\n const hour = date && is12h ? convertTo12h(date.getUTCHours()) : date?.getUTCHours();\n const HourInput = (\n <PartInput\n key='hour'\n placeholder={t('hour_placeholder')}\n aria-label={displayNames.of('hour')}\n value={hour}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={is12h ? 1 : 0}\n max={is12h ? 12 : 23}\n ref={hourInputRef}\n autoFocus={autoFocus}\n />\n );\n\n const MinuteInput = (\n <PartInput\n key='minute'\n placeholder={t('minute_placeholder')}\n aria-label={displayNames.of('minute')}\n value={date?.getUTCMinutes()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={minuteInputRef}\n />\n );\n\n const SecondInput = (\n <PartInput\n key='second'\n placeholder={t('second_placeholder')}\n aria-label={displayNames.of('second')}\n value={date?.getUTCSeconds()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={secondInputRef}\n />\n );\n\n const Period = (\n <Select\n ref={meridiemSelectRef}\n aria-label={displayNames.of('dayPeriod')}\n key='period'\n value={meridiem}\n required={required}\n disabled={disabled}\n onChange={(ev: ChangeEvent<HTMLSelectElement>) => {\n setMeridiem(ev.target.value as 'AM' | 'PM');\n onInputChange();\n }}\n readOnly={readOnly}\n >\n <Option value='AM'>{t('meridiem_value_am')}</Option>\n <Option value='PM'>{t('meridiem_value_pm')}</Option>\n </Select>\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const Picker = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={t(open ? 'close_time_button_a11y' : 'open_time_button_a11y')}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'clock'} />\n </Button>\n\n <Popover\n show={open}\n ref={setPopoverRef}\n target={containerRef.current}\n placement='bottom-end'\n strategy='fixed'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end']\n }\n },\n sameWidth\n ]}\n >\n <TimePicker\n selected={currentlySelectedTime()}\n interval={pickerInterval}\n onSelect={selected => {\n hourInputRef.current!.value = (\n is12h ? convertTo12h(selected.getUTCHours()) : selected.getUTCHours()\n )\n .toString()\n .padStart(2, '0');\n minuteInputRef.current!.value = selected.getUTCMinutes().toString().padStart(2, '0');\n if (withSeconds)\n secondInputRef.current!.value = selected\n .getUTCSeconds()\n .toString()\n .padStart(2, '0');\n if (meridiemSelectRef.current) {\n meridiemSelectRef.current!.value = getMeridiem(selected.getUTCHours());\n }\n setMeridiem(getMeridiem(selected.getUTCHours()));\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n clockFormat={clockFormat}\n />\n </Popover>\n </>\n );\n\n const Comp = (\n <Flex\n as={StyledTimeInput}\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) hourInputRef.current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n >\n {getDateFormat(locale, getTimeOptions(withSeconds, is12h)).map(part => {\n switch (part) {\n case 'hh':\n return HourInput;\n case 'mm':\n return MinuteInput;\n case 'ss':\n return SecondInput;\n case 'AM':\n case 'PM':\n return Period;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && Picker}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\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 TimeInput;\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { FormControlProps } from '../../FormControl';
|
|
3
|
+
import DateTimeProps, { DateRangeCallbackParameter, DateTimeProperties } from '../DateTime.types';
|
|
4
|
+
import { ForwardProps } from '../../../types';
|
|
5
|
+
import { MinuteInterval } from '../Picker/TimePicker';
|
|
6
|
+
import { ClockFormat } from './utils';
|
|
7
|
+
export interface TimeRangeInputProps extends DateTimeProperties {
|
|
8
|
+
/** Object of range boundaries. */
|
|
9
|
+
value?: {
|
|
10
|
+
start?: DateTimeProps['value'];
|
|
11
|
+
end?: DateTimeProps['value'];
|
|
12
|
+
};
|
|
13
|
+
/** Callback fired when inputs value changes. */
|
|
14
|
+
onChange: (value: DateRangeCallbackParameter) => void;
|
|
15
|
+
/** Callback fired when the component gets focused. */
|
|
16
|
+
onFocus?: (value: DateRangeCallbackParameter) => void;
|
|
17
|
+
/** Callback fired when the component loses focus. */
|
|
18
|
+
onBlur?: (value: DateRangeCallbackParameter) => void;
|
|
19
|
+
/** Pass a string or a fragment with an Icon and string for first part of TimeRangeInput. */
|
|
20
|
+
fromLabel?: FormControlProps['label'];
|
|
21
|
+
/** Pass a string or a fragment with an Icon and string for second part of TimeRangeInput. */
|
|
22
|
+
toLabel?: FormControlProps['label'];
|
|
23
|
+
/** Pass an object with "heading" and "content" properties to show AdditionalInfo for second part of DataRangeInput. */
|
|
24
|
+
toAdditionalInfo?: FormControlProps['additionalInfo'];
|
|
25
|
+
/** Pass an object with "heading" and "content" properties to show AdditionalInfo for first part of DataRangeInput. */
|
|
26
|
+
fromAdditionalInfo?: FormControlProps['additionalInfo'];
|
|
27
|
+
/** Controls which input is displayed */
|
|
28
|
+
mode: 'time' | 'datetime';
|
|
29
|
+
/**
|
|
30
|
+
* Display the time with seconds.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
withSeconds?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Defines interval for time picker options (in minutes).
|
|
36
|
+
* @default 30
|
|
37
|
+
*/
|
|
38
|
+
pickerInterval?: MinuteInterval;
|
|
39
|
+
/**
|
|
40
|
+
* Defines clock format that overrides locale based format
|
|
41
|
+
*/
|
|
42
|
+
clockFormat?: ClockFormat;
|
|
43
|
+
}
|
|
44
|
+
declare const TimeRangeInput: FunctionComponent<TimeRangeInputProps & ForwardProps>;
|
|
45
|
+
export default TimeRangeInput;
|
|
46
|
+
//# sourceMappingURL=TimeRangeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeRangeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeRangeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,aAAa,EAAE,EACpB,0BAA0B,EAE1B,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AAInD,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,kCAAkC;IAClC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAAC,GAAG,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IACzE,gDAAgD;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtD,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtD,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrD,4FAA4F;IAC5F,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpC,uHAAuH;IACvH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACtD,sHAAsH;IACtH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxD,wCAAwC;IACxC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AASD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAqJzE,CAAC;AACF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useRef } from 'react';
|
|
3
|
+
import Flex from '../../Flex';
|
|
4
|
+
import { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';
|
|
5
|
+
import { StyledRangeInputContainer } from '../../Input/Input.styles';
|
|
6
|
+
import FormField from '../../FormField';
|
|
7
|
+
import { parseToDate } from './utils';
|
|
8
|
+
import TimeInput from './TimeInput';
|
|
9
|
+
import DateTimeInput from './DateTimeInput';
|
|
10
|
+
const convertToCallbackParameter = (v) => {
|
|
11
|
+
return {
|
|
12
|
+
valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),
|
|
13
|
+
valueAsTimestamp: v
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const TimeRangeInput = forwardRef(({ value = {}, onChange, onFocus, onBlur, label, fromLabel, toLabel, labelHidden, required, readOnly, disabled, min, max, withSeconds, pickerInterval, clockFormat, mode, status, fromAdditionalInfo, toAdditionalInfo, autoFocus, ...restProps }, ref) => {
|
|
17
|
+
const t = useI18n();
|
|
18
|
+
const startDateRef = useRef(value.start ? parseToDate(value.start).getTime() : undefined);
|
|
19
|
+
const endDateRef = useRef(value.end ? parseToDate(value.end).getTime() : undefined);
|
|
20
|
+
const onFocusChange = useCallback((focused) => {
|
|
21
|
+
(focused ? onFocus : onBlur)?.({
|
|
22
|
+
start: convertToCallbackParameter(startDateRef.current),
|
|
23
|
+
end: convertToCallbackParameter(endDateRef.current)
|
|
24
|
+
});
|
|
25
|
+
}, [onFocus, onBlur]);
|
|
26
|
+
const containerRef = useConsolidatedRef(ref);
|
|
27
|
+
useFocusWithin([containerRef], onFocusChange);
|
|
28
|
+
const commonProps = {
|
|
29
|
+
required,
|
|
30
|
+
readOnly,
|
|
31
|
+
disabled,
|
|
32
|
+
min,
|
|
33
|
+
max,
|
|
34
|
+
status,
|
|
35
|
+
withSeconds,
|
|
36
|
+
pickerInterval,
|
|
37
|
+
clockFormat
|
|
38
|
+
};
|
|
39
|
+
return (_jsx(FormField, { as: 'fieldset', ...restProps, container: { wrap: 'nowrap' }, ref: containerRef, labelAs: 'legend', label: label, labelHidden: labelHidden, disabled: disabled, required: required, readOnly: readOnly, status: status, children: _jsx(Flex, { container: true, as: StyledRangeInputContainer, children: mode === 'time' ? (_jsxs(_Fragment, { children: [_jsx(TimeInput, { ...commonProps, value: value.start, onBlur: changedValue => {
|
|
40
|
+
startDateRef.current = !changedValue.state
|
|
41
|
+
? changedValue.valueAsTimestamp
|
|
42
|
+
: undefined;
|
|
43
|
+
onChange({
|
|
44
|
+
start: changedValue,
|
|
45
|
+
end: convertToCallbackParameter(endDateRef.current)
|
|
46
|
+
});
|
|
47
|
+
}, label: fromLabel, "aria-label": `${t('range_from_datetime') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo, autoFocus: autoFocus }), _jsx(TimeInput, { ...commonProps, value: value.end, onBlur: changedValue => {
|
|
48
|
+
endDateRef.current = !changedValue.state
|
|
49
|
+
? changedValue.valueAsTimestamp
|
|
50
|
+
: undefined;
|
|
51
|
+
onChange({
|
|
52
|
+
start: convertToCallbackParameter(startDateRef.current),
|
|
53
|
+
end: changedValue
|
|
54
|
+
});
|
|
55
|
+
}, label: toLabel, "aria-label": `${t('range_to_datetime') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo })] })) : (_jsxs(_Fragment, { children: [_jsx(DateTimeInput, { ...commonProps, value: value.start, onBlur: changedValue => {
|
|
56
|
+
startDateRef.current = !changedValue.state
|
|
57
|
+
? changedValue.valueAsTimestamp
|
|
58
|
+
: undefined;
|
|
59
|
+
onChange({
|
|
60
|
+
start: changedValue,
|
|
61
|
+
end: convertToCallbackParameter(endDateRef.current)
|
|
62
|
+
});
|
|
63
|
+
}, label: fromLabel, "aria-label": `${t('range_from_datetime') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo }), _jsx(DateTimeInput, { ...commonProps, value: value.end, onBlur: changedValue => {
|
|
64
|
+
endDateRef.current = !changedValue.state
|
|
65
|
+
? changedValue.valueAsTimestamp
|
|
66
|
+
: undefined;
|
|
67
|
+
onChange({
|
|
68
|
+
start: convertToCallbackParameter(startDateRef.current),
|
|
69
|
+
end: changedValue
|
|
70
|
+
});
|
|
71
|
+
}, label: toLabel, "aria-label": `${t('range_to_datetime') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo })] })) }) }));
|
|
72
|
+
});
|
|
73
|
+
export default TimeRangeInput;
|
|
74
|
+
//# sourceMappingURL=TimeRangeInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeRangeInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA0B,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAO7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAqC5C,MAAM,0BAA0B,GAAG,CAAC,CAAU,EAA6B,EAAE;IAC3E,OAAO;QACL,gBAAgB,EAAE,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;QACrF,gBAAgB,EAAE,CAAC;KACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAA0D,UAAU,CACtF,CACE,EACE,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,GAAG,EACH,WAAW,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AC,EAAE,CAAC,EAAE,EACtE,cAAc,EAAE,gBAAgB,GAChC,IACD,CACJ,GACI,GACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AACF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref, useCallback, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport { FormControlProps } from '../../FormControl';\nimport { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport DateTimeProps, {\n DateRangeCallbackParameter,\n DateTimeCallbackParameter,\n DateTimeProperties\n} from '../DateTime.types';\nimport { ForwardProps } from '../../../types';\nimport { StyledRangeInputContainer } from '../../Input/Input.styles';\nimport { MinuteInterval } from '../Picker/TimePicker';\nimport FormField from '../../FormField';\n\nimport { ClockFormat, parseToDate } from './utils';\nimport TimeInput from './TimeInput';\nimport DateTimeInput from './DateTimeInput';\n\nexport interface TimeRangeInputProps extends DateTimeProperties {\n /** Object of range boundaries. */\n value?: { start?: DateTimeProps['value']; end?: DateTimeProps['value'] };\n /** Callback fired when inputs value changes. */\n onChange: (value: DateRangeCallbackParameter) => void;\n /** Callback fired when the component gets focused. */\n onFocus?: (value: DateRangeCallbackParameter) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: DateRangeCallbackParameter) => void;\n /** Pass a string or a fragment with an Icon and string for first part of TimeRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of TimeRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of DataRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of DataRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Controls which input is displayed */\n mode: 'time' | 'datetime';\n /**\n * Display the time with seconds.\n * @default false\n */\n withSeconds?: boolean;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n pickerInterval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nconst convertToCallbackParameter = (v?: number): DateTimeCallbackParameter => {\n return {\n valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),\n valueAsTimestamp: v\n };\n};\n\nconst TimeRangeInput: FunctionComponent<TimeRangeInputProps & ForwardProps> = forwardRef(\n (\n {\n value = {},\n onChange,\n onFocus,\n onBlur,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n required,\n readOnly,\n disabled,\n min,\n max,\n withSeconds,\n pickerInterval,\n clockFormat,\n mode,\n status,\n fromAdditionalInfo,\n toAdditionalInfo,\n autoFocus,\n ...restProps\n }: TimeRangeInputProps,\n ref: Ref<HTMLDivElement>\n ) => {\n const t = useI18n();\n\n const startDateRef = useRef(value.start ? parseToDate(value.start).getTime() : undefined);\n const endDateRef = useRef(value.end ? parseToDate(value.end).getTime() : undefined);\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({\n start: convertToCallbackParameter(startDateRef.current),\n end: convertToCallbackParameter(endDateRef.current)\n });\n },\n [onFocus, onBlur]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const commonProps = {\n required,\n readOnly,\n disabled,\n min,\n max,\n status,\n withSeconds,\n pickerInterval,\n clockFormat\n };\n\n return (\n <FormField\n as='fieldset'\n {...restProps}\n container={{ wrap: 'nowrap' }}\n ref={containerRef}\n labelAs='legend'\n label={label}\n labelHidden={labelHidden}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n status={status}\n >\n <Flex container as={StyledRangeInputContainer}>\n {mode === 'time' ? (\n <>\n <TimeInput\n {...commonProps}\n value={value.start}\n onBlur={changedValue => {\n startDateRef.current = !changedValue.state\n ? changedValue.valueAsTimestamp\n : undefined;\n onChange({\n start: changedValue,\n end: convertToCallbackParameter(endDateRef.current)\n });\n }}\n label={fromLabel}\n aria-label={`${t('range_from_datetime') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n autoFocus={autoFocus}\n />\n <TimeInput\n {...commonProps}\n value={value.end}\n onBlur={changedValue => {\n endDateRef.current = !changedValue.state\n ? changedValue.valueAsTimestamp\n : undefined;\n onChange({\n start: convertToCallbackParameter(startDateRef.current),\n end: changedValue\n });\n }}\n label={toLabel}\n aria-label={`${t('range_to_datetime') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n />\n </>\n ) : (\n <>\n <DateTimeInput\n {...commonProps}\n value={value.start}\n onBlur={changedValue => {\n startDateRef.current = !changedValue.state\n ? changedValue.valueAsTimestamp\n : undefined;\n onChange({\n start: changedValue,\n end: convertToCallbackParameter(endDateRef.current)\n });\n }}\n label={fromLabel}\n aria-label={`${t('range_from_datetime') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n />\n <DateTimeInput\n {...commonProps}\n value={value.end}\n onBlur={changedValue => {\n endDateRef.current = !changedValue.state\n ? changedValue.valueAsTimestamp\n : undefined;\n onChange({\n start: convertToCallbackParameter(startDateRef.current),\n end: changedValue\n });\n }}\n label={toLabel}\n aria-label={`${t('range_to_datetime') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n />\n </>\n )}\n </Flex>\n </FormField>\n );\n }\n);\nexport default TimeRangeInput;\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../../types';
|
|
2
|
+
import { ForwardProps, OmitStrict } from '../../../types';
|
|
3
|
+
import { FormControlProps } from '../../FormControl';
|
|
3
4
|
import DateTimeProps from '../DateTime.types';
|
|
4
|
-
export interface WeekInputProps extends DateTimeProps {
|
|
5
|
+
export interface WeekInputProps extends OmitStrict<FormControlProps, 'value' | 'defaultValue'>, DateTimeProps {
|
|
5
6
|
}
|
|
6
7
|
export declare const StyledWeekInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WeekInputProps, never>;
|
|
7
8
|
declare const WeekInput: FunctionComponent<WeekInputProps & ForwardProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/WeekInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAIpF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"WeekInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/WeekInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAIpF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS1D,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;AAGxE,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAgB7E,MAAM,WAAW,cACf,SAAQ,UAAU,CAAC,gBAAgB,EAAE,OAAO,GAAG,cAAc,CAAC,EAC5D,aAAa;CAAG;AAEpB,eAAO,MAAM,eAAe,qHAY1B,CAAC;AA6BH,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CA8N/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { forwardRef, useRef } from 'react';
|
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { defaultThemeProp } from '../../../theme';
|
|
5
5
|
import { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';
|
|
6
|
+
import { cap } from '../../../utils';
|
|
6
7
|
import FormField from '../../FormField';
|
|
7
8
|
import Button from '../../Button';
|
|
8
9
|
import Icon, { registerIcon } from '../../Icon';
|
|
@@ -51,7 +52,7 @@ const convertToCallbackParameter = (date, parts) => {
|
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
54
|
const WeekInput = forwardRef((props, ref) => {
|
|
54
|
-
const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, status, info, required, readOnly, disabled, onChange, onFocus, onBlur, autoFocus, ...restProps } = props;
|
|
55
|
+
const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, status, info, required, readOnly, disabled, onChange, onFocus, onBlur, autoFocus, additionalInfo, ...restProps } = props;
|
|
55
56
|
const { locale } = useConfiguration();
|
|
56
57
|
const t = useI18n();
|
|
57
58
|
const date = value !== undefined ? parseToDate(value) : undefined;
|
|
@@ -98,11 +99,15 @@ const WeekInput = forwardRef((props, ref) => {
|
|
|
98
99
|
onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), convertPartsToDate()));
|
|
99
100
|
buttonEl?.setAttribute('aria-label', generatePickerButtonAriaLabel(currentlySelectedDate(), 'week', locale, t, open));
|
|
100
101
|
};
|
|
101
|
-
const
|
|
102
|
-
|
|
102
|
+
const displayNames = new Intl.DisplayNames(locale, {
|
|
103
|
+
style: 'long',
|
|
104
|
+
type: 'dateTimeField'
|
|
105
|
+
});
|
|
106
|
+
const WeekNumberInput = (_jsx(PartInput, { placeholder: t('week_placeholder'), "aria-label": displayNames.of('weekOfYear'), value: date ? getWeek(date) : undefined, onChange: onInputChange, size: 2, maxLength: 2, min: 1, max: 53, readOnly: readOnly, ref: weekInputRef, autoFocus: autoFocus }, 'week'));
|
|
107
|
+
const YearInput = (_jsx(PartInput, { placeholder: t('year_placeholder'), "aria-label": displayNames.of('year'), value: date ? getWeekYear(date) : undefined, onChange: onInputChange, size: 4, maxLength: 4, min: 1, readOnly: readOnly, ref: yearInputRef }, 'year'));
|
|
103
108
|
const containerRef = useConsolidatedRef(ref);
|
|
104
109
|
useFocusWithin([containerRef], onFocusChange);
|
|
105
|
-
const Picker = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'week', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: open ? 'times' : 'calendar' }) }), _jsx(Popover, {
|
|
110
|
+
const Picker = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'week', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: open ? 'times' : 'calendar' }) }), open && (_jsx(Popover, { ref: setPopoverRef, target: buttonEl, strategy: 'fixed', placement: 'bottom-end', modifiers: [
|
|
106
111
|
{
|
|
107
112
|
name: 'flip',
|
|
108
113
|
options: {
|
|
@@ -115,12 +120,12 @@ const WeekInput = forwardRef((props, ref) => {
|
|
|
115
120
|
setOpen(false);
|
|
116
121
|
setTimeout(() => buttonEl?.focus());
|
|
117
122
|
onInputChange();
|
|
118
|
-
}, min: min, max: max, mode: 'week' }) })] }));
|
|
123
|
+
}, min: min, max: max, mode: 'week' }) }))] }));
|
|
119
124
|
const Comp = (_jsxs(Flex, { as: StyledWeekInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
120
125
|
if (e.target === containerRef.current)
|
|
121
126
|
weekInputRef.current?.focus();
|
|
122
|
-
}, ...restProps, children: [_jsxs(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, children: [
|
|
123
|
-
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, status, required, disabled }, ref: ref, children: Comp })) : (Comp);
|
|
127
|
+
}, ...restProps, children: [_jsxs(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, children: [cap(displayNames.of('weekOfYear')), " ", WeekNumberInput, ",", YearInput] }), !readOnly && Picker] }));
|
|
128
|
+
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, status, required, disabled, additionalInfo }, ref: ref, children: Comp })) : (Comp);
|
|
124
129
|
});
|
|
125
130
|
export default WeekInput;
|
|
126
131
|
//# sourceMappingURL=WeekInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/WeekInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAwB,MAAM,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,OAAO,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,qBAAqB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led-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { ForwardProps } from '../../../types';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport FormField from '../../FormField';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport Flex from '../../Flex';\nimport { StyledFormControl } from '../../FormControl';\nimport DatePicker from '../Picker/DatePicker';\nimport Popover from '../../Popover';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport {\n parseToDate,\n getWeekYear,\n getDateOfISOWeek,\n getWeek,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, { BareInput, StyledInputContainer } from './DateTime.styles';\nimport usePickerButton from './usePickerButton';\nimport PartInput from './PartInput';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\n\nregisterIcon(timesIcon, calendarIcon);\n\nexport interface WeekInputProps extends DateTimeProps {}\n\nexport const StyledWeekInput = styled(StyledDateTime)<WeekInputProps>(props => {\n const {\n theme: { base }\n } = props;\n\n return css`\n padding-inline-end: 0;\n\n ${StyledInputContainer} > ${BareInput}:first-of-type {\n margin-inline-start: ${base.spacing};\n }\n `;\n});\n\nStyledWeekInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, month, day] = parts.map(Number);\n date.setUTCFullYear(year, month, day);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst WeekInput: FunctionComponent<WeekInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<WeekInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n status,\n info,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n ...restProps\n } = props;\n\n const { locale } = useConfiguration();\n const t = useI18n();\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [weekInputRef, yearInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n useAutoFocusNextInput([weekInputRef, yearInputRef]);\n\n const pickParts = () => {\n return [weekInputRef.current?.value || undefined, yearInputRef.current?.value || undefined];\n };\n\n const convertPartsToDate = () => {\n const parts = pickParts();\n if (parts.every(Boolean)) {\n const dateOfWeek = getDateOfISOWeek(Number(parts[0]), Number(parts[1]));\n return [\n dateOfWeek.getUTCFullYear().toString(),\n dateOfWeek.getUTCMonth().toString(),\n dateOfWeek.getUTCDate().toString()\n ];\n }\n return parts;\n };\n\n const currentlySelectedDate = () => {\n if (pickParts().every(Boolean)) {\n const [year, month, day] = convertPartsToDate().map(v => (v ? Number(v) : undefined));\n const current = date ?? new Date();\n return new Date(\n current.setUTCFullYear(\n year ?? current.getUTCFullYear(),\n month ?? current.getUTCMonth(),\n day ?? current.getUTCDate()\n )\n );\n }\n };\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 convertPartsToDate()\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 [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const onInputChange = () => {\n onChange?.(\n convertToCallbackParameter(date ? new Date(date) : new Date(), convertPartsToDate())\n );\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'week', locale, t, open)\n );\n };\n\n const WeekNumberInput = (\n <PartInput\n key='week'\n placeholder={t('week_placeholder')}\n aria-label={t('week_label_a11y')}\n value={date ? getWeek(date) : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n min={1}\n max={53}\n readOnly={readOnly}\n ref={weekInputRef}\n autoFocus={autoFocus}\n />\n );\n\n const YearInput = (\n <PartInput\n key='year'\n placeholder={t('year_placeholder')}\n aria-label={t('year_label_a11y')}\n value={date ? getWeekYear(date) : undefined}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n min={1}\n readOnly={readOnly}\n ref={yearInputRef}\n />\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const Picker = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'week',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'calendar'} />\n </Button>\n\n <Popover\n show={open}\n ref={setPopoverRef}\n target={containerRef.current}\n strategy='fixed'\n placement='bottom-end'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end', 'right', 'left']\n }\n }\n ]}\n >\n <DatePicker\n selected={currentlySelectedDate()}\n onChange={selected => {\n weekInputRef.current!.value = getWeek(selected).toString().padStart(2, '0');\n yearInputRef.current!.value = getWeekYear(selected).toString();\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n min={min}\n max={max}\n mode='week'\n />\n </Popover>\n </>\n );\n\n const Comp = (\n <Flex\n as={StyledWeekInput}\n forwardedAs={StyledFormControl}\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) weekInputRef.current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n >\n {t('week_text')} {WeekNumberInput},{YearInput}\n </Flex>\n {!readOnly && Picker}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default WeekInput;\n"]}
|
|
1
|
+
{"version":3,"file":"WeekInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/WeekInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAwB,MAAM,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAoB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,OAAO,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,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AAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,EAChF,GAAG,EAAE,GAAG,YAEP,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef, Ref, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { ForwardProps, OmitStrict } from '../../../types';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { cap } from '../../../utils';\nimport FormField from '../../FormField';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport Flex from '../../Flex';\nimport { FormControlProps, StyledFormControl } from '../../FormControl';\nimport DatePicker from '../Picker/DatePicker';\nimport Popover from '../../Popover';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport {\n parseToDate,\n getWeekYear,\n getDateOfISOWeek,\n getWeek,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, { BareInput, StyledInputContainer } from './DateTime.styles';\nimport usePickerButton from './usePickerButton';\nimport PartInput from './PartInput';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\n\nregisterIcon(timesIcon, calendarIcon);\n\nexport interface WeekInputProps\n extends OmitStrict<FormControlProps, 'value' | 'defaultValue'>,\n DateTimeProps {}\n\nexport const StyledWeekInput = styled(StyledDateTime)<WeekInputProps>(props => {\n const {\n theme: { base }\n } = props;\n\n return css`\n padding-inline-end: 0;\n\n ${StyledInputContainer} > ${BareInput}:first-of-type {\n margin-inline-start: ${base.spacing};\n }\n `;\n});\n\nStyledWeekInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, month, day] = parts.map(Number);\n date.setUTCFullYear(year, month, day);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst WeekInput: FunctionComponent<WeekInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<WeekInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n status,\n info,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n additionalInfo,\n ...restProps\n } = props;\n\n const { locale } = useConfiguration();\n const t = useI18n();\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [weekInputRef, yearInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n useAutoFocusNextInput([weekInputRef, yearInputRef]);\n\n const pickParts = () => {\n return [weekInputRef.current?.value || undefined, yearInputRef.current?.value || undefined];\n };\n\n const convertPartsToDate = () => {\n const parts = pickParts();\n if (parts.every(Boolean)) {\n const dateOfWeek = getDateOfISOWeek(Number(parts[0]), Number(parts[1]));\n return [\n dateOfWeek.getUTCFullYear().toString(),\n dateOfWeek.getUTCMonth().toString(),\n dateOfWeek.getUTCDate().toString()\n ];\n }\n return parts;\n };\n\n const currentlySelectedDate = () => {\n if (pickParts().every(Boolean)) {\n const [year, month, day] = convertPartsToDate().map(v => (v ? Number(v) : undefined));\n const current = date ?? new Date();\n return new Date(\n current.setUTCFullYear(\n year ?? current.getUTCFullYear(),\n month ?? current.getUTCMonth(),\n day ?? current.getUTCDate()\n )\n );\n }\n };\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 convertPartsToDate()\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 [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const onInputChange = () => {\n onChange?.(\n convertToCallbackParameter(date ? new Date(date) : new Date(), convertPartsToDate())\n );\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'week', locale, t, open)\n );\n };\n\n const displayNames = new Intl.DisplayNames(locale, {\n style: 'long',\n type: 'dateTimeField'\n }) as Intl.DateTimeDisplayNames;\n\n const WeekNumberInput = (\n <PartInput\n key='week'\n placeholder={t('week_placeholder')}\n aria-label={displayNames.of('weekOfYear')}\n value={date ? getWeek(date) : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n min={1}\n max={53}\n readOnly={readOnly}\n ref={weekInputRef}\n autoFocus={autoFocus}\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 ? getWeekYear(date) : undefined}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n min={1}\n readOnly={readOnly}\n ref={yearInputRef}\n />\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const Picker = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'week',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'calendar'} />\n </Button>\n {open && (\n <Popover\n ref={setPopoverRef}\n target={buttonEl}\n strategy='fixed'\n placement='bottom-end'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end', 'right', 'left']\n }\n }\n ]}\n >\n <DatePicker\n selected={currentlySelectedDate()}\n onChange={selected => {\n weekInputRef.current!.value = getWeek(selected).toString().padStart(2, '0');\n yearInputRef.current!.value = getWeekYear(selected).toString();\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n min={min}\n max={max}\n mode='week'\n />\n </Popover>\n )}\n </>\n );\n\n const Comp = (\n <Flex\n as={StyledWeekInput}\n forwardedAs={StyledFormControl}\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) weekInputRef.current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n >\n {cap(displayNames.of('weekOfYear'))} {WeekNumberInput},{YearInput}\n </Flex>\n {!readOnly && Picker}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled, additionalInfo }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default WeekInput;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
declare const usePickerButton: (onClose?: (
|
|
2
|
+
declare const usePickerButton: (onClose?: () => void) => [boolean, Dispatch<SetStateAction<boolean>>, HTMLElement | null, (instance: HTMLElement | null) => void, HTMLElement | null, (instance: HTMLElement | null) => void];
|
|
3
3
|
export default usePickerButton;
|
|
4
4
|
//# sourceMappingURL=usePickerButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePickerButton.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/usePickerButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAItE,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"usePickerButton.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/usePickerButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAItE,QAAA,MAAM,eAAe,aACT,MAAM,IAAI,iFAKT,WAAW,GAAG,IAAI,KAAK,IAAI,iCAE3B,WAAW,GAAG,IAAI,KAAK,IAAI,CAoCvC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -3,18 +3,18 @@ export declare const getWeekYear: (date: Date) => number;
|
|
|
3
3
|
export declare const getDayOfWeek: (date: Date, calendarType?: string) => number;
|
|
4
4
|
export declare const getWeekdays: (calendarType: string) => Date[];
|
|
5
5
|
export declare const getWeek: (date: Date, calendarType?: string) => number;
|
|
6
|
-
export declare const getCalendarTypeFromLocale: (localeTag?: string
|
|
6
|
+
export declare const getCalendarTypeFromLocale: (localeTag?: string) => string;
|
|
7
7
|
export declare const getDateOfISOWeek: (week: number, year: number) => Date;
|
|
8
8
|
export declare const parseToDate: (value: string | number | Date) => Date;
|
|
9
9
|
export declare type QuarterNumber = 1 | 2 | 3 | 4;
|
|
10
10
|
export declare function getQuarter(date: string | number | Date): QuarterNumber;
|
|
11
|
-
export declare const getDateFormat: (localeTag?: string
|
|
11
|
+
export declare const getDateFormat: (localeTag?: string, options?: Intl.DateTimeFormatOptions | undefined, labelFormat?: boolean) => string[];
|
|
12
12
|
export declare const getStartOfWeek: (date: Date, calendarType?: string) => Date;
|
|
13
13
|
export declare const getEndOfWeek: (date: Date, calendarType?: string) => Date;
|
|
14
14
|
export declare type ClockFormat = 12 | 24;
|
|
15
|
-
export declare const is12HClockFormat: (localeTag?: string
|
|
16
|
-
export declare const getLocalizedMonths: (localeTag?: string
|
|
17
|
-
export declare const getLocalizedWeekDays: (localeTag?: string
|
|
15
|
+
export declare const is12HClockFormat: (localeTag?: string) => boolean;
|
|
16
|
+
export declare const getLocalizedMonths: (localeTag?: string) => string[];
|
|
17
|
+
export declare const getLocalizedWeekDays: (localeTag?: string) => {
|
|
18
18
|
[key: number]: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const MS_IN_SECOND = 1000;
|
|
@@ -41,7 +41,7 @@ export declare const getTimeOptions: (withSeconds: boolean, is12h?: boolean) =>
|
|
|
41
41
|
};
|
|
42
42
|
export declare const validateDate: (year: number, month: number, day: number) => boolean;
|
|
43
43
|
export declare const validateTime: (hour: number, minute: number, second: number, is12h: boolean) => boolean;
|
|
44
|
-
export declare const toUTCDateString: (date: Date, format?: Intl.DateTimeFormat
|
|
44
|
+
export declare const toUTCDateString: (date: Date, format?: Intl.DateTimeFormat) => string;
|
|
45
45
|
export declare const isISODate: (value: string) => boolean;
|
|
46
46
|
export declare const isTime: (value: string) => boolean;
|
|
47
47
|
export declare const parseLocaleTextToDateParams: (value: string, localeTag: string) => number[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAK1E,eAAO,MAAM,WAAW,SAAU,IAAI,KAAG,MAIxC,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,IAAI,kCAetC,CAAC;AAEF,eAAO,MAAM,WAAW,iBAAkB,MAAM,WAS/C,CAAC;AAGF,eAAO,MAAM,OAAO,SAAU,IAAI,iBAAgB,MAAM,KAA6B,MAgBpF,CAAC;AAEF,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAK1E,eAAO,MAAM,WAAW,SAAU,IAAI,KAAG,M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,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAS5F,CAAC;AAEF,eAAO,MAAM,cAAc;UAKnB,MAAM;YACJ,MAAM;YACN,MAAM;MACZ,MAKH,CAAC;AAEF,eAAO,MAAM,YAAY,OAAQ,MAAM,UAAU,MAAM,KAAG,MAgBzD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,UAAU,MAAM,KAAG,MAgB5D,CAAC;AAEF,eAAO,MAAM,cAAc,gBAAiB,OAAO,UAAS,OAAO;;;;;CAOlE,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,MAAM,SAAS,MAAM,OAAO,MAAM,YAEpE,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,MAAM,UAAU,MAAM,UAAU,MAAM,SAAS,OAAO,YAIxF,CAAC;AAEF,eAAO,MAAM,eAAe,SAAU,IAAI,WAAW,KAAK,cAAc,WAGvE,CAAC;AAKF,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,OAEzC,CAAC;AAIF,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,OAEtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAW,MAAM,aAAa,MAAM,yBAyB3E,CAAC;AAEF,eAAO,MAAM,qBAAqB,UACzB,MAAM,aACF,MAAM,eACJ,IAAI,KAChB,IAAI,GAAG,SAiBT,CAAC;AAiBF,eAAO,MAAM,6BAA6B,SAClC,IAAI,GAAG,SAAS,QAChB,MAAM,GAAG,UAAU,GAAG,MAAM,UAC1B,MAAM,eACD,oBAAoB,eAAe,CAAC,QAC3C,OAAO,KACZ,MAwBF,CAAC"}
|
|
@@ -298,8 +298,9 @@ const ariaDateOpts = {
|
|
|
298
298
|
export const generatePickerButtonAriaLabel = (date, type, locale, translateFn, open) => {
|
|
299
299
|
let datePart = '';
|
|
300
300
|
if (type === 'week') {
|
|
301
|
+
const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });
|
|
301
302
|
datePart = date
|
|
302
|
-
? `${translateFn('selected_date_a11y')} ${
|
|
303
|
+
? `${translateFn('selected_date_a11y')} ${displayNames.of('weekOfYear')} ${getWeek(date, CALENDAR_TYPES.ISO_8601)}, ${date.getUTCFullYear()}, `
|
|
303
304
|
: '';
|
|
304
305
|
}
|
|
305
306
|
else {
|