@qualtrics/ui-react 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/__shared/cjs/{index-4e4cc354.js → index-384184bd.js} +994 -1872
- package/dist/__shared/cjs/{index-bf07471d.js → index-4a5425cc.js} +10 -7
- package/dist/components/Accordion/Accordion.js +1 -5
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +4 -8
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +0 -2
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +0 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -7
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -2
- 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/VisualCheckbox.js +1 -1
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +9 -30
- package/dist/components/ColorPicker/ColorPicker.js +33 -42
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +2 -1
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +20 -23
- package/dist/components/ColorPicker/Hue.js +2 -19
- package/dist/components/ColorPicker/Palette.js +7 -27
- package/dist/components/ColorPicker/Saturation.js +8 -29
- package/dist/components/ColorPicker/utils/calculateTargetId.js +10 -20
- package/dist/components/ColorPicker/utils/getMousePosition.js +4 -3
- package/dist/components/ColorPicker/utils/hexToHsv.js +0 -5
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +2 -4
- package/dist/components/ColorPicker/utils/hsvToHex.js +0 -3
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +12 -19
- package/dist/components/Combobox/Combobox.js +57 -127
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +2 -4
- package/dist/components/Combobox/ComboboxInput.js +4 -5
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane.js +0 -7
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +0 -1
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +34 -30
- package/dist/components/Dropdown/Dropdown.js +17 -68
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -33
- package/dist/components/Dropdown/DropdownHeader.js +2 -1
- package/dist/components/Dropdown/DropdownList.js +8 -7
- package/dist/components/Dropdown/DropdownOption.js +3 -10
- package/dist/components/Dropdown/DropdownSearch.js +6 -24
- package/dist/components/FilePicker/FilePicker.js +15 -26
- 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 -6
- package/dist/components/FormField/ReadOnlyText.js +2 -1
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -11
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +3 -6
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +1 -6
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +16 -33
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -5
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupProvider.js +0 -2
- 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/ConditionContainer.js +0 -2
- package/dist/components/LogicEditor/ConditionSet.js +8 -25
- package/dist/components/LogicEditor/Controls.js +2 -2
- package/dist/components/LogicEditor/LogicEditor.js +3 -12
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +9 -34
- package/dist/components/Modal/Modal.js +22 -35
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +43 -108
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +20 -32
- package/dist/components/NewMenu/parts/MenuItem.js +2 -3
- package/dist/components/NewMenu/parts/MenuSearchBox.js +2 -1
- package/dist/components/NumberStepper/NumberStepper.js +29 -44
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperIncrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperInput.js +10 -12
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +10 -6
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +8 -8
- package/dist/components/Pagination/PaginationPageInput.js +17 -22
- package/dist/components/Pagination/PaginationPreviousButton.js +8 -8
- package/dist/components/Popover/Popover.js +9 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +3 -5
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +6 -23
- package/dist/components/Radio/Radio.js +11 -13
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +5 -11
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +0 -2
- package/dist/components/SidebarNav/SidebarNav.js +5 -4
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -4
- package/dist/components/Slider/RangeSlider.js +8 -22
- package/dist/components/Slider/Slider.js +7 -26
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +7 -9
- 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/TabContextProvider.js +1 -1
- package/dist/components/Tabs/TabList.js +9 -17
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/TabPanels.js +0 -2
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +12 -41
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/PortalTargetContext.js +0 -1
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -11
- package/dist/components/deprecated_ColorPicker/Color.js +9 -66
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -8
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -7
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -10
- package/dist/components/deprecated_ColorPicker/Saturation.js +7 -14
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +0 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +14 -20
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +16 -17
- package/dist/components/deprecated_Tabs/Tabs.js +9 -25
- 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 +3 -17
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +10 -26
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -18
- package/dist/hooks/useBreakpoints/useBreakpoints.js +3 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -7
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -6
- package/dist/hooks/useControllableState/useControllableState.js +5 -10
- package/dist/hooks/useDidUpdate/useDidUpdate.js +2 -4
- package/dist/hooks/useEventCallback/useEventCallback.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -4
- package/dist/hooks/useFocusSequence/useFocusSequence.js +10 -17
- package/dist/hooks/useId/useId.js +1 -2
- package/dist/hooks/useIsFocused/useIsFocused.js +0 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +0 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +4 -3
- package/dist/hooks/useLatest/useLatest.js +0 -1
- package/dist/hooks/useMounted/useMounted.js +0 -1
- package/dist/hooks/useMouseDrag/useMouseDrag.js +0 -4
- package/dist/hooks/useOverlay/useOverlay.js +4 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/usePrevious/usePrevious.js +0 -1
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +1 -4
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +11 -16
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/HeadsetIcon.js +6 -0
- package/dist/icons/components/PauseCircleIcon.js +1 -1
- package/dist/icons/createIconComponent.js +2 -3
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -3
- package/dist/index.js +6 -5
- package/dist/next/AdvancedTable/AdvancedTable.js +82 -188
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -14
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +11 -41
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +8 -14
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -6
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -4
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +1 -3
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +8 -13
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -20
- 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 +3 -3
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +7 -20
- package/dist/next/Combobox/ComboboxOption.js +5 -6
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +37 -54
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +5 -3
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +10 -10
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +1 -6
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +6 -6
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +4 -6
- package/dist/next/Drawer/Drawer.js +5 -16
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +7 -5
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +5 -8
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +10 -23
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuContext.js +0 -2
- package/dist/next/Menu/MenuItem.js +11 -15
- package/dist/next/Menu/MenuPane.js +11 -25
- package/dist/next/Menu/MenuSearch.js +15 -22
- package/dist/next/Menu/SubMenu.js +10 -27
- package/dist/next/Menu/usePaneSearch.js +2 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +6 -12
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/Stack/Stack.js +0 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -5
- package/dist/next/TimePicker/TimeInput.js +4 -5
- package/dist/next/TimePicker/TimePicker.js +12 -30
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +1 -3
- package/dist/next/TimePicker/utils.js +12 -52
- package/dist/next/ToggleButton/ToggleButton.js +0 -5
- package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.js +376 -748
- package/dist/utils/Flyout/Flyout.js +4 -5
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +18 -25
- package/dist/utils/Portal/Portal.js +2 -1
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
- package/dist/utils/Translation/Translate.js +0 -4
- package/dist/utils/Translation/TranslationProvider.js +0 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -5
- package/dist/utils/Translation/insertPlaceholders.js +0 -1
- package/dist/utils/Translation/useTranslation.js +7 -14
- package/dist/utils/concatIds/concatIds.js +0 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
- package/dist/utils/filterChildren/filterChildren.js +8 -17
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
- package/dist/utils/keyboardUser/keyboardUser.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
- package/dist/utils/mergeRefs/mergeRefs.js +1 -2
- package/dist/utils/wrapAround/wrapAround.js +1 -2
- package/dist/utils/wrapEvent/wrapEvent.js +2 -4
- package/icons/package.json +2 -1
- package/next/package.json +5 -1
- package/package.json +9 -4
|
@@ -32,11 +32,13 @@ const Pagination = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
32
32
|
} = _ref;
|
|
33
33
|
const {
|
|
34
34
|
translate
|
|
35
|
-
} = useTranslation();
|
|
35
|
+
} = useTranslation();
|
|
36
36
|
|
|
37
|
+
// The current page (the consumer holds a current page that might be different)
|
|
37
38
|
const [pageInputValue, setPageInputValue] = useState(currentPage);
|
|
38
|
-
const announceToScreenReader = useScreenReaderAnnouncement('assertive');
|
|
39
|
+
const announceToScreenReader = useScreenReaderAnnouncement('assertive');
|
|
39
40
|
|
|
41
|
+
// Announces the new page info to the screen reader when the page info changes, but not when the component first mounts
|
|
40
42
|
useDidUpdate(() => {
|
|
41
43
|
if (numPages) {
|
|
42
44
|
announceToScreenReader(translate('pagination', {
|
|
@@ -44,22 +46,24 @@ const Pagination = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
44
46
|
numPages: Number(numPages)
|
|
45
47
|
}));
|
|
46
48
|
}
|
|
47
|
-
}, [announceToScreenReader, translate, currentPage, numPages]);
|
|
49
|
+
}, [announceToScreenReader, translate, currentPage, numPages]);
|
|
48
50
|
|
|
51
|
+
// Updates the `pageInputValue` to be `currentPage` when the `currentPage` prop changes
|
|
49
52
|
useEffect(() => {
|
|
50
53
|
setPageInputValue(currentPage);
|
|
51
54
|
}, [currentPage]);
|
|
55
|
+
|
|
52
56
|
/**
|
|
53
57
|
* Calls `onPageChange` if the function was passed in as a prop
|
|
54
58
|
* @param {Number} newPage - The value entered into the input
|
|
55
59
|
*/
|
|
56
|
-
|
|
57
60
|
const handlePageChange = useCallback(newPage => {
|
|
58
|
-
onPageChange
|
|
61
|
+
onPageChange?.({
|
|
59
62
|
page: newPage
|
|
60
63
|
});
|
|
61
|
-
}, [onPageChange]);
|
|
64
|
+
}, [onPageChange]);
|
|
62
65
|
|
|
66
|
+
// Context for the composite components
|
|
63
67
|
const context = useMemo(() => ({
|
|
64
68
|
numPages,
|
|
65
69
|
pageInputValue,
|
|
@@ -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 = {"pagination":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._O2AG8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._kWm7D{margin-right:8px}._Q-GUV{margin-left:8px}._elY8p{margin:-10px -15px}._UGuUT{width:100%;text-align:center}";
|
|
4
|
+
var styles = {"pagination":"_O2AG8","previousButton":"_kWm7D","nextButton":"_Q-GUV","btnIcon":"_elY8p","input":"_UGuUT"};
|
|
5
|
+
var stylesheet="._O2AG8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._kWm7D{margin-right:8px}._Q-GUV{margin-left:8px}._elY8p{margin:-10px -15px}._UGuUT{width:100%;text-align:center}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -26,8 +26,9 @@ const PaginationNextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
26
26
|
const {
|
|
27
27
|
translate
|
|
28
28
|
} = useTranslation();
|
|
29
|
-
const buttonLabel = translate('nextPage');
|
|
29
|
+
const buttonLabel = translate('nextPage');
|
|
30
30
|
|
|
31
|
+
// Context for Pagination
|
|
31
32
|
const {
|
|
32
33
|
numPages,
|
|
33
34
|
pageInputValue,
|
|
@@ -35,27 +36,26 @@ const PaginationNextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
35
36
|
handlePageChange,
|
|
36
37
|
setPageInputValue
|
|
37
38
|
} = usePaginationContext();
|
|
39
|
+
|
|
38
40
|
/**
|
|
39
41
|
* Increments the `pageInputValue`.
|
|
40
42
|
* Calls `handlePageChange` in order to call the `onPageChange` prop.
|
|
41
43
|
*/
|
|
42
|
-
|
|
43
44
|
const increment = () => {
|
|
44
45
|
const newPage = pageInputValue + 1;
|
|
45
|
-
setPageInputValue
|
|
46
|
-
handlePageChange
|
|
46
|
+
setPageInputValue?.(newPage);
|
|
47
|
+
handlePageChange?.(newPage);
|
|
47
48
|
};
|
|
48
|
-
|
|
49
49
|
return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
|
|
50
|
-
disabled: disabled
|
|
50
|
+
disabled: disabled ?? pageInputValue === numPages,
|
|
51
51
|
ref: ref,
|
|
52
52
|
kind: "tertiary",
|
|
53
53
|
onClick: e => {
|
|
54
|
-
onClick
|
|
54
|
+
onClick?.(e);
|
|
55
55
|
increment();
|
|
56
56
|
},
|
|
57
57
|
className: classNames(className, styles.nextButton),
|
|
58
|
-
"data-testid": dataTestIdFromProps
|
|
58
|
+
"data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'NextButton'),
|
|
59
59
|
"aria-label": buttonLabel
|
|
60
60
|
}), /*#__PURE__*/React__default.createElement(ChevronRightIcon, {
|
|
61
61
|
className: styles.btnIcon,
|
|
@@ -28,8 +28,9 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
28
28
|
...rest
|
|
29
29
|
} = _ref;
|
|
30
30
|
// Element reference to the input
|
|
31
|
-
const inputRef = useRef(null);
|
|
31
|
+
const inputRef = useRef(null);
|
|
32
32
|
|
|
33
|
+
// Context for Pagination
|
|
33
34
|
const {
|
|
34
35
|
numPages,
|
|
35
36
|
pageInputValue,
|
|
@@ -41,53 +42,46 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
41
42
|
handlePageChange,
|
|
42
43
|
setPageInputValue
|
|
43
44
|
} = usePaginationContext();
|
|
45
|
+
|
|
44
46
|
/**
|
|
45
47
|
* Computes the width of the input based on the number of characters entered
|
|
46
48
|
*/
|
|
47
|
-
|
|
48
49
|
const inputWidth = useMemo(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const numDigits = (_currentPage$toString = currentPage === null || currentPage === void 0 ? void 0 : currentPage.toString().length) !== null && _currentPage$toString !== void 0 ? _currentPage$toString : 0;
|
|
50
|
+
const numDigits = currentPage?.toString().length ?? 0;
|
|
52
51
|
const minWidth = 36;
|
|
53
52
|
return numDigits > 2 ? 9 * (numDigits - 2) + minWidth : minWidth;
|
|
54
53
|
}, [currentPage]);
|
|
54
|
+
|
|
55
55
|
/**
|
|
56
56
|
* Sets the `pageInputValue` to `currentPage` if there is a discrepancy
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
58
|
const handleBlur = () => {
|
|
60
59
|
if (pageInputValue !== currentPage && currentPage !== undefined) {
|
|
61
|
-
setPageInputValue
|
|
60
|
+
setPageInputValue?.(currentPage);
|
|
62
61
|
}
|
|
63
62
|
};
|
|
63
|
+
|
|
64
64
|
/**
|
|
65
65
|
* Updates the `pageInputValue`.
|
|
66
66
|
* Calls `handlePageChange` in order to call the `onPageChange` prop (only if the input is an integer).
|
|
67
67
|
* @param {String | Number} newValue - The value entered into the input
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
69
|
const handleInputChange = newValue => {
|
|
72
70
|
if (newValue === '' || !Number.isInteger(Number(newValue))) {
|
|
73
|
-
setPageInputValue
|
|
71
|
+
setPageInputValue?.(newValue);
|
|
74
72
|
} else {
|
|
75
73
|
const newPage = Math.min(Math.max(1, newValue), numPages || Number.MAX_SAFE_INTEGER);
|
|
76
|
-
setPageInputValue
|
|
77
|
-
handlePageChange
|
|
74
|
+
setPageInputValue?.(newPage);
|
|
75
|
+
handlePageChange?.(newPage);
|
|
78
76
|
}
|
|
79
77
|
};
|
|
78
|
+
|
|
80
79
|
/**
|
|
81
80
|
* If there is a ref to the input, selects all text within the input
|
|
82
81
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
82
|
const handleFocus = () => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.select();
|
|
83
|
+
inputRef.current?.select();
|
|
89
84
|
};
|
|
90
|
-
|
|
91
85
|
return /*#__PURE__*/React__default.createElement(Translate, {
|
|
92
86
|
messageKey: "pagination",
|
|
93
87
|
placeholders: {
|
|
@@ -104,18 +98,19 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
104
98
|
max: numPages,
|
|
105
99
|
value: pageInputValue,
|
|
106
100
|
onChange: e => {
|
|
107
|
-
onChange
|
|
101
|
+
onChange?.(e);
|
|
108
102
|
handleInputChange(e.target.value);
|
|
109
103
|
},
|
|
110
104
|
onBlur: e => {
|
|
111
|
-
onBlur
|
|
105
|
+
onBlur?.(e);
|
|
112
106
|
handleBlur();
|
|
113
107
|
},
|
|
114
108
|
onFocus: e => {
|
|
115
|
-
onFocus
|
|
109
|
+
onFocus?.(e);
|
|
116
110
|
handleFocus();
|
|
117
111
|
},
|
|
118
|
-
style: {
|
|
112
|
+
style: {
|
|
113
|
+
...style,
|
|
119
114
|
width: inputWidth
|
|
120
115
|
},
|
|
121
116
|
className: classNames(className, styles.input)
|
|
@@ -26,35 +26,35 @@ const PaginationPreviousButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
26
26
|
const {
|
|
27
27
|
translate
|
|
28
28
|
} = useTranslation();
|
|
29
|
-
const buttonLabel = translate('previousPage');
|
|
29
|
+
const buttonLabel = translate('previousPage');
|
|
30
30
|
|
|
31
|
+
// Context for Pagination
|
|
31
32
|
const {
|
|
32
33
|
pageInputValue,
|
|
33
34
|
dataTestId,
|
|
34
35
|
handlePageChange,
|
|
35
36
|
setPageInputValue
|
|
36
37
|
} = usePaginationContext();
|
|
38
|
+
|
|
37
39
|
/**
|
|
38
40
|
* Decrements the `pageInputValue`.
|
|
39
41
|
* Calls `handlePageChange` in order to call the `onPageChange` prop.
|
|
40
42
|
*/
|
|
41
|
-
|
|
42
43
|
const decrement = () => {
|
|
43
44
|
const newPage = pageInputValue - 1;
|
|
44
|
-
setPageInputValue
|
|
45
|
-
handlePageChange
|
|
45
|
+
setPageInputValue?.(newPage);
|
|
46
|
+
handlePageChange?.(newPage);
|
|
46
47
|
};
|
|
47
|
-
|
|
48
48
|
return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
|
|
49
|
-
disabled: disabled
|
|
49
|
+
disabled: disabled ?? pageInputValue === 1,
|
|
50
50
|
ref: ref,
|
|
51
51
|
kind: "tertiary",
|
|
52
52
|
onClick: e => {
|
|
53
|
-
onClick
|
|
53
|
+
onClick?.(e);
|
|
54
54
|
decrement();
|
|
55
55
|
},
|
|
56
56
|
className: classNames(className, styles.previousButton),
|
|
57
|
-
"data-testid": dataTestIdFromProps
|
|
57
|
+
"data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'PreviousButton'),
|
|
58
58
|
"aria-label": buttonLabel
|
|
59
59
|
}), /*#__PURE__*/React__default.createElement(ChevronLeftIcon, {
|
|
60
60
|
className: styles.btnIcon,
|
|
@@ -30,10 +30,11 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
30
30
|
const classes = classNames(styles.popover, className);
|
|
31
31
|
const anchorRef = useRef();
|
|
32
32
|
const popperRef = useRef(null);
|
|
33
|
-
const preventClickOutside = useClickOutsidePortals(e => show &&
|
|
33
|
+
const preventClickOutside = useClickOutsidePortals(e => show && onClickOutside?.(e));
|
|
34
34
|
const [isInDOM, setIsInDOM] = useState(false);
|
|
35
|
-
const popoverId = useId(externalId);
|
|
35
|
+
const popoverId = useId(externalId);
|
|
36
36
|
|
|
37
|
+
// Focus lock can't be enabled without `onClose` function because keyboard users need a way to exit the focus lock
|
|
37
38
|
const isFocusLockEnabled = typeof onClose === 'function';
|
|
38
39
|
useEffect(() => {
|
|
39
40
|
/*
|
|
@@ -46,31 +47,23 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
46
47
|
* 2. A user in Safari clicks on 1 or more `Popover` anchor elements and then presses the `Escape` key. This is because buttons aren't focused on `click` or `mousedown` in Safari by default.
|
|
47
48
|
*/
|
|
48
49
|
if (!show && isInDOM) {
|
|
49
|
-
var _anchorRef$current;
|
|
50
|
-
|
|
51
50
|
// Prevents scroll so that the page does not scroll to the anchor element if the anchor element is out of view
|
|
52
|
-
|
|
51
|
+
anchorRef.current?.focus({
|
|
53
52
|
preventScroll: true
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
|
-
|
|
57
55
|
setIsInDOM(show);
|
|
58
56
|
}, [show, isInDOM]);
|
|
59
|
-
|
|
60
57
|
const handlePopoverContainerClick = e => {
|
|
61
|
-
onClick
|
|
58
|
+
onClick?.(e);
|
|
62
59
|
};
|
|
63
|
-
|
|
64
60
|
const handlePopoverContainerKeyDown = e => {
|
|
65
61
|
if (e.key === 'Escape') {
|
|
66
62
|
e.stopPropagation(); // prevent event from closing modals or popovers
|
|
67
|
-
|
|
68
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
63
|
+
onClose?.(e);
|
|
69
64
|
}
|
|
70
|
-
|
|
71
|
-
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
65
|
+
onKeyDown?.(e);
|
|
72
66
|
};
|
|
73
|
-
|
|
74
67
|
return /*#__PURE__*/React__default.createElement(Popper, {
|
|
75
68
|
open: show,
|
|
76
69
|
isFocusLocked: true,
|
|
@@ -82,8 +75,6 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
82
75
|
'aria-expanded': show,
|
|
83
76
|
'aria-controls': show ? popoverId : undefined,
|
|
84
77
|
onMouseDown: e => {
|
|
85
|
-
var _children$props$onMou, _children$props;
|
|
86
|
-
|
|
87
78
|
/*
|
|
88
79
|
* Prevents the anchor element from getting focus (only in some browsers).
|
|
89
80
|
* If a Popover is open and out of view, and another button is clicked, this prevents the browser from scrolling to the open Popover.
|
|
@@ -91,9 +82,9 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
91
82
|
*/
|
|
92
83
|
e.preventDefault();
|
|
93
84
|
preventClickOutside();
|
|
94
|
-
|
|
85
|
+
children.props.onMouseDown?.(e);
|
|
95
86
|
},
|
|
96
|
-
ref: mergeRefs(anchorRef, children
|
|
87
|
+
ref: mergeRefs(anchorRef, children?.ref)
|
|
97
88
|
}),
|
|
98
89
|
popper: /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
99
90
|
ref: mergeRefs(ref, popperRef),
|
|
@@ -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 = {"popover":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._h03yL{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._h03yL:focus{outline:none}._EERNY,._EERNY>div{position:absolute;width:8px;height:8px;background:inherit}._EERNY{visibility:hidden;z-index:1000}._EERNY>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._EERNY{bottom:-4px}[data-popper-placement^=top]>._EERNY>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._EERNY{left:-5px}[data-popper-placement^=right]>._EERNY>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._EERNY{top:-5px}[data-popper-placement^=bottom]>._EERNY>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._EERNY{right:-4px}[data-popper-placement^=left]>._EERNY>div{border-bottom-color:transparent;border-left-color:transparent}";
|
|
4
|
+
var styles = {"popover":"_h03yL","arrow":"_EERNY"};
|
|
5
|
+
var stylesheet="._h03yL{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._h03yL:focus{outline:none}._EERNY,._EERNY>div{position:absolute;width:8px;height:8px;background:inherit}._EERNY{visibility:hidden;z-index:1000}._EERNY>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._EERNY{bottom:-4px}[data-popper-placement^=top]>._EERNY>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._EERNY{left:-5px}[data-popper-placement^=right]>._EERNY>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._EERNY{top:-5px}[data-popper-placement^=bottom]>._EERNY>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._EERNY{right:-4px}[data-popper-placement^=left]>._EERNY>div{border-bottom-color:transparent;border-left-color:transparent}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -12,8 +12,6 @@ import LoadingSpinner from '../LoadingSpinner/LoadingSpinner.js';
|
|
|
12
12
|
import MenuItem from '../NewMenu/parts/MenuItem.js';
|
|
13
13
|
|
|
14
14
|
const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
15
|
-
var _anchorRef$current;
|
|
16
|
-
|
|
17
15
|
let {
|
|
18
16
|
maxHeight: externalMaxHeight,
|
|
19
17
|
menuProps,
|
|
@@ -29,7 +27,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
29
27
|
const [items, setItems] = useState([]);
|
|
30
28
|
const maxHeight = items.length > 10 ? 500 : undefined;
|
|
31
29
|
const anchorRef = useRef(null);
|
|
32
|
-
const anchorWidth = anchorRef
|
|
30
|
+
const anchorWidth = anchorRef?.current?.clientWidth;
|
|
33
31
|
const {
|
|
34
32
|
translate
|
|
35
33
|
} = useTranslation();
|
|
@@ -42,7 +40,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
42
40
|
portalTarget: portalTarget,
|
|
43
41
|
zIndex: zIndex,
|
|
44
42
|
anchor: /*#__PURE__*/React__default.createElement(QuickSearchInput, _extends({}, rest, {
|
|
45
|
-
role: role
|
|
43
|
+
role: role ?? 'searchbox',
|
|
46
44
|
ref: mergeRefs(ref, anchorRef),
|
|
47
45
|
setIsLoading: setIsLoading,
|
|
48
46
|
items: items,
|
|
@@ -59,7 +57,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
59
57
|
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
60
58
|
key: index,
|
|
61
59
|
value: value,
|
|
62
|
-
onSelect: () => onSelect
|
|
60
|
+
onSelect: () => onSelect?.(item)
|
|
63
61
|
}, label);
|
|
64
62
|
}));
|
|
65
63
|
});
|
|
@@ -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 = "._5W-Bf{display:flex;height:32px}";
|
|
4
|
+
var styles = {"loadingSpinner":"_5W-Bf"};
|
|
5
|
+
var stylesheet="._5W-Bf{display:flex;height:32px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -36,22 +36,19 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
36
36
|
setIsOpen,
|
|
37
37
|
closeAndFocusAnchor: internalCloseMenu,
|
|
38
38
|
anchorRef,
|
|
39
|
-
setHighlightedIndex
|
|
40
|
-
|
|
39
|
+
setHighlightedIndex
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
41
|
} = useMenuContext();
|
|
42
|
-
|
|
43
42
|
const openMenu = () => {
|
|
44
43
|
// this prevents the "no items to display" text from appearing on initial open.
|
|
45
44
|
if (!open) {
|
|
46
45
|
setIsLoading(true);
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
setIsOpen === null || setIsOpen === void 0 ? void 0 : setIsOpen(true);
|
|
47
|
+
setIsOpen?.(true);
|
|
50
48
|
};
|
|
51
|
-
|
|
52
49
|
const closeMenu = useCallback(() => {
|
|
53
50
|
setItems([]);
|
|
54
|
-
internalCloseMenu
|
|
51
|
+
internalCloseMenu?.();
|
|
55
52
|
setIsLoading(true);
|
|
56
53
|
}, [setItems, internalCloseMenu, setIsLoading]);
|
|
57
54
|
const onSearchRef = useLatest(onSearch);
|
|
@@ -59,7 +56,6 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
59
56
|
if (!isMounted.current) {
|
|
60
57
|
return;
|
|
61
58
|
}
|
|
62
|
-
|
|
63
59
|
setIsLoading(true);
|
|
64
60
|
Promise.resolve(onSearchRef.current && onSearchRef.current(queryValue)).then(newItems => {
|
|
65
61
|
if (isMounted.current && queryValue === valueRef.current) {
|
|
@@ -69,35 +65,27 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
69
65
|
});
|
|
70
66
|
}, [isMounted, onSearchRef, setIsLoading, valueRef, setItems]);
|
|
71
67
|
const handleSearchThrottledDebounced = useCallback(debounce(debouncePeriod, throttle(throttlePeriod, handleSearch)), [debouncePeriod, throttlePeriod, handleSearch]);
|
|
72
|
-
|
|
73
68
|
const handleChange = e => {
|
|
74
69
|
setChanged(true);
|
|
75
|
-
|
|
76
70
|
if (!isControlled) {
|
|
77
71
|
setInternalValue(e.target.value);
|
|
78
72
|
}
|
|
79
|
-
|
|
80
73
|
if (typeof onChange === 'function') {
|
|
81
74
|
onChange(e);
|
|
82
75
|
}
|
|
83
76
|
};
|
|
84
|
-
|
|
85
77
|
const handleKeyDown = e => {
|
|
86
78
|
if (e.key === 'Enter' || e.key === 'ArrowDown') {
|
|
87
79
|
e.preventDefault(); // prevent scroll
|
|
88
|
-
|
|
89
80
|
openMenu();
|
|
90
|
-
setHighlightedIndex
|
|
91
|
-
|
|
81
|
+
setHighlightedIndex?.(0);
|
|
92
82
|
if (!open) {
|
|
93
83
|
handleSearch(value);
|
|
94
84
|
}
|
|
95
85
|
} else if (e.key === 'ArrowUp') {
|
|
96
86
|
e.preventDefault(); // prevent scroll
|
|
97
|
-
|
|
98
87
|
openMenu();
|
|
99
|
-
setHighlightedIndex
|
|
100
|
-
|
|
88
|
+
setHighlightedIndex?.(items.length - 1);
|
|
101
89
|
if (!open) {
|
|
102
90
|
handleSearch(value);
|
|
103
91
|
}
|
|
@@ -108,10 +96,8 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
108
96
|
value: ''
|
|
109
97
|
}
|
|
110
98
|
});
|
|
111
|
-
|
|
112
99
|
if (open) {
|
|
113
100
|
e.stopPropagation(); // prevent event from closing modals or popovers
|
|
114
|
-
|
|
115
101
|
closeMenu();
|
|
116
102
|
}
|
|
117
103
|
} else if (e.key === 'Tab') {
|
|
@@ -120,13 +106,10 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
108
|
};
|
|
123
|
-
|
|
124
109
|
useEnhancedDidUpdate(() => {
|
|
125
110
|
const shouldClose = value.length < minChars;
|
|
126
|
-
|
|
127
111
|
if (changed) {
|
|
128
112
|
setChanged(false);
|
|
129
|
-
|
|
130
113
|
if (shouldClose) {
|
|
131
114
|
setChanged(false);
|
|
132
115
|
closeMenu();
|
|
@@ -8,8 +8,6 @@ import '../../utils/index.js';
|
|
|
8
8
|
import concatIds from '../../utils/concatIds/concatIds.js';
|
|
9
9
|
|
|
10
10
|
const Radio = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
11
|
-
var _ref2;
|
|
12
|
-
|
|
13
11
|
let {
|
|
14
12
|
id,
|
|
15
13
|
className,
|
|
@@ -34,25 +32,25 @@ const Radio = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
34
32
|
helperTextId: formFieldHelperTextId,
|
|
35
33
|
errorTextId: formFieldErrorTextId
|
|
36
34
|
} = useFormFieldContext();
|
|
37
|
-
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps
|
|
38
|
-
const checked = groupValue !== undefined ? value === groupValue : radioChecked
|
|
39
|
-
const defaultChecked = groupDefaultValue !== undefined ? value === groupDefaultValue : radioDefaultChecked
|
|
40
|
-
const onChange =
|
|
35
|
+
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps?.['aria-describedby']);
|
|
36
|
+
const checked = groupValue !== undefined ? value === groupValue : radioChecked ?? inputProps?.checked;
|
|
37
|
+
const defaultChecked = groupDefaultValue !== undefined ? value === groupDefaultValue : radioDefaultChecked ?? inputProps?.defaultChecked;
|
|
38
|
+
const onChange = radioGroupOnChange ?? radioOnChange ?? inputProps?.onChange;
|
|
41
39
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
|
42
40
|
ref: ref,
|
|
43
41
|
className: classNames(className, styles.radio)
|
|
44
42
|
}), /*#__PURE__*/React__default.createElement("input", _extends({}, inputProps, {
|
|
45
|
-
className: classNames(styles.input, inputProps
|
|
43
|
+
className: classNames(styles.input, inputProps?.className),
|
|
46
44
|
type: "radio",
|
|
47
|
-
id: id
|
|
45
|
+
id: id ?? inputProps?.id,
|
|
48
46
|
checked: checked,
|
|
49
47
|
defaultChecked: defaultChecked,
|
|
50
|
-
disabled: disabled
|
|
51
|
-
name: name
|
|
52
|
-
value: value
|
|
48
|
+
disabled: disabled ?? inputProps?.disabled,
|
|
49
|
+
name: name ?? inputProps?.name,
|
|
50
|
+
value: value ?? inputProps?.value,
|
|
53
51
|
onChange: disabled ? undefined : onChange,
|
|
54
|
-
"aria-label": ariaLabel
|
|
55
|
-
"aria-labelledby": ariaLabelledBy
|
|
52
|
+
"aria-label": ariaLabel ?? inputProps?.['aria-label'],
|
|
53
|
+
"aria-labelledby": ariaLabelledBy ?? inputProps?.['aria-labelledby'],
|
|
56
54
|
"aria-describedby": internalAriaDescribedby
|
|
57
55
|
})), /*#__PURE__*/React__default.createElement("span", {
|
|
58
56
|
className: styles.check
|
|
@@ -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 = {"radio":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._nIM-b{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._nIM-b,._RCji3{cursor:pointer;height:16px;width:16px}._RCji3{position:absolute;opacity:0;z-index:10}._RCji3:checked~._rLrtP>._D8tHE{fill-opacity:1}._RCji3:checked:enabled~._rLrtP{border-color:transparent;background-color:#0b6ed0}._RCji3:checked:enabled~._rLrtP>._D8tHE{fill:#fff}._RCji3:checked:enabled:hover~._rLrtP{background-color:#085caf}._RCji3:not(:checked):enabled:hover~._rLrtP{border-color:#0b6ed0}._RCji3:disabled{cursor:not-allowed}._RCji3:disabled~._rLrtP{opacity:.4}._RCji3:checked~._rLrtP:after{content:\"\"}._5t4v8{color:#32363a;display:flex;align-items:center;cursor:pointer}._Q3PRR{cursor:auto;color:hsla(0,0%,53.7%,.4)}._BBGwn{margin-right:12px;flex-shrink:0}._rLrtP{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._D8tHE{fill:#0b6ed0;fill-opacity:0}._rLrtP:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._Wy1cW{border:none;padding:0;margin:0}._NkFxd{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._RCji3:active:focus~._rLrtP,body.keyboard-user ._RCji3:focus~._rLrtP{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"radio":"_nIM-b","input":"_RCji3","check":"_rLrtP","checkIcon":"_D8tHE","label":"_5t4v8","labelDisabled":"_Q3PRR","wrappedInput":"_BBGwn","radioGroup":"_Wy1cW","legend":"_NkFxd"};
|
|
5
|
+
var stylesheet="._nIM-b{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._nIM-b,._RCji3{cursor:pointer;height:16px;width:16px}._RCji3{position:absolute;opacity:0;z-index:10}._RCji3:checked~._rLrtP>._D8tHE{fill-opacity:1}._RCji3:checked:enabled~._rLrtP{border-color:transparent;background-color:#0b6ed0}._RCji3:checked:enabled~._rLrtP>._D8tHE{fill:#fff}._RCji3:checked:enabled:hover~._rLrtP{background-color:#085caf}._RCji3:not(:checked):enabled:hover~._rLrtP{border-color:#0b6ed0}._RCji3:disabled{cursor:not-allowed}._RCji3:disabled~._rLrtP{opacity:.4}._RCji3:checked~._rLrtP:after{content:\"\"}._5t4v8{color:#32363a;display:flex;align-items:center;cursor:pointer}._Q3PRR{cursor:auto;color:hsla(0,0%,53.7%,.4)}._BBGwn{margin-right:12px;flex-shrink:0}._rLrtP{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._D8tHE{fill:#0b6ed0;fill-opacity:0}._rLrtP:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._Wy1cW{border:none;padding:0;margin:0}._NkFxd{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._RCji3:active:focus~._rLrtP,body.keyboard-user ._RCji3:focus~._rLrtP{border-color:#0b6ed0;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 };
|
|
@@ -39,26 +39,22 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
39
39
|
} = useTranslation();
|
|
40
40
|
const clearButtonLabel = translate('clearSearchInput');
|
|
41
41
|
const isClearButtonHidden = !inputValue || isDisabled;
|
|
42
|
-
const usedWithinInputGroup = !!useInputGroupContext().className;
|
|
42
|
+
const usedWithinInputGroup = !!useInputGroupContext().className;
|
|
43
43
|
|
|
44
|
+
// Focuses the input after the input value is cleared so that screen readers see that the input doesn't have a value
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
if (wasInputValueCleared) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
47
|
+
inputRef.current?.focus();
|
|
49
48
|
setWasInputValueCleared(false);
|
|
50
49
|
}
|
|
51
50
|
}, [wasInputValueCleared]);
|
|
52
|
-
|
|
53
51
|
const clearInputText = () => {
|
|
54
52
|
setInputValue('');
|
|
55
53
|
setWasInputValueCleared(true);
|
|
56
54
|
};
|
|
57
|
-
|
|
58
55
|
const handleInputChange = e => {
|
|
59
56
|
setInputValue(e.target.value);
|
|
60
57
|
};
|
|
61
|
-
|
|
62
58
|
const handleInputKeyDown = e => {
|
|
63
59
|
if (e.key === 'Escape') {
|
|
64
60
|
if (inputValue) {
|
|
@@ -67,10 +63,8 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
67
63
|
|
|
68
64
|
clearInputText();
|
|
69
65
|
}
|
|
70
|
-
|
|
71
|
-
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
66
|
+
onKeyDown?.(e);
|
|
72
67
|
};
|
|
73
|
-
|
|
74
68
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
75
69
|
className: classNames(styles.searchInput, className),
|
|
76
70
|
style: style
|
|
@@ -78,7 +72,7 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
78
72
|
role: "searchbox",
|
|
79
73
|
id: id,
|
|
80
74
|
className: styles.searchInputInput,
|
|
81
|
-
placeholder: placeholder
|
|
75
|
+
placeholder: placeholder ?? translate('searchText'),
|
|
82
76
|
value: inputValue,
|
|
83
77
|
onChange: handleInputChange,
|
|
84
78
|
onKeyDown: handleInputKeyDown,
|
|
@@ -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 = {"searchInput":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._9iEPQ{display:inline-block;position:relative}._kt9z4._kt9z4{padding-left:36px;padding-right:36px;width:100%}._kt9z4._kt9z4:disabled+._0j7he{fill-opacity:.6}._0j7he{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._0j7he._w-qtH{z-index:20}._Z3JXq{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._Z3JXq:hover{cursor:pointer}._Z3JXq:hover>._txqbP{fill:#32363a}._Z3JXq:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._txqbP{fill:#515559}";
|
|
4
|
+
var styles = {"searchInput":"_9iEPQ","searchInputInput":"_kt9z4","searchInputSearchIcon":"_0j7he","usedWithinInputGroup":"_w-qtH","searchInputClearButton":"_Z3JXq","searchInputClearButtonIcon":"_txqbP"};
|
|
5
|
+
var stylesheet="._9iEPQ{display:inline-block;position:relative}._kt9z4._kt9z4{padding-left:36px;padding-right:36px;width:100%}._kt9z4._kt9z4:disabled+._0j7he{fill-opacity:.6}._0j7he{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._0j7he._w-qtH{z-index:20}._Z3JXq{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._Z3JXq:hover{cursor:pointer}._Z3JXq:hover>._txqbP{fill:#32363a}._Z3JXq:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._txqbP{fill:#515559}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|