@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
|
@@ -13,94 +13,108 @@ import { TextInputGroup, TextInputGroupMain, TextInputGroupUtilities } from '../
|
|
|
13
13
|
import { InputGroup } from '../InputGroup';
|
|
14
14
|
import { Popper } from '../../helpers';
|
|
15
15
|
|
|
16
|
+
/** Properties for adding search attributes to an advanced search input. These properties must
|
|
17
|
+
* be passed in as an object within an array to the search input component's attribute properrty.
|
|
18
|
+
*/
|
|
19
|
+
|
|
16
20
|
export interface SearchAttribute {
|
|
17
21
|
/** The search attribute's value to be provided in the search input's query string.
|
|
18
|
-
* It should have no spaces and be unique for every attribute
|
|
22
|
+
* It should have no spaces and be unique for every attribute.
|
|
23
|
+
*/
|
|
19
24
|
attr: string;
|
|
20
|
-
/** The search attribute's display name. It is used to label the field in the advanced
|
|
25
|
+
/** The search attribute's display name. It is used to label the field in the advanced
|
|
26
|
+
* search menu.
|
|
27
|
+
*/
|
|
21
28
|
display: React.ReactNode;
|
|
22
29
|
}
|
|
23
30
|
|
|
31
|
+
/** Properties for creating an expandable search input. These properties should be passed into
|
|
32
|
+
* the search input component's expandableInput property.
|
|
33
|
+
*/
|
|
34
|
+
|
|
24
35
|
export interface ExpandableInput {
|
|
25
|
-
/** Flag to indicate if the search input is expanded */
|
|
36
|
+
/** Flag to indicate if the search input is expanded. */
|
|
26
37
|
isExpanded: boolean;
|
|
27
|
-
/** Callback function to toggle the expandable search input */
|
|
38
|
+
/** Callback function to toggle the expandable search input. */
|
|
28
39
|
onToggleExpand: (isExpanded: boolean, event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
29
|
-
/** An accessible label for the expandable search input toggle */
|
|
40
|
+
/** An accessible label for the expandable search input toggle. */
|
|
30
41
|
toggleAriaLabel: string;
|
|
31
42
|
}
|
|
32
43
|
|
|
44
|
+
/** The main search input component. */
|
|
45
|
+
|
|
33
46
|
export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'results' | 'ref'> {
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
/** Delimiter in the query string for pairing attributes with search values.
|
|
48
|
+
* Required whenever attributes are passed as props.
|
|
49
|
+
*/
|
|
50
|
+
advancedSearchDelimiter?: string;
|
|
51
|
+
/** The container to append the menu to.
|
|
52
|
+
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
53
|
+
* Some examples:
|
|
54
|
+
* appendTo={() => document.body}
|
|
55
|
+
* appendTo={document.getElementById('target')}
|
|
56
|
+
*/
|
|
57
|
+
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
58
|
+
/** An accessible label for the search input. */
|
|
41
59
|
'aria-label'?: string;
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/**
|
|
60
|
+
/** Array of attribute values used for dynamically generated advanced search. */
|
|
61
|
+
attributes?: string[] | SearchAttribute[];
|
|
62
|
+
/** Additional classes added to the search input. */
|
|
63
|
+
className?: string;
|
|
64
|
+
/** Object that makes the search input expandable/collapsible. */
|
|
65
|
+
expandableInput?: ExpandableInput;
|
|
66
|
+
/* Additional elements added after the attributes in the form.
|
|
67
|
+
* The new form elements can be wrapped in a form group component for automatic formatting. */
|
|
68
|
+
formAdditionalItems?: React.ReactNode;
|
|
69
|
+
/** Attribute label for strings unassociated with one of the provided listed attributes. */
|
|
70
|
+
hasWordsAttrLabel?: React.ReactNode;
|
|
71
|
+
/** A suggestion for autocompleting. */
|
|
72
|
+
hint?: string;
|
|
73
|
+
/** @hide A reference object to attach to the input box. */
|
|
45
74
|
innerRef?: React.RefObject<any>;
|
|
46
|
-
/** A
|
|
75
|
+
/** A flag for controlling the open state of a custom advanced search implementation. */
|
|
76
|
+
isAdvancedSearchOpen?: boolean;
|
|
77
|
+
/** Flag indicating if search input is disabled. */
|
|
78
|
+
isDisabled?: boolean;
|
|
79
|
+
/** Flag indicating if the next navigation button is disabled. */
|
|
80
|
+
isNextNavigationButtonDisabled?: boolean;
|
|
81
|
+
/** Flag indicating if the previous navigation button is disabled. */
|
|
82
|
+
isPreviousNavigationButtonDisabled?: boolean;
|
|
83
|
+
/** Accessible label for the button to navigate to next result. */
|
|
84
|
+
nextNavigationButtonAriaLabel?: string;
|
|
85
|
+
/** A callback for when the input value changes. */
|
|
47
86
|
onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
48
|
-
/** A
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
/** A callback for when the
|
|
87
|
+
/** A callback for when the user clicks the clear button. */
|
|
88
|
+
onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
89
|
+
/** A callback for when the user clicks to navigate to next result. */
|
|
90
|
+
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
91
|
+
/** A callback for when the user clicks to navigate to previous result. */
|
|
92
|
+
onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
93
|
+
/** A callback for when the search button is clicked. */
|
|
53
94
|
onSearch?: (
|
|
54
95
|
value: string,
|
|
55
96
|
event: React.SyntheticEvent<HTMLButtonElement>,
|
|
56
97
|
attrValueMap: { [key: string]: string }
|
|
57
98
|
) => void;
|
|
58
|
-
/** A callback for when the
|
|
59
|
-
onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
60
|
-
/** Label for the buttons which reset the advanced search form and clear the search input */
|
|
61
|
-
resetButtonLabel?: string;
|
|
62
|
-
/** Label for the buttons which called the onSearch event handler */
|
|
63
|
-
submitSearchButtonLabel?: string;
|
|
64
|
-
/** A callback for when the open advanced search button is clicked */
|
|
99
|
+
/** A callback for when the open advanced search button is clicked. */
|
|
65
100
|
onToggleAdvancedSearch?: (event: React.SyntheticEvent<HTMLButtonElement>, isOpen?: boolean) => void;
|
|
66
|
-
/**
|
|
67
|
-
isAdvancedSearchOpen?: boolean;
|
|
68
|
-
/** Label for the button which opens the advanced search form menu */
|
|
101
|
+
/** Accessible label for the button which opens the advanced search form menu. */
|
|
69
102
|
openMenuButtonAriaLabel?: string;
|
|
70
|
-
/**
|
|
103
|
+
/** Placeholder text of the search input. */
|
|
104
|
+
placeholder?: string;
|
|
105
|
+
/** Accessible label for the button to navigate to previous result. */
|
|
71
106
|
previousNavigationButtonAriaLabel?: string;
|
|
72
|
-
/** Flag indicating if the previous navigation button is disabled */
|
|
73
|
-
isPreviousNavigationButtonDisabled?: boolean;
|
|
74
|
-
/** Label for the button to navigate to next result */
|
|
75
|
-
nextNavigationButtonAriaLabel?: string;
|
|
76
|
-
/** Flag indicating if the next navigation button is disabled */
|
|
77
|
-
isNextNavigationButtonDisabled?: boolean;
|
|
78
|
-
/** Function called when user clicks to navigate to next result */
|
|
79
|
-
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
80
|
-
/** Function called when user clicks to navigate to previous result */
|
|
81
|
-
onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
82
|
-
/** The number of search results returned. Either a total number of results,
|
|
83
|
-
* or a string representing the current result over the total number of results. i.e. "1 / 5" */
|
|
84
|
-
resultsCount?: number | string;
|
|
85
|
-
/** Array of attribute values used for dynamically generated advanced search */
|
|
86
|
-
attributes?: string[] | SearchAttribute[];
|
|
87
|
-
/* Additional elements added after the attributes in the form.
|
|
88
|
-
* The new form elements can be wrapped in a FormGroup component for automatic formatting */
|
|
89
|
-
formAdditionalItems?: React.ReactNode;
|
|
90
|
-
/** Attribute label for strings unassociated with one of the provided listed attributes */
|
|
91
|
-
hasWordsAttrLabel?: React.ReactNode;
|
|
92
|
-
/** Delimiter in the query string for pairing attributes with search values.
|
|
93
|
-
* Required whenever attributes are passed as props */
|
|
94
|
-
advancedSearchDelimiter?: string;
|
|
95
|
-
/** The container to append the menu to.
|
|
96
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
97
|
-
* Some examples:
|
|
98
|
-
* appendTo={() => document.body}
|
|
99
|
-
* appendTo={document.getElementById('target')}
|
|
100
|
-
*/
|
|
101
|
-
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
102
107
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
103
108
|
removeFindDomNode?: boolean;
|
|
109
|
+
/** Label for the button which resets the advanced search form and clears the search input. */
|
|
110
|
+
resetButtonLabel?: string;
|
|
111
|
+
/** The number of search results returned. Either a total number of results,
|
|
112
|
+
* or a string representing the current result over the total number of results. i.e. "1 / 5". */
|
|
113
|
+
resultsCount?: number | string;
|
|
114
|
+
/** Label for the button which calls the onSearch event handler. */
|
|
115
|
+
submitSearchButtonLabel?: string;
|
|
116
|
+
/** Value of the search input. */
|
|
117
|
+
value?: string;
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
@@ -143,6 +143,8 @@ export interface SelectProps
|
|
|
143
143
|
maxHeight?: string | number;
|
|
144
144
|
/** Icon element to render inside the select toggle */
|
|
145
145
|
toggleIcon?: React.ReactElement;
|
|
146
|
+
/** Custom icon for the dropdown replacing the CaretDownIcon */
|
|
147
|
+
toggleIndicator?: React.ReactElement;
|
|
146
148
|
/** Custom content to render in the select menu. If this prop is defined, the variant prop will be ignored and the select will render with a single select toggle */
|
|
147
149
|
customContent?: React.ReactNode;
|
|
148
150
|
/** Flag indicating if select should have an inline text input for filtering */
|
|
@@ -239,6 +241,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
239
241
|
onClear: () => undefined as void,
|
|
240
242
|
onCreateOption: () => undefined as void,
|
|
241
243
|
toggleIcon: null as React.ReactElement,
|
|
244
|
+
toggleIndicator: null as React.ReactElement,
|
|
242
245
|
onFilter: null,
|
|
243
246
|
onTypeaheadInputChanged: null,
|
|
244
247
|
customContent: null,
|
|
@@ -983,6 +986,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
983
986
|
width,
|
|
984
987
|
maxHeight,
|
|
985
988
|
toggleIcon,
|
|
989
|
+
toggleIndicator,
|
|
986
990
|
ouiaId,
|
|
987
991
|
ouiaSafe,
|
|
988
992
|
hasInlineFilter,
|
|
@@ -1314,6 +1318,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1314
1318
|
onClose={this.onClose}
|
|
1315
1319
|
onBlur={onBlur}
|
|
1316
1320
|
variant={variant}
|
|
1321
|
+
toggleIndicator={toggleIndicator}
|
|
1317
1322
|
aria-labelledby={`${ariaLabelledBy || ''} ${selectToggleId}`}
|
|
1318
1323
|
aria-label={toggleAriaLabel}
|
|
1319
1324
|
{...(ariaDescribedby && { 'aria-describedby': ariaDescribedby })}
|
|
@@ -31,6 +31,8 @@ export interface SelectToggleProps extends React.HTMLProps<HTMLElement> {
|
|
|
31
31
|
moveFocusToLastMenuItem?: () => void;
|
|
32
32
|
/** Element which wraps toggle */
|
|
33
33
|
parentRef: React.RefObject<HTMLDivElement>;
|
|
34
|
+
/** Custom icon for the dropdown replacing the CaretDownIcon */
|
|
35
|
+
toggleIndicator?: React.ReactElement;
|
|
34
36
|
/** The menu element */
|
|
35
37
|
menuRef?: React.RefObject<HTMLElement>;
|
|
36
38
|
/** The menu footer element */
|
|
@@ -262,6 +264,7 @@ export class SelectToggle extends React.Component<SelectToggleProps> {
|
|
|
262
264
|
'aria-label': ariaLabel,
|
|
263
265
|
hasFooter,
|
|
264
266
|
footerRef,
|
|
267
|
+
toggleIndicator,
|
|
265
268
|
...props
|
|
266
269
|
} = this.props;
|
|
267
270
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -307,9 +310,7 @@ export class SelectToggle extends React.Component<SelectToggleProps> {
|
|
|
307
310
|
disabled={isDisabled}
|
|
308
311
|
>
|
|
309
312
|
{children}
|
|
310
|
-
<span className={css(styles.selectToggleArrow)}>
|
|
311
|
-
<CaretDownIcon />
|
|
312
|
-
</span>
|
|
313
|
+
<span className={css(styles.selectToggleArrow)}>{toggleIndicator ?? <CaretDownIcon />}</span>
|
|
313
314
|
</button>
|
|
314
315
|
)}
|
|
315
316
|
{isTypeahead && (
|
|
@@ -354,7 +355,7 @@ export class SelectToggle extends React.Component<SelectToggleProps> {
|
|
|
354
355
|
})}
|
|
355
356
|
disabled={isDisabled}
|
|
356
357
|
>
|
|
357
|
-
<CaretDownIcon className={css(styles.selectToggleArrow)} />
|
|
358
|
+
{toggleIndicator ?? <CaretDownIcon className={css(styles.selectToggleArrow)} />}
|
|
358
359
|
</button>
|
|
359
360
|
</div>
|
|
360
361
|
)}
|
|
@@ -7,64 +7,70 @@ import { InputGroup, InputGroupText } from '../InputGroup';
|
|
|
7
7
|
import { TextInput } from '../TextInput';
|
|
8
8
|
import { Tooltip } from '../Tooltip';
|
|
9
9
|
|
|
10
|
+
/** Properties for creating custom steps in a slider. These properties should be passed in as
|
|
11
|
+
* an object within an array to the slider component's customSteps property.
|
|
12
|
+
*/
|
|
10
13
|
export interface SliderStepObject {
|
|
11
|
-
/**
|
|
12
|
-
value: number;
|
|
13
|
-
/** The display label for the step value. This is also used for the aria-valuetext */
|
|
14
|
-
label: string;
|
|
15
|
-
/** Flag to hide the label */
|
|
14
|
+
/** Flag to hide the label. */
|
|
16
15
|
isLabelHidden?: boolean;
|
|
16
|
+
/** The display label for the step value. This is also used for the aria-valuetext attribute. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Value of the step. This value is a percentage of the slider where the tick is drawn. */
|
|
19
|
+
value: number;
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
/** The main slider component. */
|
|
19
23
|
export interface SliderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
value?: number;
|
|
24
|
-
/** Flag indicating if the slider is is discrete for custom steps. This will cause the slider to snap to the closest value. */
|
|
24
|
+
/** Flag indicating if the slider is discrete for custom steps. This will cause the slider
|
|
25
|
+
* to snap to the closest value.
|
|
26
|
+
*/
|
|
25
27
|
areCustomStepsContinuous?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/** The maximum permitted value */
|
|
33
|
-
max?: number;
|
|
34
|
-
/** Flag to indicate if boundaries should be shown for slider that does not have custom steps */
|
|
35
|
-
showBoundaries?: boolean;
|
|
36
|
-
/** Flag to indicate if ticks should be shown for slider that does not have custom steps */
|
|
37
|
-
showTicks?: boolean;
|
|
28
|
+
/** One or more id's to use for the slider thumb's accessible description. */
|
|
29
|
+
'aria-describedby'?: string;
|
|
30
|
+
/** One or more id's to use for the slider thumb's accessible label. */
|
|
31
|
+
'aria-labelledby'?: string;
|
|
32
|
+
/** Additional classes added to the slider. */
|
|
33
|
+
className?: string;
|
|
38
34
|
/** Array of custom slider step objects (value and label of each step) for the slider. */
|
|
39
35
|
customSteps?: SliderStepObject[];
|
|
40
|
-
|
|
41
|
-
isInputVisible?: boolean;
|
|
42
|
-
/** Value displayed in the input field */
|
|
43
|
-
inputValue?: number;
|
|
44
|
-
/** Aria label for the input field */
|
|
45
|
-
inputAriaLabel?: string;
|
|
46
|
-
/* Aria label for the thumb */
|
|
47
|
-
thumbAriaLabel?: string;
|
|
48
|
-
/* Adds a tooltip over the thumb containing the current value */
|
|
36
|
+
/* Adds a tooltip over the slider thumb containing the current value. */
|
|
49
37
|
hasTooltipOverThumb?: boolean;
|
|
50
|
-
/**
|
|
38
|
+
/** Accessible label for the input field. */
|
|
39
|
+
inputAriaLabel?: string;
|
|
40
|
+
/** Text label that is place after the input field. */
|
|
51
41
|
inputLabel?: string | number;
|
|
52
|
-
/** Position of the input */
|
|
42
|
+
/** Position of the input. */
|
|
53
43
|
inputPosition?: 'aboveThumb' | 'right';
|
|
54
|
-
/** Value
|
|
44
|
+
/** Value displayed in the input field. */
|
|
45
|
+
inputValue?: number;
|
|
46
|
+
/** Adds disabled styling, and disables the slider and the input component if present. */
|
|
47
|
+
isDisabled?: boolean;
|
|
48
|
+
/** Flag to show value input field. */
|
|
49
|
+
isInputVisible?: boolean;
|
|
50
|
+
/** Actions placed to the left of the slider. */
|
|
51
|
+
leftActions?: React.ReactNode;
|
|
52
|
+
/** The maximum permitted value. */
|
|
53
|
+
max?: number;
|
|
54
|
+
/** The minimum permitted value. */
|
|
55
|
+
min?: number;
|
|
56
|
+
/** Value change callback. This is called when the slider value changes. */
|
|
55
57
|
onChange?: (
|
|
56
58
|
value: number,
|
|
57
59
|
inputValue?: number,
|
|
58
60
|
setLocalInputValue?: React.Dispatch<React.SetStateAction<number>>
|
|
59
61
|
) => void;
|
|
60
|
-
/** Actions placed to the
|
|
61
|
-
leftActions?: React.ReactNode;
|
|
62
|
-
/** Actions placed to the right of the slider */
|
|
62
|
+
/** Actions placed to the right of the slider. */
|
|
63
63
|
rightActions?: React.ReactNode;
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
|
|
64
|
+
/** Flag to indicate if boundaries should be shown for slider that does not have custom steps. */
|
|
65
|
+
showBoundaries?: boolean;
|
|
66
|
+
/** Flag to indicate if ticks should be shown for slider that does not have custom steps. */
|
|
67
|
+
showTicks?: boolean;
|
|
68
|
+
/** The step interval. */
|
|
69
|
+
step?: number;
|
|
70
|
+
/* Accessible label for the slider thumb. */
|
|
71
|
+
thumbAriaLabel?: string;
|
|
72
|
+
/** Current value of the slider. */
|
|
73
|
+
value?: number;
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
const getPercentage = (current: number, max: number) => (100 * current) / max;
|
|
@@ -3,18 +3,18 @@ import styles from '@patternfly/react-styles/css/components/Slider/slider';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
|
|
5
5
|
export interface SliderStepProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
|
|
6
|
-
/** Additional classes added to the slider
|
|
6
|
+
/** Additional classes added to the slider step. */
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
value?: number;
|
|
10
|
-
/** Step label **/
|
|
11
|
-
label?: string;
|
|
12
|
-
/** Flag indicating that the tick should be hidden */
|
|
13
|
-
isTickHidden?: boolean;
|
|
14
|
-
/** Flag indicating that the label should be hidden */
|
|
15
|
-
isLabelHidden?: boolean;
|
|
16
|
-
/** Flag indicating the step is active */
|
|
8
|
+
/** Flag indicating the step is active. */
|
|
17
9
|
isActive?: boolean;
|
|
10
|
+
/** Flag indicating that the label should be hidden. */
|
|
11
|
+
isLabelHidden?: boolean;
|
|
12
|
+
/** Flag indicating that the tick should be hidden. */
|
|
13
|
+
isTickHidden?: boolean;
|
|
14
|
+
/** Step label. **/
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Step value. **/
|
|
17
|
+
value?: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const SliderStep: React.FunctionComponent<SliderStepProps> = ({
|
|
@@ -3,76 +3,90 @@ import { TreeViewList } from './TreeViewList';
|
|
|
3
3
|
import { TreeViewCheckProps, TreeViewListItem } from './TreeViewListItem';
|
|
4
4
|
import { TreeViewRoot } from './TreeViewRoot';
|
|
5
5
|
|
|
6
|
+
/** Properties that make up a tree view data item. These properties should be passed in as an
|
|
7
|
+
* object to one of the various tree view component properties which accept TreeViewDataItem as
|
|
8
|
+
* a type.
|
|
9
|
+
*/
|
|
10
|
+
|
|
6
11
|
export interface TreeViewDataItem {
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/** Child nodes of a tree view item */
|
|
12
|
+
/** Action of a tree view item, which can be either a button or dropdown component. */
|
|
13
|
+
action?: React.ReactNode;
|
|
14
|
+
/** Additional properties of the tree view item badge. */
|
|
15
|
+
badgeProps?: any;
|
|
16
|
+
/** Additional properties of the tree view item checkbox. */
|
|
17
|
+
checkProps?: TreeViewCheckProps;
|
|
18
|
+
/** Child nodes of a tree view item. */
|
|
14
19
|
children?: TreeViewDataItem[];
|
|
15
|
-
/**
|
|
20
|
+
/** Optional prop for a custom badge. */
|
|
21
|
+
customBadgeContent?: React.ReactNode;
|
|
22
|
+
/** Flag indicating if node is expanded by default. */
|
|
16
23
|
defaultExpanded?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
icon?: React.ReactNode;
|
|
19
|
-
/** Expanded icon of a tree view item */
|
|
24
|
+
/** Expanded icon of a tree view item. */
|
|
20
25
|
expandedIcon?: React.ReactNode;
|
|
21
|
-
/** Flag indicating if a tree view item has a
|
|
22
|
-
hasCheck?: boolean;
|
|
23
|
-
/** Additional properties of the tree view item checkbox */
|
|
24
|
-
checkProps?: TreeViewCheckProps;
|
|
25
|
-
/** Flag indicating if a tree view item has a badge */
|
|
26
|
+
/** Flag indicating if a tree view item has a badge. */
|
|
26
27
|
hasBadge?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
28
|
+
/** Flag indicating if a tree view item has a checkbox. */
|
|
29
|
+
hasCheck?: boolean;
|
|
30
|
+
/** Default icon of a tree view item. */
|
|
31
|
+
icon?: React.ReactNode;
|
|
32
|
+
/** ID of a tree view item. */
|
|
33
|
+
id?: string;
|
|
34
|
+
/** Internal content of a tree view item. */
|
|
35
|
+
name: React.ReactNode;
|
|
36
|
+
/** Title of a tree view item. Only used in compact presentations. */
|
|
37
|
+
title?: React.ReactNode;
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
/** The main tree view component. */
|
|
41
|
+
|
|
35
42
|
export interface TreeViewProps {
|
|
36
|
-
/**
|
|
43
|
+
/** Active items of tree view. */
|
|
44
|
+
activeItems?: TreeViewDataItem[];
|
|
45
|
+
/** Sets the expanded state on all tree nodes, overriding default behavior and current
|
|
46
|
+
* internal state.
|
|
47
|
+
*/
|
|
48
|
+
allExpanded?: boolean;
|
|
49
|
+
/** Class to add if not passed a parentItem property. */
|
|
50
|
+
className?: string;
|
|
51
|
+
/** Comparison function for determining active items. */
|
|
52
|
+
compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
|
|
53
|
+
/** Data of the tree view. */
|
|
37
54
|
data: TreeViewDataItem[];
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
/** Flag indicating if all nodes in the tree view should have
|
|
43
|
-
hasChecks?: boolean;
|
|
44
|
-
/** Flag indicating if all nodes in the tree view should have badges */
|
|
55
|
+
/** Sets the default expanded behavior. */
|
|
56
|
+
defaultAllExpanded?: boolean;
|
|
57
|
+
/** Icon for all expanded node items. */
|
|
58
|
+
expandedIcon?: React.ReactNode;
|
|
59
|
+
/** Flag indicating if all nodes in the tree view should have badges. */
|
|
45
60
|
hasBadges?: boolean;
|
|
46
|
-
/** Flag indicating if tree view
|
|
61
|
+
/** Flag indicating if all nodes in the tree view should have checkboxes. */
|
|
62
|
+
hasChecks?: boolean;
|
|
63
|
+
/** Flag indicating if the tree view has guide lines. */
|
|
47
64
|
hasGuides?: boolean;
|
|
48
|
-
/** Flag indicating
|
|
65
|
+
/** Flag indicating if the tree view is nested. */
|
|
66
|
+
isNested?: boolean;
|
|
67
|
+
/** Flag indicating that tree nodes should be independently selectable, even when having
|
|
68
|
+
* children.
|
|
69
|
+
*/
|
|
49
70
|
hasSelectableNodes?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
variant?: 'default' | 'compact' | 'compactNoBackground';
|
|
52
|
-
/** Icon for all leaf or unexpanded node items */
|
|
71
|
+
/** Icon for all leaf or unexpanded node items. */
|
|
53
72
|
icon?: React.ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
allExpanded?: boolean;
|
|
58
|
-
/** Sets the default expanded behavior */
|
|
59
|
-
defaultAllExpanded?: boolean;
|
|
60
|
-
/** Callback for item selection */
|
|
61
|
-
onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
|
|
62
|
-
/** Callback for item checkbox selection */
|
|
73
|
+
/** ID of the tree view. */
|
|
74
|
+
id?: string;
|
|
75
|
+
/** Callback for item checkbox selection. */
|
|
63
76
|
onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
/** Internal. Parent item of a
|
|
77
|
+
/** Callback for item selection. */
|
|
78
|
+
onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
|
|
79
|
+
/** Internal. Parent item of a tree view list item. */
|
|
67
80
|
parentItem?: TreeViewDataItem;
|
|
68
|
-
/**
|
|
69
|
-
compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
|
|
70
|
-
/** Class to add to add if not passed a parentItem */
|
|
71
|
-
className?: string;
|
|
72
|
-
/** Toolbar to display above the tree view */
|
|
81
|
+
/** Toolbar to display above the tree view. */
|
|
73
82
|
toolbar?: React.ReactNode;
|
|
74
|
-
/** Flag indicating the
|
|
83
|
+
/** Flag indicating the tree view should utilize memoization to help render large data sets.
|
|
84
|
+
* Setting this property requires that the activeItems property is passed an array containing
|
|
85
|
+
* every node in the selected item's path.
|
|
86
|
+
*/
|
|
75
87
|
useMemo?: boolean;
|
|
88
|
+
/** Variant presentation styles for the tree view. */
|
|
89
|
+
variant?: 'default' | 'compact' | 'compactNoBackground';
|
|
76
90
|
}
|
|
77
91
|
|
|
78
92
|
export const TreeView: React.FunctionComponent<TreeViewProps> = ({
|
|
@@ -3,12 +3,12 @@ import { css } from '@patternfly/react-styles';
|
|
|
3
3
|
import { Divider } from '../Divider';
|
|
4
4
|
|
|
5
5
|
export interface TreeViewListProps extends React.HTMLProps<HTMLUListElement> {
|
|
6
|
-
/**
|
|
6
|
+
/** Child nodes of the current tree view. */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Flag indicating if the tree view is nested under another tree view. */
|
|
7
9
|
isNested?: boolean;
|
|
8
|
-
/** Toolbar to display above the tree view */
|
|
10
|
+
/** Toolbar to display above the tree view. */
|
|
9
11
|
toolbar?: React.ReactNode;
|
|
10
|
-
/** Child nodes of the current tree view */
|
|
11
|
-
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const TreeViewList: React.FunctionComponent<TreeViewListProps> = ({
|
|
@@ -11,51 +11,58 @@ export interface TreeViewCheckProps extends Omit<Partial<React.InputHTMLAttribut
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface TreeViewListItemProps {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
isExpanded?: boolean;
|
|
22
|
-
/** Flag indicating if node is expanded by default */
|
|
23
|
-
defaultExpanded?: boolean;
|
|
24
|
-
/** Child nodes of a tree view item */
|
|
25
|
-
children?: React.ReactNode;
|
|
26
|
-
/** Callback for item selection. Note: calling event.preventDefault() will prevent the node from toggling. */
|
|
27
|
-
onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
|
|
28
|
-
/** Callback for item checkbox selection */
|
|
29
|
-
onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
|
|
30
|
-
/** Flag indicating if a tree view item has a checkbox */
|
|
31
|
-
hasCheck?: boolean;
|
|
32
|
-
/** Additional properties of the tree view item checkbox */
|
|
14
|
+
/** Action of a tree view item, which can be either a button or dropdown component. */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
/** Active items of tree view. */
|
|
17
|
+
activeItems?: TreeViewDataItem[];
|
|
18
|
+
/** Additional properties of the tree view item badge. */
|
|
19
|
+
badgeProps?: any;
|
|
20
|
+
/** Additional properties of the tree view item checkbox. */
|
|
33
21
|
checkProps?: TreeViewCheckProps;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/** Optional prop for custom badge */
|
|
22
|
+
/** Child nodes of a tree view item. */
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/** Callback for item comparison function. */
|
|
25
|
+
compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
|
|
26
|
+
/** Optional prop for a custom badge. */
|
|
39
27
|
customBadgeContent?: React.ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
|
|
28
|
+
/** Flag indicating if node is expanded by default. */
|
|
29
|
+
defaultExpanded?: boolean;
|
|
30
|
+
/** Expanded icon of a tree view item. */
|
|
31
|
+
expandedIcon?: React.ReactNode;
|
|
32
|
+
/** Flag indicating if a tree view item has a badge. */
|
|
33
|
+
hasBadge?: boolean;
|
|
34
|
+
/** Flag indicating if a tree view item has a checkbox. */
|
|
35
|
+
hasCheck?: boolean;
|
|
36
|
+
/** Default icon of a tree view item. */
|
|
37
|
+
icon?: React.ReactNode;
|
|
38
|
+
/** ID of a tree view item. */
|
|
39
|
+
id?: string;
|
|
42
40
|
/** Flag indicating if the tree view is using a compact variation. */
|
|
43
41
|
isCompact?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/**
|
|
42
|
+
/** Flag indicating if the node is expanded, overrides internal state. */
|
|
43
|
+
isExpanded?: boolean;
|
|
44
|
+
/** Flag indicating that tree nodes should be independently selectable, even when having
|
|
45
|
+
* children.
|
|
46
|
+
*/
|
|
47
|
+
isSelectable?: boolean;
|
|
48
|
+
/** Data structure of tree view item. */
|
|
47
49
|
itemData?: TreeViewDataItem;
|
|
48
|
-
/**
|
|
50
|
+
/** Internal content of a tree view item. */
|
|
51
|
+
name: React.ReactNode;
|
|
52
|
+
/** Callback for item checkbox selection. */
|
|
53
|
+
onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
|
|
54
|
+
/** Callback for item selection. Note: calling event.preventDefault() will prevent the node
|
|
55
|
+
* from toggling.
|
|
56
|
+
*/
|
|
57
|
+
onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
|
|
58
|
+
/** Parent item of tree view item. */
|
|
49
59
|
parentItem?: TreeViewDataItem;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/** Callback for item comparison function */
|
|
57
|
-
compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
|
|
58
|
-
/** Flag indicating the TreeView should utilize memoization to help render large data sets. Setting this property requires that `activeItems` pass in an array containing every node in the selected item's path. */
|
|
60
|
+
/** Title of a tree view item. */
|
|
61
|
+
title: React.ReactNode;
|
|
62
|
+
/** Flag indicating the tree view should utilize memoization to help render large data sets.
|
|
63
|
+
* Setting this property requires that the activeItems property is passed an array containing
|
|
64
|
+
* every node in the selected item's path.
|
|
65
|
+
*/
|
|
59
66
|
useMemo?: boolean;
|
|
60
67
|
}
|
|
61
68
|
|