@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.
Files changed (275) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/Alert/Alert.d.ts +41 -34
  3. package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
  4. package/dist/esm/components/Alert/Alert.js.map +1 -1
  5. package/dist/esm/components/Alert/AlertActionCloseButton.d.ts +8 -5
  6. package/dist/esm/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
  7. package/dist/esm/components/Alert/AlertActionCloseButton.js.map +1 -1
  8. package/dist/esm/components/Alert/AlertActionLink.d.ts +5 -2
  9. package/dist/esm/components/Alert/AlertActionLink.d.ts.map +1 -1
  10. package/dist/esm/components/Alert/AlertActionLink.js.map +1 -1
  11. package/dist/esm/components/Alert/AlertIcon.d.ts +4 -4
  12. package/dist/esm/components/Alert/AlertIcon.d.ts.map +1 -1
  13. package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts +5 -5
  14. package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
  15. package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +34 -28
  16. package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
  17. package/dist/esm/components/CalendarMonth/CalendarMonth.js +1 -0
  18. package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
  19. package/dist/esm/components/DatePicker/DatePicker.d.ts +43 -36
  20. package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
  21. package/dist/esm/components/DatePicker/DatePicker.js +4 -0
  22. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  23. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  24. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  25. package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
  26. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  27. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  28. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  29. package/dist/esm/components/FileUpload/FileUpload.d.ts +53 -47
  30. package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
  31. package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
  32. package/dist/esm/components/FileUpload/FileUploadField.d.ts +51 -46
  33. package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
  34. package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
  35. package/dist/esm/components/Modal/Modal.d.ts +57 -48
  36. package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
  37. package/dist/esm/components/Modal/Modal.js.map +1 -1
  38. package/dist/esm/components/Modal/ModalBox.d.ts +12 -12
  39. package/dist/esm/components/Modal/ModalBox.d.ts.map +1 -1
  40. package/dist/esm/components/Modal/ModalBoxBody.d.ts +2 -2
  41. package/dist/esm/components/Modal/ModalBoxBody.d.ts.map +1 -1
  42. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  43. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  44. package/dist/esm/components/Modal/ModalBoxDescription.d.ts +3 -3
  45. package/dist/esm/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  46. package/dist/esm/components/Modal/ModalBoxFooter.d.ts +2 -2
  47. package/dist/esm/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  48. package/dist/esm/components/Modal/ModalBoxHeader.d.ts +3 -3
  49. package/dist/esm/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  50. package/dist/esm/components/Modal/ModalBoxTitle.d.ts +8 -9
  51. package/dist/esm/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  52. package/dist/esm/components/Modal/ModalBoxTitle.js.map +1 -1
  53. package/dist/esm/components/Modal/ModalContent.d.ts +56 -48
  54. package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
  55. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  56. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  57. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  58. package/dist/esm/components/NotificationBadge/NotificationBadge.js +3 -3
  59. package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
  60. package/dist/esm/components/Pagination/Navigation.d.ts +33 -33
  61. package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
  62. package/dist/esm/components/Pagination/OptionsToggle.d.ts +27 -26
  63. package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
  64. package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
  65. package/dist/esm/components/Pagination/Pagination.d.ts +76 -65
  66. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js +1 -1
  68. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  69. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  70. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  71. package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  72. package/dist/esm/components/Pagination/ToggleTemplate.d.ts +3 -0
  73. package/dist/esm/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  74. package/dist/esm/components/Pagination/ToggleTemplate.js.map +1 -1
  75. package/dist/esm/components/Popover/Popover.d.ts +88 -73
  76. package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
  77. package/dist/esm/components/Popover/Popover.js.map +1 -1
  78. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  79. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  80. package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  81. package/dist/esm/components/SearchInput/SearchInput.d.ts +71 -60
  82. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  83. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  84. package/dist/esm/components/Select/Select.d.ts +2 -0
  85. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  86. package/dist/esm/components/Select/Select.js +4 -3
  87. package/dist/esm/components/Select/Select.js.map +1 -1
  88. package/dist/esm/components/Select/SelectToggle.d.ts +2 -0
  89. package/dist/esm/components/Select/SelectToggle.d.ts.map +1 -1
  90. package/dist/esm/components/Select/SelectToggle.js +3 -5
  91. package/dist/esm/components/Select/SelectToggle.js.map +1 -1
  92. package/dist/esm/components/Slider/Slider.d.ts +45 -39
  93. package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
  94. package/dist/esm/components/Slider/Slider.js.map +1 -1
  95. package/dist/esm/components/Slider/SliderStep.d.ts +10 -10
  96. package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
  97. package/dist/esm/components/TreeView/TreeView.d.ts +65 -53
  98. package/dist/esm/components/TreeView/TreeView.d.ts.map +1 -1
  99. package/dist/esm/components/TreeView/TreeView.js.map +1 -1
  100. package/dist/esm/components/TreeView/TreeViewList.d.ts +4 -4
  101. package/dist/esm/components/TreeView/TreeViewList.d.ts.map +1 -1
  102. package/dist/esm/components/TreeView/TreeViewListItem.d.ts +46 -39
  103. package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  104. package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
  105. package/dist/esm/components/TreeView/TreeViewRoot.d.ts +4 -4
  106. package/dist/esm/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  107. package/dist/esm/components/TreeView/TreeViewSearch.d.ts +11 -8
  108. package/dist/esm/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  109. package/dist/esm/components/TreeView/TreeViewSearch.js.map +1 -1
  110. package/dist/esm/helpers/Popper/Popper.js +8 -8
  111. package/dist/esm/helpers/Popper/Popper.js.map +1 -1
  112. package/dist/js/components/Alert/Alert.d.ts +41 -34
  113. package/dist/js/components/Alert/Alert.d.ts.map +1 -1
  114. package/dist/js/components/Alert/Alert.js.map +1 -1
  115. package/dist/js/components/Alert/AlertActionCloseButton.d.ts +8 -5
  116. package/dist/js/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
  117. package/dist/js/components/Alert/AlertActionCloseButton.js.map +1 -1
  118. package/dist/js/components/Alert/AlertActionLink.d.ts +5 -2
  119. package/dist/js/components/Alert/AlertActionLink.d.ts.map +1 -1
  120. package/dist/js/components/Alert/AlertActionLink.js.map +1 -1
  121. package/dist/js/components/Alert/AlertIcon.d.ts +4 -4
  122. package/dist/js/components/Alert/AlertIcon.d.ts.map +1 -1
  123. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts +5 -5
  124. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
  125. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +34 -28
  126. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
  127. package/dist/js/components/CalendarMonth/CalendarMonth.js +1 -0
  128. package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
  129. package/dist/js/components/DatePicker/DatePicker.d.ts +43 -36
  130. package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
  131. package/dist/js/components/DatePicker/DatePicker.js +4 -0
  132. package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
  133. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  134. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  135. package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
  136. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  137. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  138. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  139. package/dist/js/components/FileUpload/FileUpload.d.ts +53 -47
  140. package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
  141. package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
  142. package/dist/js/components/FileUpload/FileUploadField.d.ts +51 -46
  143. package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
  144. package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
  145. package/dist/js/components/Modal/Modal.d.ts +57 -48
  146. package/dist/js/components/Modal/Modal.d.ts.map +1 -1
  147. package/dist/js/components/Modal/Modal.js.map +1 -1
  148. package/dist/js/components/Modal/ModalBox.d.ts +12 -12
  149. package/dist/js/components/Modal/ModalBox.d.ts.map +1 -1
  150. package/dist/js/components/Modal/ModalBoxBody.d.ts +2 -2
  151. package/dist/js/components/Modal/ModalBoxBody.d.ts.map +1 -1
  152. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  153. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  154. package/dist/js/components/Modal/ModalBoxDescription.d.ts +3 -3
  155. package/dist/js/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  156. package/dist/js/components/Modal/ModalBoxFooter.d.ts +2 -2
  157. package/dist/js/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  158. package/dist/js/components/Modal/ModalBoxHeader.d.ts +3 -3
  159. package/dist/js/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  160. package/dist/js/components/Modal/ModalBoxTitle.d.ts +8 -9
  161. package/dist/js/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  162. package/dist/js/components/Modal/ModalBoxTitle.js.map +1 -1
  163. package/dist/js/components/Modal/ModalContent.d.ts +56 -48
  164. package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
  165. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  166. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  167. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  168. package/dist/js/components/NotificationBadge/NotificationBadge.js +3 -3
  169. package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
  170. package/dist/js/components/Pagination/Navigation.d.ts +33 -33
  171. package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
  172. package/dist/js/components/Pagination/OptionsToggle.d.ts +27 -26
  173. package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
  174. package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
  175. package/dist/js/components/Pagination/Pagination.d.ts +76 -65
  176. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  177. package/dist/js/components/Pagination/Pagination.js +1 -1
  178. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  179. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  180. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  181. package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  182. package/dist/js/components/Pagination/ToggleTemplate.d.ts +3 -0
  183. package/dist/js/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  184. package/dist/js/components/Pagination/ToggleTemplate.js.map +1 -1
  185. package/dist/js/components/Popover/Popover.d.ts +88 -73
  186. package/dist/js/components/Popover/Popover.d.ts.map +1 -1
  187. package/dist/js/components/Popover/Popover.js.map +1 -1
  188. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  189. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  190. package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  191. package/dist/js/components/SearchInput/SearchInput.d.ts +71 -60
  192. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  193. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  194. package/dist/js/components/Select/Select.d.ts +2 -0
  195. package/dist/js/components/Select/Select.d.ts.map +1 -1
  196. package/dist/js/components/Select/Select.js +4 -3
  197. package/dist/js/components/Select/Select.js.map +1 -1
  198. package/dist/js/components/Select/SelectToggle.d.ts +2 -0
  199. package/dist/js/components/Select/SelectToggle.d.ts.map +1 -1
  200. package/dist/js/components/Select/SelectToggle.js +3 -5
  201. package/dist/js/components/Select/SelectToggle.js.map +1 -1
  202. package/dist/js/components/Slider/Slider.d.ts +45 -39
  203. package/dist/js/components/Slider/Slider.d.ts.map +1 -1
  204. package/dist/js/components/Slider/Slider.js.map +1 -1
  205. package/dist/js/components/Slider/SliderStep.d.ts +10 -10
  206. package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
  207. package/dist/js/components/TreeView/TreeView.d.ts +65 -53
  208. package/dist/js/components/TreeView/TreeView.d.ts.map +1 -1
  209. package/dist/js/components/TreeView/TreeView.js.map +1 -1
  210. package/dist/js/components/TreeView/TreeViewList.d.ts +4 -4
  211. package/dist/js/components/TreeView/TreeViewList.d.ts.map +1 -1
  212. package/dist/js/components/TreeView/TreeViewListItem.d.ts +46 -39
  213. package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  214. package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
  215. package/dist/js/components/TreeView/TreeViewRoot.d.ts +4 -4
  216. package/dist/js/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  217. package/dist/js/components/TreeView/TreeViewSearch.d.ts +11 -8
  218. package/dist/js/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  219. package/dist/js/components/TreeView/TreeViewSearch.js.map +1 -1
  220. package/dist/js/helpers/Popper/Popper.js +8 -8
  221. package/dist/js/helpers/Popper/Popper.js.map +1 -1
  222. package/dist/umd/react-core.min.css +172 -172
  223. package/dist/umd/react-core.min.js +3 -3
  224. package/package.json +2 -2
  225. package/src/components/Alert/Alert.tsx +42 -34
  226. package/src/components/Alert/AlertActionCloseButton.tsx +9 -5
  227. package/src/components/Alert/AlertActionLink.tsx +6 -2
  228. package/src/components/Alert/AlertIcon.tsx +4 -4
  229. package/src/components/Alert/AlertToggleExpandButton.tsx +5 -5
  230. package/src/components/Badge/__tests__/Badge.test.tsx +45 -8
  231. package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -12
  232. package/src/components/CalendarMonth/CalendarMonth.tsx +36 -28
  233. package/src/components/DatePicker/DatePicker.tsx +49 -36
  234. package/src/components/DatePicker/__tests__/DatePicker.test.tsx +21 -0
  235. package/src/components/ExpandableSection/ExpandableSection.tsx +35 -24
  236. package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +11 -5
  237. package/src/components/FileUpload/FileUpload.tsx +56 -49
  238. package/src/components/FileUpload/FileUploadField.tsx +56 -50
  239. package/src/components/Modal/Modal.tsx +57 -48
  240. package/src/components/Modal/ModalBox.tsx +12 -12
  241. package/src/components/Modal/ModalBoxBody.tsx +2 -2
  242. package/src/components/Modal/ModalBoxCloseButton.tsx +2 -2
  243. package/src/components/Modal/ModalBoxDescription.tsx +3 -3
  244. package/src/components/Modal/ModalBoxFooter.tsx +2 -2
  245. package/src/components/Modal/ModalBoxHeader.tsx +3 -3
  246. package/src/components/Modal/ModalBoxTitle.tsx +8 -9
  247. package/src/components/Modal/ModalContent.tsx +56 -48
  248. package/src/components/Modal/examples/Modal.md +1 -3
  249. package/src/components/NotificationBadge/NotificationBadge.tsx +22 -15
  250. package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +25 -1
  251. package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +5 -0
  252. package/src/components/NotificationBadge/examples/NotificationBadge.md +16 -3
  253. package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +26 -13
  254. package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +28 -18
  255. package/src/components/Pagination/Navigation.tsx +33 -33
  256. package/src/components/Pagination/OptionsToggle.tsx +27 -26
  257. package/src/components/Pagination/Pagination.tsx +79 -65
  258. package/src/components/Pagination/PaginationOptionsMenu.tsx +22 -18
  259. package/src/components/Pagination/ToggleTemplate.tsx +4 -0
  260. package/src/components/Popover/Popover.tsx +89 -73
  261. package/src/components/SearchInput/AdvancedSearchMenu.tsx +29 -28
  262. package/src/components/SearchInput/SearchInput.tsx +76 -62
  263. package/src/components/Select/Select.tsx +5 -0
  264. package/src/components/Select/SelectToggle.tsx +5 -4
  265. package/src/components/Slider/Slider.tsx +47 -41
  266. package/src/components/Slider/SliderStep.tsx +10 -10
  267. package/src/components/TreeView/TreeView.tsx +67 -53
  268. package/src/components/TreeView/TreeViewList.tsx +4 -4
  269. package/src/components/TreeView/TreeViewListItem.tsx +46 -39
  270. package/src/components/TreeView/TreeViewRoot.tsx +4 -4
  271. package/src/components/TreeView/TreeViewSearch.tsx +12 -8
  272. package/src/demos/Masthead.md +9 -193
  273. package/src/demos/NotificationDrawer/NotificationDrawer.md +2 -0
  274. package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +305 -0
  275. 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 search menu */
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
- /** Additional classes added to the banner */
35
- className?: string;
36
- /** Value of the search input */
37
- value?: string;
38
- /** Flag indicating if search input is disabled */
39
- isDisabled?: boolean;
40
- /** An accessible label for the search input */
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
- /** placeholder text of the search input */
43
- placeholder?: string;
44
- /** @hide A reference object to attach to the input box */
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 callback for when the input value changes */
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 suggestion for autocompleting */
49
- hint?: string;
50
- /** Object that makes the search input expandable/collapsible */
51
- expandableInput?: ExpandableInput;
52
- /** A callback for when the search button clicked changes */
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 user clicks the clear button */
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
- /** A flag for controlling the open state of a custom advanced search implementation */
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
- /** Label for the button to navigate to previous result */
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
- /** Value of the step. This value is a percentage of the slider where the tick is drawn. */
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
- /** Additional classes added to the spinner. */
21
- className?: string;
22
- /** Current value */
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
- /** Adds disabled styling and disables the slider and the input component is present */
27
- isDisabled?: boolean;
28
- /** The step interval*/
29
- step?: number;
30
- /** Minimum permitted value */
31
- min?: number;
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
- /** Flag to show value input field */
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
- /** Label that is place after the input field */
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 change callback. This is called when the slider value changes */
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 left of the slider */
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
- /** One or more id's to use for the slider thumb description */
65
- 'aria-describedby'?: string;
66
- /** One or more id's to use for the slider thumb label */
67
- 'aria-labelledby'?: string;
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 steps. */
6
+ /** Additional classes added to the slider step. */
7
7
  className?: string;
8
- /** Step value **/
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
- /** Internal content of a tree view item */
8
- name: React.ReactNode;
9
- /** Title a tree view item. Only used in Compact presentations. */
10
- title?: React.ReactNode;
11
- /** ID of a tree view item */
12
- id?: string;
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
- /** Flag indicating if node is expanded by default */
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
- /** Default icon of a tree view item */
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 checkbox */
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
- /** Optional prop for custom badge */
28
- customBadgeContent?: React.ReactNode;
29
- /** Additional properties of the tree view item badge */
30
- badgeProps?: any;
31
- /** Action of a tree view item, can be a Button or Dropdown */
32
- action?: React.ReactNode;
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
- /** Data of the tree view */
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
- /** ID of the tree view */
39
- id?: string;
40
- /** Flag indicating if the tree view is nested */
41
- isNested?: boolean;
42
- /** Flag indicating if all nodes in the tree view should have checkboxes */
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 has guide lines. */
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 that tree nodes should be independently selectable, even when having children */
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
- /** Variant presentation styles for the tree view. */
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
- /** Icon for all expanded node items */
55
- expandedIcon?: React.ReactNode;
56
- /** Sets the expanded state on all tree nodes, overriding default behavior and current internal state */
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
- /** Active items of tree view */
65
- activeItems?: TreeViewDataItem[];
66
- /** Internal. Parent item of a TreeViewListItem */
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
- /** Comparison function for determining active items */
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 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. */
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
- /** Flag indicating if the tree view is nested under another tree view */
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
- /** Internal content of a tree view item */
15
- name: React.ReactNode;
16
- /** Title a tree view item */
17
- title: React.ReactNode;
18
- /** ID of a tree view item */
19
- id?: string;
20
- /** Flag indicating if the node is expanded, overrides internal state */
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
- /** Flag indicating if a tree view item has a badge */
35
- hasBadge?: boolean;
36
- /** Flag indicating that tree nodes should be independently selectable, even when having children */
37
- isSelectable?: boolean;
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
- /** Additional properties of the tree view item badge */
41
- badgeProps?: any;
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
- /** Active items of tree view */
45
- activeItems?: TreeViewDataItem[];
46
- /** Data structure of tree view item */
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
- /** Parent item of tree view item */
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
- /** Default icon of a tree view item */
51
- icon?: React.ReactNode;
52
- /** Expanded icon of a tree view item */
53
- expandedIcon?: React.ReactNode;
54
- /** Action of a tree view item, can be a Button or Dropdown */
55
- action?: React.ReactNode;
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