@orfium/ictinus 4.75.0 → 4.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +9 -22
- package/dist/components/Avatar/Avatar.style.js +3 -18
- package/dist/components/Avatar/AvatarStack/AvatarStack.d.ts +1 -1
- package/dist/components/Avatar/AvatarStack/AvatarStack.js +8 -24
- package/dist/components/Avatar/AvatarStack/AvatarStack.style.js +1 -12
- package/dist/components/Avatar/AvatarStack/index.js +0 -3
- package/dist/components/Avatar/AvatarStack/utils.js +1 -3
- package/dist/components/Avatar/index.js +0 -3
- package/dist/components/Avatar/utils.js +0 -5
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +5 -17
- package/dist/components/Breadcrumb/Breadcrumb.style.js +1 -9
- package/dist/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.js +2 -9
- package/dist/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.style.js +0 -5
- package/dist/components/Breadcrumb/Separator/Separator.js +1 -10
- package/dist/components/Breadcrumb/Separator/Separator.style.js +0 -4
- package/dist/components/Breadcrumb/index.js +0 -3
- package/dist/components/Button/Button.js +22 -37
- package/dist/components/Button/Button.style.js +3 -9
- package/dist/components/Button/ButtonLoader/ButtonLoader.js +5 -16
- package/dist/components/Button/ButtonLoader/ButtonLoader.style.js +0 -6
- package/dist/components/Button/ButtonLoader/index.js +0 -3
- package/dist/components/Button/index.js +0 -3
- package/dist/components/Button/utils.js +1 -15
- package/dist/components/ButtonBase/ButtonBase.d.ts +4 -4
- package/dist/components/ButtonBase/ButtonBase.js +31 -41
- package/dist/components/ButtonBase/ButtonBase.style.js +10 -28
- package/dist/components/ButtonBase/config.js +1 -1
- package/dist/components/ButtonBase/index.js +0 -3
- package/dist/components/ButtonBase/utils.js +6 -20
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Card/Card.js +4 -10
- package/dist/components/Card/Card.style.js +3 -10
- package/dist/components/Card/index.js +0 -3
- package/dist/components/Chart/BarChart/BarChart.js +10 -29
- package/dist/components/Chart/BarChart/components/CustomLabel/CustomLabel.js +6 -13
- package/dist/components/Chart/BarChart/components/CustomLabel/index.js +0 -3
- package/dist/components/Chart/BarChart/components/CustomTooltip/CustomTooltip.js +5 -15
- package/dist/components/Chart/BarChart/components/CustomTooltip/CustomTooltip.style.js +1 -12
- package/dist/components/Chart/BarChart/components/CustomTooltip/index.js +0 -3
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/CustomTooltipContent.js +4 -11
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/CustomTooltipContent.style.js +1 -10
- package/dist/components/Chart/BarChart/components/CustomTooltipContent/index.js +0 -3
- package/dist/components/Chart/BarChart/index.js +0 -3
- package/dist/components/Chart/BarChart/utils.js +4 -24
- package/dist/components/Chart/DonutChart/DonutChart.js +2 -13
- package/dist/components/Chart/DonutChart/components/CustomLabel/CustomLabel.js +4 -11
- package/dist/components/Chart/DonutChart/components/CustomLabel/CustomLabel.style.js +0 -8
- package/dist/components/Chart/DonutChart/components/CustomLabel/index.js +0 -3
- package/dist/components/Chart/DonutChart/index.js +0 -3
- package/dist/components/Chart/LineChart/LineChart.js +7 -22
- package/dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.js +2 -8
- package/dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.style.js +1 -10
- package/dist/components/Chart/LineChart/components/CustomTooltip/index.js +0 -3
- package/dist/components/Chart/LineChart/components/GradientLine/GradientLine.js +1 -7
- package/dist/components/Chart/LineChart/components/GradientLine/index.js +0 -3
- package/dist/components/Chart/LineChart/index.js +0 -3
- package/dist/components/Chart/LineChart/story.utils.js +0 -5
- package/dist/components/Chart/LineChart/utils.js +3 -9
- package/dist/components/Chart/Wrapper.js +2 -14
- package/dist/components/CheckBox/CheckBox.js +17 -39
- package/dist/components/CheckBox/CheckBox.style.js +4 -26
- package/dist/components/CheckBox/index.js +0 -3
- package/dist/components/Chip/Chip.js +13 -33
- package/dist/components/Chip/Chip.style.js +5 -15
- package/dist/components/Chip/Chip.types.js +1 -1
- package/dist/components/Chip/components/Badge/Badge.js +3 -10
- package/dist/components/Chip/components/Badge/Badge.style.js +2 -7
- package/dist/components/Chip/components/Badge/index.js +0 -3
- package/dist/components/Chip/index.js +0 -3
- package/dist/components/Chip/utils.js +5 -8
- package/dist/components/DatePicker/DatePickInput/DatePickInput.js +16 -37
- package/dist/components/DatePicker/DatePickInput/DatePickInput.style.js +0 -5
- package/dist/components/DatePicker/DatePickInput/index.js +0 -3
- package/dist/components/DatePicker/DatePicker.js +31 -63
- package/dist/components/DatePicker/DatePicker.style.js +0 -4
- package/dist/components/DatePicker/Day/Day.js +15 -32
- package/dist/components/DatePicker/Day/Day.style.js +11 -23
- package/dist/components/DatePicker/Day/index.js +0 -3
- package/dist/components/DatePicker/Month/Month.js +6 -26
- package/dist/components/DatePicker/Month/Month.style.js +1 -12
- package/dist/components/DatePicker/Month/Month.utils.js +1 -25
- package/dist/components/DatePicker/Month/index.js +0 -3
- package/dist/components/DatePicker/OverlayComponent/OverlayComponent.js +17 -33
- package/dist/components/DatePicker/OverlayComponent/OverlayComponent.style.js +1 -21
- package/dist/components/DatePicker/OverlayComponent/components/MonthWrapper/MonthWrapper.js +13 -32
- package/dist/components/DatePicker/OverlayComponent/components/MonthWrapper/MonthWrapper.style.js +2 -20
- package/dist/components/DatePicker/OverlayComponent/index.js +0 -3
- package/dist/components/DatePicker/index.js +0 -4
- package/dist/components/DatePicker/utils.js +0 -7
- package/dist/components/Drawer/Drawer.js +0 -9
- package/dist/components/Drawer/Drawer.style.js +0 -6
- package/dist/components/Drawer/Navigation/MenuItem/MenuItem.js +10 -26
- package/dist/components/Drawer/Navigation/Navigation.js +5 -20
- package/dist/components/Drawer/Navigation/Navigation.style.js +1 -34
- package/dist/components/Drawer/index.js +0 -3
- package/dist/components/ExpandCollapse/ExpandCollapse.js +15 -31
- package/dist/components/ExpandCollapse/ExpandCollapse.style.js +0 -5
- package/dist/components/ExpandCollapse/index.js +0 -3
- package/dist/components/ExpandCollapse/useManageContentRef.js +0 -13
- package/dist/components/ExpandCollapse/utils.js +2 -4
- package/dist/components/Filter/Filter.js +54 -90
- package/dist/components/Filter/Filter.style.js +15 -46
- package/dist/components/Filter/components/FilterBase/FilterBase.js +18 -36
- package/dist/components/Filter/components/FilterBase/index.js +0 -3
- package/dist/components/Filter/components/MultiFilter/MultiFilter.js +9 -23
- package/dist/components/Filter/components/MultiFilter/MultiFilter.style.js +1 -11
- package/dist/components/Filter/components/MultiFilter/index.js +0 -3
- package/dist/components/Filter/components/Options/Options.js +7 -16
- package/dist/components/Filter/components/Options/Options.style.js +0 -6
- package/dist/components/Filter/components/SingleFilter/SingleFilter.js +10 -19
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/SearchInput.js +3 -16
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/SearchInput.style.js +1 -9
- package/dist/components/Filter/components/SingleFilter/components/SearchInput/index.js +0 -3
- package/dist/components/Filter/components/SingleFilter/index.js +0 -3
- package/dist/components/Filter/hooks/useMultiFilterUtils.js +14 -32
- package/dist/components/Filter/index.js +0 -3
- package/dist/components/Filter/utils.d.ts +1 -1
- package/dist/components/Filter/utils.js +17 -39
- package/dist/components/Icon/Icon.js +8 -16
- package/dist/components/Icon/Icon.style.js +3 -9
- package/dist/components/Icon/assets/iconSelector.js +0 -347
- package/dist/components/Icon/index.js +0 -4
- package/dist/components/IconButton/IconButton.js +10 -24
- package/dist/components/IconButton/IconButton.style.js +0 -3
- package/dist/components/IconButton/index.js +0 -3
- package/dist/components/Label/Label.js +9 -17
- package/dist/components/Label/Label.style.js +1 -8
- package/dist/components/Label/index.js +0 -3
- package/dist/components/List/List.js +11 -24
- package/dist/components/List/List.style.js +4 -16
- package/dist/components/List/ListItem/ListItem.js +14 -23
- package/dist/components/List/ListItem/ListItem.style.js +5 -14
- package/dist/components/List/ListItem/index.js +0 -3
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.js +4 -11
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.style.js +2 -11
- package/dist/components/List/ListItemGroup/ListGroupTitle/index.js +0 -3
- package/dist/components/List/ListItemGroup/ListItemGroup.js +6 -17
- package/dist/components/List/ListItemGroup/index.js +0 -3
- package/dist/components/List/NormalList/NormalList.js +9 -20
- package/dist/components/List/NormalList/index.js +0 -3
- package/dist/components/List/VirtualizedList/VirtualizedList.js +12 -34
- package/dist/components/List/VirtualizedList/index.js +0 -3
- package/dist/components/List/index.js +0 -3
- package/dist/components/List/utils.d.ts +1 -1
- package/dist/components/List/utils.js +5 -24
- package/dist/components/Loader/Loader.js +3 -10
- package/dist/components/Loader/Loader.style.js +0 -5
- package/dist/components/Loader/Loader.utils.d.ts +2 -2
- package/dist/components/Loader/Loader.utils.js +1 -12
- package/dist/components/Loader/components/DotsLoader/DotsLoader.js +1 -8
- package/dist/components/Loader/components/DotsLoader/DotsLoader.style.js +1 -14
- package/dist/components/Loader/components/DotsLoader/index.js +0 -3
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.js +1 -8
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.style.js +1 -19
- package/dist/components/Loader/components/IndeterminateLoader/index.js +0 -3
- package/dist/components/Loader/components/Spinner/Spinner.js +1 -8
- package/dist/components/Loader/components/Spinner/Spinner.style.js +0 -7
- package/dist/components/Loader/components/Spinner/index.js +0 -3
- package/dist/components/Loader/index.js +0 -3
- package/dist/components/Menu/Menu.js +24 -46
- package/dist/components/Menu/Menu.style.js +4 -11
- package/dist/components/Menu/index.js +0 -3
- package/dist/components/Modal/Modal.d.ts +2 -3
- package/dist/components/Modal/Modal.js +11 -26
- package/dist/components/Modal/Modal.style.js +1 -14
- package/dist/components/Modal/ModalContent/ModalContent.js +7 -17
- package/dist/components/Modal/ModalContent/ModalContent.style.js +1 -18
- package/dist/components/Modal/ModalContent/index.js +0 -3
- package/dist/components/Modal/index.js +0 -3
- package/dist/components/MultiTextFieldBase/MultiTextFieldBase.js +42 -67
- package/dist/components/MultiTextFieldBase/MultiTextFieldBase.style.js +7 -34
- package/dist/components/MultiTextFieldBase/hooks.js +9 -30
- package/dist/components/MultiTextFieldBase/index.js +0 -3
- package/dist/components/Notification/Banner/Banner.js +12 -20
- package/dist/components/Notification/Banner/index.js +0 -3
- package/dist/components/Notification/InlineNotification/InlineNotification.js +11 -19
- package/dist/components/Notification/InlineNotification/index.js +0 -3
- package/dist/components/Notification/Notification.style.js +3 -22
- package/dist/components/Notification/NotificationVisual/NotificationVisual.js +8 -19
- package/dist/components/Notification/NotificationVisual/NotificationVisual.style.js +1 -9
- package/dist/components/Notification/NotificationVisual/index.js +0 -3
- package/dist/components/Notification/NotificationsContainer/NotificationsContainer.js +3 -12
- package/dist/components/Notification/NotificationsContainer/NotificationsContainer.style.js +0 -8
- package/dist/components/Notification/NotificationsContainer/index.js +0 -3
- package/dist/components/Notification/Snackbar/Snackbar.js +13 -29
- package/dist/components/Notification/Snackbar/Snackbar.style.js +1 -18
- package/dist/components/Notification/Snackbar/index.js +0 -3
- package/dist/components/Notification/subcomponents/CompactNotification/CompactNotification.js +14 -32
- package/dist/components/Notification/subcomponents/CompactNotification/CompactNotification.style.js +1 -23
- package/dist/components/Notification/subcomponents/CompactNotification/index.js +0 -3
- package/dist/components/Notification/subcomponents/NotificationActionsArea/NotificationActionsArea.js +5 -13
- package/dist/components/Notification/subcomponents/NotificationActionsArea/index.js +0 -3
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.js +7 -18
- package/dist/components/Overlay/Overlay.style.js +3 -33
- package/dist/components/Overlay/index.js +0 -3
- package/dist/components/Pagination/Pagination.js +19 -29
- package/dist/components/Pagination/index.js +0 -3
- package/dist/components/Radio/Radio.js +19 -38
- package/dist/components/Radio/Radio.style.js +3 -27
- package/dist/components/Radio/index.js +0 -3
- package/dist/components/RadioGroup/RadioGroup.js +7 -22
- package/dist/components/RadioGroup/RadioGroupContext.js +0 -4
- package/dist/components/RadioGroup/index.js +0 -3
- package/dist/components/RadioGroup/useRadioGroup.js +0 -6
- package/dist/components/SearchField/SearchField.js +12 -31
- package/dist/components/SearchField/SearchFieldShowcase.js +4 -15
- package/dist/components/SearchField/index.js +0 -3
- package/dist/components/Select/Select.js +63 -124
- package/dist/components/Select/Select.style.js +1 -10
- package/dist/components/Select/components/SelectMenu/SelectMenu.js +7 -23
- package/dist/components/Select/components/SelectMenu/SelectMenu.style.js +5 -15
- package/dist/components/Select/components/SelectMenu/index.js +0 -3
- package/dist/components/Select/hooks/useMultiselectUtils.js +18 -39
- package/dist/components/Select/index.js +0 -3
- package/dist/components/Slider/Slider.js +12 -42
- package/dist/components/Slider/Slider.style.js +4 -9
- package/dist/components/Slider/components/SliderMark/SliderMark.js +7 -19
- package/dist/components/Slider/components/SliderMark/SliderMark.style.js +3 -7
- package/dist/components/Slider/components/SliderMark/index.js +0 -3
- package/dist/components/Slider/components/SliderThumb/SliderThumb.js +5 -13
- package/dist/components/Slider/components/SliderThumb/SliderThumb.style.js +4 -10
- package/dist/components/Slider/components/SliderThumb/index.js +0 -3
- package/dist/components/Slider/components/SliderTrack/SliderTrack.d.ts +2 -3
- package/dist/components/Slider/components/SliderTrack/SliderTrack.js +8 -20
- package/dist/components/Slider/components/SliderTrack/SliderTrack.style.js +1 -5
- package/dist/components/Slider/components/SliderTrack/index.js +0 -3
- package/dist/components/Slider/index.js +0 -3
- package/dist/components/Switch/Switch.js +8 -20
- package/dist/components/Switch/Switch.style.js +9 -14
- package/dist/components/Switch/index.js +0 -3
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/Table/Table.js +40 -76
- package/dist/components/Table/Table.style.js +1 -14
- package/dist/components/Table/TableRowContext.js +0 -4
- package/dist/components/Table/components/ExtendedColumnItem/ExtendedColumnItem.js +10 -27
- package/dist/components/Table/components/ExtendedColumnItem/ExtendedColumnItem.style.js +0 -9
- package/dist/components/Table/components/ExtendedColumnItem/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/RenderRowOrNestedRow.js +30 -59
- package/dist/components/Table/components/RenderRowOrNestedRow/RenderRowOrNestedRow.style.js +4 -13
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.js +12 -22
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.style.js +0 -4
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ExpandedButtonCell/ExpandedButtonCell.js +6 -16
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ExpandedButtonCell/index.js +0 -3
- package/dist/components/Table/components/RenderRowOrNestedRow/index.js +0 -3
- package/dist/components/Table/components/TableCell/TableCell.d.ts +2 -2
- package/dist/components/Table/components/TableCell/TableCell.js +24 -36
- package/dist/components/Table/components/TableCell/TableCell.style.js +0 -8
- package/dist/components/Table/components/TableCell/index.js +0 -3
- package/dist/components/Table/components/TableCell/utils.js +0 -3
- package/dist/components/Table/components/TableRow/TableRow.d.ts +2 -2
- package/dist/components/Table/components/TableRow/TableRow.js +6 -18
- package/dist/components/Table/components/TableRow/index.js +0 -3
- package/dist/components/Table/components/TableRowWrapper/TableRowWrapper.js +14 -24
- package/dist/components/Table/components/TableRowWrapper/index.js +0 -3
- package/dist/components/Table/index.js +0 -3
- package/dist/components/Table/utils/index.js +0 -2
- package/dist/components/Table/utils/utils.js +1 -7
- package/dist/components/TextArea/TextArea.js +10 -27
- package/dist/components/TextArea/TextArea.style.js +0 -4
- package/dist/components/TextArea/index.js +0 -3
- package/dist/components/TextField/TextField.js +55 -85
- package/dist/components/TextField/TextField.style.js +1 -6
- package/dist/components/TextField/components/commons.d.ts +3 -2
- package/dist/components/TextField/components/commons.js +2 -8
- package/dist/components/TextField/hooks/useMultiTextFieldUtils.js +14 -31
- package/dist/components/TextField/index.js +0 -3
- package/dist/components/TextInputBase/TextInputBase.d.ts +6 -6
- package/dist/components/TextInputBase/TextInputBase.js +21 -31
- package/dist/components/TextInputBase/TextInputBase.style.js +21 -43
- package/dist/components/TextInputBase/config.js +1 -1
- package/dist/components/TextInputBase/index.js +0 -4
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +2 -3
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -24
- package/dist/components/ThemeProvider/ThemeProvider.style.js +1 -9
- package/dist/components/ThemeProvider/index.js +0 -3
- package/dist/components/Toast/Toast.d.ts +2 -3
- package/dist/components/Toast/Toast.js +16 -33
- package/dist/components/Toast/Toast.style.js +1 -28
- package/dist/components/Toast/index.js +0 -3
- package/dist/components/Tooltip/Tooltip.js +11 -18
- package/dist/components/Tooltip/Tooltip.style.js +1 -10
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/TopAppBar/TopAppBar.js +14 -24
- package/dist/components/TopAppBar/TopAppBar.style.js +0 -13
- package/dist/components/TopAppBar/TopAppBar.types.d.ts +2 -2
- package/dist/components/TopAppBar/components/Logo/Logo.style.js +1 -8
- package/dist/components/TopAppBar/components/Logo/Logo.wrapper.d.ts +2 -2
- package/dist/components/TopAppBar/components/Logo/Logo.wrapper.js +0 -7
- package/dist/components/TopAppBar/components/Logo/index.js +0 -3
- package/dist/components/TopAppBar/components/Search/Search.js +9 -18
- package/dist/components/TopAppBar/components/Search/Search.style.js +1 -13
- package/dist/components/TopAppBar/components/Search/index.js +0 -3
- package/dist/components/TopAppBar/components/SidebarMenuIcon/SidebarMenuIcon.js +0 -7
- package/dist/components/TopAppBar/components/SidebarMenuIcon/SidebarMenuIcon.style.js +0 -4
- package/dist/components/TopAppBar/components/SidebarMenuIcon/index.js +0 -3
- package/dist/components/TopAppBar/components/UserMenu/UserMenu.js +5 -12
- package/dist/components/TopAppBar/components/UserMenu/UserMenu.style.js +0 -4
- package/dist/components/TopAppBar/components/UserMenu/index.js +0 -3
- package/dist/components/TopAppBar/components/index.js +0 -7
- package/dist/components/TopAppBar/index.js +0 -3
- package/dist/components/TruncatedContent/TruncatedContent.d.ts +2 -2
- package/dist/components/TruncatedContent/TruncatedContent.js +7 -20
- package/dist/components/TruncatedContent/TruncatedContent.style.js +1 -5
- package/dist/components/TruncatedContent/index.js +0 -3
- package/dist/components/storyUtils/Stack/Stack.d.ts +2 -2
- package/dist/components/utils/ClickAwayListener/ClickAwayListener.d.ts +2 -2
- package/dist/components/utils/ClickAwayListener/ClickAwayListener.js +6 -17
- package/dist/components/utils/ClickAwayListener/index.js +0 -3
- package/dist/components/utils/DropdownOptions/index.js +0 -5
- package/dist/components/utils/PositionInScreen/PositionInScreen.d.ts +3 -2
- package/dist/components/utils/PositionInScreen/PositionInScreen.js +13 -24
- package/dist/components/utils/PositionInScreen/PositionInScreen.style.js +1 -10
- package/dist/components/utils/PositionInScreen/hooks.js +39 -60
- package/dist/components/utils/PositionInScreen/index.js +0 -3
- package/dist/components/utils/PositionInScreen/utils.js +1 -6
- package/dist/components/utils/handleSearch.js +7 -13
- package/dist/hooks/index.js +0 -3
- package/dist/hooks/useBreakpoints.js +1 -7
- package/dist/hooks/useCheck.d.ts +1 -1
- package/dist/hooks/useCheck.js +4 -9
- package/dist/hooks/useCombinedRefs.js +0 -7
- package/dist/hooks/useEscape.js +0 -4
- package/dist/hooks/useLoading.js +2 -7
- package/dist/hooks/useLocationToGetCurrentMenuItem.js +4 -10
- package/dist/hooks/usePagination.js +6 -17
- package/dist/hooks/useSearchQueryParams.js +1 -6
- package/dist/hooks/useTheme.js +0 -3
- package/dist/hooks/useThemeSwitch.d.ts +2 -2
- package/dist/hooks/useThemeSwitch.js +4 -15
- package/dist/hooks/useToggle.js +2 -9
- package/dist/hooks/useTypeColorToColorMatch.d.ts +4 -4
- package/dist/hooks/useTypeColorToColorMatch.js +6 -21
- package/dist/index.js +1 -108
- package/dist/test/index.js +0 -2
- package/dist/test/setup.js +2 -5
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.js +15 -39
- package/dist/theme/functions.js +5 -15
- package/dist/theme/index.js +0 -12
- package/dist/theme/palette.config.js +2 -4
- package/dist/theme/palette.js +12 -24
- package/dist/theme/spacing.js +1 -3
- package/dist/theme/states/disabled.js +1 -4
- package/dist/theme/states/focus.js +3 -7
- package/dist/theme/states/hover.js +2 -10
- package/dist/theme/states/index.js +0 -8
- package/dist/theme/states/pressed.js +2 -10
- package/dist/theme/states/statesConfig.js +1 -1
- package/dist/theme/states/utils.js +4 -9
- package/dist/theme/typography.js +0 -2
- package/dist/theme/utils.js +2 -23
- package/dist/utils/common.js +6 -3
- package/dist/utils/errors.js +4 -21
- package/dist/utils/helpers.d.ts +2 -2
- package/dist/utils/helpers.js +10 -26
- package/dist/utils/initLocaleFormat.js +1 -10
- package/dist/utils/size-utils.js +2 -20
- package/dist/utils/storyshots.js +4 -8
- package/dist/utils/themeFunctions.js +3 -25
- package/dist/utils/types.d.ts +2 -0
- package/package.json +16 -15
|
@@ -2,52 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
var _helpers = require("../../utils/helpers");
|
|
9
|
-
|
|
10
7
|
var _palette = require("../../theme/palette");
|
|
11
|
-
|
|
12
8
|
var _Chip = require("./Chip.style");
|
|
13
|
-
|
|
14
9
|
var _Badge = _interopRequireDefault(require("./components/Badge"));
|
|
15
|
-
|
|
16
10
|
var _utils = require("./utils");
|
|
17
|
-
|
|
18
11
|
var _Avatar = _interopRequireDefault(require("../Avatar"));
|
|
19
|
-
|
|
20
12
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
21
|
-
|
|
22
13
|
var _react2 = require("@emotion/react");
|
|
23
|
-
|
|
24
14
|
var _excluded = ["styleType", "disabled", "dataTestId"];
|
|
25
|
-
|
|
26
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
-
|
|
30
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
|
|
32
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
-
|
|
34
19
|
var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
35
20
|
var _ref$styleType = _ref.styleType,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
21
|
+
styleType = _ref$styleType === void 0 ? _utils.defaultProps.styleType : _ref$styleType,
|
|
22
|
+
_ref$disabled = _ref.disabled,
|
|
23
|
+
disabled = _ref$disabled === void 0 ? _utils.defaultProps.disabled : _ref$disabled,
|
|
24
|
+
_ref$dataTestId = _ref.dataTestId,
|
|
25
|
+
dataTestId = _ref$dataTestId === void 0 ? _utils.defaultProps.dataTestId : _ref$dataTestId,
|
|
26
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
27
|
var onClick = rest.onClick,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
isChecked = rest.isChecked,
|
|
29
|
+
thumbnail = rest.thumbnail,
|
|
30
|
+
fill = rest.fill,
|
|
31
|
+
isSelected = rest.isSelected,
|
|
32
|
+
onClear = rest.onClear,
|
|
33
|
+
children = rest.children,
|
|
34
|
+
badgeNumber = rest.badgeNumber;
|
|
51
35
|
(0, _helpers.errorHandler)(_utils.errors, {
|
|
52
36
|
styleType: styleType,
|
|
53
37
|
isSelected: isSelected,
|
|
@@ -78,14 +62,12 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
78
62
|
variant: 850,
|
|
79
63
|
onClick: function onClick(e) {
|
|
80
64
|
e.stopPropagation();
|
|
81
|
-
|
|
82
65
|
if (!disabled) {
|
|
83
66
|
onClear();
|
|
84
67
|
}
|
|
85
68
|
},
|
|
86
69
|
dataTestId: (0, _helpers.generateTestDataId)('chip-delete', dataTestId)
|
|
87
70
|
})));
|
|
88
|
-
|
|
89
71
|
if (styleType === 'read-only') {
|
|
90
72
|
return (0, _react2.jsx)("div", {
|
|
91
73
|
ref: ref,
|
|
@@ -98,7 +80,6 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
98
80
|
"aria-readonly": "true"
|
|
99
81
|
}, contents);
|
|
100
82
|
}
|
|
101
|
-
|
|
102
83
|
return (0, _react2.jsx)("button", {
|
|
103
84
|
role: "button",
|
|
104
85
|
ref: ref,
|
|
@@ -114,7 +95,6 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
114
95
|
disabled: disabled
|
|
115
96
|
}, contents);
|
|
116
97
|
});
|
|
117
|
-
|
|
118
98
|
Chip.displayName = 'Chip';
|
|
119
99
|
var _default = Chip;
|
|
120
100
|
exports["default"] = _default;
|
|
@@ -2,28 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.closeIconWrapperStyle = exports.chipStyle = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("@emotion/react");
|
|
7
|
-
|
|
8
6
|
var _functions = require("../../theme/functions");
|
|
9
|
-
|
|
10
7
|
var _utils = require("../../theme/utils");
|
|
11
|
-
|
|
12
8
|
var _states = require("../../theme/states");
|
|
13
|
-
|
|
14
9
|
var chipStyle = function chipStyle(_ref) {
|
|
15
10
|
var styleType = _ref.styleType,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
_ref$fill = _ref.fill,
|
|
12
|
+
fill = _ref$fill === void 0 ? 'greyScale' : _ref$fill,
|
|
13
|
+
isSelected = _ref.isSelected,
|
|
14
|
+
onClear = _ref.onClear,
|
|
15
|
+
onClick = _ref.onClick;
|
|
21
16
|
return function (theme) {
|
|
22
17
|
var isInteractive = styleType === 'interactive';
|
|
23
18
|
var customFilled = styleType === 'read-only' || onClear || isSelected;
|
|
24
19
|
return (
|
|
25
20
|
/*#__PURE__*/
|
|
26
|
-
|
|
27
21
|
/*#__PURE__*/
|
|
28
22
|
(0, _react.css)(_functions.flexCenterVertical, ";height:", theme.spacing.lg, ";border-radius:", theme.spacing.lg, ";font-size:", theme.typography.fontSizes['12'], ";font-weight:", theme.typography.weights.medium, ";line-height:normal;box-sizing:border-box;padding:", theme.spacing.xsm, " ", theme.spacing.sm, ";background-color:", customFilled ? theme.utils.getColor(fill, 50) : theme.palette.white, ";color:", theme.utils.getAAColorFromSwatches(fill, 50), ";border:", (0, _utils.rem)(1), " solid ", customFilled ? theme.utils.getColor(fill, 550) : theme.utils.getColor('lightGrey', 200), ";cursor:", onClick ? 'pointer' : 'auto', ";width:fit-content;transition:background-color 150ms linear;&:hover:not(:disabled){background:", customFilled ? (0, _states.getHover)({
|
|
29
23
|
theme: theme,
|
|
@@ -42,18 +36,14 @@ var chipStyle = function chipStyle(_ref) {
|
|
|
42
36
|
);
|
|
43
37
|
};
|
|
44
38
|
};
|
|
45
|
-
|
|
46
39
|
exports.chipStyle = chipStyle;
|
|
47
|
-
|
|
48
40
|
var closeIconWrapperStyle = function closeIconWrapperStyle(disabled) {
|
|
49
41
|
return function () {
|
|
50
42
|
return (
|
|
51
43
|
/*#__PURE__*/
|
|
52
|
-
|
|
53
44
|
/*#__PURE__*/
|
|
54
45
|
(0, _react.css)("cursor:", disabled ? (0, _states.getDisabled)().cursor : 'pointer', ";" + (process.env.NODE_ENV === "production" ? "" : ";label:closeIconWrapperStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvQ2hpcC5zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3RXdGIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvQ2hpcC5zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcywgU2VyaWFsaXplZFN0eWxlcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IGZsZXhDZW50ZXJWZXJ0aWNhbCB9IGZyb20gJ3RoZW1lL2Z1bmN0aW9ucyc7XG5pbXBvcnQgeyByZW0gfSBmcm9tICd0aGVtZS91dGlscyc7XG5cbmltcG9ydCB7IFRoZW1lIH0gZnJvbSAnLi4vLi4vdGhlbWUnO1xuaW1wb3J0IHsgZ2V0RGlzYWJsZWQsIGdldEZvY3VzLCBnZXRIb3ZlciwgZ2V0UHJlc3NlZCB9IGZyb20gJy4uLy4uL3RoZW1lL3N0YXRlcyc7XG5pbXBvcnQgeyBQcm9wcyB9IGZyb20gJy4vQ2hpcC50eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBjaGlwU3R5bGUgPSAoe1xuICBzdHlsZVR5cGUsXG4gIGZpbGwgPSAnZ3JleVNjYWxlJyxcbiAgaXNTZWxlY3RlZCxcbiAgb25DbGVhcixcbiAgb25DbGljayxcbn06IFBpY2s8UHJvcHMsICdzdHlsZVR5cGUnIHwgJ2ZpbGwnIHwgJ2lzU2VsZWN0ZWQnIHwgJ29uQ2xlYXInIHwgJ29uQ2xpY2snPikgPT4gKFxuICB0aGVtZTogVGhlbWVcbik6IFNlcmlhbGl6ZWRTdHlsZXMgPT4ge1xuICBjb25zdCBpc0ludGVyYWN0aXZlID0gc3R5bGVUeXBlID09PSAnaW50ZXJhY3RpdmUnO1xuICBjb25zdCBjdXN0b21GaWxsZWQgPSBzdHlsZVR5cGUgPT09ICdyZWFkLW9ubHknIHx8IG9uQ2xlYXIgfHwgaXNTZWxlY3RlZDtcblxuICByZXR1cm4gY3NzYFxuICAgICR7ZmxleENlbnRlclZlcnRpY2FsfTtcbiAgICBoZWlnaHQ6ICR7dGhlbWUuc3BhY2luZy5sZ307XG4gICAgYm9yZGVyLXJhZGl1czogJHt0aGVtZS5zcGFjaW5nLmxnfTtcbiAgICBmb250LXNpemU6ICR7dGhlbWUudHlwb2dyYXBoeS5mb250U2l6ZXNbJzEyJ119O1xuICAgIGZvbnQtd2VpZ2h0OiAke3RoZW1lLnR5cG9ncmFwaHkud2VpZ2h0cy5tZWRpdW19O1xuICAgIGxpbmUtaGVpZ2h0OiBub3JtYWw7XG4gICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICBwYWRkaW5nOiAke3RoZW1lLnNwYWNpbmcueHNtfSAke3RoZW1lLnNwYWNpbmcuc219O1xuICAgIGJhY2tncm91bmQtY29sb3I6ICR7Y3VzdG9tRmlsbGVkID8gdGhlbWUudXRpbHMuZ2V0Q29sb3IoZmlsbCwgNTApIDogdGhlbWUucGFsZXR0ZS53aGl0ZX07XG4gICAgY29sb3I6ICR7dGhlbWUudXRpbHMuZ2V0QUFDb2xvckZyb21Td2F0Y2hlcyhmaWxsLCA1MCl9O1xuICAgIGJvcmRlcjogJHtyZW0oMSl9IHNvbGlkXG4gICAgICAke2N1c3RvbUZpbGxlZCA/IHRoZW1lLnV0aWxzLmdldENvbG9yKGZpbGwsIDU1MCkgOiB0aGVtZS51dGlscy5nZXRDb2xvcignbGlnaHRHcmV5JywgMjAwKX07XG4gICAgY3Vyc29yOiAke29uQ2xpY2sgPyAncG9pbnRlcicgOiAnYXV0byd9O1xuICAgIHdpZHRoOiBmaXQtY29udGVudDtcbiAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDE1MG1zIGxpbmVhcjtcblxuICAgICY6aG92ZXI6bm90KDpkaXNhYmxlZCkge1xuICAgICAgYmFja2dyb3VuZDogJHtjdXN0b21GaWxsZWRcbiAgICAgICAgPyBnZXRIb3Zlcih7IHRoZW1lLCBjb2xvcjogZmlsbCwgc2hhZGU6IDUwIH0pLmJhY2tncm91bmRDb2xvclxuICAgICAgICA6IGdldEhvdmVyKHsgdGhlbWUgfSkuYmFja2dyb3VuZENvbG9yfTtcbiAgICB9XG5cbiAgICAmOmZvY3VzLXZpc2libGU6bm90KDpkaXNhYmxlZCkge1xuICAgICAgb3V0bGluZTogJHshaXNJbnRlcmFjdGl2ZSA/ICdub25lJyA6IGdldEZvY3VzKHsgdGhlbWUsIGJvcmRlcldpZHRoOiAxIH0pLnN0eWxlT3V0bGluZX07XG4gICAgfVxuXG4gICAgJHtpc0ludGVyYWN0aXZlICYmXG4gICAgICBgXG4gICAgJjphY3RpdmU6bm90KDpkaXNhYmxlZCkge1xuICAgICAgYmFja2dyb3VuZDogJHtcbiAgICAgICAgZ2V0UHJlc3NlZCh7XG4gICAgICAgICAgdGhlbWUsXG4gICAgICAgICAgY29sb3I6IGZpbGwsXG4gICAgICAgICAgc2hhZGU6IDUwLFxuICAgICAgICB9KS5iYWNrZ3JvdW5kQ29sb3JcbiAgICAgIH07XG4gICAgfVxuXG4gICAgXG4gICAgICA6ZGlzYWJsZWQge1xuICAgICAgICBvcGFjaXR5OiAke2dldERpc2FibGVkKCkub3BhY2l0eX07XG4gICAgICAgIGN1cnNvcjogJHtnZXREaXNhYmxlZCgpLmN1cnNvcn07XG4gICAgICB9XG4gICAgYH1cblxuICAgID4gOm5vdCg6bGFzdC1jaGlsZCkge1xuICAgICAgbWFyZ2luLXJpZ2h0OiAke3RoZW1lLnNwYWNpbmcueHNtfTtcbiAgICB9XG4gIGA7XG59O1xuXG5leHBvcnQgY29uc3QgY2xvc2VJY29uV3JhcHBlclN0eWxlID0gKGRpc2FibGVkPzogYm9vbGVhbikgPT4gKCk6IFNlcmlhbGl6ZWRTdHlsZXMgPT4gY3NzYFxuICBjdXJzb3I6ICR7ZGlzYWJsZWQgPyBnZXREaXNhYmxlZCgpLmN1cnNvciA6ICdwb2ludGVyJ307XG5gO1xuIl19 */", process.env.NODE_ENV === "production" ? "" : ";label:closeIconWrapperStyle;")
|
|
55
46
|
);
|
|
56
47
|
};
|
|
57
48
|
};
|
|
58
|
-
|
|
59
49
|
exports.closeIconWrapperStyle = closeIconWrapperStyle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.styleType = exports.
|
|
4
|
+
exports.styleType = exports.READ_ONLY = exports.INTERACTIVE = void 0;
|
|
5
5
|
var READ_ONLY = 'read-only';
|
|
6
6
|
exports.READ_ONLY = READ_ONLY;
|
|
7
7
|
var INTERACTIVE = 'interactive';
|
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
|
|
8
6
|
var _helpers = require("../../../../utils/helpers");
|
|
9
|
-
|
|
10
7
|
var _Badge = require("./Badge.style");
|
|
11
|
-
|
|
12
8
|
var _react2 = require("@emotion/react");
|
|
13
|
-
|
|
14
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
10
|
var Badge = function Badge(_ref) {
|
|
17
11
|
var fill = _ref.fill,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
isSelected = _ref.isSelected,
|
|
13
|
+
badgeNumber = _ref.badgeNumber,
|
|
14
|
+
dataTestId = _ref.dataTestId;
|
|
21
15
|
return (0, _react2.jsx)("div", {
|
|
22
16
|
"data-testid": (0, _helpers.generateTestDataId)('badge', dataTestId),
|
|
23
17
|
css: (0, _Badge.badgeStyle)({
|
|
@@ -26,6 +20,5 @@ var Badge = function Badge(_ref) {
|
|
|
26
20
|
})
|
|
27
21
|
}, badgeNumber);
|
|
28
22
|
};
|
|
29
|
-
|
|
30
23
|
var _default = Badge;
|
|
31
24
|
exports["default"] = _default;
|
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.badgeStyle = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("@emotion/react");
|
|
7
|
-
|
|
8
6
|
var _functions = require("../../../../theme/functions");
|
|
9
|
-
|
|
10
7
|
var badgeStyle = function badgeStyle(_ref) {
|
|
11
8
|
var _ref$fill = _ref.fill,
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
fill = _ref$fill === void 0 ? 'greyScale' : _ref$fill,
|
|
10
|
+
isSelected = _ref.isSelected;
|
|
14
11
|
return function (theme) {
|
|
15
12
|
return (
|
|
16
13
|
/*#__PURE__*/
|
|
17
|
-
|
|
18
14
|
/*#__PURE__*/
|
|
19
15
|
(0, _react.css)(_functions.flex, ";width:", theme.spacing.md, ";height:", theme.spacing.md, ";border-radius:100%;background:", isSelected ? theme.utils.getColor(fill, 550) : theme.utils.getColor('lightGrey', 200), ";font-size:", theme.typography.fontSizes['10'], ";font-weight:", theme.typography.weights.medium, ";align-items:center;flex-shrink:0;line-height:normal;justify-content:center;color:", isSelected ? theme.utils.getAAColorFromSwatches(fill, 550) : theme.utils.getAAColorFromSwatches('lightGrey', 200), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:badgeStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvY29tcG9uZW50cy9CYWRnZS9CYWRnZS5zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRMEIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvQ2hpcC9jb21wb25lbnRzL0JhZGdlL0JhZGdlLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICd0aGVtZSc7XG5pbXBvcnQgeyBmbGV4IH0gZnJvbSAndGhlbWUvZnVuY3Rpb25zJztcblxuaW1wb3J0IHsgQmFkZ2VQcm9wcyB9IGZyb20gJy4vQmFkZ2UnO1xuXG5leHBvcnQgY29uc3QgYmFkZ2VTdHlsZSA9ICh7IGZpbGwgPSAnZ3JleVNjYWxlJywgaXNTZWxlY3RlZCB9OiBCYWRnZVByb3BzKSA9PiAoXG4gIHRoZW1lOiBUaGVtZVxuKTogU2VyaWFsaXplZFN0eWxlcyA9PiBjc3NgXG4gICR7ZmxleH07XG4gIHdpZHRoOiAke3RoZW1lLnNwYWNpbmcubWR9O1xuICBoZWlnaHQ6ICR7dGhlbWUuc3BhY2luZy5tZH07XG4gIGJvcmRlci1yYWRpdXM6IDEwMCU7XG4gIGJhY2tncm91bmQ6ICR7aXNTZWxlY3RlZFxuICAgID8gdGhlbWUudXRpbHMuZ2V0Q29sb3IoZmlsbCwgNTUwKVxuICAgIDogdGhlbWUudXRpbHMuZ2V0Q29sb3IoJ2xpZ2h0R3JleScsIDIwMCl9O1xuICBmb250LXNpemU6ICR7dGhlbWUudHlwb2dyYXBoeS5mb250U2l6ZXNbJzEwJ119O1xuICBmb250LXdlaWdodDogJHt0aGVtZS50eXBvZ3JhcGh5LndlaWdodHMubWVkaXVtfTtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgZmxleC1zaHJpbms6IDA7XG4gIGxpbmUtaGVpZ2h0OiBub3JtYWw7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBjb2xvcjogJHtpc1NlbGVjdGVkXG4gICAgPyB0aGVtZS51dGlscy5nZXRBQUNvbG9yRnJvbVN3YXRjaGVzKGZpbGwsIDU1MClcbiAgICA6IHRoZW1lLnV0aWxzLmdldEFBQ29sb3JGcm9tU3dhdGNoZXMoJ2xpZ2h0R3JleScsIDIwMCl9O1xuYDtcbiJdfQ== */", process.env.NODE_ENV === "production" ? "" : ";label:badgeStyle;")
|
|
20
16
|
);
|
|
21
17
|
};
|
|
22
18
|
};
|
|
23
|
-
|
|
24
19
|
exports.badgeStyle = badgeStyle;
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _Badge = _interopRequireDefault(require("./Badge"));
|
|
7
|
-
|
|
8
6
|
exports["default"] = _Badge["default"];
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
7
|
-
|
|
8
6
|
exports["default"] = _Chip["default"];
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.errors = exports.defaultProps = void 0;
|
|
5
|
-
|
|
6
5
|
var _errors = require("../../utils/errors");
|
|
7
|
-
|
|
8
6
|
var _Chip = require("./Chip.types");
|
|
9
|
-
|
|
10
7
|
var defaultProps = {
|
|
11
8
|
disabled: false,
|
|
12
9
|
styleType: _Chip.READ_ONLY,
|
|
@@ -16,17 +13,17 @@ exports.defaultProps = defaultProps;
|
|
|
16
13
|
var errors = [{
|
|
17
14
|
condition: function condition(_ref) {
|
|
18
15
|
var styleType = _ref.styleType,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
isSelected = _ref.isSelected,
|
|
17
|
+
isChecked = _ref.isChecked,
|
|
18
|
+
badgeNumber = _ref.badgeNumber,
|
|
19
|
+
disabled = _ref.disabled;
|
|
23
20
|
return Boolean(styleType === _Chip.READ_ONLY && (isSelected || isChecked || badgeNumber || disabled));
|
|
24
21
|
},
|
|
25
22
|
error: new _errors.PropsValidationError('The properties isSelected, isChecked, badgeNumber and disabled are only for Interactive style type Chips.')
|
|
26
23
|
}, {
|
|
27
24
|
condition: function condition(_ref2) {
|
|
28
25
|
var styleType = _ref2.styleType,
|
|
29
|
-
|
|
26
|
+
thumbnail = _ref2.thumbnail;
|
|
30
27
|
return Boolean(styleType === _Chip.INTERACTIVE && thumbnail);
|
|
31
28
|
},
|
|
32
29
|
error: new _errors.PropsValidationError('The property thumbnail is only for Read-Only style type Chips.')
|
|
@@ -2,69 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
7
|
-
|
|
8
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
7
|
+
var _DatePickInput = require("./DatePickInput.style");
|
|
10
8
|
var _helpers = require("../../../utils/helpers");
|
|
11
|
-
|
|
12
9
|
var _FilterBase = _interopRequireDefault(require("../../Filter/components/FilterBase"));
|
|
13
|
-
|
|
14
10
|
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
15
|
-
|
|
16
11
|
var _TextField = _interopRequireDefault(require("../../TextField/TextField"));
|
|
17
|
-
|
|
18
|
-
var _DatePickInput = require("./DatePickInput.style");
|
|
19
|
-
|
|
20
12
|
var _react2 = require("@emotion/react");
|
|
21
|
-
|
|
22
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
-
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
17
|
// TODO: Need to fix this (TextField onChange prop)
|
|
31
18
|
var ON_CHANGE_MOCK = function ON_CHANGE_MOCK() {};
|
|
32
|
-
|
|
33
19
|
var formatDate = function formatDate(dateFormatOverride) {
|
|
34
20
|
return function (date) {
|
|
35
21
|
return date ? (0, _dayjs["default"])(date).format((0, _helpers.getLocaleFormat)(dateFormatOverride)) : '';
|
|
36
22
|
};
|
|
37
23
|
};
|
|
38
|
-
|
|
39
24
|
var getLabels = function getLabels(isRangePicker, formattedTo) {
|
|
40
25
|
return {
|
|
41
26
|
selectDate: "Select Date" + (isRangePicker ? 's' : ''),
|
|
42
27
|
to: isRangePicker ? "- " + formattedTo : ''
|
|
43
28
|
};
|
|
44
29
|
};
|
|
45
|
-
|
|
46
30
|
var DatePickInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
47
31
|
var handleFocus = _ref.handleFocus,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
_ref$filterConfig = _ref.filterConfig,
|
|
33
|
+
filterConfig = _ref$filterConfig === void 0 ? {} : _ref$filterConfig,
|
|
34
|
+
handleClear = _ref.handleClear,
|
|
35
|
+
dataTestId = _ref.dataTestId,
|
|
36
|
+
isRangePicker = _ref.isRangePicker,
|
|
37
|
+
inputProps = _ref.inputProps,
|
|
38
|
+
selectedDay = _ref.selectedDay,
|
|
39
|
+
_ref$dateFormatOverri = _ref.dateFormatOverride,
|
|
40
|
+
dateFormatOverride = _ref$dateFormatOverri === void 0 ? 'MM/DD/YYYY' : _ref$dateFormatOverri,
|
|
41
|
+
isOpen = _ref.isOpen;
|
|
58
42
|
var getDateFormatted = (0, _react.useCallback)(formatDate(dateFormatOverride), [dateFormatOverride]);
|
|
59
43
|
var formattedFrom = getDateFormatted(selectedDay.from);
|
|
60
44
|
var formattedTo = getDateFormatted(selectedDay.to);
|
|
61
45
|
var labels = getLabels(isRangePicker, formattedTo);
|
|
62
46
|
var _filterConfig$buttonT = filterConfig.buttonType,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
buttonType = _filterConfig$buttonT === void 0 ? 'primary' : _filterConfig$buttonT,
|
|
48
|
+
_filterConfig$styleTy = filterConfig.styleType,
|
|
49
|
+
styleType = _filterConfig$styleTy === void 0 ? 'filled' : _filterConfig$styleTy,
|
|
50
|
+
filterType = filterConfig.filterType;
|
|
68
51
|
var renderBase = function renderBase() {
|
|
69
52
|
if (filterType) {
|
|
70
53
|
return (0, _react2.jsx)(_FilterBase["default"], {
|
|
@@ -83,7 +66,6 @@ var DatePickInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
83
66
|
iconName: selectedDay.from ? 'calendarFilled' : 'calendarEmpty'
|
|
84
67
|
});
|
|
85
68
|
}
|
|
86
|
-
|
|
87
69
|
if (isRangePicker) {
|
|
88
70
|
return (0, _react2.jsx)(_TextField["default"], _extends({
|
|
89
71
|
ref: ref
|
|
@@ -100,7 +82,6 @@ var DatePickInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
100
82
|
})
|
|
101
83
|
}));
|
|
102
84
|
}
|
|
103
|
-
|
|
104
85
|
return (0, _react2.jsx)(_TextField["default"], _extends({
|
|
105
86
|
ref: ref
|
|
106
87
|
}, inputProps, {
|
|
@@ -116,12 +97,10 @@ var DatePickInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
116
97
|
})
|
|
117
98
|
}));
|
|
118
99
|
};
|
|
119
|
-
|
|
120
100
|
return (0, _react2.jsx)("div", {
|
|
121
101
|
css: (0, _DatePickInput.rangeInputsWrapper)()
|
|
122
102
|
}, renderBase());
|
|
123
103
|
});
|
|
124
|
-
|
|
125
104
|
DatePickInput.displayName = 'DatePickInput';
|
|
126
105
|
var _default = DatePickInput;
|
|
127
106
|
exports["default"] = _default;
|
|
@@ -2,20 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.rangeInputsWrapper = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("@emotion/react");
|
|
7
|
-
|
|
8
6
|
var _utils = require("../../../theme/utils");
|
|
9
|
-
|
|
10
7
|
var rangeInputsWrapper = function rangeInputsWrapper() {
|
|
11
8
|
return function (theme) {
|
|
12
9
|
return (
|
|
13
10
|
/*#__PURE__*/
|
|
14
|
-
|
|
15
11
|
/*#__PURE__*/
|
|
16
12
|
(0, _react.css)("max-width:", (0, _utils.rem)(280), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:rangeInputsWrapper;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0RhdGVQaWNrZXIvRGF0ZVBpY2tJbnB1dC9EYXRlUGlja0lucHV0LnN0eWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUkrRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9EYXRlUGlja2VyL0RhdGVQaWNrSW5wdXQvRGF0ZVBpY2tJbnB1dC5zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcywgU2VyaWFsaXplZFN0eWxlcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IFRoZW1lIH0gZnJvbSAndGhlbWUnO1xuaW1wb3J0IHsgcmVtIH0gZnJvbSAndGhlbWUvdXRpbHMnO1xuXG5leHBvcnQgY29uc3QgcmFuZ2VJbnB1dHNXcmFwcGVyID0gKCkgPT4gKHRoZW1lOiBUaGVtZSk6IFNlcmlhbGl6ZWRTdHlsZXMgPT4gY3NzYFxuICBtYXgtd2lkdGg6ICR7cmVtKDI4MCl9O1xuYDtcbiJdfQ== */", process.env.NODE_ENV === "production" ? "" : ";label:rangeInputsWrapper;")
|
|
17
13
|
);
|
|
18
14
|
};
|
|
19
15
|
};
|
|
20
|
-
|
|
21
16
|
exports.rangeInputsWrapper = rangeInputsWrapper;
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _DatePickInput = _interopRequireDefault(require("./DatePickInput"));
|
|
7
|
-
|
|
8
6
|
exports["default"] = _DatePickInput["default"];
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports["default"] =
|
|
5
|
-
|
|
4
|
+
exports.extraOptions = exports["default"] = void 0;
|
|
6
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
|
|
8
6
|
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
9
|
-
|
|
10
|
-
var _ClickAwayListener = _interopRequireDefault(require("../utils/ClickAwayListener"));
|
|
11
|
-
|
|
12
|
-
var _PositionInScreen = _interopRequireDefault(require("../utils/PositionInScreen"));
|
|
13
|
-
|
|
14
7
|
var _DatePicker = require("./DatePicker.style");
|
|
15
|
-
|
|
16
8
|
var _DatePickInput = _interopRequireDefault(require("./DatePickInput"));
|
|
17
|
-
|
|
18
9
|
var _OverlayComponent = _interopRequireDefault(require("./OverlayComponent/OverlayComponent"));
|
|
19
|
-
|
|
20
10
|
var _utils = require("./utils");
|
|
21
|
-
|
|
11
|
+
var _ClickAwayListener = _interopRequireDefault(require("../utils/ClickAwayListener"));
|
|
12
|
+
var _PositionInScreen = _interopRequireDefault(require("../utils/PositionInScreen"));
|
|
22
13
|
var _react2 = require("@emotion/react");
|
|
23
|
-
|
|
24
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
|
-
|
|
17
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
32
18
|
var extraOptions = [{
|
|
33
19
|
value: 'last-7-days',
|
|
34
20
|
label: 'Last 7 days',
|
|
@@ -43,42 +29,36 @@ var extraOptions = [{
|
|
|
43
29
|
dates: [_utils.currentDay]
|
|
44
30
|
}];
|
|
45
31
|
exports.extraOptions = extraOptions;
|
|
46
|
-
|
|
47
32
|
var DatePicker = function DatePicker(_ref) {
|
|
48
33
|
var _ref$isRangePicker = _ref.isRangePicker,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
isRangePicker = _ref$isRangePicker === void 0 ? false : _ref$isRangePicker,
|
|
35
|
+
_ref$onChange = _ref.onChange,
|
|
36
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
37
|
+
disableDates = _ref.disableDates,
|
|
38
|
+
initialValue = _ref.value,
|
|
39
|
+
inputProps = _ref.inputProps,
|
|
40
|
+
_ref$dateFormatOverri = _ref.dateFormatOverride,
|
|
41
|
+
dateFormatOverride = _ref$dateFormatOverri === void 0 ? undefined : _ref$dateFormatOverri,
|
|
42
|
+
_ref$isClearable = _ref.isClearable,
|
|
43
|
+
isClearable = _ref$isClearable === void 0 ? false : _ref$isClearable,
|
|
44
|
+
filterConfig = _ref.filterConfig,
|
|
45
|
+
dataTestId = _ref.dataTestId;
|
|
61
46
|
var value = (0, _react.useMemo)(function () {
|
|
62
47
|
return (0, _utils.initDates)(initialValue || {});
|
|
63
48
|
}, [initialValue]);
|
|
64
|
-
|
|
65
49
|
var _useState = (0, _react.useState)(false),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
isOpen = _useState[0],
|
|
51
|
+
setIsOpen = _useState[1];
|
|
69
52
|
var _useState2 = (0, _react.useState)(''),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
selectedOption = _useState2[0],
|
|
54
|
+
setSelectedOption = _useState2[1];
|
|
73
55
|
var _useState3 = (0, _react.useState)(value),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
range = _useState3[0],
|
|
57
|
+
setRange = _useState3[1];
|
|
77
58
|
var handleSelectedOptions = (0, _react.useCallback)(function (option) {
|
|
78
59
|
var foundOption = extraOptions.find(function (optionItem) {
|
|
79
60
|
return optionItem.value === option;
|
|
80
61
|
});
|
|
81
|
-
|
|
82
62
|
if (foundOption) {
|
|
83
63
|
setRange(Array.isArray(foundOption.dates) ? {
|
|
84
64
|
from: foundOption.dates[0],
|
|
@@ -88,23 +68,19 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
88
68
|
to: foundOption.dates
|
|
89
69
|
});
|
|
90
70
|
}
|
|
91
|
-
|
|
92
71
|
setSelectedOption(option);
|
|
93
72
|
}, []);
|
|
94
73
|
var applyRangeAndClose = (0, _react.useCallback)(function (oldState) {
|
|
95
74
|
var _oldState$from, _oldState$from2, _newRange$from, _newRange$to;
|
|
96
|
-
|
|
97
75
|
var startDate = oldState.to && (_oldState$from = oldState.from) != null && _oldState$from.isAfter(oldState.to) ? oldState.to : oldState.from;
|
|
98
76
|
var endDate = oldState.to && (_oldState$from2 = oldState.from) != null && _oldState$from2.isAfter(oldState.to) ? oldState.from : oldState.to;
|
|
99
77
|
var newRange = {
|
|
100
78
|
from: startDate,
|
|
101
79
|
to: endDate
|
|
102
80
|
};
|
|
103
|
-
|
|
104
81
|
if (newRange.to) {
|
|
105
82
|
setIsOpen(false);
|
|
106
83
|
}
|
|
107
|
-
|
|
108
84
|
onChange({
|
|
109
85
|
from: (_newRange$from = newRange.from) == null ? void 0 : _newRange$from.toDate(),
|
|
110
86
|
to: (_newRange$to = newRange.to) == null ? void 0 : _newRange$to.toDate()
|
|
@@ -112,8 +88,8 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
112
88
|
}, [onChange]);
|
|
113
89
|
var setRangePick = (0, _react.useCallback)(function (day) {
|
|
114
90
|
var startOfDay = day.startOf('day');
|
|
115
|
-
var endOfDay = day.endOf('day');
|
|
116
|
-
|
|
91
|
+
var endOfDay = day.endOf('day');
|
|
92
|
+
// in case is a day picker
|
|
117
93
|
if (!isRangePicker) {
|
|
118
94
|
return setRange(function (oldState) {
|
|
119
95
|
if (oldState.from && oldState.to && day.isBetween(oldState.from, oldState.to)) {
|
|
@@ -122,15 +98,14 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
122
98
|
to: undefined
|
|
123
99
|
};
|
|
124
100
|
}
|
|
125
|
-
|
|
126
101
|
return {
|
|
127
102
|
from: startOfDay,
|
|
128
103
|
to: endOfDay
|
|
129
104
|
};
|
|
130
105
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
106
|
+
}
|
|
133
107
|
|
|
108
|
+
// in case is range picker
|
|
134
109
|
return setRange(function (oldState) {
|
|
135
110
|
if (oldState.from && oldState.to) {
|
|
136
111
|
return {
|
|
@@ -138,13 +113,11 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
138
113
|
to: undefined
|
|
139
114
|
};
|
|
140
115
|
}
|
|
141
|
-
|
|
142
116
|
if (!oldState.from) {
|
|
143
117
|
return _extends({}, oldState, {
|
|
144
118
|
from: startOfDay
|
|
145
119
|
});
|
|
146
120
|
}
|
|
147
|
-
|
|
148
121
|
return _extends({}, oldState, {
|
|
149
122
|
to: endOfDay
|
|
150
123
|
});
|
|
@@ -158,9 +131,8 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
158
131
|
}, []);
|
|
159
132
|
var handleClear = (0, _react.useCallback)(function (e) {
|
|
160
133
|
if (!isClearable && (filterConfig == null ? void 0 : filterConfig.filterType) !== 'added') {
|
|
161
|
-
return
|
|
134
|
+
return;
|
|
162
135
|
}
|
|
163
|
-
|
|
164
136
|
if (filterConfig != null && filterConfig.filterType) {
|
|
165
137
|
setIsOpen(false);
|
|
166
138
|
return onChange({
|
|
@@ -168,13 +140,12 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
168
140
|
from: undefined
|
|
169
141
|
});
|
|
170
142
|
}
|
|
171
|
-
|
|
172
|
-
if (e.keyCode === 27) {
|
|
143
|
+
if ((e == null ? void 0 : e.keyCode) === 27) {
|
|
173
144
|
// if escape
|
|
174
|
-
|
|
145
|
+
setIsOpen(false);
|
|
146
|
+
return;
|
|
175
147
|
}
|
|
176
|
-
|
|
177
|
-
if (e.keyCode === 8) {
|
|
148
|
+
if ((e == null ? void 0 : e.keyCode) === 8) {
|
|
178
149
|
//backspace
|
|
179
150
|
if (isRangePicker) {
|
|
180
151
|
if (value.from && value.to) {
|
|
@@ -188,7 +159,6 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
188
159
|
});
|
|
189
160
|
}
|
|
190
161
|
}
|
|
191
|
-
|
|
192
162
|
setRange({
|
|
193
163
|
from: undefined,
|
|
194
164
|
to: undefined
|
|
@@ -231,7 +201,5 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
231
201
|
onApply: onApply
|
|
232
202
|
}))));
|
|
233
203
|
};
|
|
234
|
-
|
|
235
204
|
var _default = /*#__PURE__*/(0, _react.memo)(DatePicker, _reactFastCompare["default"]);
|
|
236
|
-
|
|
237
205
|
exports["default"] = _default;
|