@sprinklrjs/spaceweb 10.1.0 → 12.14.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/allComponentsAndUtilities.d.ts +1 -0
- package/allComponentsAndUtilities.js +2 -1
- package/asyncSelect/asyncSelect.d.ts +4 -2
- package/asyncSelect/asyncSelect.js +43 -108
- package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/asyncSelect/groupedAsyncSelect.js +41 -0
- package/asyncSelect/helpers.d.ts +9 -3
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
- package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/asyncSelect/hooks/useAsyncSelect.js +182 -0
- package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
- package/asyncSelect/index.d.ts +4 -1
- package/asyncSelect/index.js +8 -0
- package/asyncSelect/types.d.ts +63 -12
- package/avatar/avatar.js +12 -2
- package/avatar/index.d.ts +1 -1
- package/avatar/styled-component.js +7 -22
- package/avatar/types.d.ts +1 -1
- package/badge/styled-component.js +10 -8
- package/banner/banner-item.d.ts +12 -0
- package/banner/banner-item.js +14 -0
- package/banner/banner.d.ts +19 -0
- package/banner/banner.js +56 -0
- package/banner/index.d.ts +5 -0
- package/banner/index.js +14 -0
- package/banner/locale.d.ts +6 -0
- package/banner/locale.js +2 -0
- package/banner/package.json +4 -0
- package/banner/styled-component.d.ts +6 -0
- package/banner/styled-component.js +39 -0
- package/banner/types.d.ts +26 -0
- package/banner/types.js +2 -0
- package/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/breadcrumb/breadcrumb-item.js +41 -0
- package/breadcrumb/breadcrumb.d.ts +7 -0
- package/breadcrumb/breadcrumb.js +29 -0
- package/breadcrumb/index.d.ts +4 -0
- package/breadcrumb/index.js +17 -0
- package/breadcrumb/package.json +4 -0
- package/breadcrumb/styled-components.d.ts +7 -0
- package/breadcrumb/styled-components.js +19 -0
- package/breadcrumb/types.d.ts +38 -0
- package/breadcrumb/types.js +2 -0
- package/button/Button.d.ts +3 -3
- package/button/Button.js +14 -2
- package/button/IconButton/IconButton.d.ts +2 -4
- package/button/IconButton/IconButton.js +5 -2
- package/button/IconButton/types.d.ts +10 -1
- package/button/basewebAdapter.d.ts +9 -6
- package/button/basewebAdapter.js +1 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +4 -1
- package/button-group/ButtonGroup.d.ts +1 -0
- package/button-group/ButtonGroup.js +9 -5
- package/button-group/StatefulButtonGroup.d.ts +1 -0
- package/button-group/index.d.ts +1 -2
- package/button-group/index.js +1 -5
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +60 -12
- package/button-group/types.d.ts +3 -0
- package/checkbox/basewebAdapters.d.ts +5 -2
- package/checkbox/basewebAdapters.js +9 -2
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +1 -2
- package/checkbox/styled-components.js +1 -1
- package/checkbox/types.d.ts +15 -8
- package/color-picker/ColorPalette.d.ts +9 -0
- package/color-picker/ColorPalette.js +26 -0
- package/color-picker/ColorPicker.d.ts +3 -0
- package/color-picker/ColorPicker.js +35 -0
- package/color-picker/Swatch.d.ts +12 -0
- package/color-picker/Swatch.js +40 -0
- package/color-picker/colors.d.ts +1 -0
- package/color-picker/colors.js +109 -0
- package/color-picker/getContrastRatio.d.ts +1 -0
- package/color-picker/getContrastRatio.js +23 -0
- package/color-picker/index.d.ts +3 -0
- package/color-picker/index.js +7 -0
- package/color-picker/locale.d.ts +3 -0
- package/color-picker/locale.js +2 -0
- package/color-picker/package.json +4 -0
- package/color-picker/styled-component.d.ts +1 -0
- package/color-picker/styled-component.js +5 -0
- package/color-picker/types.d.ts +15 -0
- package/color-picker/types.js +2 -0
- package/currency/Currency.d.ts +3 -0
- package/currency/Currency.js +14 -0
- package/currency/constants.d.ts +3 -0
- package/currency/constants.js +8 -0
- package/currency/index.d.ts +5 -0
- package/currency/index.js +12 -0
- package/currency/package.json +4 -0
- package/currency/types.d.ts +7 -0
- package/currency/types.js +2 -0
- package/currency/useCurrency.d.ts +2 -0
- package/currency/useCurrency.js +12 -0
- package/currency/utils.d.ts +8 -0
- package/currency/utils.js +11 -0
- package/date-input/Before.d.ts +4 -2
- package/date-input/Before.js +4 -4
- package/date-input/CalendarIconButton.js +7 -1
- package/date-input/DateInput.d.ts +1 -1
- package/date-input/DateInput.js +47 -26
- package/date-input/styled-components.d.ts +2 -2
- package/date-input/styled-components.js +10 -8
- package/date-input/types.d.ts +4 -2
- package/date-picker/Calendar.d.ts +1 -1
- package/date-picker/Calendar.js +16 -6
- package/date-picker/DateInput.d.ts +3 -2
- package/date-picker/DateInput.js +19 -17
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +13 -16
- package/date-picker/DateTimeContainer.d.ts +4 -2
- package/date-picker/DateTimeContainer.js +5 -5
- package/date-picker/StatelessDatePicker.d.ts +1 -1
- package/date-picker/StatelessDatePicker.js +40 -20
- package/date-picker/TimeInput.d.ts +5 -2
- package/date-picker/TimeInput.js +4 -2
- package/date-picker/index.d.ts +1 -0
- package/date-picker/index.js +3 -1
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.d.ts +1 -1
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.d.ts +0 -1
- package/date-picker/styled-components.js +54 -27
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +10 -7
- package/date-picker/utils.js +12 -4
- package/date-time/DateTime.d.ts +3 -0
- package/date-time/DateTime.js +12 -0
- package/date-time/index.d.ts +3 -0
- package/date-time/index.js +9 -0
- package/date-time/package.json +4 -0
- package/date-time/types.d.ts +21 -0
- package/date-time/types.js +18 -0
- package/date-time/useDateTime.d.ts +2 -0
- package/date-time/useDateTime.js +13 -0
- package/date-time/variants.d.ts +4 -0
- package/date-time/variants.js +87 -0
- package/esm/allComponentsAndUtilities.d.ts +1 -0
- package/esm/allComponentsAndUtilities.js +2 -0
- package/esm/asyncSelect/asyncSelect.d.ts +4 -2
- package/esm/asyncSelect/asyncSelect.js +46 -111
- package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
- package/esm/asyncSelect/helpers.d.ts +9 -3
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
- package/esm/asyncSelect/index.d.ts +4 -1
- package/esm/asyncSelect/index.js +3 -0
- package/esm/asyncSelect/types.d.ts +63 -12
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/styled-component.js +7 -22
- package/esm/avatar/types.d.ts +1 -1
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner-item.d.ts +12 -0
- package/esm/banner/banner-item.js +12 -0
- package/esm/banner/banner.d.ts +19 -0
- package/esm/banner/banner.js +54 -0
- package/esm/banner/index.d.ts +5 -0
- package/esm/banner/index.js +3 -0
- package/esm/banner/locale.d.ts +6 -0
- package/esm/banner/locale.js +1 -0
- package/esm/banner/styled-component.d.ts +6 -0
- package/esm/banner/styled-component.js +35 -0
- package/esm/banner/types.d.ts +26 -0
- package/esm/banner/types.js +1 -0
- package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb-item.js +39 -0
- package/esm/breadcrumb/breadcrumb.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb.js +27 -0
- package/esm/breadcrumb/index.d.ts +4 -0
- package/esm/breadcrumb/index.js +3 -0
- package/esm/breadcrumb/styled-components.d.ts +7 -0
- package/esm/breadcrumb/styled-components.js +15 -0
- package/esm/breadcrumb/types.d.ts +38 -0
- package/esm/breadcrumb/types.js +1 -0
- package/esm/button/Button.d.ts +3 -3
- package/esm/button/Button.js +14 -2
- package/esm/button/IconButton/IconButton.d.ts +2 -4
- package/esm/button/IconButton/IconButton.js +5 -2
- package/esm/button/IconButton/types.d.ts +10 -1
- package/esm/button/basewebAdapter.d.ts +9 -6
- package/esm/button/basewebAdapter.js +1 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +4 -1
- package/esm/button-group/ButtonGroup.d.ts +1 -0
- package/esm/button-group/ButtonGroup.js +9 -5
- package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
- package/esm/button-group/index.d.ts +1 -2
- package/esm/button-group/index.js +0 -1
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +58 -11
- package/esm/button-group/types.d.ts +3 -0
- package/esm/checkbox/basewebAdapters.d.ts +5 -2
- package/esm/checkbox/basewebAdapters.js +9 -2
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +1 -1
- package/esm/checkbox/types.d.ts +15 -8
- package/esm/color-picker/ColorPalette.d.ts +9 -0
- package/esm/color-picker/ColorPalette.js +22 -0
- package/esm/color-picker/ColorPicker.d.ts +3 -0
- package/esm/color-picker/ColorPicker.js +31 -0
- package/esm/color-picker/Swatch.d.ts +12 -0
- package/esm/color-picker/Swatch.js +37 -0
- package/esm/color-picker/colors.d.ts +1 -0
- package/esm/color-picker/colors.js +106 -0
- package/esm/color-picker/getContrastRatio.d.ts +1 -0
- package/esm/color-picker/getContrastRatio.js +19 -0
- package/esm/color-picker/index.d.ts +3 -0
- package/esm/color-picker/index.js +2 -0
- package/esm/color-picker/locale.d.ts +3 -0
- package/esm/color-picker/locale.js +1 -0
- package/esm/color-picker/styled-component.d.ts +1 -0
- package/esm/color-picker/styled-component.js +2 -0
- package/esm/color-picker/types.d.ts +15 -0
- package/esm/color-picker/types.js +1 -0
- package/esm/currency/Currency.d.ts +3 -0
- package/esm/currency/Currency.js +10 -0
- package/esm/currency/constants.d.ts +3 -0
- package/esm/currency/constants.js +5 -0
- package/esm/currency/index.d.ts +5 -0
- package/esm/currency/index.js +5 -0
- package/esm/currency/types.d.ts +7 -0
- package/esm/currency/types.js +1 -0
- package/esm/currency/useCurrency.d.ts +2 -0
- package/esm/currency/useCurrency.js +8 -0
- package/esm/currency/utils.d.ts +8 -0
- package/esm/currency/utils.js +7 -0
- package/esm/date-input/Before.d.ts +4 -2
- package/esm/date-input/Before.js +4 -4
- package/esm/date-input/CalendarIconButton.js +7 -1
- package/esm/date-input/DateInput.d.ts +1 -1
- package/esm/date-input/DateInput.js +48 -27
- package/esm/date-input/styled-components.d.ts +2 -2
- package/esm/date-input/styled-components.js +10 -7
- package/esm/date-input/types.d.ts +4 -2
- package/esm/date-picker/Calendar.d.ts +1 -1
- package/esm/date-picker/Calendar.js +17 -7
- package/esm/date-picker/DateInput.d.ts +3 -2
- package/esm/date-picker/DateInput.js +20 -18
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +13 -16
- package/esm/date-picker/DateTimeContainer.d.ts +4 -2
- package/esm/date-picker/DateTimeContainer.js +5 -5
- package/esm/date-picker/StatelessDatePicker.d.ts +1 -1
- package/esm/date-picker/StatelessDatePicker.js +40 -20
- package/esm/date-picker/TimeInput.d.ts +5 -2
- package/esm/date-picker/TimeInput.js +4 -2
- package/esm/date-picker/index.d.ts +1 -0
- package/esm/date-picker/index.js +1 -0
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.d.ts +1 -1
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.d.ts +0 -1
- package/esm/date-picker/styled-components.js +53 -26
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +10 -7
- package/esm/date-picker/utils.js +13 -5
- package/esm/date-time/DateTime.d.ts +3 -0
- package/esm/date-time/DateTime.js +8 -0
- package/esm/date-time/index.d.ts +3 -0
- package/esm/date-time/index.js +3 -0
- package/esm/date-time/types.d.ts +21 -0
- package/esm/date-time/types.js +15 -0
- package/esm/date-time/useDateTime.d.ts +2 -0
- package/esm/date-time/useDateTime.js +9 -0
- package/esm/date-time/variants.d.ts +4 -0
- package/esm/date-time/variants.js +84 -0
- package/esm/form-control/context.d.ts +6 -13
- package/esm/form-control/context.js +10 -9
- package/esm/form-control/form-control.d.ts +1 -1
- package/esm/form-control/form-control.js +17 -12
- package/esm/form-control/styled-component.js +18 -7
- package/esm/helpers/ClearIconButton.js +3 -1
- package/esm/helpers/StyledTombstone.d.ts +1 -0
- package/esm/helpers/StyledTombstone.js +17 -0
- package/esm/helpers/baseui/useConvertOverrides.js +6 -1
- package/esm/helpers/baseui/withThemeOverride.js +1 -1
- package/esm/helpers/commonStyles.d.ts +2 -2
- package/esm/helpers/commonStyles.js +3 -6
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +8 -0
- package/esm/helpers/styletron.d.ts +14 -3
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.d.ts +6 -7
- package/esm/hooks/useAutoFocus.js +19 -13
- package/esm/hooks/useCombinedRef.d.ts +1 -0
- package/esm/hooks/useCombinedRef.js +33 -0
- package/esm/hooks/useIsMobileDevice.d.ts +1 -0
- package/esm/hooks/useIsMobileDevice.js +6 -0
- package/esm/hooks/useMatchMedia.d.ts +3 -0
- package/esm/hooks/useMatchMedia.js +49 -0
- package/esm/icon/components/alert-solid.js +2 -0
- package/esm/icon/components/alert.js +2 -0
- package/esm/icon/components/calendar-solid.js +2 -0
- package/esm/icon/components/chevron-down.js +2 -0
- package/esm/icon/components/chevron-left.d.ts +3 -0
- package/esm/icon/components/chevron-left.js +8 -0
- package/esm/icon/components/chevron-right.d.ts +3 -0
- package/esm/icon/components/chevron-right.js +8 -0
- package/esm/icon/components/close.js +2 -0
- package/esm/icon/components/error-clr.js +2 -0
- package/esm/icon/components/error-solid.js +2 -0
- package/esm/icon/components/error.js +2 -0
- package/esm/icon/components/imagePreview.js +2 -0
- package/esm/icon/components/info.js +2 -0
- package/esm/icon/components/play-video.js +2 -0
- package/esm/icon/components/reset-color.d.ts +3 -0
- package/esm/icon/components/reset-color.js +8 -0
- package/esm/icon/components/search.js +2 -0
- package/esm/icon/components/tick.js +2 -0
- package/esm/icon/components/tickCircle-solid.js +2 -0
- package/esm/icon/components/user.js +2 -0
- package/esm/icon/components/video-non-playable.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/basewebAdapters.d.ts +1 -1
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/index.d.ts +2 -1
- package/esm/input/index.js +1 -0
- package/esm/input/styled-components.d.ts +1 -1
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +10 -4
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +8 -10
- package/esm/list/divider.js +6 -3
- package/esm/list/index.d.ts +1 -1
- package/esm/list/index.js +1 -1
- package/esm/list/list-item.d.ts +3 -1
- package/esm/list/list-item.js +9 -6
- package/esm/list/list.d.ts +10 -5
- package/esm/list/list.js +47 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -17
- package/esm/list/types.d.ts +8 -0
- package/esm/list/utils.d.ts +2 -0
- package/esm/list/utils.js +10 -0
- package/esm/locale/en_US.js +35 -0
- package/esm/locale/types.d.ts +21 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +8 -2
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +6 -0
- package/esm/menu/menu.js +11 -11
- package/esm/menu/types.d.ts +1 -0
- package/esm/menu/useKeyboardNavigation.d.ts +6 -3
- package/esm/menu/useKeyboardNavigation.js +21 -14
- package/esm/menu/useStatefulMenu.d.ts +5 -2
- package/esm/menu/useStatefulMenu.js +14 -8
- package/esm/modal/adapter.d.ts +1 -1
- package/esm/modal/index.d.ts +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +5 -5
- package/esm/modal/overrides.d.ts +2 -3
- package/esm/modal/overrides.js +6 -8
- package/esm/modal/styled-components.d.ts +1 -1
- package/esm/modal/styled-components.js +8 -8
- package/esm/number/Number.d.ts +3 -0
- package/esm/number/Number.js +10 -0
- package/esm/number/constants.d.ts +2 -0
- package/esm/number/constants.js +4 -0
- package/esm/number/index.d.ts +5 -0
- package/esm/number/index.js +5 -0
- package/esm/number/types.d.ts +6 -0
- package/esm/number/types.js +1 -0
- package/esm/number/useNumber.d.ts +2 -0
- package/esm/number/useNumber.js +8 -0
- package/esm/overrides/index.d.ts +1 -1
- package/esm/overrides/index.js +1 -1
- package/esm/overrides/mergeOverrides.d.ts +3 -2
- package/esm/overrides/mergeOverrides.js +5 -4
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +27 -4
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/payment-card/types.d.ts +4 -2
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +4 -6
- package/esm/phone-input/default-props.d.ts +6 -9
- package/esm/phone-input/default-props.js +7 -9
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -6
- package/esm/phone-input/phone-input.js +21 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -6
- package/esm/phone-input/styled-components.d.ts +9 -1
- package/esm/phone-input/styled-components.js +21 -7
- package/esm/phone-input/types.d.ts +2 -1
- package/esm/phone-input/utils.d.ts +10 -3
- package/esm/phone-input/utils.js +10 -5
- package/esm/popover/adapter.d.ts +4 -3
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +6 -3
- package/esm/popover/popover.js +13 -6
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +10 -2
- package/esm/popover/types.js +2 -1
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/circular/styled-component.d.ts +1 -1
- package/esm/progress/circular/styled-component.js +3 -3
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/basewebAdapters.d.ts +8 -11
- package/esm/radio/basewebAdapters.js +6 -3
- package/esm/radio/radio.js +6 -5
- package/esm/radio/styled-components.js +9 -11
- package/esm/radio/types.d.ts +13 -6
- package/esm/search/index.d.ts +1 -0
- package/esm/search/index.js +1 -0
- package/esm/search/search.d.ts +1 -1
- package/esm/search/search.js +15 -6
- package/esm/search/stateful-search.d.ts +3 -0
- package/esm/search/stateful-search.js +15 -0
- package/esm/search/styled-components.d.ts +1 -10
- package/esm/search/styled-components.js +54 -24
- package/esm/search/types.d.ts +8 -2
- package/esm/select/adaptor.d.ts +1 -1
- package/esm/select/base-select.d.ts +36 -16
- package/esm/select/base-select.js +185 -88
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +9 -5
- package/esm/select/default-props.js +4 -1
- package/esm/select/index.d.ts +4 -4
- package/esm/select/index.js +3 -3
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSelect.js +3 -5
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +10 -18
- package/esm/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/esm/select/overlaySelect/hooks/useControlRef.js +33 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/esm/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/esm/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/esm/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/esm/select/overrides.d.ts +3 -1
- package/esm/select/overrides.js +19 -13
- package/esm/select/select-variants.js +2 -2
- package/esm/select/select.d.ts +9 -5
- package/esm/select/select.js +9 -3
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/esm/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
- package/esm/select/selectMenuAdapter/types.d.ts +42 -0
- package/esm/select/selectMenuAdapter/types.js +1 -0
- package/esm/select/stateful-select.d.ts +9 -5
- package/esm/select/stateful-select.js +3 -3
- package/esm/select/styled-component.d.ts +15 -4
- package/esm/select/styled-component.js +60 -10
- package/esm/select/types.d.ts +36 -9
- package/esm/select/types.js +1 -0
- package/esm/select/utils/default-filter-options.d.ts +2 -1
- package/esm/select/utils/default-filter-options.js +5 -1
- package/esm/select/utils/hidden-element.d.ts +6 -0
- package/esm/select/utils/hidden-element.js +16 -0
- package/esm/select/utils/merge-options.d.ts +2 -0
- package/esm/select/utils/merge-options.js +18 -0
- package/esm/select/utils/test-utils.d.ts +1 -0
- package/esm/select/utils/test-utils.js +7 -0
- package/esm/slider/mark.d.ts +3 -3
- package/esm/slider/slider.js +2 -1
- package/esm/slider/stateful-slider.js +1 -1
- package/esm/slider/styled-components.js +4 -4
- package/esm/slider/types.d.ts +9 -2
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/CustomBaseProvider.js +1 -0
- package/esm/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/esm/spacewebProvider/SpacewebProvider.js +9 -9
- package/esm/stack/stack.js +6 -13
- package/esm/style/_buildUtils.d.ts +1 -1
- package/esm/style/_buildUtils.js +3 -1
- package/esm/style/_parseStyle.js +12 -7
- package/esm/style/useMemoizedStyletron.d.ts +1 -1
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/styleEngine/styleEngine.d.ts +1 -2
- package/esm/switch/__test__/switch.spec.js +13 -0
- package/esm/switch/styled-components.js +14 -21
- package/esm/switch/switch.js +5 -2
- package/esm/switch/types.d.ts +8 -11
- package/esm/tag/avatar-tag.js +23 -16
- package/esm/tag/styled-components.js +32 -27
- package/esm/tag/tag.js +20 -12
- package/esm/tag/types.d.ts +2 -2
- package/esm/tag/utils.d.ts +50 -0
- package/esm/tag/utils.js +64 -0
- package/esm/textarea/basewebAdapters.js +4 -4
- package/esm/textarea/styled-components.d.ts +1 -1
- package/esm/textarea/textarea.js +4 -8
- package/esm/textarea/types.d.ts +7 -5
- package/esm/theme/Provider.d.ts +10 -0
- package/esm/theme/Provider.js +61 -0
- package/esm/theme/context.d.ts +1 -10
- package/esm/theme/context.js +1 -61
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/themes/index.js +1 -1
- package/esm/themes/responsive-theme.d.ts +2 -2
- package/esm/time-picker/TimePicker.d.ts +1 -6
- package/esm/time-picker/TimePicker.js +4 -4
- package/esm/time-picker/types.d.ts +3 -1
- package/esm/time-range-picker/RangeSelector.js +6 -5
- package/esm/time-range-picker/RangeSelectorContainer.js +27 -27
- package/esm/time-range-picker/TimeRangeList.js +8 -1
- package/esm/time-range-picker/TimeRangePicker.js +26 -17
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/locale.d.ts +3 -0
- package/esm/time-range-picker/types.d.ts +17 -3
- package/esm/time-range-picker/utils.d.ts +47 -18
- package/esm/time-range-picker/utils.js +94 -16
- package/esm/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/esm/time-zone-picker/TimezonePicker.js +5 -7
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/esm/tooltip/overrides.js +1 -2
- package/esm/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/esm/tooltip/stateful-tooltip.d.ts +27 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +7 -4
- package/esm/tooltip/types.d.ts +12 -2
- package/esm/types.d.ts +5 -3
- package/esm/typography/Typography.js +14 -1
- package/esm/typography/constants.d.ts +56 -0
- package/esm/typography/constants.js +56 -0
- package/esm/typography/index.d.ts +1 -0
- package/esm/typography/index.js +1 -0
- package/esm/typography/styled-components.js +12 -4
- package/esm/typography/types.d.ts +1 -1
- package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/esm/utils/intlNumberFormatUtils/index.js +36 -0
- package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/esm/utils/intlNumberFormatUtils/types.js +6 -0
- package/esm/video/Video.js +4 -2
- package/esm/video/types.d.ts +2 -0
- package/form-control/context.d.ts +6 -13
- package/form-control/context.js +11 -10
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +18 -7
- package/helpers/ClearIconButton.js +3 -1
- package/helpers/StyledTombstone.d.ts +1 -0
- package/helpers/StyledTombstone.js +21 -0
- package/helpers/baseui/useConvertOverrides.js +6 -1
- package/helpers/baseui/withThemeOverride.js +1 -1
- package/helpers/commonStyles.d.ts +2 -2
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/styletron.d.ts +14 -3
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.d.ts +6 -7
- package/hooks/useAutoFocus.js +19 -14
- package/hooks/useCombinedRef.d.ts +1 -0
- package/hooks/useCombinedRef.js +35 -1
- package/hooks/useIsMobileDevice.d.ts +1 -0
- package/hooks/useIsMobileDevice.js +11 -0
- package/hooks/useMatchMedia.d.ts +3 -0
- package/hooks/useMatchMedia.js +52 -0
- package/icon/components/alert-solid.js +2 -0
- package/icon/components/alert.js +2 -0
- package/icon/components/calendar-solid.js +2 -0
- package/icon/components/chevron-down.js +2 -0
- package/icon/components/chevron-left.d.ts +3 -0
- package/icon/components/chevron-left.js +11 -0
- package/icon/components/chevron-right.d.ts +3 -0
- package/icon/components/chevron-right.js +11 -0
- package/icon/components/close.js +2 -0
- package/icon/components/error-clr.js +2 -0
- package/icon/components/error-solid.js +2 -0
- package/icon/components/error.js +2 -0
- package/icon/components/imagePreview.js +2 -0
- package/icon/components/info.js +2 -0
- package/icon/components/play-video.js +2 -0
- package/icon/components/reset-color.d.ts +3 -0
- package/icon/components/reset-color.js +11 -0
- package/icon/components/search.js +2 -0
- package/icon/components/tick.js +2 -0
- package/icon/components/tickCircle-solid.js +2 -0
- package/icon/components/user.js +2 -0
- package/icon/components/video-non-playable.js +2 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/input/basewebAdapters.d.ts +1 -1
- package/input/basewebAdapters.js +18 -3
- package/input/index.d.ts +2 -1
- package/input/index.js +3 -1
- package/input/styled-components.d.ts +1 -1
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +10 -4
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +6 -8
- package/list/divider.js +6 -3
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -1
- package/list/list-item.d.ts +3 -1
- package/list/list-item.js +9 -6
- package/list/list.d.ts +10 -5
- package/list/list.js +47 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -18
- package/list/types.d.ts +8 -0
- package/list/utils.d.ts +2 -0
- package/list/utils.js +14 -0
- package/locale/en_US.js +35 -0
- package/locale/types.d.ts +21 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +8 -2
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +6 -0
- package/menu/menu.js +11 -11
- package/menu/types.d.ts +1 -0
- package/menu/useKeyboardNavigation.d.ts +6 -3
- package/menu/useKeyboardNavigation.js +21 -14
- package/menu/useStatefulMenu.d.ts +5 -2
- package/menu/useStatefulMenu.js +14 -8
- package/modal/adapter.d.ts +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +1 -2
- package/modal/modal.js +4 -4
- package/modal/overrides.d.ts +2 -3
- package/modal/overrides.js +7 -9
- package/modal/styled-components.d.ts +1 -1
- package/modal/styled-components.js +8 -9
- package/number/Number.d.ts +3 -0
- package/number/Number.js +14 -0
- package/number/constants.d.ts +2 -0
- package/number/constants.js +7 -0
- package/number/index.d.ts +5 -0
- package/number/index.js +12 -0
- package/number/package.json +4 -0
- package/number/types.d.ts +6 -0
- package/number/types.js +2 -0
- package/number/useNumber.d.ts +2 -0
- package/number/useNumber.js +12 -0
- package/overrides/index.d.ts +1 -1
- package/overrides/index.js +2 -1
- package/overrides/mergeOverrides.d.ts +3 -2
- package/overrides/mergeOverrides.js +6 -4
- package/package.json +18 -12
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +27 -4
- package/payment-card/styled-components.js +24 -5
- package/payment-card/types.d.ts +4 -2
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +4 -6
- package/phone-input/default-props.d.ts +6 -9
- package/phone-input/default-props.js +8 -9
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -6
- package/phone-input/phone-input.js +20 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -6
- package/phone-input/styled-components.d.ts +9 -1
- package/phone-input/styled-components.js +22 -7
- package/phone-input/types.d.ts +2 -1
- package/phone-input/utils.d.ts +10 -3
- package/phone-input/utils.js +11 -5
- package/popover/adapter.d.ts +4 -3
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +6 -3
- package/popover/popover.js +12 -5
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +10 -2
- package/popover/types.js +5 -4
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/circular/styled-component.d.ts +1 -1
- package/progress/circular/styled-component.js +4 -4
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/basewebAdapters.d.ts +8 -11
- package/radio/basewebAdapters.js +6 -3
- package/radio/radio.js +6 -5
- package/radio/styled-components.js +9 -11
- package/radio/types.d.ts +13 -6
- package/search/index.d.ts +1 -0
- package/search/index.js +3 -1
- package/search/search.d.ts +1 -1
- package/search/search.js +14 -5
- package/search/stateful-search.d.ts +3 -0
- package/search/stateful-search.js +19 -0
- package/search/styled-components.d.ts +1 -10
- package/search/styled-components.js +56 -25
- package/search/types.d.ts +8 -2
- package/select/adaptor.d.ts +1 -1
- package/select/base-select.d.ts +36 -16
- package/select/base-select.js +183 -86
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +9 -5
- package/select/default-props.js +4 -1
- package/select/index.d.ts +4 -4
- package/select/index.js +4 -2
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSelect.js +3 -5
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +9 -17
- package/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/select/overlaySelect/hooks/useControlRef.js +37 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/select/overrides.d.ts +3 -1
- package/select/overrides.js +20 -14
- package/select/select-variants.js +2 -2
- package/select/select.d.ts +9 -5
- package/select/select.js +9 -3
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
- package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
- package/select/selectMenuAdapter/types.d.ts +42 -0
- package/select/selectMenuAdapter/types.js +2 -0
- package/select/stateful-select.d.ts +9 -5
- package/select/stateful-select.js +3 -3
- package/select/styled-component.d.ts +15 -4
- package/select/styled-component.js +58 -11
- package/select/types.d.ts +36 -9
- package/select/types.js +2 -1
- package/select/utils/default-filter-options.d.ts +2 -1
- package/select/utils/default-filter-options.js +6 -5
- package/select/utils/hidden-element.d.ts +6 -0
- package/select/utils/hidden-element.js +19 -0
- package/select/utils/merge-options.d.ts +2 -0
- package/select/utils/merge-options.js +22 -0
- package/select/utils/test-utils.d.ts +1 -0
- package/select/utils/test-utils.js +11 -0
- package/slider/mark.d.ts +3 -3
- package/slider/slider.js +2 -1
- package/slider/stateful-slider.js +1 -1
- package/slider/styled-components.js +4 -4
- package/slider/types.d.ts +9 -2
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/CustomBaseProvider.js +1 -0
- package/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/spacewebProvider/SpacewebProvider.js +8 -8
- package/stack/stack.js +6 -13
- package/style/_buildUtils.d.ts +1 -1
- package/style/_buildUtils.js +3 -1
- package/style/_parseStyle.js +12 -7
- package/style/useMemoizedStyletron.d.ts +1 -1
- package/style/useMemoizedStyletron.js +6 -1
- package/styleEngine/styleEngine.d.ts +1 -2
- package/switch/__test__/switch.spec.js +13 -0
- package/switch/styled-components.js +14 -21
- package/switch/switch.js +5 -2
- package/switch/types.d.ts +8 -11
- package/tag/avatar-tag.js +23 -16
- package/tag/styled-components.js +32 -27
- package/tag/tag.js +19 -11
- package/tag/types.d.ts +2 -2
- package/tag/utils.d.ts +50 -0
- package/tag/utils.js +67 -1
- package/textarea/basewebAdapters.js +3 -3
- package/textarea/styled-components.d.ts +1 -1
- package/textarea/textarea.js +3 -7
- package/textarea/types.d.ts +7 -5
- package/theme/Provider.d.ts +10 -0
- package/theme/Provider.js +65 -0
- package/theme/context.d.ts +1 -10
- package/theme/context.js +1 -61
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/themes/index.js +1 -1
- package/themes/responsive-theme.d.ts +2 -2
- package/time-picker/TimePicker.d.ts +1 -6
- package/time-picker/TimePicker.js +4 -4
- package/time-picker/types.d.ts +3 -1
- package/time-range-picker/RangeSelector.js +5 -4
- package/time-range-picker/RangeSelectorContainer.js +26 -26
- package/time-range-picker/TimeRangeList.js +8 -1
- package/time-range-picker/TimeRangePicker.js +25 -16
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/locale.d.ts +3 -0
- package/time-range-picker/types.d.ts +17 -3
- package/time-range-picker/utils.d.ts +47 -18
- package/time-range-picker/utils.js +98 -17
- package/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/time-zone-picker/TimezonePicker.js +5 -7
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/tooltip/overrides.js +1 -2
- package/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/tooltip/stateful-tooltip.d.ts +27 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +7 -4
- package/tooltip/types.d.ts +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +5 -3
- package/typography/Typography.js +14 -1
- package/typography/constants.d.ts +56 -0
- package/typography/constants.js +57 -1
- package/typography/index.d.ts +1 -0
- package/typography/index.js +3 -1
- package/typography/styled-components.js +11 -3
- package/typography/types.d.ts +1 -1
- package/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/utils/intlNumberFormatUtils/index.js +40 -0
- package/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/utils/intlNumberFormatUtils/types.js +9 -0
- package/utils/package.json +4 -0
- package/video/Video.js +4 -2
- package/video/types.d.ts +2 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/esm/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/esm/phone-input/virtualized-country-select-dropdown.js +0 -33
- package/esm/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/esm/style/_escapeClassName.d.ts +0 -6
- package/esm/style/_escapeClassName.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
- package/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/phone-input/virtualized-country-select-dropdown.js +0 -35
- package/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/style/_escapeClassName.d.ts +0 -6
- package/style/_escapeClassName.js +0 -9
|
@@ -7,7 +7,7 @@ declare const responsiveTheme: {
|
|
|
7
7
|
medium: number;
|
|
8
8
|
large: number;
|
|
9
9
|
};
|
|
10
|
-
mediaQuery: Record<"
|
|
10
|
+
mediaQuery: Record<"large" | "medium" | "small", string>;
|
|
11
11
|
};
|
|
12
12
|
export declare const withResponsiveTheme: <T extends object>(theme: T) => T & {
|
|
13
13
|
breakpoints: {
|
|
@@ -15,6 +15,6 @@ export declare const withResponsiveTheme: <T extends object>(theme: T) => T & {
|
|
|
15
15
|
medium: number;
|
|
16
16
|
large: number;
|
|
17
17
|
};
|
|
18
|
-
mediaQuery: Record<"
|
|
18
|
+
mediaQuery: Record<"large" | "medium" | "small", string>;
|
|
19
19
|
};
|
|
20
20
|
export {};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TimePickerProps } from './types';
|
|
3
|
-
export declare const TimePicker:
|
|
4
|
-
(props: TimePickerProps): ReactElement;
|
|
5
|
-
defaultProps: {
|
|
6
|
-
size: "md";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
3
|
+
export declare const TimePicker: (props: TimePickerProps) => ReactElement;
|
|
@@ -4,8 +4,11 @@ import { TimePicker as BaseTimePicker } from 'baseui/timepicker';
|
|
|
4
4
|
import { Select } from '../select';
|
|
5
5
|
import { useContextualFormProps } from '../form-control/context';
|
|
6
6
|
import { useConvertOverrides } from '../helpers/baseui/useConvertOverrides';
|
|
7
|
+
import { getDefaultSize } from '../helpers/themeHelpers';
|
|
8
|
+
import { useStyle } from '../style';
|
|
7
9
|
var useTimePickerBasewebAdapter = function (props) {
|
|
8
|
-
var
|
|
10
|
+
var theme = useStyle().theme;
|
|
11
|
+
var _a = useContextualFormProps(props), _b = _a.size, size = _b === void 0 ? getDefaultSize(theme) : _b, className = _a.className, style = _a.style, intent = _a.intent, overrides = _a.overrides, clearable = _a.clearable, restProps = __rest(_a, ["size", "className", "style", "intent", "overrides", "clearable"]);
|
|
9
12
|
var convertedOverrides = useConvertOverrides({
|
|
10
13
|
Select: {
|
|
11
14
|
component: Select,
|
|
@@ -23,6 +26,3 @@ export var TimePicker = function (props) {
|
|
|
23
26
|
var adaptedProps = useTimePickerBasewebAdapter(props);
|
|
24
27
|
return _jsx(BaseTimePicker, __assign({}, adaptedProps), void 0);
|
|
25
28
|
};
|
|
26
|
-
TimePicker.defaultProps = {
|
|
27
|
-
size: 'md',
|
|
28
|
-
};
|
|
@@ -2,10 +2,12 @@ import { Intent, Styles } from '../types';
|
|
|
2
2
|
import { Override } from '../overrides/types';
|
|
3
3
|
import { SharedProps, Size } from '../select/types';
|
|
4
4
|
import { TimePickerProps as BaseTimePickerProps, TimePickerOverrides as BaseTimePickerOverrides } from 'baseui/timepicker';
|
|
5
|
+
import { DateIOAdapter } from 'baseui/datepicker/utils/types';
|
|
5
6
|
export declare type TimePickerOverrides = {
|
|
6
7
|
[key in keyof BaseTimePickerOverrides]?: Override<SharedProps>;
|
|
7
8
|
};
|
|
8
|
-
export declare type TimePickerProps = Omit<BaseTimePickerProps, 'error' | 'positive' | 'overrides' | 'size' | 'nullable'> & {
|
|
9
|
+
export declare type TimePickerProps = Omit<BaseTimePickerProps, 'error' | 'positive' | 'overrides' | 'size' | 'nullable' | 'adapter'> & {
|
|
10
|
+
adapter?: DateIOAdapter<Date>;
|
|
9
11
|
intent?: Intent;
|
|
10
12
|
className?: Styles;
|
|
11
13
|
style?: Styles;
|
|
@@ -3,13 +3,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Box } from '../box';
|
|
5
5
|
import DefaultTimeRangeList from './TimeRangeList';
|
|
6
|
-
import
|
|
6
|
+
import BaseCalendar from '../date-picker/Calendar';
|
|
7
7
|
import { useOverrides } from '../overrides';
|
|
8
8
|
import { getHeight } from './utils';
|
|
9
9
|
var RangeSelector = function (_a) {
|
|
10
|
-
var _b;
|
|
10
|
+
var _b, _c;
|
|
11
11
|
var timeRange = _a.timeRange, preset = _a.preset, onChange = _a.onChange, formatString = _a.formatString, props = __rest(_a, ["timeRange", "preset", "onChange", "formatString"]);
|
|
12
|
-
var
|
|
12
|
+
var _d = __read(useOverrides((_b = props.overrides) === null || _b === void 0 ? void 0 : _b.TimeRangeList, DefaultTimeRangeList), 2), TimeRangeList = _d[0], timeRangeListProps = _d[1];
|
|
13
|
+
var _e = __read(useOverrides((_c = props.overrides) === null || _c === void 0 ? void 0 : _c.Calendar, BaseCalendar), 2), Calendar = _e[0], calendarProps = _e[1];
|
|
13
14
|
var height = getHeight({
|
|
14
15
|
monthsShown: props.monthsShown,
|
|
15
16
|
timeSelect: props.timeSelect,
|
|
@@ -17,9 +18,9 @@ var RangeSelector = function (_a) {
|
|
|
17
18
|
return (_jsxs(Box, __assign({ className: [
|
|
18
19
|
'flex border-t-1 border-b-1 border-r-0 border-l-0 border-solid spr-border-01',
|
|
19
20
|
{ height: "".concat(height, "px") },
|
|
20
|
-
] }, { children: [props.timeRangePresets.length !== 1 ? (_jsx(TimeRangeList, __assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets }, timeRangeListProps), void 0)) : null, _jsx(Box, __assign({ className: "overflow-y-auto" }, { children: _jsx(Calendar, { timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
21
|
+
] }, { children: [props.timeRangePresets.length !== 1 ? (_jsx(TimeRangeList, __assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets }, timeRangeListProps), void 0)) : null, _jsx(Box, __assign({ className: "overflow-y-auto" }, { children: _jsx(Calendar, __assign({ timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
21
22
|
// @ts-ignore
|
|
22
|
-
overrides: props.overrides, fixedHeight: props.fixedHeight }, void 0) }), void 0)] }), void 0));
|
|
23
|
+
overrides: props.overrides, fixedHeight: props.fixedHeight }, calendarProps), void 0) }), void 0)] }), void 0));
|
|
23
24
|
};
|
|
24
25
|
RangeSelector.displayName = 'RangeSelector';
|
|
25
26
|
export default memo(RangeSelector);
|
|
@@ -13,8 +13,7 @@ import DefaultTimezonePicker from './TimezonePicker';
|
|
|
13
13
|
import ErrorIcon from '../icon/components/error';
|
|
14
14
|
import { StyledFooter, StyledFooterBeforeEnhancer } from '../date-picker/styled-components';
|
|
15
15
|
import { useLocale } from '../locale';
|
|
16
|
-
import { getSelectedTimeRange } from './utils';
|
|
17
|
-
import { isTimeInRange } from '../date-picker/utils';
|
|
16
|
+
import { getRangeError, getSelectedTimeRange } from './utils';
|
|
18
17
|
import { useOverrides } from '../overrides';
|
|
19
18
|
var getPresetId = function (selectedPreset, selectedValue) {
|
|
20
19
|
if (selectedPreset) {
|
|
@@ -33,42 +32,40 @@ var RangeSelectorContainer = function (_a) {
|
|
|
33
32
|
var _g = __read(useState(selectedTimeRange), 2), timeRange = _g[0], setTimeRange = _g[1];
|
|
34
33
|
var _h = __read(useState(getPresetId(selectedPreset, selectedValue)), 2), preset = _h[0], setPreset = _h[1];
|
|
35
34
|
var _j = __read(useState(selectedTimezone), 2), timezone = _j[0], setTimezone = _j[1];
|
|
36
|
-
var _k = __read(useState(false), 2), hasError = _k[0], setHasError = _k[1];
|
|
37
35
|
useEffect(function () {
|
|
38
36
|
setTimeRange(selectedTimeRange);
|
|
39
37
|
setPreset(getPresetId(selectedPreset, selectedValue));
|
|
40
38
|
}, [selectedTimeRange, selectedValue, selectedPreset]);
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [preset, timeRange, minDate, maxDate, dateHelpers]);
|
|
39
|
+
var _k = __read(useOverrides((_b = props.overrides) === null || _b === void 0 ? void 0 : _b.Header, StyledHeader), 2), Header = _k[0], headerProps = _k[1];
|
|
40
|
+
var _l = __read(useOverrides((_c = props.overrides) === null || _c === void 0 ? void 0 : _c.HeaderBeforeEnhancer, Typography), 2), HeaderBeforeEnhancer = _l[0], headerBeforeEnhancerProps = _l[1];
|
|
41
|
+
var _m = __read(useOverrides((_d = props.overrides) === null || _d === void 0 ? void 0 : _d.Footer, StyledFooter), 2), Footer = _m[0], footerProps = _m[1];
|
|
42
|
+
var _o = __read(useOverrides((_e = props.overrides) === null || _e === void 0 ? void 0 : _e.FooterBeforeEnhancer, StyledFooterBeforeEnhancer), 2), FooterBeforeEnhancer = _o[0], footerBeforeEnhancerProps = _o[1];
|
|
43
|
+
var _p = __read(useOverrides((_f = props.overrides) === null || _f === void 0 ? void 0 : _f.TimezonePicker, DefaultTimezonePicker), 2), TimezonePicker = _p[0], timezonePickerProps = _p[1];
|
|
44
|
+
var _q = useMemo(function () {
|
|
45
|
+
return getRangeError({
|
|
46
|
+
dateHelpers: dateHelpers,
|
|
47
|
+
timeRange: timeRange,
|
|
48
|
+
maxDate: maxDate,
|
|
49
|
+
minDate: minDate,
|
|
50
|
+
locale: locale,
|
|
51
|
+
preset: preset,
|
|
52
|
+
});
|
|
53
|
+
}, [timeRange, minDate, maxDate, dateHelpers, locale, preset]), hasError = _q.hasError, errMsg = _q.errMsg;
|
|
57
54
|
var onDateChange = useCallback(function (_a) {
|
|
58
55
|
var _b, _c, _d;
|
|
59
|
-
var date = _a.date,
|
|
56
|
+
var date = _a.date, _preset = _a.preset;
|
|
60
57
|
// if preset is passed then we have to get the time range limits else date is array
|
|
61
|
-
if (
|
|
62
|
-
var nextDate = (_d = (_c = (_b = getSelectedTimeRange(
|
|
58
|
+
if (_preset) {
|
|
59
|
+
var nextDate = (_d = (_c = (_b = getSelectedTimeRange(_preset, timeRangePresets)) === null || _b === void 0 ? void 0 : _b.getTimeRangeLimits) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : [];
|
|
63
60
|
/* Here we have to manually set 0 ms on startDate and 999ms on endDate, becuase baseui internally clamps day to start of the day.
|
|
64
61
|
But in this function they only set hours, minutes and seconds to 0 and ms remains as it is. So, isDayInRange check fails, where
|
|
65
62
|
they checks (startDate<=endDate). As milliseconds of end Date may be greater then start Date, it leads to failure of presets like
|
|
66
63
|
Last 1 Hour, Last 2 to 1 Hours, Last 12 Hours, etc...
|
|
67
64
|
*/
|
|
68
65
|
nextDate = __spreadArray(__spreadArray([], __read((nextDate[0] ? [new Date(nextDate[0].setMilliseconds(0))] : [])), false), __read((nextDate[1] ? [new Date(nextDate[1].setMilliseconds(999))] : [])), false);
|
|
69
|
-
setPreset(
|
|
66
|
+
setPreset(_preset);
|
|
70
67
|
setTimeRange(nextDate);
|
|
71
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(__assign({ value:
|
|
68
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(__assign({ value: _preset, date: nextDate, preset: _preset }, (disableTimezone ? {} : { timezone: timezone })));
|
|
72
69
|
}
|
|
73
70
|
else {
|
|
74
71
|
var nextDate = date;
|
|
@@ -87,15 +84,18 @@ var RangeSelectorContainer = function (_a) {
|
|
|
87
84
|
var handleSubmit = useCallback(function () {
|
|
88
85
|
return onSubmit(__assign({ timeRange: timeRange, preset: preset }, (disableTimezone ? {} : { timezone: timezone })));
|
|
89
86
|
}, [timeRange, preset, timezone, onSubmit, disableTimezone]);
|
|
90
|
-
|
|
87
|
+
// show error message only when it is present, hasError can be true when user has not selected any date,
|
|
88
|
+
// but we are showing any error message for that scenario.
|
|
89
|
+
var errorEl = errMsg ? (_jsxs(Stack, __assign({ direction: "horizontal", gap: 1, className: cx('mr-1', { 'items-center': monthsShown !== 1 }), shrink: true }, { children: [_jsx(ErrorIcon, { size: 14, className: [
|
|
90
|
+
'block',
|
|
91
91
|
function (_a) {
|
|
92
92
|
var theme = _a.theme;
|
|
93
93
|
return ({
|
|
94
94
|
fill: theme.spr.clrRed,
|
|
95
95
|
});
|
|
96
96
|
},
|
|
97
|
-
] }, void 0), _jsx(Typography, __assign({ className: "my-0", variant: "bs3" }, { children:
|
|
98
|
-
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "bs1", "$as": "span", weight: "medium", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel }), void 0), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone }, timezonePickerProps), void 0))] }), void 0), _jsx(RangeSelector, { overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown }, void 0),
|
|
97
|
+
] }, void 0), _jsx(Typography, __assign({ className: "my-0", variant: "bs3" }, { children: errMsg }), void 0)] }), void 0)) : null;
|
|
98
|
+
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "bs1", "$as": "span", weight: "medium", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel }), void 0), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone }, timezonePickerProps), void 0))] }), void 0), _jsx(RangeSelector, { overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown }, void 0), _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { children: _jsxs(Box, __assign({ className: "justify-between w-0 flex-grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps), void 0), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: [cx({ 'items-center': monthsShown !== 1 }), { maxWidth: 'fit-content' }] }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [_jsx(Button, __assign({ size: "sm", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }), void 0), _jsx(Button, __assign({ size: "sm", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }), void 0)] }), void 0), monthsShown === 1 ? errorEl : null] }), void 0)] }), void 0) }), void 0)] }), void 0));
|
|
99
99
|
};
|
|
100
100
|
RangeSelectorContainer.displayName = 'RangeSelectorContainer';
|
|
101
101
|
export default RangeSelectorContainer;
|
|
@@ -5,6 +5,7 @@ import { Menu as DefaultMenu, MenuItem as DefaultMenuItem } from '../menu';
|
|
|
5
5
|
import { Box } from '../box';
|
|
6
6
|
import { useOverrides } from '../overrides';
|
|
7
7
|
import { useLocale } from '../locale';
|
|
8
|
+
import { useIsMobileDevice } from '../hooks/useIsMobileDevice';
|
|
8
9
|
var TimeRangeList = function (_a) {
|
|
9
10
|
var onChange = _a.onChange, timeRange = _a.timeRange, preset = _a.preset, timeRangePresets = _a.timeRangePresets, overrides = _a.overrides;
|
|
10
11
|
var locale = useLocale();
|
|
@@ -16,9 +17,15 @@ var TimeRangeList = function (_a) {
|
|
|
16
17
|
onChange({ preset: timeRangePreset.id });
|
|
17
18
|
}
|
|
18
19
|
}, [onChange, timeRange]);
|
|
20
|
+
var isMobileDevice = useIsMobileDevice();
|
|
19
21
|
var _b = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Menu, DefaultMenu), 2), Menu = _b[0], menuProps = _b[1];
|
|
20
22
|
var _c = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.MenuItem, DefaultMenuItem), 2), MenuItem = _c[0], menuItemProps = _c[1];
|
|
21
|
-
return (_jsx(Box, __assign({ className:
|
|
23
|
+
return (_jsx(Box, __assign({ className: [
|
|
24
|
+
'overflow-y-auto border-r-1 border-l-0 border-t-0 border-b-0 spr-border-01 border-solid',
|
|
25
|
+
{
|
|
26
|
+
width: isMobileDevice ? '110px' : '160px',
|
|
27
|
+
},
|
|
28
|
+
] }, { children: _jsx(Menu, __assign({ "aria-label": locale.timeRangePicker.presetMenuAriaLabel, disableNavigationOnMount: true, resetMenuHighlightOnMouseLeave: true, className: ['focus-visible:-outline-offset-2', menuProps === null || menuProps === void 0 ? void 0 : menuProps.className], role: "listbox", "$showFocusOutline": true }, menuProps, { children: timeRangePresets.map(function (timeRangePreset) { return (_jsx(MenuItem, __assign({ onClick: function () { return onItemSelect(timeRangePreset); }, selected: timeRangePreset.id === preset, className: [
|
|
22
29
|
'static',
|
|
23
30
|
function (_a, _b) {
|
|
24
31
|
var theme = _a.theme;
|
|
@@ -4,13 +4,15 @@ import { useMemo, useCallback } from 'react';
|
|
|
4
4
|
import dateFnsAdapter from 'baseui/datepicker/utils/date-fns-adapter';
|
|
5
5
|
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
6
6
|
import RangeSelectorContainer from './RangeSelectorContainer';
|
|
7
|
-
import { getSelectedTimeRange, getSystemTzName, getDefaultTimeRangePresets,
|
|
7
|
+
import { getSelectedTimeRange, getSystemTzName, getDefaultTimeRangePresets, convertDateFromTargetTzToSystemTz, convertDateFromSystemTzToTargetTz, formatSummaryValue, } from './utils';
|
|
8
8
|
import { useDatePickerState, StatelessDatePicker } from '../date-picker';
|
|
9
9
|
import { useLocale } from '../locale';
|
|
10
10
|
import { DEFAULT_FORMAT_STRING } from '../date-picker/constants';
|
|
11
11
|
import { mergeOverrides } from '../overrides';
|
|
12
12
|
import { normalizeDashes, prepareLocale } from '../date-picker/utils';
|
|
13
13
|
import { CUSTOM_OPTION } from './constants';
|
|
14
|
+
import { IconButton } from '../button';
|
|
15
|
+
import BaseCalendarIcon from '../icon/components/calendar-solid';
|
|
14
16
|
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
15
17
|
export var TimeRangePicker = function (_a) {
|
|
16
18
|
var _b = _a.adapter, adapter = _b === void 0 ? dateFnsAdapter : _b, onSubmit = _a.onSubmit, _timezone = _a.timezone, value = _a.value, formatDisplayValue = _a.formatDisplayValue, timeRangePresets = _a.timeRangePresets, overrides = _a.overrides, timeSelect = _a.timeSelect, peekNextMonth = _a.peekNextMonth, excludeDates = _a.excludeDates, filterDate = _a.filterDate, minDate = _a.minDate, maxDate = _a.maxDate, _c = _a.placeholder, placeholder = _c === void 0 ? "".concat(DEFAULT_FORMAT_STRING, "-").concat(DEFAULT_FORMAT_STRING) : _c, _d = _a.formatString, formatString = _d === void 0 ? DEFAULT_FORMAT_STRING : _d, onClose = _a.onClose, onChange = _a.onChange, showTimezoneInSummary = _a.showTimezoneInSummary, clearable = _a.clearable, onClear = _a.onClear, showFullDateInSummary = _a.showFullDateInSummary, autoSizeInput = _a.autoSizeInput, preset = _a.preset, _e = _a.startOpen, startOpen = _e === void 0 ? false : _e, fixedHeight = _a.fixedHeight, _f = _a.monthsShown, monthsShown = _f === void 0 ? 2 : _f, weekStartsOn = _a.weekStartsOn, _g = _a.disableTimezone, disableTimezone = _g === void 0 ? false : _g, _h = _a.displayVariant, displayVariant = _h === void 0 ? 'default' : _h, props = __rest(_a, ["adapter", "onSubmit", "timezone", "value", "formatDisplayValue", "timeRangePresets", "overrides", "timeSelect", "peekNextMonth", "excludeDates", "filterDate", "minDate", "maxDate", "placeholder", "formatString", "onClose", "onChange", "showTimezoneInSummary", "clearable", "onClear", "showFullDateInSummary", "autoSizeInput", "preset", "startOpen", "fixedHeight", "monthsShown", "weekStartsOn", "disableTimezone", "displayVariant"]);
|
|
@@ -41,9 +43,8 @@ export var TimeRangePicker = function (_a) {
|
|
|
41
43
|
], false); }, [timeRangePresets, locale]);
|
|
42
44
|
var formatDate = useCallback(function (date, normalizedFormatString) {
|
|
43
45
|
if (normalizedFormatString === void 0) { normalizedFormatString = normalizeDashes(formatString); }
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [formatString, dateHelpers, timezone, dateFnsLocale]);
|
|
46
|
+
return dateHelpers.formatDate(date, normalizedFormatString, dateFnsLocale);
|
|
47
|
+
}, [formatString, dateHelpers, dateFnsLocale]);
|
|
47
48
|
var defaultFormatDisplayValue = useCallback(function (date, normalizedFormatString) {
|
|
48
49
|
var _a, _b;
|
|
49
50
|
if (normalizedFormatString === void 0) { normalizedFormatString = normalizeDashes(formatString); }
|
|
@@ -51,9 +52,6 @@ export var TimeRangePicker = function (_a) {
|
|
|
51
52
|
if (!Array.isArray(date) && date) {
|
|
52
53
|
return formatDate(date);
|
|
53
54
|
}
|
|
54
|
-
if (formatDisplayValue) {
|
|
55
|
-
return formatDisplayValue(date, normalizedFormatString);
|
|
56
|
-
}
|
|
57
55
|
var timeRangePreset;
|
|
58
56
|
if (typeof preset === 'string') {
|
|
59
57
|
timeRangePreset = getSelectedTimeRange(preset, timeRangeList);
|
|
@@ -61,7 +59,7 @@ export var TimeRangePicker = function (_a) {
|
|
|
61
59
|
else if (typeof value === 'string') {
|
|
62
60
|
timeRangePreset = getSelectedTimeRange(value, timeRangeList);
|
|
63
61
|
}
|
|
64
|
-
|
|
62
|
+
var options = {
|
|
65
63
|
date: date,
|
|
66
64
|
presetId: (_a = timeRangePreset === null || timeRangePreset === void 0 ? void 0 : timeRangePreset.id) !== null && _a !== void 0 ? _a : CUSTOM_OPTION.id,
|
|
67
65
|
presetLabel: (_b = timeRangePreset === null || timeRangePreset === void 0 ? void 0 : timeRangePreset.label) !== null && _b !== void 0 ? _b : locale.timeRangePicker.customRange,
|
|
@@ -73,7 +71,11 @@ export var TimeRangePicker = function (_a) {
|
|
|
73
71
|
adapter: adapter,
|
|
74
72
|
locale: dateFnsLocale,
|
|
75
73
|
displayVariant: displayVariant,
|
|
76
|
-
}
|
|
74
|
+
};
|
|
75
|
+
if (formatDisplayValue) {
|
|
76
|
+
return formatDisplayValue(date, normalizedFormatString, options);
|
|
77
|
+
}
|
|
78
|
+
return formatSummaryValue(options);
|
|
77
79
|
}, [
|
|
78
80
|
timezone,
|
|
79
81
|
value,
|
|
@@ -96,8 +98,8 @@ export var TimeRangePicker = function (_a) {
|
|
|
96
98
|
var timeRange = _a.timeRange, preset = _a.preset, timezone = _a.timezone;
|
|
97
99
|
// value is returned only for backward compatibility will be removed in future version.
|
|
98
100
|
if (preset === 'CUSTOM') {
|
|
99
|
-
var startMillis =
|
|
100
|
-
var endMillis =
|
|
101
|
+
var startMillis = convertDateFromTargetTzToSystemTz(timeRange[0], timezone);
|
|
102
|
+
var endMillis = convertDateFromTargetTzToSystemTz(timeRange[1], timezone);
|
|
101
103
|
var dates = [new Date(startMillis), new Date(endMillis)];
|
|
102
104
|
onSubmit(__assign({ value: dates, preset: preset, date: dates }, (disableTimezone ? {} : { timezone: timezone })));
|
|
103
105
|
}
|
|
@@ -116,12 +118,18 @@ export var TimeRangePicker = function (_a) {
|
|
|
116
118
|
else {
|
|
117
119
|
dates = (_c = (_b = (_a = getSelectedTimeRange(preset !== null && preset !== void 0 ? preset : value, timeRangeList)) === null || _a === void 0 ? void 0 : _a.getTimeRangeLimits) === null || _b === void 0 ? void 0 : _b.call(_a, timezone)) !== null && _c !== void 0 ? _c : [];
|
|
118
120
|
}
|
|
119
|
-
return __spreadArray(__spreadArray([], __read((dates[0] ? [
|
|
121
|
+
return __spreadArray(__spreadArray([], __read((dates[0] ? [new Date(convertDateFromSystemTzToTargetTz(dates[0], timezone))] : [])), false), __read((dates[1] ? [new Date(convertDateFromSystemTzToTargetTz(dates[1], timezone))] : [])), false);
|
|
120
122
|
}, [value, timeRangeList, timezone, preset]);
|
|
121
123
|
var mergedOverrides = useMemo(function () {
|
|
122
124
|
return mergeOverrides({
|
|
123
|
-
Input: {
|
|
124
|
-
|
|
125
|
+
Input: __assign(__assign({}, (displayVariant === 'iconButton'
|
|
126
|
+
? {
|
|
127
|
+
component: function () { return (_jsx(IconButton, __assign({ tooltipContent: locale.calendar.calendarButtonAriaLabel, size: props.size, bordered: true, shape: "square" }, { children: _jsx(BaseCalendarIcon, {}, void 0) }), void 0)); },
|
|
128
|
+
Before: {
|
|
129
|
+
component: function () { return null; },
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
: {})), { props: {
|
|
125
133
|
overrides: __assign({}, (displayVariant === 'compact'
|
|
126
134
|
? {
|
|
127
135
|
Before: {
|
|
@@ -129,8 +137,7 @@ export var TimeRangePicker = function (_a) {
|
|
|
129
137
|
},
|
|
130
138
|
}
|
|
131
139
|
: {})),
|
|
132
|
-
},
|
|
133
|
-
},
|
|
140
|
+
} }),
|
|
134
141
|
InputWrapper: {
|
|
135
142
|
props: {
|
|
136
143
|
'data-testid': 'time-range',
|
|
@@ -174,6 +181,8 @@ export var TimeRangePicker = function (_a) {
|
|
|
174
181
|
disableTimezone,
|
|
175
182
|
locale.timeRangePicker.popoverAriaLabel,
|
|
176
183
|
displayVariant,
|
|
184
|
+
locale.calendar.calendarButtonAriaLabel,
|
|
185
|
+
props.size,
|
|
177
186
|
]);
|
|
178
187
|
var handleInputChange = useCallback(function (_a) {
|
|
179
188
|
var _b = _a.value, _value = _b === void 0 ? [] : _b;
|
|
@@ -182,5 +191,5 @@ export var TimeRangePicker = function (_a) {
|
|
|
182
191
|
onSubmit(__assign({ value: _value, preset: 'CUSTOM', date: _value }, (disableTimezone ? {} : { timezone: timezone })));
|
|
183
192
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
184
193
|
}, [onSubmit, timezone, onClear, disableTimezone]);
|
|
185
|
-
return (_jsx(StatelessDatePicker, { value: timeRange, isOpen: isOpen, onFocus: handleOpen, onBlur: handleClose, formatDisplayValue: defaultFormatDisplayValue, trapTabbing: false, intent: props.intent, variant: props.variant, size: props.size, disabled: props.disabled, formatString: formatString, placeholder: placeholder, "aria-label": locale.timeRangePicker.ariaLabelRange, overrides: mergedOverrides, clearable: clearable, onChange: handleInputChange, autoSizeInput: autoSizeInput, locale: dateFnsLocale, mountNode: props.mountNode, minDate: minDate, maxDate: maxDate }, void 0));
|
|
194
|
+
return (_jsx(StatelessDatePicker, { value: timeRange, isOpen: isOpen, onFocus: handleOpen, onBlur: handleClose, formatDisplayValue: defaultFormatDisplayValue, trapTabbing: false, intent: props.intent, variant: props.variant, size: props.size, disabled: props.disabled, formatString: formatString, placeholder: placeholder, "aria-label": locale.timeRangePicker.ariaLabelRange, overrides: mergedOverrides, clearable: clearable, onChange: handleInputChange, autoSizeInput: autoSizeInput, locale: dateFnsLocale, mountNode: props.mountNode, minDate: minDate, maxDate: maxDate, "aria-describedby": props['aria-describedby'], "aria-labelledby": props['aria-labelledby'], required: props.required, id: props.id }, void 0));
|
|
186
195
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { TimeRangePicker } from './TimeRangePicker';
|
|
2
|
-
export { getDefaultTimeRangePresets, formatSummaryValue } from './utils';
|
|
2
|
+
export { getDefaultTimeRangePresets, formatSummaryValue, convertDateFromSrcTzToTargetTz, convertDateFromSystemTzToTargetTz, convertDateFromTargetTzToSystemTz, } from './utils';
|
|
3
3
|
export type { TimeRangePickerLocale } from './locale';
|
|
4
4
|
export type { TimeRangePickerValue, TimeRangePickerProps, TimeRangePreset, TimeRangePickerOverrides, FormatString, } from './types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { TimeRangePicker } from './TimeRangePicker';
|
|
2
|
-
export { getDefaultTimeRangePresets, formatSummaryValue } from './utils';
|
|
2
|
+
export { getDefaultTimeRangePresets, formatSummaryValue, convertDateFromSrcTzToTargetTz, convertDateFromSystemTzToTargetTz, convertDateFromTargetTzToSystemTz, } from './utils';
|
|
@@ -30,6 +30,7 @@ export declare type TimeRangePickerOverrides = DatepickerOverrides<Record<string
|
|
|
30
30
|
HeaderBeforeEnhancer?: Override<Record<string, any>>;
|
|
31
31
|
FooterBeforeEnhancer?: Override<Record<string, any>>;
|
|
32
32
|
TimezonePicker?: Override<Record<string, any>>;
|
|
33
|
+
Calendar?: Override<Record<string, any>>;
|
|
33
34
|
};
|
|
34
35
|
export declare type TimeRangePickerValue = {
|
|
35
36
|
value: Date[] | string;
|
|
@@ -38,15 +39,27 @@ export declare type TimeRangePickerValue = {
|
|
|
38
39
|
timezone?: string;
|
|
39
40
|
};
|
|
40
41
|
declare type Preset = string;
|
|
41
|
-
export declare type SizeVariant = 'default' | 'compact';
|
|
42
|
-
export declare type
|
|
42
|
+
export declare type SizeVariant = 'default' | 'compact' | 'iconButton';
|
|
43
|
+
export declare type FormatSummaryValueOptions = {
|
|
44
|
+
date: Date[];
|
|
45
|
+
presetId: string;
|
|
46
|
+
presetLabel: string;
|
|
47
|
+
timezone?: string;
|
|
48
|
+
formatString?: string;
|
|
49
|
+
showFullDateInSummary?: boolean;
|
|
50
|
+
showTimezoneInSummary?: boolean;
|
|
51
|
+
adapter?: any;
|
|
52
|
+
locale?: any;
|
|
53
|
+
hidePresetLabel?: boolean;
|
|
54
|
+
displayVariant?: SizeVariant;
|
|
55
|
+
};
|
|
56
|
+
export declare type TimeRangePickerProps = Omit<StatelessDatePickerProps, 'value' | 'overrides' | 'onChange' | 'isOpen' | 'onFocus' | 'onBlur' | 'range' | 'formatDisplayValue'> & {
|
|
43
57
|
/**
|
|
44
58
|
* @deprecated Please prevent passing preset to value. Instead, pass it in the prop `preset`.
|
|
45
59
|
* This will be removed in future major releases.
|
|
46
60
|
*/
|
|
47
61
|
value?: Preset | Date[];
|
|
48
62
|
preset?: Preset;
|
|
49
|
-
timezone?: string;
|
|
50
63
|
timeRangePresets?: TimeRangePreset[];
|
|
51
64
|
onSubmit: (timeRangePickerValue: TimeRangePickerValue) => void;
|
|
52
65
|
overrides?: TimeRangePickerOverrides;
|
|
@@ -58,6 +71,7 @@ export declare type TimeRangePickerProps = Omit<StatelessDatePickerProps, 'value
|
|
|
58
71
|
startOpen?: boolean;
|
|
59
72
|
disableTimezone?: boolean;
|
|
60
73
|
displayVariant?: SizeVariant;
|
|
74
|
+
formatDisplayValue?: (date: Date | undefined | null | Array<Date | undefined | null>, formatString: string, options: FormatSummaryValueOptions) => string;
|
|
61
75
|
};
|
|
62
76
|
export declare type RangeSelectorContainerProps = Omit<TimeRangePickerProps, 'onFocus' | 'onBlur' | 'timeRangePresets' | 'onSubmit' | 'formatDisplayValue' | 'onClear' | 'timezone'> & {
|
|
63
77
|
timeRangePresets: TimeRangePreset[];
|
|
@@ -1,19 +1,49 @@
|
|
|
1
|
+
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
1
2
|
import { Locale } from '../locale';
|
|
2
|
-
import {
|
|
3
|
+
import { FormatSummaryValueOptions, TimeRangePreset } from './types';
|
|
3
4
|
export declare const getSelectedTimeRange: (selectedTimeRange: string | undefined, timeRangeOptions: Array<TimeRangePreset>) => TimeRangePreset | undefined;
|
|
4
5
|
export declare const getSystemTzName: () => string;
|
|
6
|
+
/**
|
|
7
|
+
@param date: Date object or epoch in source timezone
|
|
8
|
+
@param srcTz: source timezone
|
|
9
|
+
@param targetTz: target timezone
|
|
10
|
+
This function is used to convert the time from one timezone to another timezone.
|
|
11
|
+
Example use-case of this function
|
|
12
|
+
Lets say you want to find out what time it will be in New York when it is 6th Nov, 2022 00:00 in Los Angeles.
|
|
13
|
+
then you can call like:
|
|
14
|
+
convertDateFromSrcTzToTargetTz(new Date('6 Nov 2022, 00:00'), "America/Los_Angeles", "America/New_York")
|
|
15
|
+
this function will return 6 Nov 2022, 2:00 because generally NY is 3 hours ahead of LA but at 2:00AM NY will switch to DST
|
|
16
|
+
and hence it will be not 3:00AM but 2:00AM.
|
|
17
|
+
*/
|
|
18
|
+
export declare const convertDateFromSrcTzToTargetTz: (date: Date | number, srcTz?: string, targetTz?: string) => number;
|
|
19
|
+
/**
|
|
20
|
+
* @param date Date object or epoch representing the date in particular timezone
|
|
21
|
+
* @param timezone timezone of the date
|
|
22
|
+
* @returns epoch of the same time in system timezone
|
|
23
|
+
* Use case:
|
|
24
|
+
* Lets say user selects 6 Nov 2022, 00:00 from Time range picker and selects New York timezone.
|
|
25
|
+
* Now we want to find out what that time represents in our system timezone(Los Angeles) which in given case is 5 Nov 2022, 21:00
|
|
26
|
+
*/
|
|
27
|
+
export declare const convertDateFromTargetTzToSystemTz: (date: Date | number, timezone?: string) => number;
|
|
28
|
+
/**
|
|
29
|
+
* @param date date in system timezone
|
|
30
|
+
* @param timezone timezone in which you want to convert this date to
|
|
31
|
+
* @returns date in that timezone
|
|
32
|
+
* Use case:
|
|
33
|
+
* User will come back with 5 Nov 2022, 21:00 but has selected new york timezone so we want to find out
|
|
34
|
+
* what time it will be in new york when it is 5 Nov 2022, 21:00 in system timezone(Los Angeles), which is
|
|
35
|
+
* 6 Nov 2022, 00:00
|
|
36
|
+
*/
|
|
37
|
+
export declare const convertDateFromSystemTzToTargetTz: (date: Date | number, timezone?: string) => number;
|
|
5
38
|
/**
|
|
6
39
|
* returns milliseconds offset from timezone name
|
|
7
40
|
*/
|
|
8
41
|
export declare const getTzOffset: (timezone: string, date?: number | Date | undefined) => number;
|
|
9
42
|
/**
|
|
43
|
+
* @deprecated use convertDateFromTargetTzToSystemTz function to make sure you account for DST cases too
|
|
10
44
|
* convert epoch from one timezone to another
|
|
11
45
|
*/
|
|
12
46
|
export declare const switchEpochTimezone: (date: Date | number, tzFrom?: string, tzTo?: string) => number;
|
|
13
|
-
/**
|
|
14
|
-
* adapts date with the system timezone
|
|
15
|
-
*/
|
|
16
|
-
export declare const adaptDateWithSystemTz: (date: Date, selectedTimezone: string) => Date;
|
|
17
47
|
/**
|
|
18
48
|
* Adds or subtract the offset according to timezone passed so that we can get correct start date and end date in that timezone.
|
|
19
49
|
* ex. Lets say we are in Asia/Kolakata timezone on 19th Feb and time is 12:30 AM, and selected Asia/Kabul timezone and preset as Today.
|
|
@@ -23,20 +53,19 @@ export declare const adaptDateWithSystemTz: (date: Date, selectedTimezone: strin
|
|
|
23
53
|
*/
|
|
24
54
|
export declare const getDateForGivenTimezone: (timezone?: string | undefined) => Date;
|
|
25
55
|
export declare const getDefaultTimeRangePresets: (locale: Locale) => TimeRangePreset[];
|
|
26
|
-
export declare const formatSummaryValue: ({ date, presetId, presetLabel, timezone, formatString, showFullDateInSummary, showTimezoneInSummary, adapter, locale, hidePresetLabel, displayVariant, }:
|
|
27
|
-
date: Date[];
|
|
28
|
-
presetId: string;
|
|
29
|
-
presetLabel: string;
|
|
30
|
-
timezone?: string | undefined;
|
|
31
|
-
formatString?: string | undefined;
|
|
32
|
-
showFullDateInSummary?: boolean | undefined;
|
|
33
|
-
showTimezoneInSummary?: boolean | undefined;
|
|
34
|
-
adapter?: any;
|
|
35
|
-
locale?: any;
|
|
36
|
-
hidePresetLabel?: boolean | undefined;
|
|
37
|
-
displayVariant?: SizeVariant | undefined;
|
|
38
|
-
}) => string;
|
|
56
|
+
export declare const formatSummaryValue: ({ date, presetId, presetLabel, timezone, formatString, showFullDateInSummary, showTimezoneInSummary, adapter, locale, hidePresetLabel, displayVariant, }: FormatSummaryValueOptions) => string;
|
|
39
57
|
export declare const getHeight: ({ monthsShown, timeSelect }: {
|
|
40
58
|
monthsShown?: number | undefined;
|
|
41
59
|
timeSelect?: boolean | undefined;
|
|
42
60
|
}) => number;
|
|
61
|
+
export declare const getRangeError: ({ maxDate, minDate, dateHelpers, timeRange, locale, preset, }: {
|
|
62
|
+
minDate?: Date | null | undefined;
|
|
63
|
+
maxDate?: Date | null | undefined;
|
|
64
|
+
dateHelpers: DateHelpers<Date>;
|
|
65
|
+
timeRange: Date[];
|
|
66
|
+
locale: Locale;
|
|
67
|
+
preset?: string | undefined;
|
|
68
|
+
}) => {
|
|
69
|
+
hasError: boolean;
|
|
70
|
+
errMsg?: string;
|
|
71
|
+
};
|