@qualtrics/ui-react 2.21.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/__shared/cjs/{index-0ae99de2.js → index-75d9309a.js} +4 -4
- package/dist/__shared/cjs/{index-201e8786.js → index-a8c1a789.js} +678 -568
- package/dist/components/Accordion/Accordion.js +2 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +5 -4
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/Accordion/AccordionSection.js +1 -2
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +12 -9
- package/dist/components/ColorPicker/ColorPicker.js +10 -8
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +8 -6
- package/dist/components/ColorPicker/Hue.js +3 -2
- package/dist/components/ColorPicker/Palette.js +7 -5
- package/dist/components/ColorPicker/Saturation.js +9 -8
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +3 -2
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +10 -9
- package/dist/components/Combobox/Combobox.js +48 -29
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +3 -2
- package/dist/components/Combobox/ComboboxInput.js +4 -4
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +5 -2
- package/dist/components/Dropdown/Dropdown.js +14 -9
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -19
- package/dist/components/Dropdown/DropdownList.js +4 -4
- package/dist/components/Dropdown/DropdownOption.js +6 -9
- package/dist/components/Dropdown/DropdownSearch.js +12 -6
- package/dist/components/FilePicker/FilePicker.js +13 -6
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +12 -9
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -2
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionSet.js +5 -5
- package/dist/components/LogicEditor/LogicEditor.js +1 -1
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +2 -1
- package/dist/components/Modal/Modal.js +14 -13
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +44 -36
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -2
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +10 -7
- package/dist/components/NewMenu/parts/MenuItem.js +1 -1
- package/dist/components/NumberStepper/NumberStepper.js +7 -6
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperInput.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +5 -5
- package/dist/components/Pagination/PaginationPageInput.js +11 -9
- package/dist/components/Pagination/PaginationPreviousButton.js +5 -5
- package/dist/components/Popover/Popover.js +9 -7
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +4 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +4 -4
- package/dist/components/Radio/Radio.js +12 -11
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +4 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +2 -1
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -1
- package/dist/components/Slider/RangeSlider.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +1 -1
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabList.js +6 -5
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +10 -4
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -4
- package/dist/components/deprecated_ColorPicker/Color.js +6 -6
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -2
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -1
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -3
- package/dist/components/deprecated_ColorPicker/Saturation.js +5 -5
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +8 -8
- package/dist/components/deprecated_Tabs/Tabs.js +11 -7
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +4 -2
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +8 -8
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -1
- package/dist/hooks/useControllableState/useControllableState.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -1
- package/dist/hooks/useId/useId.js +1 -1
- package/dist/hooks/useOverlay/useOverlay.js +7 -6
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +2 -1
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +4 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/createIconComponent.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -4
- package/dist/next/AdvancedTable/AdvancedTable.js +62 -52
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +6 -4
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +18 -10
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +7 -6
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +5 -4
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +6 -6
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +3 -2
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +2 -2
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +2 -2
- package/dist/next/Combobox/ComboboxOption.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +12 -8
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +1 -1
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +3 -2
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +2 -1
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +2 -1
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +1 -1
- package/dist/next/Drawer/Drawer.js +7 -4
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +2 -2
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +5 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuItem.js +8 -9
- package/dist/next/Menu/MenuPane.js +20 -8
- package/dist/next/Menu/SubMenu.js +16 -18
- package/dist/next/Menu/useMutationObserver.js +1 -1
- package/dist/next/Menu/usePaneSearch.js +31 -21
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +8 -2
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -4
- package/dist/next/TimePicker/TimeInput.js +2 -2
- package/dist/next/TimePicker/TimePicker.js +4 -4
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +2 -1
- package/dist/next/TimePicker/utils.js +14 -27
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +317 -260
- package/dist/utils/Flyout/Flyout.js +1 -1
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +9 -5
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +2 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -3
- package/dist/utils/Translation/useTranslation.js +4 -5
- package/dist/utils/filterChildren/filterChildren.js +2 -1
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -1
- package/dist/utils/mergeRefs/mergeRefs.js +1 -1
- package/dist/utils/wrapEvent/wrapEvent.js +2 -2
- package/next/package.json +1 -1
- package/package.json +2 -2
package/dist/next/index.js
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
6
|
-
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var classNames = require('classnames');
|
|
9
8
|
var reactDnd = require('react-dnd');
|
|
10
9
|
var reactDndHtml5Backend = require('react-dnd-html5-backend');
|
|
11
10
|
var useResizeObserver = require('@react-hook/resize-observer');
|
|
12
|
-
var index = require('../__shared/cjs/index-
|
|
13
|
-
var icons_index = require('../__shared/cjs/index-
|
|
11
|
+
var index = require('../__shared/cjs/index-a8c1a789.js');
|
|
12
|
+
var icons_index = require('../__shared/cjs/index-75d9309a.js');
|
|
14
13
|
var libphonenumberJs = require('libphonenumber-js');
|
|
15
14
|
var InputMask = require('react-input-mask');
|
|
16
15
|
var reactDropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
@@ -26,33 +25,32 @@ require('throttle-debounce');
|
|
|
26
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
27
26
|
|
|
28
27
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
29
|
-
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_includesInstanceProperty);
|
|
30
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
29
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
32
30
|
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
|
|
33
31
|
var InputMask__default = /*#__PURE__*/_interopDefaultLegacy(InputMask);
|
|
34
32
|
|
|
35
|
-
var css_248z$a = ".
|
|
36
|
-
var styles$a = {"advancedTable":"
|
|
37
|
-
var stylesheet$a=".
|
|
33
|
+
var css_248z$a = "._6fTqQ{overflow:auto;position:relative;max-width:100%;max-height:100%}._6fTqQ,._jSutS{background-color:#fff}._jSutS{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._EA9mc{margin-bottom:4px}._2eXvF{position:-webkit-sticky;position:sticky;top:0;z-index:100}._AwsK9{display:flex}._AwsK9:focus{outline:none}._AwsK9.focus-visible ._jxog1:after,._AwsK9:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._AwsK9.focus-visible ._jxog1:last-of-type:after,._AwsK9:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._AwsK9.focus-visible ._jxog1:first-of-type:after,._AwsK9:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._AwsK9.focus-visible ._jxog1._YnMZe:after,._AwsK9:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:1px}._qevTF{padding-right:3px}._mpXMP{display:flex}._mpXMP._HmLHn ._jxog1,._mpXMP._HmLHn ._VByXD{cursor:pointer}._mpXMP._a65aV ._jxog1,._mpXMP._a65aV ._VByXD{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._mpXMP._a65aV ._jxog1._YnMZe,._mpXMP._a65aV ._VByXD._YnMZe{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._mpXMP._a65aV ._jxog1._YnMZe ._IfXyg,._mpXMP._a65aV ._jxog1._YnMZe ._VByXD,._mpXMP._a65aV ._jxog1._YnMZe ._w0rDa,._mpXMP._a65aV ._VByXD._YnMZe ._IfXyg,._mpXMP._a65aV ._VByXD._YnMZe ._VByXD,._mpXMP._a65aV ._VByXD._YnMZe ._w0rDa{background-color:rgba(11,110,208,.08)}._mpXMP._HmLHn:hover:not(._a65aV):not(._Fq5N6) ._jxog1,._mpXMP._HmLHn:hover:not(._a65aV):not(._Fq5N6) ._VByXD{background-color:#f9f9f9}._mpXMP._HmLHn:active:not(._a65aV):not(._Fq5N6) ._jxog1,._mpXMP._HmLHn:active:not(._a65aV):not(._Fq5N6) ._VByXD{background-color:#f3f3f3}._mpXMP:focus{outline:none}._mpXMP.focus-visible ._jxog1:after,._mpXMP:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP.focus-visible ._jxog1:last-of-type:after,._mpXMP:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP.focus-visible ._jxog1:first-of-type:after,._mpXMP:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP.focus-visible ._jxog1._YnMZe:after,._mpXMP:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:0}._mpXMP:last-of-type:focus{outline:none}._mpXMP:last-of-type.focus-visible ._jxog1:after,._mpXMP:last-of-type:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:-2px;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP:last-of-type.focus-visible ._jxog1:last-of-type:after,._mpXMP:last-of-type:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP:last-of-type.focus-visible ._jxog1:first-of-type:after,._mpXMP:last-of-type:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP:last-of-type.focus-visible ._jxog1._YnMZe:after,._mpXMP:last-of-type:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:1px}._mpXMP:last-of-type ._IfXyg:focus{outline:none}._mpXMP:last-of-type ._IfXyg._MmTsv.focus-visible:after,._mpXMP:last-of-type ._IfXyg._MmTsv:focus-visible:after,._mpXMP:last-of-type ._IfXyg.focus-visible:after,._mpXMP:last-of-type ._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._mpXMP:first-of-type:focus{outline:none}._mpXMP:first-of-type.focus-visible ._jxog1:after,._mpXMP:first-of-type:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP:first-of-type.focus-visible ._jxog1:last-of-type:after,._mpXMP:first-of-type:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP:first-of-type.focus-visible ._jxog1:first-of-type:after,._mpXMP:first-of-type:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP:first-of-type.focus-visible ._jxog1._YnMZe:after,._mpXMP:first-of-type:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:0}._mpXMP:first-of-type ._IfXyg:focus{outline:none}._mpXMP:first-of-type ._IfXyg._MmTsv.focus-visible:after,._mpXMP:first-of-type ._IfXyg._MmTsv:focus-visible:after,._mpXMP:first-of-type ._IfXyg.focus-visible:after,._mpXMP:first-of-type ._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._DPfTT{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #d9d9d9;flex-shrink:0;font-size:12px;line-height:16px;font-weight:700;color:#6a6d70;background-color:#fff;position:relative}._DPfTT._P6xwJ{flex-grow:1}._DPfTT._dsB26{cursor:pointer}._DPfTT._dsB26:hover:not(._Olb-P){background-color:#f9f9f9;border-bottom-color:#6a6d70}._DPfTT._dsB26:active:not(._Olb-P){background-color:#f3f3f3}._DPfTT._1MzJ9:not(._Olb-P){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._DPfTT._Olb-P{cursor:move;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._DPfTT ._yiN0U{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._DPfTT ._yiN0U._BowfZ{left:-1px}._DPfTT ._yiN0U._z8C93{right:0}._DPfTT ._Hw2Dw{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._DPfTT ._Hw2Dw._BowfZ{left:-2px}._DPfTT ._Hw2Dw._z8C93{right:-1px}._DPfTT:first-of-type ._BowfZ._yiN0U{left:0;width:2px;border-left:1px solid #fff}._DPfTT:first-of-type ._BowfZ._Hw2Dw{left:0}._DPfTT:last-of-type ._z8C93._yiN0U{right:0;width:2px;border-right:1px solid #fff}._DPfTT:last-of-type ._z8C93._Hw2Dw{right:0}._DPfTT ._jP6Z1{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._DPfTT ._jP6Z1 ._4mLYf{position:absolute;width:2px;right:2px;top:0;bottom:0}._DPfTT ._jP6Z1 ._4mLYf._Dt96Z{background-color:#0a6ed1}._DPfTT ._jP6Z1:hover ._4mLYf:not(._Dt96Z){background-color:#d9d9d9}._DPfTT ._Cqa0N{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 0 13px 12px}._DPfTT ._Cqa0N._hJx5q{flex-direction:row-reverse;justify-content:flex-start}._DPfTT ._Cqa0N._hJx5q ._OP0Xk{margin:1px 7px 1px 1px}._DPfTT ._Cqa0N ._oWQun{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._DPfTT ._Cqa0N ._OP0Xk{margin:1px 1px 1px 7px;flex-shrink:0}._DPfTT ._37TKw{margin-left:6px;margin-right:4px;flex-shrink:0}._DPfTT ._s5y-S{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._DPfTT:focus{outline:none}._DPfTT._MmTsv.focus-visible:after,._DPfTT._MmTsv:focus-visible:after,._DPfTT.focus-visible:after,._DPfTT:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._vbt-6{margin-right:6px}._YnMZe{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._YnMZe[focus-within]{z-index:30}._YnMZe:focus-within{z-index:30}._IfXyg{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #eee;flex-shrink:0;font-size:14px;line-height:20px;overflow-wrap:break-word;color:#32363a;position:relative}._IfXyg ._Na-Ah{width:100%;padding:12px 12px 11px;overflow:hidden}._IfXyg._Olb-P{background-color:#efefef;border-bottom-color:#dfdfe1}._IfXyg._P6xwJ{flex-grow:1}._IfXyg:focus{outline:none}._IfXyg._MmTsv.focus-visible:after,._IfXyg._MmTsv:focus-visible:after,._IfXyg.focus-visible:after,._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-2px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._VByXD{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0}._VByXD._JI67L{border-bottom-color:#d9d9d9;background-color:#fff}._w0rDa{display:flex;align-items:center;justify-content:center;min-height:44px;width:40px;border-bottom:1px solid #eee;padding:12px 12px 11px;flex-shrink:0;cursor:pointer}._w0rDa._JI67L{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._w0rDa:focus input~span,._w0rDa:hover input~span{border-color:#0b6ed0}._w0rDa ._I96O5{position:relative;display:inline-flex}._w0rDa ._I96O5 ._jEufg{margin:0!important}._w0rDa ._I96O5 ._DbdFR{position:absolute;top:3px;left:3px;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._7Cc0F{justify-content:flex-start}._IaW7k{justify-content:center;text-align:center}._hJx5q{justify-content:flex-end;text-align:right}._-EmA3{display:none}._aC2UQ{opacity:0;height:0;width:0;overflow:hidden}._aC2UQ,._EefLf{position:absolute}._EefLf{cursor:move;background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000;pointer-events:none}._2-sF3{width:246px}";
|
|
34
|
+
var styles$a = {"advancedTable":"_6fTqQ","advancedTablePaginationContainer":"_jSutS","advancedTablePagination":"_EA9mc","advancedTableColumnHeadersRowGroup":"_2eXvF","advancedTableColumnHeaders":"_AwsK9","advancedTableRowChild":"_jxog1","pinnedContainer":"_YnMZe","advancedTableRowGroup":"_qevTF","advancedTableRow":"_mpXMP","hasRowAction":"_HmLHn","advancedTableExpandRowSpacer":"_VByXD","isSelected":"_a65aV","advancedTableCheckbox":"_w0rDa","advancedTableCell":"_IfXyg","isCheckboxHovered":"_Fq5N6","showFocusRing":"_MmTsv","advancedTableColumnHeader":"_DPfTT","fillRemainingSpace":"_P6xwJ","isSortable":"_dsB26","isDragging":"_Olb-P","isSorted":"_1MzJ9","dropTargetLine":"_yiN0U","dropTargetLeft":"_BowfZ","dropTargetRight":"_z8C93","dropTargetMarker":"_Hw2Dw","resizeHandle":"_jP6Z1","resizeLine":"_4mLYf","isResizing":"_Dt96Z","advancedTableColumnHeaderLabel":"_Cqa0N","rightAligned":"_hJx5q","sortIcon":"_OP0Xk","advancedTableColumnHeaderLabelText":"_oWQun","advancedTableColumnHeaderMenu":"_37TKw","advancedTableColumnHeaderMenuHiddenAnchor":"_s5y-S","advancedTableColumnHeaderMenuItemIcon":"_vbt-6","advancedTableCellContainer":"_Na-Ah","header":"_JI67L","checkboxContainer":"_I96O5","checkbox":"_jEufg","mixed":"_DbdFR","leftAligned":"_7Cc0F","centerAligned":"_IaW7k","hiddenDescription":"_-EmA3","hiddenLiveRegion":"_aC2UQ","dragPreview":"_EefLf","rowActionMenuPane":"_2-sF3"};
|
|
35
|
+
var stylesheet$a="._6fTqQ{overflow:auto;position:relative;max-width:100%;max-height:100%}._6fTqQ,._jSutS{background-color:#fff}._jSutS{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._EA9mc{margin-bottom:4px}._2eXvF{position:-webkit-sticky;position:sticky;top:0;z-index:100}._AwsK9{display:flex}._AwsK9:focus{outline:none}._AwsK9.focus-visible ._jxog1:after,._AwsK9:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._AwsK9.focus-visible ._jxog1:last-of-type:after,._AwsK9:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._AwsK9.focus-visible ._jxog1:first-of-type:after,._AwsK9:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._AwsK9.focus-visible ._jxog1._YnMZe:after,._AwsK9:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:1px}._qevTF{padding-right:3px}._mpXMP{display:flex}._mpXMP._HmLHn ._jxog1,._mpXMP._HmLHn ._VByXD{cursor:pointer}._mpXMP._a65aV ._jxog1,._mpXMP._a65aV ._VByXD{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._mpXMP._a65aV ._jxog1._YnMZe,._mpXMP._a65aV ._VByXD._YnMZe{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._mpXMP._a65aV ._jxog1._YnMZe ._IfXyg,._mpXMP._a65aV ._jxog1._YnMZe ._VByXD,._mpXMP._a65aV ._jxog1._YnMZe ._w0rDa,._mpXMP._a65aV ._VByXD._YnMZe ._IfXyg,._mpXMP._a65aV ._VByXD._YnMZe ._VByXD,._mpXMP._a65aV ._VByXD._YnMZe ._w0rDa{background-color:rgba(11,110,208,.08)}._mpXMP._HmLHn:hover:not(._a65aV):not(._Fq5N6) ._jxog1,._mpXMP._HmLHn:hover:not(._a65aV):not(._Fq5N6) ._VByXD{background-color:#f9f9f9}._mpXMP._HmLHn:active:not(._a65aV):not(._Fq5N6) ._jxog1,._mpXMP._HmLHn:active:not(._a65aV):not(._Fq5N6) ._VByXD{background-color:#f3f3f3}._mpXMP:focus{outline:none}._mpXMP.focus-visible ._jxog1:after,._mpXMP:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP.focus-visible ._jxog1:last-of-type:after,._mpXMP:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP.focus-visible ._jxog1:first-of-type:after,._mpXMP:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP.focus-visible ._jxog1._YnMZe:after,._mpXMP:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:0}._mpXMP:last-of-type:focus{outline:none}._mpXMP:last-of-type.focus-visible ._jxog1:after,._mpXMP:last-of-type:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:-2px;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP:last-of-type.focus-visible ._jxog1:last-of-type:after,._mpXMP:last-of-type:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP:last-of-type.focus-visible ._jxog1:first-of-type:after,._mpXMP:last-of-type:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP:last-of-type.focus-visible ._jxog1._YnMZe:after,._mpXMP:last-of-type:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:1px}._mpXMP:last-of-type ._IfXyg:focus{outline:none}._mpXMP:last-of-type ._IfXyg._MmTsv.focus-visible:after,._mpXMP:last-of-type ._IfXyg._MmTsv:focus-visible:after,._mpXMP:last-of-type ._IfXyg.focus-visible:after,._mpXMP:last-of-type ._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._mpXMP:first-of-type:focus{outline:none}._mpXMP:first-of-type.focus-visible ._jxog1:after,._mpXMP:first-of-type:focus-visible ._jxog1:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._mpXMP:first-of-type.focus-visible ._jxog1:last-of-type:after,._mpXMP:first-of-type:focus-visible ._jxog1:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._mpXMP:first-of-type.focus-visible ._jxog1:first-of-type:after,._mpXMP:first-of-type:focus-visible ._jxog1:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._mpXMP:first-of-type.focus-visible ._jxog1._YnMZe:after,._mpXMP:first-of-type:focus-visible ._jxog1._YnMZe:after{right:-3px;bottom:0}._mpXMP:first-of-type ._IfXyg:focus{outline:none}._mpXMP:first-of-type ._IfXyg._MmTsv.focus-visible:after,._mpXMP:first-of-type ._IfXyg._MmTsv:focus-visible:after,._mpXMP:first-of-type ._IfXyg.focus-visible:after,._mpXMP:first-of-type ._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._DPfTT{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #d9d9d9;flex-shrink:0;font-size:12px;line-height:16px;font-weight:700;color:#6a6d70;background-color:#fff;position:relative}._DPfTT._P6xwJ{flex-grow:1}._DPfTT._dsB26{cursor:pointer}._DPfTT._dsB26:hover:not(._Olb-P){background-color:#f9f9f9;border-bottom-color:#6a6d70}._DPfTT._dsB26:active:not(._Olb-P){background-color:#f3f3f3}._DPfTT._1MzJ9:not(._Olb-P){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._DPfTT._Olb-P{cursor:move;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._DPfTT ._yiN0U{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._DPfTT ._yiN0U._BowfZ{left:-1px}._DPfTT ._yiN0U._z8C93{right:0}._DPfTT ._Hw2Dw{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._DPfTT ._Hw2Dw._BowfZ{left:-2px}._DPfTT ._Hw2Dw._z8C93{right:-1px}._DPfTT:first-of-type ._BowfZ._yiN0U{left:0;width:2px;border-left:1px solid #fff}._DPfTT:first-of-type ._BowfZ._Hw2Dw{left:0}._DPfTT:last-of-type ._z8C93._yiN0U{right:0;width:2px;border-right:1px solid #fff}._DPfTT:last-of-type ._z8C93._Hw2Dw{right:0}._DPfTT ._jP6Z1{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._DPfTT ._jP6Z1 ._4mLYf{position:absolute;width:2px;right:2px;top:0;bottom:0}._DPfTT ._jP6Z1 ._4mLYf._Dt96Z{background-color:#0a6ed1}._DPfTT ._jP6Z1:hover ._4mLYf:not(._Dt96Z){background-color:#d9d9d9}._DPfTT ._Cqa0N{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 0 13px 12px}._DPfTT ._Cqa0N._hJx5q{flex-direction:row-reverse;justify-content:flex-start}._DPfTT ._Cqa0N._hJx5q ._OP0Xk{margin:1px 7px 1px 1px}._DPfTT ._Cqa0N ._oWQun{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._DPfTT ._Cqa0N ._OP0Xk{margin:1px 1px 1px 7px;flex-shrink:0}._DPfTT ._37TKw{margin-left:6px;margin-right:4px;flex-shrink:0}._DPfTT ._s5y-S{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._DPfTT:focus{outline:none}._DPfTT._MmTsv.focus-visible:after,._DPfTT._MmTsv:focus-visible:after,._DPfTT.focus-visible:after,._DPfTT:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._vbt-6{margin-right:6px}._YnMZe{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._YnMZe[focus-within]{z-index:30}._YnMZe:focus-within{z-index:30}._IfXyg{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #eee;flex-shrink:0;font-size:14px;line-height:20px;overflow-wrap:break-word;color:#32363a;position:relative}._IfXyg ._Na-Ah{width:100%;padding:12px 12px 11px;overflow:hidden}._IfXyg._Olb-P{background-color:#efefef;border-bottom-color:#dfdfe1}._IfXyg._P6xwJ{flex-grow:1}._IfXyg:focus{outline:none}._IfXyg._MmTsv.focus-visible:after,._IfXyg._MmTsv:focus-visible:after,._IfXyg.focus-visible:after,._IfXyg:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-2px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._VByXD{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0}._VByXD._JI67L{border-bottom-color:#d9d9d9;background-color:#fff}._w0rDa{display:flex;align-items:center;justify-content:center;min-height:44px;width:40px;border-bottom:1px solid #eee;padding:12px 12px 11px;flex-shrink:0;cursor:pointer}._w0rDa._JI67L{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._w0rDa:focus input~span,._w0rDa:hover input~span{border-color:#0b6ed0}._w0rDa ._I96O5{position:relative;display:inline-flex}._w0rDa ._I96O5 ._jEufg{margin:0!important}._w0rDa ._I96O5 ._DbdFR{position:absolute;top:3px;left:3px;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._7Cc0F{justify-content:flex-start}._IaW7k{justify-content:center;text-align:center}._hJx5q{justify-content:flex-end;text-align:right}._-EmA3{display:none}._aC2UQ{opacity:0;height:0;width:0;overflow:hidden}._aC2UQ,._EefLf{position:absolute}._EefLf{cursor:move;background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000;pointer-events:none}._2-sF3{width:246px}";
|
|
38
36
|
icons_index.styleInject(css_248z$a);
|
|
39
37
|
|
|
40
38
|
// TODO: Move the imported types into this file to avoid a ciruclar dependency warning.
|
|
41
39
|
// Also Alignment, etc can be defined directly and have AdvancedTableColumnConfig use them instead of the reverse like now.
|
|
42
40
|
// Context: Zach was trying to make type-doc work better, but it's probably not worth the weird organization.
|
|
43
41
|
|
|
44
|
-
let SortDirections
|
|
45
|
-
(function (SortDirections) {
|
|
42
|
+
let SortDirections = /*#__PURE__*/function (SortDirections) {
|
|
46
43
|
SortDirections["Ascending"] = "ascending";
|
|
47
44
|
SortDirections["Descending"] = "descending";
|
|
48
45
|
SortDirections["None"] = "none";
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
return SortDirections;
|
|
47
|
+
}({});
|
|
48
|
+
let Alignments = /*#__PURE__*/function (Alignments) {
|
|
52
49
|
Alignments["Left"] = "left";
|
|
53
50
|
Alignments["Right"] = "right";
|
|
54
51
|
Alignments["Center"] = "center";
|
|
55
|
-
|
|
52
|
+
return Alignments;
|
|
53
|
+
}({});
|
|
56
54
|
|
|
57
55
|
const AdvancedTableColumnHeaderMenu = _ref => {
|
|
58
56
|
let {
|
|
@@ -86,10 +84,11 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
86
84
|
role: "menuitem" // Enables having an action menu item inside of a SelectMenu
|
|
87
85
|
,
|
|
88
86
|
onSelect: e => {
|
|
87
|
+
var _columnHeaderRef$curr;
|
|
89
88
|
e.preventDefault(); // prevents SelectMenu value from changing
|
|
90
89
|
setIsOpen(false);
|
|
91
|
-
columnHeaderRef.current
|
|
92
|
-
onSelect
|
|
90
|
+
(_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.focus();
|
|
91
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
93
92
|
},
|
|
94
93
|
"date-testid": menuItemDataTestId
|
|
95
94
|
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
@@ -120,7 +119,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
120
119
|
},
|
|
121
120
|
isOpen: isOpen,
|
|
122
121
|
onIsOpenChange: setIsOpen
|
|
123
|
-
}, rest), sortOptions
|
|
122
|
+
}, rest), sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.map((_ref3, index$1) => {
|
|
124
123
|
let {
|
|
125
124
|
ascendingLabel,
|
|
126
125
|
ascendingIcon,
|
|
@@ -143,7 +142,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
143
142
|
key: ascendingValue,
|
|
144
143
|
value: ascendingValue,
|
|
145
144
|
label: ascendingLabel,
|
|
146
|
-
"data-testid": index.getSubDataTestId(dataTestId,
|
|
145
|
+
"data-testid": index.getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index$1, "-").concat(SortDirections.Ascending))
|
|
147
146
|
}, /*#__PURE__*/React__default["default"].createElement(AscendingIconComponent, {
|
|
148
147
|
size: "small",
|
|
149
148
|
className: styles$a.advancedTableColumnHeaderMenuItemIcon,
|
|
@@ -152,13 +151,13 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
152
151
|
key: descendingValue,
|
|
153
152
|
value: descendingValue,
|
|
154
153
|
label: descendingLabel,
|
|
155
|
-
"data-testid": index.getSubDataTestId(dataTestId,
|
|
154
|
+
"data-testid": index.getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index$1, "-").concat(SortDirections.Descending))
|
|
156
155
|
}, /*#__PURE__*/React__default["default"].createElement(DescendingIconComponent, {
|
|
157
156
|
size: "small",
|
|
158
157
|
className: styles$a.advancedTableColumnHeaderMenuItemIcon,
|
|
159
158
|
"aria-hidden": "true"
|
|
160
159
|
}), descendingLabel)];
|
|
161
|
-
}), sortOptions
|
|
160
|
+
}), (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (onIsPinnedChange || onMoveLeft || onMoveRight) && /*#__PURE__*/React__default["default"].createElement(index.Divider, null), pinItem, onMoveLeft && getActionMenuItem({
|
|
162
161
|
onSelect: onMoveLeft,
|
|
163
162
|
Icon: icons_index.ArrowLeftIcon,
|
|
164
163
|
label: translate('advancedTable.moveColumnLeft'),
|
|
@@ -220,6 +219,7 @@ const useDragAndDrop = _ref => {
|
|
|
220
219
|
}, dropRef] = reactDnd.useDrop(() => ({
|
|
221
220
|
accept: tableId,
|
|
222
221
|
hover: (item, monitor) => {
|
|
222
|
+
var _monitor$getClientOff, _columnHeaderRef$curr;
|
|
223
223
|
const {
|
|
224
224
|
id: dragSourceId,
|
|
225
225
|
columnIndex: dragSourceColumnIndex,
|
|
@@ -232,11 +232,11 @@ const useDragAndDrop = _ref => {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
// Calculate which column line is closest
|
|
235
|
-
const dropX = monitor.getClientOffset()
|
|
235
|
+
const dropX = (_monitor$getClientOff = monitor.getClientOffset()) === null || _monitor$getClientOff === void 0 ? void 0 : _monitor$getClientOff.x;
|
|
236
236
|
const {
|
|
237
237
|
x,
|
|
238
238
|
width
|
|
239
|
-
} = columnHeaderRef.current
|
|
239
|
+
} = (_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect();
|
|
240
240
|
const diffLeft = Math.abs(dropX - x) || 0;
|
|
241
241
|
const diffRight = Math.abs(dropX - (x + width)) || 0;
|
|
242
242
|
if (diffLeft < diffRight) {
|
|
@@ -337,7 +337,7 @@ const useDragAndDrop = _ref => {
|
|
|
337
337
|
function useComputedWidth() {
|
|
338
338
|
let widthBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
339
339
|
let defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
340
|
-
return React.useMemo(() => typeof defaultWidth === 'number' ?
|
|
340
|
+
return React.useMemo(() => typeof defaultWidth === 'number' ? "".concat(defaultWidth + widthBuffer, "px") : "calc(".concat(widthBuffer, "px + ").concat(defaultWidth, ")"), [widthBuffer, defaultWidth]);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -379,8 +379,8 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
379
379
|
const [ellipsisShown, setEllipsisShown] = React.useState();
|
|
380
380
|
const columnHeaderRef = React.useRef(null);
|
|
381
381
|
const labelContainerRef = React.useRef(null);
|
|
382
|
-
const isSortable = Boolean(sortOptions
|
|
383
|
-
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < sortOptions
|
|
382
|
+
const isSortable = Boolean(sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length);
|
|
383
|
+
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (selectedSortOption.direction === 'ascending' || selectedSortOption.direction === 'descending');
|
|
384
384
|
const selectedSortIndex = isSorted ? selectedSortOption.index : -1;
|
|
385
385
|
const arrowUpSvgContent = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
386
386
|
fillRule: "evenodd",
|
|
@@ -444,19 +444,22 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
444
444
|
setIsHiddenMenuOpen(true);
|
|
445
445
|
setHiddenMenuHighlightedIndex(0);
|
|
446
446
|
} else if (onWidthChange && e.key === 'ArrowRight' && e.shiftKey) {
|
|
447
|
+
var _columnHeaderRef$curr;
|
|
447
448
|
e.preventDefault(); // prevent scroll
|
|
448
|
-
const newWidth = columnHeaderRef.current
|
|
449
|
+
const newWidth = ((_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect().width) + 10;
|
|
449
450
|
onWidthChange(newWidth);
|
|
450
451
|
} else if (onWidthChange && e.key === 'ArrowLeft' && e.shiftKey) {
|
|
452
|
+
var _columnHeaderRef$curr2;
|
|
451
453
|
e.preventDefault(); // prevent scroll
|
|
452
|
-
const newWidth = Math.max(80, columnHeaderRef.current
|
|
454
|
+
const newWidth = Math.max(80, ((_columnHeaderRef$curr2 = columnHeaderRef.current) === null || _columnHeaderRef$curr2 === void 0 ? void 0 : _columnHeaderRef$curr2.getBoundingClientRect().width) - 10);
|
|
453
455
|
onWidthChange(newWidth);
|
|
454
456
|
} else {
|
|
455
|
-
onKeyDown
|
|
457
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
456
458
|
}
|
|
457
459
|
};
|
|
458
460
|
const handleClick = e => {
|
|
459
|
-
|
|
461
|
+
var _labelContainerRef$cu;
|
|
462
|
+
if (e.target === e.currentTarget || (_labelContainerRef$cu = labelContainerRef.current) !== null && _labelContainerRef$cu !== void 0 && _labelContainerRef$cu.contains(e.target)) {
|
|
460
463
|
const newIndex = isSorted ? selectedSortIndex : 0;
|
|
461
464
|
const newDirection = isSorted && selectedSortOption.direction === 'ascending' ? 'descending' : 'ascending';
|
|
462
465
|
setSelectedSortOption({
|
|
@@ -521,10 +524,11 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
521
524
|
}
|
|
522
525
|
};
|
|
523
526
|
const handleMouseMove = e => {
|
|
527
|
+
var _columnHeaderRef$curr3;
|
|
524
528
|
const mouseX = e.clientX;
|
|
525
|
-
const headerX = columnHeaderRef.current
|
|
529
|
+
const headerX = (_columnHeaderRef$curr3 = columnHeaderRef.current) === null || _columnHeaderRef$curr3 === void 0 ? void 0 : _columnHeaderRef$curr3.getBoundingClientRect().x;
|
|
526
530
|
const newWidth = Math.max(80, mouseX - headerX);
|
|
527
|
-
onWidthChange
|
|
531
|
+
onWidthChange === null || onWidthChange === void 0 ? void 0 : onWidthChange(newWidth);
|
|
528
532
|
};
|
|
529
533
|
const handleMouseUp = e => {
|
|
530
534
|
if (e.button === 0) {
|
|
@@ -544,7 +548,10 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
544
548
|
onIsPinnedChange: disableUserPinnableColumns ? undefined : handleIsPinnedChange,
|
|
545
549
|
onMoveLeft: disableUserReorderableColumns || isPinned && columnIndex === 0 || !isPinned && columnIndex === minUnpinnedColumnIndex ? undefined : handleMoveLeft,
|
|
546
550
|
onMoveRight: disableUserReorderableColumns || isPinned && columnIndex === minUnpinnedColumnIndex - 1 || !isPinned && columnIndex === maxUnpinnedColumnIndex ? undefined : handleMoveRight,
|
|
547
|
-
onFocus: () =>
|
|
551
|
+
onFocus: () => {
|
|
552
|
+
var _columnHeaderRef$curr4;
|
|
553
|
+
return (_columnHeaderRef$curr4 = columnHeaderRef.current) === null || _columnHeaderRef$curr4 === void 0 ? void 0 : _columnHeaderRef$curr4.focus();
|
|
554
|
+
},
|
|
548
555
|
columnId: id,
|
|
549
556
|
columnHeaderRef,
|
|
550
557
|
'data-testid': dataTestId
|
|
@@ -612,7 +619,8 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
612
619
|
tabIndex: -1,
|
|
613
620
|
"aria-hidden": "true",
|
|
614
621
|
onFocus: () => {
|
|
615
|
-
|
|
622
|
+
var _columnHeaderRef$curr5;
|
|
623
|
+
(_columnHeaderRef$curr5 = columnHeaderRef.current) === null || _columnHeaderRef$curr5 === void 0 ? void 0 : _columnHeaderRef$curr5.focus();
|
|
616
624
|
},
|
|
617
625
|
className: styles$a.advancedTableColumnHeaderMenuHiddenAnchor
|
|
618
626
|
})
|
|
@@ -676,14 +684,15 @@ const AdvancedTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
676
684
|
} : undefined;
|
|
677
685
|
const handleKeyDown = e => {
|
|
678
686
|
if (e.target === e.currentTarget && e.key === 'Enter' && isInteractive) {
|
|
679
|
-
|
|
687
|
+
var _focusableElementRef$;
|
|
688
|
+
(_focusableElementRef$ = focusableElementRef.current) === null || _focusableElementRef$ === void 0 ? void 0 : _focusableElementRef$.focus();
|
|
680
689
|
e.preventDefault(); // Prevent click event from occurring on the focusable element
|
|
681
690
|
}
|
|
682
691
|
|
|
683
|
-
onKeyDown
|
|
692
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
684
693
|
};
|
|
685
694
|
const handleFocus = e => {
|
|
686
|
-
onFocus
|
|
695
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
687
696
|
if (isInteractive) {
|
|
688
697
|
if (e.target !== e.currentTarget) {
|
|
689
698
|
setIsEditing(true);
|
|
@@ -698,7 +707,8 @@ const AdvancedTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
698
707
|
}
|
|
699
708
|
} : undefined;
|
|
700
709
|
const focusCell = () => {
|
|
701
|
-
|
|
710
|
+
var _cellRef$current;
|
|
711
|
+
(_cellRef$current = cellRef.current) === null || _cellRef$current === void 0 ? void 0 : _cellRef$current.focus();
|
|
702
712
|
};
|
|
703
713
|
const computedWidth = useComputedWidth(widthBuffer, width);
|
|
704
714
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({}, rest, {
|
|
@@ -849,6 +859,7 @@ const AdvancedTableHiddenDescription = _ref => {
|
|
|
849
859
|
};
|
|
850
860
|
|
|
851
861
|
const AdvancedTableDragPreview = _ref => {
|
|
862
|
+
var _columnHeaderRefs$ite, _tableRef$current;
|
|
852
863
|
let {
|
|
853
864
|
tableRef,
|
|
854
865
|
columnHeaderRefs
|
|
@@ -860,10 +871,10 @@ const AdvancedTableDragPreview = _ref => {
|
|
|
860
871
|
item: monitor.getItem(),
|
|
861
872
|
currentOffset: monitor.getSourceClientOffset()
|
|
862
873
|
}));
|
|
863
|
-
const width = columnHeaderRefs
|
|
864
|
-
const height = tableRef.current
|
|
865
|
-
const top = currentOffset
|
|
866
|
-
const left = currentOffset
|
|
874
|
+
const width = columnHeaderRefs === null || columnHeaderRefs === void 0 || (_columnHeaderRefs$ite = columnHeaderRefs[item === null || item === void 0 ? void 0 : item.columnIndex]) === null || _columnHeaderRefs$ite === void 0 || (_columnHeaderRefs$ite = _columnHeaderRefs$ite.getBoundingClientRect()) === null || _columnHeaderRefs$ite === void 0 ? void 0 : _columnHeaderRefs$ite.width;
|
|
875
|
+
const height = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 || (_tableRef$current = _tableRef$current.getBoundingClientRect()) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.height;
|
|
876
|
+
const top = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.y) || 0;
|
|
877
|
+
const left = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.x) || 0;
|
|
867
878
|
return /*#__PURE__*/React__default["default"].createElement(index.Portal, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
868
879
|
className: styles$a.dragPreview,
|
|
869
880
|
style: {
|
|
@@ -891,7 +902,7 @@ const AdvancedTablePagination = _ref => {
|
|
|
891
902
|
page
|
|
892
903
|
} = _ref2;
|
|
893
904
|
setCurrentPage(page);
|
|
894
|
-
onPageChange
|
|
905
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(page);
|
|
895
906
|
};
|
|
896
907
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
897
908
|
className: styles$a.advancedTablePaginationContainer
|
|
@@ -946,6 +957,7 @@ const AdvancedTableRowExpandButton = _ref => {
|
|
|
946
957
|
};
|
|
947
958
|
|
|
948
959
|
const AdvancedTable = _ref => {
|
|
960
|
+
var _ref5;
|
|
949
961
|
let {
|
|
950
962
|
columnConfigs: externalColumnConfigs,
|
|
951
963
|
rows: rowsPropExternal,
|
|
@@ -987,7 +999,7 @@ const AdvancedTable = _ref => {
|
|
|
987
999
|
// This handles an edge case where no rows are passed in
|
|
988
1000
|
// and the internal row transforms cause infinite state updates using a standard default assignment
|
|
989
1001
|
const stableDefaultArray = React.useMemo(() => [], []);
|
|
990
|
-
const rowsProp = rowsPropExternal
|
|
1002
|
+
const rowsProp = rowsPropExternal !== null && rowsPropExternal !== void 0 ? rowsPropExternal : stableDefaultArray;
|
|
991
1003
|
const [rows, setRows] = React.useState();
|
|
992
1004
|
const rowActionsColumnConfigId = index.useId();
|
|
993
1005
|
let rowActionsColumnConfig;
|
|
@@ -996,7 +1008,7 @@ const AdvancedTable = _ref => {
|
|
|
996
1008
|
[externalColumnConfigs, rows] // columnConfigs has an implicit dependency on rows because it is initially computed using rows data
|
|
997
1009
|
);
|
|
998
1010
|
|
|
999
|
-
const [currentPage, setCurrentPage] = React.useState(initialPage
|
|
1011
|
+
const [currentPage, setCurrentPage] = React.useState(initialPage !== null && initialPage !== void 0 ? initialPage : 1);
|
|
1000
1012
|
const [tableHeight, setTableHeight] = React.useState();
|
|
1001
1013
|
const getPaginatedRowIndex = React.useCallback(universalRowIndex => rowsPerPage ? universalRowIndex + rowsPerPage * (currentPage - 1) : universalRowIndex, [rowsPerPage, currentPage]);
|
|
1002
1014
|
const paginatedRows = React.useMemo(() => {
|
|
@@ -1038,13 +1050,14 @@ const AdvancedTable = _ref => {
|
|
|
1038
1050
|
}
|
|
1039
1051
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.EllipsisHorizontalIcon, null))), /*#__PURE__*/React__default["default"].createElement(index.DropdownList, {
|
|
1040
1052
|
className: styles$a.rowActionMenuPane
|
|
1041
|
-
}, !rows ? [] : rowActions
|
|
1053
|
+
}, !rows ? [] : rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((actionGroup, groupIndex) => {
|
|
1054
|
+
var _actionGroup$actions;
|
|
1042
1055
|
const row = rows[rowIndex];
|
|
1043
|
-
const actions = !row ? [] : actionGroup.actions
|
|
1056
|
+
const actions = !row ? [] : (_actionGroup$actions = actionGroup.actions) === null || _actionGroup$actions === void 0 ? void 0 : _actionGroup$actions.map((action, actionIndex) => /*#__PURE__*/React__default["default"].createElement(index.DropdownOption
|
|
1044
1057
|
// React Docs: "We don't recommend using indexes for keys if the order of items may change." These will not change; the alternative is to require an id from the consumer.
|
|
1045
1058
|
// eslint-disable-next-line react/no-array-index-key
|
|
1046
1059
|
, {
|
|
1047
|
-
key:
|
|
1060
|
+
key: "".concat(groupIndex, "-").concat(actionIndex),
|
|
1048
1061
|
disabled: typeof action.isDisabled === 'function' ? action.isDisabled(row && row.rowPropReference) : action.isDisabled,
|
|
1049
1062
|
onSelect: () => action.action(row && row.rowPropReference),
|
|
1050
1063
|
value: "",
|
|
@@ -1084,9 +1097,9 @@ const AdvancedTable = _ref => {
|
|
|
1084
1097
|
const minColumnIndex = hasFocusableRows ? -1 : 0; // When entire rows are focusable, they get an index of -1 so that the columns can be zero-indexed
|
|
1085
1098
|
const maxColumnIndex = columnConfigs.length - 1;
|
|
1086
1099
|
const tableId = index.useId(externalTableId);
|
|
1087
|
-
const arrowKeyDescriptionId =
|
|
1088
|
-
const rowActionDescriptionId =
|
|
1089
|
-
const rowCheckboxDescriptionId =
|
|
1100
|
+
const arrowKeyDescriptionId = "".concat(tableId, "-arrowKeyDescription");
|
|
1101
|
+
const rowActionDescriptionId = "".concat(tableId, "-rowActionDescription");
|
|
1102
|
+
const rowCheckboxDescriptionId = "".concat(tableId, "-rowCheckboxDescription");
|
|
1090
1103
|
useResizeObserver__default["default"](tableRef, entry => {
|
|
1091
1104
|
setTableHeight(entry.contentRect.height);
|
|
1092
1105
|
});
|
|
@@ -1100,11 +1113,11 @@ const AdvancedTable = _ref => {
|
|
|
1100
1113
|
index.useDidUpdate(() => {
|
|
1101
1114
|
setInternalColumnOrder(columnConfigsOrder);
|
|
1102
1115
|
}, [JSON.stringify(columnConfigsOrder)]);
|
|
1103
|
-
const columnOrder = externalColumnOrder
|
|
1116
|
+
const columnOrder = externalColumnOrder !== null && externalColumnOrder !== void 0 ? externalColumnOrder : internalColumnOrder;
|
|
1104
1117
|
const setColumnOrder = index.useEventCallback(value => {
|
|
1105
1118
|
const newColumnOrder = typeof value === 'function' ? value(columnOrder) : value;
|
|
1106
1119
|
setInternalColumnOrder(newColumnOrder);
|
|
1107
|
-
onColumnOrderChange
|
|
1120
|
+
onColumnOrderChange === null || onColumnOrderChange === void 0 ? void 0 : onColumnOrderChange(newColumnOrder);
|
|
1108
1121
|
});
|
|
1109
1122
|
const {
|
|
1110
1123
|
pinnedColumnConfigs,
|
|
@@ -1211,7 +1224,7 @@ const AdvancedTable = _ref => {
|
|
|
1211
1224
|
return ids;
|
|
1212
1225
|
}, [rowsProp]);
|
|
1213
1226
|
const totalRowsCountWithExpansion = React.useMemo(() => getAllRowIds().length, [getAllRowIds]);
|
|
1214
|
-
const hasExpandableRows = React.useMemo(() => rows
|
|
1227
|
+
const hasExpandableRows = React.useMemo(() => rows === null || rows === void 0 ? void 0 : rows.some(_ref3 => {
|
|
1215
1228
|
let {
|
|
1216
1229
|
hasChildRows
|
|
1217
1230
|
} = _ref3;
|
|
@@ -1230,10 +1243,10 @@ const AdvancedTable = _ref => {
|
|
|
1230
1243
|
} else if (expand !== false) {
|
|
1231
1244
|
rowPropReference.isExpanded = true;
|
|
1232
1245
|
}
|
|
1233
|
-
onRowsChange
|
|
1246
|
+
onRowsChange === null || onRowsChange === void 0 ? void 0 : onRowsChange([...rowsProp]);
|
|
1234
1247
|
};
|
|
1235
1248
|
const getLastToggledRowIndex = () => {
|
|
1236
|
-
const index = rows
|
|
1249
|
+
const index = rows === null || rows === void 0 ? void 0 : rows.findIndex(_ref4 => {
|
|
1237
1250
|
let {
|
|
1238
1251
|
id
|
|
1239
1252
|
} = _ref4;
|
|
@@ -1259,10 +1272,11 @@ const AdvancedTable = _ref => {
|
|
|
1259
1272
|
}
|
|
1260
1273
|
};
|
|
1261
1274
|
const multiUpdateCheckedRowIds = (startIndex, endIndex) => {
|
|
1275
|
+
var _rows$endIndex;
|
|
1262
1276
|
if (!rows || startIndex === headerRowIndex || endIndex === headerRowIndex) {
|
|
1263
1277
|
return;
|
|
1264
1278
|
}
|
|
1265
|
-
const endRowId = rows
|
|
1279
|
+
const endRowId = rows === null || rows === void 0 || (_rows$endIndex = rows[endIndex]) === null || _rows$endIndex === void 0 ? void 0 : _rows$endIndex.id;
|
|
1266
1280
|
const isEndIndexChecked = checkedRowIdsSet.has(endRowId);
|
|
1267
1281
|
let newCheckedRowIds = [...checkedRowIds];
|
|
1268
1282
|
const increment = startIndex < endIndex ? 1 : -1;
|
|
@@ -1280,7 +1294,7 @@ const AdvancedTable = _ref => {
|
|
|
1280
1294
|
if (hasChildRows) {
|
|
1281
1295
|
idsToUncheck = idsToUncheck.concat(getAllRowIds(rowPropReference.childRows));
|
|
1282
1296
|
}
|
|
1283
|
-
newCheckedRowIds = newCheckedRowIds.filter(id => !
|
|
1297
|
+
newCheckedRowIds = newCheckedRowIds.filter(id => !idsToUncheck.includes(id));
|
|
1284
1298
|
} else if (!checkedRowIdsSet.has(rowId)) {
|
|
1285
1299
|
let idsToCheck = [rowId];
|
|
1286
1300
|
if (hasChildRows) {
|
|
@@ -1307,7 +1321,7 @@ const AdvancedTable = _ref => {
|
|
|
1307
1321
|
if (hasChildRows) {
|
|
1308
1322
|
idsToUncheck = idsToUncheck.concat(getAllRowIds(rowPropReference.childRows));
|
|
1309
1323
|
}
|
|
1310
|
-
setCheckedRowIds(checkedRowIds.filter(id => !
|
|
1324
|
+
setCheckedRowIds(checkedRowIds.filter(id => !idsToUncheck.includes(id)));
|
|
1311
1325
|
} else {
|
|
1312
1326
|
let idsToCheck = [rowId];
|
|
1313
1327
|
if (hasChildRows) {
|
|
@@ -1330,8 +1344,8 @@ const AdvancedTable = _ref => {
|
|
|
1330
1344
|
let newFocusedRowIndex;
|
|
1331
1345
|
const currentRow = rows[rowIndex];
|
|
1332
1346
|
const rowOrFirstColumnIsFocused = focusedColumnIndex <= 0;
|
|
1333
|
-
const rowCanExpand = currentRow
|
|
1334
|
-
const rowCanCollapse = currentRow
|
|
1347
|
+
const rowCanExpand = (currentRow === null || currentRow === void 0 ? void 0 : currentRow.hasChildRows) && !(currentRow !== null && currentRow !== void 0 && currentRow.isExpanded);
|
|
1348
|
+
const rowCanCollapse = (currentRow === null || currentRow === void 0 ? void 0 : currentRow.hasChildRows) && (currentRow === null || currentRow === void 0 ? void 0 : currentRow.isExpanded);
|
|
1335
1349
|
switch (e.key) {
|
|
1336
1350
|
case 'ArrowUp':
|
|
1337
1351
|
e.preventDefault(); // prevent scroll
|
|
@@ -1402,6 +1416,7 @@ const AdvancedTable = _ref => {
|
|
|
1402
1416
|
}
|
|
1403
1417
|
};
|
|
1404
1418
|
const getColumnHeaderProps = (columnConfig, columnIndex, isPinned) => {
|
|
1419
|
+
var _columnWidths$id;
|
|
1405
1420
|
const rowIndex = headerRowIndex;
|
|
1406
1421
|
const {
|
|
1407
1422
|
id,
|
|
@@ -1414,9 +1429,9 @@ const AdvancedTable = _ref => {
|
|
|
1414
1429
|
return {
|
|
1415
1430
|
id,
|
|
1416
1431
|
isRowActionMenuColumn,
|
|
1417
|
-
'data-testid': dataTestId && id ?
|
|
1432
|
+
'data-testid': dataTestId && id ? "".concat(dataTestId, "-").concat(id) : undefined,
|
|
1418
1433
|
label: headerLabel,
|
|
1419
|
-
width: columnWidths[id]
|
|
1434
|
+
width: (_columnWidths$id = columnWidths[id]) !== null && _columnWidths$id !== void 0 ? _columnWidths$id : width,
|
|
1420
1435
|
widthBuffer: columnIndex === 0 && maxRowDepth > 0 ? columnWidthBuffers[0] : undefined,
|
|
1421
1436
|
onWidthChange: disableUserResizableColumns || isRowActionMenuColumn ? undefined : newWidth => {
|
|
1422
1437
|
setColumnWidths(currentColumnWidths => {
|
|
@@ -1426,8 +1441,9 @@ const AdvancedTable = _ref => {
|
|
|
1426
1441
|
} else if (currentColumnWidths[colId]) {
|
|
1427
1442
|
map[colId] = currentColumnWidths[colId];
|
|
1428
1443
|
} else {
|
|
1429
|
-
|
|
1430
|
-
|
|
1444
|
+
var _cellRefs$current;
|
|
1445
|
+
const colRef = (_cellRefs$current = cellRefs.current) === null || _cellRefs$current === void 0 || (_cellRefs$current = _cellRefs$current[headerRowIndex]) === null || _cellRefs$current === void 0 ? void 0 : _cellRefs$current[index];
|
|
1446
|
+
map[colId] = colRef === null || colRef === void 0 ? void 0 : colRef.getBoundingClientRect().width;
|
|
1431
1447
|
}
|
|
1432
1448
|
return map;
|
|
1433
1449
|
}, {});
|
|
@@ -1463,7 +1479,7 @@ const AdvancedTable = _ref => {
|
|
|
1463
1479
|
};
|
|
1464
1480
|
};
|
|
1465
1481
|
const getAdvancedTableRowExpandButton = (rowId, isExpanded, rowIndex) => /*#__PURE__*/React__default["default"].createElement(AdvancedTableRowExpandButton, {
|
|
1466
|
-
"data-testid": dataTestId && rowId ?
|
|
1482
|
+
"data-testid": dataTestId && rowId ? "".concat(dataTestId, "-row-").concat(rowId, "-expand-button") : undefined,
|
|
1467
1483
|
isRowExpanded: !!isExpanded,
|
|
1468
1484
|
onClick: e => {
|
|
1469
1485
|
e.stopPropagation(); // prevent onRowSelect
|
|
@@ -1484,6 +1500,7 @@ const AdvancedTable = _ref => {
|
|
|
1484
1500
|
}, children);
|
|
1485
1501
|
};
|
|
1486
1502
|
const getCellProps = (columnConfig, columnIndex, data, rowIndex, rowId, depth) => {
|
|
1503
|
+
var _columnWidths$columnI;
|
|
1487
1504
|
const {
|
|
1488
1505
|
id: columnId,
|
|
1489
1506
|
width,
|
|
@@ -1497,18 +1514,18 @@ const AdvancedTable = _ref => {
|
|
|
1497
1514
|
setValue: newValue => {
|
|
1498
1515
|
const newRows = [...rowsProp];
|
|
1499
1516
|
newRows[rowIndex].data[columnId] = newValue;
|
|
1500
|
-
onRowsChange
|
|
1517
|
+
onRowsChange === null || onRowsChange === void 0 ? void 0 : onRowsChange(newRows);
|
|
1501
1518
|
},
|
|
1502
1519
|
renderCellContent,
|
|
1503
1520
|
isCellContentInteractive,
|
|
1504
|
-
width: columnWidths[columnId]
|
|
1521
|
+
width: (_columnWidths$columnI = columnWidths[columnId]) !== null && _columnWidths$columnI !== void 0 ? _columnWidths$columnI : width,
|
|
1505
1522
|
widthBuffer: columnIndex === 0 && maxRowDepth > 0 ? columnWidthBuffers[depth] : undefined,
|
|
1506
1523
|
alignment,
|
|
1507
1524
|
rowId,
|
|
1508
1525
|
columnId,
|
|
1509
1526
|
rowIndex,
|
|
1510
1527
|
columnIndex,
|
|
1511
|
-
'data-testid': dataTestId && rowId && columnId ?
|
|
1528
|
+
'data-testid': dataTestId && rowId && columnId ? "".concat(dataTestId, "-cell-").concat(rowId, "-").concat(columnId) : undefined,
|
|
1512
1529
|
isFocused: rowIndex === focusedRowIndex && columnIndex === focusedColumnIndex,
|
|
1513
1530
|
onFocus: onCellFocus(rowIndex, columnIndex),
|
|
1514
1531
|
onKeyDown: onKeyDown(rowIndex),
|
|
@@ -1568,16 +1585,16 @@ const AdvancedTable = _ref => {
|
|
|
1568
1585
|
onClick: handleColumnHeaderCheckboxToggle,
|
|
1569
1586
|
onFocus: onRowFocus(headerRowIndex, minColumnIndex),
|
|
1570
1587
|
variant: "header"
|
|
1571
|
-
}), hasExpandableRows && pinnedColumnConfigs.length ? getExpandableRowsSpacer(
|
|
1588
|
+
}), hasExpandableRows && pinnedColumnConfigs.length ? getExpandableRowsSpacer("".concat(widthBufferWidth, "px"), true) : undefined, pinnedColumnConfigs.map((columnConfigs, i) => {
|
|
1572
1589
|
const props = getColumnHeaderProps(columnConfigs, i, true);
|
|
1573
1590
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableColumnHeader, props);
|
|
1574
|
-
})) : undefined, hasExpandableRows && !pinnedColumnConfigs.length ? getExpandableRowsSpacer(
|
|
1591
|
+
})) : undefined, hasExpandableRows && !pinnedColumnConfigs.length ? getExpandableRowsSpacer("".concat(widthBufferWidth, "px"), true) : undefined, unpinnedColumnConfigs.map((columnConfigs, i) => {
|
|
1575
1592
|
const props = getColumnHeaderProps(columnConfigs, i + pinnedColumnConfigs.length, false);
|
|
1576
1593
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableColumnHeader, props);
|
|
1577
1594
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1578
1595
|
role: "rowgroup",
|
|
1579
1596
|
className: styles$a.advancedTableRowGroup
|
|
1580
|
-
}, (paginatedRows
|
|
1597
|
+
}, ((_ref5 = paginatedRows !== null && paginatedRows !== void 0 ? paginatedRows : rows) !== null && _ref5 !== void 0 ? _ref5 : []).map((row, rowIndex) => {
|
|
1581
1598
|
const {
|
|
1582
1599
|
id: rowId,
|
|
1583
1600
|
data,
|
|
@@ -1594,7 +1611,7 @@ const AdvancedTable = _ref => {
|
|
|
1594
1611
|
const onSelect = e => {
|
|
1595
1612
|
e.preventDefault(); // stops event from triggering on new target when focus is changed during onSelect
|
|
1596
1613
|
if (hasOnRowSelect) {
|
|
1597
|
-
onRowSelect
|
|
1614
|
+
onRowSelect === null || onRowSelect === void 0 ? void 0 : onRowSelect(row.rowPropReference);
|
|
1598
1615
|
setSelectedRowId(rowId);
|
|
1599
1616
|
}
|
|
1600
1617
|
};
|
|
@@ -1609,7 +1626,7 @@ const AdvancedTable = _ref => {
|
|
|
1609
1626
|
"aria-rowindex": hasExpandableRows ? undefined : paginatedRowIndex + 2 // aria-rowindex is one-indexed + the column headers row is the first row in the table
|
|
1610
1627
|
,
|
|
1611
1628
|
|
|
1612
|
-
"data-testid": dataTestId && rowId ?
|
|
1629
|
+
"data-testid": dataTestId && rowId ? "".concat(dataTestId, "-row-").concat(rowId) : undefined,
|
|
1613
1630
|
hasOnRowSelect: hasOnRowSelect,
|
|
1614
1631
|
isFocusable: hasFocusableRows,
|
|
1615
1632
|
isFocused: paginatedRowIndex === focusedRowIndex && minColumnIndex === focusedColumnIndex,
|
|
@@ -1618,7 +1635,7 @@ const AdvancedTable = _ref => {
|
|
|
1618
1635
|
onKeyDown: onRowKeyDown,
|
|
1619
1636
|
onFocus: onRowFocus(paginatedRowIndex, minColumnIndex),
|
|
1620
1637
|
onClick: e => onSelect(e),
|
|
1621
|
-
key:
|
|
1638
|
+
key: "".concat(rowId).concat(depth).concat(parentId),
|
|
1622
1639
|
ref: createRef(paginatedRowIndex, minColumnIndex),
|
|
1623
1640
|
"aria-level": hasExpandableRows ? depth + 1 : undefined // aria-level is one-indexed
|
|
1624
1641
|
,
|
|
@@ -1642,14 +1659,14 @@ const AdvancedTable = _ref => {
|
|
|
1642
1659
|
onMouseEnter: () => setIsCheckboxHovered(true),
|
|
1643
1660
|
onMouseLeave: () => setIsCheckboxHovered(false),
|
|
1644
1661
|
onFocus: onRowFocus(paginatedRowIndex, minColumnIndex)
|
|
1645
|
-
}), hasExpandableRows && pinnedColumnConfigs.length ? getExpandableRowsSpacer(
|
|
1662
|
+
}), hasExpandableRows && pinnedColumnConfigs.length ? getExpandableRowsSpacer("".concat(widthBufferWidth * (depth + 1), "px"), false, hasChildRows ? getAdvancedTableRowExpandButton(rowId, isExpanded, rowIndex) : undefined) : undefined, pinnedColumnConfigs.map((c, i) => {
|
|
1646
1663
|
const props = getCellProps(c, i, data, paginatedRowIndex, rowId, depth);
|
|
1647
1664
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableCell, _extends__default["default"]({}, props, {
|
|
1648
1665
|
"aria-rowindex": hasExpandableRows ? undefined : rowIndex + 2 // aria-rowindex is one-indexed + the column headers row is the first row in the table
|
|
1649
1666
|
,
|
|
1650
1667
|
"aria-colindex": i + 1 // aria-colindex is one-indexed
|
|
1651
1668
|
}));
|
|
1652
|
-
})) : undefined, hasExpandableRows && !pinnedColumnConfigs.length ? getExpandableRowsSpacer(
|
|
1669
|
+
})) : undefined, hasExpandableRows && !pinnedColumnConfigs.length ? getExpandableRowsSpacer("".concat(widthBufferWidth * (depth + 1), "px"), false, hasChildRows ? getAdvancedTableRowExpandButton(rowId, isExpanded, rowIndex) : undefined) : undefined, unpinnedColumnConfigs.map((c, i) => {
|
|
1653
1670
|
const props = getCellProps(c, i + pinnedColumnConfigs.length, data, paginatedRowIndex, rowId, depth);
|
|
1654
1671
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableCell, _extends__default["default"]({}, props, {
|
|
1655
1672
|
className: styles$a.advancedTableRowChild,
|
|
@@ -1670,26 +1687,27 @@ const AdvancedTable = _ref => {
|
|
|
1670
1687
|
};
|
|
1671
1688
|
|
|
1672
1689
|
// TODO: move hook to separate file
|
|
1673
|
-
function useSortedRows(
|
|
1690
|
+
function useSortedRows(_ref6) {
|
|
1674
1691
|
let {
|
|
1675
1692
|
columnConfigs,
|
|
1676
1693
|
onRowsChange,
|
|
1677
1694
|
selectedSortOption,
|
|
1678
1695
|
setCurrentPage
|
|
1679
|
-
} =
|
|
1696
|
+
} = _ref6;
|
|
1680
1697
|
const columnConfigsRef = index.useLatest(columnConfigs);
|
|
1681
1698
|
const onRowsChangeRef = index.useLatest(onRowsChange);
|
|
1682
1699
|
index.useDidUpdate(() => {
|
|
1700
|
+
var _columnConfigsRef$cur;
|
|
1683
1701
|
const {
|
|
1684
1702
|
columnId,
|
|
1685
1703
|
index
|
|
1686
1704
|
} = selectedSortOption;
|
|
1687
|
-
const sort = columnConfigsRef.current.find(
|
|
1705
|
+
const sort = (_columnConfigsRef$cur = columnConfigsRef.current.find(_ref7 => {
|
|
1688
1706
|
let {
|
|
1689
1707
|
id
|
|
1690
|
-
} =
|
|
1708
|
+
} = _ref7;
|
|
1691
1709
|
return id === columnId;
|
|
1692
|
-
})
|
|
1710
|
+
})) === null || _columnConfigsRef$cur === void 0 || (_columnConfigsRef$cur = _columnConfigsRef$cur.sortOptions) === null || _columnConfigsRef$cur === void 0 || (_columnConfigsRef$cur = _columnConfigsRef$cur[index]) === null || _columnConfigsRef$cur === void 0 ? void 0 : _columnConfigsRef$cur.sort;
|
|
1693
1711
|
if (typeof sort === 'function' && onRowsChangeRef.current) {
|
|
1694
1712
|
onRowsChangeRef.current(sort(selectedSortOption));
|
|
1695
1713
|
setCurrentPage(1);
|
|
@@ -1698,7 +1716,7 @@ function useSortedRows(_ref5) {
|
|
|
1698
1716
|
}
|
|
1699
1717
|
|
|
1700
1718
|
// TODO: move hook to separate file
|
|
1701
|
-
function useFocusState(
|
|
1719
|
+
function useFocusState(_ref8) {
|
|
1702
1720
|
let {
|
|
1703
1721
|
headerRowIndex,
|
|
1704
1722
|
maxRowIndex,
|
|
@@ -1708,7 +1726,7 @@ function useFocusState(_ref7) {
|
|
|
1708
1726
|
pinnedUnpinnedColumnOrder,
|
|
1709
1727
|
tableRef,
|
|
1710
1728
|
currentPage
|
|
1711
|
-
} =
|
|
1729
|
+
} = _ref8;
|
|
1712
1730
|
const cellRefs = React.useRef({});
|
|
1713
1731
|
const pinnedContainersRef = React.useRef({});
|
|
1714
1732
|
const [focusedRowIndex, setFocusedRowIndex] = React.useState(headerRowIndex);
|
|
@@ -1734,11 +1752,12 @@ function useFocusState(_ref7) {
|
|
|
1734
1752
|
return newIndex;
|
|
1735
1753
|
};
|
|
1736
1754
|
const focusCell = index.useEventCallback(cell => {
|
|
1755
|
+
var _tableRef$current, _cellRefs$current2;
|
|
1737
1756
|
// Manually scroll cells/rows into view if needed
|
|
1738
|
-
const tablePos = tableRef.current
|
|
1739
|
-
const header = cellRefs.current
|
|
1740
|
-
const headerPos = header
|
|
1741
|
-
let cellPos = cell
|
|
1757
|
+
const tablePos = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.getBoundingClientRect();
|
|
1758
|
+
const header = (_cellRefs$current2 = cellRefs.current) === null || _cellRefs$current2 === void 0 || (_cellRefs$current2 = _cellRefs$current2[headerRowIndex]) === null || _cellRefs$current2 === void 0 ? void 0 : _cellRefs$current2[-1];
|
|
1759
|
+
const headerPos = header === null || header === void 0 ? void 0 : header.getBoundingClientRect();
|
|
1760
|
+
let cellPos = cell === null || cell === void 0 ? void 0 : cell.getBoundingClientRect();
|
|
1742
1761
|
|
|
1743
1762
|
// Vertical scroll
|
|
1744
1763
|
if (cell !== header && !header.contains(cell)) {
|
|
@@ -1759,6 +1778,7 @@ function useFocusState(_ref7) {
|
|
|
1759
1778
|
if (minColumnIndex === -1 && focusedColumnIndex === minColumnIndex) {
|
|
1760
1779
|
tableRef.current.scrollLeft -= tablePos.left - cellPos.left;
|
|
1761
1780
|
} else {
|
|
1781
|
+
var _pinnedContainersRef$;
|
|
1762
1782
|
if (cellPos.left < tablePos.left) {
|
|
1763
1783
|
// Scroll right if cell out of view to the left of the table
|
|
1764
1784
|
tableRef.current.scrollLeft -= tablePos.left - cellPos.left;
|
|
@@ -1766,23 +1786,24 @@ function useFocusState(_ref7) {
|
|
|
1766
1786
|
// Scroll left if cell out of view to the right of the table
|
|
1767
1787
|
tableRef.current.scrollLeft += cellPos.right - tablePos.right;
|
|
1768
1788
|
}
|
|
1769
|
-
const pinnedContainer = pinnedContainersRef.current
|
|
1770
|
-
const pinnedContainerPos = pinnedContainer
|
|
1771
|
-
cellPos = cell
|
|
1789
|
+
const pinnedContainer = (_pinnedContainersRef$ = pinnedContainersRef.current) === null || _pinnedContainersRef$ === void 0 ? void 0 : _pinnedContainersRef$[focusedRowIndex];
|
|
1790
|
+
const pinnedContainerPos = pinnedContainer === null || pinnedContainer === void 0 ? void 0 : pinnedContainer.getBoundingClientRect();
|
|
1791
|
+
cellPos = cell === null || cell === void 0 ? void 0 : cell.getBoundingClientRect();
|
|
1772
1792
|
|
|
1773
1793
|
// Scroll right if cell covered by pinned columns
|
|
1774
1794
|
if (pinnedContainer && cellPos.left < pinnedContainerPos.left + pinnedContainerPos.width && !pinnedContainer.contains(cell)) {
|
|
1775
1795
|
tableRef.current.scrollLeft -= pinnedContainerPos.left + pinnedContainerPos.width - cellPos.left;
|
|
1776
1796
|
}
|
|
1777
1797
|
}
|
|
1778
|
-
cell
|
|
1798
|
+
cell === null || cell === void 0 ? void 0 : cell.focus();
|
|
1779
1799
|
});
|
|
1780
1800
|
|
|
1781
1801
|
// Focus header cell when the focused column id changes. Used when pinning/unpinning columns since a new DOM element is created.
|
|
1782
1802
|
index.useDidUpdate(() => {
|
|
1783
1803
|
if (focusedColumnId) {
|
|
1804
|
+
var _cellRefs$current3;
|
|
1784
1805
|
const columnIndex = pinnedUnpinnedColumnOrder.indexOf(focusedColumnId);
|
|
1785
|
-
focusCell(cellRefs.current
|
|
1806
|
+
focusCell((_cellRefs$current3 = cellRefs.current) === null || _cellRefs$current3 === void 0 || (_cellRefs$current3 = _cellRefs$current3[focusedRowIndex]) === null || _cellRefs$current3 === void 0 ? void 0 : _cellRefs$current3[columnIndex]);
|
|
1786
1807
|
setFocusedColumnIndex(columnIndex);
|
|
1787
1808
|
setFocusedColumnId(undefined);
|
|
1788
1809
|
}
|
|
@@ -1790,7 +1811,8 @@ function useFocusState(_ref7) {
|
|
|
1790
1811
|
|
|
1791
1812
|
// Focus cell when the focused indices change
|
|
1792
1813
|
index.useDidUpdate(() => {
|
|
1793
|
-
|
|
1814
|
+
var _cellRefs$current4;
|
|
1815
|
+
const newFocusedCell = (_cellRefs$current4 = cellRefs.current) === null || _cellRefs$current4 === void 0 || (_cellRefs$current4 = _cellRefs$current4[focusedRowIndex]) === null || _cellRefs$current4 === void 0 ? void 0 : _cellRefs$current4[focusedColumnIndex];
|
|
1794
1816
|
|
|
1795
1817
|
/* Prevent cells from stealing focus from their children when they
|
|
1796
1818
|
* receive focus, but still allow focus to move from a cell to a row.
|
|
@@ -1817,9 +1839,9 @@ function useFocusState(_ref7) {
|
|
|
1817
1839
|
|
|
1818
1840
|
/* eslint-disable import/prefer-default-export */
|
|
1819
1841
|
|
|
1820
|
-
var css_248z$9 = ".
|
|
1821
|
-
var styles$9 = {"collapsibleSearchInput":"
|
|
1822
|
-
var stylesheet$9=".
|
|
1842
|
+
var css_248z$9 = "._pwZN0{display:inline-block;width:36px;transition:width .25s ease-out}._GIzNn{width:100%}._IKTUF>input{padding-right:0!important}._kOyzt>svg{fill:#515559}";
|
|
1843
|
+
var styles$9 = {"collapsibleSearchInput":"_pwZN0","searchInput":"_GIzNn","searchInputCollapsed":"_IKTUF","iconButton":"_kOyzt"};
|
|
1844
|
+
var stylesheet$9="._pwZN0{display:inline-block;width:36px;transition:width .25s ease-out}._GIzNn{width:100%}._IKTUF>input{padding-right:0!important}._kOyzt>svg{fill:#515559}";
|
|
1823
1845
|
icons_index.styleInject(css_248z$9);
|
|
1824
1846
|
|
|
1825
1847
|
const CollapsibleSearchInputIconButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -1835,7 +1857,7 @@ const CollapsibleSearchInputIconButton = /*#__PURE__*/React.forwardRef((_ref, re
|
|
|
1835
1857
|
return /*#__PURE__*/React__default["default"].createElement(index.IconButton, _extends__default["default"]({}, rest, {
|
|
1836
1858
|
className: styles$9.iconButton,
|
|
1837
1859
|
"aria-label": label,
|
|
1838
|
-
tooltipContent: tooltipContent
|
|
1860
|
+
tooltipContent: tooltipContent !== null && tooltipContent !== void 0 ? tooltipContent : label,
|
|
1839
1861
|
tooltipPlacement: tooltipPlacement,
|
|
1840
1862
|
ref: ref
|
|
1841
1863
|
}), /*#__PURE__*/React__default["default"].createElement(icons_index.SearchIcon, null));
|
|
@@ -1896,7 +1918,8 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1896
1918
|
});
|
|
1897
1919
|
};
|
|
1898
1920
|
const handleIconButtonClick = () => {
|
|
1899
|
-
|
|
1921
|
+
var _iconButtonRef$curren;
|
|
1922
|
+
(_iconButtonRef$curren = iconButtonRef.current) === null || _iconButtonRef$curren === void 0 ? void 0 : _iconButtonRef$curren.focus();
|
|
1900
1923
|
setExternalIsExpanded(true);
|
|
1901
1924
|
};
|
|
1902
1925
|
index.useDidUpdate(() => {
|
|
@@ -1911,10 +1934,11 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1911
1934
|
});
|
|
1912
1935
|
}, [externalIsExpanded]);
|
|
1913
1936
|
React.useEffect(() => {
|
|
1937
|
+
var _searchInputRef$curre, _iconButtonRef$curren2;
|
|
1914
1938
|
if (isComponentFocused) {
|
|
1915
1939
|
switch (internalExpandedState) {
|
|
1916
1940
|
case expandedStates.EXPANDING:
|
|
1917
|
-
searchInputRef.current
|
|
1941
|
+
(_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
|
|
1918
1942
|
break;
|
|
1919
1943
|
case expandedStates.COLLAPSED:
|
|
1920
1944
|
/*
|
|
@@ -1922,7 +1946,7 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1922
1946
|
* This will show the focus ring on the icon button and allow the tooltip to appear.
|
|
1923
1947
|
*/
|
|
1924
1948
|
|
|
1925
|
-
iconButtonRef.current
|
|
1949
|
+
(_iconButtonRef$curren2 = iconButtonRef.current) === null || _iconButtonRef$curren2 === void 0 ? void 0 : _iconButtonRef$curren2.focus();
|
|
1926
1950
|
break;
|
|
1927
1951
|
default:
|
|
1928
1952
|
}
|
|
@@ -1958,9 +1982,9 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1958
1982
|
}));
|
|
1959
1983
|
});
|
|
1960
1984
|
|
|
1961
|
-
var css_248z$8 = ".
|
|
1962
|
-
var styles$8 = {"input":"
|
|
1963
|
-
var stylesheet$8=".
|
|
1985
|
+
var css_248z$8 = "._3Lwys input{padding-left:76px!important}._a8k7r input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._a8k7r input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._a8k7r input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._dDFoz{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._dDFoz,._dDFoz._a8k7r:hover{background-color:transparent!important}._dDFoz:hover{background-color:rgba(50,54,58,.08)!important}._dDFoz:active{background-color:rgba(50,54,58,.11)!important}._dDFoz svg{top:2px!important}._-tnsL{position:relative}._T-5Dv{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
1986
|
+
var styles$8 = {"input":"_3Lwys","disabled":"_a8k7r","dropdown":"_dDFoz","container":"_-tnsL","countryCode":"_T-5Dv"};
|
|
1987
|
+
var stylesheet$8="._3Lwys input{padding-left:76px!important}._a8k7r input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._a8k7r input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._a8k7r input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._dDFoz{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._dDFoz,._dDFoz._a8k7r:hover{background-color:transparent!important}._dDFoz:hover{background-color:rgba(50,54,58,.08)!important}._dDFoz:active{background-color:rgba(50,54,58,.11)!important}._dDFoz svg{top:2px!important}._-tnsL{position:relative}._T-5Dv{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
1964
1988
|
icons_index.styleInject(css_248z$8);
|
|
1965
1989
|
|
|
1966
1990
|
const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -1986,9 +2010,10 @@ const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1986
2010
|
translate
|
|
1987
2011
|
} = index.useTranslation();
|
|
1988
2012
|
const getMinMaxLength = React.useCallback(() => {
|
|
2013
|
+
var _metadata$numberingPl;
|
|
1989
2014
|
const metadata = new libphonenumberJs.Metadata();
|
|
1990
2015
|
metadata.selectNumberingPlan(countryCode);
|
|
1991
|
-
const possibleLengths = metadata
|
|
2016
|
+
const possibleLengths = metadata === null || metadata === void 0 || (_metadata$numberingPl = metadata.numberingPlan) === null || _metadata$numberingPl === void 0 ? void 0 : _metadata$numberingPl.possibleLengths();
|
|
1992
2017
|
return possibleLengths ? [Math.min(...possibleLengths), Math.max(...possibleLengths)] : [0, genericMaxNumberLength];
|
|
1993
2018
|
}, [countryCode]);
|
|
1994
2019
|
const shouldUseMask = Number(libphonenumberJs.getCountryCallingCode(countryCode)) === 1;
|
|
@@ -2002,7 +2027,7 @@ const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2002
2027
|
React.useEffect(() => {
|
|
2003
2028
|
updateMask();
|
|
2004
2029
|
}, [countryCode, updateMask]);
|
|
2005
|
-
const removeNonNumericCharacters = value => value
|
|
2030
|
+
const removeNonNumericCharacters = value => value === null || value === void 0 ? void 0 : value.replace(/\D/g, '');
|
|
2006
2031
|
const handleInputChange = a => {
|
|
2007
2032
|
// remove all non-numeric characters
|
|
2008
2033
|
const value = removeNonNumericCharacters(a.target.value);
|
|
@@ -2018,12 +2043,12 @@ const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2018
2043
|
} catch (e) {
|
|
2019
2044
|
// `parsePhoneNumber` throws an error if the inputs are invalid.
|
|
2020
2045
|
}
|
|
2021
|
-
onChange
|
|
2046
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(internationalNumber, isValidLength, countryCode, value);
|
|
2022
2047
|
};
|
|
2023
2048
|
const inputClassNames = classNames__default["default"](styles$8.input, {
|
|
2024
2049
|
[styles$8.disabled]: isDisabled
|
|
2025
2050
|
});
|
|
2026
|
-
const dropdownLabel = React.useMemo(() => countryCode ?
|
|
2051
|
+
const dropdownLabel = React.useMemo(() => countryCode ? "+".concat(libphonenumberJs.getCountryCallingCode(countryCode)) : undefined, [countryCode]);
|
|
2027
2052
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2028
2053
|
className: styles$8.container,
|
|
2029
2054
|
"data-testid": dataTestId
|
|
@@ -2040,14 +2065,14 @@ const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2040
2065
|
disabled: isDisabled,
|
|
2041
2066
|
"aria-label": buttonAriaLabel,
|
|
2042
2067
|
"aria-labelledby": buttonAriaLabelledBy
|
|
2043
|
-
}, (countryCodes
|
|
2068
|
+
}, (countryCodes !== null && countryCodes !== void 0 ? countryCodes : libphonenumberJs.getCountries()).map(individualCountryCode => {
|
|
2044
2069
|
if (!libphonenumberJs.isSupportedCountry(individualCountryCode)) {
|
|
2045
2070
|
return null;
|
|
2046
2071
|
}
|
|
2047
2072
|
return /*#__PURE__*/React__default["default"].createElement(index.MenuItem, {
|
|
2048
2073
|
key: individualCountryCode,
|
|
2049
2074
|
value: individualCountryCode
|
|
2050
|
-
},
|
|
2075
|
+
}, "".concat(translate(individualCountryCode), " +").concat(libphonenumberJs.getCountryCallingCode(individualCountryCode)));
|
|
2051
2076
|
})), /*#__PURE__*/React__default["default"].createElement(InputMask__default["default"], {
|
|
2052
2077
|
value: isDisabled ? removeNonNumericCharacters(initialValue) : undefined,
|
|
2053
2078
|
type: "tel",
|
|
@@ -2102,7 +2127,7 @@ function deleteOption(option, options, hookFunctionName) {
|
|
|
2102
2127
|
const indexOfNodeToDelete = options.findIndex(n => n === option);
|
|
2103
2128
|
if (indexOfNodeToDelete === -1) {
|
|
2104
2129
|
// eslint-disable-next-line no-console
|
|
2105
|
-
console.error(
|
|
2130
|
+
console.error("[".concat(hookFunctionName, "] Attempt to delete node failed. This node does not exist in the list of registered nodes."));
|
|
2106
2131
|
} else {
|
|
2107
2132
|
options.splice(indexOfNodeToDelete, 1);
|
|
2108
2133
|
}
|
|
@@ -2125,7 +2150,7 @@ function useComboboxFilteredGroup() {
|
|
|
2125
2150
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
2126
2151
|
if (!option) {
|
|
2127
2152
|
// eslint-disable-next-line no-console
|
|
2128
|
-
console.warn(
|
|
2153
|
+
console.warn("[".concat(useComboboxFilteredGroup.name, "] registerOption called without any parameters! Pass in \"option\" as parameter."));
|
|
2129
2154
|
return;
|
|
2130
2155
|
}
|
|
2131
2156
|
insertOption(option, filteredOptionsRef.current);
|
|
@@ -2192,7 +2217,8 @@ isDisabled) {
|
|
|
2192
2217
|
* @param descendantElement - The element to be marked as the active descendant element.
|
|
2193
2218
|
*/
|
|
2194
2219
|
const focusDescendant = React.useCallback((descendantElement, index) => {
|
|
2195
|
-
|
|
2220
|
+
var _inputRef$current;
|
|
2221
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute('aria-activedescendant', descendantElement.id);
|
|
2196
2222
|
setActiveDescendant({
|
|
2197
2223
|
element: descendantElement,
|
|
2198
2224
|
index
|
|
@@ -2223,7 +2249,7 @@ isDisabled) {
|
|
|
2223
2249
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
2224
2250
|
if (!option) {
|
|
2225
2251
|
// eslint-disable-next-line no-console
|
|
2226
|
-
console.error(
|
|
2252
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] registerOption called without any parameters! Pass in a 'ComboboxOption' via the \"option\" parameter."));
|
|
2227
2253
|
} else {
|
|
2228
2254
|
insertOption(option, filteredOptionsRef.current);
|
|
2229
2255
|
}
|
|
@@ -2237,10 +2263,11 @@ isDisabled) {
|
|
|
2237
2263
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
2238
2264
|
if (!option) {
|
|
2239
2265
|
// eslint-disable-next-line no-console
|
|
2240
|
-
console.error(
|
|
2266
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] deregisterOption called without any parameters! Pass in a 'ComboboxOption' via the \"option\" parameter."));
|
|
2241
2267
|
} else {
|
|
2268
|
+
var _activeDescendantRef$;
|
|
2242
2269
|
deleteOption(option, filteredOptionsRef.current, useComboboxFocusSequence.name);
|
|
2243
|
-
if (option === activeDescendantRef.current
|
|
2270
|
+
if (option === ((_activeDescendantRef$ = activeDescendantRef.current) === null || _activeDescendantRef$ === void 0 ? void 0 : _activeDescendantRef$.element)) {
|
|
2244
2271
|
setActiveDescendant(undefined);
|
|
2245
2272
|
}
|
|
2246
2273
|
if (filteredOptionsRef.current.length === 0) {
|
|
@@ -2282,7 +2309,8 @@ isDisabled) {
|
|
|
2282
2309
|
if (!isOpen) {
|
|
2283
2310
|
openFlyoutAndFocus(focusNext.name);
|
|
2284
2311
|
} else {
|
|
2285
|
-
|
|
2312
|
+
var _activeDescendantRef$2;
|
|
2313
|
+
const currentFocusedNodeIndex = (_activeDescendantRef$2 = activeDescendantRef.current) === null || _activeDescendantRef$2 === void 0 ? void 0 : _activeDescendantRef$2.index;
|
|
2286
2314
|
if (currentFocusedNodeIndex === filteredOptionsRef.current.length - 1) {
|
|
2287
2315
|
focusInput();
|
|
2288
2316
|
} else if (currentFocusedNodeIndex === undefined) {
|
|
@@ -2303,7 +2331,8 @@ isDisabled) {
|
|
|
2303
2331
|
if (!isOpen) {
|
|
2304
2332
|
openFlyoutAndFocus(focusPrevious.name);
|
|
2305
2333
|
} else {
|
|
2306
|
-
|
|
2334
|
+
var _activeDescendantRef$3;
|
|
2335
|
+
const currentFocusedNodeIndex = (_activeDescendantRef$3 = activeDescendantRef.current) === null || _activeDescendantRef$3 === void 0 ? void 0 : _activeDescendantRef$3.index;
|
|
2307
2336
|
if (currentFocusedNodeIndex === 0) {
|
|
2308
2337
|
focusInput();
|
|
2309
2338
|
} else if (currentFocusedNodeIndex === undefined) {
|
|
@@ -2390,13 +2419,13 @@ isDisabled) {
|
|
|
2390
2419
|
focusLast,
|
|
2391
2420
|
focusNext,
|
|
2392
2421
|
focusPrevious,
|
|
2393
|
-
activeDescendantElement: activeDescendant
|
|
2422
|
+
activeDescendantElement: activeDescendant === null || activeDescendant === void 0 ? void 0 : activeDescendant.element,
|
|
2394
2423
|
filteredOptionsRef
|
|
2395
2424
|
};
|
|
2396
2425
|
}
|
|
2397
2426
|
function logNoOptionsToFocusError(functionName) {
|
|
2398
2427
|
// eslint-disable-next-line no-console
|
|
2399
|
-
console.error(
|
|
2428
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] Invalid call to '").concat(functionName, "'. There are no registered nodes to focus."));
|
|
2400
2429
|
}
|
|
2401
2430
|
|
|
2402
2431
|
/**
|
|
@@ -2483,7 +2512,7 @@ function useComboboxLoadingState(isLoading, isComponentFocused, activeDescendant
|
|
|
2483
2512
|
*/
|
|
2484
2513
|
function useComboboxValue(initialInputValue, externalInputValue, externalOnChange) {
|
|
2485
2514
|
// This is the `value` of the `input` element (what is displayed to the user)
|
|
2486
|
-
const [rawInputValue, setRawInputValue] = React.useState(externalInputValue
|
|
2515
|
+
const [rawInputValue, setRawInputValue] = React.useState(externalInputValue !== null && externalInputValue !== void 0 ? externalInputValue : initialInputValue);
|
|
2487
2516
|
|
|
2488
2517
|
// The `value` of the `input` element will become this value by the time the `input` element is blurred
|
|
2489
2518
|
const [committedInputValue, setCommittedInputValue_DO_NOT_USE // A setter is created below so that the raw input value is also updated
|
|
@@ -2519,9 +2548,10 @@ function getFlyoutDimensions(anchorDimensions) {
|
|
|
2519
2548
|
* @returns A CSS style object containing styles to properly size the flyout.
|
|
2520
2549
|
*/
|
|
2521
2550
|
function useListboxFlyoutDimensions(anchorElement) {
|
|
2551
|
+
var _anchorElement$offset, _anchorElement$offset2;
|
|
2522
2552
|
const [anchorDimensions, setAnchorDimensions] = React.useState({
|
|
2523
|
-
width: anchorElement
|
|
2524
|
-
height: anchorElement
|
|
2553
|
+
width: (_anchorElement$offset = anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.offsetWidth) !== null && _anchorElement$offset !== void 0 ? _anchorElement$offset : 0,
|
|
2554
|
+
height: (_anchorElement$offset2 = anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.offsetHeight) !== null && _anchorElement$offset2 !== void 0 ? _anchorElement$offset2 : 18
|
|
2525
2555
|
});
|
|
2526
2556
|
const [flyoutDimensions, setFlyoutDimensions] = React.useState(getFlyoutDimensions(anchorDimensions));
|
|
2527
2557
|
|
|
@@ -2559,8 +2589,9 @@ function useSelectedOptionScroll(isOpen, activeDescendantElement, optionsRef, fl
|
|
|
2559
2589
|
// Scrolls to the selected option if the selected option is out of view
|
|
2560
2590
|
React.useEffect(() => {
|
|
2561
2591
|
if (isOpen && activeDescendantElement && flyoutRef.current) {
|
|
2592
|
+
var _optionsRef$current;
|
|
2562
2593
|
const flyoutContainerElement = flyoutRef.current;
|
|
2563
|
-
if (activeDescendantElement === optionsRef.current
|
|
2594
|
+
if (activeDescendantElement === ((_optionsRef$current = optionsRef.current) === null || _optionsRef$current === void 0 ? void 0 : _optionsRef$current[0])) {
|
|
2564
2595
|
// Scrolls the first header into view if one exists
|
|
2565
2596
|
flyoutContainerElement.scrollTop = 0;
|
|
2566
2597
|
} else if (flyoutContainerElement.scrollHeight > flyoutContainerElement.clientHeight) {
|
|
@@ -2587,7 +2618,8 @@ function useShouldRenderGroupHeader(filteredOptionsRef, committedInputValue) {
|
|
|
2587
2618
|
|
|
2588
2619
|
// Should render the header if the group includes at least one filtered option
|
|
2589
2620
|
React.useEffect(() => {
|
|
2590
|
-
|
|
2621
|
+
var _filteredOptionsRef$c;
|
|
2622
|
+
if (((_filteredOptionsRef$c = filteredOptionsRef.current) === null || _filteredOptionsRef$c === void 0 ? void 0 : _filteredOptionsRef$c.length) === 0) {
|
|
2591
2623
|
setShouldRenderHeader(false);
|
|
2592
2624
|
} else {
|
|
2593
2625
|
setShouldRenderHeader(true);
|
|
@@ -2672,9 +2704,9 @@ function Combobox(_ref) {
|
|
|
2672
2704
|
}, children);
|
|
2673
2705
|
}
|
|
2674
2706
|
|
|
2675
|
-
var css_248z$7 = ".
|
|
2676
|
-
var styles$7 = {"loadingSpinner":"
|
|
2677
|
-
var stylesheet$7=".
|
|
2707
|
+
var css_248z$7 = "._myN0M :after{background-color:#515559!important}._wRAs7>input:focus{box-shadow:none!important;border:1px solid #898989!important}._rP7Km{max-width:500px;padding:4px 0;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._rP7Km ._VvJt- ._FWGCs{display:flex;align-items:center;min-height:40px;padding:10px 12px;color:#32363a;font-size:12px;line-height:16px;font-weight:700;word-break:break-word}._rP7Km ._VvJt-:first-child ._LMRfC{display:none}._rP7Km ._YeJbX{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._rP7Km ._YeJbX:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._rP7Km ._YeJbX:hover._iLZnA{background-color:#e4effa}._rP7Km ._YeJbX._iLZnA{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._rP7Km ._YeJbX:active:not(._iLZnA){background-color:#e8e9e9}";
|
|
2708
|
+
var styles$7 = {"loadingSpinner":"_myN0M","ignoreFocusStyle":"_wRAs7","flyout":"_rP7Km","group":"_VvJt-","header":"_FWGCs","divider":"_LMRfC","option":"_YeJbX","selected":"_iLZnA"};
|
|
2709
|
+
var stylesheet$7="._myN0M :after{background-color:#515559!important}._wRAs7>input:focus{box-shadow:none!important;border:1px solid #898989!important}._rP7Km{max-width:500px;padding:4px 0;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._rP7Km ._VvJt- ._FWGCs{display:flex;align-items:center;min-height:40px;padding:10px 12px;color:#32363a;font-size:12px;line-height:16px;font-weight:700;word-break:break-word}._rP7Km ._VvJt-:first-child ._LMRfC{display:none}._rP7Km ._YeJbX{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._rP7Km ._YeJbX:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._rP7Km ._YeJbX:hover._iLZnA{background-color:#e4effa}._rP7Km ._YeJbX._iLZnA{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._rP7Km ._YeJbX:active:not(._iLZnA){background-color:#e8e9e9}";
|
|
2678
2710
|
icons_index.styleInject(css_248z$7);
|
|
2679
2711
|
|
|
2680
2712
|
const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -2806,8 +2838,8 @@ const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2806
2838
|
onBlur: () => {
|
|
2807
2839
|
commitCurrentRawInputValueAndCloseFlyout();
|
|
2808
2840
|
},
|
|
2809
|
-
"aria-label": ariaLabel
|
|
2810
|
-
"aria-labelledby": ariaLabelledBy
|
|
2841
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rootAriaLabel,
|
|
2842
|
+
"aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : rootAriaLabelledBy,
|
|
2811
2843
|
"aria-describedby": ariaDescribedBy,
|
|
2812
2844
|
"data-testid": index.getSubDataTestId(rootDataTestId, 'input'),
|
|
2813
2845
|
"aria-expanded": isOpen,
|
|
@@ -2851,8 +2883,8 @@ const ComboboxFlyout = _ref => {
|
|
|
2851
2883
|
id: flyoutId,
|
|
2852
2884
|
className: styles$7.flyout,
|
|
2853
2885
|
style: flyoutDimensions,
|
|
2854
|
-
"aria-label": ariaLabel
|
|
2855
|
-
"aria-labelledby": ariaLabelledBy
|
|
2886
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rootAriaLabel,
|
|
2887
|
+
"aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : rootAriaLabelledBy,
|
|
2856
2888
|
"aria-describedby": ariaDescribedBy,
|
|
2857
2889
|
"data-testid": index.getSubDataTestId(rootDataTestId, 'flyout'),
|
|
2858
2890
|
ref: flyoutRef
|
|
@@ -2904,7 +2936,7 @@ function ComboboxGroup(_ref) {
|
|
|
2904
2936
|
className: styles$7.group,
|
|
2905
2937
|
"aria-labelledby": headerElementId,
|
|
2906
2938
|
"aria-describedby": ariaDescribedBy,
|
|
2907
|
-
"data-testid": index.getSubDataTestId(rootDataTestId,
|
|
2939
|
+
"data-testid": index.getSubDataTestId(rootDataTestId, "group-".concat(label))
|
|
2908
2940
|
}, /*#__PURE__*/React__default["default"].createElement(index.Divider, {
|
|
2909
2941
|
className: styles$7.divider
|
|
2910
2942
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2975,14 +3007,14 @@ function ComboboxOption(_ref) {
|
|
|
2975
3007
|
onMouseDown: e => e.preventDefault() // Prevents the input from getting blurred
|
|
2976
3008
|
,
|
|
2977
3009
|
"aria-selected": isOptionSelected,
|
|
2978
|
-
"data-testid": index.getSubDataTestId(rootDataTestId,
|
|
3010
|
+
"data-testid": index.getSubDataTestId(rootDataTestId, "option-".concat(label)),
|
|
2979
3011
|
ref: containerElementRef
|
|
2980
3012
|
}, label);
|
|
2981
3013
|
}
|
|
2982
3014
|
|
|
2983
|
-
var css_248z$6 = ".
|
|
2984
|
-
var styles$6 = {"container":"
|
|
2985
|
-
var stylesheet$6=".
|
|
3015
|
+
var css_248z$6 = "._OvR8C{display:flex}._-f9G5{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._-f9G5._wH-CQ{background-color:#fff}._-f9G5._wH-CQ._HCBQf:not(._-f9G5._wH-CQ._3DW4Y),._-f9G5._wH-CQ._VAFAa.focus-visible:not(._ccYDM),._-f9G5._wH-CQ._VAFAa:focus-visible:not(._ccYDM),._-f9G5._YdaMA{background-color:#0b6ed0}._-f9G5._YdaMA._3DW4Y._HCBQf,._-f9G5._YdaMA._ccYDM._3DW4Y,._-f9G5._YdaMA._ccYDM._VAFAa{opacity:.4}._cvhox{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._cvhox:focus{z-index:1}._P8F-D{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._P8F-D svg{margin-left:1px}._P8F-D._wH-CQ{background-color:#0b6ed0;border-color:transparent}._P8F-D._wH-CQ svg{fill:#fff!important}._P8F-D._wH-CQ:not(._HCqT5):hover{background-color:#085caf!important}._P8F-D._wH-CQ:not(._HCqT5):active{background-color:#0854a1!important}._P8F-D._wH-CQ._HCqT5{opacity:.4}._P8F-D._wH-CQ._HCqT5 svg{background-color:transparent}._P8F-D._YdaMA{border-color:#0b6ed0;background-color:#fff}._P8F-D._YdaMA svg{fill:#0b6ed0!important}._P8F-D._YdaMA:not(._HCqT5):hover{background-color:#eef5fc!important}._P8F-D._YdaMA:not(._HCqT5):active{background-color:#e1edf9!important}._P8F-D._YdaMA._HCqT5{opacity:.4}._P8F-D._YdaMA._HCqT5 svg{background-color:transparent}._R90pQ{width:260px}";
|
|
3016
|
+
var styles$6 = {"container":"_OvR8C","divider":"_-f9G5","primary":"_wH-CQ","mainButtonFocus":"_VAFAa","mainButtonDisabled":"_ccYDM","dropdownButtonFocus":"_HCBQf","dropdownButtonDisabled":"_3DW4Y","secondary":"_YdaMA","mainButton":"_cvhox","dropdownButton":"_P8F-D","disabled":"_HCqT5","dropdownOption":"_R90pQ"};
|
|
3017
|
+
var stylesheet$6="._OvR8C{display:flex}._-f9G5{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._-f9G5._wH-CQ{background-color:#fff}._-f9G5._wH-CQ._HCBQf:not(._-f9G5._wH-CQ._3DW4Y),._-f9G5._wH-CQ._VAFAa.focus-visible:not(._ccYDM),._-f9G5._wH-CQ._VAFAa:focus-visible:not(._ccYDM),._-f9G5._YdaMA{background-color:#0b6ed0}._-f9G5._YdaMA._3DW4Y._HCBQf,._-f9G5._YdaMA._ccYDM._3DW4Y,._-f9G5._YdaMA._ccYDM._VAFAa{opacity:.4}._cvhox{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._cvhox:focus{z-index:1}._P8F-D{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._P8F-D svg{margin-left:1px}._P8F-D._wH-CQ{background-color:#0b6ed0;border-color:transparent}._P8F-D._wH-CQ svg{fill:#fff!important}._P8F-D._wH-CQ:not(._HCqT5):hover{background-color:#085caf!important}._P8F-D._wH-CQ:not(._HCqT5):active{background-color:#0854a1!important}._P8F-D._wH-CQ._HCqT5{opacity:.4}._P8F-D._wH-CQ._HCqT5 svg{background-color:transparent}._P8F-D._YdaMA{border-color:#0b6ed0;background-color:#fff}._P8F-D._YdaMA svg{fill:#0b6ed0!important}._P8F-D._YdaMA:not(._HCqT5):hover{background-color:#eef5fc!important}._P8F-D._YdaMA:not(._HCqT5):active{background-color:#e1edf9!important}._P8F-D._YdaMA._HCqT5{opacity:.4}._P8F-D._YdaMA._HCqT5 svg{background-color:transparent}._R90pQ{width:260px}";
|
|
2986
3018
|
icons_index.styleInject(css_248z$6);
|
|
2987
3019
|
|
|
2988
3020
|
const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -3006,8 +3038,14 @@ const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3006
3038
|
const [mainButtonHasFocus, setMainButtonHasFocus] = React.useState(false);
|
|
3007
3039
|
|
|
3008
3040
|
// Keyboard navigation cannot be implemented using `onKeyDown` on the `button`s because keyboard events are disabled if the buttons are disabled. The consumer must be able to access either button, even if the other is disabled.
|
|
3009
|
-
index.useEventListener(mainButtonRef, 'keydown', e =>
|
|
3010
|
-
|
|
3041
|
+
index.useEventListener(mainButtonRef, 'keydown', e => {
|
|
3042
|
+
var _dropdownButtonRef$cu;
|
|
3043
|
+
return e.key === 'ArrowRight' && ((_dropdownButtonRef$cu = dropdownButtonRef.current) === null || _dropdownButtonRef$cu === void 0 ? void 0 : _dropdownButtonRef$cu.focus());
|
|
3044
|
+
});
|
|
3045
|
+
index.useEventListener(dropdownButtonRef, 'keydown', e => {
|
|
3046
|
+
var _mainButtonRef$curren;
|
|
3047
|
+
return e.key === 'ArrowLeft' && ((_mainButtonRef$curren = mainButtonRef.current) === null || _mainButtonRef$curren === void 0 ? void 0 : _mainButtonRef$curren.focus());
|
|
3048
|
+
});
|
|
3011
3049
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3012
3050
|
"data-testid": dataTestId,
|
|
3013
3051
|
className: classNames__default["default"](styles$6.container, className),
|
|
@@ -3076,9 +3114,9 @@ const SplitButtonOption = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3076
3114
|
}, children);
|
|
3077
3115
|
});
|
|
3078
3116
|
|
|
3079
|
-
var css_248z$5 = ".
|
|
3080
|
-
var styles$5 = {"button":"
|
|
3081
|
-
var stylesheet$5=".
|
|
3117
|
+
var css_248z$5 = "._qHxTT{display:flex;justify-content:space-between;align-items:center;max-width:100%;min-width:76px;height:36px;padding:0 6px 0 12px;outline:none;font-size:14px;background-color:#fff;border:1px solid #898989;border-radius:20px;cursor:pointer}._qHxTT:hover:not(._6UU1i){background-color:rgba(50,54,58,.08)}._qHxTT:hover:not(._6UU1i)._PWVBj{border-color:#085caf;background-color:rgba(11,110,208,.04)}._qHxTT:hover:not(._6UU1i)._PWVBj ._BwEqX{color:#32363a}._qHxTT:hover:not(._6UU1i)._PWVBj ._Zjoif{fill:#32363a}._qHxTT:hover:not(._6UU1i)._PWVBj ._5m4ti{fill:#085caf}._qHxTT:hover:not(._6UU1i)._PWVBj ._6-Dkt{background-color:rgba(11,110,208,.11)}._qHxTT:hover:not(._6UU1i)._PWVBj ._6-Dkt ._lCIlI{color:#085caf}._qHxTT:active:not(._6UU1i){background-color:#e8e9e9}._qHxTT:active:not(._6UU1i)._PWVBj{background-color:rgba(11,110,208,.11);border-color:#0854a1}._qHxTT:active:not(._6UU1i)._PWVBj ._5m4ti{fill:#0854a1}._qHxTT:active:not(._6UU1i)._PWVBj ._6-Dkt{background-color:rgba(11,110,208,.11)}._qHxTT:active:not(._6UU1i)._PWVBj ._6-Dkt ._lCIlI{color:#0854a1}._qHxTT._6UU1i{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._qHxTT._PWVBj{border-color:#0b6ed0}._Zjoif{fill:#515559;margin-right:4px}._BwEqX{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._BwEqX+._6-Dkt{margin-left:6px}._BwEqX._6UU1i{color:#74777a}._6-Dkt{display:flex;justify-content:center;align-items:center;max-width:350px;flex:1;min-width:0;height:24px;margin-right:3px;padding:0 10px;background-color:#ebf3fb;border-radius:20px}._lCIlI{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._5m4ti{fill:#515559}._5m4ti._6UU1i,._5m4ti._6UU1i._PWVBj{fill:rgba(116,119,122,.4)}._5m4ti._PWVBj{fill:#0b6ed0}._5m4ti._AXtae{transform:rotate(-180deg)}._qHxTT.focus-visible,._qHxTT:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
3118
|
+
var styles$5 = {"button":"_qHxTT","disabled":"_6UU1i","selected":"_PWVBj","label":"_BwEqX","lockIcon":"_Zjoif","chevronIcon":"_5m4ti","selectedFiltersContainer":"_6-Dkt","selectedFilters":"_lCIlI","open":"_AXtae"};
|
|
3119
|
+
var stylesheet$5="._qHxTT{display:flex;justify-content:space-between;align-items:center;max-width:100%;min-width:76px;height:36px;padding:0 6px 0 12px;outline:none;font-size:14px;background-color:#fff;border:1px solid #898989;border-radius:20px;cursor:pointer}._qHxTT:hover:not(._6UU1i){background-color:rgba(50,54,58,.08)}._qHxTT:hover:not(._6UU1i)._PWVBj{border-color:#085caf;background-color:rgba(11,110,208,.04)}._qHxTT:hover:not(._6UU1i)._PWVBj ._BwEqX{color:#32363a}._qHxTT:hover:not(._6UU1i)._PWVBj ._Zjoif{fill:#32363a}._qHxTT:hover:not(._6UU1i)._PWVBj ._5m4ti{fill:#085caf}._qHxTT:hover:not(._6UU1i)._PWVBj ._6-Dkt{background-color:rgba(11,110,208,.11)}._qHxTT:hover:not(._6UU1i)._PWVBj ._6-Dkt ._lCIlI{color:#085caf}._qHxTT:active:not(._6UU1i){background-color:#e8e9e9}._qHxTT:active:not(._6UU1i)._PWVBj{background-color:rgba(11,110,208,.11);border-color:#0854a1}._qHxTT:active:not(._6UU1i)._PWVBj ._5m4ti{fill:#0854a1}._qHxTT:active:not(._6UU1i)._PWVBj ._6-Dkt{background-color:rgba(11,110,208,.11)}._qHxTT:active:not(._6UU1i)._PWVBj ._6-Dkt ._lCIlI{color:#0854a1}._qHxTT._6UU1i{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._qHxTT._PWVBj{border-color:#0b6ed0}._Zjoif{fill:#515559;margin-right:4px}._BwEqX{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._BwEqX+._6-Dkt{margin-left:6px}._BwEqX._6UU1i{color:#74777a}._6-Dkt{display:flex;justify-content:center;align-items:center;max-width:350px;flex:1;min-width:0;height:24px;margin-right:3px;padding:0 10px;background-color:#ebf3fb;border-radius:20px}._lCIlI{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._5m4ti{fill:#515559}._5m4ti._6UU1i,._5m4ti._6UU1i._PWVBj{fill:rgba(116,119,122,.4)}._5m4ti._PWVBj{fill:#0b6ed0}._5m4ti._AXtae{transform:rotate(-180deg)}._qHxTT.focus-visible,._qHxTT:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
3082
3120
|
icons_index.styleInject(css_248z$5);
|
|
3083
3121
|
|
|
3084
3122
|
const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -3112,14 +3150,14 @@ const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3112
3150
|
if (isDisabled) {
|
|
3113
3151
|
e.stopPropagation(); // Prevents "click" events from occurring on parent elements
|
|
3114
3152
|
} else {
|
|
3115
|
-
onClick
|
|
3153
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
3116
3154
|
}
|
|
3117
3155
|
},
|
|
3118
3156
|
onKeyDown: e => {
|
|
3119
3157
|
if (isDisabled) {
|
|
3120
3158
|
e.stopPropagation(); // Prevents "keydown" events from occurring on parent elements
|
|
3121
3159
|
} else {
|
|
3122
|
-
onKeyDown
|
|
3160
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
3123
3161
|
}
|
|
3124
3162
|
},
|
|
3125
3163
|
disabled: undefined // This component uses aria-disabled instead of disabled
|
|
@@ -3146,7 +3184,7 @@ const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3146
3184
|
}, label)), isLoading ? /*#__PURE__*/React__default["default"].createElement(index.LoadingSpinner, {
|
|
3147
3185
|
show: true,
|
|
3148
3186
|
size: "xs",
|
|
3149
|
-
"aria-label": loadingSpinnerAriaLabel
|
|
3187
|
+
"aria-label": loadingSpinnerAriaLabel !== null && loadingSpinnerAriaLabel !== void 0 ? loadingSpinnerAriaLabel : translate('loading')
|
|
3150
3188
|
}) : selectedFilters && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3151
3189
|
className: styles$5.selectedFiltersContainer
|
|
3152
3190
|
}, /*#__PURE__*/React__default["default"].createElement(index.TextOverflowTooltip, {
|
|
@@ -3200,6 +3238,7 @@ const usePaneContext = childItemRef => {
|
|
|
3200
3238
|
|
|
3201
3239
|
/* eslint-disable max-classes-per-file */
|
|
3202
3240
|
const Menu = _ref => {
|
|
3241
|
+
var _process$env;
|
|
3203
3242
|
let {
|
|
3204
3243
|
'data-testid': dataTestId,
|
|
3205
3244
|
isOpen,
|
|
@@ -3207,9 +3246,10 @@ const Menu = _ref => {
|
|
|
3207
3246
|
isDisabled,
|
|
3208
3247
|
children
|
|
3209
3248
|
} = _ref;
|
|
3210
|
-
if (typeof process !== 'undefined' && process.env
|
|
3211
|
-
|
|
3212
|
-
window.
|
|
3249
|
+
if (typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) === 'test' && window) {
|
|
3250
|
+
var _window$ResizeObserve, _window$PointerEvent;
|
|
3251
|
+
window.ResizeObserver = (_window$ResizeObserve = window.ResizeObserver) !== null && _window$ResizeObserve !== void 0 ? _window$ResizeObserve : ResizeObserver;
|
|
3252
|
+
window.PointerEvent = (_window$PointerEvent = window.PointerEvent) !== null && _window$PointerEvent !== void 0 ? _window$PointerEvent : PointerEvent;
|
|
3213
3253
|
}
|
|
3214
3254
|
const [open, setOpen] = index.useControllableState(isOpen, onIsOpenChange, isOpen);
|
|
3215
3255
|
const [maskHeight, setMaskHeight] = React.useState(null);
|
|
@@ -3279,9 +3319,9 @@ class PointerEvent extends Event {
|
|
|
3279
3319
|
}
|
|
3280
3320
|
}
|
|
3281
3321
|
|
|
3282
|
-
var css_248z$4 = ".
|
|
3283
|
-
var styles$4 = {"buttonContainer":"
|
|
3284
|
-
var stylesheet$4=".
|
|
3322
|
+
var css_248z$4 = "._S4Js6{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._S4Js6>._OrzuD{cursor:unset;width:100%;height:100%;padding:0 28px 0 12px;border-radius:4px;white-space:nowrap;line-height:20px;font-size:14px;text-align:left;outline:none;border:none;box-shadow:inset 0 0 0 1px #898989;color:#515559;background-color:#fafafa;overflow:hidden;text-overflow:ellipsis}._S4Js6>._OrzuD:hover:not([aria-disabled=true]){background-color:#f5f5f5}._S4Js6>._OrzuD.focus-visible,._S4Js6>._OrzuD:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._S4Js6>._OrzuD+._N99f-{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._S4Js6>._OrzuD[data-state=open]+._N99f-{transform:rotate(-180deg) translateY(50%)}._S4Js6>._OrzuD[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._S4Js6>._OrzuD[aria-disabled=true]+._N99f-{fill:#515559;opacity:.4}._9E4fn>[data-radix-popper-content-wrapper]{overflow:hidden;background-color:#fff;width:var(--radix-dropdown-menu-trigger-width);min-width:200px!important;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);border-radius:4px;z-index:1!important}._9E4fn>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._nDlGA{margin:0;padding:4px 0;background:#fff;transition:.35s;opacity:1;overflow:auto;width:var(--radix-dropdown-menu-trigger-width);min-width:200px;max-height:350px}._nDlGA._uMzNI{margin-left:30px;opacity:0}._nDlGA._0jcRp{margin-left:-30px}._u-dkj{position:relative;padding:10px 12px;min-height:40px;display:flex;flex-direction:row;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._u-dkj._2HQjd{cursor:unset}._u-dkj ._sixk-{fill:#32363a;margin-right:4px}._u-dkj:focus,._u-dkj:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._u-dkj[aria-disabled=true]{cursor:not-allowed;opacity:.65}._u-dkj._DlFuJ{padding-right:32px}._u-dkj._DlFuJ ._N99f-{position:absolute;height:100%;right:3px;fill:#515559}._u-dkj._TqhET{pointer-events:none}._0BPzx{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;z-index:1;border-bottom:1px solid #e8e8e8}._0BPzx._32QZF{padding-top:49px}._vi1-R{z-index:1;pointer-events:none;position:fixed;left:0;top:0}._PwSUm{position:absolute;background-color:#fff;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;overflow:hidden;opacity:1;transition:opacity .35s}._PwSUm._0jcRp{opacity:0}._PwSUm._0jcRp>._JjhqP{margin-left:-30px}._PwSUm._uMzNI{opacity:0}._PwSUm._uMzNI>._JjhqP{margin-left:30px}._PwSUm>._JjhqP{transition:margin-left .35s;width:100%}._PwSUm._TqhET{pointer-events:none}body.keyboard-user ._u-dkj:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
3323
|
+
var styles$4 = {"buttonContainer":"_S4Js6","button":"_OrzuD","rightIcon":"_N99f-","maskContainer":"_9E4fn","flyout":"_nDlGA","animatedRight":"_uMzNI","animatedLeft":"_0jcRp","menuItem":"_u-dkj","noItems":"_2HQjd","backIcon":"_sixk-","subMenu":"_DlFuJ","unresponsive":"_TqhET","stickyBox":"_0BPzx","isSearchable":"_32QZF","searchBoxesContainer":"_vi1-R","searchBox":"_PwSUm","searchInput":"_JjhqP"};
|
|
3324
|
+
var stylesheet$4="._S4Js6{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._S4Js6>._OrzuD{cursor:unset;width:100%;height:100%;padding:0 28px 0 12px;border-radius:4px;white-space:nowrap;line-height:20px;font-size:14px;text-align:left;outline:none;border:none;box-shadow:inset 0 0 0 1px #898989;color:#515559;background-color:#fafafa;overflow:hidden;text-overflow:ellipsis}._S4Js6>._OrzuD:hover:not([aria-disabled=true]){background-color:#f5f5f5}._S4Js6>._OrzuD.focus-visible,._S4Js6>._OrzuD:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._S4Js6>._OrzuD+._N99f-{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._S4Js6>._OrzuD[data-state=open]+._N99f-{transform:rotate(-180deg) translateY(50%)}._S4Js6>._OrzuD[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._S4Js6>._OrzuD[aria-disabled=true]+._N99f-{fill:#515559;opacity:.4}._9E4fn>[data-radix-popper-content-wrapper]{overflow:hidden;background-color:#fff;width:var(--radix-dropdown-menu-trigger-width);min-width:200px!important;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);border-radius:4px;z-index:1!important}._9E4fn>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._nDlGA{margin:0;padding:4px 0;background:#fff;transition:.35s;opacity:1;overflow:auto;width:var(--radix-dropdown-menu-trigger-width);min-width:200px;max-height:350px}._nDlGA._uMzNI{margin-left:30px;opacity:0}._nDlGA._0jcRp{margin-left:-30px}._u-dkj{position:relative;padding:10px 12px;min-height:40px;display:flex;flex-direction:row;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._u-dkj._2HQjd{cursor:unset}._u-dkj ._sixk-{fill:#32363a;margin-right:4px}._u-dkj:focus,._u-dkj:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._u-dkj[aria-disabled=true]{cursor:not-allowed;opacity:.65}._u-dkj._DlFuJ{padding-right:32px}._u-dkj._DlFuJ ._N99f-{position:absolute;height:100%;right:3px;fill:#515559}._u-dkj._TqhET{pointer-events:none}._0BPzx{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;z-index:1;border-bottom:1px solid #e8e8e8}._0BPzx._32QZF{padding-top:49px}._vi1-R{z-index:1;pointer-events:none;position:fixed;left:0;top:0}._PwSUm{position:absolute;background-color:#fff;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;overflow:hidden;opacity:1;transition:opacity .35s}._PwSUm._0jcRp{opacity:0}._PwSUm._0jcRp>._JjhqP{margin-left:-30px}._PwSUm._uMzNI{opacity:0}._PwSUm._uMzNI>._JjhqP{margin-left:30px}._PwSUm>._JjhqP{transition:margin-left .35s;width:100%}._PwSUm._TqhET{pointer-events:none}body.keyboard-user ._u-dkj:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
3285
3325
|
icons_index.styleInject(css_248z$4);
|
|
3286
3326
|
|
|
3287
3327
|
/* eslint-disable import/prefer-default-export */
|
|
@@ -3371,6 +3411,7 @@ const MenuSearch = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
3371
3411
|
// creates a searchBarConfig, which maps to an instance of `MenuSearch`
|
|
3372
3412
|
// returns values that are necessary for use within pane
|
|
3373
3413
|
function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, items, animatedLeft, animatedRight, menuParentDataTestId, id, flyoutRef) {
|
|
3414
|
+
var _searchRef$current$qu, _searchRef$current;
|
|
3374
3415
|
let backButtonRef = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : undefined;
|
|
3375
3416
|
let closeSubmenu = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : undefined;
|
|
3376
3417
|
const [internalSearchValue, setSearchValue] = index.useControllableState(externalSearchValue, onSearchValueChange, externalSearchValue);
|
|
@@ -3380,49 +3421,59 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3380
3421
|
} = index.useTranslation();
|
|
3381
3422
|
const noMatchesText = translate('menu.noItemsToDisplay');
|
|
3382
3423
|
const searchPlaceholder = translate('searchText');
|
|
3383
|
-
React.useEffect(() => setZeroSearchResults(items
|
|
3424
|
+
React.useEffect(() => setZeroSearchResults((items === null || items === void 0 ? void 0 : items.filter(item => item.element.current).length) === 0), [items, internalSearchValue]);
|
|
3384
3425
|
const {
|
|
3385
3426
|
isFocusVisible
|
|
3386
3427
|
} = interactions.useFocusVisible({
|
|
3387
3428
|
isTextInput: true
|
|
3388
3429
|
});
|
|
3389
3430
|
const searchRef = React.useRef(null);
|
|
3390
|
-
const searchInput = searchRef.current
|
|
3391
|
-
const getFirstNonNullItem = () =>
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3431
|
+
const searchInput = (_searchRef$current$qu = (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.querySelector('input')) !== null && _searchRef$current$qu !== void 0 ? _searchRef$current$qu : null;
|
|
3432
|
+
const getFirstNonNullItem = () => {
|
|
3433
|
+
var _backButtonRef$curren, _items$find;
|
|
3434
|
+
return (_backButtonRef$curren = backButtonRef === null || backButtonRef === void 0 ? void 0 : backButtonRef.current) !== null && _backButtonRef$curren !== void 0 ? _backButtonRef$curren : (_items$find = items.find(item => item.element.current)) === null || _items$find === void 0 ? void 0 : _items$find.element.current;
|
|
3435
|
+
};
|
|
3436
|
+
const getLastNonNullItem = () => {
|
|
3437
|
+
var _findLast$element$cur, _findLast;
|
|
3438
|
+
return (// our tsconfig does not target a recent enough version to use `Array.prototype.findLast`
|
|
3439
|
+
(_findLast$element$cur = (_findLast = items.findLast(item => item.element.current)) === null || _findLast === void 0 ? void 0 : _findLast.element.current) !== null && _findLast$element$cur !== void 0 ? _findLast$element$cur : backButtonRef === null || backButtonRef === void 0 ? void 0 : backButtonRef.current
|
|
3440
|
+
);
|
|
3441
|
+
};
|
|
3395
3442
|
index.useEventListener(flyoutRef, 'keydown', e => {
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
searchInput?.focus();
|
|
3443
|
+
if (KEYS.NAVIGATE_UP.includes(e.key) && e.target === getFirstNonNullItem() || KEYS.NAVIGATE_DOWN.includes(e.key) && e.target === getLastNonNullItem()) {
|
|
3444
|
+
searchInput === null || searchInput === void 0 ? void 0 : searchInput.focus();
|
|
3399
3445
|
}
|
|
3400
3446
|
}, {
|
|
3401
3447
|
additionalDependencies: [flyoutRef.current],
|
|
3402
3448
|
isDisabled: !isSearchable
|
|
3403
3449
|
});
|
|
3404
3450
|
index.useEventListener(searchInput, 'keydown', e => {
|
|
3405
|
-
var
|
|
3406
|
-
if (
|
|
3451
|
+
var _e$target;
|
|
3452
|
+
if ([...KEYS.NAVIGATE_DOWN, ...KEYS.NAVIGATE_TOP].includes(e.key)) {
|
|
3453
|
+
var _getFirstNonNullItem;
|
|
3407
3454
|
// prevent scrolling
|
|
3408
3455
|
e.preventDefault();
|
|
3409
|
-
getFirstNonNullItem()
|
|
3410
|
-
} else if (
|
|
3456
|
+
(_getFirstNonNullItem = getFirstNonNullItem()) === null || _getFirstNonNullItem === void 0 ? void 0 : _getFirstNonNullItem.focus();
|
|
3457
|
+
} else if ([...KEYS.NAVIGATE_UP, ...KEYS.NAVIIGATE_BOTTOM].includes(e.key)) {
|
|
3458
|
+
var _getLastNonNullItem;
|
|
3411
3459
|
// prevent scrolling
|
|
3412
3460
|
e.preventDefault();
|
|
3413
|
-
getLastNonNullItem()
|
|
3414
|
-
} else if (
|
|
3415
|
-
closeSubmenu
|
|
3416
|
-
} else if (
|
|
3461
|
+
(_getLastNonNullItem = getLastNonNullItem()) === null || _getLastNonNullItem === void 0 ? void 0 : _getLastNonNullItem.focus();
|
|
3462
|
+
} else if (KEYS.CLOSE_SUBMENU.includes(e.key) && ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.selectionStart) === 0) {
|
|
3463
|
+
closeSubmenu === null || closeSubmenu === void 0 ? void 0 : closeSubmenu(e);
|
|
3464
|
+
} else if (KEYS.IGNORED_BY_SEARCH_INPUT.includes(e.key)) {
|
|
3417
3465
|
e.preventDefault();
|
|
3418
3466
|
}
|
|
3419
3467
|
});
|
|
3420
|
-
index.useEventListener(searchInput, 'blur', () => !isFocusVisible && !animatedLeft && !animatedRight && searchInput
|
|
3468
|
+
index.useEventListener(searchInput, 'blur', () => !isFocusVisible && !animatedLeft && !animatedRight && (searchInput === null || searchInput === void 0 ? void 0 : searchInput.focus()));
|
|
3421
3469
|
const {
|
|
3422
3470
|
searchBarConfigs,
|
|
3423
3471
|
setSearchBarConfigs
|
|
3424
3472
|
} = useMenuContext();
|
|
3425
|
-
const onInteractOutside = React.useCallback(e => searchBarConfigs.some(config =>
|
|
3473
|
+
const onInteractOutside = React.useCallback(e => searchBarConfigs.some(config => {
|
|
3474
|
+
var _config$ref$current;
|
|
3475
|
+
return (_config$ref$current = config.ref.current) === null || _config$ref$current === void 0 ? void 0 : _config$ref$current.contains(e.target);
|
|
3476
|
+
}) && e.preventDefault(), [searchBarConfigs]);
|
|
3426
3477
|
React.useEffect(() => {
|
|
3427
3478
|
if (!isSearchable) {
|
|
3428
3479
|
return undefined;
|
|
@@ -3434,7 +3485,7 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3434
3485
|
isInteractive: !animatedLeft && !animatedRight,
|
|
3435
3486
|
animatedLeft,
|
|
3436
3487
|
animatedRight,
|
|
3437
|
-
dataTestId: menuParentDataTestId
|
|
3488
|
+
dataTestId: menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_SEARCH),
|
|
3438
3489
|
setSearchValue,
|
|
3439
3490
|
ref: searchRef,
|
|
3440
3491
|
id,
|
|
@@ -3477,15 +3528,15 @@ const useMutationObserver = (target, options, onMutate) => React.useEffect(() =>
|
|
|
3477
3528
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3478
3529
|
args[_key] = arguments[_key];
|
|
3479
3530
|
}
|
|
3480
|
-
onMutate
|
|
3531
|
+
onMutate === null || onMutate === void 0 ? void 0 : onMutate(...args);
|
|
3481
3532
|
});
|
|
3482
3533
|
observer.observe(target, options);
|
|
3483
3534
|
return () => observer.disconnect();
|
|
3484
3535
|
}, [target, options, onMutate]);
|
|
3485
3536
|
|
|
3486
|
-
var css_248z$3 = ".
|
|
3487
|
-
var styles$3 = {"overlay":"
|
|
3488
|
-
var stylesheet$3=".
|
|
3537
|
+
var css_248z$3 = "._sepgy{background-color:#000;opacity:.5;width:100%;height:100%;position:absolute;top:0;left:0;right:0;bottom:0;display:grid;align-items:left;justify-items:left;place-items:left;overflow-y:auto}._4CRt2{visibility:hidden}";
|
|
3538
|
+
var styles$3 = {"overlay":"_sepgy","hidden":"_4CRt2"};
|
|
3539
|
+
var stylesheet$3="._sepgy{background-color:#000;opacity:.5;width:100%;height:100%;position:absolute;top:0;left:0;right:0;bottom:0;display:grid;align-items:left;justify-items:left;place-items:left;overflow-y:auto}._4CRt2{visibility:hidden}";
|
|
3489
3540
|
icons_index.styleInject(css_248z$3);
|
|
3490
3541
|
|
|
3491
3542
|
/**
|
|
@@ -3510,7 +3561,8 @@ const useOverlay = _ref => {
|
|
|
3510
3561
|
} = _ref;
|
|
3511
3562
|
const overlayId = index.useId();
|
|
3512
3563
|
React.useEffect(() => {
|
|
3513
|
-
|
|
3564
|
+
var _containerRef$current;
|
|
3565
|
+
const containerNode = (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body;
|
|
3514
3566
|
const overlay = document.createElement('div');
|
|
3515
3567
|
overlay.id = overlayId;
|
|
3516
3568
|
overlay.classList.add(styles$3.overlay);
|
|
@@ -3527,18 +3579,19 @@ const useOverlay = _ref => {
|
|
|
3527
3579
|
};
|
|
3528
3580
|
}, [containerRef, overlayId, isVisible, onClick, dataTestId, zIndex]);
|
|
3529
3581
|
React.useEffect(() => {
|
|
3530
|
-
|
|
3582
|
+
var _containerRef$current2;
|
|
3583
|
+
const containerNode = (_containerRef$current2 = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current2 !== void 0 ? _containerRef$current2 : document.body;
|
|
3531
3584
|
const overlayNode = document.getElementById(overlayId);
|
|
3532
3585
|
if (isVisible) {
|
|
3533
3586
|
Array.from(containerNode.children).forEach(child => {
|
|
3534
|
-
if (!
|
|
3587
|
+
if (!ignoreIds.includes(child.id) && child.id !== overlayId) child.setAttribute('inert', '');
|
|
3535
3588
|
});
|
|
3536
|
-
overlayNode
|
|
3589
|
+
overlayNode === null || overlayNode === void 0 ? void 0 : overlayNode.classList.remove(styles$3.hidden);
|
|
3537
3590
|
} else {
|
|
3538
3591
|
Array.from(containerNode.children).forEach(child => {
|
|
3539
3592
|
child.removeAttribute('inert');
|
|
3540
3593
|
});
|
|
3541
|
-
overlayNode
|
|
3594
|
+
overlayNode === null || overlayNode === void 0 ? void 0 : overlayNode.classList.add(styles$3.hidden);
|
|
3542
3595
|
}
|
|
3543
3596
|
return () => {
|
|
3544
3597
|
Array.from(containerNode.children).forEach(child => {
|
|
@@ -3549,6 +3602,7 @@ const useOverlay = _ref => {
|
|
|
3549
3602
|
};
|
|
3550
3603
|
|
|
3551
3604
|
const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
3605
|
+
var _flyoutRef$current$pa, _flyoutRef$current2, _flyoutRef$current3;
|
|
3552
3606
|
let {
|
|
3553
3607
|
placement,
|
|
3554
3608
|
children,
|
|
@@ -3564,7 +3618,10 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3564
3618
|
const flyoutRef = React.useRef(null);
|
|
3565
3619
|
const stickyBoxRef = React.useRef(null);
|
|
3566
3620
|
const portalTarget = index.usePortalTarget();
|
|
3567
|
-
const [side, align] = React.useMemo(() =>
|
|
3621
|
+
const [side, align] = React.useMemo(() => {
|
|
3622
|
+
var _placement$split, _placement$split2;
|
|
3623
|
+
return (_placement$split = placement === null || placement === void 0 || (_placement$split2 = placement.split) === null || _placement$split2 === void 0 ? void 0 : _placement$split2.call(placement, '-')) !== null && _placement$split !== void 0 ? _placement$split : [];
|
|
3624
|
+
}, [placement]);
|
|
3568
3625
|
const {
|
|
3569
3626
|
dataTestId: rootDataTestId,
|
|
3570
3627
|
openPaneDepth,
|
|
@@ -3596,7 +3653,8 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3596
3653
|
if (openPaneDepth === thisPanesDepth) {
|
|
3597
3654
|
if (initialHeightOfThisPane.current === null) {
|
|
3598
3655
|
window.requestAnimationFrame(() => {
|
|
3599
|
-
|
|
3656
|
+
var _flyoutRef$current$cl, _flyoutRef$current;
|
|
3657
|
+
initialHeightOfThisPane.current = (_flyoutRef$current$cl = (_flyoutRef$current = flyoutRef.current) === null || _flyoutRef$current === void 0 ? void 0 : _flyoutRef$current.clientHeight) !== null && _flyoutRef$current$cl !== void 0 ? _flyoutRef$current$cl : null;
|
|
3600
3658
|
setMaskHeight(initialHeightOfThisPane.current);
|
|
3601
3659
|
});
|
|
3602
3660
|
} else {
|
|
@@ -3605,7 +3663,8 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3605
3663
|
}
|
|
3606
3664
|
}, [openPaneDepth]);
|
|
3607
3665
|
const defaultSide = React.useMemo(() => {
|
|
3608
|
-
|
|
3666
|
+
var _triggerRef$current;
|
|
3667
|
+
const rect = triggerRef === null || triggerRef === void 0 || (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getBoundingClientRect();
|
|
3609
3668
|
if (!rect) {
|
|
3610
3669
|
return 'bottom';
|
|
3611
3670
|
}
|
|
@@ -3629,11 +3688,14 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3629
3688
|
return 'bottom';
|
|
3630
3689
|
}, [open, triggerRef]);
|
|
3631
3690
|
const [transform, setTransform] = React.useState('');
|
|
3632
|
-
const target = flyoutRef.current
|
|
3691
|
+
const target = (_flyoutRef$current$pa = (_flyoutRef$current2 = flyoutRef.current) === null || _flyoutRef$current2 === void 0 ? void 0 : _flyoutRef$current2.parentNode) !== null && _flyoutRef$current$pa !== void 0 ? _flyoutRef$current$pa : undefined;
|
|
3633
3692
|
useMutationObserver(target, {
|
|
3634
3693
|
attributes: true,
|
|
3635
3694
|
attributeFilter: ['style']
|
|
3636
|
-
}, () =>
|
|
3695
|
+
}, () => {
|
|
3696
|
+
var _style$transform, _style;
|
|
3697
|
+
return setTransform((_style$transform = target === null || target === void 0 || (_style = target.style) === null || _style === void 0 ? void 0 : _style.transform) !== null && _style$transform !== void 0 ? _style$transform : '');
|
|
3698
|
+
});
|
|
3637
3699
|
return /*#__PURE__*/React__default["default"].createElement(PaneContextProvider, {
|
|
3638
3700
|
items: items,
|
|
3639
3701
|
setItems: setItems,
|
|
@@ -3651,7 +3713,10 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3651
3713
|
className: styles$4.maskContainer,
|
|
3652
3714
|
id: maskContainerId
|
|
3653
3715
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Content, _extends__default["default"]({}, rest, {
|
|
3654
|
-
onCloseAutoFocus: () =>
|
|
3716
|
+
onCloseAutoFocus: () => {
|
|
3717
|
+
var _triggerRef$current2;
|
|
3718
|
+
return triggerRef === null || triggerRef === void 0 || (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.focus();
|
|
3719
|
+
},
|
|
3655
3720
|
sideOffset: 6,
|
|
3656
3721
|
loop: !isSearchable,
|
|
3657
3722
|
side: side || defaultSide,
|
|
@@ -3664,7 +3729,7 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3664
3729
|
onInteractOutside: onInteractOutside,
|
|
3665
3730
|
style: {
|
|
3666
3731
|
...style,
|
|
3667
|
-
height: internalSearchValue && openPaneDepth === thisPanesDepth ? undefined : maskHeight
|
|
3732
|
+
height: internalSearchValue && openPaneDepth === thisPanesDepth ? undefined : maskHeight !== null && maskHeight !== void 0 ? maskHeight : undefined
|
|
3668
3733
|
}
|
|
3669
3734
|
}), isSearchable && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3670
3735
|
className: classNames__default["default"](styles$4.stickyBox, styles$4.isSearchable),
|
|
@@ -3673,7 +3738,7 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3673
3738
|
className: styles$4.searchBoxesContainer,
|
|
3674
3739
|
style: {
|
|
3675
3740
|
transform,
|
|
3676
|
-
width: flyoutRef.current
|
|
3741
|
+
width: (_flyoutRef$current3 = flyoutRef.current) === null || _flyoutRef$current3 === void 0 ? void 0 : _flyoutRef$current3.clientWidth
|
|
3677
3742
|
}
|
|
3678
3743
|
}, searchBarConfigs.length ? searchBarConfigs.map(_ref2 => {
|
|
3679
3744
|
let {
|
|
@@ -3712,14 +3777,15 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3712
3777
|
} = interactions.useFocusVisible({
|
|
3713
3778
|
isTextInput: true
|
|
3714
3779
|
});
|
|
3715
|
-
const dataTestId = index.getSubDataTestId(menuParentDataTestId
|
|
3780
|
+
const dataTestId = index.getSubDataTestId(menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_ITEM), String(index$1));
|
|
3716
3781
|
const isVisible = React.useMemo(() => {
|
|
3717
|
-
const searchMatcher = label
|
|
3718
|
-
return isSearchFilteringDisabled || !searchValue || searchMatcher
|
|
3782
|
+
const searchMatcher = label !== null && label !== void 0 ? label : typeof children === 'string' ? children : undefined;
|
|
3783
|
+
return isSearchFilteringDisabled || !searchValue || (searchMatcher === null || searchMatcher === void 0 ? void 0 : searchMatcher.toLowerCase().includes(searchValue.toLowerCase()));
|
|
3719
3784
|
}, [children, searchValue, label, isSearchFilteringDisabled]);
|
|
3720
3785
|
const handleFocus = () => {
|
|
3721
3786
|
if (itemRef.current && flyoutRef.current && isFocusVisible) {
|
|
3722
|
-
|
|
3787
|
+
var _stickyBoxRef$current, _stickyBoxRef$current2;
|
|
3788
|
+
const stickyBoxHeight = (_stickyBoxRef$current = (_stickyBoxRef$current2 = stickyBoxRef.current) === null || _stickyBoxRef$current2 === void 0 ? void 0 : _stickyBoxRef$current2.clientHeight) !== null && _stickyBoxRef$current !== void 0 ? _stickyBoxRef$current : 0;
|
|
3723
3789
|
|
|
3724
3790
|
// if the top of the focused menu item is beneath the sticky box
|
|
3725
3791
|
if (itemRef.current.offsetTop < flyoutRef.current.scrollTop + stickyBoxHeight) {
|
|
@@ -3737,20 +3803,19 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3737
3803
|
"data-testid": dataTestId,
|
|
3738
3804
|
ref: index.mergeRefs(ref, itemRef),
|
|
3739
3805
|
onKeyDown: e => {
|
|
3740
|
-
var _context;
|
|
3741
3806
|
if (!isInteractive) {
|
|
3742
3807
|
e.preventDefault();
|
|
3743
3808
|
return;
|
|
3744
3809
|
}
|
|
3745
|
-
if (
|
|
3746
|
-
closeSubmenu
|
|
3810
|
+
if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
3811
|
+
closeSubmenu === null || closeSubmenu === void 0 ? void 0 : closeSubmenu(e);
|
|
3747
3812
|
}
|
|
3748
3813
|
},
|
|
3749
3814
|
onFocus: handleFocus
|
|
3750
3815
|
// stop radix from closing the menu on selection of disabled item
|
|
3751
3816
|
// other pointer and keyboard events still work, even when disabled
|
|
3752
3817
|
,
|
|
3753
|
-
onSelect: e => isDisabled ? e.preventDefault() : onSelect
|
|
3818
|
+
onSelect: e => isDisabled ? e.preventDefault() : onSelect === null || onSelect === void 0 ? void 0 : onSelect()
|
|
3754
3819
|
}), (!children || typeof children === 'string') && label ? label : children) : null;
|
|
3755
3820
|
});
|
|
3756
3821
|
|
|
@@ -3807,12 +3872,9 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3807
3872
|
noSearchResultsNode,
|
|
3808
3873
|
onInteractOutside
|
|
3809
3874
|
} = usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, items, animatedLeft, animatedRight, paneDataTestId, internalId, flyoutRef, backButtonRef, closeThisSubmenu);
|
|
3810
|
-
const backButtonDataTestId = paneDataTestId
|
|
3811
|
-
const triggerDataTestId = paneDataTestId
|
|
3812
|
-
const triggerIsVisible = React.useMemo(() =>
|
|
3813
|
-
var _context;
|
|
3814
|
-
return isSearchFilteringDisabledForPaneContainingTrigger || !paneContainingTriggerSearchValue || typeof label === 'string' && _includesInstanceProperty__default["default"](_context = label.toLowerCase()).call(_context, paneContainingTriggerSearchValue.toLowerCase());
|
|
3815
|
-
}, [paneContainingTriggerSearchValue, label, isSearchFilteringDisabledForPaneContainingTrigger]);
|
|
3875
|
+
const backButtonDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_BACK);
|
|
3876
|
+
const triggerDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_ITEM);
|
|
3877
|
+
const triggerIsVisible = React.useMemo(() => isSearchFilteringDisabledForPaneContainingTrigger || !paneContainingTriggerSearchValue || typeof label === 'string' && label.toLowerCase().includes(paneContainingTriggerSearchValue.toLowerCase()), [paneContainingTriggerSearchValue, label, isSearchFilteringDisabledForPaneContainingTrigger]);
|
|
3816
3878
|
index.useDidUpdate(() => {
|
|
3817
3879
|
if (isPaneInDOM) {
|
|
3818
3880
|
setIsTransitioningFromRight(true);
|
|
@@ -3821,7 +3883,7 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3821
3883
|
window.requestAnimationFrame(() => setIsFrameAfterPaneAddedToDOM(false));
|
|
3822
3884
|
}
|
|
3823
3885
|
registerSubmenu(internalId, isPaneInDOM);
|
|
3824
|
-
onIsOpenChange
|
|
3886
|
+
onIsOpenChange === null || onIsOpenChange === void 0 ? void 0 : onIsOpenChange(isPaneInDOM);
|
|
3825
3887
|
}, [isPaneInDOM]);
|
|
3826
3888
|
|
|
3827
3889
|
// Omitted dependencies because this should only run on unmount
|
|
@@ -3829,7 +3891,8 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3829
3891
|
React.useEffect(() => () => registerSubmenu(internalId, false), []);
|
|
3830
3892
|
index.useDidUpdate(() => {
|
|
3831
3893
|
if (thisPanesDepth === totalOpenPaneDepth) {
|
|
3832
|
-
|
|
3894
|
+
var _flyoutRef$current$cl, _flyoutRef$current;
|
|
3895
|
+
setMaskHeight((_flyoutRef$current$cl = (_flyoutRef$current = flyoutRef.current) === null || _flyoutRef$current === void 0 ? void 0 : _flyoutRef$current.clientHeight) !== null && _flyoutRef$current$cl !== void 0 ? _flyoutRef$current$cl : null);
|
|
3833
3896
|
}
|
|
3834
3897
|
},
|
|
3835
3898
|
// ignoring other dependencies because this should only run when the children change
|
|
@@ -3837,24 +3900,27 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3837
3900
|
index.useDidUpdate(() => {
|
|
3838
3901
|
if (thisPanesDepth === totalOpenPaneDepth) {
|
|
3839
3902
|
window.requestAnimationFrame(() => {
|
|
3840
|
-
|
|
3903
|
+
var _flyoutRef$current$cl2, _flyoutRef$current2;
|
|
3904
|
+
setMaskHeight((_flyoutRef$current$cl2 = (_flyoutRef$current2 = flyoutRef.current) === null || _flyoutRef$current2 === void 0 ? void 0 : _flyoutRef$current2.clientHeight) !== null && _flyoutRef$current$cl2 !== void 0 ? _flyoutRef$current$cl2 : null);
|
|
3841
3905
|
});
|
|
3842
3906
|
}
|
|
3843
3907
|
}, [totalOpenPaneDepth, internalSearchValue]);
|
|
3844
3908
|
const handlePaneTransitionEnd = () => {
|
|
3909
|
+
var _flyoutRef$current3;
|
|
3845
3910
|
if (animatedLeft) {
|
|
3846
3911
|
return;
|
|
3847
3912
|
}
|
|
3848
3913
|
if (animatedRight) {
|
|
3849
3914
|
setIsPaneInDOM(false);
|
|
3850
3915
|
if (isFocusVisible) {
|
|
3851
|
-
|
|
3916
|
+
var _triggerRef$current;
|
|
3917
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
3852
3918
|
}
|
|
3853
3919
|
return;
|
|
3854
3920
|
}
|
|
3855
3921
|
|
|
3856
3922
|
// if the newly closed submenu doesn't place the focus on its trigger due to mouse events
|
|
3857
|
-
if (!flyoutRef.current
|
|
3923
|
+
if (!((_flyoutRef$current3 = flyoutRef.current) !== null && _flyoutRef$current3 !== void 0 && _flyoutRef$current3.contains(document.activeElement)) && isFocusVisible) {
|
|
3858
3924
|
if (triggerRef.current && paneContainingTriggerIsInteractive) {
|
|
3859
3925
|
triggerRef.current.focus();
|
|
3860
3926
|
} else if (backButtonRef.current) {
|
|
@@ -3874,15 +3940,14 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3874
3940
|
ref: triggerRef,
|
|
3875
3941
|
onClick: () => !isDisabled && setIsPaneInDOM(true),
|
|
3876
3942
|
onKeyDown: e => {
|
|
3877
|
-
var _context2, _context3;
|
|
3878
3943
|
if (!paneContainingTriggerIsInteractive) {
|
|
3879
3944
|
e.preventDefault();
|
|
3880
3945
|
return;
|
|
3881
3946
|
}
|
|
3882
|
-
if (!isDisabled &&
|
|
3947
|
+
if (!isDisabled && KEYS.OPEN_SUBMENU.includes(e.key)) {
|
|
3883
3948
|
setIsPaneInDOM(true);
|
|
3884
|
-
} else if (
|
|
3885
|
-
closeSubmenuContainingTrigger
|
|
3949
|
+
} else if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
3950
|
+
closeSubmenuContainingTrigger === null || closeSubmenuContainingTrigger === void 0 ? void 0 : closeSubmenuContainingTrigger(e);
|
|
3886
3951
|
}
|
|
3887
3952
|
}
|
|
3888
3953
|
}, label, /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronRightIcon, {
|
|
@@ -3926,8 +3991,7 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3926
3991
|
onSelect: closeThisSubmenu,
|
|
3927
3992
|
ref: backButtonRef,
|
|
3928
3993
|
onKeyDown: e => {
|
|
3929
|
-
|
|
3930
|
-
if (_includesInstanceProperty__default["default"](_context4 = KEYS.CLOSE_SUBMENU).call(_context4, e.key)) {
|
|
3994
|
+
if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
3931
3995
|
closeThisSubmenu(e);
|
|
3932
3996
|
}
|
|
3933
3997
|
}
|
|
@@ -3937,12 +4001,13 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3937
4001
|
}), label)), noSearchResultsNode, children))) : null;
|
|
3938
4002
|
});
|
|
3939
4003
|
|
|
3940
|
-
var css_248z$2 = ".
|
|
3941
|
-
var styles$2 = {"drawer":"
|
|
3942
|
-
var stylesheet$2=".
|
|
4004
|
+
var css_248z$2 = "._wX-h2{position:absolute;top:0;height:100%;overflow:auto;color:#32363a;background-color:#fff;border-right:1px solid #eee;z-index:1000;padding:12px 20px 20px;transition:left .5s}._E5XJG{visibility:hidden}._0zqnH{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._92828{padding-top:8px}._jodXK{margin-left:12px}";
|
|
4005
|
+
var styles$2 = {"drawer":"_wX-h2","hidden":"_E5XJG","header":"_0zqnH","title":"_92828","closeButton":"_jodXK"};
|
|
4006
|
+
var stylesheet$2="._wX-h2{position:absolute;top:0;height:100%;overflow:auto;color:#32363a;background-color:#fff;border-right:1px solid #eee;z-index:1000;padding:12px 20px 20px;transition:left .5s}._E5XJG{visibility:hidden}._0zqnH{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._92828{padding-top:8px}._jodXK{margin-left:12px}";
|
|
3943
4007
|
icons_index.styleInject(css_248z$2);
|
|
3944
4008
|
|
|
3945
4009
|
const Drawer = _ref => {
|
|
4010
|
+
var _containerRef$current;
|
|
3946
4011
|
let {
|
|
3947
4012
|
id,
|
|
3948
4013
|
isOpen: externalIsOpen,
|
|
@@ -3994,13 +4059,15 @@ const Drawer = _ref => {
|
|
|
3994
4059
|
setIsHidden(false);
|
|
3995
4060
|
setElementUsedToOpenModal(document.activeElement);
|
|
3996
4061
|
} else {
|
|
4062
|
+
var _elementRefToFocusOnC;
|
|
3997
4063
|
setIsClosing(true);
|
|
3998
|
-
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose
|
|
4064
|
+
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 || (_elementRefToFocusOnC = elementRefToFocusOnClose.current) === null || _elementRefToFocusOnC === void 0 ? void 0 : _elementRefToFocusOnC.focus();else elementUsedToOpenModal === null || elementUsedToOpenModal === void 0 ? void 0 : elementUsedToOpenModal.focus();
|
|
3999
4065
|
}
|
|
4000
4066
|
}, [elementRefToFocusOnClose, isOpen]);
|
|
4001
4067
|
React.useEffect(() => {
|
|
4002
4068
|
if (isOpen && !isHidden) {
|
|
4003
|
-
|
|
4069
|
+
var _closeButtonRef$curre;
|
|
4070
|
+
(_closeButtonRef$curre = closeButtonRef.current) === null || _closeButtonRef$curre === void 0 ? void 0 : _closeButtonRef$curre.focus();
|
|
4004
4071
|
}
|
|
4005
4072
|
}, [isOpen, isHidden]);
|
|
4006
4073
|
const handleTransitionEnd = () => {
|
|
@@ -4019,7 +4086,7 @@ const Drawer = _ref => {
|
|
|
4019
4086
|
}),
|
|
4020
4087
|
style: {
|
|
4021
4088
|
width,
|
|
4022
|
-
left:
|
|
4089
|
+
left: "".concat(isHidden || isClosing ? "-".concat(width) : '0'),
|
|
4023
4090
|
zIndex
|
|
4024
4091
|
},
|
|
4025
4092
|
onKeyDown: handleKeyDown,
|
|
@@ -4044,12 +4111,12 @@ const Drawer = _ref => {
|
|
|
4044
4111
|
"aria-label": closeButtonAriaLabel
|
|
4045
4112
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.CloseIcon, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4046
4113
|
"data-testid": index.getSubDataTestId(dataTestId, 'body')
|
|
4047
|
-
}, children))), containerRef
|
|
4114
|
+
}, children))), (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body) : null;
|
|
4048
4115
|
};
|
|
4049
4116
|
|
|
4050
|
-
var css_248z$1 = ".
|
|
4051
|
-
var styles$1 = {"container":"
|
|
4052
|
-
var stylesheet$1=".
|
|
4117
|
+
var css_248z$1 = "._nWBAx{display:inline-block;position:relative}._EpnRq{width:120px}._EpnRq ._iYJNA._-YisB{transform:rotate(-180deg)}._EpnRq ._iYJNA._IaAUa{fill:#9d9fa1;opacity:.4}._PNYtv>input:focus{box-shadow:none!important;border:1px solid #898989!important}._hMk0j{width:120px}._hMk0j ._hQE-K._FwwH7{background-color:#efefef;border-radius:6px}._iYJNA{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._iYJNA._-YisB{transform:rotate(-180deg)}";
|
|
4118
|
+
var styles$1 = {"container":"_nWBAx","input":"_EpnRq","icon":"_iYJNA","open":"_-YisB","disabled":"_IaAUa","ignoreFocusStyle":"_PNYtv","flyout":"_hMk0j","option":"_hQE-K","exactMatch":"_FwwH7"};
|
|
4119
|
+
var stylesheet$1="._nWBAx{display:inline-block;position:relative}._EpnRq{width:120px}._EpnRq ._iYJNA._-YisB{transform:rotate(-180deg)}._EpnRq ._iYJNA._IaAUa{fill:#9d9fa1;opacity:.4}._PNYtv>input:focus{box-shadow:none!important;border:1px solid #898989!important}._hMk0j{width:120px}._hMk0j ._hQE-K._FwwH7{background-color:#efefef;border-radius:6px}._iYJNA{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._iYJNA._-YisB{transform:rotate(-180deg)}";
|
|
4053
4120
|
icons_index.styleInject(css_248z$1);
|
|
4054
4121
|
|
|
4055
4122
|
const TimeDropdown = _ref => {
|
|
@@ -4089,14 +4156,14 @@ const TimeDropdown = _ref => {
|
|
|
4089
4156
|
"aria-label": ariaLabel,
|
|
4090
4157
|
"aria-labelledby": ariaLabelledBy,
|
|
4091
4158
|
"aria-describedby": ariaDescribedBy,
|
|
4092
|
-
"data-testid": dataTestId &&
|
|
4159
|
+
"data-testid": dataTestId && "".concat(dataTestId, "-dropdown"),
|
|
4093
4160
|
className: styles$1.flyout,
|
|
4094
4161
|
onMouseOver: () => setIsOptionHovered(true),
|
|
4095
4162
|
onMouseLeave: () => setIsOptionHovered(false)
|
|
4096
4163
|
}, items.map((item, index$1) => /*#__PURE__*/React__default["default"].createElement(index.FlyoutOption, {
|
|
4097
4164
|
id: item.id,
|
|
4098
4165
|
isHighlightedOnHover: true,
|
|
4099
|
-
isHighlighted: scrolledToItem
|
|
4166
|
+
isHighlighted: (scrolledToItem === null || scrolledToItem === void 0 ? void 0 : scrolledToItem.index) === index$1 && (scrolledToItem === null || scrolledToItem === void 0 ? void 0 : scrolledToItem.isFocused),
|
|
4100
4167
|
key: item.label,
|
|
4101
4168
|
ref: node => {
|
|
4102
4169
|
if (node) {
|
|
@@ -4105,9 +4172,9 @@ const TimeDropdown = _ref => {
|
|
|
4105
4172
|
}
|
|
4106
4173
|
},
|
|
4107
4174
|
onClick: () => onClick(index$1),
|
|
4108
|
-
"data-testid": dataTestId &&
|
|
4175
|
+
"data-testid": dataTestId && "".concat(dataTestId, "-option-").concat(index$1),
|
|
4109
4176
|
className: classNames__default["default"](styles$1.option, {
|
|
4110
|
-
[styles$1.exactMatch]: scrolledToItem
|
|
4177
|
+
[styles$1.exactMatch]: (scrolledToItem === null || scrolledToItem === void 0 ? void 0 : scrolledToItem.index) === index$1 && scrolledToItem.isExactMatch && !isOptionHovered
|
|
4111
4178
|
})
|
|
4112
4179
|
}, item.label))),
|
|
4113
4180
|
anchorNode: inputRef.current,
|
|
@@ -4131,7 +4198,7 @@ const formatUtcDate = (utcDate, is24HourClock) => {
|
|
|
4131
4198
|
const dateWithoutLeadingZeros = format(utcDate);
|
|
4132
4199
|
let dateWithLeadingZeros = dateWithoutLeadingZeros;
|
|
4133
4200
|
if (dateWithLeadingZeros.split(':')[0].length === 1) {
|
|
4134
|
-
dateWithLeadingZeros =
|
|
4201
|
+
dateWithLeadingZeros = "0".concat(dateWithLeadingZeros);
|
|
4135
4202
|
}
|
|
4136
4203
|
return dateWithLeadingZeros.toLowerCase();
|
|
4137
4204
|
};
|
|
@@ -4160,17 +4227,18 @@ const generateTimes = (step, is24HourClock) => {
|
|
|
4160
4227
|
return {
|
|
4161
4228
|
label: labelWithLeadingZeros,
|
|
4162
4229
|
value: i * step,
|
|
4163
|
-
id:
|
|
4230
|
+
id: "time-option-".concat(i)
|
|
4164
4231
|
};
|
|
4165
4232
|
});
|
|
4166
4233
|
};
|
|
4167
4234
|
function getTimeStringCorrector(str, is24HourClock) {
|
|
4235
|
+
var _letterString;
|
|
4168
4236
|
let [numberString, letterString] = str.replace(':', '').split(' ');
|
|
4169
|
-
letterString = letterString
|
|
4237
|
+
letterString = (_letterString = letterString) === null || _letterString === void 0 ? void 0 : _letterString.toLowerCase();
|
|
4170
4238
|
let selectionModifier = 0;
|
|
4171
4239
|
const getTimeString = () => {
|
|
4172
|
-
const finalNumberString =
|
|
4173
|
-
return is24HourClock ? finalNumberString :
|
|
4240
|
+
const finalNumberString = "".concat(numberString.slice(0, 2), ":").concat(numberString.slice(2, 4));
|
|
4241
|
+
return is24HourClock ? finalNumberString : "".concat(finalNumberString, " ").concat(letterString);
|
|
4174
4242
|
};
|
|
4175
4243
|
const getSelectionModifier = () => selectionModifier;
|
|
4176
4244
|
const replaceDashes = () => {
|
|
@@ -4185,36 +4253,24 @@ function getTimeStringCorrector(str, is24HourClock) {
|
|
|
4185
4253
|
}
|
|
4186
4254
|
};
|
|
4187
4255
|
const shiftMinutesRight = () => {
|
|
4188
|
-
numberString =
|
|
4256
|
+
numberString = "".concat(numberString.slice(0, 2), "0").concat(numberString[2]);
|
|
4189
4257
|
selectionModifier += 1;
|
|
4190
4258
|
};
|
|
4191
4259
|
const prependCharacter = character => {
|
|
4192
|
-
numberString =
|
|
4260
|
+
numberString = "".concat(character).concat(numberString);
|
|
4193
4261
|
selectionModifier += 1;
|
|
4194
4262
|
};
|
|
4195
4263
|
const setHoursTo12 = () => {
|
|
4196
|
-
numberString =
|
|
4264
|
+
numberString = "12".concat(numberString.slice(2));
|
|
4197
4265
|
};
|
|
4198
4266
|
const clearSecondHoursDigit = () => {
|
|
4199
|
-
numberString =
|
|
4267
|
+
numberString = "".concat(numberString.slice(0, 1), "0").concat(numberString.slice(2));
|
|
4200
4268
|
};
|
|
4201
4269
|
const hoursAre00 = () => numberString[0] === '0' && numberString[1] === '0';
|
|
4202
|
-
const firstHourGreaterThan1 = () =>
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
const firstHourGreaterThan2 = () => {
|
|
4207
|
-
var _context2;
|
|
4208
|
-
return !_includesInstanceProperty__default["default"](_context2 = '012-').call(_context2, numberString[0]);
|
|
4209
|
-
};
|
|
4210
|
-
const hoursGreaterThan12 = () => {
|
|
4211
|
-
var _context3;
|
|
4212
|
-
return numberString[0] === '1' && !_includesInstanceProperty__default["default"](_context3 = '012-').call(_context3, numberString[1]);
|
|
4213
|
-
};
|
|
4214
|
-
const hoursGreaterThan23 = () => {
|
|
4215
|
-
var _context4;
|
|
4216
|
-
return numberString[0] === '2' && !_includesInstanceProperty__default["default"](_context4 = '0123-').call(_context4, numberString[1]);
|
|
4217
|
-
};
|
|
4270
|
+
const firstHourGreaterThan1 = () => !'01-'.includes(numberString[0]);
|
|
4271
|
+
const firstHourGreaterThan2 = () => !'012-'.includes(numberString[0]);
|
|
4272
|
+
const hoursGreaterThan12 = () => numberString[0] === '1' && !'012-'.includes(numberString[1]);
|
|
4273
|
+
const hoursGreaterThan23 = () => numberString[0] === '2' && !'0123-'.includes(numberString[1]);
|
|
4218
4274
|
const firstMinuteGreaterThan5 = () => numberString[2] !== '-' && +numberString[2] > 5;
|
|
4219
4275
|
const hasTypedMinutes = () => numberString[2] !== '-' && numberString[3] !== '-';
|
|
4220
4276
|
return {
|
|
@@ -4347,7 +4403,7 @@ const TimeInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
4347
4403
|
correctedTime,
|
|
4348
4404
|
selectionModifier
|
|
4349
4405
|
} = correctTime(next.value, is24HourClock, false);
|
|
4350
|
-
const newSelection = next
|
|
4406
|
+
const newSelection = next === null || next === void 0 ? void 0 : next.selection;
|
|
4351
4407
|
if (newSelection) {
|
|
4352
4408
|
const validTimeLength = mask.length;
|
|
4353
4409
|
newSelection.start = shouldMoveSelectionToEnd ? validTimeLength : newSelection.start;
|
|
@@ -4379,7 +4435,7 @@ const TimeInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
4379
4435
|
"aria-labelledby": ariaLabelledBy,
|
|
4380
4436
|
"aria-describedby": ariaDescribedBy,
|
|
4381
4437
|
"aria-activedescendant": ariaActiveDescendant,
|
|
4382
|
-
"data-testid": dataTestId &&
|
|
4438
|
+
"data-testid": dataTestId && "".concat(dataTestId, "-input")
|
|
4383
4439
|
}));
|
|
4384
4440
|
});
|
|
4385
4441
|
|
|
@@ -4400,8 +4456,9 @@ const TimePickerIcon = _ref => {
|
|
|
4400
4456
|
})
|
|
4401
4457
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronDownIcon, {
|
|
4402
4458
|
onClick: !isDisabled ? () => {
|
|
4459
|
+
var _inputRef$current;
|
|
4403
4460
|
setIsFlyoutOpen(i => !i);
|
|
4404
|
-
inputRef.current
|
|
4461
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
4405
4462
|
} : undefined,
|
|
4406
4463
|
onMouseDown: e => e.preventDefault(),
|
|
4407
4464
|
ref: iconRef
|
|
@@ -4431,8 +4488,8 @@ const TimePicker = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
4431
4488
|
'aria-describedby': ariaDescribedBy
|
|
4432
4489
|
} = _ref;
|
|
4433
4490
|
const timePickerId = index.useId(externalId);
|
|
4434
|
-
const inputId =
|
|
4435
|
-
const dropdownId =
|
|
4491
|
+
const inputId = "".concat(timePickerId, "-input");
|
|
4492
|
+
const dropdownId = "".concat(timePickerId, "-dropdown");
|
|
4436
4493
|
const [isOptionHovered, setIsOptionHovered] = React.useState(false);
|
|
4437
4494
|
const [timeObject, setTimeObject] = index.useControllableState(DEFAULT_TIME, externalOnChange, externalValue);
|
|
4438
4495
|
const defaultTimeString = convertTimeObjectToTimeString(timeObject, is24HourClock);
|
|
@@ -4561,7 +4618,7 @@ const TimePicker = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
4561
4618
|
break;
|
|
4562
4619
|
case 'Enter':
|
|
4563
4620
|
e.preventDefault();
|
|
4564
|
-
if (scrolledToItem
|
|
4621
|
+
if (scrolledToItem !== null && scrolledToItem !== void 0 && scrolledToItem.isFocused) {
|
|
4565
4622
|
// "focus" is on the listbox
|
|
4566
4623
|
handleSelectTime(scrolledToItem.index);
|
|
4567
4624
|
} else {
|
|
@@ -4584,7 +4641,7 @@ const TimePicker = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
4584
4641
|
}, /*#__PURE__*/React__default["default"].createElement(TimeInput, {
|
|
4585
4642
|
id: inputId,
|
|
4586
4643
|
dataTestId: dataTestId,
|
|
4587
|
-
ariaActiveDescendant: isFlyoutOpen && scrolledToItem
|
|
4644
|
+
ariaActiveDescendant: isFlyoutOpen && scrolledToItem !== null && scrolledToItem !== void 0 && scrolledToItem.isFocused ? dropdownItems[scrolledToItem.index].id : undefined,
|
|
4588
4645
|
ariaControls: dropdownId,
|
|
4589
4646
|
ariaExpanded: isFlyoutOpen,
|
|
4590
4647
|
onChange: handleType,
|
|
@@ -4628,9 +4685,9 @@ const {
|
|
|
4628
4685
|
Provider: ToggleButtonGroupContextProvider
|
|
4629
4686
|
} = index.createContextUtilities(null);
|
|
4630
4687
|
|
|
4631
|
-
var css_248z = ".
|
|
4632
|
-
var styles = {"default":"
|
|
4633
|
-
var stylesheet=".
|
|
4688
|
+
var css_248z = "._YvWWd{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._EY2KA{background-color:rgba(50,54,58,.08)}._4Pqe3{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._EawKn{color:rgba(81,85,89,.4);cursor:not-allowed}._Hxnmt{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._peqfD{color:#085caf;border-color:#085caf}._GONTP,._peqfD{background:rgba(11,110,208,.11)}._GONTP{color:#0854a1;border-color:#0854a1}._55QcY{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._HpTE1{position:relative;display:inline-grid}._HpTE1 svg{fill:currentColor}._HpTE1 ._TjE10{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._HpTE1 ._TjE10+._xNZUc{background-color:transparent;color:#515559;cursor:pointer;border:1px solid transparent;border-radius:4px;grid-column:1;grid-row:1;padding:0;min-width:76px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._HpTE1 ._TjE10+._xNZUc._hJ3Q4{padding:5px;max-width:36px;min-width:36px}._HpTE1 ._TjE10+._xNZUc._xM147{padding:0 16px}._HpTE1 ._TjE10+._xNZUc._5Z9XO{padding:0 16px 0 12px}._HpTE1 ._TjE10:hover+._xNZUc{background-color:rgba(50,54,58,.08)}._HpTE1 ._TjE10:disabled+._xNZUc{color:rgba(81,85,89,.4);cursor:not-allowed}._HpTE1 ._TjE10:active+._xNZUc,._HpTE1 ._TjE10:focus:active+._xNZUc{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._HpTE1 ._TjE10:checked+._xNZUc{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._HpTE1 ._TjE10:checked:hover+._xNZUc{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._HpTE1 ._TjE10:checked:disabled+._xNZUc{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._HpTE1 ._TjE10:checked:active+._xNZUc,._HpTE1 ._TjE10:checked:focus:active+._xNZUc{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._4ty9-{display:inline-flex;position:relative}._4ty9-:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._4ty9->*{flex-shrink:0;flex-grow:0}._AHOSg{border:none;margin:0;padding:0}._AHOSg legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._HpTE1 ._TjE10.focus-visible+._xNZUc,._HpTE1 ._TjE10:focus-visible+._xNZUc{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4689
|
+
var styles = {"default":"_YvWWd","hovered":"_EY2KA","pressed":"_4Pqe3","disabled":"_EawKn","selectedDefault":"_Hxnmt","selectedHovered":"_peqfD","selectedPressed":"_GONTP","selectedDisabled":"_55QcY","toggleContainer":"_HpTE1","toggleInput":"_TjE10","toggleButton":"_xNZUc","iconOnly":"_hJ3Q4","text":"_xM147","iconText":"_5Z9XO","toggleButtonGroup":"_4ty9-","toggleButtonGroupFieldset":"_AHOSg"};
|
|
4690
|
+
var stylesheet="._YvWWd{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._EY2KA{background-color:rgba(50,54,58,.08)}._4Pqe3{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._EawKn{color:rgba(81,85,89,.4);cursor:not-allowed}._Hxnmt{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._peqfD{color:#085caf;border-color:#085caf}._GONTP,._peqfD{background:rgba(11,110,208,.11)}._GONTP{color:#0854a1;border-color:#0854a1}._55QcY{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._HpTE1{position:relative;display:inline-grid}._HpTE1 svg{fill:currentColor}._HpTE1 ._TjE10{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._HpTE1 ._TjE10+._xNZUc{background-color:transparent;color:#515559;cursor:pointer;border:1px solid transparent;border-radius:4px;grid-column:1;grid-row:1;padding:0;min-width:76px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._HpTE1 ._TjE10+._xNZUc._hJ3Q4{padding:5px;max-width:36px;min-width:36px}._HpTE1 ._TjE10+._xNZUc._xM147{padding:0 16px}._HpTE1 ._TjE10+._xNZUc._5Z9XO{padding:0 16px 0 12px}._HpTE1 ._TjE10:hover+._xNZUc{background-color:rgba(50,54,58,.08)}._HpTE1 ._TjE10:disabled+._xNZUc{color:rgba(81,85,89,.4);cursor:not-allowed}._HpTE1 ._TjE10:active+._xNZUc,._HpTE1 ._TjE10:focus:active+._xNZUc{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._HpTE1 ._TjE10:checked+._xNZUc{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._HpTE1 ._TjE10:checked:hover+._xNZUc{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._HpTE1 ._TjE10:checked:disabled+._xNZUc{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._HpTE1 ._TjE10:checked:active+._xNZUc,._HpTE1 ._TjE10:checked:focus:active+._xNZUc{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._4ty9-{display:inline-flex;position:relative}._4ty9-:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._4ty9->*{flex-shrink:0;flex-grow:0}._AHOSg{border:none;margin:0;padding:0}._AHOSg legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._HpTE1 ._TjE10.focus-visible+._xNZUc,._HpTE1 ._TjE10:focus-visible+._xNZUc{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4634
4691
|
icons_index.styleInject(css_248z);
|
|
4635
4692
|
|
|
4636
4693
|
const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|