@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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useGetExpandedGroup } from './hooks/useGetExpandedGroup';
|
|
5
|
+
import { Box } from '../../box';
|
|
6
|
+
import { Menu } from '../../menu';
|
|
7
|
+
import { Typography } from '../../typography';
|
|
8
|
+
import SelectMenuItem from './SelectMenuItem';
|
|
9
|
+
import _map from 'lodash/map';
|
|
10
|
+
import _isEmpty from 'lodash/isEmpty';
|
|
11
|
+
import { mergeOverrides, useOverrides } from '../../overrides';
|
|
12
|
+
import { selectMenuOverrides } from '../overrides';
|
|
13
|
+
import { NoResults } from '../styled-component';
|
|
14
|
+
import { UNGROUPED_ID } from '../constants';
|
|
15
|
+
import { BaseButton } from '../../base-button';
|
|
16
|
+
import ChevronDown from '../../icon/components/chevron-down';
|
|
17
|
+
import { chevronStyles } from '../../helpers/commonStyles';
|
|
18
|
+
var Collapsible = function (_a) {
|
|
19
|
+
var _b;
|
|
20
|
+
var children = _a.children, group = _a.group, expanded = _a.expanded, onClick = _a.onClick, disabled = _a.disabled;
|
|
21
|
+
return (_jsxs(Box, __assign({ className: { borderRadius: 'inherit' } }, { children: [_jsxs(BaseButton, __assign({ disabled: disabled, onClick: function () { return onClick(group.id); }, className: [
|
|
22
|
+
'w-full flex justify-between items-center py-2 pl-4 pr-3 border-t-1 border-b-1 border-solid spr-border-01 disabled:opacity-60 disabled:cursor-not-allowed focus-visible:outline-none',
|
|
23
|
+
expanded ? 'border-b-1' : 'border-b-0',
|
|
24
|
+
], type: "button" }, { children: [_jsxs(Typography, __assign({ className: "block", variant: "h7" }, { children: [(_b = group.count) !== null && _b !== void 0 ? _b : '', " ", group.label] }), void 0), _jsx(ChevronDown, { style: chevronStyles, "$isOpen": expanded, "data-testid": expanded ? "".concat(group.id, "-expanded") : "".concat(group.id, "-collapsed") }, void 0)] }), void 0), expanded ? children : null] }), void 0));
|
|
25
|
+
};
|
|
26
|
+
export var CollapsibleSelectMenu = function (_a) {
|
|
27
|
+
var _b, _c, _d, _e;
|
|
28
|
+
var overrides = _a.overrides, value = _a.value, groupedItems = _a.items, multi = _a.multi, labelKey = _a.labelKey, valueKey = _a.valueKey, onItemSelect = _a.onItemSelect, shouldDisplaySelectAll = _a.shouldDisplaySelectAll, selectAllChecked = _a.selectAllSelected, noResultsMsg = _a.noResultsMsg, $onPaginate = _a.$onPaginate, groupConfig = _a.groupConfig, virtual = _a.virtual, clearAsOption = _a.clearAsOption, selectOnTab = _a.selectOnTab;
|
|
29
|
+
var selectAllSelected = !!shouldDisplaySelectAll && selectAllChecked;
|
|
30
|
+
var _f = __read(useGetExpandedGroup({ groupConfig: groupConfig, groupedItems: groupedItems }), 2), expandedGroupId = _f[0], setExpandedGroupId = _f[1];
|
|
31
|
+
var selectedValuesSet = useMemo(function () {
|
|
32
|
+
var set = new Set(_map(value, valueKey));
|
|
33
|
+
return set;
|
|
34
|
+
}, [value, valueKey]);
|
|
35
|
+
/**
|
|
36
|
+
* extract out useful overrides/props passed by baseui
|
|
37
|
+
*/
|
|
38
|
+
var listOverride = overrides === null || overrides === void 0 ? void 0 : overrides.List;
|
|
39
|
+
var optionOverride = overrides === null || overrides === void 0 ? void 0 : overrides.Option;
|
|
40
|
+
var baseuiMenuListProps;
|
|
41
|
+
var getItemLabel, baseuiMenuItemProps;
|
|
42
|
+
if (typeof optionOverride === 'object' && typeof optionOverride.props === 'object') {
|
|
43
|
+
getItemLabel = (_b = optionOverride === null || optionOverride === void 0 ? void 0 : optionOverride.props) === null || _b === void 0 ? void 0 : _b.getItemLabel;
|
|
44
|
+
baseuiMenuItemProps = (_e = (_d = (_c = optionOverride === null || optionOverride === void 0 ? void 0 : optionOverride.props) === null || _c === void 0 ? void 0 : _c.overrides) === null || _d === void 0 ? void 0 : _d.ListItem) === null || _e === void 0 ? void 0 : _e.props;
|
|
45
|
+
}
|
|
46
|
+
if (typeof listOverride === 'object') {
|
|
47
|
+
// todo: make this component a11y
|
|
48
|
+
baseuiMenuListProps = listOverride.props;
|
|
49
|
+
}
|
|
50
|
+
var mergedOverrides = useMemo(function () { return mergeOverrides(selectMenuOverrides, overrides); }, [overrides]);
|
|
51
|
+
var _g = __read(useOverrides(mergedOverrides.Menu, Menu), 2), MenuComponent = _g[0], menuProps = _g[1];
|
|
52
|
+
var _h = __read(useOverrides(mergedOverrides.NoResults, NoResults), 2), NoResultsOverriden = _h[0], noResultsProps = _h[1];
|
|
53
|
+
var menuItemOverrides = useMemo(function () { return ({
|
|
54
|
+
MenuItem: mergedOverrides.MenuItem,
|
|
55
|
+
ListItemText: mergedOverrides.ListItemText,
|
|
56
|
+
}); }, [mergedOverrides.ListItemText, mergedOverrides.MenuItem]);
|
|
57
|
+
var selectAllItem = shouldDisplaySelectAll ? groupedItems[UNGROUPED_ID][0] : null;
|
|
58
|
+
var clearAsOptionItem = !multi && clearAsOption ? groupedItems[UNGROUPED_ID][0] : null;
|
|
59
|
+
return (_jsxs(Box, __assign({ className: { borderRadius: 'inherit' } }, { children: [selectAllItem ? (_jsx(SelectMenuItem, __assign({ overrides: menuItemOverrides, item: selectAllItem, selected: selectAllSelected, multi: multi, getItemLabel: getItemLabel, labelKey: labelKey, valueKey: valueKey, onItemSelect: onItemSelect, "$item": selectAllItem, button: true }, baseuiMenuItemProps, { className: ['mt-1 mx-1', baseuiMenuItemProps === null || baseuiMenuItemProps === void 0 ? void 0 : baseuiMenuItemProps.className] }), "select-all-option")) : null, groupConfig.map(function (group) {
|
|
60
|
+
var _a;
|
|
61
|
+
var groupId = group.id;
|
|
62
|
+
var itemsInGroup = groupedItems[groupId];
|
|
63
|
+
return (_jsx(Collapsible, __assign({ group: group, expanded: selectAllSelected ? false : groupId === expandedGroupId, disabled: selectAllSelected, onClick: function (newGroupId) { return setExpandedGroupId(function (prev) { return (prev === newGroupId ? undefined : newGroupId); }); } }, { children: _isEmpty(itemsInGroup) ? (_jsx(NoResultsOverriden, __assign({ "aria-live": "polite", "aria-atomic": true, msg: noResultsMsg, "aria-disabled": true, "$groupId": groupId }, noResultsProps), void 0)) : (_jsxs(MenuComponent, __assign({ resetMenuHighlightOnMouseLeave: true, focusWhenNavigationEnabled: false, tabIndex: -1, selectOnTab: selectOnTab }, menuProps, { virtual: virtual, className: ['overflow-auto', { maxHeight: '200px' }, (_a = menuProps) === null || _a === void 0 ? void 0 : _a.className], onScroll: function (e) {
|
|
64
|
+
$onPaginate === null || $onPaginate === void 0 ? void 0 : $onPaginate(e, groupId);
|
|
65
|
+
} }, { children: [clearAsOptionItem ? (_jsx(SelectMenuItem, __assign({ overrides: menuItemOverrides, item: clearAsOptionItem, selected: selectAllSelected, multi: multi, getItemLabel: getItemLabel, labelKey: labelKey, valueKey: valueKey, onItemSelect: onItemSelect, "$item": clearAsOptionItem, button: true }, baseuiMenuItemProps), "clear-option")) : null, itemsInGroup.map(function (item) {
|
|
66
|
+
var selected = selectedValuesSet.has(item[valueKey]);
|
|
67
|
+
return (_jsx(SelectMenuItem, __assign({ overrides: menuItemOverrides, item: item, selected: selected, multi: multi, getItemLabel: getItemLabel, labelKey: labelKey, valueKey: valueKey, onItemSelect: onItemSelect, "$item": item, button: true }, baseuiMenuItemProps), item.isCreatable ? 'creatable-option' : item[valueKey]));
|
|
68
|
+
})] }), void 0)) }), groupId));
|
|
69
|
+
})] }), void 0));
|
|
70
|
+
};
|
|
@@ -1,34 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { Override } from '../../overrides';
|
|
5
|
-
import { SelectProps } from '../types';
|
|
6
|
-
declare type PropsAddedByOverride = {
|
|
7
|
-
id?: string;
|
|
8
|
-
value: SelectProps['value'];
|
|
9
|
-
overrides?: {
|
|
10
|
-
Menu?: Override<MenuProps>;
|
|
11
|
-
MenuItem?: Override<MenuItemProps & {
|
|
12
|
-
$multi: boolean;
|
|
13
|
-
$item: unknown;
|
|
14
|
-
$labelKey: string;
|
|
15
|
-
}>;
|
|
16
|
-
NoResults?: Override<{}>;
|
|
17
|
-
Divider?: Override<{
|
|
18
|
-
title: string;
|
|
19
|
-
}>;
|
|
20
|
-
ListItemText?: Override<{
|
|
21
|
-
$multi: boolean;
|
|
22
|
-
$item: unknown;
|
|
23
|
-
$labelKey: string;
|
|
24
|
-
}>;
|
|
25
|
-
};
|
|
26
|
-
valueKey: string;
|
|
27
|
-
labelKey: string;
|
|
28
|
-
multi: SelectProps['multi'];
|
|
29
|
-
selectAllSelected: boolean;
|
|
30
|
-
noResultsMsg?: string;
|
|
31
|
-
captureScroll?: boolean;
|
|
32
|
-
};
|
|
33
|
-
declare const SelectMenuAdapter: (props: BaseStatefulMenuProps & PropsAddedByOverride) => React.ReactElement;
|
|
2
|
+
import { MenuAdapterProps } from './types';
|
|
3
|
+
declare const SelectMenuAdapter: (props: MenuAdapterProps) => React.ReactElement;
|
|
34
4
|
export default SelectMenuAdapter;
|
|
@@ -15,6 +15,7 @@ import { selectMenuOverrides } from '../overrides';
|
|
|
15
15
|
import { NoResults } from '../styled-component';
|
|
16
16
|
import { SELECT_ALL_ID } from '../types';
|
|
17
17
|
import SelectMenuItem from './SelectMenuItem';
|
|
18
|
+
import { normalizeOptions } from 'baseui/select/utils';
|
|
18
19
|
var removeUngroupedIfEmpty = function (groupedOptions) {
|
|
19
20
|
var _a;
|
|
20
21
|
if (!((_a = groupedOptions[UNGROUPED_ID]) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
@@ -24,7 +25,7 @@ var removeUngroupedIfEmpty = function (groupedOptions) {
|
|
|
24
25
|
};
|
|
25
26
|
var SelectMenuAdapter = function (props) {
|
|
26
27
|
var _a, _b, _c, _d;
|
|
27
|
-
var id = props.id, groupedItems = props.items, overrides = props.overrides, _e = props.onItemSelect, onItemSelect = _e === void 0 ? _noop : _e, value = props.value, valueKey = props.valueKey, labelKey = props.labelKey, multi = props.multi, selectAllSelected = props.selectAllSelected, noResultsMsg = props.noResultsMsg, captureScroll = props.captureScroll;
|
|
28
|
+
var id = props.id, groupedItems = props.items, overrides = props.overrides, _e = props.onItemSelect, onItemSelect = _e === void 0 ? _noop : _e, value = props.value, valueKey = props.valueKey, labelKey = props.labelKey, multi = props.multi, selectAllSelected = props.selectAllSelected, noResultsMsg = props.noResultsMsg, captureScroll = props.captureScroll, virtual = props.virtual, overscanCount = props.overscanCount, selectOnTab = props.selectOnTab;
|
|
28
29
|
var selectedValuesSet = useMemo(function () {
|
|
29
30
|
var set = new Set(_map(value, valueKey));
|
|
30
31
|
return set;
|
|
@@ -36,7 +37,7 @@ var SelectMenuAdapter = function (props) {
|
|
|
36
37
|
var optionOverride = overrides === null || overrides === void 0 ? void 0 : overrides.Option;
|
|
37
38
|
var baseuiMenuListProps;
|
|
38
39
|
var getItemLabel, baseuiMenuItemProps;
|
|
39
|
-
if (typeof optionOverride === 'object') {
|
|
40
|
+
if (typeof optionOverride === 'object' && typeof optionOverride.props === 'object') {
|
|
40
41
|
getItemLabel = (_a = optionOverride === null || optionOverride === void 0 ? void 0 : optionOverride.props) === null || _a === void 0 ? void 0 : _a.getItemLabel;
|
|
41
42
|
baseuiMenuItemProps = (_d = (_c = (_b = optionOverride === null || optionOverride === void 0 ? void 0 : optionOverride.props) === null || _b === void 0 ? void 0 : _b.overrides) === null || _c === void 0 ? void 0 : _c.ListItem) === null || _d === void 0 ? void 0 : _d.props;
|
|
42
43
|
}
|
|
@@ -51,11 +52,16 @@ var SelectMenuAdapter = function (props) {
|
|
|
51
52
|
MenuItem: mergedOverrides.MenuItem,
|
|
52
53
|
ListItemText: mergedOverrides.ListItemText,
|
|
53
54
|
}); }, [mergedOverrides.ListItemText, mergedOverrides.MenuItem]);
|
|
55
|
+
var currentCount = 0, totalCount = normalizeOptions(groupedItems).length;
|
|
54
56
|
var itemsToRender = _flatten(Object.keys(removeUngroupedIfEmpty(groupedItems)).map(function (itemGroup, index) {
|
|
55
57
|
var itemsInGroup = groupedItems[itemGroup];
|
|
56
|
-
var menuItems = itemsInGroup.
|
|
58
|
+
var menuItems = itemsInGroup.flatMap(function (item) {
|
|
59
|
+
currentCount += 1;
|
|
57
60
|
var selected = selectedValuesSet.has(item[valueKey]) || (item[SELECT_ALL_ID] && selectAllSelected);
|
|
58
|
-
|
|
61
|
+
var selectMenuItem = (_jsx(SelectMenuItem, __assign({ overrides: menuItemOverrides, item: item, selected: selected, multi: multi, getItemLabel: getItemLabel, labelKey: labelKey, valueKey: valueKey, onItemSelect: onItemSelect, "$item": item, "aria-posinset": currentCount, "aria-setsize": totalCount }, baseuiMenuItemProps), item.isCreatable ? 'creatable-option' : "".concat(item[valueKey], "-").concat(item.__optgroup)));
|
|
62
|
+
return item[SELECT_ALL_ID]
|
|
63
|
+
? [selectMenuItem, _jsx(DividerOverriden, __assign({ "$item": item }, dividerProps), "divider-select-all")]
|
|
64
|
+
: selectMenuItem;
|
|
59
65
|
});
|
|
60
66
|
if (itemGroup !== UNGROUPED_ID) {
|
|
61
67
|
menuItems.unshift(_jsx(DividerOverriden, __assign({ first: index === 0 }, dividerProps, { children: _jsx(Typography, __assign({ variant: "l4", weight: "medium", className: "spr-text-03" }, { children: itemGroup }), void 0) }), "divider-".concat(itemGroup)));
|
|
@@ -67,6 +73,6 @@ var SelectMenuAdapter = function (props) {
|
|
|
67
73
|
}
|
|
68
74
|
return (
|
|
69
75
|
// focusWhenNavigationEnabled false, or else it will remove focus from select input
|
|
70
|
-
_jsx(MenuOverriden, __assign({ resetMenuHighlightOnMouseLeave: true, focusWhenNavigationEnabled: false, "$multi": multi, captureScroll: captureScroll, tabIndex: -1, "aria-label": "Menu", role: "listbox" }, baseuiMenuListProps, { id: id }, menuProps, { children: itemsToRender }), void 0));
|
|
76
|
+
_jsx(MenuOverriden, __assign({ resetMenuHighlightOnMouseLeave: true, focusWhenNavigationEnabled: false, "$multi": multi, captureScroll: captureScroll, tabIndex: -1, "aria-label": "Menu", role: "listbox" }, baseuiMenuListProps, { id: id, virtual: virtual, overscanCount: overscanCount, selectOnTab: selectOnTab }, menuProps, { children: itemsToRender }), void 0));
|
|
71
77
|
};
|
|
72
78
|
export default SelectMenuAdapter;
|
|
@@ -26,17 +26,19 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
26
26
|
disabled?: boolean | undefined;
|
|
27
27
|
endEnhancer?: import("../../list/types").Enhancer<import("../../list").ListItemSharedProps>;
|
|
28
28
|
highlighted?: boolean | undefined;
|
|
29
|
-
onClick?: ((event: React.
|
|
29
|
+
onClick?: ((event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
30
30
|
overrides?: {
|
|
31
31
|
ChildContainer?: Override<import("../../list").ListItemSharedProps & Record<string, any>> | undefined;
|
|
32
32
|
EndEnhancer?: Override<import("../../list").ListItemSharedProps & Record<string, any>> | undefined;
|
|
33
33
|
Root?: Override<import("../../list").ListItemSharedProps & Record<string, any>> | undefined;
|
|
34
34
|
StartEnhancer?: Override<import("../../list").ListItemSharedProps & Record<string, any>> | undefined;
|
|
35
|
+
StatefulTooltip?: Override<import("../../list").ListItemSharedProps & Record<string, any>> | undefined;
|
|
35
36
|
} | undefined;
|
|
36
37
|
selected?: boolean | undefined;
|
|
37
38
|
startEnhancer?: import("../../list/types").Enhancer<import("../../list").ListItemSharedProps>;
|
|
39
|
+
tooltipContent?: React.ReactNode | import("baseui/popover").StatefulContentRenderProp;
|
|
38
40
|
} & Record<string, any>> | undefined;
|
|
39
|
-
Popover?: Override<Omit<import("baseui/popover").PopoverProps, "overrides" | "
|
|
41
|
+
Popover?: Override<Omit<import("baseui/popover").PopoverProps, "children" | "overrides" | "triggerType" | "placement"> & {
|
|
40
42
|
overrides?: ({
|
|
41
43
|
Body?: Override<any> | undefined;
|
|
42
44
|
Arrow?: Override<any> | undefined;
|
|
@@ -48,6 +50,10 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
48
50
|
isOpen: boolean;
|
|
49
51
|
}) => React.ReactNode);
|
|
50
52
|
targetElement?: HTMLElement | null | undefined;
|
|
53
|
+
triggerType?: import("../../popover").TriggerType | undefined;
|
|
54
|
+
placement?: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
55
|
+
innerRef?: React.Ref<HTMLElement> | undefined;
|
|
56
|
+
viewportAsBoundary?: boolean | undefined;
|
|
51
57
|
} & Record<string, any>> | undefined;
|
|
52
58
|
} | undefined;
|
|
53
59
|
} & Record<string, any>> | undefined;
|
|
@@ -25,11 +25,9 @@ var SelectMenuItem = React.forwardRef(function (_a, ref) {
|
|
|
25
25
|
// Passes intent to override intent from useContextualFormProps,
|
|
26
26
|
// see: https://prod-gitlab.sprinklr.com/sprinklr/frontend/spaceweb/-/issues/282
|
|
27
27
|
var startEnhancer = useMemo(function () {
|
|
28
|
-
return multi && (_jsx(Checkbox, { checked: selected, size: "sm", overrides: { Input: { props: { 'aria-labelledby': id } } }, disabled: item.disabled, intent: "default" }, void 0));
|
|
28
|
+
return multi && (_jsx(Checkbox, { checked: selected, size: "sm", overrides: { Input: { props: { 'aria-labelledby': id } }, Label: { style: 'hidden' } }, disabled: item.disabled, intent: "default" }, void 0));
|
|
29
29
|
}, [multi, selected, item.disabled, item[valueKey], id]);
|
|
30
|
-
return (_jsx(MenuItemOverriden, __assign({ role: "option", "aria-selected": selected,
|
|
31
|
-
'border-b spr-border-01 border-solid border-t-0 border-l-0 border-r-0': item[SELECT_ALL_ID],
|
|
32
|
-
}),
|
|
30
|
+
return (_jsx(MenuItemOverriden, __assign({ role: "option", "aria-selected": selected,
|
|
33
31
|
// for Multi Select variant do not show selected styles
|
|
34
32
|
selected: multi ? false : selected, onClick: handleItemSelect, startEnhancer: startEnhancer, disabled: item.disabled, "$multi": multi, "$item": item, "$valueKey": valueKey, "$labelKey": labelKey, ref: ref, id: id }, restProps, menuItemProps, { children: _jsx(ListItemTextOverriden, __assign({ "$multi": multi, "$item": item, "$labelKey": labelKey }, listItemTextProps, { overrides: listItemTextOverrides }, { children: getItemLabel(item) }), void 0) }), void 0));
|
|
35
33
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GroupConfig } from '../types';
|
|
2
|
+
import type { Items } from 'baseui/menu/types';
|
|
3
|
+
export declare const useGetExpandedGroup: ({ groupConfig, groupedItems, }: {
|
|
4
|
+
groupConfig: GroupConfig;
|
|
5
|
+
groupedItems: Items;
|
|
6
|
+
}) => [string | undefined, React.Dispatch<React.SetStateAction<string | undefined>>];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
export var useGetExpandedGroup = function (_a) {
|
|
4
|
+
var groupConfig = _a.groupConfig, groupedItems = _a.groupedItems;
|
|
5
|
+
var _b = __read(useState(groupConfig[0].id), 2), expandedGroupId = _b[0], setExpandedGroupId = _b[1];
|
|
6
|
+
// by default open very first group with non zero elements
|
|
7
|
+
var _c = __read(useState(false), 2), initialised = _c[0], setInitialised = _c[1];
|
|
8
|
+
if (!initialised) {
|
|
9
|
+
var validGroup = groupConfig.find(function (group) { var _a; return !!group.count || !!((_a = groupedItems[group.id]) === null || _a === void 0 ? void 0 : _a.length); });
|
|
10
|
+
if (validGroup) {
|
|
11
|
+
setExpandedGroupId(validGroup.id);
|
|
12
|
+
setInitialised(true);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return [expandedGroupId, setExpandedGroupId];
|
|
16
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SelectProps } from '../types';
|
|
2
|
+
import { Override } from '../../overrides';
|
|
3
|
+
import { MenuItemProps, MenuProps } from '../../menu';
|
|
4
|
+
import { StatefulMenuProps as BaseStatefulMenuProps } from 'baseui/menu/types';
|
|
5
|
+
declare type PropsAddedByOverride = {
|
|
6
|
+
id?: string;
|
|
7
|
+
value: SelectProps['value'];
|
|
8
|
+
overrides?: {
|
|
9
|
+
Menu?: Override<MenuProps>;
|
|
10
|
+
MenuItem?: Override<MenuItemProps & {
|
|
11
|
+
$multi: boolean;
|
|
12
|
+
$item: unknown;
|
|
13
|
+
$labelKey: string;
|
|
14
|
+
}>;
|
|
15
|
+
NoResults?: Override<{}>;
|
|
16
|
+
Divider?: Override<{
|
|
17
|
+
title: string;
|
|
18
|
+
}>;
|
|
19
|
+
ListItemText?: Override<{
|
|
20
|
+
$multi: boolean;
|
|
21
|
+
$item: unknown;
|
|
22
|
+
$labelKey: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
valueKey: string;
|
|
26
|
+
labelKey: string;
|
|
27
|
+
multi: SelectProps['multi'];
|
|
28
|
+
selectAllSelected: boolean;
|
|
29
|
+
shouldDisplaySelectAll?: boolean;
|
|
30
|
+
noResultsMsg?: string;
|
|
31
|
+
captureScroll?: boolean;
|
|
32
|
+
virtual?: boolean;
|
|
33
|
+
overscanCount?: number;
|
|
34
|
+
selectOnTab?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare type MenuAdapterProps = BaseStatefulMenuProps & PropsAddedByOverride;
|
|
37
|
+
export declare type GroupConfig = {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
count?: number;
|
|
41
|
+
}[];
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StatefulSelectProps } from './types';
|
|
3
|
-
declare function StatefulSelect({ overrides, ...restProps }: StatefulSelectProps): React.ReactElement;
|
|
3
|
+
declare function StatefulSelect({ overrides, onChange, ...restProps }: StatefulSelectProps): React.ReactElement;
|
|
4
4
|
declare namespace StatefulSelect {
|
|
5
5
|
var defaultProps: {
|
|
6
6
|
autoFocus: boolean;
|
|
@@ -13,7 +13,10 @@ declare namespace StatefulSelect {
|
|
|
13
13
|
error: boolean;
|
|
14
14
|
positive: boolean;
|
|
15
15
|
escapeClearsValue: boolean;
|
|
16
|
-
filterOptions:
|
|
16
|
+
filterOptions: ((options: import("baseui/select").Value, filterValue: string, excludeOptions: import("baseui/select").Value | null | undefined, a: {
|
|
17
|
+
valueKey: string;
|
|
18
|
+
labelKey: string;
|
|
19
|
+
}) => import("baseui/select").Value) | null | undefined;
|
|
17
20
|
filterOutSelected: boolean;
|
|
18
21
|
isLoading: boolean;
|
|
19
22
|
labelKey: string;
|
|
@@ -28,15 +31,16 @@ declare namespace StatefulSelect {
|
|
|
28
31
|
onSelectResetsInput: boolean;
|
|
29
32
|
openOnClick: boolean;
|
|
30
33
|
startOpen: boolean;
|
|
31
|
-
options: import("baseui/select").
|
|
34
|
+
options: import("baseui/select").Options;
|
|
32
35
|
overrides: {};
|
|
33
36
|
required: boolean;
|
|
34
37
|
searchable: boolean;
|
|
35
|
-
size: import("./types").Size;
|
|
36
38
|
type: "overlay" | import("./types").Type | "mobile";
|
|
37
39
|
value: import("baseui/select").Value;
|
|
38
40
|
valueKey: string;
|
|
39
|
-
placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "
|
|
41
|
+
placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
42
|
+
virtual: boolean;
|
|
43
|
+
popoverMinWidth: string;
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
46
|
export default StatefulSelect;
|
|
@@ -5,9 +5,9 @@ import OverlaySelect from './overlaySelect';
|
|
|
5
5
|
import Select from './select';
|
|
6
6
|
import defaultProps from './default-props';
|
|
7
7
|
function StatefulSelect(_a) {
|
|
8
|
-
var overrides = _a.overrides, restProps = __rest(_a, ["overrides"]);
|
|
9
|
-
return (_jsx(StatefulSelectContainer, __assign({}, restProps, { children: function (selectProps) {
|
|
10
|
-
return restProps.type === 'overlay' ? (_jsx(OverlaySelect, __assign({}, selectProps, { overrides: overrides }, { children: restProps.children }), void 0)) : (_jsx(Select, __assign({}, selectProps, { overrides: overrides }), void 0));
|
|
8
|
+
var overrides = _a.overrides, onChange = _a.onChange, restProps = __rest(_a, ["overrides", "onChange"]);
|
|
9
|
+
return (_jsx(StatefulSelectContainer, __assign({}, restProps, { onChange: onChange }, { children: function (selectProps) {
|
|
10
|
+
return restProps.type === 'overlay' ? (_jsx(OverlaySelect, __assign({}, selectProps, { overrides: overrides }, { children: restProps.children }), void 0)) : (_jsx(Select, __assign({}, selectProps, { filterOptions: selectProps.filterOptions, overrides: overrides }), void 0));
|
|
11
11
|
} }), void 0));
|
|
12
12
|
}
|
|
13
13
|
StatefulSelect.defaultProps = defaultProps;
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { SelectProps } from 'baseui/select';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { SharedProps, Size } from './types';
|
|
4
|
+
import { Value } from 'baseui/select/types';
|
|
4
5
|
declare const StyledSelect: React.ComponentType<SelectProps>;
|
|
5
|
-
declare const NoResults:
|
|
6
|
+
declare const NoResults: React.ForwardRefExoticComponent<{
|
|
6
7
|
msg?: string | undefined;
|
|
7
|
-
}
|
|
8
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
export declare const StyledInputContainer: import("../style/styled").StyledComponent;
|
|
10
|
+
export declare const StyledInput: import("../style/styled").StyledComponent;
|
|
8
11
|
declare const StyledOverlayContentContainer: import("../style/styled").StyledComponent;
|
|
9
|
-
declare const InputContainer: ({ menuId, size, ...props }: SharedProps & {
|
|
12
|
+
declare const InputContainer: ({ menuId, size, $value, $labelKey, placeholder, ...props }: SharedProps & {
|
|
10
13
|
menuId: string;
|
|
11
14
|
size: Size;
|
|
15
|
+
$value: Value;
|
|
16
|
+
$labelKey: string;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
} & {
|
|
19
|
+
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
12
20
|
}) => JSX.Element;
|
|
13
21
|
declare const Input: React.ForwardRefExoticComponent<SharedProps & {
|
|
14
22
|
id: string;
|
|
15
23
|
menuId: string;
|
|
24
|
+
placeholder: string;
|
|
25
|
+
$value: Value;
|
|
26
|
+
$labelKey: string;
|
|
16
27
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
17
|
-
export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer,
|
|
28
|
+
export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, } from 'baseui/select';
|
|
18
29
|
export { StyledSelect, NoResults, StyledOverlayContentContainer, InputContainer, Input };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Select as BaseSelect
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Select as BaseSelect } from 'baseui/select';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import withThemeOverride from '../helpers/baseui/withThemeOverride';
|
|
6
6
|
import { borderRadius } from '../helpers/longHandHelpers';
|
|
7
7
|
import { useLocale } from '../locale';
|
|
8
8
|
import MenuItem from '../menu/menu-item';
|
|
9
9
|
import { styled } from '../style';
|
|
10
|
+
import { getComponentSizeTheme } from '../helpers/themeHelpers';
|
|
11
|
+
import _omit from 'lodash/omit';
|
|
12
|
+
import { useUID } from 'react-uid';
|
|
13
|
+
import { HiddenElement } from './utils/hidden-element';
|
|
14
|
+
import getInterpolatedString from 'baseui/helpers/i18n-interpolation';
|
|
10
15
|
var StyledSelect = withThemeOverride(BaseSelect, function (theme) { return ({
|
|
11
16
|
borders: {
|
|
12
17
|
inputBorderRadius: theme.input.borderRadius,
|
|
@@ -30,24 +35,69 @@ var StyledSelect = withThemeOverride(BaseSelect, function (theme) { return ({
|
|
|
30
35
|
inputEnhancerTextDisabled: theme.spr.text02,
|
|
31
36
|
},
|
|
32
37
|
}); });
|
|
33
|
-
var NoResults = function (_a) {
|
|
38
|
+
var NoResults = React.forwardRef(function (_a, ref) {
|
|
34
39
|
var msg = _a.msg, props = __rest(_a, ["msg"]);
|
|
35
40
|
var locale = useLocale();
|
|
36
|
-
return (_jsx(MenuItem, __assign({ button: false }, props, { children: msg || locale.select.noResultsMsg }), void 0));
|
|
37
|
-
};
|
|
41
|
+
return (_jsx(MenuItem, __assign({ button: false, ref: ref }, props, { children: msg || locale.select.noResultsMsg }), void 0));
|
|
42
|
+
});
|
|
43
|
+
export var StyledInputContainer = styled('div', 'relative inline-block bg-transparent max-w-full border-none box-border m-0 p-0 outline-none', function (_a, props) {
|
|
44
|
+
var theme = _a.theme, px2rem = _a.px2rem;
|
|
45
|
+
var $selectSize = props.$selectSize, $isEmpty = props.$isEmpty;
|
|
46
|
+
var _b = getComponentSizeTheme(theme, 'input', $selectSize, 'md'), fontSize = _b.fontSize, lineHeight = _b.lineHeight;
|
|
47
|
+
return {
|
|
48
|
+
boxShadow: 'none',
|
|
49
|
+
marginLeft: $isEmpty ? 0 : px2rem(2),
|
|
50
|
+
height: lineHeight,
|
|
51
|
+
maxHeight: lineHeight,
|
|
52
|
+
fontSize: fontSize,
|
|
53
|
+
lineHeight: lineHeight,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
export var StyledInput = styled('input', 'bg-transparent border-none inline-block m-0 p-0 max-w-full box-content outline-none', function (_, props) {
|
|
57
|
+
var $searchable = props.$searchable, $width = props.$width, $disabled = props.$disabled;
|
|
58
|
+
return __assign({ color: 'inherit', lineHeight: 'inherit', fontSize: 'inherit', fontWeight: 'inherit', letterSpacing: 'normal', width: !$searchable ? '1px' : $width || '100%', boxShadow: 'none', '::placeholder': {
|
|
59
|
+
color: 'transparent',
|
|
60
|
+
} }, ($disabled ? { '-webkit-text-fill-color': 'transparent' } : {}));
|
|
61
|
+
});
|
|
38
62
|
var DEFAULT_OVERLAY_WIDTH = '300px';
|
|
39
63
|
var StyledOverlayContentContainer = styled('div', 'overflow-auto', function (_a, _b) {
|
|
40
64
|
var px2rem = _a.px2rem;
|
|
41
65
|
var $overlayWidth = _b.$overlayWidth;
|
|
42
66
|
return (__assign({ width: $overlayWidth || DEFAULT_OVERLAY_WIDTH }, borderRadius('inherit')));
|
|
43
67
|
});
|
|
68
|
+
var getCommaSeparatedValues = function (value, labelKey, locale) {
|
|
69
|
+
var commaSeparatedValues = value === null || value === void 0 ? void 0 : value.map(function (val) { return val[labelKey]; }).join(',');
|
|
70
|
+
return value && value.length > 0
|
|
71
|
+
? "".concat(getInterpolatedString(locale.select.selectedValuesPrefix, { values: commaSeparatedValues }))
|
|
72
|
+
: '';
|
|
73
|
+
};
|
|
44
74
|
var InputContainer = function (_a) {
|
|
45
|
-
var
|
|
46
|
-
|
|
75
|
+
var _b;
|
|
76
|
+
var menuId = _a.menuId, size = _a.size, $value = _a.$value, $labelKey = _a.$labelKey, placeholder = _a.placeholder, props = __rest(_a, ["menuId", "size", "$value", "$labelKey", "placeholder"]);
|
|
77
|
+
var locale = useLocale();
|
|
78
|
+
var commaSeparatedValues = getCommaSeparatedValues($value, $labelKey, locale);
|
|
79
|
+
var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
|
|
80
|
+
var selectedValuesId = useUID();
|
|
81
|
+
var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
82
|
+
var containerRef = React.useRef(null);
|
|
83
|
+
if (!props.$searchable) {
|
|
84
|
+
return (_jsxs(_Fragment, { children: [commaSeparatedValues ? _jsx(HiddenElement, __assign({ id: selectedValuesId }, { children: commaSeparatedValues }), void 0) : null, _jsx(StyledInputContainer, __assign({}, props, { "$selectSize": size, "aria-owns": props.$isOpen ? menuId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, role: "combobox", ref: containerRef, "aria-placeholder": placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder, "aria-haspopup": "listbox" }, { children: props.children
|
|
85
|
+
? React.cloneElement(React.Children.only(props.children), { onFocus: function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } })
|
|
86
|
+
: null }), void 0)] }, void 0));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return _jsx(StyledInputContainer, __assign({}, props, { "$selectSize": size }), void 0);
|
|
90
|
+
}
|
|
47
91
|
};
|
|
48
92
|
var Input = React.forwardRef(function (_a, ref) {
|
|
49
|
-
var
|
|
50
|
-
|
|
93
|
+
var _b;
|
|
94
|
+
var id = _a.id, menuId = _a.menuId, placeholder = _a.placeholder, $value = _a.$value, $labelKey = _a.$labelKey, props = __rest(_a, ["id", "menuId", "placeholder", "$value", "$labelKey"]);
|
|
95
|
+
var locale = useLocale();
|
|
96
|
+
var commaSeparatedValues = getCommaSeparatedValues($value, $labelKey, locale);
|
|
97
|
+
var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
|
|
98
|
+
var selectedValuesId = useUID();
|
|
99
|
+
var ariaDescribedBy = commaSeparatedValues || props['aria-label'] ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
100
|
+
return (_jsxs(_Fragment, { children: [commaSeparatedValues || props['aria-label'] ? (_jsx(HiddenElement, __assign({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props['aria-label'] || '') }), void 0)) : null, _jsx(StyledInput, __assign({}, _omit(props, 'aria-label'), { id: id, "aria-controls": props.$searchable && props.$isOpen ? menuId : null, ref: ref, "aria-describedby": ariaDescribedBy, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder }), void 0)] }, void 0));
|
|
51
101
|
});
|
|
52
|
-
export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer,
|
|
102
|
+
export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, } from 'baseui/select';
|
|
53
103
|
export { StyledSelect, NoResults, StyledOverlayContentContainer, InputContainer, Input };
|
package/esm/select/types.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { OverridesDropdown as BaseuiDropdownOverrides, DropdownProps as BaseDropdownProps, Option, Options, SelectOverrides as BaseuiSelectOverrides, SelectProps as BaseuiSelectProps, State, StateReducer } from 'baseui/select';
|
|
3
3
|
import { STATE_CHANGE_TYPE } from './constants';
|
|
4
4
|
import { Override } from '../overrides';
|
|
5
5
|
import { TagProps } from '../tag';
|
|
6
6
|
import { Intent, SpacewebComponentProps } from '../types';
|
|
7
7
|
import { PopoverProps } from '../popover/types';
|
|
8
8
|
import { ValueOf } from '../utility-types';
|
|
9
|
-
|
|
9
|
+
import { Value } from 'baseui/select/types';
|
|
10
|
+
/**
|
|
11
|
+
* lg size is deprecated. Please use md.
|
|
12
|
+
*/
|
|
13
|
+
export declare type Size = 'xxxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
10
14
|
export declare type Type = 'select' | 'search';
|
|
11
15
|
declare type OverridableComponent = keyof Omit<BaseuiSelectOverrides, 'Dropdown' | 'DropdownListItem' | 'DropdownOption'> | 'Menu' | 'MenuItem' | 'NoResults' | 'Divider' | 'ListItemText' | 'OverlayContentContainer';
|
|
12
16
|
export declare type SelectActions = {
|
|
13
17
|
setDropdownOpen?: (shouldOpen: boolean) => void;
|
|
14
18
|
};
|
|
19
|
+
export declare type OnChangeParams = {
|
|
20
|
+
value: Value;
|
|
21
|
+
option?: Option;
|
|
22
|
+
type?: ValueOf<typeof STATE_CHANGE_TYPE>;
|
|
23
|
+
};
|
|
15
24
|
export declare type BaseSelectProps = SpacewebComponentProps<Omit<BaseuiSelectProps, 'overrides' | 'size' | 'type' | 'onChange' | 'positive' | 'error'>> & {
|
|
16
25
|
onChange?: (params: OnChangeParams) => unknown;
|
|
17
26
|
intent?: Intent;
|
|
@@ -24,15 +33,31 @@ export declare type BaseSelectProps = SpacewebComponentProps<Omit<BaseuiSelectPr
|
|
|
24
33
|
captureScroll?: boolean;
|
|
25
34
|
placement?: PopoverProps['placement'];
|
|
26
35
|
popoverMinWidth?: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
createOption?: (label: string) => Options | Promise<Options>;
|
|
37
|
+
onPaste?: (event: React.ClipboardEvent) => Options | undefined;
|
|
38
|
+
virtual?: boolean;
|
|
39
|
+
ignoreBoundary?: boolean;
|
|
40
|
+
delimiter?: string;
|
|
41
|
+
clearAsOption?: boolean;
|
|
42
|
+
clearAsOptionLabel?: string;
|
|
43
|
+
selectOnTab?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* This is an internal prop being used in AsyncSelect. Not meant for consumer.
|
|
46
|
+
* If true, selectAll event won't return all options in values.
|
|
47
|
+
*/
|
|
48
|
+
__selectAllShouldReturnAllOptions?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* This is an internal prop being used in AsyncSelect.
|
|
51
|
+
* Selected state of SelectAll option will be decided based on this prop if __selectAllShouldReturnAllOptions is true.
|
|
52
|
+
*/
|
|
53
|
+
__selectAllSelected?: boolean;
|
|
30
54
|
};
|
|
31
55
|
declare type Merge<A, B> = Omit<A, keyof B> & B;
|
|
32
56
|
export declare type OverlaySelectProps = Merge<BaseSelectProps, {
|
|
33
57
|
type: 'overlay';
|
|
34
58
|
overlayWidth?: string;
|
|
35
59
|
children: PopoverProps['children'];
|
|
60
|
+
scrollContainer?: 'overlayContainer' | 'menuContainer';
|
|
36
61
|
}>;
|
|
37
62
|
export declare type MobileSelectProps = Merge<OverlaySelectProps, {
|
|
38
63
|
type: 'mobile';
|
|
@@ -63,6 +88,7 @@ export declare type SharedProps = {
|
|
|
63
88
|
$selected?: boolean;
|
|
64
89
|
$isEmpty?: boolean;
|
|
65
90
|
$size?: Size;
|
|
91
|
+
$selectSize?: Size;
|
|
66
92
|
};
|
|
67
93
|
export declare type DropdownProps = Omit<BaseDropdownProps, 'overrides' | 'size' | 'type'> & {
|
|
68
94
|
overrides?: {
|
|
@@ -70,12 +96,13 @@ export declare type DropdownProps = Omit<BaseDropdownProps, 'overrides' | 'size'
|
|
|
70
96
|
};
|
|
71
97
|
type?: Type;
|
|
72
98
|
};
|
|
73
|
-
export declare type OnChangeParams = BaseOnChangeParams & {
|
|
74
|
-
type?: ValueOf<typeof STATE_CHANGE_TYPE>;
|
|
75
|
-
};
|
|
76
99
|
export declare const SELECT_ALL_ID = "__selectAll";
|
|
100
|
+
export declare const CLEAR_OPTION_ID = "__clear";
|
|
77
101
|
declare type RemoveValue = () => void;
|
|
78
102
|
export declare type MultiValueProps = Omit<TagProps, 'overrides'> & SharedProps & {
|
|
103
|
+
$isContainerFocused?: boolean;
|
|
104
|
+
$valueByIdMap: Record<string, Option>;
|
|
105
|
+
$valueKey: string;
|
|
79
106
|
value: Option;
|
|
80
107
|
removeValue: RemoveValue;
|
|
81
108
|
selectSize: Size;
|
|
@@ -88,4 +115,4 @@ export declare type MultiValueProps = Omit<TagProps, 'overrides'> & SharedProps
|
|
|
88
115
|
} & Record<string, any>>;
|
|
89
116
|
};
|
|
90
117
|
};
|
|
91
|
-
export type {
|
|
118
|
+
export type { Option, Value, Options, Optgroups, StateReducer, ControlRef, ImperativeMethods, AutosizeInputProps, StatefulContainerProps, SelectState, AutosizeInputState, State as StatefulContainerState, } from 'baseui/select';
|
package/esm/select/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import defaultFilterOptions from 'baseui/select/utils/default-filter-options';
|
|
2
|
+
export declare const filterOptions: typeof defaultFilterOptions;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
// todo: no deep import
|
|
2
|
-
|
|
3
|
+
import defaultFilterOptions from 'baseui/select/utils/default-filter-options';
|
|
4
|
+
export var filterOptions = function (options, filterValue, excludeOptions, newProps) {
|
|
5
|
+
return defaultFilterOptions(options, filterValue, excludeOptions, __assign({ matchProp: 'label' }, newProps));
|
|
6
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
var HiddenElement = function (_a) {
|
|
4
|
+
var id = _a.id, children = _a.children;
|
|
5
|
+
return (_jsx("div", __assign({ id: id, style: {
|
|
6
|
+
border: 0,
|
|
7
|
+
clip: 'rect(0 0 0 0)',
|
|
8
|
+
height: '0px',
|
|
9
|
+
margin: '-1px',
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
padding: 0,
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
width: '0px',
|
|
14
|
+
} }, { children: children }), void 0));
|
|
15
|
+
};
|
|
16
|
+
export { HiddenElement };
|