@qualtrics/ui-react 2.20.0 → 2.22.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 +17 -33
- package/dist/__shared/cjs/{index-90d4069b.js → index-025620bf.js} +718 -673
- package/dist/__shared/cjs/{index-579c4690.js → index-41a013d2.js} +4 -4
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +4 -4
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +12 -16
- package/dist/components/ColorPicker/ColorPicker.js +15 -9
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +9 -4
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +8 -6
- package/dist/components/ColorPicker/Hue.js +3 -9
- package/dist/components/ColorPicker/Palette.js +13 -9
- package/dist/components/ColorPicker/Saturation.js +9 -17
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +3 -2
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +10 -9
- package/dist/components/Combobox/Combobox.js +54 -31
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +3 -2
- package/dist/components/Combobox/ComboboxInput.js +4 -4
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +5 -2
- package/dist/components/Dropdown/Dropdown.js +14 -14
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -19
- package/dist/components/Dropdown/DropdownList.js +4 -4
- package/dist/components/Dropdown/DropdownOption.js +5 -7
- package/dist/components/Dropdown/DropdownSearch.js +12 -9
- package/dist/components/FilePicker/FilePicker.js +13 -13
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +12 -9
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -2
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionSet.js +5 -5
- package/dist/components/LogicEditor/LogicEditor.js +1 -1
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +2 -1
- package/dist/components/Modal/Modal.js +14 -13
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +41 -30
- 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 +19 -15
- package/dist/components/NewMenu/parts/MenuItem.js +1 -1
- package/dist/components/NumberStepper/NumberStepper.js +7 -6
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperInput.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +5 -5
- package/dist/components/Pagination/PaginationPageInput.js +11 -9
- package/dist/components/Pagination/PaginationPreviousButton.js +5 -5
- package/dist/components/Popover/Popover.js +9 -7
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +4 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +4 -4
- package/dist/components/Radio/Radio.js +12 -11
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +4 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +2 -1
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -1
- package/dist/components/Slider/RangeSlider.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +1 -1
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabList.js +6 -5
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +15 -7
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -4
- package/dist/components/deprecated_ColorPicker/Color.js +6 -6
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -2
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -1
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -3
- package/dist/components/deprecated_ColorPicker/Saturation.js +5 -5
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +8 -8
- package/dist/components/deprecated_Tabs/Tabs.js +11 -7
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +4 -29
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +8 -8
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -1
- package/dist/hooks/useControllableState/useControllableState.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +4 -1
- package/dist/hooks/useId/useId.js +1 -1
- package/dist/hooks/useOverlay/useOverlay.js +11 -6
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +2 -1
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +4 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/createIconComponent.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.es.js +1 -7
- package/dist/index.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTable.js +86 -87
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +6 -4
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +18 -10
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +7 -6
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +5 -4
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -1
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +3 -2
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +6 -5
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +2 -2
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +2 -2
- package/dist/next/Combobox/ComboboxOption.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +12 -8
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +1 -1
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +3 -2
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +2 -1
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +2 -1
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +1 -1
- package/dist/next/Drawer/Drawer.js +7 -4
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +2 -2
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +11 -5
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuItem.js +19 -11
- package/dist/next/Menu/MenuPane.js +70 -40
- package/dist/next/Menu/MenuSearch.js +16 -71
- package/dist/next/Menu/SubMenu.js +63 -46
- package/dist/next/Menu/constants.js +5 -1
- package/dist/next/Menu/useMutationObserver.js +17 -0
- package/dist/next/Menu/usePaneSearch.js +109 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +8 -2
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -4
- package/dist/next/TimePicker/TimeInput.js +2 -2
- package/dist/next/TimePicker/TimePicker.js +4 -4
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +2 -1
- package/dist/next/TimePicker/utils.js +10 -9
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +2 -1
- package/dist/next/index.js +601 -432
- package/dist/utils/Flyout/Flyout.js +1 -1
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +9 -5
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +2 -1
- package/dist/utils/Translation/useTranslation.js +4 -5
- package/dist/utils/filterChildren/filterChildren.js +2 -1
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -1
- package/dist/utils/mergeRefs/mergeRefs.js +1 -1
- package/dist/utils/wrapEvent/wrapEvent.js +2 -2
- package/icons/package.json +1 -0
- package/next/package.json +2 -1
- package/package.json +4 -4
- package/dist/utils/keyboardUser/index.js +0 -1
- package/dist/utils/keyboardUser/keyboardUser.js +0 -30
|
@@ -40,14 +40,15 @@ const AdvancedTableCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
40
40
|
} : undefined;
|
|
41
41
|
const handleKeyDown = e => {
|
|
42
42
|
if (e.target === e.currentTarget && e.key === 'Enter' && isInteractive) {
|
|
43
|
-
|
|
43
|
+
var _focusableElementRef$;
|
|
44
|
+
(_focusableElementRef$ = focusableElementRef.current) === null || _focusableElementRef$ === void 0 ? void 0 : _focusableElementRef$.focus();
|
|
44
45
|
e.preventDefault(); // Prevent click event from occurring on the focusable element
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
onKeyDown
|
|
48
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
48
49
|
};
|
|
49
50
|
const handleFocus = e => {
|
|
50
|
-
onFocus
|
|
51
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
51
52
|
if (isInteractive) {
|
|
52
53
|
if (e.target !== e.currentTarget) {
|
|
53
54
|
setIsEditing(true);
|
|
@@ -62,7 +63,8 @@ const AdvancedTableCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
62
63
|
}
|
|
63
64
|
} : undefined;
|
|
64
65
|
const focusCell = () => {
|
|
65
|
-
|
|
66
|
+
var _cellRef$current;
|
|
67
|
+
(_cellRef$current = cellRef.current) === null || _cellRef$current === void 0 ? void 0 : _cellRef$current.focus();
|
|
66
68
|
};
|
|
67
69
|
const computedWidth = useComputedWidth(widthBuffer, width);
|
|
68
70
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
@@ -55,8 +55,8 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
55
55
|
const [ellipsisShown, setEllipsisShown] = useState();
|
|
56
56
|
const columnHeaderRef = useRef(null);
|
|
57
57
|
const labelContainerRef = useRef(null);
|
|
58
|
-
const isSortable = Boolean(sortOptions
|
|
59
|
-
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < sortOptions
|
|
58
|
+
const isSortable = Boolean(sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length);
|
|
59
|
+
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (selectedSortOption.direction === 'ascending' || selectedSortOption.direction === 'descending');
|
|
60
60
|
const selectedSortIndex = isSorted ? selectedSortOption.index : -1;
|
|
61
61
|
const arrowUpSvgContent = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("path", {
|
|
62
62
|
fillRule: "evenodd",
|
|
@@ -120,19 +120,22 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
120
120
|
setIsHiddenMenuOpen(true);
|
|
121
121
|
setHiddenMenuHighlightedIndex(0);
|
|
122
122
|
} else if (onWidthChange && e.key === 'ArrowRight' && e.shiftKey) {
|
|
123
|
+
var _columnHeaderRef$curr;
|
|
123
124
|
e.preventDefault(); // prevent scroll
|
|
124
|
-
const newWidth = columnHeaderRef.current
|
|
125
|
+
const newWidth = ((_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect().width) + 10;
|
|
125
126
|
onWidthChange(newWidth);
|
|
126
127
|
} else if (onWidthChange && e.key === 'ArrowLeft' && e.shiftKey) {
|
|
128
|
+
var _columnHeaderRef$curr2;
|
|
127
129
|
e.preventDefault(); // prevent scroll
|
|
128
|
-
const newWidth = Math.max(80, columnHeaderRef.current
|
|
130
|
+
const newWidth = Math.max(80, ((_columnHeaderRef$curr2 = columnHeaderRef.current) === null || _columnHeaderRef$curr2 === void 0 ? void 0 : _columnHeaderRef$curr2.getBoundingClientRect().width) - 10);
|
|
129
131
|
onWidthChange(newWidth);
|
|
130
132
|
} else {
|
|
131
|
-
onKeyDown
|
|
133
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
132
134
|
}
|
|
133
135
|
};
|
|
134
136
|
const handleClick = e => {
|
|
135
|
-
|
|
137
|
+
var _labelContainerRef$cu;
|
|
138
|
+
if (e.target === e.currentTarget || (_labelContainerRef$cu = labelContainerRef.current) !== null && _labelContainerRef$cu !== void 0 && _labelContainerRef$cu.contains(e.target)) {
|
|
136
139
|
const newIndex = isSorted ? selectedSortIndex : 0;
|
|
137
140
|
const newDirection = isSorted && selectedSortOption.direction === 'ascending' ? 'descending' : 'ascending';
|
|
138
141
|
setSelectedSortOption({
|
|
@@ -197,10 +200,11 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
197
200
|
}
|
|
198
201
|
};
|
|
199
202
|
const handleMouseMove = e => {
|
|
203
|
+
var _columnHeaderRef$curr3;
|
|
200
204
|
const mouseX = e.clientX;
|
|
201
|
-
const headerX = columnHeaderRef.current
|
|
205
|
+
const headerX = (_columnHeaderRef$curr3 = columnHeaderRef.current) === null || _columnHeaderRef$curr3 === void 0 ? void 0 : _columnHeaderRef$curr3.getBoundingClientRect().x;
|
|
202
206
|
const newWidth = Math.max(80, mouseX - headerX);
|
|
203
|
-
onWidthChange
|
|
207
|
+
onWidthChange === null || onWidthChange === void 0 ? void 0 : onWidthChange(newWidth);
|
|
204
208
|
};
|
|
205
209
|
const handleMouseUp = e => {
|
|
206
210
|
if (e.button === 0) {
|
|
@@ -220,7 +224,10 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
220
224
|
onIsPinnedChange: disableUserPinnableColumns ? undefined : handleIsPinnedChange,
|
|
221
225
|
onMoveLeft: disableUserReorderableColumns || isPinned && columnIndex === 0 || !isPinned && columnIndex === minUnpinnedColumnIndex ? undefined : handleMoveLeft,
|
|
222
226
|
onMoveRight: disableUserReorderableColumns || isPinned && columnIndex === minUnpinnedColumnIndex - 1 || !isPinned && columnIndex === maxUnpinnedColumnIndex ? undefined : handleMoveRight,
|
|
223
|
-
onFocus: () =>
|
|
227
|
+
onFocus: () => {
|
|
228
|
+
var _columnHeaderRef$curr4;
|
|
229
|
+
return (_columnHeaderRef$curr4 = columnHeaderRef.current) === null || _columnHeaderRef$curr4 === void 0 ? void 0 : _columnHeaderRef$curr4.focus();
|
|
230
|
+
},
|
|
224
231
|
columnId: id,
|
|
225
232
|
columnHeaderRef,
|
|
226
233
|
'data-testid': dataTestId
|
|
@@ -288,7 +295,8 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
288
295
|
tabIndex: -1,
|
|
289
296
|
"aria-hidden": "true",
|
|
290
297
|
onFocus: () => {
|
|
291
|
-
|
|
298
|
+
var _columnHeaderRef$curr5;
|
|
299
|
+
(_columnHeaderRef$curr5 = columnHeaderRef.current) === null || _columnHeaderRef$curr5 === void 0 ? void 0 : _columnHeaderRef$curr5.focus();
|
|
292
300
|
},
|
|
293
301
|
className: styles.advancedTableColumnHeaderMenuHiddenAnchor
|
|
294
302
|
})
|
|
@@ -52,10 +52,11 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
52
52
|
role: "menuitem" // Enables having an action menu item inside of a SelectMenu
|
|
53
53
|
,
|
|
54
54
|
onSelect: e => {
|
|
55
|
+
var _columnHeaderRef$curr;
|
|
55
56
|
e.preventDefault(); // prevents SelectMenu value from changing
|
|
56
57
|
setIsOpen(false);
|
|
57
|
-
columnHeaderRef.current
|
|
58
|
-
onSelect
|
|
58
|
+
(_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.focus();
|
|
59
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
59
60
|
},
|
|
60
61
|
"date-testid": menuItemDataTestId
|
|
61
62
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
@@ -86,7 +87,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
86
87
|
},
|
|
87
88
|
isOpen: isOpen,
|
|
88
89
|
onIsOpenChange: setIsOpen
|
|
89
|
-
}, rest), sortOptions
|
|
90
|
+
}, rest), sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.map((_ref3, index) => {
|
|
90
91
|
let {
|
|
91
92
|
ascendingLabel,
|
|
92
93
|
ascendingIcon,
|
|
@@ -109,7 +110,7 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
109
110
|
key: ascendingValue,
|
|
110
111
|
value: ascendingValue,
|
|
111
112
|
label: ascendingLabel,
|
|
112
|
-
"data-testid": getSubDataTestId(dataTestId,
|
|
113
|
+
"data-testid": getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index, "-").concat(SortDirections.Ascending))
|
|
113
114
|
}, /*#__PURE__*/React__default.createElement(AscendingIconComponent, {
|
|
114
115
|
size: "small",
|
|
115
116
|
className: styles.advancedTableColumnHeaderMenuItemIcon,
|
|
@@ -118,13 +119,13 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
118
119
|
key: descendingValue,
|
|
119
120
|
value: descendingValue,
|
|
120
121
|
label: descendingLabel,
|
|
121
|
-
"data-testid": getSubDataTestId(dataTestId,
|
|
122
|
+
"data-testid": getSubDataTestId(dataTestId, "ColumnHeaderMenu-Sort-".concat(index, "-").concat(SortDirections.Descending))
|
|
122
123
|
}, /*#__PURE__*/React__default.createElement(DescendingIconComponent, {
|
|
123
124
|
size: "small",
|
|
124
125
|
className: styles.advancedTableColumnHeaderMenuItemIcon,
|
|
125
126
|
"aria-hidden": "true"
|
|
126
127
|
}), descendingLabel)];
|
|
127
|
-
}), sortOptions
|
|
128
|
+
}), (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (onIsPinnedChange || onMoveLeft || onMoveRight) && /*#__PURE__*/React__default.createElement(Divider, null), pinItem, onMoveLeft && getActionMenuItem({
|
|
128
129
|
onSelect: onMoveLeft,
|
|
129
130
|
Icon: ArrowLeftIcon,
|
|
130
131
|
label: translate('advancedTable.moveColumnLeft'),
|
|
@@ -5,6 +5,7 @@ import styles from './AdvancedTable2.js';
|
|
|
5
5
|
import Portal from '../../utils/Portal/Portal.js';
|
|
6
6
|
|
|
7
7
|
const AdvancedTableDragPreview = _ref => {
|
|
8
|
+
var _columnHeaderRefs$ite, _columnHeaderRefs$ite2, _tableRef$current, _tableRef$current$get;
|
|
8
9
|
let {
|
|
9
10
|
tableRef,
|
|
10
11
|
columnHeaderRefs
|
|
@@ -16,10 +17,10 @@ const AdvancedTableDragPreview = _ref => {
|
|
|
16
17
|
item: monitor.getItem(),
|
|
17
18
|
currentOffset: monitor.getSourceClientOffset()
|
|
18
19
|
}));
|
|
19
|
-
const width = columnHeaderRefs
|
|
20
|
-
const height = tableRef.current
|
|
21
|
-
const top = currentOffset
|
|
22
|
-
const left = currentOffset
|
|
20
|
+
const width = columnHeaderRefs === null || columnHeaderRefs === void 0 ? void 0 : (_columnHeaderRefs$ite = columnHeaderRefs[item === null || item === void 0 ? void 0 : item.columnIndex]) === null || _columnHeaderRefs$ite === void 0 ? void 0 : (_columnHeaderRefs$ite2 = _columnHeaderRefs$ite.getBoundingClientRect()) === null || _columnHeaderRefs$ite2 === void 0 ? void 0 : _columnHeaderRefs$ite2.width;
|
|
21
|
+
const height = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$get = _tableRef$current.getBoundingClientRect()) === null || _tableRef$current$get === void 0 ? void 0 : _tableRef$current$get.height;
|
|
22
|
+
const top = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.y) || 0;
|
|
23
|
+
const left = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.x) || 0;
|
|
23
24
|
return /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement("div", {
|
|
24
25
|
className: styles.dragPreview,
|
|
25
26
|
style: {
|
|
@@ -19,7 +19,7 @@ const AdvancedTablePagination = _ref => {
|
|
|
19
19
|
page
|
|
20
20
|
} = _ref2;
|
|
21
21
|
setCurrentPage(page);
|
|
22
|
-
onPageChange
|
|
22
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(page);
|
|
23
23
|
};
|
|
24
24
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
25
25
|
className: styles.advancedTablePaginationContainer
|
|
@@ -53,6 +53,7 @@ const useDragAndDrop = _ref => {
|
|
|
53
53
|
}, dropRef] = useDrop(() => ({
|
|
54
54
|
accept: tableId,
|
|
55
55
|
hover: (item, monitor) => {
|
|
56
|
+
var _monitor$getClientOff, _columnHeaderRef$curr;
|
|
56
57
|
const {
|
|
57
58
|
id: dragSourceId,
|
|
58
59
|
columnIndex: dragSourceColumnIndex,
|
|
@@ -65,11 +66,11 @@ const useDragAndDrop = _ref => {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
// Calculate which column line is closest
|
|
68
|
-
const dropX = monitor.getClientOffset()
|
|
69
|
+
const dropX = (_monitor$getClientOff = monitor.getClientOffset()) === null || _monitor$getClientOff === void 0 ? void 0 : _monitor$getClientOff.x;
|
|
69
70
|
const {
|
|
70
71
|
x,
|
|
71
72
|
width
|
|
72
|
-
} = columnHeaderRef.current
|
|
73
|
+
} = (_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect();
|
|
73
74
|
const diffLeft = Math.abs(dropX - x) || 0;
|
|
74
75
|
const diffRight = Math.abs(dropX - (x + width)) || 0;
|
|
75
76
|
if (diffLeft < diffRight) {
|
|
@@ -3,7 +3,7 @@ import { useMemo } from 'react';
|
|
|
3
3
|
function useComputedWidth() {
|
|
4
4
|
let widthBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
5
5
|
let defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
6
|
-
return useMemo(() => typeof defaultWidth === 'number' ?
|
|
6
|
+
return useMemo(() => typeof defaultWidth === 'number' ? "".concat(defaultWidth + widthBuffer, "px") : "calc(".concat(widthBuffer, "px + ").concat(defaultWidth, ")"), [widthBuffer, defaultWidth]);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { useComputedWidth as default };
|
|
@@ -7,7 +7,6 @@ import '../../hooks/index.js';
|
|
|
7
7
|
import '../../components/SearchInput/index.js';
|
|
8
8
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
9
9
|
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
10
|
-
import { setIsKeyboardUser } from '../../utils/keyboardUser/keyboardUser.js';
|
|
11
10
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
12
11
|
import SearchInput from '../../components/SearchInput/SearchInput.js';
|
|
13
12
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
@@ -67,7 +66,8 @@ const CollapsibleSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
67
66
|
});
|
|
68
67
|
};
|
|
69
68
|
const handleIconButtonClick = () => {
|
|
70
|
-
|
|
69
|
+
var _iconButtonRef$curren;
|
|
70
|
+
(_iconButtonRef$curren = iconButtonRef.current) === null || _iconButtonRef$curren === void 0 ? void 0 : _iconButtonRef$curren.focus();
|
|
71
71
|
setExternalIsExpanded(true);
|
|
72
72
|
};
|
|
73
73
|
useDidUpdate(() => {
|
|
@@ -82,18 +82,19 @@ const CollapsibleSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
82
82
|
});
|
|
83
83
|
}, [externalIsExpanded]);
|
|
84
84
|
useEffect(() => {
|
|
85
|
+
var _searchInputRef$curre, _iconButtonRef$curren2;
|
|
85
86
|
if (isComponentFocused) {
|
|
86
87
|
switch (internalExpandedState) {
|
|
87
88
|
case expandedStates.EXPANDING:
|
|
88
|
-
searchInputRef.current
|
|
89
|
+
(_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
|
|
89
90
|
break;
|
|
90
91
|
case expandedStates.COLLAPSED:
|
|
91
92
|
/*
|
|
92
93
|
* Handles use-case when user clicks on search input to enter text and the component is collapsed while focus is still on the search input.
|
|
93
94
|
* This will show the focus ring on the icon button and allow the tooltip to appear.
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
-
iconButtonRef.current
|
|
96
|
+
|
|
97
|
+
(_iconButtonRef$curren2 = iconButtonRef.current) === null || _iconButtonRef$curren2 === void 0 ? void 0 : _iconButtonRef$curren2.focus();
|
|
97
98
|
break;
|
|
98
99
|
default:
|
|
99
100
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"collapsibleSearchInput":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._jakeN{display:inline-block;width:36px;transition:width .25s ease-out}._eTa5V{width:100%}._4oLH9>input{padding-right:0!important}._P3iQS>svg{fill:#515559}";
|
|
4
|
+
var styles = {"collapsibleSearchInput":"_jakeN","searchInput":"_eTa5V","searchInputCollapsed":"_4oLH9","iconButton":"_P3iQS"};
|
|
5
|
+
var stylesheet="._jakeN{display:inline-block;width:36px;transition:width .25s ease-out}._eTa5V{width:100%}._4oLH9>input{padding-right:0!important}._P3iQS>svg{fill:#515559}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -21,7 +21,7 @@ const CollapsibleSearchInputIconButton = /*#__PURE__*/forwardRef((_ref, ref) =>
|
|
|
21
21
|
return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, rest, {
|
|
22
22
|
className: styles.iconButton,
|
|
23
23
|
"aria-label": label,
|
|
24
|
-
tooltipContent: tooltipContent
|
|
24
|
+
tooltipContent: tooltipContent !== null && tooltipContent !== void 0 ? tooltipContent : label,
|
|
25
25
|
tooltipPlacement: tooltipPlacement,
|
|
26
26
|
ref: ref
|
|
27
27
|
}), /*#__PURE__*/React__default.createElement(SearchIcon, null));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"loadingSpinner":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._xq0A3 :after{background-color:#515559!important}._5aqVK>input:focus{box-shadow:none!important;border:1px solid #898989!important}._N4RtS{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}._N4RtS ._-TygD ._WCjrf{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}._N4RtS ._-TygD:first-child ._kr1f5{display:none}._N4RtS ._eSWAu{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._N4RtS ._eSWAu:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._N4RtS ._eSWAu:hover._PQ7bi{background-color:#e4effa}._N4RtS ._eSWAu._PQ7bi{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._N4RtS ._eSWAu:active:not(._PQ7bi){background-color:#e8e9e9}";
|
|
4
|
+
var styles = {"loadingSpinner":"_xq0A3","ignoreFocusStyle":"_5aqVK","flyout":"_N4RtS","group":"_-TygD","header":"_WCjrf","divider":"_kr1f5","option":"_eSWAu","selected":"_PQ7bi"};
|
|
5
|
+
var stylesheet="._xq0A3 :after{background-color:#515559!important}._5aqVK>input:focus{box-shadow:none!important;border:1px solid #898989!important}._N4RtS{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}._N4RtS ._-TygD ._WCjrf{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}._N4RtS ._-TygD:first-child ._kr1f5{display:none}._N4RtS ._eSWAu{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._N4RtS ._eSWAu:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._N4RtS ._eSWAu:hover._PQ7bi{background-color:#e4effa}._N4RtS ._eSWAu._PQ7bi{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._N4RtS ._eSWAu:active:not(._PQ7bi){background-color:#e8e9e9}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -41,8 +41,8 @@ const ComboboxFlyout = _ref => {
|
|
|
41
41
|
id: flyoutId,
|
|
42
42
|
className: styles.flyout,
|
|
43
43
|
style: flyoutDimensions,
|
|
44
|
-
"aria-label": ariaLabel
|
|
45
|
-
"aria-labelledby": ariaLabelledBy
|
|
44
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rootAriaLabel,
|
|
45
|
+
"aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : rootAriaLabelledBy,
|
|
46
46
|
"aria-describedby": ariaDescribedBy,
|
|
47
47
|
"data-testid": getSubDataTestId(rootDataTestId, 'flyout'),
|
|
48
48
|
ref: flyoutRef
|
|
@@ -41,7 +41,7 @@ function ComboboxGroup(_ref) {
|
|
|
41
41
|
className: styles.group,
|
|
42
42
|
"aria-labelledby": headerElementId,
|
|
43
43
|
"aria-describedby": ariaDescribedBy,
|
|
44
|
-
"data-testid": getSubDataTestId(rootDataTestId,
|
|
44
|
+
"data-testid": getSubDataTestId(rootDataTestId, "group-".concat(label))
|
|
45
45
|
}, /*#__PURE__*/React__default.createElement(Divider, {
|
|
46
46
|
className: styles.divider
|
|
47
47
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -139,8 +139,8 @@ const ComboboxInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
139
139
|
onBlur: () => {
|
|
140
140
|
commitCurrentRawInputValueAndCloseFlyout();
|
|
141
141
|
},
|
|
142
|
-
"aria-label": ariaLabel
|
|
143
|
-
"aria-labelledby": ariaLabelledBy
|
|
142
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rootAriaLabel,
|
|
143
|
+
"aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : rootAriaLabelledBy,
|
|
144
144
|
"aria-describedby": ariaDescribedBy,
|
|
145
145
|
"data-testid": getSubDataTestId(rootDataTestId, 'input'),
|
|
146
146
|
"aria-expanded": isOpen,
|
|
@@ -68,7 +68,7 @@ function ComboboxOption(_ref) {
|
|
|
68
68
|
onMouseDown: e => e.preventDefault() // Prevents the input from getting blurred
|
|
69
69
|
,
|
|
70
70
|
"aria-selected": isOptionSelected,
|
|
71
|
-
"data-testid": getSubDataTestId(rootDataTestId,
|
|
71
|
+
"data-testid": getSubDataTestId(rootDataTestId, "option-".concat(label)),
|
|
72
72
|
ref: containerElementRef
|
|
73
73
|
}, label);
|
|
74
74
|
}
|
|
@@ -19,7 +19,7 @@ function useComboboxFilteredGroup() {
|
|
|
19
19
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
20
20
|
if (!option) {
|
|
21
21
|
// eslint-disable-next-line no-console
|
|
22
|
-
console.warn(
|
|
22
|
+
console.warn("[".concat(useComboboxFilteredGroup.name, "] registerOption called without any parameters! Pass in \"option\" as parameter."));
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
insertOption(option, filteredOptionsRef.current);
|
|
@@ -50,7 +50,8 @@ isDisabled) {
|
|
|
50
50
|
* @param descendantElement - The element to be marked as the active descendant element.
|
|
51
51
|
*/
|
|
52
52
|
const focusDescendant = useCallback((descendantElement, index) => {
|
|
53
|
-
|
|
53
|
+
var _inputRef$current;
|
|
54
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute('aria-activedescendant', descendantElement.id);
|
|
54
55
|
setActiveDescendant({
|
|
55
56
|
element: descendantElement,
|
|
56
57
|
index
|
|
@@ -81,7 +82,7 @@ isDisabled) {
|
|
|
81
82
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
82
83
|
if (!option) {
|
|
83
84
|
// eslint-disable-next-line no-console
|
|
84
|
-
console.error(
|
|
85
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] registerOption called without any parameters! Pass in a 'ComboboxOption' via the \"option\" parameter."));
|
|
85
86
|
} else {
|
|
86
87
|
insertOption(option, filteredOptionsRef.current);
|
|
87
88
|
}
|
|
@@ -95,10 +96,11 @@ isDisabled) {
|
|
|
95
96
|
// NOTE: This function and its dependencies *must* not change during re-renders because it will cause ComboboxOptions to deregister and reregister, thus causing unexpected behavior
|
|
96
97
|
if (!option) {
|
|
97
98
|
// eslint-disable-next-line no-console
|
|
98
|
-
console.error(
|
|
99
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] deregisterOption called without any parameters! Pass in a 'ComboboxOption' via the \"option\" parameter."));
|
|
99
100
|
} else {
|
|
101
|
+
var _activeDescendantRef$;
|
|
100
102
|
deleteOption(option, filteredOptionsRef.current, useComboboxFocusSequence.name);
|
|
101
|
-
if (option === activeDescendantRef.current
|
|
103
|
+
if (option === ((_activeDescendantRef$ = activeDescendantRef.current) === null || _activeDescendantRef$ === void 0 ? void 0 : _activeDescendantRef$.element)) {
|
|
102
104
|
setActiveDescendant(undefined);
|
|
103
105
|
}
|
|
104
106
|
if (filteredOptionsRef.current.length === 0) {
|
|
@@ -140,7 +142,8 @@ isDisabled) {
|
|
|
140
142
|
if (!isOpen) {
|
|
141
143
|
openFlyoutAndFocus(focusNext.name);
|
|
142
144
|
} else {
|
|
143
|
-
|
|
145
|
+
var _activeDescendantRef$2;
|
|
146
|
+
const currentFocusedNodeIndex = (_activeDescendantRef$2 = activeDescendantRef.current) === null || _activeDescendantRef$2 === void 0 ? void 0 : _activeDescendantRef$2.index;
|
|
144
147
|
if (currentFocusedNodeIndex === filteredOptionsRef.current.length - 1) {
|
|
145
148
|
focusInput();
|
|
146
149
|
} else if (currentFocusedNodeIndex === undefined) {
|
|
@@ -161,7 +164,8 @@ isDisabled) {
|
|
|
161
164
|
if (!isOpen) {
|
|
162
165
|
openFlyoutAndFocus(focusPrevious.name);
|
|
163
166
|
} else {
|
|
164
|
-
|
|
167
|
+
var _activeDescendantRef$3;
|
|
168
|
+
const currentFocusedNodeIndex = (_activeDescendantRef$3 = activeDescendantRef.current) === null || _activeDescendantRef$3 === void 0 ? void 0 : _activeDescendantRef$3.index;
|
|
165
169
|
if (currentFocusedNodeIndex === 0) {
|
|
166
170
|
focusInput();
|
|
167
171
|
} else if (currentFocusedNodeIndex === undefined) {
|
|
@@ -248,13 +252,13 @@ isDisabled) {
|
|
|
248
252
|
focusLast,
|
|
249
253
|
focusNext,
|
|
250
254
|
focusPrevious,
|
|
251
|
-
activeDescendantElement: activeDescendant
|
|
255
|
+
activeDescendantElement: activeDescendant === null || activeDescendant === void 0 ? void 0 : activeDescendant.element,
|
|
252
256
|
filteredOptionsRef
|
|
253
257
|
};
|
|
254
258
|
}
|
|
255
259
|
function logNoOptionsToFocusError(functionName) {
|
|
256
260
|
// eslint-disable-next-line no-console
|
|
257
|
-
console.error(
|
|
261
|
+
console.error("[".concat(useComboboxFocusSequence.name, "] Invalid call to '").concat(functionName, "'. There are no registered nodes to focus."));
|
|
258
262
|
}
|
|
259
263
|
|
|
260
264
|
/**
|
|
@@ -13,7 +13,7 @@ import useControllableState from '../../../../hooks/useControllableState/useCont
|
|
|
13
13
|
*/
|
|
14
14
|
function useComboboxValue(initialInputValue, externalInputValue, externalOnChange) {
|
|
15
15
|
// This is the `value` of the `input` element (what is displayed to the user)
|
|
16
|
-
const [rawInputValue, setRawInputValue] = useState(externalInputValue
|
|
16
|
+
const [rawInputValue, setRawInputValue] = useState(externalInputValue !== null && externalInputValue !== void 0 ? externalInputValue : initialInputValue);
|
|
17
17
|
|
|
18
18
|
// The `value` of the `input` element will become this value by the time the `input` element is blurred
|
|
19
19
|
const [committedInputValue, setCommittedInputValue_DO_NOT_USE // A setter is created below so that the raw input value is also updated
|
|
@@ -21,9 +21,10 @@ function getFlyoutDimensions(anchorDimensions) {
|
|
|
21
21
|
* @returns A CSS style object containing styles to properly size the flyout.
|
|
22
22
|
*/
|
|
23
23
|
function useListboxFlyoutDimensions(anchorElement) {
|
|
24
|
+
var _anchorElement$offset, _anchorElement$offset2;
|
|
24
25
|
const [anchorDimensions, setAnchorDimensions] = useState({
|
|
25
|
-
width: anchorElement
|
|
26
|
-
height: anchorElement
|
|
26
|
+
width: (_anchorElement$offset = anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.offsetWidth) !== null && _anchorElement$offset !== void 0 ? _anchorElement$offset : 0,
|
|
27
|
+
height: (_anchorElement$offset2 = anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.offsetHeight) !== null && _anchorElement$offset2 !== void 0 ? _anchorElement$offset2 : 18
|
|
27
28
|
});
|
|
28
29
|
const [flyoutDimensions, setFlyoutDimensions] = useState(getFlyoutDimensions(anchorDimensions));
|
|
29
30
|
|
|
@@ -11,8 +11,9 @@ function useSelectedOptionScroll(isOpen, activeDescendantElement, optionsRef, fl
|
|
|
11
11
|
// Scrolls to the selected option if the selected option is out of view
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
if (isOpen && activeDescendantElement && flyoutRef.current) {
|
|
14
|
+
var _optionsRef$current;
|
|
14
15
|
const flyoutContainerElement = flyoutRef.current;
|
|
15
|
-
if (activeDescendantElement === optionsRef.current
|
|
16
|
+
if (activeDescendantElement === ((_optionsRef$current = optionsRef.current) === null || _optionsRef$current === void 0 ? void 0 : _optionsRef$current[0])) {
|
|
16
17
|
// Scrolls the first header into view if one exists
|
|
17
18
|
flyoutContainerElement.scrollTop = 0;
|
|
18
19
|
} else if (flyoutContainerElement.scrollHeight > flyoutContainerElement.clientHeight) {
|
|
@@ -11,7 +11,8 @@ function useShouldRenderGroupHeader(filteredOptionsRef, committedInputValue) {
|
|
|
11
11
|
|
|
12
12
|
// Should render the header if the group includes at least one filtered option
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
|
|
14
|
+
var _filteredOptionsRef$c;
|
|
15
|
+
if (((_filteredOptionsRef$c = filteredOptionsRef.current) === null || _filteredOptionsRef$c === void 0 ? void 0 : _filteredOptionsRef$c.length) === 0) {
|
|
15
16
|
setShouldRenderHeader(false);
|
|
16
17
|
} else {
|
|
17
18
|
setShouldRenderHeader(true);
|
|
@@ -26,7 +26,7 @@ function deleteOption(option, options, hookFunctionName) {
|
|
|
26
26
|
const indexOfNodeToDelete = options.findIndex(n => n === option);
|
|
27
27
|
if (indexOfNodeToDelete === -1) {
|
|
28
28
|
// eslint-disable-next-line no-console
|
|
29
|
-
console.error(
|
|
29
|
+
console.error("[".concat(hookFunctionName, "] Attempt to delete node failed. This node does not exist in the list of registered nodes."));
|
|
30
30
|
} else {
|
|
31
31
|
options.splice(indexOfNodeToDelete, 1);
|
|
32
32
|
}
|
|
@@ -20,6 +20,7 @@ import { PortalTargetProvider } from '../../components/UIProvider/PortalTargetCo
|
|
|
20
20
|
import CloseIcon from '../../icons/components/CloseIcon.js';
|
|
21
21
|
|
|
22
22
|
const Drawer = _ref => {
|
|
23
|
+
var _containerRef$current;
|
|
23
24
|
let {
|
|
24
25
|
id,
|
|
25
26
|
isOpen: externalIsOpen,
|
|
@@ -71,13 +72,15 @@ const Drawer = _ref => {
|
|
|
71
72
|
setIsHidden(false);
|
|
72
73
|
setElementUsedToOpenModal(document.activeElement);
|
|
73
74
|
} else {
|
|
75
|
+
var _elementRefToFocusOnC;
|
|
74
76
|
setIsClosing(true);
|
|
75
|
-
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose
|
|
77
|
+
if (elementRefToFocusOnClose !== undefined) elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 ? void 0 : (_elementRefToFocusOnC = elementRefToFocusOnClose.current) === null || _elementRefToFocusOnC === void 0 ? void 0 : _elementRefToFocusOnC.focus();else elementUsedToOpenModal === null || elementUsedToOpenModal === void 0 ? void 0 : elementUsedToOpenModal.focus();
|
|
76
78
|
}
|
|
77
79
|
}, [elementRefToFocusOnClose, isOpen]);
|
|
78
80
|
useEffect(() => {
|
|
79
81
|
if (isOpen && !isHidden) {
|
|
80
|
-
|
|
82
|
+
var _closeButtonRef$curre;
|
|
83
|
+
(_closeButtonRef$curre = closeButtonRef.current) === null || _closeButtonRef$curre === void 0 ? void 0 : _closeButtonRef$curre.focus();
|
|
81
84
|
}
|
|
82
85
|
}, [isOpen, isHidden]);
|
|
83
86
|
const handleTransitionEnd = () => {
|
|
@@ -96,7 +99,7 @@ const Drawer = _ref => {
|
|
|
96
99
|
}),
|
|
97
100
|
style: {
|
|
98
101
|
width,
|
|
99
|
-
left:
|
|
102
|
+
left: "".concat(isHidden || isClosing ? "-".concat(width) : '0'),
|
|
100
103
|
zIndex
|
|
101
104
|
},
|
|
102
105
|
onKeyDown: handleKeyDown,
|
|
@@ -121,7 +124,7 @@ const Drawer = _ref => {
|
|
|
121
124
|
"aria-label": closeButtonAriaLabel
|
|
122
125
|
}, /*#__PURE__*/React__default.createElement(CloseIcon, null))), /*#__PURE__*/React__default.createElement("div", {
|
|
123
126
|
"data-testid": getSubDataTestId(dataTestId, 'body')
|
|
124
|
-
}, children))), containerRef
|
|
127
|
+
}, children))), (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body) : null;
|
|
125
128
|
};
|
|
126
129
|
|
|
127
130
|
export { Drawer as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"drawer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._a3VHe{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}._SCuPd{visibility:hidden}._sFqQi{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._8UPIu{padding-top:8px}._LCjYN{margin-left:12px}";
|
|
4
|
+
var styles = {"drawer":"_a3VHe","hidden":"_SCuPd","header":"_sFqQi","title":"_8UPIu","closeButton":"_LCjYN"};
|
|
5
|
+
var stylesheet="._a3VHe{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}._SCuPd{visibility:hidden}._sFqQi{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._8UPIu{padding-top:8px}._LCjYN{margin-left:12px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -45,14 +45,14 @@ const FilterAnchor = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
45
45
|
if (isDisabled) {
|
|
46
46
|
e.stopPropagation(); // Prevents "click" events from occurring on parent elements
|
|
47
47
|
} else {
|
|
48
|
-
onClick
|
|
48
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
onKeyDown: e => {
|
|
52
52
|
if (isDisabled) {
|
|
53
53
|
e.stopPropagation(); // Prevents "keydown" events from occurring on parent elements
|
|
54
54
|
} else {
|
|
55
|
-
onKeyDown
|
|
55
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
disabled: undefined // This component uses aria-disabled instead of disabled
|
|
@@ -79,7 +79,7 @@ const FilterAnchor = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
79
79
|
}, label)), isLoading ? /*#__PURE__*/React__default.createElement(LoadingSpinner, {
|
|
80
80
|
show: true,
|
|
81
81
|
size: "xs",
|
|
82
|
-
"aria-label": loadingSpinnerAriaLabel
|
|
82
|
+
"aria-label": loadingSpinnerAriaLabel !== null && loadingSpinnerAriaLabel !== void 0 ? loadingSpinnerAriaLabel : translate('loading')
|
|
83
83
|
}) : selectedFilters && /*#__PURE__*/React__default.createElement("div", {
|
|
84
84
|
className: styles.selectedFiltersContainer
|
|
85
85
|
}, /*#__PURE__*/React__default.createElement(TextOverflowTooltip, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"button":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._hd5Op{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}._hd5Op:hover:not(._bwYzJ){background-color:rgba(50,54,58,.08)}._hd5Op:hover:not(._bwYzJ)._pbRsW{border-color:#085caf;background-color:rgba(11,110,208,.04)}._hd5Op:hover:not(._bwYzJ)._pbRsW ._6K2iq{color:#32363a}._hd5Op:hover:not(._bwYzJ)._pbRsW ._ymGAJ{fill:#32363a}._hd5Op:hover:not(._bwYzJ)._pbRsW ._rrUXQ{fill:#085caf}._hd5Op:hover:not(._bwYzJ)._pbRsW ._cf46Y{background-color:rgba(11,110,208,.11)}._hd5Op:hover:not(._bwYzJ)._pbRsW ._cf46Y ._0oWI8{color:#085caf}._hd5Op:active:not(._bwYzJ){background-color:#e8e9e9}._hd5Op:active:not(._bwYzJ)._pbRsW{background-color:rgba(11,110,208,.11);border-color:#0854a1}._hd5Op:active:not(._bwYzJ)._pbRsW ._rrUXQ{fill:#0854a1}._hd5Op:active:not(._bwYzJ)._pbRsW ._cf46Y{background-color:rgba(11,110,208,.11)}._hd5Op:active:not(._bwYzJ)._pbRsW ._cf46Y ._0oWI8{color:#0854a1}._hd5Op._bwYzJ{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._hd5Op._pbRsW{border-color:#0b6ed0}._ymGAJ{fill:#515559;margin-right:4px}._6K2iq{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._6K2iq+._cf46Y{margin-left:6px}._6K2iq._bwYzJ{color:#74777a}._cf46Y{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}._0oWI8{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._rrUXQ{fill:#515559}._rrUXQ._bwYzJ,._rrUXQ._bwYzJ._pbRsW{fill:rgba(116,119,122,.4)}._rrUXQ._pbRsW{fill:#0b6ed0}._rrUXQ._rcyO1{transform:rotate(-180deg)}._hd5Op.focus-visible,._hd5Op:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"button":"_hd5Op","disabled":"_bwYzJ","selected":"_pbRsW","label":"_6K2iq","lockIcon":"_ymGAJ","chevronIcon":"_rrUXQ","selectedFiltersContainer":"_cf46Y","selectedFilters":"_0oWI8","open":"_rcyO1"};
|
|
5
|
+
var stylesheet="._hd5Op{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}._hd5Op:hover:not(._bwYzJ){background-color:rgba(50,54,58,.08)}._hd5Op:hover:not(._bwYzJ)._pbRsW{border-color:#085caf;background-color:rgba(11,110,208,.04)}._hd5Op:hover:not(._bwYzJ)._pbRsW ._6K2iq{color:#32363a}._hd5Op:hover:not(._bwYzJ)._pbRsW ._ymGAJ{fill:#32363a}._hd5Op:hover:not(._bwYzJ)._pbRsW ._rrUXQ{fill:#085caf}._hd5Op:hover:not(._bwYzJ)._pbRsW ._cf46Y{background-color:rgba(11,110,208,.11)}._hd5Op:hover:not(._bwYzJ)._pbRsW ._cf46Y ._0oWI8{color:#085caf}._hd5Op:active:not(._bwYzJ){background-color:#e8e9e9}._hd5Op:active:not(._bwYzJ)._pbRsW{background-color:rgba(11,110,208,.11);border-color:#0854a1}._hd5Op:active:not(._bwYzJ)._pbRsW ._rrUXQ{fill:#0854a1}._hd5Op:active:not(._bwYzJ)._pbRsW ._cf46Y{background-color:rgba(11,110,208,.11)}._hd5Op:active:not(._bwYzJ)._pbRsW ._cf46Y ._0oWI8{color:#0854a1}._hd5Op._bwYzJ{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._hd5Op._pbRsW{border-color:#0b6ed0}._ymGAJ{fill:#515559;margin-right:4px}._6K2iq{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._6K2iq+._cf46Y{margin-left:6px}._6K2iq._bwYzJ{color:#74777a}._cf46Y{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}._0oWI8{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._rrUXQ{fill:#515559}._rrUXQ._bwYzJ,._rrUXQ._bwYzJ._pbRsW{fill:rgba(116,119,122,.4)}._rrUXQ._pbRsW{fill:#0b6ed0}._rrUXQ._rcyO1{transform:rotate(-180deg)}._hd5Op.focus-visible,._hd5Op:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|