@pega/cosmos-react-core 2.0.0-dev.9.4 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/components/Actions/Actions.js +1 -1
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +1 -6
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +88 -63
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +227 -173
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +7 -7
- 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 +3 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +9 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +4 -3
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +24 -19
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +7 -8
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.js +3 -5
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
- package/lib/components/AppShell/SkipNavigation.js +30 -39
- package/lib/components/AppShell/SkipNavigation.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +1 -0
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -0
- 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 +5 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +7 -6
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Backdrop/index.d.ts +1 -2
- package/lib/components/Backdrop/index.d.ts.map +1 -1
- package/lib/components/Backdrop/index.js +1 -2
- package/lib/components/Backdrop/index.js.map +1 -1
- package/lib/components/Badges/Alert.d.ts +2 -2
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js +1 -1
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Badges/Count.js +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +10 -9
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +2 -2
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +1 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.js +1 -1
- package/lib/components/Badges/Tag.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +2 -2
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +6 -8
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +1 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts.map +1 -1
- package/lib/components/Button/BareButton.js +21 -2
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts +12 -0
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
- package/lib/components/Button/BareRoleButton.js +20 -0
- package/lib/components/Button/BareRoleButton.js.map +1 -0
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +34 -10
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +3 -2
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContent.d.ts.map +1 -1
- package/lib/components/Card/CardContent.js +5 -4
- package/lib/components/Card/CardContent.js.map +1 -1
- package/lib/components/Card/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/CardFooter.js +5 -4
- package/lib/components/Card/CardFooter.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts +3 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +9 -7
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/Card/CardMedia.js +1 -1
- package/lib/components/Card/CardMedia.js.map +1 -1
- package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/Card/CollapsibleCard.js +5 -7
- package/lib/components/Card/CollapsibleCard.js.map +1 -1
- package/lib/components/Card/SelectableCard.js +1 -1
- package/lib/components/Card/SelectableCard.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +8 -11
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +43 -63
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -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.js +4 -4
- 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 +23 -29
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +11 -13
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js +11 -7
- 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 +16 -16
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
- 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 +12 -1
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/Currency/utils.js +30 -2
- package/lib/components/Currency/utils.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +2 -1
- 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/DateTimeDisplay.d.ts +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js +10 -2
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +11 -6
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +26 -28
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +37 -44
- 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 +7 -5
- 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 +3 -3
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
- 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 +12 -15
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +12 -16
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +3 -4
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/QuarterInput.js +102 -0
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +29 -39
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +23 -24
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +4 -4
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +7 -0
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +52 -10
- 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 +32 -34
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
- 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 +13 -17
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +9 -10
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +9 -11
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +3 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +3 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +2 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +10 -7
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +2 -2
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js +2 -2
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
- package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +14 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EmptyState/index.d.ts +4 -0
- package/lib/components/EmptyState/index.d.ts.map +1 -0
- package/lib/components/EmptyState/index.js +3 -0
- package/lib/components/EmptyState/index.js.map +1 -0
- package/lib/components/ErrorState/ErrorState.d.ts +16 -0
- package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
- package/lib/components/ErrorState/ErrorState.js +31 -0
- package/lib/components/ErrorState/ErrorState.js.map +1 -0
- package/lib/components/ErrorState/index.d.ts +4 -0
- package/lib/components/ErrorState/index.d.ts.map +1 -0
- package/lib/components/ErrorState/index.js +3 -0
- package/lib/components/ErrorState/index.js.map +1 -0
- package/lib/components/ExpandCollapse/ExpandCollapse.js +6 -6
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +6 -7
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +8 -7
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/index.d.ts +1 -0
- package/lib/components/FieldGroup/index.d.ts.map +1 -1
- package/lib/components/FieldGroup/index.js +1 -0
- package/lib/components/FieldGroup/index.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +5 -7
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +6 -3
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +7 -7
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +3 -3
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +18 -19
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts +0 -2
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +3 -4
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileUploadItem.d.ts +4 -2
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +58 -20
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +7 -16
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js +44 -47
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/File/index.d.ts +1 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +1 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/File/utils.js +2 -3
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +17 -7
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +25 -9
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +7 -1
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +5 -4
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +1 -1
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +5 -7
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +9 -19
- 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.js +17 -21
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Icon/Icon.js +3 -5
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
- package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
- package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/dock.icon.js +6 -0
- package/lib/components/Icon/icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
- package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
- package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
- package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +1 -3
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
- package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad.icon.js +1 -5
- package/lib/components/Icon/icons/grad.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +1 -6
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +1 -6
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/pin.icon.js +1 -2
- package/lib/components/Icon/icons/pin.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-solid.icon.js +1 -2
- package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tracer.icon.js +1 -2
- package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
- package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox.icon.js +1 -3
- package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
- package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/undock.icon.js +6 -0
- package/lib/components/Icon/icons/undock.icon.js.map +1 -0
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -0
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Image/Image.js +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.d.ts.map +1 -1
- package/lib/components/Image/index.js +1 -0
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +13 -13
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.js +2 -2
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Input/index.d.ts.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/Label/Label.d.ts +2 -2
- package/lib/components/Label/Label.d.ts.map +1 -1
- package/lib/components/Label/Label.js +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +6 -0
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.js +129 -0
- package/lib/components/Lightbox/Lightbox.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.js +166 -0
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.js +2 -0
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
- package/lib/components/Lightbox/index.d.ts +3 -0
- package/lib/components/Lightbox/index.d.ts.map +1 -0
- package/lib/components/Lightbox/index.js +2 -0
- package/lib/components/Lightbox/index.js.map +1 -0
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +19 -19
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts +15 -0
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
- package/lib/components/List/CommaSeparatedList.js +61 -0
- package/lib/components/List/CommaSeparatedList.js.map +1 -0
- package/lib/components/List/List.d.ts +30 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +56 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/OrderedList.d.ts +6 -0
- package/lib/components/List/OrderedList.d.ts.map +1 -0
- package/lib/components/List/OrderedList.js +6 -0
- package/lib/components/List/OrderedList.js.map +1 -0
- package/lib/components/List/UnorderedList.d.ts +6 -0
- package/lib/components/List/UnorderedList.d.ts.map +1 -0
- package/lib/components/List/UnorderedList.js +6 -0
- package/lib/components/List/UnorderedList.js.map +1 -0
- package/lib/components/List/index.d.ts +5 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +4 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +7 -7
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.types.d.ts +2 -1
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.js +8 -9
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +27 -28
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.js +8 -13
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +4 -4
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.js +11 -15
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.js +12 -15
- package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +2 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +92 -48
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +11 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +208 -7
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +30 -12
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/MenuGroup.d.ts +6 -0
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
- package/lib/components/Menu/MenuGroup.js +17 -0
- package/lib/components/Menu/MenuGroup.js.map +1 -0
- package/lib/components/Menu/MenuItem.d.ts +0 -3
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +57 -164
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +28 -30
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts +0 -1
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js +7 -55
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +13 -12
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/helpers.js +40 -36
- package/lib/components/Menu/helpers.js.map +1 -1
- package/lib/components/Menu/index.d.ts +2 -3
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -2
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +13 -14
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +13 -4
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +34 -20
- 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 +6 -2
- 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 +5 -4
- 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 +53 -38
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +89 -136
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +9 -0
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
- package/lib/components/Modal/Modal.styles.js +134 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -0
- package/lib/components/Modal/Modal.types.d.ts +60 -7
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js +2 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +78 -68
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.js +10 -12
- package/lib/components/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js +5 -2
- package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
- package/lib/components/MultiStep/index.d.ts +1 -1
- package/lib/components/MultiStep/index.d.ts.map +1 -1
- package/lib/components/MultiStep/index.js.map +1 -1
- package/lib/components/Number/NumberDisplay.d.ts +2 -2
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +1 -1
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +18 -25
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +2 -2
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -2
- 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/utils.js +2 -3
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +8 -18
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +48 -28
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +89 -79
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +5 -3
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +2 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +2 -2
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +7 -6
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
- package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
- package/lib/components/Paragraph/index.d.ts +3 -0
- package/lib/components/Paragraph/index.d.ts.map +1 -0
- package/lib/components/Paragraph/index.js +2 -0
- package/lib/components/Paragraph/index.js.map +1 -0
- package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -3
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +2 -2
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +18 -17
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.js +2 -3
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +0 -4
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +17 -122
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +5 -0
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
- package/lib/components/Popover/Popover.styles.js +131 -0
- package/lib/components/Popover/Popover.styles.js.map +1 -0
- package/lib/components/Popover/PopoverManager.js +2 -2
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +1 -1
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +3 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -0
- package/lib/components/Popover/modifiers.js +11 -0
- package/lib/components/Popover/modifiers.js.map +1 -0
- package/lib/components/Progress/Bar.js +2 -2
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.d.ts +1 -1
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js +48 -50
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.js +3 -4
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/Ring.d.ts +1 -1
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js +40 -40
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +7 -8
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/Rating/Rating.d.ts +2 -2
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js +6 -7
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +5 -5
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +14 -14
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Option.js +1 -1
- package/lib/components/Select/Option.js.map +1 -1
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +15 -16
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/index.d.ts +2 -3
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js.map +1 -1
- package/lib/components/Sentiment/Sentiment.d.ts +2 -2
- package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
- package/lib/components/Sentiment/Sentiment.js +1 -2
- package/lib/components/Sentiment/Sentiment.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.js +1 -1
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +12 -19
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +4 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +17 -5
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +2 -2
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/SliderTicks.d.ts +1 -0
- package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
- package/lib/components/Slider/SliderTicks.js +19 -12
- package/lib/components/Slider/SliderTicks.js.map +1 -1
- package/lib/components/Slider/utils.d.ts +10 -11
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +24 -18
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +3 -5
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +8 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +10 -11
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +14 -10
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts +2 -2
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +41 -30
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Table/Table.d.ts +2 -2
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js +14 -13
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/index.d.ts +1 -2
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +9 -7
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +10 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +24 -8
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +1 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +22 -18
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +2 -2
- package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.d.ts.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 +2 -2
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +31 -30
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts.map +1 -1
- package/lib/components/TextArea/index.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +8 -36
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +97 -102
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +6 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +6 -13
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts +6 -0
- package/lib/components/Tree/StandardTree.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.js +175 -0
- package/lib/components/Tree/StandardTree.js.map +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.styles.js +155 -0
- package/lib/components/Tree/StandardTree.styles.js.map +1 -0
- package/lib/components/Tree/StandardTree.types.d.ts +25 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.types.js +2 -0
- package/lib/components/Tree/StandardTree.types.js.map +1 -0
- package/lib/components/Tree/Tree.d.ts +35 -49
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.js +18 -56
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/helpers.d.ts +19 -0
- package/lib/components/Tree/helpers.d.ts.map +1 -0
- package/lib/components/Tree/helpers.js +180 -0
- package/lib/components/Tree/helpers.js.map +1 -0
- package/lib/components/Tree/index.d.ts +4 -2
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js +3 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js +2 -2
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -0
- package/lib/components/VisuallyHiddenText/index.d.ts +2 -0
- package/lib/components/VisuallyHiddenText/index.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/index.js +2 -0
- package/lib/components/VisuallyHiddenText/index.js.map +1 -0
- package/lib/hooks/index.d.ts +7 -4
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +7 -3
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +17 -3
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +86 -64
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +6 -7
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.js +2 -4
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +8 -0
- package/lib/hooks/useDraggable.d.ts.map +1 -0
- package/lib/hooks/useDraggable.js +64 -0
- package/lib/hooks/useDraggable.js.map +1 -0
- package/lib/hooks/useFocusWithin.d.ts +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +29 -24
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +511 -170
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useI18n.js +2 -2
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useLongPress.d.ts +16 -0
- package/lib/hooks/useLongPress.d.ts.map +1 -0
- package/lib/hooks/useLongPress.js +59 -0
- package/lib/hooks/useLongPress.js.map +1 -0
- package/lib/hooks/useOuterEvent.js +1 -1
- package/lib/hooks/useOuterEvent.js.map +1 -1
- package/lib/hooks/useOverride.js +1 -1
- package/lib/hooks/useOverride.js.map +1 -1
- package/lib/hooks/useScrollStick.js +14 -3
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts +6 -0
- package/lib/hooks/useScrollToggle.d.ts.map +1 -0
- package/lib/hooks/useScrollToggle.js +40 -0
- package/lib/hooks/useScrollToggle.js.map +1 -0
- package/lib/hooks/useTransitionState.d.ts +39 -0
- package/lib/hooks/useTransitionState.d.ts.map +1 -0
- package/lib/hooks/useTransitionState.js +56 -0
- package/lib/hooks/useTransitionState.js.map +1 -0
- package/lib/i18n/default.d.ts +589 -0
- package/lib/i18n/default.d.ts.map +1 -0
- package/lib/i18n/default.js +636 -0
- package/lib/i18n/default.js.map +1 -0
- package/lib/i18n/i18n.d.ts +1000 -318
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/i18n.js +1 -1
- package/lib/i18n/i18n.js.map +1 -1
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/translate.d.ts +29 -4
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js +21 -8
- package/lib/i18n/translate.js.map +1 -1
- package/lib/index.d.ts +11 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -2
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +2 -26
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/theme/ThemeMachine.js +7 -1
- 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 +83 -53
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +50 -30
- package/lib/theme/themeOverrides.schema.json +24 -3
- package/lib/theme/themes/buildTheme.json +3 -39
- package/lib/theme/themes/darkTheme.json +6 -0
- package/lib/theme/themes/legacyBuildTheme.json +50 -0
- package/lib/types/types.d.ts +6 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +41 -4
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +55 -9
- package/lib/utils/utils.js.map +1 -1
- package/package.json +11 -12
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
- package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
- package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
- package/lib/components/NoItems/NoItems.d.ts +0 -14
- package/lib/components/NoItems/NoItems.d.ts.map +0 -1
- package/lib/components/NoItems/NoItems.js.map +0 -1
- package/lib/components/NoItems/index.d.ts +0 -4
- package/lib/components/NoItems/index.d.ts.map +0 -1
- package/lib/components/NoItems/index.js +0 -3
- package/lib/components/NoItems/index.js.map +0 -1
- package/lib/i18n/default.json +0 -246
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayOfWeekInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DayOfWeekInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,OAAO,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,SAAS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,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,EAC3C,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,KAC1B,SAAS,aAEZ,CAAC,QAAQ,IAAI,KAAC,MAAM,4BAAW,EAC/B,gBAAgB,YACV,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, useMemo } from 'react';\n\nimport { ForwardProps } from '../../../types';\nimport Select, { Option } from '../../Select';\nimport { SelectProps } from '../../Select/Select';\nimport { FormControlProps } from '../../FormControl';\nimport { useConfiguration } from '../../../hooks';\n\nimport { CALENDAR_TYPES } from './local';\nimport { getCalendarTypeFromLocale, getWeekdays } from './utils';\n\nexport type DayOfWeek = 1 | 2 | 3 | 4 | 5 | 6 | 7;\n\nexport interface DayOfWeekInputProps {\n /**\n * Number from range [1-7].\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: DayOfWeek;\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Callback fired when input value changes. */\n onChange?: (value: DayOfWeek) => void;\n}\n\n// returns object with properties for localized days names\n// properties are numbers corresponding to days order according to ISO_8601 calendar (1-Monday, 2-Tuesday etc.)\nfunction getDayOfWeekNamesMap(localeTag?: string) {\n return getWeekdays(CALENDAR_TYPES.ISO_8601).reduce((accumulator, dayDate, index) => {\n accumulator[index + 1] = dayDate.toLocaleString(localeTag, {\n weekday: 'long',\n timeZone: 'UTC'\n });\n return accumulator;\n }, {} as { [key: number]: string });\n}\n\n// returns index of the first day of week according to given calendar type\n// returned value is a position of the day in base ISO calendar\nfunction getFirstWeekDayForCalendar(refCalendarType = CALENDAR_TYPES.ISO_8601) {\n switch (refCalendarType) {\n case CALENDAR_TYPES.ISO_8601:\n // start week with Monday\n return 0;\n case CALENDAR_TYPES.ARABIC:\n // start week with Saturday\n return 5;\n case CALENDAR_TYPES.HEBREW:\n case CALENDAR_TYPES.US:\n // start week with Sunday\n return 6;\n default:\n // ISO as default\n return 0;\n }\n}\n\n// returns array of Options for day names, ordered according to given calendar\nfunction generateOrderedDays(dayOfWeekNames: { [key: number]: string }, refCalendarType: string) {\n const optionsArray = Object.keys(dayOfWeekNames).map(key => {\n return (\n <Option key={dayOfWeekNames[Number(key)]} value={key.toString()}>\n {dayOfWeekNames[Number(key)]}\n </Option>\n );\n });\n\n const startingDayIndex = getFirstWeekDayForCalendar(refCalendarType);\n\n return [...optionsArray.slice(startingDayIndex), ...optionsArray.slice(0, startingDayIndex)];\n}\n\nconst DayOfWeekInput: FunctionComponent<DayOfWeekInputProps & ForwardProps> = (\n props: DayOfWeekInputProps\n) => {\n const { locale } = useConfiguration();\n const { value, required, readOnly, disabled, onChange, ...restProps } = props;\n\n // days ordered according to given calendar\n const dayOfWeekOptions = useMemo(\n () => generateOrderedDays(getDayOfWeekNamesMap(locale), getCalendarTypeFromLocale(locale)),\n [locale]\n );\n\n const onChangeWrapper: SelectProps['onChange'] = ev => {\n onChange?.(Number(ev.target.value) as DayOfWeek);\n };\n\n return (\n <Select\n required={required}\n value={value ? value.toString() : undefined}\n onChange={onChangeWrapper}\n readOnly={readOnly}\n disabled={disabled || readOnly}\n {...restProps}\n >\n {!required && <Option> </Option>}\n {dayOfWeekOptions}\n </Select>\n );\n};\n\nexport default DayOfWeekInput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurationInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/DurationInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,kBAA8B,MAAM,uBAAuB,CAAC;AAEnE,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"DurationInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/DurationInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,kBAA8B,MAAM,uBAAuB,CAAC;AAEnE,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAqCvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useI18n } from '../../../../hooks';
|
|
4
4
|
import FormField from '../../../FormField';
|
|
@@ -8,8 +8,8 @@ import { Format } from './DurationInput.types';
|
|
|
8
8
|
const DurationInput = forwardRef((props, ref) => {
|
|
9
9
|
const { id, label, labelHidden, required, status, disabled, onChange, format = Format.Seconds, onSelect, ...restProps } = props;
|
|
10
10
|
const t = useI18n();
|
|
11
|
-
const Comp =
|
|
12
|
-
return label ? (_jsx(FormField,
|
|
11
|
+
const Comp = format === Format.Formatted ? (_jsx(Time, { ...{ status, disabled, onChange }, ...restProps }, void 0)) : (_jsx(NumberUnit, { ...{ format, status, disabled, onChange, onSelect }, ...restProps }, void 0));
|
|
12
|
+
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', info: format === Format.Formatted && t('time_format_info'), status: status, ...{ label, labelHidden, id, required, disabled, ref }, children: Comp }, void 0)) : (Comp);
|
|
13
13
|
});
|
|
14
14
|
export default DurationInput;
|
|
15
15
|
//# sourceMappingURL=DurationInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurationInput.js","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/DurationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,UAAU,EAA0B,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAA2B,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,aAAa,GAAyD,UAAU,CACpF,CAAC,KAA0C,EAAE,GAA6B,EAAE,EAAE;IAC5E,MAAM,EACJ,EAAE,EACF,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,GAAG,MAAM,CAAC,OAAO,EACvB,QAAQ,EACR,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"DurationInput.js","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/DurationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,UAAU,EAA0B,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC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{ useI18n } from '../../../../hooks';\nimport FormField from '../../../FormField';\nimport { ForwardProps } from '../../../../types';\n\nimport Time from './Time';\nimport NumberUnit from './NumberUnit';\nimport DurationInputProps, { Format } from './DurationInput.types';\n\nconst DurationInput: FunctionComponent<DurationInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DurationInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const {\n id,\n label,\n labelHidden,\n required,\n status,\n disabled,\n onChange,\n format = Format.Seconds,\n onSelect,\n ...restProps\n } = props;\n const t = useI18n();\n\n const Comp =\n format === Format.Formatted ? (\n <Time {...{ status, disabled, onChange }} {...restProps} />\n ) : (\n <NumberUnit {...{ format, status, disabled, onChange, onSelect }} {...restProps} />\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n info={format === Format.Formatted && t('time_format_info')}\n status={status}\n {...{ label, labelHidden, id, required, disabled, ref }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default DurationInput;\n"]}
|
|
@@ -48,7 +48,7 @@ const OPTIONS = [Format.Seconds, Format.Minutes, Format.Hours, Format.Days];
|
|
|
48
48
|
const NumberUnit = (props) => {
|
|
49
49
|
const { defaultValue = 0, value, onChange, format = Format.Seconds, onSelect, disabled, readOnly, required, status, autoFocus, ...restProps } = props;
|
|
50
50
|
const t = useI18n();
|
|
51
|
-
const [valueInMs, setValueInMs] = useState(value
|
|
51
|
+
const [valueInMs, setValueInMs] = useState(value ?? defaultValue);
|
|
52
52
|
const [unit, setUnit] = useState(format);
|
|
53
53
|
useEffect(() => {
|
|
54
54
|
setUnit(format);
|
|
@@ -76,12 +76,11 @@ const NumberUnit = (props) => {
|
|
|
76
76
|
const onSelectChange = useCallback((ev) => {
|
|
77
77
|
const selectedValue = ev.target.value;
|
|
78
78
|
setUnit(selectedValue);
|
|
79
|
-
onSelect
|
|
79
|
+
onSelect?.(selectedValue);
|
|
80
80
|
}, [onSelect]);
|
|
81
|
-
const unitOptions = OPTIONS.map(option => (_jsx(Option,
|
|
81
|
+
const unitOptions = OPTIONS.map(option => (_jsx(Option, { value: option, children: t(`${option}_text`) }, option)));
|
|
82
82
|
const id = useUID();
|
|
83
|
-
return (_jsxs(Flex,
|
|
84
|
-
_jsx(Select, Object.assign({ id: id, "aria-label": t(`${unit}_text`), value: unit, required: required, status: status, readOnly: readOnly, disabled: disabled || readOnly, onChange: onSelectChange }, { children: unitOptions }), 'unit')] }), void 0));
|
|
83
|
+
return (_jsxs(Flex, { as: StyledNumberUnit, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ...restProps, children: [_jsx(Input, { type: 'number', placeholder: '0', "aria-labelledby": id, value: msToTimeUnit(valueInMs, unit), onChange: onNumberInputChange, onBlur: onInputBlur, onKeyDown: onInputKeyDown, required: required, status: status, readOnly: readOnly, disabled: disabled, autoFocus: autoFocus }, 'number'), _jsx(Select, { id: id, "aria-label": t(`${unit}_text`), value: unit, required: required, status: status, readOnly: readOnly, disabled: disabled || readOnly, onChange: onSelectChange, children: unitOptions }, 'unit')] }, void 0));
|
|
85
84
|
};
|
|
86
85
|
export default NumberUnit;
|
|
87
86
|
//# sourceMappingURL=NumberUnit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberUnit.js","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/NumberUnit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,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,EAEb,WAAW,EAAC,GAAG,qBACE,EAAE,EACnB,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE,IAAI,CAAQ,EAC3C,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,IAXhB,QAAQ,CAYZ,EACF,KAAC,MAAM,IACL,EAAE,EAAE,EAAE,gBACM,CAAC,CAAC,GAAG,IAAI,OAAgC,CAAC,EAEtD,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,cAAc,YAEvB,WAAW,IARR,MAAM,CASH,YACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { ChangeEvent, FC, KeyboardEvent, useCallback, useEffect, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { TranslationPack } from '../../../../i18n';\nimport { useDirection, useI18n, useUID } from '../../../../hooks';\nimport StyledInput from '../../../Input/Input.styles';\nimport { StyledSelect } from '../../../Select/Select';\nimport { ForwardProps } from '../../../../types';\nimport { msToTimeUnit, timeUnitToMs } from '../utils';\nimport StyledDateTime from '../DateTime.styles';\nimport { StyledFormControl } from '../../../FormControl';\nimport Flex from '../../../Flex';\nimport Input from '../../../Input';\nimport Select, { Option } from '../../../Select';\nimport { defaultThemeProp } from '../../../../theme';\n\nimport DurationInputProps, { Format } from './DurationInput.types';\n\nexport const StyledNumberUnit = styled(StyledDateTime)<DurationInputProps>(() => {\n const { start, end } = useDirection();\n return css`\n padding: 0;\n border: 0;\n height: auto;\n &:focus-within:not([readonly]):not([disabled]) {\n box-shadow: none;\n }\n > ${StyledInput} {\n background-color: transparent;\n border-top-${end}-radius: 0;\n border-bottom-${end}-radius: 0;\n }\n > ${StyledSelect} {\n max-width: max-content;\n margin-inline-start: -0.0625rem;\n background-color: transparent;\n border-top-${start}-radius: 0;\n border-bottom-${start}-radius: 0;\n }\n &[readonly] > ${StyledSelect} {\n color: currentcolor;\n opacity: 1;\n cursor: default;\n }\n > ${StyledInput}:hover:not([readonly]):not([disabled]) + ${StyledSelect} {\n border-inline-start: transparent;\n }\n `;\n});\n\nStyledNumberUnit.defaultProps = defaultThemeProp;\n\ntype NumberUnitProps = DurationInputProps & ForwardProps;\n\nconst OPTIONS = [Format.Seconds, Format.Minutes, Format.Hours, Format.Days];\n\nconst NumberUnit: FC<NumberUnitProps> = (props: DurationInputProps) => {\n const {\n defaultValue = 0,\n value,\n onChange,\n format = Format.Seconds,\n onSelect,\n disabled,\n readOnly,\n required,\n status,\n autoFocus,\n ...restProps\n } = props;\n const t = useI18n();\n const [valueInMs, setValueInMs] = useState<number>(value ?? defaultValue);\n const [unit, setUnit] = useState<Format>(format);\n\n useEffect(() => {\n setUnit(format);\n }, [format]);\n\n useEffect(() => {\n if (value !== undefined) {\n setValueInMs(value);\n }\n }, [value]);\n\n const onNumberInputChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n const inputValue = Number(ev.target.value);\n if (Number.isNaN(inputValue) || inputValue < 0) return;\n setValueInMs(timeUnitToMs(inputValue, unit));\n },\n [unit]\n );\n\n const onInputBlur = useCallback(() => {\n if (!disabled && !readOnly && onChange) {\n onChange(valueInMs);\n }\n }, [valueInMs, onChange]);\n\n const onInputKeyDown = useCallback((ev: KeyboardEvent<HTMLInputElement>) => {\n if (['e', 'E', '+', '-', ',', '.'].includes(ev.key)) ev.preventDefault();\n }, []);\n\n const onSelectChange = useCallback(\n (ev: ChangeEvent<HTMLSelectElement>) => {\n const selectedValue = ev.target.value as Format;\n setUnit(selectedValue);\n onSelect?.(selectedValue);\n },\n [onSelect]\n );\n\n const unitOptions = OPTIONS.map(option => (\n <Option key={option} value={option}>\n {t(`${option}_text` as keyof TranslationPack)}\n </Option>\n ));\n\n const id = useUID();\n\n return (\n <Flex\n as={StyledNumberUnit}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n {...restProps}\n >\n <Input\n type='number'\n key='number'\n placeholder='0'\n aria-labelledby={id}\n value={msToTimeUnit(valueInMs, unit) as any}\n onChange={onNumberInputChange}\n onBlur={onInputBlur}\n onKeyDown={onInputKeyDown}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n autoFocus={autoFocus}\n />\n <Select\n id={id}\n aria-label={t(`${unit}_text` as keyof TranslationPack)}\n key='unit'\n value={unit}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled || readOnly}\n onChange={onSelectChange}\n >\n {unitOptions}\n </Select>\n </Flex>\n );\n};\n\nexport default NumberUnit;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/Time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/Time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASjD,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,aAAK,SAAS,GAAG,kBAAkB,GAAG,YAAY,CAAC;AAEnD,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAgGvB,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from 'react';
|
|
2
|
+
import { useCallback, useRef } from 'react';
|
|
3
3
|
import { useI18n, useFocusWithin } from '../../../../hooks';
|
|
4
4
|
import { msToTimeFormat, timeFormatToMs } from '../utils';
|
|
5
5
|
import StyledDateTime from '../DateTime.styles';
|
|
@@ -19,34 +19,31 @@ const Time = (props) => {
|
|
|
19
19
|
];
|
|
20
20
|
useAutoFocusNextInput([hourInputRef, minuteInputRef, secondInputRef]);
|
|
21
21
|
const pickParts = () => {
|
|
22
|
-
var _a, _b, _c;
|
|
23
22
|
return [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
hourInputRef.current?.value || undefined,
|
|
24
|
+
minuteInputRef.current?.value || undefined,
|
|
25
|
+
secondInputRef.current?.value || undefined
|
|
27
26
|
];
|
|
28
27
|
};
|
|
29
|
-
const onFocusChange = (focused) => {
|
|
30
|
-
var _a, _b, _c;
|
|
28
|
+
const onFocusChange = useCallback((focused) => {
|
|
31
29
|
if (!focused && !disabled && !readOnly && onChange) {
|
|
32
30
|
const parts = pickParts();
|
|
33
31
|
onChange(parts.some(v => v !== undefined)
|
|
34
32
|
? timeFormatToMs({
|
|
35
|
-
hour: Number(
|
|
36
|
-
minute: Number(
|
|
37
|
-
second: Number(
|
|
33
|
+
hour: Number(parts[0] ?? 0),
|
|
34
|
+
minute: Number(parts[1] ?? 0),
|
|
35
|
+
second: Number(parts[2] ?? 0)
|
|
38
36
|
})
|
|
39
37
|
: undefined);
|
|
40
38
|
}
|
|
41
|
-
};
|
|
39
|
+
}, [disabled, readOnly, onChange]);
|
|
42
40
|
const t = useI18n();
|
|
43
41
|
const containerRef = useRef(null);
|
|
44
42
|
useFocusWithin([containerRef], onFocusChange);
|
|
45
|
-
return (_jsxs(Flex,
|
|
46
|
-
var _a;
|
|
43
|
+
return (_jsxs(Flex, { as: StyledDateTime, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
47
44
|
if (e.target === containerRef.current)
|
|
48
|
-
|
|
49
|
-
}
|
|
45
|
+
hourInputRef.current?.focus();
|
|
46
|
+
}, ...restProps, children: [_jsx(PartInput, { placeholder: t('hour_placeholder'), "aria-label": t('hour_label_a11y'), value: time.hour, readOnly: readOnly, ref: hourInputRef, autoFocus: autoFocus }, 'hour'), ":", _jsx(PartInput, { placeholder: t('minute_placeholder'), "aria-label": t('minute_label_a11y'), value: time.minute, size: 2, maxLength: 2, readOnly: readOnly, max: 59, ref: minuteInputRef }, 'minute'), ":", _jsx(PartInput, { placeholder: t('second_placeholder'), "aria-label": t('second_label_a11y'), value: time.second, size: 2, maxLength: 2, readOnly: readOnly, max: 59, ref: secondInputRef }, 'second')] }, void 0));
|
|
50
47
|
};
|
|
51
48
|
export default Time;
|
|
52
49
|
//# sourceMappingURL=Time.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/Time.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../../../src/components/DateTime/Input/Duration/Time.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAM7D,MAAM,IAAI,GAAkB,CAAC,KAAyB,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QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,EAAE,EACP,GAAG,EAAE,cAAc,IARf,QAAQ,CASZ,OAEF,KAAC,SAAS,IAER,WAAW,EAAE,CAAC,CAAC,oBAAoB,CAAC,gBACxB,CAAC,CAAC,mBAAmB,CAAC,EAClC,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,EAAE,EACP,GAAG,EAAE,cAAc,IARf,QAAQ,CASZ,YACG,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,IAAI,CAAC","sourcesContent":["import { FC, useCallback, useRef } from 'react';\n\nimport { ForwardProps } from '../../../../types';\nimport { useI18n, useFocusWithin } from '../../../../hooks';\nimport { msToTimeFormat, timeFormatToMs } from '../utils';\nimport StyledDateTime from '../DateTime.styles';\nimport { StyledFormControl } from '../../../FormControl';\nimport Flex from '../../../Flex';\nimport PartInput from '../PartInput';\nimport useAutoFocusNextInput from '../useAutoFocusNextInput';\n\nimport DurationInputProps from './DurationInput.types';\n\ntype TimeProps = DurationInputProps & ForwardProps;\n\nconst Time: FC<TimeProps> = (props: DurationInputProps) => {\n const { value, onChange, disabled, readOnly, required, status, autoFocus, ...restProps } = props;\n\n const time =\n value !== undefined\n ? msToTimeFormat(value)\n : { hour: undefined, minute: undefined, second: undefined };\n\n const [hourInputRef, minuteInputRef, secondInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(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 secondInputRef.current?.value || undefined\n ];\n };\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n if (!focused && !disabled && !readOnly && onChange) {\n const parts = pickParts();\n onChange(\n parts.some(v => v !== undefined)\n ? timeFormatToMs({\n hour: Number(parts[0] ?? 0),\n minute: Number(parts[1] ?? 0),\n second: Number(parts[2] ?? 0)\n })\n : undefined\n );\n }\n },\n [disabled, readOnly, onChange]\n );\n\n const t = useI18n();\n\n const containerRef = useRef<HTMLElement>(null);\n useFocusWithin([containerRef], onFocusChange);\n\n return (\n <Flex\n as={StyledDateTime}\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 <PartInput\n key='hour'\n placeholder={t('hour_placeholder')}\n aria-label={t('hour_label_a11y')}\n value={time.hour}\n readOnly={readOnly}\n ref={hourInputRef}\n autoFocus={autoFocus}\n />\n :\n <PartInput\n key='minute'\n placeholder={t('minute_placeholder')}\n aria-label={t('minute_label_a11y')}\n value={time.minute}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={minuteInputRef}\n />\n :\n <PartInput\n key='second'\n placeholder={t('second_placeholder')}\n aria-label={t('second_label_a11y')}\n value={time.second}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n max={59}\n ref={secondInputRef}\n />\n </Flex>\n );\n};\nexport default Time;\n"]}
|
|
@@ -64,7 +64,6 @@ const reducer = (state, action) => {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
const MonthInput = forwardRef((props, ref) => {
|
|
67
|
-
var _a, _b, _c, _d;
|
|
68
67
|
const { locale } = useConfiguration();
|
|
69
68
|
const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, info, status, required, readOnly, disabled, onChange, onFocus, onBlur, autoFocus, ...restProps } = props;
|
|
70
69
|
const date = value ? parseToDate(value) : undefined;
|
|
@@ -74,13 +73,13 @@ const MonthInput = forwardRef((props, ref) => {
|
|
|
74
73
|
const years = range(minYear, maxYear);
|
|
75
74
|
const months = useMemo(() => getLocalizedMonths(locale), [locale]);
|
|
76
75
|
const [state, dispatch] = useReducer(reducer, [
|
|
77
|
-
date
|
|
78
|
-
date
|
|
76
|
+
date?.getUTCFullYear().toString(),
|
|
77
|
+
date?.getUTCMonth().toString()
|
|
79
78
|
]);
|
|
80
79
|
useEffect(() => {
|
|
81
|
-
dispatch({ field: 'month', value: date
|
|
82
|
-
dispatch({ field: 'year', value: date
|
|
83
|
-
}, [date
|
|
80
|
+
dispatch({ field: 'month', value: date?.getUTCMonth().toString() });
|
|
81
|
+
dispatch({ field: 'year', value: date?.getUTCFullYear().toString() });
|
|
82
|
+
}, [date?.toLocaleDateString()]);
|
|
84
83
|
const onFocusChange = (focused) => {
|
|
85
84
|
const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), state);
|
|
86
85
|
if (onFocus && focused)
|
|
@@ -91,20 +90,17 @@ const MonthInput = forwardRef((props, ref) => {
|
|
|
91
90
|
const onSelectChange = (field) => (ev) => {
|
|
92
91
|
const action = { field, value: ev.target.value };
|
|
93
92
|
dispatch(action);
|
|
94
|
-
onChange
|
|
93
|
+
onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), reducer(state, action)));
|
|
95
94
|
};
|
|
96
95
|
const containerRef = useConsolidatedRef(ref);
|
|
97
96
|
useFocusWithin([containerRef], onFocusChange);
|
|
98
97
|
const t = useI18n();
|
|
99
|
-
const monthOptions = months.map((month, index) => (_jsx(Option,
|
|
100
|
-
const yearOptions = years.map(year => (_jsx(Option,
|
|
101
|
-
const Month = (_jsxs(Select,
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const Comp = (_jsxs(Flex, Object.assign({ as: StyledMonthInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, ref: containerRef, status: status, disabled: disabled, readOnly: readOnly }, restProps, { children: [Month,
|
|
106
|
-
Year] }), void 0));
|
|
107
|
-
return label ? (_jsx(FormField, Object.assign({ as: 'fieldset', labelAs: 'legend' }, { label, labelHidden, id, info, status, required, disabled }, { children: Comp }), void 0)) : (Comp);
|
|
98
|
+
const monthOptions = months.map((month, index) => (_jsx(Option, { value: index.toString(), children: months[index] }, month)));
|
|
99
|
+
const yearOptions = years.map(year => (_jsx(Option, { value: year.toString(), children: year.toString() }, year.toString())));
|
|
100
|
+
const Month = (_jsxs(Select, { "aria-label": t('month_label_a11y'), readOnly: readOnly, required: required, value: state[1]?.toString() ?? '', onChange: onSelectChange('month'), status: status, disabled: disabled, autoFocus: autoFocus, children: [!required && _jsx(Option, { children: " " }, 'null'), monthOptions] }, 'month'));
|
|
101
|
+
const Year = (_jsxs(Select, { "aria-label": t('year_label_a11y'), readOnly: readOnly, required: required, value: state[0]?.toString() ?? '', onChange: onSelectChange('year'), status: status, disabled: disabled, children: [!required && _jsx(Option, { children: " " }, 'null'), yearOptions] }, 'year'));
|
|
102
|
+
const Comp = (_jsxs(Flex, { as: StyledMonthInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, ref: containerRef, status: status, disabled: disabled, readOnly: readOnly, ...restProps, children: [Month, Year] }, void 0));
|
|
103
|
+
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, status, required, disabled }, children: Comp }, void 0)) : (Comp);
|
|
108
104
|
});
|
|
109
105
|
export default MonthInput;
|
|
110
106
|
//# sourceMappingURL=MonthInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/MonthInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EAGV,UAAU,EAEV,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,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,EAAC,UAAU,EACb,OAAO,EAAC,QAAQ,IACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAE/D,IAAI,YACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n useMemo,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useReducer,\n ChangeEvent,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { ForwardProps } from '../../../types';\nimport { range } from '../../../utils';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useFocusWithin,\n useI18n\n} from '../../../hooks';\nimport FormField from '../../FormField';\nimport Select, { Option } from '../../Select';\nimport { StyledSelect } from '../../Select/Select';\nimport Flex from '../../Flex';\nimport { StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport { parseToDate, getLocalizedMonths } from './utils';\nimport StyledDateTime from './DateTime.styles';\n\nexport interface MonthInputProps extends DateTimeProps {}\n\nexport const StyledMonthInput = styled(StyledDateTime)<MonthInputProps>(() => {\n const { start, end } = useDirection();\n return css`\n padding: 0;\n border: 0;\n ${StyledSelect} {\n min-width: 0;\n &:first-child {\n border-top-${end}-radius: 0;\n border-bottom-${end}-radius: 0;\n }\n &:last-child {\n max-width: max-content;\n margin-inline-start: -0.0625rem;\n border-top-${start}-radius: 0;\n border-bottom-${start}-radius: 0;\n }\n }\n `;\n});\n\nStyledMonthInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, month] = parts.map(Number);\n date.setUTCFullYear(year, month);\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\ntype Field = 'month' | 'year';\ntype State = [year: string | undefined, month: string | undefined];\n\nconst reducer = (state: State, action: { field: Field; value: string | undefined }): State => {\n switch (action.field) {\n case 'year':\n return [action.value, state[1]];\n case 'month':\n return [state[0], action.value];\n default:\n return state.slice(0) as State;\n }\n};\n\nconst MonthInput: FunctionComponent<MonthInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<MonthInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n info,\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n ...restProps\n } = props;\n\n const date = value ? parseToDate(value) : undefined;\n const currentYear = date ? date.getUTCFullYear() : new Date().getFullYear();\n\n const minYear = min ? parseToDate(min).getUTCFullYear() : currentYear - 10;\n const maxYear = max ? parseToDate(max).getUTCFullYear() : currentYear + 10;\n\n const years = range(minYear, maxYear);\n const months = useMemo(() => getLocalizedMonths(locale), [locale]);\n\n const [state, dispatch] = useReducer(reducer, [\n date?.getUTCFullYear().toString(),\n date?.getUTCMonth().toString()\n ]);\n\n useEffect(() => {\n dispatch({ field: 'month', value: date?.getUTCMonth().toString() });\n dispatch({ field: 'year', value: date?.getUTCFullYear().toString() });\n }, [date?.toLocaleDateString()]);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), state);\n if (onFocus && focused) onFocus(callbackParam);\n else if (onBlur && !focused) onBlur(callbackParam);\n };\n\n const onSelectChange = (field: Field) => (ev: ChangeEvent<HTMLSelectElement>) => {\n const action = { field, value: ev.target.value };\n dispatch(action);\n onChange?.(\n convertToCallbackParameter(date ? new Date(date) : new Date(), reducer(state, action))\n );\n };\n\n const containerRef = useConsolidatedRef<HTMLElement>(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const t = useI18n();\n\n const monthOptions = months.map((month, index) => (\n <Option key={month} value={index.toString()}>\n {months[index]}\n </Option>\n ));\n const yearOptions = years.map(year => (\n <Option key={year.toString()} value={year.toString()}>\n {year.toString()}\n </Option>\n ));\n\n const Month = (\n <Select\n key='month'\n aria-label={t('month_label_a11y')}\n readOnly={readOnly}\n required={required}\n value={state[1]?.toString() ?? ''}\n onChange={onSelectChange('month')}\n status={status}\n disabled={disabled}\n autoFocus={autoFocus}\n >\n {!required && <Option key='null'> </Option>}\n {monthOptions}\n </Select>\n );\n\n const Year = (\n <Select\n aria-label={t('year_label_a11y')}\n key='year'\n readOnly={readOnly}\n required={required}\n value={state[0]?.toString() ?? ''}\n onChange={onSelectChange('year')}\n status={status}\n disabled={disabled}\n >\n {!required && <Option key='null'> </Option>}\n {yearOptions}\n </Select>\n );\n\n const Comp = (\n <Flex\n as={StyledMonthInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n ref={containerRef}\n status={status}\n disabled={disabled}\n readOnly={readOnly}\n {...restProps}\n >\n {Month}\n {Year}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default MonthInput;\n"]}
|
|
1
|
+
{"version":3,"file":"MonthInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/MonthInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EAGV,UAAU,EAEV,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,KAA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D,IAAI,WACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n useMemo,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useReducer,\n ChangeEvent,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { ForwardProps } from '../../../types';\nimport { range } from '../../../utils';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useFocusWithin,\n useI18n\n} from '../../../hooks';\nimport FormField from '../../FormField';\nimport Select, { Option } from '../../Select';\nimport { StyledSelect } from '../../Select/Select';\nimport Flex from '../../Flex';\nimport { StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport { parseToDate, getLocalizedMonths } from './utils';\nimport StyledDateTime from './DateTime.styles';\n\nexport interface MonthInputProps extends DateTimeProps {}\n\nexport const StyledMonthInput = styled(StyledDateTime)<MonthInputProps>(() => {\n const { start, end } = useDirection();\n return css`\n padding: 0;\n border: 0;\n ${StyledSelect} {\n min-width: 0;\n &:first-child {\n border-top-${end}-radius: 0;\n border-bottom-${end}-radius: 0;\n }\n &:last-child {\n max-width: max-content;\n margin-inline-start: -0.0625rem;\n border-top-${start}-radius: 0;\n border-bottom-${start}-radius: 0;\n }\n }\n `;\n});\n\nStyledMonthInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, month] = parts.map(Number);\n date.setUTCFullYear(year, month);\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\ntype Field = 'month' | 'year';\ntype State = [year: string | undefined, month: string | undefined];\n\nconst reducer = (state: State, action: { field: Field; value: string | undefined }): State => {\n switch (action.field) {\n case 'year':\n return [action.value, state[1]];\n case 'month':\n return [state[0], action.value];\n default:\n return state.slice(0) as State;\n }\n};\n\nconst MonthInput: FunctionComponent<MonthInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<MonthInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n info,\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n ...restProps\n } = props;\n\n const date = value ? parseToDate(value) : undefined;\n const currentYear = date ? date.getUTCFullYear() : new Date().getFullYear();\n\n const minYear = min ? parseToDate(min).getUTCFullYear() : currentYear - 10;\n const maxYear = max ? parseToDate(max).getUTCFullYear() : currentYear + 10;\n\n const years = range(minYear, maxYear);\n const months = useMemo(() => getLocalizedMonths(locale), [locale]);\n\n const [state, dispatch] = useReducer(reducer, [\n date?.getUTCFullYear().toString(),\n date?.getUTCMonth().toString()\n ]);\n\n useEffect(() => {\n dispatch({ field: 'month', value: date?.getUTCMonth().toString() });\n dispatch({ field: 'year', value: date?.getUTCFullYear().toString() });\n }, [date?.toLocaleDateString()]);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), state);\n if (onFocus && focused) onFocus(callbackParam);\n else if (onBlur && !focused) onBlur(callbackParam);\n };\n\n const onSelectChange = (field: Field) => (ev: ChangeEvent<HTMLSelectElement>) => {\n const action = { field, value: ev.target.value };\n dispatch(action);\n onChange?.(\n convertToCallbackParameter(date ? new Date(date) : new Date(), reducer(state, action))\n );\n };\n\n const containerRef = useConsolidatedRef<HTMLElement>(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const t = useI18n();\n\n const monthOptions = months.map((month, index) => (\n <Option key={month} value={index.toString()}>\n {months[index]}\n </Option>\n ));\n const yearOptions = years.map(year => (\n <Option key={year.toString()} value={year.toString()}>\n {year.toString()}\n </Option>\n ));\n\n const Month = (\n <Select\n key='month'\n aria-label={t('month_label_a11y')}\n readOnly={readOnly}\n required={required}\n value={state[1]?.toString() ?? ''}\n onChange={onSelectChange('month')}\n status={status}\n disabled={disabled}\n autoFocus={autoFocus}\n >\n {!required && <Option key='null'> </Option>}\n {monthOptions}\n </Select>\n );\n\n const Year = (\n <Select\n aria-label={t('year_label_a11y')}\n key='year'\n readOnly={readOnly}\n required={required}\n value={state[0]?.toString() ?? ''}\n onChange={onSelectChange('year')}\n status={status}\n disabled={disabled}\n >\n {!required && <Option key='null'> </Option>}\n {yearOptions}\n </Select>\n );\n\n const Comp = (\n <Flex\n as={StyledMonthInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n ref={containerRef}\n status={status}\n disabled={disabled}\n readOnly={readOnly}\n {...restProps}\n >\n {Month}\n {Year}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default MonthInput;\n"]}
|
|
@@ -9,9 +9,8 @@ const PartInput = forwardRef(({ value, onChange, readOnly, min = 0, max = Infini
|
|
|
9
9
|
}, []);
|
|
10
10
|
const inputRef = useConsolidatedRef(ref);
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
var _a;
|
|
13
12
|
if (inputRef.current && !Number.isNaN(value)) {
|
|
14
|
-
inputRef.current.value =
|
|
13
|
+
inputRef.current.value = value?.toString().padStart(2, '0') ?? '';
|
|
15
14
|
}
|
|
16
15
|
}, [value, inputRef.current]);
|
|
17
16
|
const onInputChange = useCallback((ev) => {
|
|
@@ -25,10 +24,10 @@ const PartInput = forwardRef(({ value, onChange, readOnly, min = 0, max = Infini
|
|
|
25
24
|
const targetEl = ev.target;
|
|
26
25
|
if (targetEl.value !== '')
|
|
27
26
|
targetEl.value = targetEl.value.padStart(2, '0');
|
|
28
|
-
onChange
|
|
27
|
+
onChange?.(targetEl.value);
|
|
29
28
|
}, [onChange]);
|
|
30
29
|
const defaultValue = value ? value.toString().padStart(2, '0') : '';
|
|
31
|
-
return (_jsx(BareInput,
|
|
30
|
+
return (_jsx(BareInput, { type: 'number', defaultValue: defaultValue, onBlur: onBlur, onKeyDown: onKeyDown, onChange: onInputChange, step: 1, min: min, max: max, maxLength: maxLength, readOnly: readOnly, ref: inputRef, size: size, ...restProps }, void 0));
|
|
32
31
|
});
|
|
33
32
|
export default PartInput;
|
|
34
33
|
//# sourceMappingURL=PartInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/PartInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,UAAU,EAGV,WAAW,EACX,SAAS,EAEV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAW9C,MAAM,SAAS,GAAqD,UAAU,CAC5E,CACE,EACE,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,CAAC,EACR,SAAS,GAAG,QAAQ,EACpB,GAAG,SAAS,EACoB,EAClC,GAA0B,EAC1B,EAAE;IACF,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,EAAmC,EAAE,EAAE;QACpE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;YAAE,EAAE,CAAC,cAAc,EAAE,CAAC;IAC3E,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,QA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QAAQ,EAClB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,KACN,SAAS,WACb,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n FocusEvent,\n KeyboardEvent,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useCallback,\n useEffect,\n ChangeEvent\n} from 'react';\n\nimport { useConsolidatedRef } from '../../../hooks';\nimport { ForwardProps, OmitStrict } from '../../../types';\nimport { InputProps } from '../../Input/Input';\n\nimport { BareInput } from './DateTime.styles';\n\nexport interface PartInputProps extends OmitStrict<InputProps, 'defaultValue' | 'value'> {\n value?: number;\n min?: number;\n max?: number;\n maxLength?: number;\n size?: number;\n onChange?: (value?: string) => void;\n}\n\nconst PartInput: FunctionComponent<PartInputProps & ForwardProps> = forwardRef(\n (\n {\n value,\n onChange,\n readOnly,\n min = 0,\n max = Infinity,\n size = 2,\n maxLength = Infinity,\n ...restProps\n }: PropsWithoutRef<PartInputProps>,\n ref: Ref<HTMLInputElement>\n ) => {\n const onKeyDown = useCallback((ev: KeyboardEvent<HTMLInputElement>) => {\n if (['+', '-', 'e', 'E', '.', ','].includes(ev.key)) ev.preventDefault();\n }, []);\n\n const inputRef = useConsolidatedRef(ref);\n useEffect(() => {\n if (inputRef.current && !Number.isNaN(value)) {\n inputRef.current.value = value?.toString().padStart(2, '0') ?? '';\n }\n }, [value, inputRef.current]);\n\n const onInputChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n const targetEl = ev.target;\n if (targetEl.value.length > maxLength) targetEl.value = targetEl.value.slice(0, maxLength);\n else if (size !== maxLength)\n targetEl.style.width = `${Math.max(targetEl.value.length, size)}ch`;\n },\n [maxLength]\n );\n\n const onBlur = useCallback(\n (ev: FocusEvent<HTMLInputElement>) => {\n const targetEl = ev.target;\n if (targetEl.value !== '') targetEl.value = targetEl.value.padStart(2, '0');\n onChange?.(targetEl.value);\n },\n [onChange]\n );\n\n const defaultValue = value ? value.toString().padStart(2, '0') : '';\n\n return (\n <BareInput\n type='number'\n defaultValue={defaultValue}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n onChange={onInputChange}\n step={1}\n min={min}\n max={max}\n maxLength={maxLength}\n readOnly={readOnly}\n ref={inputRef}\n size={size}\n {...restProps}\n />\n );\n }\n);\n\nexport default PartInput;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ForwardProps } from '../../../types';
|
|
3
|
+
import DateTimeProps from '../DateTime.types';
|
|
4
|
+
export interface QuarterInputProps extends DateTimeProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StyledQuarterInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, QuarterInputProps, never>;
|
|
7
|
+
declare const QuarterInput: FunctionComponent<QuarterInputProps & ForwardProps>;
|
|
8
|
+
export default QuarterInput;
|
|
9
|
+
//# sourceMappingURL=QuarterInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuarterInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/QuarterInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAW7E,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CAAG;AAE3D,eAAO,MAAM,kBAAkB,wHAmB7B,CAAC;AA4CH,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAiIrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useReducer } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import FormField from '../../FormField';
|
|
5
|
+
import Select, { Option } from '../../Select';
|
|
6
|
+
import Flex from '../../Flex';
|
|
7
|
+
import { range } from '../../../utils';
|
|
8
|
+
import { useConsolidatedRef, useDirection, useFocusWithin, useI18n } from '../../../hooks';
|
|
9
|
+
import { StyledSelect } from '../../Select/Select';
|
|
10
|
+
import { defaultThemeProp } from '../../../theme';
|
|
11
|
+
import { StyledFormControl } from '../../FormControl';
|
|
12
|
+
import { getQuarter, parseToDate } from './utils';
|
|
13
|
+
import StyledDateTime from './DateTime.styles';
|
|
14
|
+
export const StyledQuarterInput = styled(StyledDateTime)(() => {
|
|
15
|
+
const { start, end } = useDirection();
|
|
16
|
+
return css `
|
|
17
|
+
padding: 0;
|
|
18
|
+
border: 0;
|
|
19
|
+
${StyledSelect} {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
&:first-child {
|
|
22
|
+
${`border-top-${end}-radius`}: 0;
|
|
23
|
+
${`border-bottom-${end}-radius`}: 0;
|
|
24
|
+
}
|
|
25
|
+
&:last-child {
|
|
26
|
+
max-width: max-content;
|
|
27
|
+
margin-inline-start: -0.0625rem;
|
|
28
|
+
${`border-top-${start}-radius`}: 0;
|
|
29
|
+
${`border-bottom-${start}-radius`}: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
});
|
|
34
|
+
StyledQuarterInput.defaultProps = defaultThemeProp;
|
|
35
|
+
const convertToCallbackParameter = (date, parts) => {
|
|
36
|
+
if (parts.every(Boolean)) {
|
|
37
|
+
const [year, quarter] = parts.map(Number);
|
|
38
|
+
const quarterStartMonth = [0, 3, 6, 9][quarter - 1];
|
|
39
|
+
date.setUTCFullYear(year, quarterStartMonth, 1);
|
|
40
|
+
return {
|
|
41
|
+
valueAsISOString: date.toISOString(),
|
|
42
|
+
valueAsTimestamp: date.getTime()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (parts.every(p => !p)) {
|
|
46
|
+
return {
|
|
47
|
+
valueAsISOString: '',
|
|
48
|
+
valueAsTimestamp: undefined
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
valueAsISOString: '',
|
|
53
|
+
valueAsTimestamp: NaN,
|
|
54
|
+
state: 'incomplete'
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const reducer = (state, action) => {
|
|
58
|
+
switch (action.field) {
|
|
59
|
+
case 'year':
|
|
60
|
+
return [action.value, state[1]];
|
|
61
|
+
case 'quarter':
|
|
62
|
+
return [state[0], action.value];
|
|
63
|
+
default:
|
|
64
|
+
return state.slice(0);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const QuarterInput = forwardRef((props, ref) => {
|
|
68
|
+
const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, info, status, required, readOnly, disabled, onChange, onFocus, onBlur, autoFocus, ...restProps } = props;
|
|
69
|
+
const date = value ? parseToDate(value) : undefined;
|
|
70
|
+
const currentYear = date ? date.getUTCFullYear() : new Date().getFullYear();
|
|
71
|
+
const minYear = min ? parseToDate(min).getUTCFullYear() : currentYear - 10;
|
|
72
|
+
const maxYear = max ? parseToDate(max).getUTCFullYear() : currentYear + 10;
|
|
73
|
+
const years = range(minYear, maxYear);
|
|
74
|
+
const [state, dispatch] = useReducer(reducer, [
|
|
75
|
+
date?.getUTCFullYear().toString(),
|
|
76
|
+
date && getQuarter(date).toString()
|
|
77
|
+
]);
|
|
78
|
+
const onFocusChange = (focused) => {
|
|
79
|
+
const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), state);
|
|
80
|
+
if (onFocus && focused)
|
|
81
|
+
onFocus(callbackParam);
|
|
82
|
+
else if (onBlur && !focused)
|
|
83
|
+
onBlur(callbackParam);
|
|
84
|
+
};
|
|
85
|
+
const onSelectChange = (field) => (ev) => {
|
|
86
|
+
const action = { field, value: ev.target.value };
|
|
87
|
+
dispatch(action);
|
|
88
|
+
onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), reducer(state, action)));
|
|
89
|
+
};
|
|
90
|
+
const containerRef = useConsolidatedRef(ref);
|
|
91
|
+
useFocusWithin([containerRef], onFocusChange);
|
|
92
|
+
const t = useI18n();
|
|
93
|
+
const quarters = [1, 2, 3, 4];
|
|
94
|
+
const quarterOptions = quarters.map(quarterNumber => (_jsx(Option, { value: quarterNumber.toString(), children: t(`date_quarter_q${quarterNumber}`).trim() }, t(`date_quarter_q${quarterNumber}`).trim())));
|
|
95
|
+
const yearOptions = years.map(year => (_jsx(Option, { value: year.toString(), children: year.toString() }, year.toString())));
|
|
96
|
+
const Quarter = (_jsxs(Select, { "aria-label": t('quarter_label_a11y'), readOnly: readOnly, required: required, value: state[1]?.toString() ?? '', onChange: onSelectChange('quarter'), status: status, disabled: disabled, autoFocus: autoFocus, children: [!required && _jsx(Option, { children: " " }, 'null'), quarterOptions] }, 'quarter'));
|
|
97
|
+
const Year = (_jsxs(Select, { "aria-label": t('year_label_a11y'), readOnly: readOnly, required: required, value: state[0]?.toString() ?? '', onChange: onSelectChange('year'), status: status, disabled: disabled, children: [!required && _jsx(Option, { children: " " }, 'null'), yearOptions] }, 'year'));
|
|
98
|
+
const Comp = (_jsxs(Flex, { ...restProps, as: StyledQuarterInput, forwardedAs: StyledFormControl, container: { alignItems: 'center' }, ref: containerRef, status: status, disabled: disabled, readOnly: readOnly, children: [Quarter, Year] }, void 0));
|
|
99
|
+
return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, status, required, disabled }, children: Comp }, void 0)) : (Comp);
|
|
100
|
+
});
|
|
101
|
+
export default QuarterInput;
|
|
102
|
+
//# sourceMappingURL=QuarterInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuarterInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/QuarterInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,UAAU,EACX,MAAM,OAAO,CAAC;AAC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CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n ChangeEvent,\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useReducer\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Select, { Option } from '../../Select';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\nimport Flex from '../../Flex';\nimport { range } from '../../../utils';\nimport { useConsolidatedRef, useDirection, useFocusWithin, useI18n } from '../../../hooks';\nimport { StyledSelect } from '../../Select/Select';\nimport { defaultThemeProp } from '../../../theme';\nimport { StyledFormControl } from '../../FormControl';\n\nimport { getQuarter, parseToDate, QuarterNumber } from './utils';\nimport StyledDateTime from './DateTime.styles';\n\nexport interface QuarterInputProps extends DateTimeProps {}\n\nexport const StyledQuarterInput = styled(StyledDateTime)<QuarterInputProps>(() => {\n const { start, end } = useDirection();\n return css`\n padding: 0;\n border: 0;\n ${StyledSelect} {\n min-width: 0;\n &:first-child {\n ${`border-top-${end}-radius`}: 0;\n ${`border-bottom-${end}-radius`}: 0;\n }\n &:last-child {\n max-width: max-content;\n margin-inline-start: -0.0625rem;\n ${`border-top-${start}-radius`}: 0;\n ${`border-bottom-${start}-radius`}: 0;\n }\n }\n `;\n});\n\nStyledQuarterInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, quarter] = parts.map(Number);\n const quarterStartMonth = [0, 3, 6, 9][quarter - 1];\n date.setUTCFullYear(year, quarterStartMonth, 1);\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\ntype Field = 'quarter' | 'year';\ntype State = [year: string | undefined, quarter: string | undefined];\n\nconst reducer = (state: State, action: { field: Field; value: string | undefined }): State => {\n switch (action.field) {\n case 'year':\n return [action.value, state[1]];\n case 'quarter':\n return [state[0], action.value];\n default:\n return state.slice(0) as State;\n }\n};\n\nconst QuarterInput: FunctionComponent<QuarterInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<QuarterInputProps>, ref: Ref<HTMLFieldSetElement>) => {\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n info,\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n autoFocus,\n ...restProps\n } = props;\n\n const date = value ? parseToDate(value) : undefined;\n const currentYear = date ? date.getUTCFullYear() : new Date().getFullYear();\n\n const minYear = min ? parseToDate(min).getUTCFullYear() : currentYear - 10;\n const maxYear = max ? parseToDate(max).getUTCFullYear() : currentYear + 10;\n\n const years = range(minYear, maxYear);\n\n const [state, dispatch] = useReducer(reducer, [\n date?.getUTCFullYear().toString(),\n date && getQuarter(date).toString()\n ]);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), state);\n if (onFocus && focused) onFocus(callbackParam);\n else if (onBlur && !focused) onBlur(callbackParam);\n };\n\n const onSelectChange = (field: Field) => (ev: ChangeEvent<HTMLSelectElement>) => {\n const action = { field, value: ev.target.value };\n dispatch(action);\n onChange?.(\n convertToCallbackParameter(date ? new Date(date) : new Date(), reducer(state, action))\n );\n };\n\n const containerRef = useConsolidatedRef<HTMLElement>(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const t = useI18n();\n\n const quarters: QuarterNumber[] = [1, 2, 3, 4];\n\n const quarterOptions = quarters.map(quarterNumber => (\n <Option key={t(`date_quarter_q${quarterNumber}`).trim()} value={quarterNumber.toString()}>\n {t(`date_quarter_q${quarterNumber}`).trim()}\n </Option>\n ));\n\n const yearOptions = years.map(year => (\n <Option key={year.toString()} value={year.toString()}>\n {year.toString()}\n </Option>\n ));\n\n const Quarter = (\n <Select\n aria-label={t('quarter_label_a11y')}\n key='quarter'\n readOnly={readOnly}\n required={required}\n value={state[1]?.toString() ?? ''}\n onChange={onSelectChange('quarter')}\n status={status}\n disabled={disabled}\n autoFocus={autoFocus}\n >\n {!required && <Option key='null'> </Option>}\n {quarterOptions}\n </Select>\n );\n\n const Year = (\n <Select\n aria-label={t('year_label_a11y')}\n key='year'\n readOnly={readOnly}\n required={required}\n value={state[0]?.toString() ?? ''}\n onChange={onSelectChange('year')}\n status={status}\n disabled={disabled}\n >\n {!required && <Option key='null'> </Option>}\n {yearOptions}\n </Select>\n );\n\n const Comp = (\n <Flex\n {...restProps}\n as={StyledQuarterInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center' }}\n ref={containerRef}\n status={status}\n disabled={disabled}\n readOnly={readOnly}\n >\n {Quarter}\n {Year}\n </Flex>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default QuarterInput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/TimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAKL,WAAW,EAEZ,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,qHAE3B,CAAC;AAyDF,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAiR/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|