@patternfly/react-core 4.243.1 → 4.244.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 +24 -0
- package/dist/esm/components/Alert/Alert.d.ts +41 -34
- package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/Alert/AlertActionCloseButton.d.ts +8 -5
- package/dist/esm/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertActionCloseButton.js.map +1 -1
- package/dist/esm/components/Alert/AlertActionLink.d.ts +5 -2
- package/dist/esm/components/Alert/AlertActionLink.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertActionLink.js.map +1 -1
- package/dist/esm/components/Alert/AlertIcon.d.ts +4 -4
- package/dist/esm/components/Alert/AlertIcon.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts +5 -5
- package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +34 -28
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +1 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.d.ts +43 -36
- package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js +4 -0
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +34 -24
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.d.ts +53 -47
- package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.d.ts +51 -46
- package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +57 -48
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalBox.d.ts +12 -12
- package/dist/esm/components/Modal/ModalBox.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxBody.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxBody.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxDescription.d.ts +3 -3
- package/dist/esm/components/Modal/ModalBoxDescription.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxFooter.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxFooter.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxHeader.d.ts +3 -3
- package/dist/esm/components/Modal/ModalBoxHeader.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxTitle.d.ts +8 -9
- package/dist/esm/components/Modal/ModalBoxTitle.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxTitle.js.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts +56 -48
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +17 -13
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +3 -3
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Pagination/Navigation.d.ts +33 -33
- package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +27 -26
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +76 -65
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/Pagination/ToggleTemplate.d.ts +3 -0
- package/dist/esm/components/Pagination/ToggleTemplate.d.ts.map +1 -1
- package/dist/esm/components/Pagination/ToggleTemplate.js.map +1 -1
- package/dist/esm/components/Popover/Popover.d.ts +88 -73
- package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +71 -60
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +4 -3
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/SelectToggle.d.ts +2 -0
- package/dist/esm/components/Select/SelectToggle.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectToggle.js +3 -5
- package/dist/esm/components/Select/SelectToggle.js.map +1 -1
- package/dist/esm/components/Slider/Slider.d.ts +45 -39
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Slider/SliderStep.d.ts +10 -10
- package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeView.d.ts +65 -53
- package/dist/esm/components/TreeView/TreeView.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeView.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewList.d.ts +4 -4
- package/dist/esm/components/TreeView/TreeViewList.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts +46 -39
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewRoot.d.ts +4 -4
- package/dist/esm/components/TreeView/TreeViewRoot.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewSearch.d.ts +11 -8
- package/dist/esm/components/TreeView/TreeViewSearch.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewSearch.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js +8 -8
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/components/Alert/Alert.d.ts +41 -34
- package/dist/js/components/Alert/Alert.d.ts.map +1 -1
- package/dist/js/components/Alert/Alert.js.map +1 -1
- package/dist/js/components/Alert/AlertActionCloseButton.d.ts +8 -5
- package/dist/js/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertActionCloseButton.js.map +1 -1
- package/dist/js/components/Alert/AlertActionLink.d.ts +5 -2
- package/dist/js/components/Alert/AlertActionLink.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertActionLink.js.map +1 -1
- package/dist/js/components/Alert/AlertIcon.d.ts +4 -4
- package/dist/js/components/Alert/AlertIcon.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertToggleExpandButton.d.ts +5 -5
- package/dist/js/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +34 -28
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +1 -0
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/DatePicker/DatePicker.d.ts +43 -36
- package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/js/components/DatePicker/DatePicker.js +4 -0
- package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +34 -24
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts +53 -47
- package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.d.ts +51 -46
- package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +57 -48
- package/dist/js/components/Modal/Modal.d.ts.map +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Modal/ModalBox.d.ts +12 -12
- package/dist/js/components/Modal/ModalBox.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxBody.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxBody.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxDescription.d.ts +3 -3
- package/dist/js/components/Modal/ModalBoxDescription.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxFooter.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxFooter.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxHeader.d.ts +3 -3
- package/dist/js/components/Modal/ModalBoxHeader.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxTitle.d.ts +8 -9
- package/dist/js/components/Modal/ModalBoxTitle.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxTitle.js.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts +56 -48
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +17 -13
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +3 -3
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Pagination/Navigation.d.ts +33 -33
- package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +27 -26
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +76 -65
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +1 -1
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/Pagination/ToggleTemplate.d.ts +3 -0
- package/dist/js/components/Pagination/ToggleTemplate.d.ts.map +1 -1
- package/dist/js/components/Pagination/ToggleTemplate.js.map +1 -1
- package/dist/js/components/Popover/Popover.d.ts +88 -73
- package/dist/js/components/Popover/Popover.d.ts.map +1 -1
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +71 -60
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +2 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +4 -3
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Select/SelectToggle.d.ts +2 -0
- package/dist/js/components/Select/SelectToggle.d.ts.map +1 -1
- package/dist/js/components/Select/SelectToggle.js +3 -5
- package/dist/js/components/Select/SelectToggle.js.map +1 -1
- package/dist/js/components/Slider/Slider.d.ts +45 -39
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/components/Slider/SliderStep.d.ts +10 -10
- package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeView.d.ts +65 -53
- package/dist/js/components/TreeView/TreeView.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeView.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewList.d.ts +4 -4
- package/dist/js/components/TreeView/TreeViewList.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.d.ts +46 -39
- package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewRoot.d.ts +4 -4
- package/dist/js/components/TreeView/TreeViewRoot.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewSearch.d.ts +11 -8
- package/dist/js/components/TreeView/TreeViewSearch.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewSearch.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.js +8 -8
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/umd/react-core.min.css +172 -172
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +42 -34
- package/src/components/Alert/AlertActionCloseButton.tsx +9 -5
- package/src/components/Alert/AlertActionLink.tsx +6 -2
- package/src/components/Alert/AlertIcon.tsx +4 -4
- package/src/components/Alert/AlertToggleExpandButton.tsx +5 -5
- package/src/components/Badge/__tests__/Badge.test.tsx +45 -8
- package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -12
- package/src/components/CalendarMonth/CalendarMonth.tsx +36 -28
- package/src/components/DatePicker/DatePicker.tsx +49 -36
- package/src/components/DatePicker/__tests__/DatePicker.test.tsx +21 -0
- package/src/components/ExpandableSection/ExpandableSection.tsx +35 -24
- package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +11 -5
- package/src/components/FileUpload/FileUpload.tsx +56 -49
- package/src/components/FileUpload/FileUploadField.tsx +56 -50
- package/src/components/Modal/Modal.tsx +57 -48
- package/src/components/Modal/ModalBox.tsx +12 -12
- package/src/components/Modal/ModalBoxBody.tsx +2 -2
- package/src/components/Modal/ModalBoxCloseButton.tsx +2 -2
- package/src/components/Modal/ModalBoxDescription.tsx +3 -3
- package/src/components/Modal/ModalBoxFooter.tsx +2 -2
- package/src/components/Modal/ModalBoxHeader.tsx +3 -3
- package/src/components/Modal/ModalBoxTitle.tsx +8 -9
- package/src/components/Modal/ModalContent.tsx +56 -48
- package/src/components/Modal/examples/Modal.md +1 -3
- package/src/components/NotificationBadge/NotificationBadge.tsx +22 -15
- package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +25 -1
- package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +5 -0
- package/src/components/NotificationBadge/examples/NotificationBadge.md +16 -3
- package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +26 -13
- package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +28 -18
- package/src/components/Pagination/Navigation.tsx +33 -33
- package/src/components/Pagination/OptionsToggle.tsx +27 -26
- package/src/components/Pagination/Pagination.tsx +79 -65
- package/src/components/Pagination/PaginationOptionsMenu.tsx +22 -18
- package/src/components/Pagination/ToggleTemplate.tsx +4 -0
- package/src/components/Popover/Popover.tsx +89 -73
- package/src/components/SearchInput/AdvancedSearchMenu.tsx +29 -28
- package/src/components/SearchInput/SearchInput.tsx +76 -62
- package/src/components/Select/Select.tsx +5 -0
- package/src/components/Select/SelectToggle.tsx +5 -4
- package/src/components/Slider/Slider.tsx +47 -41
- package/src/components/Slider/SliderStep.tsx +10 -10
- package/src/components/TreeView/TreeView.tsx +67 -53
- package/src/components/TreeView/TreeViewList.tsx +4 -4
- package/src/components/TreeView/TreeViewListItem.tsx +46 -39
- package/src/components/TreeView/TreeViewRoot.tsx +4 -4
- package/src/components/TreeView/TreeViewSearch.tsx +12 -8
- package/src/demos/Masthead.md +9 -193
- package/src/demos/NotificationDrawer/NotificationDrawer.md +2 -0
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +305 -0
- package/src/helpers/Popper/Popper.tsx +8 -8
|
@@ -11,8 +11,8 @@ import widthChars from '@patternfly/react-tokens/dist/esm/c_pagination__nav_page
|
|
|
11
11
|
import { PickOptional } from '../../helpers';
|
|
12
12
|
|
|
13
13
|
export enum PaginationVariant {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
bottom = 'bottom',
|
|
15
|
+
top = 'top'
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const defaultPerPageOptions = [
|
|
@@ -34,40 +34,48 @@ const defaultPerPageOptions = [
|
|
|
34
34
|
}
|
|
35
35
|
];
|
|
36
36
|
|
|
37
|
+
/** Properties to customize the content and behavior of the pagination dropdown options. These
|
|
38
|
+
* properties should be passed into the pagination component's perPageOptions property.
|
|
39
|
+
*/
|
|
40
|
+
|
|
37
41
|
export interface PerPageOptions {
|
|
38
|
-
/**
|
|
42
|
+
/** The text title of the option, which is rendered inside the pagination dropdown menu. */
|
|
39
43
|
title?: string;
|
|
40
|
-
/**
|
|
44
|
+
/** The value of the option, which determines how many items are displayed per page. */
|
|
41
45
|
value?: number;
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
/** Properties to customize various pagination titles. The following properties should be
|
|
49
|
+
* passed into the pagination component's title property.
|
|
50
|
+
*/
|
|
51
|
+
|
|
44
52
|
export interface PaginationTitles {
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
/** The title of
|
|
48
|
-
pages?: string;
|
|
49
|
-
/** The type or title of the items being paginated */
|
|
53
|
+
/** Accessible label for the input displaying the current page. */
|
|
54
|
+
currPage?: string;
|
|
55
|
+
/** The type or title of the items being paginated. */
|
|
50
56
|
items?: string;
|
|
51
|
-
/** The title of the pagination options menu */
|
|
57
|
+
/** The title of the pagination options menu. */
|
|
52
58
|
itemsPerPage?: string;
|
|
53
|
-
/**
|
|
59
|
+
/** Label for the English word "of". */
|
|
60
|
+
ofWord?: string;
|
|
61
|
+
/** Accessible label for the options toggle. */
|
|
62
|
+
optionsToggle?: string;
|
|
63
|
+
/** The title of a page displayed beside the page number. */
|
|
64
|
+
page?: string;
|
|
65
|
+
/** The title of a page displayed beside the page number (plural form). */
|
|
66
|
+
pages?: string;
|
|
67
|
+
/** Accessible label for the pagination component. */
|
|
68
|
+
paginationTitle?: string;
|
|
69
|
+
/** The suffix to be displayed after each option on the options menu dropdown. */
|
|
54
70
|
perPageSuffix?: string;
|
|
55
|
-
/** Accessible label for the button which moves to the first page */
|
|
71
|
+
/** Accessible label for the button which moves to the first page. */
|
|
56
72
|
toFirstPage?: string;
|
|
57
|
-
/** Accessible label for the button which moves to the
|
|
58
|
-
toPreviousPage?: string;
|
|
59
|
-
/** Accessible label for the button which moves to the last page */
|
|
73
|
+
/** Accessible label for the button which moves to the last page. */
|
|
60
74
|
toLastPage?: string;
|
|
61
|
-
/** Accessible label for the button which moves to the next page */
|
|
75
|
+
/** Accessible label for the button which moves to the next page. */
|
|
62
76
|
toNextPage?: string;
|
|
63
|
-
/** Accessible label for the
|
|
64
|
-
|
|
65
|
-
/** Accessible label for the input displaying the current page */
|
|
66
|
-
currPage?: string;
|
|
67
|
-
/** Accessible label for the pagination component */
|
|
68
|
-
paginationTitle?: string;
|
|
69
|
-
/** Accessible label for the English word "of" */
|
|
70
|
-
ofWord?: string;
|
|
77
|
+
/** Accessible label for the button which moves to the previous page. */
|
|
78
|
+
toPreviousPage?: string;
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
export type OnSetPage = (
|
|
@@ -86,65 +94,71 @@ export type OnPerPageSelect = (
|
|
|
86
94
|
endIdx?: number
|
|
87
95
|
) => void;
|
|
88
96
|
|
|
97
|
+
/** The main pagination component. */
|
|
98
|
+
|
|
89
99
|
export interface PaginationProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
90
|
-
/** What should be rendered inside */
|
|
100
|
+
/** What should be rendered inside the pagination. */
|
|
91
101
|
children?: React.ReactNode;
|
|
92
|
-
/** Additional classes for the container. */
|
|
102
|
+
/** Additional classes for the pagination container. */
|
|
93
103
|
className?: string;
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
/**
|
|
104
|
+
/** Indicate whether to show last full page of results when user selects perPage value
|
|
105
|
+
* greater than remaining rows.
|
|
106
|
+
*/
|
|
107
|
+
defaultToFullPage?: boolean;
|
|
108
|
+
/** Direction of dropdown context menu. */
|
|
109
|
+
dropDirection?: 'up' | 'down';
|
|
110
|
+
/** Page to start at. */
|
|
111
|
+
firstPage?: number;
|
|
112
|
+
/** Flag indicating if pagination is compact. */
|
|
101
113
|
isCompact?: boolean;
|
|
102
|
-
/** Flag indicating if pagination
|
|
114
|
+
/** Flag indicating if pagination is disabled. */
|
|
115
|
+
isDisabled?: boolean;
|
|
116
|
+
/** Flag indicating if pagination should not be sticky on mobile. */
|
|
103
117
|
isStatic?: boolean;
|
|
104
|
-
/** Flag indicating if pagination should stick to its position (based on variant) */
|
|
118
|
+
/** Flag indicating if pagination should stick to its position (based on variant). */
|
|
105
119
|
isSticky?: boolean;
|
|
120
|
+
/** Total number of items. */
|
|
121
|
+
itemCount?: number;
|
|
122
|
+
/** Last index of items on current page. */
|
|
123
|
+
itemsEnd?: number;
|
|
124
|
+
/** First index of items on current page. */
|
|
125
|
+
itemsStart?: number;
|
|
126
|
+
/** Start index of rows to display, used in place of providing page. */
|
|
127
|
+
offset?: number;
|
|
128
|
+
/** Current page number. */
|
|
129
|
+
page?: number;
|
|
106
130
|
/** Number of items per page. */
|
|
107
131
|
perPage?: number;
|
|
108
|
-
/**
|
|
132
|
+
/** Component to be used for wrapping the toggle contents. Use "button" when you want
|
|
133
|
+
* all of the toggle text to be clickable.
|
|
134
|
+
*/
|
|
135
|
+
perPageComponent?: 'div' | 'button';
|
|
136
|
+
/** Array of the number of items per page options. */
|
|
109
137
|
perPageOptions?: PerPageOptions[];
|
|
110
|
-
/** Indicate whether to show last full page of results when user selects perPage value greater than remaining rows */
|
|
111
|
-
defaultToFullPage?: boolean;
|
|
112
|
-
/** Page we start at. */
|
|
113
|
-
firstPage?: number;
|
|
114
|
-
/** Current page number. */
|
|
115
|
-
page?: number;
|
|
116
|
-
/** Start index of rows to display, used in place of providing page */
|
|
117
|
-
offset?: number;
|
|
118
|
-
/** First index of items on current page. */
|
|
119
|
-
itemsStart?: number;
|
|
120
|
-
/** Last index of items on current page. */
|
|
121
|
-
itemsEnd?: number;
|
|
122
|
-
/** ID to ideintify widget on page. */
|
|
123
|
-
widgetId?: string;
|
|
124
|
-
/** Direction of dropdown context menu. */
|
|
125
|
-
dropDirection?: 'up' | 'down';
|
|
126
|
-
/** Object with titles to display in pagination. */
|
|
127
|
-
titles?: PaginationTitles;
|
|
128
|
-
/** This will be shown in pagination toggle span. You can use firstIndex, lastIndex, itemCount, itemsTitle, ofWord props. */
|
|
129
|
-
toggleTemplate?: ((props: ToggleTemplateProps) => React.ReactElement) | string;
|
|
130
|
-
/** Function called when user sets page. */
|
|
131
|
-
onSetPage?: OnSetPage;
|
|
132
138
|
/** Function called when user clicks on navigate to first page. */
|
|
133
139
|
onFirstClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
134
|
-
/** Function called when user clicks on navigate to previous page. */
|
|
135
|
-
onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
136
|
-
/** Function called when user clicks on navigate to next page. */
|
|
137
|
-
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
138
140
|
/** Function called when user clicks on navigate to last page. */
|
|
139
141
|
onLastClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
142
|
+
/** Function called when user clicks on navigate to next page. */
|
|
143
|
+
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
140
144
|
/** Function called when user inputs page number. */
|
|
141
145
|
onPageInput?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
142
146
|
/** Function called when user selects number of items per page. */
|
|
143
147
|
onPerPageSelect?: OnPerPageSelect;
|
|
144
|
-
/**
|
|
145
|
-
|
|
148
|
+
/** Function called when user clicks on navigate to previous page. */
|
|
149
|
+
onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
150
|
+
/** Function called when user sets page. */
|
|
151
|
+
onSetPage?: OnSetPage;
|
|
152
|
+
/** Object with titles to display in pagination. */
|
|
153
|
+
titles?: PaginationTitles;
|
|
154
|
+
/** This will be shown in pagination toggle span. You can use firstIndex, lastIndex,
|
|
155
|
+
* itemCount, itemsTitle, and/or ofWord props.
|
|
146
156
|
*/
|
|
147
|
-
|
|
157
|
+
toggleTemplate?: ((props: ToggleTemplateProps) => React.ReactElement) | string;
|
|
158
|
+
/** Position where pagination is rendered. */
|
|
159
|
+
variant?: 'top' | 'bottom' | PaginationVariant;
|
|
160
|
+
/** Id to ideintify widget on page. */
|
|
161
|
+
widgetId?: string;
|
|
148
162
|
}
|
|
149
163
|
|
|
150
164
|
const handleInputWidth = (lastPage: number, node: HTMLDivElement) => {
|
|
@@ -8,43 +8,47 @@ import { ToggleTemplateProps, ToggleTemplate } from './ToggleTemplate';
|
|
|
8
8
|
import { PerPageOptions, OnPerPageSelect } from './Pagination';
|
|
9
9
|
|
|
10
10
|
export interface PaginationOptionsMenuProps extends React.HTMLProps<HTMLDivElement> {
|
|
11
|
-
/** Custom class name added to the pagination options menu */
|
|
11
|
+
/** Custom class name added to the pagination options menu. */
|
|
12
12
|
className?: string;
|
|
13
|
-
/** Id added to the title of the
|
|
13
|
+
/** Id added to the title of the pagination options menu. */
|
|
14
14
|
widgetId?: string;
|
|
15
|
-
/** Flag indicating if pagination options menu is disabled */
|
|
15
|
+
/** Flag indicating if pagination options menu is disabled. */
|
|
16
16
|
isDisabled?: boolean;
|
|
17
|
-
/** Menu will open up or open down from the options menu toggle */
|
|
17
|
+
/** Menu will open up or open down from the options menu toggle. */
|
|
18
18
|
dropDirection?: 'up' | 'down';
|
|
19
|
-
/** Array of titles and values which will be the options on the options menu dropdown */
|
|
19
|
+
/** Array of titles and values which will be the options on the options menu dropdown. */
|
|
20
20
|
perPageOptions?: PerPageOptions[];
|
|
21
|
-
/** The title of the pagination options menu */
|
|
21
|
+
/** The title of the pagination options menu. */
|
|
22
22
|
itemsPerPageTitle?: string;
|
|
23
|
-
/** Current page number */
|
|
23
|
+
/** Current page number. */
|
|
24
24
|
page?: number;
|
|
25
|
-
/** The suffix to be displayed after each option on the options menu dropdown */
|
|
25
|
+
/** The suffix to be displayed after each option on the options menu dropdown. */
|
|
26
26
|
perPageSuffix?: string;
|
|
27
|
-
/** The type or title of the items being paginated */
|
|
27
|
+
/** The type or title of the items being paginated. */
|
|
28
28
|
itemsTitle?: string;
|
|
29
|
-
/** Accessible label for the options toggle */
|
|
29
|
+
/** Accessible label for the options toggle. */
|
|
30
30
|
optionsToggle?: string;
|
|
31
|
-
/** The total number of items being paginated */
|
|
31
|
+
/** The total number of items being paginated. */
|
|
32
32
|
itemCount?: number;
|
|
33
|
-
/** The first index of the items being paginated */
|
|
33
|
+
/** The first index of the items being paginated. */
|
|
34
34
|
firstIndex?: number;
|
|
35
|
-
/** The last index of the items being paginated */
|
|
35
|
+
/** The last index of the items being paginated. */
|
|
36
36
|
lastIndex?: number;
|
|
37
|
-
/** Flag to show last full page of results
|
|
37
|
+
/** Flag to indicate whether to show last full page of results when user selects perPage
|
|
38
|
+
* value that is greater than remaining rows.
|
|
39
|
+
*/
|
|
38
40
|
defaultToFullPage?: boolean;
|
|
39
|
-
/** The number of items to be displayed per page */
|
|
41
|
+
/** The number of items to be displayed per page. */
|
|
40
42
|
perPage?: number;
|
|
41
|
-
/** The number of the last page */
|
|
43
|
+
/** The number of the last page. */
|
|
42
44
|
lastPage?: number;
|
|
43
|
-
/** This will be shown in pagination toggle span. You can use firstIndex, lastIndex,
|
|
45
|
+
/** This will be shown in pagination toggle span. You can use firstIndex, lastIndex,
|
|
46
|
+
* itemCount, and/or itemsTitle props.
|
|
47
|
+
*/
|
|
44
48
|
toggleTemplate: ((props: ToggleTemplateProps) => React.ReactElement) | string;
|
|
45
49
|
/** Function called when user selects number of items per page. */
|
|
46
50
|
onPerPageSelect?: OnPerPageSelect;
|
|
47
|
-
/** Label for the English word "of" */
|
|
51
|
+
/** Label for the English word "of". */
|
|
48
52
|
ofWord?: string;
|
|
49
53
|
/** Component to be used for wrapping the toggle contents. Use 'button' when you want
|
|
50
54
|
* all of the toggle text to be clickable.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/** Allows more customization of the pagination dropdown toggle. The following properties
|
|
4
|
+
* should be passed into the pagination component's toggleTemplate property.
|
|
5
|
+
*/
|
|
6
|
+
|
|
3
7
|
export interface ToggleTemplateProps {
|
|
4
8
|
/** The first index of the items being paginated */
|
|
5
9
|
firstIndex?: number;
|
|
@@ -34,51 +34,63 @@ export enum PopoverPosition {
|
|
|
34
34
|
rightEnd = 'right-end'
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/** The main popover component. The following properties can also be passed into another component
|
|
38
|
+
* that has a property specifically for passing in popover properties.
|
|
39
|
+
*/
|
|
40
|
+
|
|
37
41
|
export interface PopoverProps {
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
/** @beta Text announced by screen reader when alert severity variant is set to indicate
|
|
43
|
+
* severity level.
|
|
44
|
+
*/
|
|
45
|
+
alertSeverityScreenReaderText?: string;
|
|
46
|
+
/** @beta Severity variants for an alert popover. This modifies the color of the header to
|
|
47
|
+
* match the severity.
|
|
48
|
+
*/
|
|
49
|
+
alertSeverityVariant?: 'default' | 'info' | 'warning' | 'success' | 'danger';
|
|
50
|
+
/** The duration of the CSS fade transition animation. */
|
|
51
|
+
animationDuration?: number;
|
|
52
|
+
/** The element to append the popover to. Defaults to "document.body". */
|
|
41
53
|
appendTo?: HTMLElement | ((ref?: HTMLElement) => HTMLElement);
|
|
54
|
+
/** Accessible label for the popover, required when header is not present. */
|
|
55
|
+
'aria-label'?: string;
|
|
42
56
|
/**
|
|
43
|
-
* Body content
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
57
|
+
* Body content of the popover. If you want to close the popover after an action within the
|
|
58
|
+
* body content, you can use the isVisible prop for manual control, or you can provide a
|
|
59
|
+
* function which will receive a callback as an argument to hide the popover, i.e.
|
|
60
|
+
* bodyContent={hide => <Button onClick={() => hide()}>Close</Button>}
|
|
47
61
|
*/
|
|
48
62
|
bodyContent: React.ReactNode | ((hide: () => void) => React.ReactNode);
|
|
63
|
+
/** @deprecated - no longer used. if you want to constrain the popper to a specific element
|
|
64
|
+
* use the appendTo prop instead.
|
|
65
|
+
*/
|
|
66
|
+
boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
|
|
49
67
|
/**
|
|
50
|
-
* The reference element to which the
|
|
51
|
-
*
|
|
68
|
+
* The reference element to which the popover is relatively placed to. If you cannot wrap
|
|
69
|
+
* the reference with the Popover, you can use the reference prop instead.
|
|
52
70
|
* Usage: <Popover><Button>Reference</Button></Popover>
|
|
53
71
|
*/
|
|
54
72
|
children?: ReactElement<any>;
|
|
55
|
-
/**
|
|
56
|
-
* The reference element to which the Popover is relatively placed to.
|
|
57
|
-
* If you can wrap the reference with the Popover, you can use the children prop instead.
|
|
58
|
-
* Usage: <Popover reference={() => document.getElementById('reference-element')} />
|
|
59
|
-
*/
|
|
60
|
-
reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
61
|
-
/** Popover additional class */
|
|
73
|
+
/** Additional classes added to the popover. */
|
|
62
74
|
className?: string;
|
|
63
|
-
/**
|
|
75
|
+
/** Accessible label for the close button. */
|
|
64
76
|
closeBtnAriaLabel?: string;
|
|
65
|
-
/**
|
|
66
|
-
showClose?: boolean;
|
|
67
|
-
/** Distance of the popover to its target, defaults to 25 */
|
|
77
|
+
/** Distance of the popover to its target. Defaults to 25. */
|
|
68
78
|
distance?: number;
|
|
69
79
|
/**
|
|
70
80
|
* If true, tries to keep the popover in view by flipping it if necessary.
|
|
71
|
-
* If the position is set to 'auto', this prop is ignored
|
|
81
|
+
* If the position is set to 'auto', this prop is ignored.
|
|
72
82
|
*/
|
|
73
83
|
enableFlip?: boolean;
|
|
74
84
|
/**
|
|
75
85
|
* The desired position to flip the popover to if the initial position is not possible.
|
|
76
|
-
* By setting this prop to 'flip' it attempts to flip the popover to the opposite side if
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
86
|
+
* By setting this prop to 'flip' it attempts to flip the popover to the opposite side if
|
|
87
|
+
* there is no space.
|
|
88
|
+
* You can also pass an array of positions that determines the flip order. It should contain
|
|
89
|
+
* the initial position followed by alternative positions if that position is unavailable.
|
|
90
|
+
* Example: Initial position is 'top'. Button with popover is in the top right corner.
|
|
91
|
+
* 'flipBehavior' is set to ['top', 'right', 'left']. Since there is no space to the top, it
|
|
92
|
+
* checks if right is available. There's also no space to the right, so it finally shows the
|
|
93
|
+
* popover on the left.
|
|
82
94
|
*/
|
|
83
95
|
flipBehavior?:
|
|
84
96
|
| 'flip'
|
|
@@ -97,40 +109,46 @@ export interface PopoverProps {
|
|
|
97
109
|
| 'right-end'
|
|
98
110
|
)[];
|
|
99
111
|
/**
|
|
100
|
-
* Footer content
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
112
|
+
* Footer content of the popover. If you want to close the popover after an action within the
|
|
113
|
+
* footer content, you can use the isVisible prop for manual control, or you can provide a
|
|
114
|
+
* function which will receive a callback as an argument to hide the popover, i.e.
|
|
115
|
+
* footerContent={hide => <Button onClick={() => hide()}>Close</Button>}
|
|
104
116
|
*/
|
|
105
117
|
footerContent?: React.ReactNode | ((hide: () => void) => React.ReactNode);
|
|
118
|
+
/** Removes fixed-width and allows width to be defined by contents. */
|
|
119
|
+
hasAutoWidth?: boolean;
|
|
120
|
+
/** Allows content to touch edges of popover container. */
|
|
121
|
+
hasNoPadding?: boolean;
|
|
122
|
+
/** Sets the heading level to use for the popover header. Defaults to h6. */
|
|
123
|
+
headerComponent?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
106
124
|
/**
|
|
107
|
-
* Simple header content to be placed within a title.
|
|
108
|
-
*
|
|
109
|
-
* or you can provide a function which will receive a callback as an argument to hide the
|
|
110
|
-
* i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}
|
|
125
|
+
* Simple header content to be placed within a title. If you want to close the popover after
|
|
126
|
+
* an action within the header content, you can use the isVisible prop for manual control,
|
|
127
|
+
* or you can provide a function which will receive a callback as an argument to hide the
|
|
128
|
+
* popover, i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}
|
|
111
129
|
*/
|
|
112
130
|
headerContent?: React.ReactNode | ((hide: () => void) => React.ReactNode);
|
|
113
|
-
/**
|
|
114
|
-
headerComponent?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
115
|
-
/** @beta Icon to be displayed in the popover header **/
|
|
131
|
+
/** @beta Icon to be displayed in the popover header. **/
|
|
116
132
|
headerIcon?: React.ReactNode;
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
alertSeverityScreenReaderText?: string;
|
|
121
|
-
/** Hides the popover when a click occurs outside (only works if isVisible is not controlled by the user) */
|
|
133
|
+
/** Hides the popover when a click occurs outside (only works if isVisible is not controlled
|
|
134
|
+
* by the user).
|
|
135
|
+
*/
|
|
122
136
|
hideOnOutsideClick?: boolean;
|
|
137
|
+
/** Id used as part of the various popover elements (popover-${id}-header/body/footer). */
|
|
138
|
+
id?: string;
|
|
123
139
|
/**
|
|
124
140
|
* True to show the popover programmatically. Used in conjunction with the shouldClose prop.
|
|
125
|
-
* By default, the popover child element handles click events automatically. If you want to
|
|
126
|
-
* the popover will not auto-close if the
|
|
127
|
-
*
|
|
141
|
+
* By default, the popover child element handles click events automatically. If you want to
|
|
142
|
+
* control this programmatically, the popover will not auto-close if the close button is
|
|
143
|
+
* clicked, the escape key is used, or if a click occurs outside the popover. Instead, the
|
|
144
|
+
* consumer is responsible for closing the popover themselves by adding a callback listener
|
|
145
|
+
* for the shouldClose prop.
|
|
128
146
|
*/
|
|
129
147
|
isVisible?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
minWidth?: string;
|
|
132
|
-
/** Maximum width of the popover (default 18.75rem) */
|
|
148
|
+
/** Maximum width of the popover (default 18.75rem). */
|
|
133
149
|
maxWidth?: string;
|
|
150
|
+
/** Minimum width of the popover (default 6.25rem). */
|
|
151
|
+
minWidth?: string;
|
|
134
152
|
/**
|
|
135
153
|
* Lifecycle function invoked when the popover has fully transitioned out.
|
|
136
154
|
* Note: The tip argument is no longer passed and has been deprecated.
|
|
@@ -157,9 +175,9 @@ export interface PopoverProps {
|
|
|
157
175
|
*/
|
|
158
176
|
onShown?: (tip?: TippyInstance) => void;
|
|
159
177
|
/**
|
|
160
|
-
* Popover position. Note: With
|
|
161
|
-
*
|
|
162
|
-
*
|
|
178
|
+
* Popover position. Note: With the enableFlip property set to true, it will change the
|
|
179
|
+
* position if there is not enough space for the starting position. The behavior of where it
|
|
180
|
+
* flips to can be controlled through the flipBehavior property.
|
|
163
181
|
*/
|
|
164
182
|
position?:
|
|
165
183
|
| PopoverPosition
|
|
@@ -177,34 +195,32 @@ export interface PopoverProps {
|
|
|
177
195
|
| 'right-start'
|
|
178
196
|
| 'right-end';
|
|
179
197
|
/**
|
|
180
|
-
*
|
|
181
|
-
*
|
|
198
|
+
* The reference element to which the popover is relatively placed to. If you can wrap the
|
|
199
|
+
* reference with the popover, you can use the children prop instead.
|
|
200
|
+
* Usage: <Popover reference={() => document.getElementById('reference-element')} />
|
|
201
|
+
*/
|
|
202
|
+
reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
203
|
+
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
204
|
+
removeFindDomNode?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Callback function that is only invoked when isVisible is also controlled. Called when the
|
|
207
|
+
* popover close button is clicked, the enter key was used on it, or the escape key is used.
|
|
182
208
|
* Note: The tip argument is no longer passed and has been deprecated.
|
|
183
209
|
*/
|
|
184
210
|
shouldClose?: (tip?: TippyInstance, hideFunction?: () => void, event?: MouseEvent | KeyboardEvent) => void;
|
|
185
211
|
/**
|
|
186
|
-
* Callback function that is only invoked when isVisible is also controlled. Called when the
|
|
187
|
-
* used on the focused trigger
|
|
212
|
+
* Callback function that is only invoked when isVisible is also controlled. Called when the
|
|
213
|
+
* enter key is used on the focused trigger.
|
|
188
214
|
*/
|
|
189
215
|
shouldOpen?: (showFunction?: () => void, event?: MouseEvent | KeyboardEvent) => void;
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
animationDuration?: number;
|
|
194
|
-
/** id used as part of the various popover elements (popover-${id}-header/body/footer) */
|
|
195
|
-
id?: string;
|
|
196
|
-
/** Whether to trap focus in the popover */
|
|
197
|
-
withFocusTrap?: boolean;
|
|
198
|
-
/** Removes fixed-width and allows width to be defined by contents */
|
|
199
|
-
hasAutoWidth?: boolean;
|
|
200
|
-
/** Allows content to touch edges of popover container */
|
|
201
|
-
hasNoPadding?: boolean;
|
|
202
|
-
/** @deprecated - no longer used. if you want to constrain the popper to a specific element use the appendTo prop instead */
|
|
203
|
-
boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
|
|
204
|
-
/** @deprecated - no longer used */
|
|
216
|
+
/** Flag indicating whether the close button should be shown. */
|
|
217
|
+
showClose?: boolean;
|
|
218
|
+
/** @deprecated - no longer used. */
|
|
205
219
|
tippyProps?: Partial<TippyProps>;
|
|
206
|
-
/**
|
|
207
|
-
|
|
220
|
+
/** Whether to trap focus in the popover. */
|
|
221
|
+
withFocusTrap?: boolean;
|
|
222
|
+
/** The z-index of the popover. */
|
|
223
|
+
zIndex?: number;
|
|
208
224
|
}
|
|
209
225
|
|
|
210
226
|
const alertStyle = {
|
|
@@ -8,44 +8,45 @@ import { Panel, PanelMain, PanelMainBody } from '../Panel';
|
|
|
8
8
|
import { css } from '@patternfly/react-styles';
|
|
9
9
|
|
|
10
10
|
export interface AdvancedSearchMenuProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
|
|
11
|
-
/**
|
|
11
|
+
/** Delimiter in the query string for pairing attributes with search values.
|
|
12
|
+
* Required whenever attributes are passed as props.
|
|
13
|
+
*/
|
|
14
|
+
advancedSearchDelimiter?: string;
|
|
15
|
+
/** Array of attribute values used for dynamically generated advanced search. */
|
|
16
|
+
attributes?: string[] | SearchAttribute[];
|
|
17
|
+
/** Additional classes added to the advanced search menu. */
|
|
12
18
|
className?: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** Ref of the input element within the search input**/
|
|
18
|
-
parentInputRef?: React.RefObject<any>;
|
|
19
|
-
/** Function which builds an attribute-value map by parsing the value in the search input */
|
|
19
|
+
/* Additional elements added after the attributes in the form.
|
|
20
|
+
* The new form elements can be wrapped in a form group component for automatic formatting. */
|
|
21
|
+
formAdditionalItems?: React.ReactNode;
|
|
22
|
+
/** Function which builds an attribute-value map by parsing the value in the search input. */
|
|
20
23
|
getAttrValueMap?: () => { [key: string]: string };
|
|
21
|
-
/**
|
|
24
|
+
/** Attribute label for strings unassociated with one of the provided listed attributes. */
|
|
25
|
+
hasWordsAttrLabel?: React.ReactNode;
|
|
26
|
+
/** Flag for toggling the open/close state of the advanced search menu. */
|
|
27
|
+
isSearchMenuOpen?: boolean;
|
|
28
|
+
/** A callback for when the input value changes. */
|
|
29
|
+
onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
30
|
+
/** A callback for when the user clicks the clear button. */
|
|
31
|
+
onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
32
|
+
/** A callback for when the search button is clicked. */
|
|
22
33
|
onSearch?: (
|
|
23
34
|
value: string,
|
|
24
35
|
event: React.SyntheticEvent<HTMLButtonElement>,
|
|
25
36
|
attrValueMap: { [key: string]: string }
|
|
26
37
|
) => void;
|
|
27
|
-
/** A callback for when the
|
|
28
|
-
onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
29
|
-
/** A callback for when the input value changes */
|
|
30
|
-
onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
31
|
-
/** Function called to toggle the advanced search menu */
|
|
38
|
+
/** A callback for when the open advanced search button is clicked. */
|
|
32
39
|
onToggleAdvancedMenu?: (e: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
/**
|
|
40
|
+
/** Ref of the input element within the search input. */
|
|
41
|
+
parentInputRef?: React.RefObject<any>;
|
|
42
|
+
/** Ref of the div wrapping the whole search input. */
|
|
43
|
+
parentRef?: React.RefObject<any>;
|
|
44
|
+
/** Label for the button which resets the advanced search form and clears the search input. */
|
|
36
45
|
resetButtonLabel?: string;
|
|
37
|
-
/** Label for the
|
|
46
|
+
/** Label for the button which calls the onSearch event handler. */
|
|
38
47
|
submitSearchButtonLabel?: string;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/* Additional elements added after the attributes in the form.
|
|
42
|
-
* The new form elements can be wrapped in a FormGroup component for automatic formatting */
|
|
43
|
-
formAdditionalItems?: React.ReactNode;
|
|
44
|
-
/** Attribute label for strings unassociated with one of the provided listed attributes */
|
|
45
|
-
hasWordsAttrLabel?: React.ReactNode;
|
|
46
|
-
/** Delimiter in the query string for pairing attributes with search values.
|
|
47
|
-
* Required whenever attributes are passed as props */
|
|
48
|
-
advancedSearchDelimiter?: string;
|
|
48
|
+
/** Value of the search input. */
|
|
49
|
+
value?: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export const AdvancedSearchMenu: React.FunctionComponent<AdvancedSearchMenuProps> = ({
|