@qualtrics/ui-react 2.24.2 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/__shared/cjs/{index-8f52588d.js → index-ae6df097.js} +3 -3
- package/dist/__shared/cjs/{index-b7a35c2e.js → index-dc6f69ac.js} +262 -256
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +1 -1
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/Hue.js +1 -1
- package/dist/components/ColorPicker/Palette.js +1 -1
- package/dist/components/ColorPicker/Saturation.js +1 -1
- package/dist/components/Combobox/Combobox.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxIcon.js +1 -1
- package/dist/components/Combobox/ComboboxInput.js +1 -1
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown.js +4 -4
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +6 -6
- package/dist/components/Dropdown/DropdownList.js +1 -1
- package/dist/components/Dropdown/DropdownOption.js +2 -2
- package/dist/components/Dropdown/DropdownSearch.js +2 -2
- package/dist/components/FilePicker/FilePicker.js +2 -2
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +2 -2
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +7 -7
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- 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/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor.js +1 -1
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal.js +6 -6
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +3 -3
- 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 +3 -3
- package/dist/components/NumberStepper/NumberStepper.js +2 -2
- 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 +3 -3
- package/dist/components/Pagination/PaginationPageInput.js +8 -8
- package/dist/components/Pagination/PaginationPreviousButton.js +3 -3
- package/dist/components/Popover/Popover.js +5 -5
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +4 -4
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +2 -2
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +1 -1
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/Alpha.js +2 -2
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +1 -1
- 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 +2 -2
- package/dist/components/deprecated_ColorPicker/Saturation.js +2 -2
- package/dist/components/deprecated_ColorPicker/Swatch.js +1 -1
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +1 -1
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +5 -5
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +3 -3
- package/dist/hooks/useControllableState/useControllableState.js +1 -1
- package/dist/hooks/useOverlay/useOverlay.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +1 -1
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.es.js +2 -1
- package/dist/index.js +4 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +8 -6
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -4
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +6 -3
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +2 -2
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox.js +2 -0
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxInput.js +2 -0
- package/dist/next/Combobox/ComboboxOption.js +2 -0
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +1 -1
- package/dist/next/Drawer/Drawer.js +2 -2
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +2 -2
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/{useCSSVariable.js → Hooks/useCSSVariable.js} +1 -1
- package/dist/next/Menu/Hooks/useFocusVirtualBoundary.js +41 -0
- package/dist/next/Menu/Hooks/useIsVirtualized.js +8 -0
- package/dist/next/Menu/Hooks/useMaskDimensions.js +59 -0
- package/dist/next/Menu/{useMutationObserver.js → Hooks/useMutationObserver.js} +1 -1
- package/dist/next/Menu/{usePaneSearch.js → Hooks/usePaneSearch.js} +76 -34
- package/dist/next/Menu/Menu.js +22 -24
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +5 -2
- package/dist/next/Menu/MenuContext.js +5 -1
- package/dist/next/Menu/MenuItem.js +38 -16
- package/dist/next/Menu/MenuPane.js +90 -55
- package/dist/next/Menu/PaneChildren.js +47 -0
- package/dist/next/Menu/SubMenu.js +95 -49
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select.js +118 -0
- package/dist/next/Select/Select2.js +8 -0
- package/dist/next/Select/SelectButton.js +46 -0
- package/dist/next/Select/SelectContext.js +16 -0
- package/dist/next/Select/SelectItem.js +46 -0
- package/dist/next/Select/SelectPane.js +43 -0
- package/dist/next/Select/SelectedItems.js +45 -0
- package/dist/next/Select/SubSelect.js +90 -0
- package/dist/next/Select/constants.js +13 -0
- package/dist/next/Select/index.js +5 -0
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +1 -1
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +68 -6
- package/dist/next/index.es.js +6 -0
- package/dist/next/index.js +1009 -372
- package/dist/translations-en.js +7 -1
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +2 -2
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -1
- package/dist/utils/wrapEvent/wrapEvent.js +1 -1
- package/icons/package.json +2 -0
- package/next/package.json +3 -1
- package/package.json +6 -3
package/dist/next/index.js
CHANGED
|
@@ -8,12 +8,14 @@ var classNames = require('classnames');
|
|
|
8
8
|
var reactDnd = require('react-dnd');
|
|
9
9
|
var reactDndHtml5Backend = require('react-dnd-html5-backend');
|
|
10
10
|
var useResizeObserver = require('@react-hook/resize-observer');
|
|
11
|
-
var index = require('../__shared/cjs/index-
|
|
12
|
-
var icons_index = require('../__shared/cjs/index-
|
|
11
|
+
var index = require('../__shared/cjs/index-dc6f69ac.js');
|
|
12
|
+
var icons_index = require('../__shared/cjs/index-ae6df097.js');
|
|
13
13
|
var libphonenumberJs = require('libphonenumber-js');
|
|
14
14
|
var InputMask = require('react-input-mask');
|
|
15
15
|
var reactDropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
16
|
+
var resizeObserver = require('@juggle/resize-observer');
|
|
16
17
|
var interactions = require('@react-aria/interactions');
|
|
18
|
+
var reactVirtuoso = require('react-virtuoso');
|
|
17
19
|
var ReactDOM = require('react-dom');
|
|
18
20
|
require('react-popper');
|
|
19
21
|
require('@popperjs/core');
|
|
@@ -30,10 +32,10 @@ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
|
30
32
|
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
|
|
31
33
|
var InputMask__default = /*#__PURE__*/_interopDefaultLegacy(InputMask);
|
|
32
34
|
|
|
33
|
-
var css_248z$
|
|
34
|
-
var styles$
|
|
35
|
-
var stylesheet$
|
|
36
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
35
|
+
var css_248z$b = "._SBChp{overflow:auto;position:relative;max-width:100%;max-height:100%}._4yxRr,._SBChp{background-color:#fff}._4yxRr{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._7GNgP{margin-bottom:4px}._uYqKM{position:-webkit-sticky;position:sticky;top:0;z-index:100}._shHru{display:flex}._shHru:focus{outline:none}._shHru.focus-visible ._GcHx2:after,._shHru:focus-visible ._GcHx2: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}._shHru.focus-visible ._GcHx2:last-of-type:after,._shHru:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._shHru.focus-visible ._GcHx2:first-of-type:after,._shHru:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._shHru.focus-visible ._GcHx2._TgB9f:after,._shHru:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:1px}._PfnXR{padding-right:3px}._Gw8n4{display:flex}._Gw8n4._iiODk ._GcHx2,._Gw8n4._iiODk ._NtX2d{cursor:pointer}._Gw8n4._fN7xs ._GcHx2,._Gw8n4._fN7xs ._NtX2d{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._Gw8n4._fN7xs ._GcHx2._TgB9f,._Gw8n4._fN7xs ._NtX2d._TgB9f{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._Gw8n4._fN7xs ._GcHx2._TgB9f ._5S6qD,._Gw8n4._fN7xs ._GcHx2._TgB9f ._NtX2d,._Gw8n4._fN7xs ._GcHx2._TgB9f ._YNW7C,._Gw8n4._fN7xs ._NtX2d._TgB9f ._5S6qD,._Gw8n4._fN7xs ._NtX2d._TgB9f ._NtX2d,._Gw8n4._fN7xs ._NtX2d._TgB9f ._YNW7C{background-color:rgba(11,110,208,.08)}._Gw8n4._iiODk:hover:not(._fN7xs) ._GcHx2,._Gw8n4._iiODk:hover:not(._fN7xs) ._NtX2d{background-color:#f9f9f9}._Gw8n4._iiODk:active:not(._fN7xs)[\\:not-has\\(._YNW7C\\:active\\)] ._GcHx2,._Gw8n4._iiODk:active:not(._fN7xs)[\\:not-has\\(._YNW7C\\:active\\)] ._NtX2d{background-color:#f3f3f3}._Gw8n4._iiODk:active:not(._fN7xs):not(._Gw8n4._iiODk:active:not(._fN7xs):has(._YNW7C:active)) ._GcHx2,._Gw8n4._iiODk:active:not(._fN7xs):not(._Gw8n4._iiODk:active:not(._fN7xs):has(._YNW7C:active)) ._NtX2d{background-color:#f3f3f3}._Gw8n4:focus{outline:none}._Gw8n4.focus-visible ._GcHx2:after,._Gw8n4:focus-visible ._GcHx2: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}._Gw8n4.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:0}._Gw8n4:last-of-type:focus{outline:none}._Gw8n4:last-of-type.focus-visible ._GcHx2:after,._Gw8n4:last-of-type:focus-visible ._GcHx2: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}._Gw8n4:last-of-type.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:last-of-type:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4:last-of-type.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:last-of-type:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4:last-of-type.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:last-of-type:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:1px}._Gw8n4:last-of-type ._5S6qD:focus{outline:none}._Gw8n4:last-of-type ._5S6qD._dvyxH.focus-visible:after,._Gw8n4:last-of-type ._5S6qD._dvyxH:focus-visible:after,._Gw8n4:last-of-type ._5S6qD.focus-visible:after,._Gw8n4:last-of-type ._5S6qD: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}._Gw8n4:first-of-type:focus{outline:none}._Gw8n4:first-of-type.focus-visible ._GcHx2:after,._Gw8n4:first-of-type:focus-visible ._GcHx2: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}._Gw8n4:first-of-type.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:first-of-type:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4:first-of-type.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:first-of-type:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4:first-of-type.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:first-of-type:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:0}._Gw8n4:first-of-type ._5S6qD:focus{outline:none}._Gw8n4:first-of-type ._5S6qD._dvyxH.focus-visible:after,._Gw8n4:first-of-type ._5S6qD._dvyxH:focus-visible:after,._Gw8n4:first-of-type ._5S6qD.focus-visible:after,._Gw8n4:first-of-type ._5S6qD: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}._HZ55p{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}._HZ55p._xtIyi{flex-grow:1}._HZ55p._2qgRf{cursor:pointer}._HZ55p._2qgRf:hover:not(._Xo7-J){background-color:#f9f9f9;border-bottom-color:#6a6d70}._HZ55p._2qgRf:active:not(._Xo7-J){background-color:#f3f3f3}._HZ55p._MK4qy:not(._Xo7-J){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._HZ55p._Xo7-J{cursor:move;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._HZ55p ._11-6n{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._HZ55p ._11-6n._JFjBF{left:-1px}._HZ55p ._11-6n._-MXDd{right:0}._HZ55p ._M8d1f{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._HZ55p ._M8d1f._JFjBF{left:-2px}._HZ55p ._M8d1f._-MXDd{right:-1px}._HZ55p:first-of-type ._JFjBF._11-6n{left:0;width:2px;border-left:1px solid #fff}._HZ55p:first-of-type ._JFjBF._M8d1f{left:0}._HZ55p:last-of-type ._-MXDd._11-6n{right:0;width:2px;border-right:1px solid #fff}._HZ55p:last-of-type ._-MXDd._M8d1f{right:0}._HZ55p ._fmM71{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._HZ55p ._fmM71 ._fZa1H{position:absolute;width:2px;right:2px;top:0;bottom:0}._HZ55p ._fmM71 ._fZa1H._yRsEd{background-color:#0a6ed1}._HZ55p ._fmM71:hover ._fZa1H:not(._yRsEd){background-color:#d9d9d9}._HZ55p ._4lZ3k{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 0 13px 12px}._HZ55p ._4lZ3k._uuaHr{flex-direction:row-reverse;justify-content:flex-start}._HZ55p ._4lZ3k._uuaHr ._2rftT{margin:1px 7px 1px 1px}._HZ55p ._4lZ3k ._tJJDS{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._HZ55p ._4lZ3k ._2rftT{margin:1px 1px 1px 7px;flex-shrink:0}._HZ55p ._EzumA{margin-left:6px;margin-right:4px;flex-shrink:0}._HZ55p ._gJP1I{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._HZ55p:focus{outline:none}._HZ55p._dvyxH.focus-visible:after,._HZ55p._dvyxH:focus-visible:after,._HZ55p.focus-visible:after,._HZ55p: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}._-TaB-{margin-right:6px}._TgB9f{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._TgB9f[focus-within]{z-index:30}._TgB9f:focus-within{z-index:30}._5S6qD{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}._5S6qD ._2aAnH{width:100%;padding:12px 12px 11px;overflow:hidden}._5S6qD._Xo7-J{background-color:#efefef;border-bottom-color:#dfdfe1}._5S6qD._xtIyi{flex-grow:1}._5S6qD:focus{outline:none}._5S6qD._dvyxH.focus-visible:after,._5S6qD._dvyxH:focus-visible:after,._5S6qD.focus-visible:after,._5S6qD: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}._NtX2d{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0}._NtX2d._IrKSf{border-bottom-color:#d9d9d9;background-color:#fff}._YNW7C{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}._YNW7C._IrKSf{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._YNW7C:focus input~span,._YNW7C:hover input~span{border-color:#0b6ed0}._YNW7C ._o-lZf{position:relative;display:inline-flex}._YNW7C ._o-lZf ._fvnVI{margin:0!important}._YNW7C ._o-lZf ._VdAXm{position:absolute;top:3px;left:3px;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._24gHY{justify-content:flex-start}._g9po0{justify-content:center;text-align:center}._uuaHr{justify-content:flex-end;text-align:right}._ROk3J{display:none}._d3-U1{opacity:0;height:0;width:0;overflow:hidden}._d3-U1,._duxuJ{position:absolute}._duxuJ{cursor:move;background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000;pointer-events:none}._lW-5O{max-width:250px;min-width:150px!important}";
|
|
36
|
+
var styles$b = {"advancedTable":"_SBChp","advancedTablePaginationContainer":"_4yxRr","advancedTablePagination":"_7GNgP","advancedTableColumnHeadersRowGroup":"_uYqKM","advancedTableColumnHeaders":"_shHru","advancedTableRowChild":"_GcHx2","pinnedContainer":"_TgB9f","advancedTableRowGroup":"_PfnXR","advancedTableRow":"_Gw8n4","hasRowAction":"_iiODk","advancedTableExpandRowSpacer":"_NtX2d","isSelected":"_fN7xs","advancedTableCheckbox":"_YNW7C","advancedTableCell":"_5S6qD","showFocusRing":"_dvyxH","advancedTableColumnHeader":"_HZ55p","fillRemainingSpace":"_xtIyi","isSortable":"_2qgRf","isDragging":"_Xo7-J","isSorted":"_MK4qy","dropTargetLine":"_11-6n","dropTargetLeft":"_JFjBF","dropTargetRight":"_-MXDd","dropTargetMarker":"_M8d1f","resizeHandle":"_fmM71","resizeLine":"_fZa1H","isResizing":"_yRsEd","advancedTableColumnHeaderLabel":"_4lZ3k","rightAligned":"_uuaHr","sortIcon":"_2rftT","advancedTableColumnHeaderLabelText":"_tJJDS","advancedTableColumnHeaderMenu":"_EzumA","advancedTableColumnHeaderMenuHiddenAnchor":"_gJP1I","advancedTableColumnHeaderMenuItemIcon":"_-TaB-","advancedTableCellContainer":"_2aAnH","header":"_IrKSf","checkboxContainer":"_o-lZf","checkbox":"_fvnVI","mixed":"_VdAXm","leftAligned":"_24gHY","centerAligned":"_g9po0","hiddenDescription":"_ROk3J","hiddenLiveRegion":"_d3-U1","dragPreview":"_duxuJ","rowActionMenuPane":"_lW-5O"};
|
|
37
|
+
var stylesheet$b="._SBChp{overflow:auto;position:relative;max-width:100%;max-height:100%}._4yxRr,._SBChp{background-color:#fff}._4yxRr{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._7GNgP{margin-bottom:4px}._uYqKM{position:-webkit-sticky;position:sticky;top:0;z-index:100}._shHru{display:flex}._shHru:focus{outline:none}._shHru.focus-visible ._GcHx2:after,._shHru:focus-visible ._GcHx2: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}._shHru.focus-visible ._GcHx2:last-of-type:after,._shHru:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._shHru.focus-visible ._GcHx2:first-of-type:after,._shHru:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._shHru.focus-visible ._GcHx2._TgB9f:after,._shHru:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:1px}._PfnXR{padding-right:3px}._Gw8n4{display:flex}._Gw8n4._iiODk ._GcHx2,._Gw8n4._iiODk ._NtX2d{cursor:pointer}._Gw8n4._fN7xs ._GcHx2,._Gw8n4._fN7xs ._NtX2d{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._Gw8n4._fN7xs ._GcHx2._TgB9f,._Gw8n4._fN7xs ._NtX2d._TgB9f{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._Gw8n4._fN7xs ._GcHx2._TgB9f ._5S6qD,._Gw8n4._fN7xs ._GcHx2._TgB9f ._NtX2d,._Gw8n4._fN7xs ._GcHx2._TgB9f ._YNW7C,._Gw8n4._fN7xs ._NtX2d._TgB9f ._5S6qD,._Gw8n4._fN7xs ._NtX2d._TgB9f ._NtX2d,._Gw8n4._fN7xs ._NtX2d._TgB9f ._YNW7C{background-color:rgba(11,110,208,.08)}._Gw8n4._iiODk:hover:not(._fN7xs) ._GcHx2,._Gw8n4._iiODk:hover:not(._fN7xs) ._NtX2d{background-color:#f9f9f9}._Gw8n4._iiODk:active:not(._fN7xs)[\\:not-has\\(._YNW7C\\:active\\)] ._GcHx2,._Gw8n4._iiODk:active:not(._fN7xs)[\\:not-has\\(._YNW7C\\:active\\)] ._NtX2d{background-color:#f3f3f3}._Gw8n4._iiODk:active:not(._fN7xs):not(._Gw8n4._iiODk:active:not(._fN7xs):has(._YNW7C:active)) ._GcHx2,._Gw8n4._iiODk:active:not(._fN7xs):not(._Gw8n4._iiODk:active:not(._fN7xs):has(._YNW7C:active)) ._NtX2d{background-color:#f3f3f3}._Gw8n4:focus{outline:none}._Gw8n4.focus-visible ._GcHx2:after,._Gw8n4:focus-visible ._GcHx2: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}._Gw8n4.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:0}._Gw8n4:last-of-type:focus{outline:none}._Gw8n4:last-of-type.focus-visible ._GcHx2:after,._Gw8n4:last-of-type:focus-visible ._GcHx2: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}._Gw8n4:last-of-type.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:last-of-type:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4:last-of-type.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:last-of-type:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4:last-of-type.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:last-of-type:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:1px}._Gw8n4:last-of-type ._5S6qD:focus{outline:none}._Gw8n4:last-of-type ._5S6qD._dvyxH.focus-visible:after,._Gw8n4:last-of-type ._5S6qD._dvyxH:focus-visible:after,._Gw8n4:last-of-type ._5S6qD.focus-visible:after,._Gw8n4:last-of-type ._5S6qD: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}._Gw8n4:first-of-type:focus{outline:none}._Gw8n4:first-of-type.focus-visible ._GcHx2:after,._Gw8n4:first-of-type:focus-visible ._GcHx2: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}._Gw8n4:first-of-type.focus-visible ._GcHx2:last-of-type:after,._Gw8n4:first-of-type:focus-visible ._GcHx2:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._Gw8n4:first-of-type.focus-visible ._GcHx2:first-of-type:after,._Gw8n4:first-of-type:focus-visible ._GcHx2:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._Gw8n4:first-of-type.focus-visible ._GcHx2._TgB9f:after,._Gw8n4:first-of-type:focus-visible ._GcHx2._TgB9f:after{right:-3px;bottom:0}._Gw8n4:first-of-type ._5S6qD:focus{outline:none}._Gw8n4:first-of-type ._5S6qD._dvyxH.focus-visible:after,._Gw8n4:first-of-type ._5S6qD._dvyxH:focus-visible:after,._Gw8n4:first-of-type ._5S6qD.focus-visible:after,._Gw8n4:first-of-type ._5S6qD: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}._HZ55p{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}._HZ55p._xtIyi{flex-grow:1}._HZ55p._2qgRf{cursor:pointer}._HZ55p._2qgRf:hover:not(._Xo7-J){background-color:#f9f9f9;border-bottom-color:#6a6d70}._HZ55p._2qgRf:active:not(._Xo7-J){background-color:#f3f3f3}._HZ55p._MK4qy:not(._Xo7-J){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._HZ55p._Xo7-J{cursor:move;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._HZ55p ._11-6n{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._HZ55p ._11-6n._JFjBF{left:-1px}._HZ55p ._11-6n._-MXDd{right:0}._HZ55p ._M8d1f{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._HZ55p ._M8d1f._JFjBF{left:-2px}._HZ55p ._M8d1f._-MXDd{right:-1px}._HZ55p:first-of-type ._JFjBF._11-6n{left:0;width:2px;border-left:1px solid #fff}._HZ55p:first-of-type ._JFjBF._M8d1f{left:0}._HZ55p:last-of-type ._-MXDd._11-6n{right:0;width:2px;border-right:1px solid #fff}._HZ55p:last-of-type ._-MXDd._M8d1f{right:0}._HZ55p ._fmM71{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._HZ55p ._fmM71 ._fZa1H{position:absolute;width:2px;right:2px;top:0;bottom:0}._HZ55p ._fmM71 ._fZa1H._yRsEd{background-color:#0a6ed1}._HZ55p ._fmM71:hover ._fZa1H:not(._yRsEd){background-color:#d9d9d9}._HZ55p ._4lZ3k{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 0 13px 12px}._HZ55p ._4lZ3k._uuaHr{flex-direction:row-reverse;justify-content:flex-start}._HZ55p ._4lZ3k._uuaHr ._2rftT{margin:1px 7px 1px 1px}._HZ55p ._4lZ3k ._tJJDS{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._HZ55p ._4lZ3k ._2rftT{margin:1px 1px 1px 7px;flex-shrink:0}._HZ55p ._EzumA{margin-left:6px;margin-right:4px;flex-shrink:0}._HZ55p ._gJP1I{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._HZ55p:focus{outline:none}._HZ55p._dvyxH.focus-visible:after,._HZ55p._dvyxH:focus-visible:after,._HZ55p.focus-visible:after,._HZ55p: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}._-TaB-{margin-right:6px}._TgB9f{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._TgB9f[focus-within]{z-index:30}._TgB9f:focus-within{z-index:30}._5S6qD{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}._5S6qD ._2aAnH{width:100%;padding:12px 12px 11px;overflow:hidden}._5S6qD._Xo7-J{background-color:#efefef;border-bottom-color:#dfdfe1}._5S6qD._xtIyi{flex-grow:1}._5S6qD:focus{outline:none}._5S6qD._dvyxH.focus-visible:after,._5S6qD._dvyxH:focus-visible:after,._5S6qD.focus-visible:after,._5S6qD: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}._NtX2d{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0}._NtX2d._IrKSf{border-bottom-color:#d9d9d9;background-color:#fff}._YNW7C{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}._YNW7C._IrKSf{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._YNW7C:focus input~span,._YNW7C:hover input~span{border-color:#0b6ed0}._YNW7C ._o-lZf{position:relative;display:inline-flex}._YNW7C ._o-lZf ._fvnVI{margin:0!important}._YNW7C ._o-lZf ._VdAXm{position:absolute;top:3px;left:3px;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._24gHY{justify-content:flex-start}._g9po0{justify-content:center;text-align:center}._uuaHr{justify-content:flex-end;text-align:right}._ROk3J{display:none}._d3-U1{opacity:0;height:0;width:0;overflow:hidden}._d3-U1,._duxuJ{position:absolute}._duxuJ{cursor:move;background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000;pointer-events:none}._lW-5O{max-width:250px;min-width:150px!important}";
|
|
38
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$b);}
|
|
37
39
|
|
|
38
40
|
// TODO: Move the imported types into this file to avoid a ciruclar dependency warning.
|
|
39
41
|
// Also Alignment, etc can be defined directly and have AdvancedTableColumnConfig use them instead of the reverse like now.
|
|
@@ -87,13 +89,13 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
87
89
|
var _columnHeaderRef$curr;
|
|
88
90
|
e.preventDefault(); // prevents SelectMenu value from changing
|
|
89
91
|
setIsOpen(false);
|
|
90
|
-
(_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0
|
|
91
|
-
onSelect === null || onSelect === void 0
|
|
92
|
+
(_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 || _columnHeaderRef$curr.focus();
|
|
93
|
+
onSelect === null || onSelect === void 0 || onSelect();
|
|
92
94
|
},
|
|
93
95
|
"date-testid": menuItemDataTestId
|
|
94
96
|
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
95
97
|
size: "small",
|
|
96
|
-
className: styles$
|
|
98
|
+
className: styles$b.advancedTableColumnHeaderMenuItemIcon,
|
|
97
99
|
"aria-hidden": "true"
|
|
98
100
|
}), label);
|
|
99
101
|
};
|
|
@@ -145,7 +147,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
145
147
|
"data-testid": index.getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index$1, "-").concat(SortDirections.Ascending))
|
|
146
148
|
}, /*#__PURE__*/React__default["default"].createElement(AscendingIconComponent, {
|
|
147
149
|
size: "small",
|
|
148
|
-
className: styles$
|
|
150
|
+
className: styles$b.advancedTableColumnHeaderMenuItemIcon,
|
|
149
151
|
"aria-hidden": "true"
|
|
150
152
|
}), ascendingLabel), /*#__PURE__*/React__default["default"].createElement(index.MenuItem, {
|
|
151
153
|
key: descendingValue,
|
|
@@ -154,7 +156,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
154
156
|
"data-testid": index.getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index$1, "-").concat(SortDirections.Descending))
|
|
155
157
|
}, /*#__PURE__*/React__default["default"].createElement(DescendingIconComponent, {
|
|
156
158
|
size: "small",
|
|
157
|
-
className: styles$
|
|
159
|
+
className: styles$b.advancedTableColumnHeaderMenuItemIcon,
|
|
158
160
|
"aria-hidden": "true"
|
|
159
161
|
}), descendingLabel)];
|
|
160
162
|
}), (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (onIsPinnedChange || onMoveLeft || onMoveRight) && /*#__PURE__*/React__default["default"].createElement(index.Divider, null), pinItem, onMoveLeft && getActionMenuItem({
|
|
@@ -403,7 +405,7 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
403
405
|
const selectedSortIcon = isSorted ? /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
404
406
|
"aria-hidden": "true",
|
|
405
407
|
focusable: "false",
|
|
406
|
-
className: styles$
|
|
408
|
+
className: styles$b.sortIcon,
|
|
407
409
|
width: "10",
|
|
408
410
|
height: "10",
|
|
409
411
|
viewBox: "0 0 10 10",
|
|
@@ -454,7 +456,7 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
454
456
|
const newWidth = Math.max(80, ((_columnHeaderRef$curr2 = columnHeaderRef.current) === null || _columnHeaderRef$curr2 === void 0 ? void 0 : _columnHeaderRef$curr2.getBoundingClientRect().width) - 10);
|
|
455
457
|
onWidthChange(newWidth);
|
|
456
458
|
} else {
|
|
457
|
-
onKeyDown === null || onKeyDown === void 0
|
|
459
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
|
|
458
460
|
}
|
|
459
461
|
};
|
|
460
462
|
const handleClick = e => {
|
|
@@ -528,7 +530,7 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
528
530
|
const mouseX = e.clientX;
|
|
529
531
|
const headerX = (_columnHeaderRef$curr3 = columnHeaderRef.current) === null || _columnHeaderRef$curr3 === void 0 ? void 0 : _columnHeaderRef$curr3.getBoundingClientRect().x;
|
|
530
532
|
const newWidth = Math.max(80, mouseX - headerX);
|
|
531
|
-
onWidthChange === null || onWidthChange === void 0
|
|
533
|
+
onWidthChange === null || onWidthChange === void 0 || onWidthChange(newWidth);
|
|
532
534
|
};
|
|
533
535
|
const handleMouseUp = e => {
|
|
534
536
|
if (e.button === 0) {
|
|
@@ -576,28 +578,28 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
576
578
|
onFocus: onFocus,
|
|
577
579
|
onClick: isSortable ? handleClick : undefined,
|
|
578
580
|
tabIndex: isFocused ? 0 : -1,
|
|
579
|
-
className: classNames__default["default"](styles$
|
|
580
|
-
[styles$
|
|
581
|
+
className: classNames__default["default"](styles$b.advancedTableColumnHeader, {
|
|
582
|
+
[styles$b.advancedTableRowChild]: !isPinned,
|
|
581
583
|
// if nested inside of pinned container, not a direct row child
|
|
582
|
-
[styles$
|
|
583
|
-
[styles$
|
|
584
|
-
[styles$
|
|
585
|
-
[styles$
|
|
586
|
-
[styles$
|
|
584
|
+
[styles$b.isSortable]: isSortable,
|
|
585
|
+
[styles$b.isSorted]: isSorted,
|
|
586
|
+
[styles$b.showFocusRing]: isHiddenMenuOpen,
|
|
587
|
+
[styles$b.isDragging]: isDragging,
|
|
588
|
+
[styles$b.fillRemainingSpace]: width === undefined
|
|
587
589
|
}),
|
|
588
590
|
style: {
|
|
589
591
|
width: computedWidth
|
|
590
592
|
},
|
|
591
593
|
ref: index.mergeRefs(columnHeaderRef, dragRef, dropRef, ref)
|
|
592
594
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
593
|
-
className: classNames__default["default"](styles$
|
|
594
|
-
[styles$
|
|
595
|
-
[styles$
|
|
596
|
-
[styles$
|
|
595
|
+
className: classNames__default["default"](styles$b.advancedTableColumnHeaderLabel, {
|
|
596
|
+
[styles$b.leftAligned]: alignment === 'left',
|
|
597
|
+
[styles$b.centerAligned]: alignment === 'center',
|
|
598
|
+
[styles$b.rightAligned]: alignment === 'right'
|
|
597
599
|
}),
|
|
598
600
|
ref: labelContainerRef
|
|
599
601
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
600
|
-
className: styles$
|
|
602
|
+
className: styles$b.advancedTableColumnHeaderLabelText,
|
|
601
603
|
style: {
|
|
602
604
|
WebkitLineClamp: headerMaxLines
|
|
603
605
|
},
|
|
@@ -608,7 +610,7 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
608
610
|
anchor: /*#__PURE__*/React__default["default"].createElement(index.IconButton, {
|
|
609
611
|
tabIndex: -1,
|
|
610
612
|
"aria-hidden": "true",
|
|
611
|
-
className: styles$
|
|
613
|
+
className: styles$b.advancedTableColumnHeaderMenu
|
|
612
614
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronDownIcon, null))
|
|
613
615
|
})), /*#__PURE__*/React__default["default"].createElement(AdvancedTableColumnHeaderMenu, _extends__default["default"]({}, commonMenuProps, {
|
|
614
616
|
isOpen: isHiddenMenuOpen,
|
|
@@ -620,33 +622,33 @@ const AdvancedTableColumnHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
620
622
|
"aria-hidden": "true",
|
|
621
623
|
onFocus: () => {
|
|
622
624
|
var _columnHeaderRef$curr5;
|
|
623
|
-
(_columnHeaderRef$curr5 = columnHeaderRef.current) === null || _columnHeaderRef$curr5 === void 0
|
|
625
|
+
(_columnHeaderRef$curr5 = columnHeaderRef.current) === null || _columnHeaderRef$curr5 === void 0 || _columnHeaderRef$curr5.focus();
|
|
624
626
|
},
|
|
625
|
-
className: styles$
|
|
627
|
+
className: styles$b.advancedTableColumnHeaderMenuHiddenAnchor
|
|
626
628
|
})
|
|
627
629
|
}))), dropTargetSide && !isRowActionMenuColumn && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
628
|
-
className: classNames__default["default"](styles$
|
|
629
|
-
[styles$
|
|
630
|
-
[styles$
|
|
630
|
+
className: classNames__default["default"](styles$b.dropTargetLine, {
|
|
631
|
+
[styles$b.dropTargetLeft]: dropTargetSide === 'left',
|
|
632
|
+
[styles$b.dropTargetRight]: dropTargetSide === 'right'
|
|
631
633
|
}),
|
|
632
634
|
style: {
|
|
633
635
|
height: tableHeight
|
|
634
636
|
}
|
|
635
637
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
636
|
-
className: classNames__default["default"](styles$
|
|
637
|
-
[styles$
|
|
638
|
-
[styles$
|
|
638
|
+
className: classNames__default["default"](styles$b.dropTargetMarker, {
|
|
639
|
+
[styles$b.dropTargetLeft]: dropTargetSide === 'left',
|
|
640
|
+
[styles$b.dropTargetRight]: dropTargetSide === 'right'
|
|
639
641
|
})
|
|
640
642
|
})), onWidthChange && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
641
643
|
"aria-hidden": true,
|
|
642
|
-
className: styles$
|
|
644
|
+
className: styles$b.resizeHandle,
|
|
643
645
|
style: {
|
|
644
646
|
height: tableHeight
|
|
645
647
|
},
|
|
646
648
|
onMouseDown: handleMouseDown
|
|
647
649
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
648
|
-
className: classNames__default["default"](styles$
|
|
649
|
-
[styles$
|
|
650
|
+
className: classNames__default["default"](styles$b.resizeLine, {
|
|
651
|
+
[styles$b.isResizing]: isResizing
|
|
650
652
|
})
|
|
651
653
|
}))));
|
|
652
654
|
});
|
|
@@ -685,14 +687,14 @@ const AdvancedTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
685
687
|
const handleKeyDown = e => {
|
|
686
688
|
if (e.target === e.currentTarget && e.key === 'Enter' && isInteractive) {
|
|
687
689
|
var _focusableElementRef$;
|
|
688
|
-
(_focusableElementRef$ = focusableElementRef.current) === null || _focusableElementRef$ === void 0
|
|
690
|
+
(_focusableElementRef$ = focusableElementRef.current) === null || _focusableElementRef$ === void 0 || _focusableElementRef$.focus();
|
|
689
691
|
e.preventDefault(); // Prevent click event from occurring on the focusable element
|
|
690
692
|
}
|
|
691
693
|
|
|
692
|
-
onKeyDown === null || onKeyDown === void 0
|
|
694
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
|
|
693
695
|
};
|
|
694
696
|
const handleFocus = e => {
|
|
695
|
-
onFocus === null || onFocus === void 0
|
|
697
|
+
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
696
698
|
if (isInteractive) {
|
|
697
699
|
if (e.target !== e.currentTarget) {
|
|
698
700
|
setIsEditing(true);
|
|
@@ -708,7 +710,7 @@ const AdvancedTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
708
710
|
} : undefined;
|
|
709
711
|
const focusCell = () => {
|
|
710
712
|
var _cellRef$current;
|
|
711
|
-
(_cellRef$current = cellRef.current) === null || _cellRef$current === void 0
|
|
713
|
+
(_cellRef$current = cellRef.current) === null || _cellRef$current === void 0 || _cellRef$current.focus();
|
|
712
714
|
};
|
|
713
715
|
const computedWidth = useComputedWidth(widthBuffer, width);
|
|
714
716
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({}, rest, {
|
|
@@ -719,19 +721,19 @@ const AdvancedTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
719
721
|
onFocus: handleFocus,
|
|
720
722
|
onBlur: handleBlur,
|
|
721
723
|
tabIndex: isFocused && !isEditing ? 0 : -1,
|
|
722
|
-
className: classNames__default["default"](className, styles$
|
|
723
|
-
[styles$
|
|
724
|
-
[styles$
|
|
725
|
-
[styles$
|
|
726
|
-
[styles$
|
|
727
|
-
[styles$
|
|
724
|
+
className: classNames__default["default"](className, styles$b.advancedTableCell, {
|
|
725
|
+
[styles$b.leftAligned]: alignment === Alignments.Left,
|
|
726
|
+
[styles$b.centerAligned]: alignment === Alignments.Center,
|
|
727
|
+
[styles$b.rightAligned]: alignment === Alignments.Right,
|
|
728
|
+
[styles$b.isDragging]: isDragging,
|
|
729
|
+
[styles$b.fillRemainingSpace]: width === undefined
|
|
728
730
|
}),
|
|
729
731
|
style: {
|
|
730
732
|
width: computedWidth
|
|
731
733
|
},
|
|
732
734
|
ref: index.mergeRefs(ref, cellRef)
|
|
733
735
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
734
|
-
className: styles$
|
|
736
|
+
className: styles$b.advancedTableCellContainer
|
|
735
737
|
}, typeof renderCellContent === 'function' ? renderCellContent({
|
|
736
738
|
value,
|
|
737
739
|
setValue,
|
|
@@ -766,9 +768,9 @@ const AdvancedTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
766
768
|
onKeyDown: isFocusable ? onKeyDown : undefined,
|
|
767
769
|
onFocus: isFocusable ? onFocus : undefined,
|
|
768
770
|
onClick: hasOnRowSelect ? onClick : undefined,
|
|
769
|
-
className: classNames__default["default"](styles$
|
|
770
|
-
[styles$
|
|
771
|
-
[styles$
|
|
771
|
+
className: classNames__default["default"](styles$b.advancedTableRow, {
|
|
772
|
+
[styles$b.hasRowAction]: hasOnRowSelect,
|
|
773
|
+
[styles$b.isSelected]: hasOnRowSelect && isSelected
|
|
772
774
|
}),
|
|
773
775
|
ref: isFocusable ? ref : undefined
|
|
774
776
|
}), children);
|
|
@@ -788,7 +790,7 @@ const AdvancedTableColumnHeaders = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
788
790
|
tabIndex: isFocusable ? isFocused ? 0 : -1 : undefined,
|
|
789
791
|
onKeyDown: isFocusable ? onKeyDown : undefined,
|
|
790
792
|
onFocus: isFocusable ? onFocus : undefined,
|
|
791
|
-
className: styles$
|
|
793
|
+
className: styles$b.advancedTableColumnHeaders,
|
|
792
794
|
ref: ref
|
|
793
795
|
}), children);
|
|
794
796
|
});
|
|
@@ -799,7 +801,9 @@ const AdvancedTableCheckbox = _ref => {
|
|
|
799
801
|
state,
|
|
800
802
|
onClick,
|
|
801
803
|
variant = 'cell',
|
|
802
|
-
isRowFocused
|
|
804
|
+
isRowFocused,
|
|
805
|
+
className,
|
|
806
|
+
isDisabled
|
|
803
807
|
} = _ref;
|
|
804
808
|
const {
|
|
805
809
|
translate
|
|
@@ -820,17 +824,18 @@ const AdvancedTableCheckbox = _ref => {
|
|
|
820
824
|
}, [isRowFocused, announceToScreenReader, label]);
|
|
821
825
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
822
826
|
onClick: onClick,
|
|
823
|
-
className: classNames__default["default"](styles$
|
|
824
|
-
[styles$
|
|
827
|
+
className: classNames__default["default"](styles$b.advancedTableCheckbox, className, {
|
|
828
|
+
[styles$b.header]: variant === 'header'
|
|
825
829
|
}),
|
|
826
830
|
role: "presentation"
|
|
827
831
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
828
|
-
className: styles$
|
|
832
|
+
className: styles$b.checkboxContainer
|
|
829
833
|
}, /*#__PURE__*/React__default["default"].createElement(index.VisualCheckbox, {
|
|
830
|
-
className: styles$
|
|
831
|
-
checked: state === 'true'
|
|
834
|
+
className: styles$b.checkbox,
|
|
835
|
+
checked: state === 'true',
|
|
836
|
+
disabled: isDisabled
|
|
832
837
|
}), state === 'mixed' && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
833
|
-
className: styles$
|
|
838
|
+
className: styles$b.mixed
|
|
834
839
|
})));
|
|
835
840
|
};
|
|
836
841
|
|
|
@@ -843,7 +848,7 @@ const AdvancedTableHiddenDescription = _ref => {
|
|
|
843
848
|
translate
|
|
844
849
|
} = index.useTranslation();
|
|
845
850
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
846
|
-
className: styles$
|
|
851
|
+
className: styles$b.hiddenDescription,
|
|
847
852
|
id: id
|
|
848
853
|
}, translate(messageKey));
|
|
849
854
|
};
|
|
@@ -866,7 +871,7 @@ const AdvancedTableDragPreview = _ref => {
|
|
|
866
871
|
const top = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.y) || 0;
|
|
867
872
|
const left = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.x) || 0;
|
|
868
873
|
return /*#__PURE__*/React__default["default"].createElement(index.Portal, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
869
|
-
className: styles$
|
|
874
|
+
className: styles$b.dragPreview,
|
|
870
875
|
style: {
|
|
871
876
|
height,
|
|
872
877
|
width,
|
|
@@ -892,12 +897,12 @@ const AdvancedTablePagination = _ref => {
|
|
|
892
897
|
page
|
|
893
898
|
} = _ref2;
|
|
894
899
|
setCurrentPage(page);
|
|
895
|
-
onPageChange === null || onPageChange === void 0
|
|
900
|
+
onPageChange === null || onPageChange === void 0 || onPageChange(page);
|
|
896
901
|
};
|
|
897
902
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
898
|
-
className: styles$
|
|
903
|
+
className: styles$b.advancedTablePaginationContainer
|
|
899
904
|
}, /*#__PURE__*/React__default["default"].createElement(index.Pagination, {
|
|
900
|
-
className: styles$
|
|
905
|
+
className: styles$b.advancedTablePagination,
|
|
901
906
|
"aria-label": ariaLabel,
|
|
902
907
|
numPages: Math.max(Math.ceil(rows.length / rowsPerPage), 1),
|
|
903
908
|
currentPage: currentPage,
|
|
@@ -978,6 +983,7 @@ const AdvancedTable = _ref => {
|
|
|
978
983
|
'data-testid': dataTestId,
|
|
979
984
|
rowActions,
|
|
980
985
|
rowActionsButtonAriaLabel,
|
|
986
|
+
rowActionsPlacement = 'bottom-end',
|
|
981
987
|
headerMaxLines
|
|
982
988
|
} = _ref;
|
|
983
989
|
// This handles an edge case where no rows are passed in
|
|
@@ -1042,7 +1048,8 @@ const AdvancedTable = _ref => {
|
|
|
1042
1048
|
}
|
|
1043
1049
|
}
|
|
1044
1050
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.EllipsisHorizontalIcon, null))), /*#__PURE__*/React__default["default"].createElement(index.DropdownList, {
|
|
1045
|
-
className: styles$
|
|
1051
|
+
className: styles$b.rowActionMenuPane,
|
|
1052
|
+
placement: rowActionsPlacement
|
|
1046
1053
|
}, !rows ? [] : rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((actionGroup, groupIndex) => {
|
|
1047
1054
|
var _actionGroup$actions;
|
|
1048
1055
|
const row = rows[rowIndex];
|
|
@@ -1110,7 +1117,7 @@ const AdvancedTable = _ref => {
|
|
|
1110
1117
|
const setColumnOrder = index.useEventCallback(value => {
|
|
1111
1118
|
const newColumnOrder = typeof value === 'function' ? value(columnOrder) : value;
|
|
1112
1119
|
setInternalColumnOrder(newColumnOrder);
|
|
1113
|
-
onColumnOrderChange === null || onColumnOrderChange === void 0
|
|
1120
|
+
onColumnOrderChange === null || onColumnOrderChange === void 0 || onColumnOrderChange(newColumnOrder);
|
|
1114
1121
|
});
|
|
1115
1122
|
const {
|
|
1116
1123
|
pinnedColumnConfigs,
|
|
@@ -1202,7 +1209,7 @@ const AdvancedTable = _ref => {
|
|
|
1202
1209
|
} else if (expand !== false) {
|
|
1203
1210
|
rowPropReference.isExpanded = true;
|
|
1204
1211
|
}
|
|
1205
|
-
onRowsChange === null || onRowsChange === void 0
|
|
1212
|
+
onRowsChange === null || onRowsChange === void 0 || onRowsChange([...rowsProp]);
|
|
1206
1213
|
};
|
|
1207
1214
|
const getLastToggledRowIndex = () => {
|
|
1208
1215
|
const index = rows === null || rows === void 0 ? void 0 : rows.findIndex(_ref4 => {
|
|
@@ -1449,8 +1456,8 @@ const AdvancedTable = _ref => {
|
|
|
1449
1456
|
const getExpandableRowsSpacer = function (width, inHeader) {
|
|
1450
1457
|
let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
1451
1458
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1452
|
-
className: classNames__default["default"](styles$
|
|
1453
|
-
[styles$
|
|
1459
|
+
className: classNames__default["default"](styles$b.advancedTableExpandRowSpacer, {
|
|
1460
|
+
[styles$b.header]: inHeader
|
|
1454
1461
|
}),
|
|
1455
1462
|
style: {
|
|
1456
1463
|
width
|
|
@@ -1473,7 +1480,7 @@ const AdvancedTable = _ref => {
|
|
|
1473
1480
|
setValue: newValue => {
|
|
1474
1481
|
const newRows = [...rowsProp];
|
|
1475
1482
|
rowPropReference.data[columnId] = newValue;
|
|
1476
|
-
onRowsChange === null || onRowsChange === void 0
|
|
1483
|
+
onRowsChange === null || onRowsChange === void 0 || onRowsChange(newRows);
|
|
1477
1484
|
},
|
|
1478
1485
|
renderCellContent,
|
|
1479
1486
|
isCellContentInteractive,
|
|
@@ -1497,7 +1504,7 @@ const AdvancedTable = _ref => {
|
|
|
1497
1504
|
backend: reactDndHtml5Backend.HTML5Backend,
|
|
1498
1505
|
context: index.canUseDOM() ? window : undefined
|
|
1499
1506
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1500
|
-
className: styles$
|
|
1507
|
+
className: styles$b.advancedTable,
|
|
1501
1508
|
ref: tableRef
|
|
1502
1509
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1503
1510
|
role: hasExpandableRows ? 'treegrid' : 'grid',
|
|
@@ -1522,7 +1529,7 @@ const AdvancedTable = _ref => {
|
|
|
1522
1529
|
messageKey: "advancedTable.rowCheckboxDescription"
|
|
1523
1530
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1524
1531
|
role: "rowgroup",
|
|
1525
|
-
className: classNames__default["default"](styles$
|
|
1532
|
+
className: classNames__default["default"](styles$b.advancedTableColumnHeadersRowGroup, styles$b.advancedTableRowGroup)
|
|
1526
1533
|
}, /*#__PURE__*/React__default["default"].createElement(AdvancedTableColumnHeaders, {
|
|
1527
1534
|
"aria-rowindex": hasExpandableRows ? undefined : 1,
|
|
1528
1535
|
"aria-level": hasExpandableRows ? 1 : undefined // aria-level is one-indexed
|
|
@@ -1538,7 +1545,7 @@ const AdvancedTable = _ref => {
|
|
|
1538
1545
|
ref: createRef(headerRowIndex, -1)
|
|
1539
1546
|
}, hasCheckboxColumn || pinnedColumnConfigs.length ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1540
1547
|
role: "presentation",
|
|
1541
|
-
className: classNames__default["default"](styles$
|
|
1548
|
+
className: classNames__default["default"](styles$b.pinnedContainer, styles$b.advancedTableRowChild),
|
|
1542
1549
|
ref: createPinnedContainerRef(headerRowIndex)
|
|
1543
1550
|
}, hasCheckboxColumn && /*#__PURE__*/React__default["default"].createElement(AdvancedTableCheckbox, {
|
|
1544
1551
|
state: checkedRowIds.length === totalRowsCountWithExpansion ? 'true' : checkedRowIds.length === 0 ? 'false' : 'mixed',
|
|
@@ -1553,7 +1560,7 @@ const AdvancedTable = _ref => {
|
|
|
1553
1560
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableColumnHeader, props);
|
|
1554
1561
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1555
1562
|
role: "rowgroup",
|
|
1556
|
-
className: styles$
|
|
1563
|
+
className: styles$b.advancedTableRowGroup
|
|
1557
1564
|
}, ((_ref5 = paginatedRows !== null && paginatedRows !== void 0 ? paginatedRows : rows) !== null && _ref5 !== void 0 ? _ref5 : []).map((row, rowIndex) => {
|
|
1558
1565
|
const {
|
|
1559
1566
|
id: rowId,
|
|
@@ -1571,7 +1578,7 @@ const AdvancedTable = _ref => {
|
|
|
1571
1578
|
const onSelect = e => {
|
|
1572
1579
|
e.preventDefault(); // stops event from triggering on new target when focus is changed during onSelect
|
|
1573
1580
|
if (hasOnRowSelect) {
|
|
1574
|
-
onRowSelect === null || onRowSelect === void 0
|
|
1581
|
+
onRowSelect === null || onRowSelect === void 0 || onRowSelect(row.rowPropReference);
|
|
1575
1582
|
setSelectedRowId(rowId);
|
|
1576
1583
|
}
|
|
1577
1584
|
};
|
|
@@ -1603,7 +1610,7 @@ const AdvancedTable = _ref => {
|
|
|
1603
1610
|
"aria-setsize": hasExpandableRows ? depthSize : undefined,
|
|
1604
1611
|
"aria-posinset": hasExpandableRows ? depthIndex + 1 : undefined // aria-posinset is one-indexed
|
|
1605
1612
|
}), hasCheckboxColumn || pinnedColumnConfigs.length ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1606
|
-
className: classNames__default["default"](styles$
|
|
1613
|
+
className: classNames__default["default"](styles$b.pinnedContainer, styles$b.advancedTableRowChild),
|
|
1607
1614
|
ref: createPinnedContainerRef(paginatedRowIndex)
|
|
1608
1615
|
}, hasCheckboxColumn && /*#__PURE__*/React__default["default"].createElement(AdvancedTableCheckbox, {
|
|
1609
1616
|
state: getCheckboxStateForRow(row),
|
|
@@ -1626,7 +1633,7 @@ const AdvancedTable = _ref => {
|
|
|
1626
1633
|
})) : undefined, hasExpandableRows && !pinnedColumnConfigs.length ? getExpandableRowsSpacer("".concat(widthBufferWidth * (depth + 1), "px"), false, hasChildRows ? getAdvancedTableRowExpandButton(rowId, isExpanded, rowIndex) : undefined) : undefined, unpinnedColumnConfigs.map((c, i) => {
|
|
1627
1634
|
const props = getCellProps(c, i + pinnedColumnConfigs.length, data, paginatedRowIndex, rowId, depth, rowPropReference);
|
|
1628
1635
|
return /*#__PURE__*/React__default["default"].createElement(AdvancedTableCell, _extends__default["default"]({}, props, {
|
|
1629
|
-
className: styles$
|
|
1636
|
+
className: styles$b.advancedTableRowChild,
|
|
1630
1637
|
"aria-rowindex": hasExpandableRows ? undefined : rowIndex + 2 // aria-rowindex is one-indexed + the column headers row is the first row in the table
|
|
1631
1638
|
,
|
|
1632
1639
|
"aria-colindex": i + 1 // aria-colindex is one-indexed
|
|
@@ -1752,7 +1759,7 @@ function useFocusState(_ref8) {
|
|
|
1752
1759
|
tableRef.current.scrollLeft -= pinnedContainerPos.left + pinnedContainerPos.width - cellPos.left;
|
|
1753
1760
|
}
|
|
1754
1761
|
}
|
|
1755
|
-
cell === null || cell === void 0
|
|
1762
|
+
cell === null || cell === void 0 || cell.focus();
|
|
1756
1763
|
});
|
|
1757
1764
|
|
|
1758
1765
|
// Focus header cell when the focused column id changes. Used when pinning/unpinning columns since a new DOM element is created.
|
|
@@ -1819,10 +1826,10 @@ function mapExternalRowToInternalRows(row, depthSize, depthIndex, parentId) {
|
|
|
1819
1826
|
|
|
1820
1827
|
/* eslint-disable import/prefer-default-export */
|
|
1821
1828
|
|
|
1822
|
-
var css_248z$
|
|
1823
|
-
var styles$
|
|
1824
|
-
var stylesheet$
|
|
1825
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
1829
|
+
var css_248z$a = "._EJUud{display:inline-block;width:36px;transition:width .25s ease-out}._5LbQV{width:100%}._HHbN5>input{padding-right:0!important}._FUHDV>svg{fill:#515559}";
|
|
1830
|
+
var styles$a = {"collapsibleSearchInput":"_EJUud","searchInput":"_5LbQV","searchInputCollapsed":"_HHbN5","iconButton":"_FUHDV"};
|
|
1831
|
+
var stylesheet$a="._EJUud{display:inline-block;width:36px;transition:width .25s ease-out}._5LbQV{width:100%}._HHbN5>input{padding-right:0!important}._FUHDV>svg{fill:#515559}";
|
|
1832
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$a);}
|
|
1826
1833
|
|
|
1827
1834
|
const CollapsibleSearchInputIconButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1828
1835
|
let {
|
|
@@ -1835,7 +1842,7 @@ const CollapsibleSearchInputIconButton = /*#__PURE__*/React.forwardRef((_ref, re
|
|
|
1835
1842
|
} = index.useTranslation();
|
|
1836
1843
|
const label = translate('collapsibleSearchInput.openSearchField');
|
|
1837
1844
|
return /*#__PURE__*/React__default["default"].createElement(index.IconButton, _extends__default["default"]({}, rest, {
|
|
1838
|
-
className: styles$
|
|
1845
|
+
className: styles$a.iconButton,
|
|
1839
1846
|
"aria-label": label,
|
|
1840
1847
|
tooltipContent: tooltipContent !== null && tooltipContent !== void 0 ? tooltipContent : label,
|
|
1841
1848
|
tooltipPlacement: tooltipPlacement,
|
|
@@ -1899,7 +1906,7 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1899
1906
|
};
|
|
1900
1907
|
const handleIconButtonClick = () => {
|
|
1901
1908
|
var _iconButtonRef$curren;
|
|
1902
|
-
(_iconButtonRef$curren = iconButtonRef.current) === null || _iconButtonRef$curren === void 0
|
|
1909
|
+
(_iconButtonRef$curren = iconButtonRef.current) === null || _iconButtonRef$curren === void 0 || _iconButtonRef$curren.focus();
|
|
1903
1910
|
setExternalIsExpanded(true);
|
|
1904
1911
|
};
|
|
1905
1912
|
index.useDidUpdate(() => {
|
|
@@ -1918,7 +1925,7 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1918
1925
|
if (isComponentFocused) {
|
|
1919
1926
|
switch (internalExpandedState) {
|
|
1920
1927
|
case expandedStates.EXPANDING:
|
|
1921
|
-
(_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0
|
|
1928
|
+
(_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 || _searchInputRef$curre.focus();
|
|
1922
1929
|
break;
|
|
1923
1930
|
case expandedStates.COLLAPSED:
|
|
1924
1931
|
/*
|
|
@@ -1926,7 +1933,7 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1926
1933
|
* This will show the focus ring on the icon button and allow the tooltip to appear.
|
|
1927
1934
|
*/
|
|
1928
1935
|
|
|
1929
|
-
(_iconButtonRef$curren2 = iconButtonRef.current) === null || _iconButtonRef$curren2 === void 0
|
|
1936
|
+
(_iconButtonRef$curren2 = iconButtonRef.current) === null || _iconButtonRef$curren2 === void 0 || _iconButtonRef$curren2.focus();
|
|
1930
1937
|
break;
|
|
1931
1938
|
default:
|
|
1932
1939
|
}
|
|
@@ -1936,7 +1943,7 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1936
1943
|
onFocus: handleContainerFocus,
|
|
1937
1944
|
onBlur: handleContainerBlur,
|
|
1938
1945
|
onTransitionEnd: handleContainerTransitionEnd,
|
|
1939
|
-
className: styles$
|
|
1946
|
+
className: styles$a.collapsibleSearchInput,
|
|
1940
1947
|
style: {
|
|
1941
1948
|
width: externalIsExpanded ? widthWhenExpanded : undefined
|
|
1942
1949
|
},
|
|
@@ -1950,8 +1957,8 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1950
1957
|
"aria-label": searchInputAriaLabel,
|
|
1951
1958
|
"aria-labelledby": searchInputAriaLabelledBy,
|
|
1952
1959
|
"aria-describedby": searchInputAriaDescribedBy,
|
|
1953
|
-
className: classNames__default["default"](styles$
|
|
1954
|
-
[styles$
|
|
1960
|
+
className: classNames__default["default"](styles$a.searchInput, {
|
|
1961
|
+
[styles$a.searchInputCollapsed]: internalExpandedState !== expandedStates.EXPANDED
|
|
1955
1962
|
}),
|
|
1956
1963
|
"data-testid": index.getSubDataTestId(dataTestId, 'SearchInput'),
|
|
1957
1964
|
ref: searchInputRef
|
|
@@ -1962,10 +1969,10 @@ const CollapsibleSearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1962
1969
|
}));
|
|
1963
1970
|
});
|
|
1964
1971
|
|
|
1965
|
-
var css_248z$
|
|
1966
|
-
var styles$
|
|
1967
|
-
var stylesheet$
|
|
1968
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
1972
|
+
var css_248z$9 = "._Yam-8 input{padding-left:76px!important}._2PHbV input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._2PHbV input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._2PHbV input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._LSADJ{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._LSADJ,._LSADJ._2PHbV:hover{background-color:transparent!important}._LSADJ:hover{background-color:rgba(50,54,58,.08)!important}._LSADJ:active{background-color:rgba(50,54,58,.11)!important}._LSADJ svg{top:2px!important}._tJt-2{position:relative}._cCDs1{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
1973
|
+
var styles$9 = {"input":"_Yam-8","disabled":"_2PHbV","dropdown":"_LSADJ","container":"_tJt-2","countryCode":"_cCDs1"};
|
|
1974
|
+
var stylesheet$9="._Yam-8 input{padding-left:76px!important}._2PHbV input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._2PHbV input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._2PHbV input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._LSADJ{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._LSADJ,._LSADJ._2PHbV:hover{background-color:transparent!important}._LSADJ:hover{background-color:rgba(50,54,58,.08)!important}._LSADJ:active{background-color:rgba(50,54,58,.11)!important}._LSADJ svg{top:2px!important}._tJt-2{position:relative}._cCDs1{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
1975
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$9);}
|
|
1969
1976
|
|
|
1970
1977
|
const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1971
1978
|
let {
|
|
@@ -2023,23 +2030,23 @@ const PhoneNumberInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2023
2030
|
} catch (e) {
|
|
2024
2031
|
// `parsePhoneNumber` throws an error if the inputs are invalid.
|
|
2025
2032
|
}
|
|
2026
|
-
onChange === null || onChange === void 0
|
|
2033
|
+
onChange === null || onChange === void 0 || onChange(internationalNumber, isValidLength, countryCode, value);
|
|
2027
2034
|
};
|
|
2028
|
-
const inputClassNames = classNames__default["default"](styles$
|
|
2029
|
-
[styles$
|
|
2035
|
+
const inputClassNames = classNames__default["default"](styles$9.input, {
|
|
2036
|
+
[styles$9.disabled]: isDisabled
|
|
2030
2037
|
});
|
|
2031
2038
|
const dropdownLabel = React.useMemo(() => countryCode ? "+".concat(libphonenumberJs.getCountryCallingCode(countryCode)) : undefined, [countryCode]);
|
|
2032
2039
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2033
|
-
className: styles$
|
|
2040
|
+
className: styles$9.container,
|
|
2034
2041
|
"data-testid": dataTestId
|
|
2035
2042
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2036
|
-
className: styles$
|
|
2043
|
+
className: styles$9.countryCode
|
|
2037
2044
|
}, dropdownLabel), /*#__PURE__*/React__default["default"].createElement(index.SelectMenu, {
|
|
2038
2045
|
label: " ",
|
|
2039
2046
|
defaultValue: countryCode,
|
|
2040
2047
|
onChange: value => setCountryCode(value),
|
|
2041
|
-
className: classNames__default["default"](styles$
|
|
2042
|
-
[styles$
|
|
2048
|
+
className: classNames__default["default"](styles$9.dropdown, {
|
|
2049
|
+
[styles$9.disabled]: isDisabled
|
|
2043
2050
|
}),
|
|
2044
2051
|
searchable: true,
|
|
2045
2052
|
disabled: isDisabled,
|
|
@@ -2198,7 +2205,7 @@ isDisabled) {
|
|
|
2198
2205
|
*/
|
|
2199
2206
|
const focusDescendant = React.useCallback((descendantElement, index) => {
|
|
2200
2207
|
var _inputRef$current;
|
|
2201
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0
|
|
2208
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.setAttribute('aria-activedescendant', descendantElement.id);
|
|
2202
2209
|
setActiveDescendant({
|
|
2203
2210
|
element: descendantElement,
|
|
2204
2211
|
index
|
|
@@ -2617,6 +2624,7 @@ function Combobox(_ref) {
|
|
|
2617
2624
|
initialValue = '',
|
|
2618
2625
|
value,
|
|
2619
2626
|
onChange,
|
|
2627
|
+
onSubmit,
|
|
2620
2628
|
isDisabled,
|
|
2621
2629
|
isInvalid,
|
|
2622
2630
|
isRequired,
|
|
@@ -2670,6 +2678,7 @@ function Combobox(_ref) {
|
|
|
2670
2678
|
setRawInputValue,
|
|
2671
2679
|
committedInputValue,
|
|
2672
2680
|
setCommittedInputValue,
|
|
2681
|
+
onSubmit,
|
|
2673
2682
|
registerOption,
|
|
2674
2683
|
deregisterOption,
|
|
2675
2684
|
focusInput,
|
|
@@ -2684,10 +2693,10 @@ function Combobox(_ref) {
|
|
|
2684
2693
|
}, children);
|
|
2685
2694
|
}
|
|
2686
2695
|
|
|
2687
|
-
var css_248z$
|
|
2688
|
-
var styles$
|
|
2689
|
-
var stylesheet$
|
|
2690
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
2696
|
+
var css_248z$8 = "._jP-o2 :after{background-color:#515559!important}._-XCbz>input:focus{box-shadow:none!important;border:1px solid #898989!important}._eBhO9{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}._eBhO9 ._6-d-i ._Ngvh6{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}._eBhO9 ._6-d-i:first-child ._L6uri{display:none}._eBhO9 ._0a4eq{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._eBhO9 ._0a4eq:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._eBhO9 ._0a4eq:hover._BKYBO{background-color:#e4effa}._eBhO9 ._0a4eq._BKYBO{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._eBhO9 ._0a4eq:active:not(._BKYBO){background-color:#e8e9e9}";
|
|
2697
|
+
var styles$8 = {"loadingSpinner":"_jP-o2","ignoreFocusStyle":"_-XCbz","flyout":"_eBhO9","group":"_6-d-i","header":"_Ngvh6","divider":"_L6uri","option":"_0a4eq","selected":"_BKYBO"};
|
|
2698
|
+
var stylesheet$8="._jP-o2 :after{background-color:#515559!important}._-XCbz>input:focus{box-shadow:none!important;border:1px solid #898989!important}._eBhO9{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}._eBhO9 ._6-d-i ._Ngvh6{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}._eBhO9 ._6-d-i:first-child ._L6uri{display:none}._eBhO9 ._0a4eq{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._eBhO9 ._0a4eq:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._eBhO9 ._0a4eq:hover._BKYBO{background-color:#e4effa}._eBhO9 ._0a4eq._BKYBO{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._eBhO9 ._0a4eq:active:not(._BKYBO){background-color:#e8e9e9}";
|
|
2699
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$8);}
|
|
2691
2700
|
|
|
2692
2701
|
const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
2693
2702
|
let {
|
|
@@ -2716,6 +2725,7 @@ const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2716
2725
|
setRawInputValue,
|
|
2717
2726
|
committedInputValue,
|
|
2718
2727
|
setCommittedInputValue,
|
|
2728
|
+
onSubmit,
|
|
2719
2729
|
activeDescendantElement,
|
|
2720
2730
|
isDisabled,
|
|
2721
2731
|
isRequired,
|
|
@@ -2784,6 +2794,7 @@ const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2784
2794
|
case 'Enter':
|
|
2785
2795
|
e.preventDefault(); // Prevents form submission
|
|
2786
2796
|
commitCurrentRawInputValueAndCloseFlyout();
|
|
2797
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(rawInputValue);
|
|
2787
2798
|
break;
|
|
2788
2799
|
default:
|
|
2789
2800
|
}
|
|
@@ -2791,7 +2802,7 @@ const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2791
2802
|
return /*#__PURE__*/React__default["default"].createElement(index.Input$1, {
|
|
2792
2803
|
role: "combobox",
|
|
2793
2804
|
className: classNames__default["default"](className, {
|
|
2794
|
-
[styles$
|
|
2805
|
+
[styles$8.ignoreFocusStyle]: hoveredOption || activeDescendantElement
|
|
2795
2806
|
}),
|
|
2796
2807
|
style: style,
|
|
2797
2808
|
id: id,
|
|
@@ -2804,7 +2815,7 @@ const ComboboxInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
2804
2815
|
},
|
|
2805
2816
|
leftAddOn: leftAddOn,
|
|
2806
2817
|
rightAddOn: isLoading ? /*#__PURE__*/React__default["default"].createElement(index.LoadingSpinner, {
|
|
2807
|
-
className: styles$
|
|
2818
|
+
className: styles$8.loadingSpinner,
|
|
2808
2819
|
size: "xs",
|
|
2809
2820
|
show: isLoading,
|
|
2810
2821
|
"aria-hidden": true
|
|
@@ -2861,7 +2872,7 @@ const ComboboxFlyout = _ref => {
|
|
|
2861
2872
|
popper: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2862
2873
|
role: "listbox",
|
|
2863
2874
|
id: flyoutId,
|
|
2864
|
-
className: styles$
|
|
2875
|
+
className: styles$8.flyout,
|
|
2865
2876
|
style: flyoutDimensions,
|
|
2866
2877
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rootAriaLabel,
|
|
2867
2878
|
"aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : rootAriaLabelledBy,
|
|
@@ -2913,16 +2924,16 @@ function ComboboxGroup(_ref) {
|
|
|
2913
2924
|
}, children);
|
|
2914
2925
|
return hasFilteredOptions ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2915
2926
|
role: "group",
|
|
2916
|
-
className: styles$
|
|
2927
|
+
className: styles$8.group,
|
|
2917
2928
|
"aria-labelledby": headerElementId,
|
|
2918
2929
|
"aria-describedby": ariaDescribedBy,
|
|
2919
2930
|
"data-testid": index.getSubDataTestId(rootDataTestId, "group-".concat(label))
|
|
2920
2931
|
}, /*#__PURE__*/React__default["default"].createElement(index.Divider, {
|
|
2921
|
-
className: styles$
|
|
2932
|
+
className: styles$8.divider
|
|
2922
2933
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2923
2934
|
"aria-hidden": "true",
|
|
2924
2935
|
id: headerElementId,
|
|
2925
|
-
className: styles$
|
|
2936
|
+
className: styles$8.header
|
|
2926
2937
|
}, label), childrenWithContext) : childrenWithContext // Even if the group currently has no filtered children, the children (i.e. options) still need the context so that they can register themselves later on if the input value changes
|
|
2927
2938
|
;
|
|
2928
2939
|
}
|
|
@@ -2941,6 +2952,7 @@ function ComboboxOption(_ref) {
|
|
|
2941
2952
|
activeDescendantElement,
|
|
2942
2953
|
committedInputValue,
|
|
2943
2954
|
setCommittedInputValue,
|
|
2955
|
+
onSubmit,
|
|
2944
2956
|
rootDataTestId,
|
|
2945
2957
|
setHoveredOption
|
|
2946
2958
|
} = useComboboxContext();
|
|
@@ -2974,11 +2986,12 @@ function ComboboxOption(_ref) {
|
|
|
2974
2986
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2975
2987
|
role: "option",
|
|
2976
2988
|
id: containerId,
|
|
2977
|
-
className: classNames__default["default"](styles$
|
|
2978
|
-
[styles$
|
|
2989
|
+
className: classNames__default["default"](styles$8.option, {
|
|
2990
|
+
[styles$8.selected]: isOptionSelected
|
|
2979
2991
|
}),
|
|
2980
2992
|
onClick: () => {
|
|
2981
2993
|
setCommittedInputValue(label);
|
|
2994
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(label);
|
|
2982
2995
|
setIsOpen(false);
|
|
2983
2996
|
setHoveredOption(null);
|
|
2984
2997
|
},
|
|
@@ -2992,10 +3005,10 @@ function ComboboxOption(_ref) {
|
|
|
2992
3005
|
}, label);
|
|
2993
3006
|
}
|
|
2994
3007
|
|
|
2995
|
-
var css_248z$
|
|
2996
|
-
var styles$
|
|
2997
|
-
var stylesheet$
|
|
2998
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
3008
|
+
var css_248z$7 = "._wKU3g{display:flex}._hqLBl{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._hqLBl._LtiBm{background-color:#fff}._hqLBl._DWUOJ,._hqLBl._LtiBm._92PMI:not(._hqLBl._LtiBm._iVUEp),._hqLBl._LtiBm._AF6he.focus-visible:not(._-6XQD),._hqLBl._LtiBm._AF6he:focus-visible:not(._-6XQD){background-color:#0b6ed0}._hqLBl._DWUOJ._-6XQD._AF6he,._hqLBl._DWUOJ._-6XQD._iVUEp,._hqLBl._DWUOJ._iVUEp._92PMI{opacity:.4}._M-7mD{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._M-7mD:focus{z-index:1}._73oWS{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}._73oWS svg{margin-left:1px}._73oWS._LtiBm{background-color:#0b6ed0;border-color:transparent}._73oWS._LtiBm svg{fill:#fff!important}._73oWS._LtiBm:not(._XAt9I):hover{background-color:#085caf!important}._73oWS._LtiBm:not(._XAt9I):active{background-color:#0854a1!important}._73oWS._LtiBm._XAt9I{opacity:.4}._73oWS._LtiBm._XAt9I svg{background-color:transparent}._73oWS._DWUOJ{border-color:#0b6ed0;background-color:#fff}._73oWS._DWUOJ svg{fill:#0b6ed0!important}._73oWS._DWUOJ:not(._XAt9I):hover{background-color:#eef5fc!important}._73oWS._DWUOJ:not(._XAt9I):active{background-color:#e1edf9!important}._73oWS._DWUOJ._XAt9I{opacity:.4}._73oWS._DWUOJ._XAt9I svg{background-color:transparent}._9tgrH{width:260px}";
|
|
3009
|
+
var styles$7 = {"container":"_wKU3g","divider":"_hqLBl","primary":"_LtiBm","mainButtonFocus":"_AF6he","mainButtonDisabled":"_-6XQD","dropdownButtonFocus":"_92PMI","dropdownButtonDisabled":"_iVUEp","secondary":"_DWUOJ","mainButton":"_M-7mD","dropdownButton":"_73oWS","disabled":"_XAt9I","dropdownOption":"_9tgrH"};
|
|
3010
|
+
var stylesheet$7="._wKU3g{display:flex}._hqLBl{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._hqLBl._LtiBm{background-color:#fff}._hqLBl._DWUOJ,._hqLBl._LtiBm._92PMI:not(._hqLBl._LtiBm._iVUEp),._hqLBl._LtiBm._AF6he.focus-visible:not(._-6XQD),._hqLBl._LtiBm._AF6he:focus-visible:not(._-6XQD){background-color:#0b6ed0}._hqLBl._DWUOJ._-6XQD._AF6he,._hqLBl._DWUOJ._-6XQD._iVUEp,._hqLBl._DWUOJ._iVUEp._92PMI{opacity:.4}._M-7mD{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._M-7mD:focus{z-index:1}._73oWS{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}._73oWS svg{margin-left:1px}._73oWS._LtiBm{background-color:#0b6ed0;border-color:transparent}._73oWS._LtiBm svg{fill:#fff!important}._73oWS._LtiBm:not(._XAt9I):hover{background-color:#085caf!important}._73oWS._LtiBm:not(._XAt9I):active{background-color:#0854a1!important}._73oWS._LtiBm._XAt9I{opacity:.4}._73oWS._LtiBm._XAt9I svg{background-color:transparent}._73oWS._DWUOJ{border-color:#0b6ed0;background-color:#fff}._73oWS._DWUOJ svg{fill:#0b6ed0!important}._73oWS._DWUOJ:not(._XAt9I):hover{background-color:#eef5fc!important}._73oWS._DWUOJ:not(._XAt9I):active{background-color:#e1edf9!important}._73oWS._DWUOJ._XAt9I{opacity:.4}._73oWS._DWUOJ._XAt9I svg{background-color:transparent}._9tgrH{width:260px}";
|
|
3011
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$7);}
|
|
2999
3012
|
|
|
3000
3013
|
const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
3001
3014
|
let {
|
|
@@ -3028,14 +3041,14 @@ const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3028
3041
|
});
|
|
3029
3042
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3030
3043
|
"data-testid": dataTestId,
|
|
3031
|
-
className: classNames__default["default"](styles$
|
|
3044
|
+
className: classNames__default["default"](styles$7.container, className),
|
|
3032
3045
|
ref: ref
|
|
3033
3046
|
}, /*#__PURE__*/React__default["default"].createElement(index.Button, {
|
|
3034
3047
|
kind: kind,
|
|
3035
3048
|
"data-testid": index.getSubDataTestId(dataTestId, 'button'),
|
|
3036
|
-
className: classNames__default["default"](styles$
|
|
3037
|
-
[styles$
|
|
3038
|
-
[styles$
|
|
3049
|
+
className: classNames__default["default"](styles$7.mainButton, {
|
|
3050
|
+
[styles$7.disabled]: isButtonDisabled,
|
|
3051
|
+
[styles$7.primary]: kind === 'primary'
|
|
3039
3052
|
}),
|
|
3040
3053
|
onClick: onClick,
|
|
3041
3054
|
disabled: isButtonDisabled,
|
|
@@ -3046,13 +3059,13 @@ const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3046
3059
|
onFocus: () => setMainButtonHasFocus(true),
|
|
3047
3060
|
onBlur: () => setMainButtonHasFocus(false)
|
|
3048
3061
|
}, label), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3049
|
-
className: classNames__default["default"](styles$
|
|
3050
|
-
[styles$
|
|
3051
|
-
[styles$
|
|
3052
|
-
[styles$
|
|
3053
|
-
[styles$
|
|
3054
|
-
[styles$
|
|
3055
|
-
[styles$
|
|
3062
|
+
className: classNames__default["default"](styles$7.divider, {
|
|
3063
|
+
[styles$7.primary]: kind === 'primary',
|
|
3064
|
+
[styles$7.secondary]: kind === 'secondary',
|
|
3065
|
+
[styles$7.mainButtonFocus]: mainButtonHasFocus,
|
|
3066
|
+
[styles$7.dropdownButtonFocus]: dropdownButtonHasFocus,
|
|
3067
|
+
[styles$7.mainButtonDisabled]: isButtonDisabled,
|
|
3068
|
+
[styles$7.dropdownButtonDisabled]: isDropdownDisabled
|
|
3056
3069
|
})
|
|
3057
3070
|
}), /*#__PURE__*/React__default["default"].createElement(index.Dropdown, {
|
|
3058
3071
|
"data-testid": index.getSubDataTestId(dataTestId, 'dropdown'),
|
|
@@ -3064,10 +3077,10 @@ const SplitButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3064
3077
|
// `label` of type `string` adds Dropdown's `isString` class, which causes a css bug in Safari
|
|
3065
3078
|
, {
|
|
3066
3079
|
label: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null),
|
|
3067
|
-
className: classNames__default["default"](styles$
|
|
3068
|
-
[styles$
|
|
3069
|
-
[styles$
|
|
3070
|
-
[styles$
|
|
3080
|
+
className: classNames__default["default"](styles$7.dropdownButton, {
|
|
3081
|
+
[styles$7.disabled]: isDropdownDisabled,
|
|
3082
|
+
[styles$7.primary]: kind === 'primary',
|
|
3083
|
+
[styles$7.secondary]: kind === 'secondary'
|
|
3071
3084
|
}),
|
|
3072
3085
|
ref: dropdownButtonRef,
|
|
3073
3086
|
tabIndex: -1,
|
|
@@ -3089,15 +3102,15 @@ const SplitButtonOption = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3089
3102
|
label: "",
|
|
3090
3103
|
disabled: isDisabled,
|
|
3091
3104
|
onSelect: onClick,
|
|
3092
|
-
className: styles$
|
|
3105
|
+
className: styles$7.dropdownOption,
|
|
3093
3106
|
ref: ref
|
|
3094
3107
|
}, children);
|
|
3095
3108
|
});
|
|
3096
3109
|
|
|
3097
|
-
var css_248z$
|
|
3098
|
-
var styles$
|
|
3099
|
-
var stylesheet$
|
|
3100
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
3110
|
+
var css_248z$6 = "._ZOzRb{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}._ZOzRb:hover:not(._626lm){background-color:rgba(50,54,58,.08)}._ZOzRb:hover:not(._626lm)._SGTqR{border-color:#085caf;background-color:rgba(11,110,208,.04)}._ZOzRb:hover:not(._626lm)._SGTqR ._jGw8N{color:#32363a}._ZOzRb:hover:not(._626lm)._SGTqR ._xhbFD{fill:#32363a}._ZOzRb:hover:not(._626lm)._SGTqR ._2ybld{fill:#085caf}._ZOzRb:hover:not(._626lm)._SGTqR ._iR26-{background-color:rgba(11,110,208,.11)}._ZOzRb:hover:not(._626lm)._SGTqR ._iR26- ._s3CEG{color:#085caf}._ZOzRb:active:not(._626lm){background-color:#e8e9e9}._ZOzRb:active:not(._626lm)._SGTqR{background-color:rgba(11,110,208,.11);border-color:#0854a1}._ZOzRb:active:not(._626lm)._SGTqR ._2ybld{fill:#0854a1}._ZOzRb:active:not(._626lm)._SGTqR ._iR26-{background-color:rgba(11,110,208,.11)}._ZOzRb:active:not(._626lm)._SGTqR ._iR26- ._s3CEG{color:#0854a1}._ZOzRb._626lm{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._ZOzRb._SGTqR{border-color:#0b6ed0}._xhbFD{fill:#515559;margin-right:4px}._jGw8N{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._jGw8N+._iR26-{margin-left:6px}._jGw8N._626lm{color:#74777a}._iR26-{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}._s3CEG{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._2ybld{fill:#515559}._2ybld._626lm,._2ybld._626lm._SGTqR{fill:rgba(116,119,122,.4)}._2ybld._SGTqR{fill:#0b6ed0}._2ybld._GGSa9{transform:rotate(-180deg)}._ZOzRb.focus-visible,._ZOzRb:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
3111
|
+
var styles$6 = {"button":"_ZOzRb","disabled":"_626lm","selected":"_SGTqR","label":"_jGw8N","lockIcon":"_xhbFD","chevronIcon":"_2ybld","selectedFiltersContainer":"_iR26-","selectedFilters":"_s3CEG","open":"_GGSa9"};
|
|
3112
|
+
var stylesheet$6="._ZOzRb{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}._ZOzRb:hover:not(._626lm){background-color:rgba(50,54,58,.08)}._ZOzRb:hover:not(._626lm)._SGTqR{border-color:#085caf;background-color:rgba(11,110,208,.04)}._ZOzRb:hover:not(._626lm)._SGTqR ._jGw8N{color:#32363a}._ZOzRb:hover:not(._626lm)._SGTqR ._xhbFD{fill:#32363a}._ZOzRb:hover:not(._626lm)._SGTqR ._2ybld{fill:#085caf}._ZOzRb:hover:not(._626lm)._SGTqR ._iR26-{background-color:rgba(11,110,208,.11)}._ZOzRb:hover:not(._626lm)._SGTqR ._iR26- ._s3CEG{color:#085caf}._ZOzRb:active:not(._626lm){background-color:#e8e9e9}._ZOzRb:active:not(._626lm)._SGTqR{background-color:rgba(11,110,208,.11);border-color:#0854a1}._ZOzRb:active:not(._626lm)._SGTqR ._2ybld{fill:#0854a1}._ZOzRb:active:not(._626lm)._SGTqR ._iR26-{background-color:rgba(11,110,208,.11)}._ZOzRb:active:not(._626lm)._SGTqR ._iR26- ._s3CEG{color:#0854a1}._ZOzRb._626lm{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._ZOzRb._SGTqR{border-color:#0b6ed0}._xhbFD{fill:#515559;margin-right:4px}._jGw8N{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._jGw8N+._iR26-{margin-left:6px}._jGw8N._626lm{color:#74777a}._iR26-{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}._s3CEG{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._2ybld{fill:#515559}._2ybld._626lm,._2ybld._626lm._SGTqR{fill:rgba(116,119,122,.4)}._2ybld._SGTqR{fill:#0b6ed0}._2ybld._GGSa9{transform:rotate(-180deg)}._ZOzRb.focus-visible,._ZOzRb:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
3113
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$6);}
|
|
3101
3114
|
|
|
3102
3115
|
const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
3103
3116
|
let {
|
|
@@ -3122,22 +3135,22 @@ const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3122
3135
|
} = index.useTranslation();
|
|
3123
3136
|
return /*#__PURE__*/React__default["default"].createElement("button", _extends__default["default"]({}, rest, {
|
|
3124
3137
|
type: "button",
|
|
3125
|
-
className: classNames__default["default"](className, styles$
|
|
3126
|
-
[styles$
|
|
3127
|
-
[styles$
|
|
3138
|
+
className: classNames__default["default"](className, styles$6.button, {
|
|
3139
|
+
[styles$6.disabled]: isDisabled,
|
|
3140
|
+
[styles$6.selected]: !!selectedFilters
|
|
3128
3141
|
}),
|
|
3129
3142
|
onClick: e => {
|
|
3130
3143
|
if (isDisabled) {
|
|
3131
3144
|
e.stopPropagation(); // Prevents "click" events from occurring on parent elements
|
|
3132
3145
|
} else {
|
|
3133
|
-
onClick === null || onClick === void 0
|
|
3146
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
3134
3147
|
}
|
|
3135
3148
|
},
|
|
3136
3149
|
onKeyDown: e => {
|
|
3137
3150
|
if (isDisabled) {
|
|
3138
3151
|
e.stopPropagation(); // Prevents "keydown" events from occurring on parent elements
|
|
3139
3152
|
} else {
|
|
3140
|
-
onKeyDown === null || onKeyDown === void 0
|
|
3153
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
|
|
3141
3154
|
}
|
|
3142
3155
|
},
|
|
3143
3156
|
disabled: undefined // This component uses aria-disabled instead of disabled
|
|
@@ -3150,7 +3163,7 @@ const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3150
3163
|
}), isLocked && /*#__PURE__*/React__default["default"].createElement(icons_index.LockIcon, {
|
|
3151
3164
|
size: "small",
|
|
3152
3165
|
id: lockIconElementId,
|
|
3153
|
-
className: styles$
|
|
3166
|
+
className: styles$6.lockIcon
|
|
3154
3167
|
// @ts-ignore - 'locked' is not in the current list of translations
|
|
3155
3168
|
,
|
|
3156
3169
|
"aria-label": translate('locked')
|
|
@@ -3158,26 +3171,26 @@ const FilterAnchor = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
3158
3171
|
lightTheme: true
|
|
3159
3172
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3160
3173
|
id: labelElementId,
|
|
3161
|
-
className: classNames__default["default"](styles$
|
|
3162
|
-
[styles$
|
|
3174
|
+
className: classNames__default["default"](styles$6.label, {
|
|
3175
|
+
[styles$6.disabled]: isDisabled
|
|
3163
3176
|
})
|
|
3164
3177
|
}, label)), isLoading ? /*#__PURE__*/React__default["default"].createElement(index.LoadingSpinner, {
|
|
3165
3178
|
show: true,
|
|
3166
3179
|
size: "xs",
|
|
3167
3180
|
"aria-label": loadingSpinnerAriaLabel !== null && loadingSpinnerAriaLabel !== void 0 ? loadingSpinnerAriaLabel : translate('loading')
|
|
3168
3181
|
}) : selectedFilters && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3169
|
-
className: styles$
|
|
3182
|
+
className: styles$6.selectedFiltersContainer
|
|
3170
3183
|
}, /*#__PURE__*/React__default["default"].createElement(index.TextOverflowTooltip, {
|
|
3171
3184
|
lightTheme: true
|
|
3172
3185
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3173
3186
|
id: selectedFiltersElementId,
|
|
3174
|
-
className: styles$
|
|
3187
|
+
className: styles$6.selectedFilters
|
|
3175
3188
|
}, selectedFilters))), /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronDownIcon, {
|
|
3176
3189
|
size: "medium",
|
|
3177
|
-
className: classNames__default["default"](styles$
|
|
3178
|
-
[styles$
|
|
3179
|
-
[styles$
|
|
3180
|
-
[styles$
|
|
3190
|
+
className: classNames__default["default"](styles$6.chevronIcon, {
|
|
3191
|
+
[styles$6.disabled]: isDisabled,
|
|
3192
|
+
[styles$6.selected]: !!selectedFilters,
|
|
3193
|
+
[styles$6.open]: isOpen
|
|
3181
3194
|
}),
|
|
3182
3195
|
"aria-hidden": true
|
|
3183
3196
|
}));
|
|
@@ -3187,6 +3200,10 @@ const {
|
|
|
3187
3200
|
useContext: useMenuContext,
|
|
3188
3201
|
Provider: MenuContextProvider
|
|
3189
3202
|
} = index.createContextUtilities();
|
|
3203
|
+
const {
|
|
3204
|
+
useContext: useItemContext,
|
|
3205
|
+
Provider: ItemContextProvider
|
|
3206
|
+
} = index.createContextUtilities({});
|
|
3190
3207
|
const {
|
|
3191
3208
|
useContext: intermediaryUseMenuContext,
|
|
3192
3209
|
Provider: IntermediaryMenuContextProvider
|
|
@@ -3224,15 +3241,18 @@ const Menu = _ref => {
|
|
|
3224
3241
|
isOpen,
|
|
3225
3242
|
onIsOpenChange,
|
|
3226
3243
|
isDisabled,
|
|
3227
|
-
children
|
|
3244
|
+
children,
|
|
3245
|
+
isVirtualizationDisabled
|
|
3228
3246
|
} = _ref;
|
|
3229
3247
|
if (typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) === 'test' && window) {
|
|
3230
3248
|
var _window$ResizeObserve, _window$PointerEvent;
|
|
3231
|
-
window.ResizeObserver = (_window$ResizeObserve = window.ResizeObserver) !== null && _window$ResizeObserve !== void 0 ? _window$ResizeObserve : ResizeObserver;
|
|
3249
|
+
window.ResizeObserver = (_window$ResizeObserve = window.ResizeObserver) !== null && _window$ResizeObserve !== void 0 ? _window$ResizeObserve : resizeObserver.ResizeObserver;
|
|
3232
3250
|
window.PointerEvent = (_window$PointerEvent = window.PointerEvent) !== null && _window$PointerEvent !== void 0 ? _window$PointerEvent : PointerEvent;
|
|
3233
3251
|
}
|
|
3234
3252
|
const [open, setOpen] = index.useControllableState(isOpen, onIsOpenChange, isOpen);
|
|
3253
|
+
const virtuoso = React.useRef(null);
|
|
3235
3254
|
const [maskHeight, setMaskHeight] = React.useState(null);
|
|
3255
|
+
const [maskWidth, setMaskWidth] = React.useState(null);
|
|
3236
3256
|
const [submenus, setSubmenus] = React.useState(new Set());
|
|
3237
3257
|
const triggerRef = React.useRef(null);
|
|
3238
3258
|
const registerSubmenu = (submenuId, submenuIsOpen) => {
|
|
@@ -3246,6 +3266,16 @@ const Menu = _ref => {
|
|
|
3246
3266
|
return clone;
|
|
3247
3267
|
});
|
|
3248
3268
|
};
|
|
3269
|
+
|
|
3270
|
+
// Virtuoso and Radix-Dropdown have conflicting ResizeObserver behavior
|
|
3271
|
+
// according to the author of the error, this is not a problem https://stackoverflow.com/a/50387233/9487902
|
|
3272
|
+
// the virtuoso library author recommends this approach for conflicting libraries https://virtuoso.dev/react-beautiful-dnd/
|
|
3273
|
+
index.useEventListener(window, 'error', e => {
|
|
3274
|
+
if (e.message === 'ResizeObserver loop completed with undelivered notifications.' || e.message === 'ResizeObserver loop limit exceeded') {
|
|
3275
|
+
e.stopImmediatePropagation();
|
|
3276
|
+
e.preventDefault();
|
|
3277
|
+
}
|
|
3278
|
+
});
|
|
3249
3279
|
const openPaneDepth = React.useMemo(() => open ? submenus.size + 1 : 0, [submenus, open]);
|
|
3250
3280
|
const [searchBarConfigs, setSearchBarConfigs] = React.useState([]);
|
|
3251
3281
|
return /*#__PURE__*/React__default["default"].createElement(MenuContextProvider, {
|
|
@@ -3259,7 +3289,11 @@ const Menu = _ref => {
|
|
|
3259
3289
|
open,
|
|
3260
3290
|
triggerRef,
|
|
3261
3291
|
searchBarConfigs,
|
|
3262
|
-
setSearchBarConfigs
|
|
3292
|
+
setSearchBarConfigs,
|
|
3293
|
+
maskWidth,
|
|
3294
|
+
setMaskWidth,
|
|
3295
|
+
virtuoso,
|
|
3296
|
+
isVirtualizationDisabled
|
|
3263
3297
|
}
|
|
3264
3298
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Root, {
|
|
3265
3299
|
open: open,
|
|
@@ -3268,27 +3302,6 @@ const Menu = _ref => {
|
|
|
3268
3302
|
}, children));
|
|
3269
3303
|
};
|
|
3270
3304
|
|
|
3271
|
-
// https://github.com/radix-ui/primitives/issues/420#issuecomment-771615182
|
|
3272
|
-
class ResizeObserver {
|
|
3273
|
-
constructor(cb) {
|
|
3274
|
-
this.cb = cb;
|
|
3275
|
-
}
|
|
3276
|
-
observe() {
|
|
3277
|
-
this.cb([{
|
|
3278
|
-
borderBoxSize: {
|
|
3279
|
-
inlineSize: 0,
|
|
3280
|
-
blockSize: 0
|
|
3281
|
-
}
|
|
3282
|
-
}]);
|
|
3283
|
-
}
|
|
3284
|
-
|
|
3285
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3286
|
-
unobserve() {}
|
|
3287
|
-
|
|
3288
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3289
|
-
disconnect() {}
|
|
3290
|
-
}
|
|
3291
|
-
|
|
3292
3305
|
// https://github.com/radix-ui/primitives/issues/1220#issuecomment-1087465026
|
|
3293
3306
|
class PointerEvent extends Event {
|
|
3294
3307
|
constructor(type, props) {
|
|
@@ -3299,20 +3312,20 @@ class PointerEvent extends Event {
|
|
|
3299
3312
|
}
|
|
3300
3313
|
}
|
|
3301
3314
|
|
|
3302
|
-
var css_248z$
|
|
3303
|
-
var styles$
|
|
3304
|
-
var stylesheet$
|
|
3305
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
3315
|
+
var css_248z$5 = "._P-1qk{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._P-1qk>._avlWI{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}._P-1qk>._avlWI:hover:not([aria-disabled=true]){background-color:#f5f5f5}._P-1qk>._avlWI.focus-visible,._P-1qk>._avlWI:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._P-1qk>._avlWI+._08qYC{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._P-1qk>._avlWI[data-state=open]+._08qYC{transform:rotate(-180deg) translateY(50%)}._P-1qk>._avlWI[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._P-1qk>._avlWI[aria-disabled=true]+._08qYC{fill:#515559;opacity:.4}._gZOPA>[data-radix-popper-content-wrapper]{overflow:hidden;background-color:#fff;max-width:350px;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:var(--mask-z-index)!important;width:var(--mask-width);height:var(--mask-height);transition:height .35s,width .35s}._gZOPA>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._-nrnj{margin:0;padding-bottom:var(--flyout-bottom-padding);background:#fff;transition:margin-left .35s,opacity .35s,height .35s,width .35s;opacity:1;max-width:350px;width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:200px;max-height:var(--flyout-max-height)}._-nrnj ._sDfyk{height:100%;overflow-y:scroll}._-nrnj._zgTUU{margin-left:30px;opacity:0}._-nrnj._lOy6Z{margin-left:-30px}._TTaMv{position:relative;padding:10px 12px;display:flex;flex-direction:row;min-height:40px;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._TTaMv._cWSdL{cursor:unset}._TTaMv ._5244S{fill:#32363a;margin-right:4px}._TTaMv:focus,._TTaMv:hover:not(._TTaMv._cWSdL){background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._TTaMv[aria-disabled=true]{cursor:not-allowed;opacity:.65}._TTaMv._al2zZ{padding-right:32px}._TTaMv._al2zZ ._08qYC{position:absolute;height:100%;right:3px;fill:#515559}._TTaMv._GIP-N{pointer-events:none}._5WkZQ{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;border-bottom:1px solid #e8e8e8}._5WkZQ._eQooQ{padding-top:52px}._uUO-O{pointer-events:none;position:fixed;left:0;top:0;transition:width .35s;min-width:200px;width:var(--mask-width);max-width:350px}._wQQjr{position:absolute;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;opacity:1;width:100%;transition:opacity .35s,margin-left .35s}._wQQjr._lOy6Z{opacity:0}._wQQjr._lOy6Z>._9og9E{margin-left:-30px}._wQQjr._zgTUU{opacity:0}._wQQjr._zgTUU>._9og9E{margin-left:30px}._wQQjr>._9og9E{transition:margin-left .35s;width:100%}._wQQjr._GIP-N{pointer-events:none}body.keyboard-user ._TTaMv:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
3316
|
+
var styles$5 = {"buttonContainer":"_P-1qk","button":"_avlWI","rightIcon":"_08qYC","maskContainer":"_gZOPA","flyout":"_-nrnj","scrollContainer":"_sDfyk","animatedRight":"_zgTUU","animatedLeft":"_lOy6Z","menuItem":"_TTaMv","noItems":"_cWSdL","backIcon":"_5244S","subMenu":"_al2zZ","unresponsive":"_GIP-N","stickyBox":"_5WkZQ","isSearchable":"_eQooQ","searchBoxesContainer":"_uUO-O","searchBox":"_wQQjr","searchInput":"_9og9E"};
|
|
3317
|
+
var stylesheet$5="._P-1qk{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._P-1qk>._avlWI{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}._P-1qk>._avlWI:hover:not([aria-disabled=true]){background-color:#f5f5f5}._P-1qk>._avlWI.focus-visible,._P-1qk>._avlWI:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._P-1qk>._avlWI+._08qYC{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._P-1qk>._avlWI[data-state=open]+._08qYC{transform:rotate(-180deg) translateY(50%)}._P-1qk>._avlWI[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._P-1qk>._avlWI[aria-disabled=true]+._08qYC{fill:#515559;opacity:.4}._gZOPA>[data-radix-popper-content-wrapper]{overflow:hidden;background-color:#fff;max-width:350px;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:var(--mask-z-index)!important;width:var(--mask-width);height:var(--mask-height);transition:height .35s,width .35s}._gZOPA>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._-nrnj{margin:0;padding-bottom:var(--flyout-bottom-padding);background:#fff;transition:margin-left .35s,opacity .35s,height .35s,width .35s;opacity:1;max-width:350px;width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:200px;max-height:var(--flyout-max-height)}._-nrnj ._sDfyk{height:100%;overflow-y:scroll}._-nrnj._zgTUU{margin-left:30px;opacity:0}._-nrnj._lOy6Z{margin-left:-30px}._TTaMv{position:relative;padding:10px 12px;display:flex;flex-direction:row;min-height:40px;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._TTaMv._cWSdL{cursor:unset}._TTaMv ._5244S{fill:#32363a;margin-right:4px}._TTaMv:focus,._TTaMv:hover:not(._TTaMv._cWSdL){background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._TTaMv[aria-disabled=true]{cursor:not-allowed;opacity:.65}._TTaMv._al2zZ{padding-right:32px}._TTaMv._al2zZ ._08qYC{position:absolute;height:100%;right:3px;fill:#515559}._TTaMv._GIP-N{pointer-events:none}._5WkZQ{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;border-bottom:1px solid #e8e8e8}._5WkZQ._eQooQ{padding-top:52px}._uUO-O{pointer-events:none;position:fixed;left:0;top:0;transition:width .35s;min-width:200px;width:var(--mask-width);max-width:350px}._wQQjr{position:absolute;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;opacity:1;width:100%;transition:opacity .35s,margin-left .35s}._wQQjr._lOy6Z{opacity:0}._wQQjr._lOy6Z>._9og9E{margin-left:-30px}._wQQjr._zgTUU{opacity:0}._wQQjr._zgTUU>._9og9E{margin-left:30px}._wQQjr>._9og9E{transition:margin-left .35s;width:100%}._wQQjr._GIP-N{pointer-events:none}body.keyboard-user ._TTaMv:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
3318
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$5);}
|
|
3306
3319
|
|
|
3307
3320
|
/* eslint-disable import/prefer-default-export */
|
|
3308
|
-
const DATA_TESTID_SUFFIXES = {
|
|
3321
|
+
const DATA_TESTID_SUFFIXES$1 = {
|
|
3309
3322
|
MENU_PANE: 'menupane',
|
|
3310
3323
|
MENU_ITEM: 'menuitem',
|
|
3311
3324
|
MENU_BUTTON: 'menubutton',
|
|
3312
3325
|
MENU_SEARCH: 'menusearch',
|
|
3313
3326
|
MENU_BACK: 'menuback'
|
|
3314
3327
|
};
|
|
3315
|
-
const KEYS = {
|
|
3328
|
+
const KEYS$1 = {
|
|
3316
3329
|
OPEN_SUBMENU: ['ArrowRight', 'Enter', ' '],
|
|
3317
3330
|
CLOSE_SUBMENU: ['ArrowLeft'],
|
|
3318
3331
|
NAVIGATE_UP: ['ArrowUp'],
|
|
@@ -3322,6 +3335,30 @@ const KEYS = {
|
|
|
3322
3335
|
IGNORED_BY_SEARCH_INPUT: ['Tab']
|
|
3323
3336
|
};
|
|
3324
3337
|
|
|
3338
|
+
/* eslint-disable import/prefer-default-export */
|
|
3339
|
+
const DATA_TESTID_SUFFIXES = {
|
|
3340
|
+
SELECT_PANE: 'selectpane',
|
|
3341
|
+
SELECT_ITEM: 'selectitem',
|
|
3342
|
+
SELECT_BUTTON: 'selectbutton',
|
|
3343
|
+
SELECT_SEARCH: 'selectsearch',
|
|
3344
|
+
SELECT_BACK: 'selectback'
|
|
3345
|
+
};
|
|
3346
|
+
const KEYS = {
|
|
3347
|
+
CHECK_PARENT: [' ']
|
|
3348
|
+
};
|
|
3349
|
+
|
|
3350
|
+
const {
|
|
3351
|
+
Provider: SelectContextProvider,
|
|
3352
|
+
useContext
|
|
3353
|
+
} = index.createContextUtilities(null);
|
|
3354
|
+
function useSelectContext(isOptional) {
|
|
3355
|
+
const context = useContext();
|
|
3356
|
+
if (!isOptional && !context) {
|
|
3357
|
+
throw Error('useContext must be called inside a provider or be initialized with a default value');
|
|
3358
|
+
}
|
|
3359
|
+
return context;
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3325
3362
|
const AsChildWrapper = _ref => {
|
|
3326
3363
|
let {
|
|
3327
3364
|
asChild,
|
|
@@ -3334,7 +3371,7 @@ const AsChildWrapper = _ref => {
|
|
|
3334
3371
|
content: tooltipContent,
|
|
3335
3372
|
delayMs: 250
|
|
3336
3373
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3337
|
-
className: styles$
|
|
3374
|
+
className: styles$5.buttonContainer
|
|
3338
3375
|
}, children));
|
|
3339
3376
|
};
|
|
3340
3377
|
const MenuButton = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref) => {
|
|
@@ -3350,6 +3387,7 @@ const MenuButton = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref
|
|
|
3350
3387
|
triggerRef
|
|
3351
3388
|
} = useMenuContext();
|
|
3352
3389
|
const isTruncated = index.useIsTruncated(triggerRef);
|
|
3390
|
+
const withinSelect = useSelectContext(true) !== null;
|
|
3353
3391
|
return /*#__PURE__*/React__default["default"].createElement(AsChildWrapper, {
|
|
3354
3392
|
asChild: asChild,
|
|
3355
3393
|
tooltipContent: children,
|
|
@@ -3357,13 +3395,13 @@ const MenuButton = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref
|
|
|
3357
3395
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Trigger, _extends__default["default"]({}, rest, {
|
|
3358
3396
|
"aria-disabled": isDisabled,
|
|
3359
3397
|
className: classNames__default["default"](className, {
|
|
3360
|
-
[styles$
|
|
3398
|
+
[styles$5.button]: !asChild
|
|
3361
3399
|
}),
|
|
3362
3400
|
asChild: asChild,
|
|
3363
3401
|
ref: index.mergeRefs(triggerRef, ref),
|
|
3364
|
-
"data-testid": index.getSubDataTestId(rootDataTestId, DATA_TESTID_SUFFIXES.MENU_BUTTON)
|
|
3402
|
+
"data-testid": index.getSubDataTestId(rootDataTestId, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_BUTTON : DATA_TESTID_SUFFIXES$1.MENU_BUTTON)
|
|
3365
3403
|
}), children), !asChild && /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronDownIcon, {
|
|
3366
|
-
className: styles$
|
|
3404
|
+
className: styles$5.rightIcon,
|
|
3367
3405
|
"aria-hidden": "true"
|
|
3368
3406
|
}));
|
|
3369
3407
|
});
|
|
@@ -3379,10 +3417,10 @@ const MenuSearch = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
3379
3417
|
searchPlaceholder
|
|
3380
3418
|
} = _ref;
|
|
3381
3419
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3382
|
-
className: classNames__default["default"](styles$
|
|
3383
|
-
[styles$
|
|
3384
|
-
[styles$
|
|
3385
|
-
[styles$
|
|
3420
|
+
className: classNames__default["default"](styles$5.searchBox, {
|
|
3421
|
+
[styles$5.unresponsive]: !isInteractive,
|
|
3422
|
+
[styles$5.animatedLeft]: animatedLeft,
|
|
3423
|
+
[styles$5.animatedRight]: animatedRight
|
|
3386
3424
|
}),
|
|
3387
3425
|
ref: ref
|
|
3388
3426
|
}, /*#__PURE__*/React__default["default"].createElement(index.Input$1, {
|
|
@@ -3392,17 +3430,67 @@ const MenuSearch = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
3392
3430
|
onChange: e => setSearchValue(e.target.value),
|
|
3393
3431
|
placeholder: searchPlaceholder,
|
|
3394
3432
|
leftAddOn: /*#__PURE__*/React__default["default"].createElement(icons_index.SearchIcon, null),
|
|
3395
|
-
className: styles$
|
|
3433
|
+
className: styles$5.searchInput
|
|
3396
3434
|
}));
|
|
3397
3435
|
});
|
|
3398
3436
|
|
|
3437
|
+
/*
|
|
3438
|
+
this hook returns a method that
|
|
3439
|
+
1. Scrolls to the top or bottom boundary of a virtual list
|
|
3440
|
+
2. waits until the `visibleChildren` prop has updated completely
|
|
3441
|
+
3. Uses `visibleChildren`'s ref to focus.
|
|
3442
|
+
*/
|
|
3443
|
+
const useFocusVirtualBoundary = function (visibleChildren) {
|
|
3444
|
+
let backButtonRef = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
3445
|
+
const [scrollComplete, setScrollComplete] = React.useState(null);
|
|
3446
|
+
const {
|
|
3447
|
+
virtuoso
|
|
3448
|
+
} = useMenuContext();
|
|
3449
|
+
index.useDidUpdate(() => {
|
|
3450
|
+
window.requestAnimationFrame(() => {
|
|
3451
|
+
if (scrollComplete && visibleChildren[visibleChildren.length - 1].element.current) {
|
|
3452
|
+
if (scrollComplete === 'top' && backButtonRef !== null && backButtonRef !== void 0 && backButtonRef.current) {
|
|
3453
|
+
backButtonRef === null || backButtonRef === void 0 || backButtonRef.current.focus();
|
|
3454
|
+
} else {
|
|
3455
|
+
var _visibleChildren;
|
|
3456
|
+
(_visibleChildren = visibleChildren[scrollComplete === 'bottom' ? visibleChildren.length - 1 : 0]) === null || _visibleChildren === void 0 || (_visibleChildren = _visibleChildren.element) === null || _visibleChildren === void 0 || (_visibleChildren = _visibleChildren.current) === null || _visibleChildren === void 0 || _visibleChildren.focus();
|
|
3457
|
+
}
|
|
3458
|
+
setScrollComplete(null);
|
|
3459
|
+
}
|
|
3460
|
+
});
|
|
3461
|
+
}, [visibleChildren, scrollComplete]);
|
|
3462
|
+
return topOrBottom => {
|
|
3463
|
+
var _virtuoso$current;
|
|
3464
|
+
(_virtuoso$current = virtuoso.current) === null || _virtuoso$current === void 0 || _virtuoso$current.scrollToIndex({
|
|
3465
|
+
index: topOrBottom === 'top' ? 0 : 'LAST',
|
|
3466
|
+
behavior: 'auto'
|
|
3467
|
+
});
|
|
3468
|
+
setScrollComplete(topOrBottom);
|
|
3469
|
+
};
|
|
3470
|
+
};
|
|
3471
|
+
|
|
3399
3472
|
// abstracts the logic required for searching by both `MenuPane` and `SubMenu`
|
|
3400
3473
|
// creates a searchBarConfig, which maps to an instance of `MenuSearch`
|
|
3401
3474
|
// returns values that are necessary for use within pane
|
|
3402
|
-
function usePaneSearch(
|
|
3475
|
+
function usePaneSearch(_ref) {
|
|
3403
3476
|
var _searchRef$current$qu, _searchRef$current;
|
|
3404
|
-
let
|
|
3405
|
-
|
|
3477
|
+
let {
|
|
3478
|
+
isSearchable,
|
|
3479
|
+
externalSearchValue,
|
|
3480
|
+
onSearchValueChange,
|
|
3481
|
+
items,
|
|
3482
|
+
animatedLeft,
|
|
3483
|
+
animatedRight,
|
|
3484
|
+
menuParentDataTestId,
|
|
3485
|
+
id,
|
|
3486
|
+
flyoutRef,
|
|
3487
|
+
children,
|
|
3488
|
+
isSearchFilteringDisabled,
|
|
3489
|
+
backButtonRef,
|
|
3490
|
+
closeSubmenu,
|
|
3491
|
+
isVirtualized
|
|
3492
|
+
} = _ref;
|
|
3493
|
+
const withinSelect = useSelectContext(true) !== null;
|
|
3406
3494
|
const [internalSearchValue, setSearchValue] = index.useControllableState(externalSearchValue, onSearchValueChange, externalSearchValue);
|
|
3407
3495
|
const [zeroSearchResults, setZeroSearchResults] = React.useState();
|
|
3408
3496
|
const {
|
|
@@ -3410,22 +3498,34 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3410
3498
|
} = index.useTranslation();
|
|
3411
3499
|
const noMatchesText = translate('menu.noItemsToDisplay');
|
|
3412
3500
|
const searchPlaceholder = translate('searchText');
|
|
3501
|
+
const filteredChildren = React.useMemo(() => (Array.isArray(children) ? children : [children]).filter(_ref2 => {
|
|
3502
|
+
var _props$label, _searchMatcher$toLowe;
|
|
3503
|
+
let {
|
|
3504
|
+
props
|
|
3505
|
+
} = _ref2;
|
|
3506
|
+
if (!props || !internalSearchValue || isSearchFilteringDisabled) {
|
|
3507
|
+
return true;
|
|
3508
|
+
}
|
|
3509
|
+
const searchMatcher = (_props$label = props.label) !== null && _props$label !== void 0 ? _props$label : typeof props.children === 'string' ? props.children : undefined;
|
|
3510
|
+
return searchMatcher === null || searchMatcher === void 0 || (_searchMatcher$toLowe = searchMatcher.toLowerCase) === null || _searchMatcher$toLowe === void 0 ? void 0 : _searchMatcher$toLowe.call(searchMatcher).includes(internalSearchValue.toLowerCase());
|
|
3511
|
+
}), [internalSearchValue, children, isSearchFilteringDisabled]);
|
|
3512
|
+
const focusVirtualBoundary = useFocusVirtualBoundary(items, backButtonRef);
|
|
3413
3513
|
React.useEffect(() => setZeroSearchResults((items === null || items === void 0 ? void 0 : items.filter(item => item.element.current).length) === 0), [items, internalSearchValue]);
|
|
3414
3514
|
const searchRef = React.useRef(null);
|
|
3415
3515
|
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;
|
|
3416
|
-
const
|
|
3516
|
+
const getFirstVisibleItem = () => {
|
|
3417
3517
|
var _backButtonRef$curren, _items$find;
|
|
3418
3518
|
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;
|
|
3419
3519
|
};
|
|
3420
|
-
const
|
|
3520
|
+
const getLastVisibleItem = () => {
|
|
3421
3521
|
var _findLast$element$cur, _findLast;
|
|
3422
3522
|
return (// our tsconfig does not target a recent enough version to use `Array.prototype.findLast`
|
|
3423
3523
|
(_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
|
|
3424
3524
|
);
|
|
3425
3525
|
};
|
|
3426
3526
|
index.useEventListener(flyoutRef, 'keydown', e => {
|
|
3427
|
-
if (KEYS.NAVIGATE_UP.includes(e.key) && e.target ===
|
|
3428
|
-
searchInput === null || searchInput === void 0
|
|
3527
|
+
if (KEYS$1.NAVIGATE_UP.includes(e.key) && e.target === getFirstVisibleItem() || KEYS$1.NAVIGATE_DOWN.includes(e.key) && e.target === getLastVisibleItem()) {
|
|
3528
|
+
searchInput === null || searchInput === void 0 || searchInput.focus();
|
|
3429
3529
|
}
|
|
3430
3530
|
}, {
|
|
3431
3531
|
additionalDependencies: [flyoutRef.current],
|
|
@@ -3435,24 +3535,32 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3435
3535
|
index.useEventListener(searchInput, 'keydown', e => {
|
|
3436
3536
|
var _e$target;
|
|
3437
3537
|
lastestKeyPressedInSearchInput.current = e.key;
|
|
3438
|
-
if ([...KEYS.NAVIGATE_DOWN, ...KEYS.NAVIGATE_TOP].includes(e.key)) {
|
|
3439
|
-
var _getFirstNonNullItem;
|
|
3538
|
+
if ([...KEYS$1.NAVIGATE_DOWN, ...KEYS$1.NAVIGATE_TOP].includes(e.key)) {
|
|
3440
3539
|
// prevent scrolling
|
|
3441
3540
|
e.preventDefault();
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3541
|
+
if (isVirtualized) {
|
|
3542
|
+
focusVirtualBoundary('top');
|
|
3543
|
+
} else {
|
|
3544
|
+
var _getFirstVisibleItem;
|
|
3545
|
+
(_getFirstVisibleItem = getFirstVisibleItem()) === null || _getFirstVisibleItem === void 0 || _getFirstVisibleItem.focus();
|
|
3546
|
+
}
|
|
3547
|
+
} else if ([...KEYS$1.NAVIGATE_UP, ...KEYS$1.NAVIIGATE_BOTTOM].includes(e.key)) {
|
|
3445
3548
|
// prevent scrolling
|
|
3446
3549
|
e.preventDefault();
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3550
|
+
if (isVirtualized) {
|
|
3551
|
+
focusVirtualBoundary('bottom');
|
|
3552
|
+
} else {
|
|
3553
|
+
var _getLastVisibleItem;
|
|
3554
|
+
(_getLastVisibleItem = getLastVisibleItem()) === null || _getLastVisibleItem === void 0 || _getLastVisibleItem.focus();
|
|
3555
|
+
}
|
|
3556
|
+
} else if (KEYS$1.CLOSE_SUBMENU.includes(e.key) && ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.selectionStart) === 0) {
|
|
3557
|
+
closeSubmenu === null || closeSubmenu === void 0 || closeSubmenu(e);
|
|
3558
|
+
} else if (KEYS$1.IGNORED_BY_SEARCH_INPUT.includes(e.key)) {
|
|
3451
3559
|
e.preventDefault();
|
|
3452
3560
|
}
|
|
3453
3561
|
});
|
|
3454
3562
|
index.useEventListener(searchInput, 'blur', () => {
|
|
3455
|
-
const refocus = ![...KEYS.NAVIGATE_DOWN, ...KEYS.NAVIGATE_UP, ...KEYS.NAVIGATE_TOP, ...KEYS.NAVIIGATE_BOTTOM].includes(lastestKeyPressedInSearchInput.current) && !animatedLeft && !animatedRight && searchInput;
|
|
3563
|
+
const refocus = ![...KEYS$1.NAVIGATE_DOWN, ...KEYS$1.NAVIGATE_UP, ...KEYS$1.NAVIGATE_TOP, ...KEYS$1.NAVIIGATE_BOTTOM].includes(lastestKeyPressedInSearchInput.current) && !animatedLeft && !animatedRight && searchInput;
|
|
3456
3564
|
lastestKeyPressedInSearchInput.current = undefined;
|
|
3457
3565
|
if (refocus) {
|
|
3458
3566
|
searchInput.focus();
|
|
@@ -3468,7 +3576,7 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3468
3576
|
}) && e.preventDefault(), [searchBarConfigs]);
|
|
3469
3577
|
React.useEffect(() => {
|
|
3470
3578
|
if (!isSearchable) {
|
|
3471
|
-
return
|
|
3579
|
+
return;
|
|
3472
3580
|
}
|
|
3473
3581
|
setSearchBarConfigs(configs => {
|
|
3474
3582
|
const configsClone = [...configs];
|
|
@@ -3477,7 +3585,7 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3477
3585
|
isInteractive: !animatedLeft && !animatedRight,
|
|
3478
3586
|
animatedLeft,
|
|
3479
3587
|
animatedRight,
|
|
3480
|
-
dataTestId: menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_SEARCH),
|
|
3588
|
+
dataTestId: menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_SEARCH : DATA_TESTID_SUFFIXES$1.MENU_SEARCH),
|
|
3481
3589
|
setSearchValue,
|
|
3482
3590
|
ref: searchRef,
|
|
3483
3591
|
id,
|
|
@@ -3491,24 +3599,28 @@ function usePaneSearch(isSearchable, externalSearchValue, onSearchValueChange, i
|
|
|
3491
3599
|
}
|
|
3492
3600
|
return configsClone;
|
|
3493
3601
|
});
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
},
|
|
3602
|
+
}, [isSearchable, searchPlaceholder, setSearchBarConfigs, internalSearchValue, animatedLeft, animatedRight, menuParentDataTestId, setSearchValue, searchRef, id, withinSelect]);
|
|
3603
|
+
React.useEffect(() => () => setSearchBarConfigs(configs => {
|
|
3604
|
+
const configIndex = configs.findIndex(config => config.id === id);
|
|
3605
|
+
if (configIndex === -1) {
|
|
3606
|
+
return configs;
|
|
3607
|
+
}
|
|
3608
|
+
const configsClone = [...configs];
|
|
3609
|
+
configsClone.splice(configIndex, 1);
|
|
3610
|
+
return configsClone;
|
|
3611
|
+
}),
|
|
3612
|
+
// Omitted dependencies because we only want this to run on unmount
|
|
3613
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3614
|
+
[]);
|
|
3504
3615
|
const noSearchResultsNode = zeroSearchResults && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3505
|
-
className: classNames__default["default"](styles$
|
|
3616
|
+
className: classNames__default["default"](styles$5.menuItem, styles$5.noItems),
|
|
3506
3617
|
"aria-live": "assertive"
|
|
3507
3618
|
}, noMatchesText);
|
|
3508
3619
|
return {
|
|
3509
3620
|
internalSearchValue,
|
|
3510
3621
|
noSearchResultsNode,
|
|
3511
|
-
onInteractOutside
|
|
3622
|
+
onInteractOutside,
|
|
3623
|
+
filteredChildren
|
|
3512
3624
|
};
|
|
3513
3625
|
}
|
|
3514
3626
|
|
|
@@ -3520,16 +3632,16 @@ const useMutationObserver = (target, options, onMutate) => React.useEffect(() =>
|
|
|
3520
3632
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3521
3633
|
args[_key] = arguments[_key];
|
|
3522
3634
|
}
|
|
3523
|
-
onMutate === null || onMutate === void 0
|
|
3635
|
+
onMutate === null || onMutate === void 0 || onMutate(...args);
|
|
3524
3636
|
});
|
|
3525
3637
|
observer.observe(target, options);
|
|
3526
3638
|
return () => observer.disconnect();
|
|
3527
3639
|
}, [target, options, onMutate]);
|
|
3528
3640
|
|
|
3529
|
-
var css_248z$
|
|
3530
|
-
var styles$
|
|
3531
|
-
var stylesheet$
|
|
3532
|
-
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$
|
|
3641
|
+
var css_248z$4 = "._1iXuo{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}._-d2as{visibility:hidden}";
|
|
3642
|
+
var styles$4 = {"overlay":"_1iXuo","hidden":"_-d2as"};
|
|
3643
|
+
var stylesheet$4="._1iXuo{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}._-d2as{visibility:hidden}";
|
|
3644
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$4);}
|
|
3533
3645
|
|
|
3534
3646
|
/**
|
|
3535
3647
|
* Adds an overlay to an area that obscures visibility and disables background elements.
|
|
@@ -3557,10 +3669,10 @@ const useOverlay = _ref => {
|
|
|
3557
3669
|
const containerNode = (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body;
|
|
3558
3670
|
const overlay = document.createElement('div');
|
|
3559
3671
|
overlay.id = overlayId;
|
|
3560
|
-
overlay.classList.add(styles$
|
|
3672
|
+
overlay.classList.add(styles$4.overlay);
|
|
3561
3673
|
if (onClick) overlay.addEventListener('click', onClick);
|
|
3562
3674
|
if (dataTestId) overlay.dataset.testid = dataTestId;
|
|
3563
|
-
if (!isVisible) overlay.classList.add(styles$
|
|
3675
|
+
if (!isVisible) overlay.classList.add(styles$4.hidden);
|
|
3564
3676
|
if (zIndex || zIndex === 0) overlay.style.zIndex = zIndex.toString();
|
|
3565
3677
|
if (opacity || opacity === 0) overlay.style.opacity = opacity.toString();
|
|
3566
3678
|
containerNode.appendChild(overlay);
|
|
@@ -3569,7 +3681,7 @@ const useOverlay = _ref => {
|
|
|
3569
3681
|
containerNode.style.position = 'static';
|
|
3570
3682
|
containerNode.removeChild(overlay);
|
|
3571
3683
|
};
|
|
3572
|
-
}, [containerRef, overlayId, isVisible, onClick, dataTestId, zIndex]);
|
|
3684
|
+
}, [containerRef, overlayId, isVisible, onClick, dataTestId, zIndex, opacity]);
|
|
3573
3685
|
React.useEffect(() => {
|
|
3574
3686
|
var _containerRef$current2;
|
|
3575
3687
|
const containerNode = (_containerRef$current2 = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current2 !== void 0 ? _containerRef$current2 : document.body;
|
|
@@ -3578,12 +3690,12 @@ const useOverlay = _ref => {
|
|
|
3578
3690
|
Array.from(containerNode.children).forEach(child => {
|
|
3579
3691
|
if (!ignoreIds.includes(child.id) && child.id !== overlayId) child.setAttribute('inert', '');
|
|
3580
3692
|
});
|
|
3581
|
-
overlayNode === null || overlayNode === void 0
|
|
3693
|
+
overlayNode === null || overlayNode === void 0 || overlayNode.classList.remove(styles$4.hidden);
|
|
3582
3694
|
} else {
|
|
3583
3695
|
Array.from(containerNode.children).forEach(child => {
|
|
3584
3696
|
child.removeAttribute('inert');
|
|
3585
3697
|
});
|
|
3586
|
-
overlayNode === null || overlayNode === void 0
|
|
3698
|
+
overlayNode === null || overlayNode === void 0 || overlayNode.classList.add(styles$4.hidden);
|
|
3587
3699
|
}
|
|
3588
3700
|
return () => {
|
|
3589
3701
|
Array.from(containerNode.children).forEach(child => {
|
|
@@ -3597,11 +3709,268 @@ const useCSSVariable = function (name, value) {
|
|
|
3597
3709
|
let dependencies = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
3598
3710
|
React.useEffect(() => {
|
|
3599
3711
|
document.documentElement.style.setProperty(name, value !== null && value !== void 0 ? value : null);
|
|
3600
|
-
}, [value, ...dependencies]);
|
|
3712
|
+
}, [value, name, ...dependencies]);
|
|
3713
|
+
};
|
|
3714
|
+
|
|
3715
|
+
const SubSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
3716
|
+
let {
|
|
3717
|
+
label,
|
|
3718
|
+
onIsOpenChange,
|
|
3719
|
+
children,
|
|
3720
|
+
isDisabled,
|
|
3721
|
+
...rest
|
|
3722
|
+
} = _ref;
|
|
3723
|
+
const paneId = index.useId();
|
|
3724
|
+
const selectContext = useSelectContext();
|
|
3725
|
+
const {
|
|
3726
|
+
selectedValues,
|
|
3727
|
+
GetSelectItemsFrom,
|
|
3728
|
+
setSelectedValues
|
|
3729
|
+
} = selectContext;
|
|
3730
|
+
const allSelectItemChildren = React.useMemo(() => {
|
|
3731
|
+
var _GetSelectItemsFrom;
|
|
3732
|
+
return (_GetSelectItemsFrom = GetSelectItemsFrom === null || GetSelectItemsFrom === void 0 ? void 0 : GetSelectItemsFrom(children)) !== null && _GetSelectItemsFrom !== void 0 ? _GetSelectItemsFrom : [];
|
|
3733
|
+
}, [children, GetSelectItemsFrom]);
|
|
3734
|
+
const checkedState = React.useMemo(() => {
|
|
3735
|
+
const selectedChildCount = allSelectItemChildren.filter(_ref2 => {
|
|
3736
|
+
let [value] = _ref2;
|
|
3737
|
+
return Array.isArray(selectedValues) ? selectedValues.includes(value) : selectedValues === value;
|
|
3738
|
+
}).length;
|
|
3739
|
+
const childCount = allSelectItemChildren.length;
|
|
3740
|
+
let result = 'mixed';
|
|
3741
|
+
if (selectedChildCount === childCount) {
|
|
3742
|
+
result = 'true';
|
|
3743
|
+
} else if (selectedChildCount === 0) {
|
|
3744
|
+
result = 'false';
|
|
3745
|
+
}
|
|
3746
|
+
return result;
|
|
3747
|
+
}, [allSelectItemChildren, selectedValues]);
|
|
3748
|
+
const onTriggerCheckboxSelect = e => {
|
|
3749
|
+
if (isDisabled) {
|
|
3750
|
+
return;
|
|
3751
|
+
}
|
|
3752
|
+
e === null || e === void 0 || e.stopPropagation();
|
|
3753
|
+
setSelectedValues === null || setSelectedValues === void 0 || setSelectedValues(previouslySelectedValues => {
|
|
3754
|
+
// exclude duplicates
|
|
3755
|
+
const prevSet = new Set(previouslySelectedValues);
|
|
3756
|
+
if (checkedState === 'true') {
|
|
3757
|
+
allSelectItemChildren.forEach(_ref3 => {
|
|
3758
|
+
let [value] = _ref3;
|
|
3759
|
+
return prevSet.delete(value);
|
|
3760
|
+
});
|
|
3761
|
+
} else {
|
|
3762
|
+
allSelectItemChildren.forEach(_ref4 => {
|
|
3763
|
+
let [value] = _ref4;
|
|
3764
|
+
return prevSet.add(value);
|
|
3765
|
+
});
|
|
3766
|
+
}
|
|
3767
|
+
return Array.from(prevSet);
|
|
3768
|
+
});
|
|
3769
|
+
};
|
|
3770
|
+
const subSelectPaneProps = {
|
|
3771
|
+
role: 'group',
|
|
3772
|
+
id: paneId
|
|
3773
|
+
};
|
|
3774
|
+
const subSelectTriggerProps = {
|
|
3775
|
+
role: 'treeitem',
|
|
3776
|
+
'aria-haspopup': undefined,
|
|
3777
|
+
'aria-owns': paneId
|
|
3778
|
+
};
|
|
3779
|
+
const sharedSubMenuProps = {
|
|
3780
|
+
...rest,
|
|
3781
|
+
isDisabled,
|
|
3782
|
+
onIsOpenChange,
|
|
3783
|
+
label,
|
|
3784
|
+
ref
|
|
3785
|
+
};
|
|
3786
|
+
return /*#__PURE__*/React__default["default"].createElement(SelectContextProvider, {
|
|
3787
|
+
value: {
|
|
3788
|
+
...selectContext,
|
|
3789
|
+
subSelectTriggerProps,
|
|
3790
|
+
subSelectPaneProps,
|
|
3791
|
+
triggerCheckedState: checkedState,
|
|
3792
|
+
onTriggerCheckboxSelect
|
|
3793
|
+
}
|
|
3794
|
+
}, /*#__PURE__*/React__default["default"].createElement(SubMenu$1, sharedSubMenuProps, children));
|
|
3795
|
+
});
|
|
3796
|
+
|
|
3797
|
+
var css_248z$3 = "._slREa{box-shadow:inset 0 0 0 1px #b00!important}._mOaSA{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._lawCe{background-color:rgba(11,110,208,.08);font-weight:500}";
|
|
3798
|
+
var styles$3 = {"isInvalid":"_slREa","checkbox":"_mOaSA","selectedItem":"_lawCe"};
|
|
3799
|
+
var stylesheet$3="._slREa{box-shadow:inset 0 0 0 1px #b00!important}._mOaSA{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._lawCe{background-color:rgba(11,110,208,.08);font-weight:500}";
|
|
3800
|
+
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$3);}
|
|
3801
|
+
|
|
3802
|
+
const SelectItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
3803
|
+
let {
|
|
3804
|
+
isDisabled,
|
|
3805
|
+
label,
|
|
3806
|
+
value,
|
|
3807
|
+
children,
|
|
3808
|
+
className,
|
|
3809
|
+
...rest
|
|
3810
|
+
} = _ref;
|
|
3811
|
+
const {
|
|
3812
|
+
multiselect,
|
|
3813
|
+
selectedSelectItems,
|
|
3814
|
+
onItemSelect
|
|
3815
|
+
} = useSelectContext();
|
|
3816
|
+
const isSelected = selectedSelectItems.has(value);
|
|
3817
|
+
const sharedMenuItemProps = {
|
|
3818
|
+
ref,
|
|
3819
|
+
label,
|
|
3820
|
+
isDisabled
|
|
3821
|
+
};
|
|
3822
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem$1, _extends__default["default"]({}, rest, sharedMenuItemProps, {
|
|
3823
|
+
className: classNames__default["default"](className, {
|
|
3824
|
+
[styles$3.selectedItem]: isSelected
|
|
3825
|
+
}),
|
|
3826
|
+
asChild: true,
|
|
3827
|
+
onSelect: () => onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(value, !isSelected)
|
|
3828
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3829
|
+
"aria-selected": isSelected,
|
|
3830
|
+
role: "treeitem"
|
|
3831
|
+
}, multiselect ? /*#__PURE__*/React__default["default"].createElement(AdvancedTableCheckbox, {
|
|
3832
|
+
state: isSelected ? 'true' : 'false',
|
|
3833
|
+
className: styles$3.checkbox,
|
|
3834
|
+
isDisabled: isDisabled
|
|
3835
|
+
}) : null, children !== null && children !== void 0 ? children : label));
|
|
3836
|
+
});
|
|
3837
|
+
|
|
3838
|
+
const SelectedItems = () => {
|
|
3839
|
+
const selectContext = useSelectContext();
|
|
3840
|
+
const {
|
|
3841
|
+
selectedSelectItems,
|
|
3842
|
+
enabledSelectItems
|
|
3843
|
+
} = selectContext;
|
|
3844
|
+
const [displayedItems, setDisplayedItems] = React.useState(selectedSelectItems);
|
|
3845
|
+
const [open, setOpen] = React.useState(false);
|
|
3846
|
+
const {
|
|
3847
|
+
translate
|
|
3848
|
+
} = index.useTranslation();
|
|
3849
|
+
React.useEffect(() => {
|
|
3850
|
+
if (open) {
|
|
3851
|
+
setDisplayedItems(selectedSelectItems);
|
|
3852
|
+
}
|
|
3853
|
+
// Display items should only update on open
|
|
3854
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3855
|
+
}, [open]);
|
|
3856
|
+
return /*#__PURE__*/React__default["default"].createElement(SelectContextProvider, {
|
|
3857
|
+
value: {
|
|
3858
|
+
...selectContext,
|
|
3859
|
+
isSelectedItems: true
|
|
3860
|
+
}
|
|
3861
|
+
}, /*#__PURE__*/React__default["default"].createElement(SubSelect, {
|
|
3862
|
+
onIsOpenChange: setOpen,
|
|
3863
|
+
label: translate('selectedItems')
|
|
3864
|
+
}, Array.from(displayedItems, _ref => {
|
|
3865
|
+
let [value, label] = _ref;
|
|
3866
|
+
return /*#__PURE__*/React__default["default"].createElement(SelectItem, {
|
|
3867
|
+
label: label,
|
|
3868
|
+
key: value,
|
|
3869
|
+
value: value,
|
|
3870
|
+
isDisabled: !enabledSelectItems.has(value)
|
|
3871
|
+
});
|
|
3872
|
+
})));
|
|
3873
|
+
};
|
|
3874
|
+
|
|
3875
|
+
const PaneChildren = _ref => {
|
|
3876
|
+
var _useSelectContext, _containerRef$current, _containerRef$current2;
|
|
3877
|
+
let {
|
|
3878
|
+
children
|
|
3879
|
+
} = _ref;
|
|
3880
|
+
const {
|
|
3881
|
+
virtuoso
|
|
3882
|
+
} = useMenuContext();
|
|
3883
|
+
const {
|
|
3884
|
+
multiselect,
|
|
3885
|
+
showSelectedItemsPane
|
|
3886
|
+
} = (_useSelectContext = useSelectContext(true)) !== null && _useSelectContext !== void 0 ? _useSelectContext : {};
|
|
3887
|
+
const {
|
|
3888
|
+
closeSubmenu: containedWithinSubpane,
|
|
3889
|
+
isVirtualized
|
|
3890
|
+
} = usePaneContext();
|
|
3891
|
+
const containerRef = React.useRef(null);
|
|
3892
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3893
|
+
ref: containerRef,
|
|
3894
|
+
className: styles$5.scrollContainer,
|
|
3895
|
+
style: {
|
|
3896
|
+
maxHeight: "calc(var(--flyout-max-height) -\n ".concat((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetTop, "px -\n var(--flyout-bottom-padding))")
|
|
3897
|
+
}
|
|
3898
|
+
}, isVirtualized ? /*#__PURE__*/React__default["default"].createElement(reactVirtuoso.Virtuoso, {
|
|
3899
|
+
ref: virtuoso,
|
|
3900
|
+
increaseViewportBy: 250,
|
|
3901
|
+
customScrollParent: (_containerRef$current2 = containerRef.current) !== null && _containerRef$current2 !== void 0 ? _containerRef$current2 : undefined,
|
|
3902
|
+
data: Array.isArray(children) ? children : [children],
|
|
3903
|
+
itemContent: (index, child) => ! /*#__PURE__*/React__default["default"].isValidElement(child) ? null : /*#__PURE__*/React__default["default"].createElement(ItemContextProvider, {
|
|
3904
|
+
value: {
|
|
3905
|
+
virtualIndex: index + (multiselect && showSelectedItemsPane && !containedWithinSubpane ? 1 : 0)
|
|
3906
|
+
}
|
|
3907
|
+
}, child)
|
|
3908
|
+
}) : /*#__PURE__*/React__default["default"].createElement(ItemContextProvider, {
|
|
3909
|
+
value: {
|
|
3910
|
+
virtualIndex: undefined
|
|
3911
|
+
}
|
|
3912
|
+
}, children));
|
|
3913
|
+
};
|
|
3914
|
+
|
|
3915
|
+
const useIsVirtualized = function (children) {
|
|
3916
|
+
let isVirtualizationDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
3917
|
+
return React.useMemo(() => !isVirtualizationDisabled && React__default["default"].Children.count(children) >= 25, [children, isVirtualizationDisabled]);
|
|
3918
|
+
};
|
|
3919
|
+
|
|
3920
|
+
const useMaskDimensions = (target, animatedLeft, paneDepth, children) => {
|
|
3921
|
+
var _process$env;
|
|
3922
|
+
const {
|
|
3923
|
+
setMaskHeight,
|
|
3924
|
+
maskHeight,
|
|
3925
|
+
setMaskWidth,
|
|
3926
|
+
openPaneDepth,
|
|
3927
|
+
open
|
|
3928
|
+
} = useMenuContext();
|
|
3929
|
+
const updateMaskDimensions = () => {
|
|
3930
|
+
if (target) {
|
|
3931
|
+
setMaskHeight(target.clientHeight);
|
|
3932
|
+
setMaskWidth(target.clientWidth);
|
|
3933
|
+
}
|
|
3934
|
+
};
|
|
3935
|
+
const auto = 'auto';
|
|
3936
|
+
|
|
3937
|
+
// resets dimensions on menu close, so that the top-level pane reopens immediately, rather than animating
|
|
3938
|
+
React.useEffect(() => {
|
|
3939
|
+
if (!open) {
|
|
3940
|
+
setMaskHeight(auto);
|
|
3941
|
+
setMaskWidth(auto);
|
|
3942
|
+
}
|
|
3943
|
+
}, [open, setMaskHeight, setMaskWidth]);
|
|
3944
|
+
|
|
3945
|
+
// handles async children adjustments by consumer
|
|
3946
|
+
index.useDidUpdate(() => {
|
|
3947
|
+
if (paneDepth === openPaneDepth) {
|
|
3948
|
+
updateMaskDimensions();
|
|
3949
|
+
}
|
|
3950
|
+
},
|
|
3951
|
+
// ignoring other dependencies because this should only run when the children change
|
|
3952
|
+
[children]);
|
|
3953
|
+
|
|
3954
|
+
// handles returning to this pane by traversing backwards
|
|
3955
|
+
index.useDidUpdate(() => {
|
|
3956
|
+
if (!animatedLeft) {
|
|
3957
|
+
updateMaskDimensions();
|
|
3958
|
+
}
|
|
3959
|
+
}, [animatedLeft]);
|
|
3960
|
+
|
|
3961
|
+
// handles dynamic resizing by both radix and virtuoso
|
|
3962
|
+
useResizeObserver__default["default"](target, () => {
|
|
3963
|
+
if (openPaneDepth === paneDepth) {
|
|
3964
|
+
updateMaskDimensions();
|
|
3965
|
+
}
|
|
3966
|
+
});
|
|
3967
|
+
|
|
3968
|
+
// determines if the mask is ready
|
|
3969
|
+
return maskHeight !== auto || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) === 'test';
|
|
3601
3970
|
};
|
|
3602
3971
|
|
|
3603
3972
|
const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
3604
|
-
var _flyoutRef$current$pa, _flyoutRef$
|
|
3973
|
+
var _flyoutRef$current$pa, _flyoutRef$current, _flyoutRef$current2;
|
|
3605
3974
|
let {
|
|
3606
3975
|
placement,
|
|
3607
3976
|
children,
|
|
@@ -3610,67 +3979,77 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3610
3979
|
onSearchValueChange,
|
|
3611
3980
|
isSearchFilteringDisabled = false,
|
|
3612
3981
|
className,
|
|
3613
|
-
style,
|
|
3614
3982
|
zIndex = 1000,
|
|
3615
3983
|
...rest
|
|
3616
3984
|
} = _ref;
|
|
3617
3985
|
const [items, setItems] = React.useState([]);
|
|
3618
3986
|
const flyoutRef = React.useRef(null);
|
|
3619
3987
|
const stickyBoxRef = React.useRef(null);
|
|
3988
|
+
const selectContext = useSelectContext(true);
|
|
3989
|
+
const withinSelect = selectContext !== null;
|
|
3990
|
+
const {
|
|
3991
|
+
multiselect,
|
|
3992
|
+
showSelectedItemsPane
|
|
3993
|
+
} = selectContext !== null && selectContext !== void 0 ? selectContext : {};
|
|
3620
3994
|
const portalTarget = index.usePortalTarget();
|
|
3621
3995
|
const [side, align] = React.useMemo(() => {
|
|
3622
3996
|
var _placement$split, _placement$split2;
|
|
3623
3997
|
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
3998
|
}, [placement]);
|
|
3999
|
+
const thisPanesDepth = 1;
|
|
4000
|
+
const paneMaxHeight = 350;
|
|
4001
|
+
const paneBottomPadding = 4;
|
|
4002
|
+
const maskContainerId = index.useId();
|
|
4003
|
+
const [transform, setTransform] = React.useState('');
|
|
4004
|
+
const target = (_flyoutRef$current$pa = (_flyoutRef$current = flyoutRef.current) === null || _flyoutRef$current === void 0 ? void 0 : _flyoutRef$current.parentNode) !== null && _flyoutRef$current$pa !== void 0 ? _flyoutRef$current$pa : undefined;
|
|
3625
4005
|
const {
|
|
3626
4006
|
dataTestId: rootDataTestId,
|
|
3627
4007
|
openPaneDepth,
|
|
3628
|
-
setMaskHeight,
|
|
3629
4008
|
maskHeight,
|
|
3630
4009
|
open,
|
|
3631
4010
|
triggerRef,
|
|
3632
|
-
searchBarConfigs
|
|
4011
|
+
searchBarConfigs,
|
|
4012
|
+
maskWidth,
|
|
4013
|
+
isVirtualizationDisabled
|
|
3633
4014
|
} = useMenuContext();
|
|
3634
|
-
const
|
|
3635
|
-
const maskContainerId = 'maskContainer';
|
|
3636
|
-
useOverlay({
|
|
3637
|
-
isVisible: open,
|
|
3638
|
-
ignoreIds: [maskContainerId],
|
|
3639
|
-
opacity: 0
|
|
3640
|
-
});
|
|
4015
|
+
const isVirtualized = useIsVirtualized(children, isVirtualizationDisabled);
|
|
3641
4016
|
const animatedLeft = React.useMemo(() => openPaneDepth > thisPanesDepth, [openPaneDepth]);
|
|
3642
|
-
const dataTestId = index.getSubDataTestId(rootDataTestId, DATA_TESTID_SUFFIXES.MENU_PANE);
|
|
4017
|
+
const dataTestId = index.getSubDataTestId(rootDataTestId, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE);
|
|
3643
4018
|
const {
|
|
3644
|
-
internalSearchValue,
|
|
3645
4019
|
noSearchResultsNode,
|
|
3646
|
-
onInteractOutside
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
4020
|
+
onInteractOutside,
|
|
4021
|
+
filteredChildren
|
|
4022
|
+
} = usePaneSearch({
|
|
4023
|
+
isSearchable,
|
|
4024
|
+
externalSearchValue,
|
|
4025
|
+
onSearchValueChange,
|
|
4026
|
+
items,
|
|
4027
|
+
animatedLeft,
|
|
4028
|
+
animatedRight: false,
|
|
4029
|
+
menuParentDataTestId: dataTestId,
|
|
4030
|
+
id: index.useId(),
|
|
4031
|
+
flyoutRef,
|
|
4032
|
+
children,
|
|
4033
|
+
isSearchFilteringDisabled,
|
|
4034
|
+
isVirtualized
|
|
4035
|
+
});
|
|
4036
|
+
const focusVirtualBoundary = useFocusVirtualBoundary(items);
|
|
4037
|
+
const {
|
|
4038
|
+
isFocusVisible
|
|
4039
|
+
} = interactions.useFocusVisible();
|
|
4040
|
+
const maskIsReady = useMaskDimensions(flyoutRef.current, animatedLeft, thisPanesDepth, children);
|
|
3652
4041
|
index.useDidUpdate(() => {
|
|
3653
|
-
if (
|
|
3654
|
-
|
|
3655
|
-
window.requestAnimationFrame(() => {
|
|
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;
|
|
3658
|
-
setMaskHeight(initialHeightOfThisPane.current);
|
|
3659
|
-
});
|
|
3660
|
-
} else {
|
|
3661
|
-
setMaskHeight(initialHeightOfThisPane.current);
|
|
3662
|
-
}
|
|
4042
|
+
if (maskIsReady && isFocusVisible) {
|
|
4043
|
+
items[0].element.current.focus();
|
|
3663
4044
|
}
|
|
3664
|
-
}, [
|
|
4045
|
+
}, [maskIsReady]);
|
|
3665
4046
|
const defaultSide = React.useMemo(() => {
|
|
3666
4047
|
var _triggerRef$current;
|
|
3667
4048
|
const rect = triggerRef === null || triggerRef === void 0 || (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getBoundingClientRect();
|
|
3668
4049
|
if (!rect) {
|
|
3669
4050
|
return 'bottom';
|
|
3670
4051
|
}
|
|
3671
|
-
|
|
3672
|
-
// hard coded in Menu.less
|
|
3673
|
-
let maxHeight = 350;
|
|
4052
|
+
let maxHeight = paneMaxHeight;
|
|
3674
4053
|
if (flyoutRef.current) {
|
|
3675
4054
|
const computedString = window.getComputedStyle(flyoutRef.current).maxHeight.slice(0, -2);
|
|
3676
4055
|
if (computedString !== '' && !Number.isNaN(+computedString)) {
|
|
@@ -3686,9 +4065,23 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3686
4065
|
return 'top';
|
|
3687
4066
|
}
|
|
3688
4067
|
return 'bottom';
|
|
3689
|
-
},
|
|
3690
|
-
|
|
3691
|
-
|
|
4068
|
+
},
|
|
4069
|
+
// including `open` because the trigger location may change between openings
|
|
4070
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4071
|
+
[open, triggerRef]);
|
|
4072
|
+
|
|
4073
|
+
// We use the top-level Radix container as a mask. Radix does not expose this container to consumers, except through CSS.
|
|
4074
|
+
// These hooks dynamically update the style of that container using CSS variables.
|
|
4075
|
+
useCSSVariable('--mask-z-index', String(zIndex), [open]);
|
|
4076
|
+
useCSSVariable('--mask-width', "".concat(maskWidth, "px"));
|
|
4077
|
+
useCSSVariable('--mask-height', "".concat(maskHeight, "px"));
|
|
4078
|
+
useCSSVariable('--flyout-max-height', "".concat(paneMaxHeight, "px"));
|
|
4079
|
+
useCSSVariable('--flyout-bottom-padding', "".concat(paneBottomPadding, "px"));
|
|
4080
|
+
useOverlay({
|
|
4081
|
+
isVisible: open,
|
|
4082
|
+
ignoreIds: [maskContainerId],
|
|
4083
|
+
opacity: 0
|
|
4084
|
+
});
|
|
3692
4085
|
useMutationObserver(target, {
|
|
3693
4086
|
attributes: true,
|
|
3694
4087
|
attributeFilter: ['style']
|
|
@@ -3696,24 +4089,29 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3696
4089
|
var _style$transform, _style;
|
|
3697
4090
|
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
4091
|
});
|
|
3699
|
-
useCSSVariable('--mask-z-index', String(zIndex), [open]);
|
|
3700
4092
|
return /*#__PURE__*/React__default["default"].createElement(PaneContextProvider, {
|
|
3701
4093
|
items: items,
|
|
3702
4094
|
setItems: setItems,
|
|
3703
4095
|
value: {
|
|
3704
4096
|
dataTestId,
|
|
3705
|
-
searchValue: internalSearchValue,
|
|
3706
|
-
isSearchFilteringDisabled,
|
|
3707
4097
|
isInteractive: !animatedLeft,
|
|
3708
4098
|
flyoutRef,
|
|
3709
4099
|
stickyBoxRef,
|
|
3710
|
-
zIndex
|
|
4100
|
+
zIndex,
|
|
4101
|
+
focusVirtualBoundary,
|
|
4102
|
+
isVirtualized,
|
|
4103
|
+
maskIsReady
|
|
3711
4104
|
}
|
|
3712
4105
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Portal, {
|
|
3713
4106
|
container: portalTarget || undefined
|
|
3714
4107
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3715
|
-
className: styles$
|
|
3716
|
-
id: maskContainerId
|
|
4108
|
+
className: styles$5.maskContainer,
|
|
4109
|
+
id: maskContainerId,
|
|
4110
|
+
style: {
|
|
4111
|
+
// virtuoso and radix both do funny things with window.requestAnimationFrame that cause unpredictable resizing.
|
|
4112
|
+
// this causes jitters. We need to wait until it's done resizing.
|
|
4113
|
+
opacity: maskIsReady ? 1 : 0
|
|
4114
|
+
}
|
|
3717
4115
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Content, _extends__default["default"]({}, rest, {
|
|
3718
4116
|
onCloseAutoFocus: () => {
|
|
3719
4117
|
var _triggerRef$current2;
|
|
@@ -3726,25 +4124,23 @@ const MenuPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3726
4124
|
ref: index.mergeRefs(ref, flyoutRef),
|
|
3727
4125
|
"data-testid": dataTestId,
|
|
3728
4126
|
className: classNames__default["default"](className, {
|
|
3729
|
-
[styles$
|
|
3730
|
-
}, styles$
|
|
3731
|
-
onInteractOutside: onInteractOutside
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
}
|
|
3736
|
-
}), isSearchable && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3737
|
-
className: classNames__default["default"](styles$4.stickyBox, styles$4.isSearchable),
|
|
4127
|
+
[styles$5.animatedLeft]: animatedLeft
|
|
4128
|
+
}, styles$5.flyout),
|
|
4129
|
+
onInteractOutside: onInteractOutside
|
|
4130
|
+
}), (isSearchable || multiselect && showSelectedItemsPane) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4131
|
+
className: classNames__default["default"](styles$5.stickyBox, {
|
|
4132
|
+
[styles$5.isSearchable]: isSearchable
|
|
4133
|
+
}),
|
|
3738
4134
|
ref: stickyBoxRef,
|
|
3739
4135
|
style: {
|
|
3740
4136
|
zIndex
|
|
3741
4137
|
}
|
|
3742
|
-
}), noSearchResultsNode,
|
|
3743
|
-
className: styles$
|
|
4138
|
+
}, showSelectedItemsPane && multiselect && /*#__PURE__*/React__default["default"].createElement(SelectedItems, null)), noSearchResultsNode, /*#__PURE__*/React__default["default"].createElement(PaneChildren, null, filteredChildren)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4139
|
+
className: styles$5.searchBoxesContainer,
|
|
3744
4140
|
style: {
|
|
3745
4141
|
transform,
|
|
3746
4142
|
zIndex: zIndex + openPaneDepth,
|
|
3747
|
-
width: (_flyoutRef$
|
|
4143
|
+
width: (_flyoutRef$current2 = flyoutRef.current) === null || _flyoutRef$current2 === void 0 ? void 0 : _flyoutRef$current2.clientWidth
|
|
3748
4144
|
}
|
|
3749
4145
|
}, searchBarConfigs.length ? searchBarConfigs.map(_ref2 => {
|
|
3750
4146
|
let {
|
|
@@ -3767,27 +4163,31 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3767
4163
|
label,
|
|
3768
4164
|
...rest
|
|
3769
4165
|
} = _ref;
|
|
4166
|
+
const selectContext = useSelectContext(true);
|
|
4167
|
+
const withinSelect = selectContext !== null;
|
|
4168
|
+
const multiselect = selectContext === null || selectContext === void 0 ? void 0 : selectContext.multiselect;
|
|
3770
4169
|
const itemRef = React.useRef(null);
|
|
3771
4170
|
const {
|
|
3772
4171
|
dataTestId: menuParentDataTestId,
|
|
3773
|
-
childIndex
|
|
3774
|
-
searchValue,
|
|
3775
|
-
isSearchFilteringDisabled,
|
|
4172
|
+
childIndex,
|
|
3776
4173
|
isInteractive,
|
|
3777
4174
|
closeSubmenu,
|
|
3778
4175
|
flyoutRef,
|
|
3779
|
-
stickyBoxRef
|
|
4176
|
+
stickyBoxRef,
|
|
4177
|
+
focusVirtualBoundary,
|
|
4178
|
+
isVirtualized: paneIsVirtualized,
|
|
4179
|
+
maskIsReady
|
|
3780
4180
|
} = usePaneContext(itemRef);
|
|
4181
|
+
const {
|
|
4182
|
+
virtualIndex
|
|
4183
|
+
} = useItemContext();
|
|
4184
|
+
const index$1 = React.useMemo(() => virtualIndex !== null && virtualIndex !== void 0 ? virtualIndex : childIndex, [childIndex, virtualIndex]);
|
|
3781
4185
|
const {
|
|
3782
4186
|
isFocusVisible
|
|
3783
4187
|
} = interactions.useFocusVisible({
|
|
3784
4188
|
isTextInput: true
|
|
3785
4189
|
});
|
|
3786
|
-
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));
|
|
3787
|
-
const isVisible = React.useMemo(() => {
|
|
3788
|
-
const searchMatcher = label !== null && label !== void 0 ? label : typeof children === 'string' ? children : undefined;
|
|
3789
|
-
return isSearchFilteringDisabled || !searchValue || (searchMatcher === null || searchMatcher === void 0 ? void 0 : searchMatcher.toLowerCase().includes(searchValue.toLowerCase()));
|
|
3790
|
-
}, [children, searchValue, label, isSearchFilteringDisabled]);
|
|
4190
|
+
const dataTestId = index.getSubDataTestId(menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_ITEM : DATA_TESTID_SUFFIXES$1.MENU_ITEM), String(index$1));
|
|
3791
4191
|
const handleFocus = () => {
|
|
3792
4192
|
if (itemRef.current && flyoutRef.current && isFocusVisible) {
|
|
3793
4193
|
var _stickyBoxRef$current, _stickyBoxRef$current2;
|
|
@@ -3800,11 +4200,11 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3800
4200
|
}
|
|
3801
4201
|
}
|
|
3802
4202
|
};
|
|
3803
|
-
return
|
|
4203
|
+
return /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Item, _extends__default["default"]({}, rest, {
|
|
3804
4204
|
asChild: asChild,
|
|
3805
4205
|
"aria-disabled": isDisabled,
|
|
3806
|
-
className: classNames__default["default"](className, styles$
|
|
3807
|
-
[styles$
|
|
4206
|
+
className: classNames__default["default"](className, styles$5.menuItem, {
|
|
4207
|
+
[styles$5.unresponsive]: !isInteractive
|
|
3808
4208
|
}),
|
|
3809
4209
|
"data-testid": dataTestId,
|
|
3810
4210
|
ref: index.mergeRefs(ref, itemRef),
|
|
@@ -3813,17 +4213,33 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
3813
4213
|
e.preventDefault();
|
|
3814
4214
|
return;
|
|
3815
4215
|
}
|
|
3816
|
-
if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
3817
|
-
closeSubmenu === null || closeSubmenu === void 0
|
|
4216
|
+
if (KEYS$1.CLOSE_SUBMENU.includes(e.key)) {
|
|
4217
|
+
closeSubmenu === null || closeSubmenu === void 0 || closeSubmenu(e);
|
|
4218
|
+
} else if (paneIsVirtualized && KEYS$1.NAVIGATE_TOP.includes(e.key)) {
|
|
4219
|
+
e.preventDefault();
|
|
4220
|
+
focusVirtualBoundary('top');
|
|
4221
|
+
} else if (paneIsVirtualized && KEYS$1.NAVIIGATE_BOTTOM.includes(e.key)) {
|
|
4222
|
+
e.preventDefault();
|
|
4223
|
+
focusVirtualBoundary('bottom');
|
|
3818
4224
|
}
|
|
3819
4225
|
},
|
|
3820
4226
|
onFocus: handleFocus
|
|
3821
4227
|
// stop radix from closing the menu on selection of disabled item
|
|
3822
4228
|
// other pointer and keyboard events still work, even when disabled
|
|
3823
4229
|
,
|
|
3824
|
-
onSelect: e =>
|
|
3825
|
-
|
|
4230
|
+
onSelect: e => {
|
|
4231
|
+
if (isDisabled || maskIsReady === false) {
|
|
4232
|
+
e.preventDefault();
|
|
4233
|
+
return;
|
|
4234
|
+
}
|
|
4235
|
+
if (multiselect) {
|
|
4236
|
+
e.preventDefault();
|
|
4237
|
+
}
|
|
4238
|
+
onSelect === null || onSelect === void 0 || onSelect();
|
|
4239
|
+
}
|
|
4240
|
+
}), (!children || typeof children === 'string') && label ? label : children);
|
|
3826
4241
|
});
|
|
4242
|
+
var MenuItem$1 = MenuItem;
|
|
3827
4243
|
|
|
3828
4244
|
const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
3829
4245
|
let {
|
|
@@ -3839,6 +4255,19 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3839
4255
|
onIsOpenChange,
|
|
3840
4256
|
...rest
|
|
3841
4257
|
} = _ref;
|
|
4258
|
+
const selectContext = useSelectContext(true);
|
|
4259
|
+
const withinSelect = selectContext !== null;
|
|
4260
|
+
const {
|
|
4261
|
+
subSelectTriggerProps,
|
|
4262
|
+
multiselect,
|
|
4263
|
+
subSelectPaneProps,
|
|
4264
|
+
isSelectedItems,
|
|
4265
|
+
triggerCheckedState = 'false',
|
|
4266
|
+
onTriggerCheckboxSelect
|
|
4267
|
+
} = selectContext !== null && selectContext !== void 0 ? selectContext : {};
|
|
4268
|
+
const {
|
|
4269
|
+
virtualIndex
|
|
4270
|
+
} = useItemContext();
|
|
3842
4271
|
const [items, setItems] = React.useState([]);
|
|
3843
4272
|
const internalId = index.useId();
|
|
3844
4273
|
const triggerRef = React.useRef(null);
|
|
@@ -3847,17 +4276,18 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3847
4276
|
const backButtonRef = React.useRef(null);
|
|
3848
4277
|
const {
|
|
3849
4278
|
dataTestId: paneContainingTriggerDataTestId,
|
|
3850
|
-
childIndex
|
|
3851
|
-
searchValue: paneContainingTriggerSearchValue,
|
|
3852
|
-
isSearchFilteringDisabled: isSearchFilteringDisabledForPaneContainingTrigger,
|
|
4279
|
+
childIndex,
|
|
3853
4280
|
isInteractive: paneContainingTriggerIsInteractive,
|
|
3854
4281
|
closeSubmenu: closeSubmenuContainingTrigger,
|
|
3855
|
-
zIndex: paneContainingTriggerZIndex
|
|
4282
|
+
zIndex: paneContainingTriggerZIndex,
|
|
4283
|
+
focusVirtualBoundary: focusVirtualBoundaryWithinPaneContainingTrigger,
|
|
4284
|
+
isVirtualized: paneContainingTriggerIsVirtualized
|
|
3856
4285
|
} = usePaneContext(triggerRef);
|
|
4286
|
+
const triggerIndex = React.useMemo(() => virtualIndex !== null && virtualIndex !== void 0 ? virtualIndex : childIndex, [childIndex, virtualIndex]);
|
|
3857
4287
|
const {
|
|
3858
4288
|
openPaneDepth: totalOpenPaneDepth,
|
|
3859
4289
|
registerSubmenu,
|
|
3860
|
-
|
|
4290
|
+
isVirtualizationDisabled
|
|
3861
4291
|
} = useMenuContext();
|
|
3862
4292
|
const {
|
|
3863
4293
|
isFocusVisible
|
|
@@ -3868,21 +4298,37 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3868
4298
|
const [isFrameAfterPaneAddedToDOM, setIsFrameAfterPaneAddedToDOM] = React.useState(false);
|
|
3869
4299
|
const [isTransitioningFromRight, setIsTransitioningFromRight] = React.useState(false);
|
|
3870
4300
|
const animatedLeft = React.useMemo(() => thisPanesDepth < totalOpenPaneDepth, [totalOpenPaneDepth, thisPanesDepth]);
|
|
3871
|
-
const animatedRight = React.useMemo(() => thisPanesDepth > totalOpenPaneDepth || isFrameAfterPaneAddedToDOM, [totalOpenPaneDepth, isFrameAfterPaneAddedToDOM, thisPanesDepth]);
|
|
4301
|
+
const animatedRight = React.useMemo(() => thisPanesDepth > totalOpenPaneDepth || thisPanesDepth === totalOpenPaneDepth && !isPaneInDOM || isFrameAfterPaneAddedToDOM, [totalOpenPaneDepth, isFrameAfterPaneAddedToDOM, thisPanesDepth, isPaneInDOM]);
|
|
3872
4302
|
const paneDataTestId = index.getSubDataTestId(paneContainingTriggerDataTestId, String(triggerIndex));
|
|
3873
4303
|
const closeThisSubmenu = e => {
|
|
3874
4304
|
// prevent closing the entire menu, and Radix keyboard navigation
|
|
3875
4305
|
e.preventDefault();
|
|
3876
4306
|
registerSubmenu(internalId, false);
|
|
3877
4307
|
};
|
|
4308
|
+
const isVirtualized = useIsVirtualized(children, isVirtualizationDisabled);
|
|
3878
4309
|
const {
|
|
3879
|
-
internalSearchValue,
|
|
3880
4310
|
noSearchResultsNode,
|
|
3881
|
-
onInteractOutside
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
4311
|
+
onInteractOutside,
|
|
4312
|
+
filteredChildren
|
|
4313
|
+
} = usePaneSearch({
|
|
4314
|
+
isSearchable,
|
|
4315
|
+
externalSearchValue,
|
|
4316
|
+
onSearchValueChange,
|
|
4317
|
+
items,
|
|
4318
|
+
animatedLeft,
|
|
4319
|
+
animatedRight,
|
|
4320
|
+
menuParentDataTestId: paneDataTestId,
|
|
4321
|
+
id: internalId,
|
|
4322
|
+
flyoutRef,
|
|
4323
|
+
children,
|
|
4324
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren,
|
|
4325
|
+
backButtonRef,
|
|
4326
|
+
closeSubmenu: closeThisSubmenu,
|
|
4327
|
+
isVirtualized
|
|
4328
|
+
});
|
|
4329
|
+
const focusVirtualBoundaryInPane = useFocusVirtualBoundary(items, backButtonRef);
|
|
4330
|
+
const backButtonDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_BACK : DATA_TESTID_SUFFIXES$1.MENU_BACK);
|
|
4331
|
+
const triggerDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_ITEM : DATA_TESTID_SUFFIXES$1.MENU_ITEM);
|
|
3886
4332
|
index.useDidUpdate(() => {
|
|
3887
4333
|
if (isPaneInDOM) {
|
|
3888
4334
|
setIsTransitioningFromRight(true);
|
|
@@ -3891,30 +4337,15 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3891
4337
|
window.requestAnimationFrame(() => setIsFrameAfterPaneAddedToDOM(false));
|
|
3892
4338
|
}
|
|
3893
4339
|
registerSubmenu(internalId, isPaneInDOM);
|
|
3894
|
-
onIsOpenChange === null || onIsOpenChange === void 0
|
|
4340
|
+
onIsOpenChange === null || onIsOpenChange === void 0 || onIsOpenChange(isPaneInDOM);
|
|
3895
4341
|
}, [isPaneInDOM]);
|
|
3896
4342
|
|
|
3897
4343
|
// Omitted dependencies because this should only run on unmount
|
|
3898
4344
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3899
4345
|
React.useEffect(() => () => registerSubmenu(internalId, false), []);
|
|
3900
|
-
|
|
3901
|
-
if (thisPanesDepth === totalOpenPaneDepth) {
|
|
3902
|
-
var _flyoutRef$current$cl, _flyoutRef$current;
|
|
3903
|
-
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);
|
|
3904
|
-
}
|
|
3905
|
-
},
|
|
3906
|
-
// ignoring other dependencies because this should only run when the children change
|
|
3907
|
-
[children]);
|
|
3908
|
-
index.useDidUpdate(() => {
|
|
3909
|
-
if (thisPanesDepth === totalOpenPaneDepth) {
|
|
3910
|
-
window.requestAnimationFrame(() => {
|
|
3911
|
-
var _flyoutRef$current$cl2, _flyoutRef$current2;
|
|
3912
|
-
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);
|
|
3913
|
-
});
|
|
3914
|
-
}
|
|
3915
|
-
}, [totalOpenPaneDepth, internalSearchValue]);
|
|
4346
|
+
useMaskDimensions(flyoutRef.current, animatedLeft, thisPanesDepth, children);
|
|
3916
4347
|
const handlePaneTransitionEnd = () => {
|
|
3917
|
-
var _flyoutRef$
|
|
4348
|
+
var _flyoutRef$current;
|
|
3918
4349
|
if (animatedLeft) {
|
|
3919
4350
|
return;
|
|
3920
4351
|
}
|
|
@@ -3922,13 +4353,13 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3922
4353
|
setIsPaneInDOM(false);
|
|
3923
4354
|
if (isFocusVisible) {
|
|
3924
4355
|
var _triggerRef$current;
|
|
3925
|
-
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0
|
|
4356
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
|
|
3926
4357
|
}
|
|
3927
4358
|
return;
|
|
3928
4359
|
}
|
|
3929
4360
|
|
|
3930
4361
|
// if the newly closed submenu doesn't place the focus on its trigger due to mouse events
|
|
3931
|
-
if (!((_flyoutRef$
|
|
4362
|
+
if (!((_flyoutRef$current = flyoutRef.current) !== null && _flyoutRef$current !== void 0 && _flyoutRef$current.contains(document.activeElement)) && isFocusVisible) {
|
|
3932
4363
|
if (triggerRef.current && paneContainingTriggerIsInteractive) {
|
|
3933
4364
|
triggerRef.current.focus();
|
|
3934
4365
|
} else if (backButtonRef.current) {
|
|
@@ -3937,11 +4368,12 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3937
4368
|
}
|
|
3938
4369
|
setIsTransitioningFromRight(false);
|
|
3939
4370
|
};
|
|
3940
|
-
return
|
|
4371
|
+
return /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Sub, {
|
|
3941
4372
|
open: isPaneInDOM
|
|
3942
|
-
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.SubTrigger, {
|
|
3943
|
-
className: classNames__default["default"](styles$
|
|
3944
|
-
[styles$
|
|
4373
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.SubTrigger, _extends__default["default"]({
|
|
4374
|
+
className: classNames__default["default"](styles$5.menuItem, styles$5.subMenu, {
|
|
4375
|
+
[styles$5.unresponsive]: !paneContainingTriggerIsInteractive,
|
|
4376
|
+
[styles$3.selectedItem]: triggerCheckedState === 'true' && !isSelectedItems
|
|
3945
4377
|
}),
|
|
3946
4378
|
"data-testid": triggerDataTestId,
|
|
3947
4379
|
"aria-disabled": isDisabled,
|
|
@@ -3952,70 +4384,92 @@ const SubMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
|
|
|
3952
4384
|
e.preventDefault();
|
|
3953
4385
|
return;
|
|
3954
4386
|
}
|
|
3955
|
-
if (!
|
|
4387
|
+
if (multiselect && !isSelectedItems && KEYS.CHECK_PARENT.includes(e.key)) {
|
|
4388
|
+
onTriggerCheckboxSelect === null || onTriggerCheckboxSelect === void 0 || onTriggerCheckboxSelect();
|
|
4389
|
+
return;
|
|
4390
|
+
}
|
|
4391
|
+
if (!isDisabled && KEYS$1.OPEN_SUBMENU.includes(e.key)) {
|
|
3956
4392
|
setIsPaneInDOM(true);
|
|
3957
|
-
} else if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
3958
|
-
closeSubmenuContainingTrigger === null || closeSubmenuContainingTrigger === void 0
|
|
4393
|
+
} else if (KEYS$1.CLOSE_SUBMENU.includes(e.key)) {
|
|
4394
|
+
closeSubmenuContainingTrigger === null || closeSubmenuContainingTrigger === void 0 || closeSubmenuContainingTrigger(e);
|
|
4395
|
+
} else if (paneContainingTriggerIsVirtualized && KEYS$1.NAVIGATE_TOP.includes(e.key)) {
|
|
4396
|
+
e.preventDefault();
|
|
4397
|
+
focusVirtualBoundaryWithinPaneContainingTrigger('top');
|
|
4398
|
+
} else if (paneContainingTriggerIsVirtualized && KEYS$1.NAVIIGATE_BOTTOM.includes(e.key)) {
|
|
4399
|
+
e.preventDefault();
|
|
4400
|
+
focusVirtualBoundaryWithinPaneContainingTrigger('bottom');
|
|
3959
4401
|
}
|
|
3960
4402
|
}
|
|
3961
|
-
},
|
|
3962
|
-
|
|
4403
|
+
}, subSelectTriggerProps), multiselect && !isSelectedItems ? /*#__PURE__*/React__default["default"].createElement(AdvancedTableCheckbox, {
|
|
4404
|
+
state: triggerCheckedState,
|
|
4405
|
+
className: styles$3.checkbox,
|
|
4406
|
+
onClick: onTriggerCheckboxSelect,
|
|
4407
|
+
isDisabled: isDisabled
|
|
4408
|
+
}) : null, label, /*#__PURE__*/React__default["default"].createElement(icons_index.ChevronRightIcon, {
|
|
4409
|
+
className: styles$5.rightIcon
|
|
3963
4410
|
})), /*#__PURE__*/React__default["default"].createElement(PaneContextProvider, {
|
|
3964
4411
|
items: items,
|
|
3965
4412
|
setItems: setItems,
|
|
3966
4413
|
value: {
|
|
3967
4414
|
dataTestId: paneDataTestId,
|
|
3968
|
-
searchValue: internalSearchValue,
|
|
3969
|
-
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren,
|
|
3970
4415
|
isInteractive: !isTransitioningFromRight && !animatedLeft && !animatedRight,
|
|
3971
4416
|
closeSubmenu: closeThisSubmenu,
|
|
3972
4417
|
flyoutRef,
|
|
3973
4418
|
stickyBoxRef,
|
|
3974
|
-
zIndex
|
|
4419
|
+
zIndex,
|
|
4420
|
+
focusVirtualBoundary: focusVirtualBoundaryInPane,
|
|
4421
|
+
isVirtualized
|
|
3975
4422
|
}
|
|
3976
4423
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.SubContent, _extends__default["default"]({}, rest, {
|
|
3977
4424
|
loop: !isSearchable,
|
|
3978
4425
|
"data-testid": paneDataTestId,
|
|
3979
4426
|
ref: index.mergeRefs(ref, flyoutRef),
|
|
3980
4427
|
onInteractOutside: onInteractOutside,
|
|
3981
|
-
className: classNames__default["default"](className, styles$
|
|
3982
|
-
[styles$
|
|
3983
|
-
[styles$
|
|
4428
|
+
className: classNames__default["default"](className, styles$5.flyout, {
|
|
4429
|
+
[styles$5.animatedRight]: animatedRight,
|
|
4430
|
+
[styles$5.animatedLeft]: animatedLeft
|
|
3984
4431
|
}),
|
|
3985
4432
|
onTransitionEnd: handlePaneTransitionEnd,
|
|
3986
4433
|
style: {
|
|
3987
4434
|
...style,
|
|
3988
4435
|
zIndex
|
|
3989
4436
|
}
|
|
3990
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3991
|
-
className: classNames__default["default"](styles$
|
|
3992
|
-
[styles$
|
|
4437
|
+
}, subSelectPaneProps), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4438
|
+
className: classNames__default["default"](styles$5.stickyBox, {
|
|
4439
|
+
[styles$5.isSearchable]: isSearchable
|
|
3993
4440
|
}),
|
|
3994
4441
|
ref: stickyBoxRef,
|
|
3995
4442
|
style: {
|
|
3996
4443
|
zIndex
|
|
3997
4444
|
}
|
|
3998
4445
|
}, /*#__PURE__*/React__default["default"].createElement(reactDropdownMenu.Item, {
|
|
3999
|
-
className: classNames__default["default"](styles$
|
|
4000
|
-
[styles$
|
|
4446
|
+
className: classNames__default["default"](styles$5.menuItem, {
|
|
4447
|
+
[styles$5.unresponsive]: isTransitioningFromRight || animatedLeft || animatedRight
|
|
4001
4448
|
}),
|
|
4002
4449
|
"data-testid": backButtonDataTestId,
|
|
4003
4450
|
onSelect: closeThisSubmenu,
|
|
4004
4451
|
ref: backButtonRef,
|
|
4005
4452
|
onKeyDown: e => {
|
|
4006
|
-
if (KEYS.CLOSE_SUBMENU.includes(e.key)) {
|
|
4453
|
+
if (KEYS$1.CLOSE_SUBMENU.includes(e.key)) {
|
|
4007
4454
|
closeThisSubmenu(e);
|
|
4455
|
+
} else if (isVirtualized && KEYS$1.NAVIGATE_TOP.includes(e.key)) {
|
|
4456
|
+
e.preventDefault();
|
|
4457
|
+
focusVirtualBoundaryInPane('top');
|
|
4458
|
+
} else if (isVirtualized && KEYS$1.NAVIIGATE_BOTTOM.includes(e.key)) {
|
|
4459
|
+
e.preventDefault();
|
|
4460
|
+
focusVirtualBoundaryInPane('bottom');
|
|
4008
4461
|
}
|
|
4009
4462
|
}
|
|
4010
4463
|
}, /*#__PURE__*/React__default["default"].createElement(icons_index.ArrowLeftIcon, {
|
|
4011
4464
|
size: "small",
|
|
4012
|
-
className: styles$
|
|
4013
|
-
}), label)), noSearchResultsNode,
|
|
4465
|
+
className: styles$5.backIcon
|
|
4466
|
+
}), label)), noSearchResultsNode, /*#__PURE__*/React__default["default"].createElement(PaneChildren, null, filteredChildren))));
|
|
4014
4467
|
});
|
|
4468
|
+
var SubMenu$1 = SubMenu;
|
|
4015
4469
|
|
|
4016
|
-
var css_248z$2 = ".
|
|
4017
|
-
var styles$2 = {"drawer":"
|
|
4018
|
-
var stylesheet$2=".
|
|
4470
|
+
var css_248z$2 = "._x9l97{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}._DFNUj{visibility:hidden}._xhD7U{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._APGPn{padding-top:8px}._uL-0S{margin-left:12px}";
|
|
4471
|
+
var styles$2 = {"drawer":"_x9l97","hidden":"_DFNUj","header":"_xhD7U","title":"_APGPn","closeButton":"_uL-0S"};
|
|
4472
|
+
var stylesheet$2="._x9l97{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}._DFNUj{visibility:hidden}._xhD7U{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._APGPn{padding-top:8px}._uL-0S{margin-left:12px}";
|
|
4019
4473
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$2);}
|
|
4020
4474
|
|
|
4021
4475
|
const Drawer = _ref => {
|
|
@@ -4077,13 +4531,13 @@ const Drawer = _ref => {
|
|
|
4077
4531
|
} else {
|
|
4078
4532
|
var _elementRefToFocusOnC;
|
|
4079
4533
|
setIsClosing(true);
|
|
4080
|
-
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 || (_elementRefToFocusOnC = elementRefToFocusOnClose.current) === null || _elementRefToFocusOnC === void 0
|
|
4534
|
+
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 || (_elementRefToFocusOnC = elementRefToFocusOnClose.current) === null || _elementRefToFocusOnC === void 0 || _elementRefToFocusOnC.focus();else elementUsedToOpenModal === null || elementUsedToOpenModal === void 0 || elementUsedToOpenModal.focus();
|
|
4081
4535
|
}
|
|
4082
4536
|
}, [elementRefToFocusOnClose, isOpen]);
|
|
4083
4537
|
React.useEffect(() => {
|
|
4084
4538
|
if (isOpen && !isHidden) {
|
|
4085
4539
|
var _closeButtonRef$curre;
|
|
4086
|
-
(_closeButtonRef$curre = closeButtonRef.current) === null || _closeButtonRef$curre === void 0
|
|
4540
|
+
(_closeButtonRef$curre = closeButtonRef.current) === null || _closeButtonRef$curre === void 0 || _closeButtonRef$curre.focus();
|
|
4087
4541
|
}
|
|
4088
4542
|
}, [isOpen, isHidden]);
|
|
4089
4543
|
const handleTransitionEnd = () => {
|
|
@@ -4130,9 +4584,9 @@ const Drawer = _ref => {
|
|
|
4130
4584
|
}, children))), (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body) : null;
|
|
4131
4585
|
};
|
|
4132
4586
|
|
|
4133
|
-
var css_248z$1 = ".
|
|
4134
|
-
var styles$1 = {"container":"
|
|
4135
|
-
var stylesheet$1=".
|
|
4587
|
+
var css_248z$1 = "._2q4xP{display:inline-block;position:relative}._Sow9H{width:120px}._Sow9H ._t0a-a._21LvV{transform:rotate(-180deg)}._Sow9H ._t0a-a._7eJ8s{fill:#9d9fa1;opacity:.4}._7dF8v>input:focus{box-shadow:none!important;border:1px solid #898989!important}._CjNpj{width:120px}._CjNpj ._0Q3DN._QdLU8{background-color:#efefef;border-radius:6px}._t0a-a{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._t0a-a._21LvV{transform:rotate(-180deg)}";
|
|
4588
|
+
var styles$1 = {"container":"_2q4xP","input":"_Sow9H","icon":"_t0a-a","open":"_21LvV","disabled":"_7eJ8s","ignoreFocusStyle":"_7dF8v","flyout":"_CjNpj","option":"_0Q3DN","exactMatch":"_QdLU8"};
|
|
4589
|
+
var stylesheet$1="._2q4xP{display:inline-block;position:relative}._Sow9H{width:120px}._Sow9H ._t0a-a._21LvV{transform:rotate(-180deg)}._Sow9H ._t0a-a._7eJ8s{fill:#9d9fa1;opacity:.4}._7dF8v>input:focus{box-shadow:none!important;border:1px solid #898989!important}._CjNpj{width:120px}._CjNpj ._0Q3DN._QdLU8{background-color:#efefef;border-radius:6px}._t0a-a{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._t0a-a._21LvV{transform:rotate(-180deg)}";
|
|
4136
4590
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z$1);}
|
|
4137
4591
|
|
|
4138
4592
|
const TimeDropdown = _ref => {
|
|
@@ -4474,7 +4928,7 @@ const TimePickerIcon = _ref => {
|
|
|
4474
4928
|
onClick: !isDisabled ? () => {
|
|
4475
4929
|
var _inputRef$current;
|
|
4476
4930
|
setIsFlyoutOpen(i => !i);
|
|
4477
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0
|
|
4931
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
4478
4932
|
} : undefined,
|
|
4479
4933
|
onMouseDown: e => e.preventDefault(),
|
|
4480
4934
|
ref: iconRef
|
|
@@ -4706,9 +5160,9 @@ const {
|
|
|
4706
5160
|
Provider: ToggleButtonGroupContextProvider
|
|
4707
5161
|
} = index.createContextUtilities(null);
|
|
4708
5162
|
|
|
4709
|
-
var css_248z = ".
|
|
4710
|
-
var styles = {"default":"
|
|
4711
|
-
var stylesheet=".
|
|
5163
|
+
var css_248z = "._Rd04I{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._bvIWL{background-color:rgba(50,54,58,.08)}._hwvnZ{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._J5lyy{color:rgba(81,85,89,.4);cursor:not-allowed}._jdRCb{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._obbD1{color:#085caf;border-color:#085caf}._ecIRD,._obbD1{background:rgba(11,110,208,.11)}._ecIRD{color:#0854a1;border-color:#0854a1}._kbX-y{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._LL4IZ{position:relative;display:inline-grid}._LL4IZ svg{fill:currentColor}._LL4IZ ._zAuFG{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._LL4IZ ._zAuFG+._NGbNa{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}._LL4IZ ._zAuFG+._NGbNa._cuvFM{padding:5px;max-width:36px;min-width:36px}._LL4IZ ._zAuFG+._NGbNa._tkHXH{padding:0 16px}._LL4IZ ._zAuFG+._NGbNa._rwzIj{padding:0 16px 0 12px}._LL4IZ ._zAuFG:hover+._NGbNa{background-color:rgba(50,54,58,.08)}._LL4IZ ._zAuFG:disabled+._NGbNa{color:rgba(81,85,89,.4);cursor:not-allowed}._LL4IZ ._zAuFG:active+._NGbNa,._LL4IZ ._zAuFG:focus:active+._NGbNa{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._LL4IZ ._zAuFG:checked+._NGbNa{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._LL4IZ ._zAuFG:checked:hover+._NGbNa{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._LL4IZ ._zAuFG:checked:disabled+._NGbNa{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._LL4IZ ._zAuFG:checked:active+._NGbNa,._LL4IZ ._zAuFG:checked:focus:active+._NGbNa{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._FlkTD{display:inline-flex;position:relative}._FlkTD:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._FlkTD>*{flex-shrink:0;flex-grow:0}._yxVFy{border:none;margin:0;padding:0}._yxVFy legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._LL4IZ ._zAuFG.focus-visible+._NGbNa,._LL4IZ ._zAuFG:focus-visible+._NGbNa{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
5164
|
+
var styles = {"default":"_Rd04I","hovered":"_bvIWL","pressed":"_hwvnZ","disabled":"_J5lyy","selectedDefault":"_jdRCb","selectedHovered":"_obbD1","selectedPressed":"_ecIRD","selectedDisabled":"_kbX-y","toggleContainer":"_LL4IZ","toggleInput":"_zAuFG","toggleButton":"_NGbNa","iconOnly":"_cuvFM","text":"_tkHXH","iconText":"_rwzIj","toggleButtonGroup":"_FlkTD","toggleButtonGroupFieldset":"_yxVFy"};
|
|
5165
|
+
var stylesheet="._Rd04I{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._bvIWL{background-color:rgba(50,54,58,.08)}._hwvnZ{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._J5lyy{color:rgba(81,85,89,.4);cursor:not-allowed}._jdRCb{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._obbD1{color:#085caf;border-color:#085caf}._ecIRD,._obbD1{background:rgba(11,110,208,.11)}._ecIRD{color:#0854a1;border-color:#0854a1}._kbX-y{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._LL4IZ{position:relative;display:inline-grid}._LL4IZ svg{fill:currentColor}._LL4IZ ._zAuFG{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._LL4IZ ._zAuFG+._NGbNa{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}._LL4IZ ._zAuFG+._NGbNa._cuvFM{padding:5px;max-width:36px;min-width:36px}._LL4IZ ._zAuFG+._NGbNa._tkHXH{padding:0 16px}._LL4IZ ._zAuFG+._NGbNa._rwzIj{padding:0 16px 0 12px}._LL4IZ ._zAuFG:hover+._NGbNa{background-color:rgba(50,54,58,.08)}._LL4IZ ._zAuFG:disabled+._NGbNa{color:rgba(81,85,89,.4);cursor:not-allowed}._LL4IZ ._zAuFG:active+._NGbNa,._LL4IZ ._zAuFG:focus:active+._NGbNa{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._LL4IZ ._zAuFG:checked+._NGbNa{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._LL4IZ ._zAuFG:checked:hover+._NGbNa{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._LL4IZ ._zAuFG:checked:disabled+._NGbNa{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._LL4IZ ._zAuFG:checked:active+._NGbNa,._LL4IZ ._zAuFG:checked:focus:active+._NGbNa{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._FlkTD{display:inline-flex;position:relative}._FlkTD:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._FlkTD>*{flex-shrink:0;flex-grow:0}._yxVFy{border:none;margin:0;padding:0}._yxVFy legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._LL4IZ ._zAuFG.focus-visible+._NGbNa,._LL4IZ ._zAuFG:focus-visible+._NGbNa{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4712
5166
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){icons_index.styleInject(css_248z);}
|
|
4713
5167
|
|
|
4714
5168
|
const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -4942,6 +5396,184 @@ const VStack = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React_
|
|
|
4942
5396
|
direction: "vertical"
|
|
4943
5397
|
})));
|
|
4944
5398
|
|
|
5399
|
+
const SelectPane = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
5400
|
+
let {
|
|
5401
|
+
children,
|
|
5402
|
+
isSearchable,
|
|
5403
|
+
placement,
|
|
5404
|
+
showSelectedItemsPane = false,
|
|
5405
|
+
searchValue,
|
|
5406
|
+
onSearchValueChange,
|
|
5407
|
+
isSearchFilteringDisabled,
|
|
5408
|
+
zIndex,
|
|
5409
|
+
...rest
|
|
5410
|
+
} = _ref;
|
|
5411
|
+
const selectContext = useSelectContext();
|
|
5412
|
+
const {
|
|
5413
|
+
multiselect
|
|
5414
|
+
} = selectContext;
|
|
5415
|
+
const sharedMenuProps = {
|
|
5416
|
+
placement,
|
|
5417
|
+
isSearchable,
|
|
5418
|
+
searchValue,
|
|
5419
|
+
onSearchValueChange,
|
|
5420
|
+
isSearchFilteringDisabled,
|
|
5421
|
+
zIndex,
|
|
5422
|
+
ref
|
|
5423
|
+
};
|
|
5424
|
+
return /*#__PURE__*/React__default["default"].createElement(SelectContextProvider, {
|
|
5425
|
+
value: {
|
|
5426
|
+
...selectContext,
|
|
5427
|
+
showSelectedItemsPane
|
|
5428
|
+
}
|
|
5429
|
+
}, /*#__PURE__*/React__default["default"].createElement(MenuPane, _extends__default["default"]({}, rest, sharedMenuProps, {
|
|
5430
|
+
"aria-multiselectable": Boolean(multiselect),
|
|
5431
|
+
role: "tree"
|
|
5432
|
+
}), children));
|
|
5433
|
+
});
|
|
5434
|
+
|
|
5435
|
+
const GetSelectItemsFrom = function (startingChildren) {
|
|
5436
|
+
let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
5437
|
+
const current = [];
|
|
5438
|
+
if (!startingChildren) {
|
|
5439
|
+
return current;
|
|
5440
|
+
}
|
|
5441
|
+
const childrenArray = Array.isArray(startingChildren) ? startingChildren : [startingChildren];
|
|
5442
|
+
childrenArray.forEach(child => {
|
|
5443
|
+
if (filter && !filter(child.props)) {
|
|
5444
|
+
return;
|
|
5445
|
+
}
|
|
5446
|
+
if (child.type === SelectItem) {
|
|
5447
|
+
const {
|
|
5448
|
+
label,
|
|
5449
|
+
value: childValue,
|
|
5450
|
+
children: childChildren
|
|
5451
|
+
} = child.props;
|
|
5452
|
+
const safeLabel = label !== null && label !== void 0 ? label : ['string', 'number'].includes(typeof childChildren) ? childChildren : undefined;
|
|
5453
|
+
current.push([childValue, safeLabel]);
|
|
5454
|
+
} else if (child.type === SubSelect) {
|
|
5455
|
+
current.push(...GetSelectItemsFrom(child.props.children, filter));
|
|
5456
|
+
}
|
|
5457
|
+
});
|
|
5458
|
+
return current;
|
|
5459
|
+
};
|
|
5460
|
+
const Select = _ref => {
|
|
5461
|
+
let {
|
|
5462
|
+
multiselect,
|
|
5463
|
+
children,
|
|
5464
|
+
isDisabled,
|
|
5465
|
+
onChange,
|
|
5466
|
+
isOpen,
|
|
5467
|
+
onIsOpenChange,
|
|
5468
|
+
value,
|
|
5469
|
+
isInvalid,
|
|
5470
|
+
'data-testid': dataTestId,
|
|
5471
|
+
isVirtualizationDisabled
|
|
5472
|
+
} = _ref;
|
|
5473
|
+
const [selectedValues, setSelectedValues] = index.useControllableState(value, onChange, value);
|
|
5474
|
+
const selectPaneChildren = React.useMemo(() => {
|
|
5475
|
+
var _children$find;
|
|
5476
|
+
return Array.isArray(children) ? (_children$find = children.find(child => child.type === SelectPane)) === null || _children$find === void 0 ? void 0 : _children$find.props.children : null;
|
|
5477
|
+
}, [children]);
|
|
5478
|
+
const selectedSelectItems = React.useMemo(() => {
|
|
5479
|
+
if (Array.isArray(selectedValues)) {
|
|
5480
|
+
return new Map(GetSelectItemsFrom(selectPaneChildren, _ref2 => {
|
|
5481
|
+
let {
|
|
5482
|
+
value: _value
|
|
5483
|
+
} = _ref2;
|
|
5484
|
+
return _value == null || selectedValues.includes(_value);
|
|
5485
|
+
}));
|
|
5486
|
+
}
|
|
5487
|
+
return new Map(GetSelectItemsFrom(selectPaneChildren, _ref3 => {
|
|
5488
|
+
let {
|
|
5489
|
+
value: _value
|
|
5490
|
+
} = _ref3;
|
|
5491
|
+
return _value == null || selectedValues === _value;
|
|
5492
|
+
}));
|
|
5493
|
+
}, [selectedValues, selectPaneChildren]);
|
|
5494
|
+
const enabledSelectItems = React.useMemo(() => new Map(GetSelectItemsFrom(selectPaneChildren, _ref4 => {
|
|
5495
|
+
let {
|
|
5496
|
+
isDisabled: _isDisabled
|
|
5497
|
+
} = _ref4;
|
|
5498
|
+
return !_isDisabled;
|
|
5499
|
+
})), [selectPaneChildren]);
|
|
5500
|
+
const onItemSelect = React.useCallback((_value, isSelected) => {
|
|
5501
|
+
setSelectedValues(currentSelectedValues => {
|
|
5502
|
+
if (multiselect) {
|
|
5503
|
+
if (Array.isArray(currentSelectedValues)) {
|
|
5504
|
+
const clone = new Set(currentSelectedValues);
|
|
5505
|
+
if (isSelected) {
|
|
5506
|
+
clone.add(_value);
|
|
5507
|
+
} else {
|
|
5508
|
+
clone.delete(_value);
|
|
5509
|
+
}
|
|
5510
|
+
return Array.from(clone);
|
|
5511
|
+
}
|
|
5512
|
+
if (isSelected) {
|
|
5513
|
+
return [_value];
|
|
5514
|
+
}
|
|
5515
|
+
} else if (isSelected) {
|
|
5516
|
+
return _value;
|
|
5517
|
+
}
|
|
5518
|
+
return currentSelectedValues;
|
|
5519
|
+
});
|
|
5520
|
+
}, [setSelectedValues, multiselect]);
|
|
5521
|
+
const sharedMenuProps = {
|
|
5522
|
+
isDisabled,
|
|
5523
|
+
isOpen,
|
|
5524
|
+
onIsOpenChange,
|
|
5525
|
+
'data-testid': dataTestId,
|
|
5526
|
+
isVirtualizationDisabled
|
|
5527
|
+
};
|
|
5528
|
+
return /*#__PURE__*/React__default["default"].createElement(SelectContextProvider, {
|
|
5529
|
+
value: {
|
|
5530
|
+
multiselect,
|
|
5531
|
+
onItemSelect,
|
|
5532
|
+
selectedValues,
|
|
5533
|
+
selectedSelectItems,
|
|
5534
|
+
GetSelectItemsFrom,
|
|
5535
|
+
isInvalid,
|
|
5536
|
+
setSelectedValues,
|
|
5537
|
+
enabledSelectItems
|
|
5538
|
+
}
|
|
5539
|
+
}, /*#__PURE__*/React__default["default"].createElement(Menu, sharedMenuProps, children));
|
|
5540
|
+
};
|
|
5541
|
+
|
|
5542
|
+
const SelectButton = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
5543
|
+
let {
|
|
5544
|
+
children,
|
|
5545
|
+
asChild,
|
|
5546
|
+
placeholder: externalPlaceholder,
|
|
5547
|
+
...rest
|
|
5548
|
+
} = _ref;
|
|
5549
|
+
const {
|
|
5550
|
+
selectedSelectItems,
|
|
5551
|
+
isInvalid,
|
|
5552
|
+
multiselect
|
|
5553
|
+
} = useSelectContext();
|
|
5554
|
+
const {
|
|
5555
|
+
translate
|
|
5556
|
+
} = index.useTranslation();
|
|
5557
|
+
const placeholder = externalPlaceholder !== null && externalPlaceholder !== void 0 ? externalPlaceholder : multiselect ? translate('selectOneOrMore') : translate('selectOne');
|
|
5558
|
+
const selectedItemsString = React.useMemo(() => Array.from(selectedSelectItems)
|
|
5559
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5560
|
+
.map(_ref2 => {
|
|
5561
|
+
let [value, label] = _ref2;
|
|
5562
|
+
return label;
|
|
5563
|
+
}).join(', '), [selectedSelectItems]);
|
|
5564
|
+
const sharedMenuButtonProps = {
|
|
5565
|
+
ref,
|
|
5566
|
+
asChild
|
|
5567
|
+
};
|
|
5568
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuButton, _extends__default["default"]({}, rest, sharedMenuButtonProps, {
|
|
5569
|
+
"aria-haspopup": "tree",
|
|
5570
|
+
role: "combobox",
|
|
5571
|
+
className: classNames__default["default"]({
|
|
5572
|
+
[styles$3.isInvalid]: isInvalid
|
|
5573
|
+
})
|
|
5574
|
+
}), children !== null && children !== void 0 ? children : selectedSelectItems !== null && selectedSelectItems !== void 0 && selectedSelectItems.size ? selectedItemsString : placeholder);
|
|
5575
|
+
});
|
|
5576
|
+
|
|
4945
5577
|
/* eslint-disable camelcase */
|
|
4946
5578
|
|
|
4947
5579
|
exports.Input = index.Input$1;
|
|
@@ -4957,13 +5589,18 @@ exports.FilterAnchor = FilterAnchor;
|
|
|
4957
5589
|
exports.HStack = HStack;
|
|
4958
5590
|
exports.Menu = Menu;
|
|
4959
5591
|
exports.MenuButton = MenuButton;
|
|
4960
|
-
exports.MenuItem = MenuItem;
|
|
5592
|
+
exports.MenuItem = MenuItem$1;
|
|
4961
5593
|
exports.MenuPane = MenuPane;
|
|
4962
5594
|
exports.PhoneNumberInput = PhoneNumberInput;
|
|
5595
|
+
exports.Select = Select;
|
|
5596
|
+
exports.SelectButton = SelectButton;
|
|
5597
|
+
exports.SelectItem = SelectItem;
|
|
5598
|
+
exports.SelectPane = SelectPane;
|
|
4963
5599
|
exports.SplitButton = SplitButton;
|
|
4964
5600
|
exports.SplitButtonOption = SplitButtonOption;
|
|
4965
5601
|
exports.StackItem = StackItem;
|
|
4966
|
-
exports.SubMenu = SubMenu;
|
|
5602
|
+
exports.SubMenu = SubMenu$1;
|
|
5603
|
+
exports.SubSelect = SubSelect;
|
|
4967
5604
|
exports.TimePicker = TimePicker;
|
|
4968
5605
|
exports.ToggleButton = ToggleButton;
|
|
4969
5606
|
exports.ToggleButtonGroup = ToggleButtonGroup;
|