@patternfly/react-docs 7.6.0-prerelease.8 → 7.6.0-prerelease.9

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 (163) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +21 -0
  3. package/package.json +12 -11
  4. package/patternfly-docs/generated/components/about-modal/react.js +0 -149
  5. package/patternfly-docs/generated/components/accordion/react.js +0 -262
  6. package/patternfly-docs/generated/components/action-list/react.js +0 -144
  7. package/patternfly-docs/generated/components/alert/react-demos.js +0 -56
  8. package/patternfly-docs/generated/components/alert/react.js +0 -1433
  9. package/patternfly-docs/generated/components/avatar/react.js +0 -166
  10. package/patternfly-docs/generated/components/back-to-top/react-demos.js +0 -60
  11. package/patternfly-docs/generated/components/back-to-top/react.js +0 -77
  12. package/patternfly-docs/generated/components/backdrop/react.js +0 -64
  13. package/patternfly-docs/generated/components/background-image/react.js +0 -62
  14. package/patternfly-docs/generated/components/badge/react.js +0 -97
  15. package/patternfly-docs/generated/components/banner/react-demos.js +0 -57
  16. package/patternfly-docs/generated/components/banner/react.js +0 -148
  17. package/patternfly-docs/generated/components/brand/react.js +0 -142
  18. package/patternfly-docs/generated/components/breadcrumb/react.js +0 -206
  19. package/patternfly-docs/generated/components/button/react-demos.js +0 -57
  20. package/patternfly-docs/generated/components/button/react.js +0 -826
  21. package/patternfly-docs/generated/components/card/react-demos.js +0 -201
  22. package/patternfly-docs/generated/components/card/react.js +0 -1015
  23. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +0 -1350
  24. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +0 -1334
  25. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +0 -1282
  26. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +0 -848
  27. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +0 -192
  28. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +0 -426
  29. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +0 -804
  30. package/patternfly-docs/generated/components/charts/legends/-Victory.js +0 -3230
  31. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +0 -1178
  32. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +0 -525
  33. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +0 -3382
  34. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +0 -377
  35. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +0 -2475
  36. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +0 -538
  37. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +0 -1551
  38. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +0 -4115
  39. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +0 -955
  40. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +0 -1173
  41. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +0 -1166
  42. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +0 -413
  43. package/patternfly-docs/generated/components/chip/react-deprecated.js +0 -323
  44. package/patternfly-docs/generated/components/clipboard-copy/react.js +0 -373
  45. package/patternfly-docs/generated/components/code-block/react.js +0 -148
  46. package/patternfly-docs/generated/components/code-editor/react.js +0 -659
  47. package/patternfly-docs/generated/components/compass/react-demos.js +0 -147
  48. package/patternfly-docs/generated/components/compass/react.js +0 -440
  49. package/patternfly-docs/generated/components/content/react.js +0 -248
  50. package/patternfly-docs/generated/components/data-list/react-demos.js +0 -90
  51. package/patternfly-docs/generated/components/data-list/react.js +0 -709
  52. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +0 -283
  53. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +0 -64
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +0 -83
  55. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +0 -395
  56. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +0 -241
  57. package/patternfly-docs/generated/components/description-list/react-demos.js +0 -58
  58. package/patternfly-docs/generated/components/description-list/react.js +0 -743
  59. package/patternfly-docs/generated/components/divider/react.js +0 -126
  60. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +0 -351
  61. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +0 -184
  62. package/patternfly-docs/generated/components/drag-and-drop/react.js +0 -137
  63. package/patternfly-docs/generated/components/drawer/react.js +0 -598
  64. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +0 -772
  65. package/patternfly-docs/generated/components/dual-list-selector/react.js +0 -594
  66. package/patternfly-docs/generated/components/empty-state/react.js +0 -199
  67. package/patternfly-docs/generated/components/expandable-section/react-demos.js +0 -65
  68. package/patternfly-docs/generated/components/expandable-section/react.js +0 -408
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +0 -52
  70. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +0 -398
  71. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +0 -749
  72. package/patternfly-docs/generated/components/forms/checkbox/react.js +0 -222
  73. package/patternfly-docs/generated/components/forms/form/react.js +0 -1106
  74. package/patternfly-docs/generated/components/forms/form-select/react.js +0 -208
  75. package/patternfly-docs/generated/components/forms/radio/react.js +0 -212
  76. package/patternfly-docs/generated/components/forms/text-area/react.js +0 -160
  77. package/patternfly-docs/generated/components/forms/text-input/react.js +0 -216
  78. package/patternfly-docs/generated/components/helper-text/react-demos.js +0 -180
  79. package/patternfly-docs/generated/components/helper-text/react.js +0 -164
  80. package/patternfly-docs/generated/components/hero/react.js +0 -88
  81. package/patternfly-docs/generated/components/hint/react.js +0 -169
  82. package/patternfly-docs/generated/components/icon/react.js +0 -215
  83. package/patternfly-docs/generated/components/input-group/react.js +0 -182
  84. package/patternfly-docs/generated/components/jump-links/react-demos.js +0 -154
  85. package/patternfly-docs/generated/components/jump-links/react.js +0 -212
  86. package/patternfly-docs/generated/components/label/react-demos.js +0 -57
  87. package/patternfly-docs/generated/components/label/react.js +0 -417
  88. package/patternfly-docs/generated/components/list/react.js +0 -175
  89. package/patternfly-docs/generated/components/login-page/react.js +0 -587
  90. package/patternfly-docs/generated/components/masthead/react-demos.js +0 -79
  91. package/patternfly-docs/generated/components/masthead/react.js +0 -291
  92. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +0 -769
  93. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +0 -665
  94. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +0 -187
  95. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +0 -163
  96. package/patternfly-docs/generated/components/menus/dropdown/react.js +0 -998
  97. package/patternfly-docs/generated/components/menus/menu/react.js +0 -1540
  98. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +0 -747
  99. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +0 -508
  100. package/patternfly-docs/generated/components/menus/select/react-templates.js +0 -257
  101. package/patternfly-docs/generated/components/menus/select/react.js +0 -998
  102. package/patternfly-docs/generated/components/modal/react-deprecated.js +0 -554
  103. package/patternfly-docs/generated/components/modal/react.js +0 -597
  104. package/patternfly-docs/generated/components/navigation/react-demos.js +0 -356
  105. package/patternfly-docs/generated/components/navigation/react.js +0 -409
  106. package/patternfly-docs/generated/components/notification-badge/react.js +0 -196
  107. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +0 -107
  108. package/patternfly-docs/generated/components/notification-drawer/react.js +0 -394
  109. package/patternfly-docs/generated/components/number-input/react.js +0 -210
  110. package/patternfly-docs/generated/components/overflow-menu/react.js +0 -274
  111. package/patternfly-docs/generated/components/page/react-demos.js +0 -149
  112. package/patternfly-docs/generated/components/page/react.js +0 -1352
  113. package/patternfly-docs/generated/components/pagination/react.js +0 -492
  114. package/patternfly-docs/generated/components/panel/react.js +0 -236
  115. package/patternfly-docs/generated/components/popover/react.js +0 -390
  116. package/patternfly-docs/generated/components/progress/react-demos.js +0 -59
  117. package/patternfly-docs/generated/components/progress/react.js +0 -283
  118. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +0 -45
  119. package/patternfly-docs/generated/components/progress-stepper/react.js +0 -219
  120. package/patternfly-docs/generated/components/search-input/react-demos.js +0 -113
  121. package/patternfly-docs/generated/components/search-input/react.js +0 -263
  122. package/patternfly-docs/generated/components/sidebar/react.js +0 -236
  123. package/patternfly-docs/generated/components/simple-list/react.js +0 -200
  124. package/patternfly-docs/generated/components/skeleton/react-demos.js +0 -44
  125. package/patternfly-docs/generated/components/skeleton/react.js +0 -122
  126. package/patternfly-docs/generated/components/skip-to-content/react.js +0 -73
  127. package/patternfly-docs/generated/components/slider/react.js +0 -309
  128. package/patternfly-docs/generated/components/spinner/react.js +0 -111
  129. package/patternfly-docs/generated/components/switch/react.js +0 -163
  130. package/patternfly-docs/generated/components/table/react-demos.js +0 -355
  131. package/patternfly-docs/generated/components/table/react-deprecated.js +0 -1350
  132. package/patternfly-docs/generated/components/table/react.js +0 -3241
  133. package/patternfly-docs/generated/components/tabs/react-demos.js +0 -108
  134. package/patternfly-docs/generated/components/tabs/react.js +0 -1359
  135. package/patternfly-docs/generated/components/text-input-group/react-demos.js +0 -152
  136. package/patternfly-docs/generated/components/text-input-group/react.js +0 -278
  137. package/patternfly-docs/generated/components/tile/react-deprecated.js +0 -242
  138. package/patternfly-docs/generated/components/timestamp/react.js +0 -283
  139. package/patternfly-docs/generated/components/title/react.js +0 -94
  140. package/patternfly-docs/generated/components/toggle-group/react.js +0 -299
  141. package/patternfly-docs/generated/components/toolbar/react-demos.js +0 -66
  142. package/patternfly-docs/generated/components/toolbar/react.js +0 -932
  143. package/patternfly-docs/generated/components/tooltip/react.js +0 -241
  144. package/patternfly-docs/generated/components/tree-view/react.js +0 -429
  145. package/patternfly-docs/generated/components/truncate/react.js +0 -211
  146. package/patternfly-docs/generated/components/wizard/react-demos.js +0 -87
  147. package/patternfly-docs/generated/components/wizard/react-deprecated.js +0 -788
  148. package/patternfly-docs/generated/components/wizard/react.js +0 -986
  149. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +0 -285
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +0 -70
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +0 -506
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +0 -94
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +0 -272
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +0 -87
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +0 -124
  156. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +0 -112
  157. package/patternfly-docs/generated/index.js +0 -1769
  158. package/patternfly-docs/generated/patterns/card-view/react-demos.js +0 -78
  159. package/patternfly-docs/generated/patterns/filters/react-demos.js +0 -141
  160. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +0 -51
  161. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +0 -61
  162. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +0 -124
  163. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +0 -81
@@ -1,709 +0,0 @@
1
- import React from 'react';
2
- import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
- import { Fragment, useState } from 'react';
4
- import RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';
5
- import RhMicronsCaretDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-down-icon';
6
- import RhMicronsCaretRightIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-right-icon';
7
- import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';
8
- import { css } from '@patternfly/react-styles';
9
- import { DragDropSort, DragDropContainer, Droppable as NewDroppable } from '@patternfly/react-drag-drop';
10
- const pageData = {
11
- "id": "Data list",
12
- "section": "components",
13
- "subsection": "",
14
- "deprecated": false,
15
- "template": false,
16
- "beta": false,
17
- "demo": false,
18
- "newImplementationLink": false,
19
- "source": "react",
20
- "tabName": null,
21
- "slug": "/components/data-list/react",
22
- "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/DataList/examples/DataList.md",
23
- "relPath": "packages/react-core/src/components/DataList/examples/DataList.md",
24
- "propComponents": [
25
- {
26
- "name": "DataList",
27
- "description": "",
28
- "props": [
29
- {
30
- "name": "aria-label",
31
- "type": "string",
32
- "description": "Adds accessible text to the data list list",
33
- "required": true
34
- },
35
- {
36
- "name": "children",
37
- "type": "React.ReactNode",
38
- "description": "Content rendered inside the data list list"
39
- },
40
- {
41
- "name": "className",
42
- "type": "string",
43
- "description": "Additional classes added to the data list list"
44
- },
45
- {
46
- "name": "gridBreakpoint",
47
- "type": "'none' | 'always' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'",
48
- "description": "Specifies the grid breakpoints"
49
- },
50
- {
51
- "name": "isCompact",
52
- "type": "boolean",
53
- "description": "Flag indicating if data list should have compact styling"
54
- },
55
- {
56
- "name": "isNoPlainOnGlass",
57
- "type": "boolean",
58
- "description": "Flag to prevent the data list from automatically applying plain styling when glass theme is enabled.",
59
- "beta": true
60
- },
61
- {
62
- "name": "isPlain",
63
- "type": "boolean",
64
- "description": "Flag indicating if data list should have plain styling with a transparent background",
65
- "beta": true
66
- },
67
- {
68
- "name": "onSelectableRowChange",
69
- "type": "(event: React.FormEvent<HTMLInputElement>, id: string) => void",
70
- "description": "Object that causes the data list to render hidden inputs which improve selectable item a11y"
71
- },
72
- {
73
- "name": "onSelectDataListItem",
74
- "type": "(event: React.MouseEvent | React.KeyboardEvent, id: string) => void",
75
- "description": "Optional callback to make data list selectable, fired when data list item selected"
76
- },
77
- {
78
- "name": "selectedDataListItemId",
79
- "type": "string",
80
- "description": "Id of data list item currently selected"
81
- },
82
- {
83
- "name": "wrapModifier",
84
- "type": "DataListWrapModifier | 'nowrap' | 'truncate' | 'breakWord'",
85
- "description": "Determines which wrapping modifier to apply to the data list"
86
- }
87
- ]
88
- },
89
- {
90
- "name": "DataListAction",
91
- "description": "",
92
- "props": [
93
- {
94
- "name": "aria-label",
95
- "type": "string",
96
- "description": "Adds accessible text to the data list action",
97
- "required": true
98
- },
99
- {
100
- "name": "aria-labelledby",
101
- "type": "string",
102
- "description": "Adds accessible text to the data list action",
103
- "required": true
104
- },
105
- {
106
- "name": "children",
107
- "type": "React.ReactNode",
108
- "description": "Content rendered as data list action (e.g <Button> or <Dropdown>)",
109
- "required": true
110
- },
111
- {
112
- "name": "className",
113
- "type": "string",
114
- "description": "Additional classes added to the data list action"
115
- },
116
- {
117
- "name": "id",
118
- "type": "string",
119
- "description": "Identify the data list toggle number",
120
- "required": true
121
- },
122
- {
123
- "name": "visibility",
124
- "type": "{\n default?: 'hidden' | 'visible';\n sm?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n}",
125
- "description": "What breakpoints to hide/show the data list action"
126
- }
127
- ]
128
- },
129
- {
130
- "name": "DataListCell",
131
- "description": "",
132
- "props": [
133
- {
134
- "name": "alignRight",
135
- "type": "boolean",
136
- "description": "Aligns the cell content to the right of its parent.",
137
- "defaultValue": "false"
138
- },
139
- {
140
- "name": "children",
141
- "type": "React.ReactNode",
142
- "description": "Content rendered inside the data list cell",
143
- "defaultValue": "null"
144
- },
145
- {
146
- "name": "className",
147
- "type": "string",
148
- "description": "Additional classes added to the data list cell",
149
- "defaultValue": "''"
150
- },
151
- {
152
- "name": "isFilled",
153
- "type": "boolean",
154
- "description": "Enables the body content to fill the height of the card",
155
- "defaultValue": "true"
156
- },
157
- {
158
- "name": "isIcon",
159
- "type": "boolean",
160
- "description": "Set to true if the cell content is an icon",
161
- "defaultValue": "false"
162
- },
163
- {
164
- "name": "width",
165
- "type": "1 | 2 | 3 | 4 | 5",
166
- "description": "Width (from 1-5) to the data list cell",
167
- "defaultValue": "1"
168
- },
169
- {
170
- "name": "wrapModifier",
171
- "type": "DataListWrapModifier | 'nowrap' | 'truncate' | 'breakWord'",
172
- "description": "Determines which wrapping modifier to apply to the data list cell",
173
- "defaultValue": "null"
174
- }
175
- ]
176
- },
177
- {
178
- "name": "DataListCheck",
179
- "description": "",
180
- "props": [
181
- {
182
- "name": "aria-labelledby",
183
- "type": "string",
184
- "description": "Aria-labelledby of the DataList checkbox",
185
- "required": true
186
- },
187
- {
188
- "name": "checked",
189
- "type": "boolean",
190
- "description": "Flag to show if the DataList checkbox is checked when it is controlled by React state. Both isChecked and checked are valid,\nbut only use one.\nTo make the DataList checkbox uncontrolled, instead use the defaultChecked prop, but do not use both."
191
- },
192
- {
193
- "name": "className",
194
- "type": "string",
195
- "description": "Additional classes added to the DataList item checkbox"
196
- },
197
- {
198
- "name": "defaultChecked",
199
- "type": "boolean",
200
- "description": "Flag to set default value of DataList checkbox when it is uncontrolled by React state.\nTo make the DataList checkbox controlled, instead use the isChecked prop, but do not use both."
201
- },
202
- {
203
- "name": "id",
204
- "type": "string",
205
- "description": "Id of the DataList checkbox."
206
- },
207
- {
208
- "name": "isChecked",
209
- "type": "boolean",
210
- "description": "Flag to show if the DataList checkbox is checked when it is controlled by React state. Both isChecked and checked are valid,\nbut only use one.\nTo make the DataList checkbox uncontrolled, instead use the defaultChecked prop, but do not use both."
211
- },
212
- {
213
- "name": "isDisabled",
214
- "type": "boolean",
215
- "description": "Flag to show if the DataList checkbox is disabled",
216
- "defaultValue": "false"
217
- },
218
- {
219
- "name": "isValid",
220
- "type": "boolean",
221
- "description": "Flag to show if the DataList checkbox selection is valid or invalid",
222
- "defaultValue": "true"
223
- },
224
- {
225
- "name": "onChange",
226
- "type": "(event: React.FormEvent<HTMLInputElement>, checked: boolean) => void",
227
- "description": "A callback for when the DataList checkbox selection changes"
228
- },
229
- {
230
- "name": "otherControls",
231
- "type": "boolean",
232
- "description": "Flag to indicate if other controls are used in the DataListItem",
233
- "defaultValue": "false"
234
- }
235
- ]
236
- },
237
- {
238
- "name": "DataListItem",
239
- "description": "",
240
- "props": [
241
- {
242
- "name": "aria-labelledby",
243
- "type": "string",
244
- "description": "Adds an accessible name to the selectable input if one is rendered",
245
- "defaultValue": "''"
246
- },
247
- {
248
- "name": "children",
249
- "type": "React.ReactNode",
250
- "description": "Content rendered inside the DataList item",
251
- "defaultValue": "null"
252
- },
253
- {
254
- "name": "className",
255
- "type": "string",
256
- "description": "Additional classes added to the DataList item should be either <DataListItemRow> or <DataListContent>",
257
- "defaultValue": "''"
258
- },
259
- {
260
- "name": "id",
261
- "type": "string",
262
- "description": "Unique id for the DataList item",
263
- "defaultValue": "''"
264
- },
265
- {
266
- "name": "isExpanded",
267
- "type": "boolean",
268
- "description": "Flag to show if the expanded content of the DataList item is visible",
269
- "defaultValue": "false"
270
- },
271
- {
272
- "name": "selectableInputAriaLabel",
273
- "type": "string",
274
- "description": "Aria label to apply to the selectable input if one is rendered"
275
- }
276
- ]
277
- },
278
- {
279
- "name": "DataListItemCells",
280
- "description": "",
281
- "props": [
282
- {
283
- "name": "className",
284
- "type": "string",
285
- "description": "Additional classes added to the data list item content wrapper. Children should be one or more <DataListCell> nodes",
286
- "defaultValue": "''"
287
- },
288
- {
289
- "name": "dataListCells",
290
- "type": "React.ReactNode",
291
- "description": "Array of <DataListCell> nodes that are rendered one after the other."
292
- },
293
- {
294
- "name": "rowid",
295
- "type": "string",
296
- "description": "Id for the row",
297
- "defaultValue": "''"
298
- }
299
- ]
300
- },
301
- {
302
- "name": "DataListItemRow",
303
- "description": "",
304
- "props": [
305
- {
306
- "name": "children",
307
- "type": "React.ReactNode",
308
- "description": "Content rendered inside the DataListItemRow",
309
- "required": true
310
- },
311
- {
312
- "name": "className",
313
- "type": "string",
314
- "description": "Additional classes added to the DataListItemRow",
315
- "defaultValue": "''"
316
- },
317
- {
318
- "name": "rowid",
319
- "type": "string",
320
- "description": "Id for the row item",
321
- "defaultValue": "''"
322
- },
323
- {
324
- "name": "wrapModifier",
325
- "type": "DataListWrapModifier | 'nowrap' | 'truncate' | 'breakWord'",
326
- "description": "Determines which wrapping modifier to apply to the DataListItemRow",
327
- "defaultValue": "null"
328
- }
329
- ]
330
- },
331
- {
332
- "name": "DataListToggle",
333
- "description": "",
334
- "props": [
335
- {
336
- "name": "aria-controls",
337
- "type": "string",
338
- "description": "Allows users of some screen readers to shift focus to the controlled element. Should be used when the controlled contents are not adjacent to the toggle that controls them.",
339
- "defaultValue": "''"
340
- },
341
- {
342
- "name": "aria-label",
343
- "type": "string",
344
- "description": "Adds accessible text to the data list toggle",
345
- "defaultValue": "'Details'"
346
- },
347
- {
348
- "name": "aria-labelledby",
349
- "type": "string",
350
- "description": "Adds accessible text to the data list toggle"
351
- },
352
- {
353
- "name": "buttonProps",
354
- "type": "ButtonProps",
355
- "description": "Additional properties spread to the toggle button"
356
- },
357
- {
358
- "name": "className",
359
- "type": "string",
360
- "description": "Additional classes added to the data list cell",
361
- "defaultValue": "''"
362
- },
363
- {
364
- "name": "id",
365
- "type": "string",
366
- "description": "Identify the data list toggle number",
367
- "required": true
368
- },
369
- {
370
- "name": "isExpanded",
371
- "type": "boolean",
372
- "description": "Flag to show if the expanded content of the data list item is visible",
373
- "defaultValue": "false"
374
- },
375
- {
376
- "name": "rowid",
377
- "type": "string",
378
- "description": "Id for the row",
379
- "defaultValue": "''"
380
- }
381
- ]
382
- },
383
- {
384
- "name": "DataListContent",
385
- "description": "",
386
- "props": [
387
- {
388
- "name": "aria-label",
389
- "type": "string",
390
- "description": "Adds accessible text to the DataList toggle",
391
- "required": true
392
- },
393
- {
394
- "name": "children",
395
- "type": "React.ReactNode",
396
- "description": "Content rendered inside the DataList item",
397
- "defaultValue": "null"
398
- },
399
- {
400
- "name": "className",
401
- "type": "string",
402
- "description": "Additional classes added to the DataList cell",
403
- "defaultValue": "''"
404
- },
405
- {
406
- "name": "hasNoPadding",
407
- "type": "boolean",
408
- "description": "Flag to remove padding from the expandable content",
409
- "defaultValue": "false"
410
- },
411
- {
412
- "name": "id",
413
- "type": "string",
414
- "description": "Identify the DataListContent item",
415
- "defaultValue": "''"
416
- },
417
- {
418
- "name": "isHidden",
419
- "type": "boolean",
420
- "description": "Flag to show if the expanded content of the DataList item is visible",
421
- "defaultValue": "false"
422
- },
423
- {
424
- "name": "rowid",
425
- "type": "string",
426
- "description": "Id for the row",
427
- "defaultValue": "''"
428
- }
429
- ]
430
- },
431
- {
432
- "name": "DataListDragButton",
433
- "description": "",
434
- "props": [
435
- {
436
- "name": "className",
437
- "type": "string",
438
- "description": "Additional classes added to the drag button",
439
- "defaultValue": "''"
440
- },
441
- {
442
- "name": "isDisabled",
443
- "type": "boolean",
444
- "description": "Flag indicating if drag is disabled for the item",
445
- "defaultValue": "false"
446
- },
447
- {
448
- "name": "type",
449
- "type": "'button' | 'submit' | 'reset'",
450
- "description": "Sets button type"
451
- }
452
- ]
453
- },
454
- {
455
- "name": "DataListControl",
456
- "description": "",
457
- "props": [
458
- {
459
- "name": "children",
460
- "type": "React.ReactNode",
461
- "description": "Children of the data list control"
462
- },
463
- {
464
- "name": "className",
465
- "type": "string",
466
- "description": "Additional classes added to the DataList item control",
467
- "defaultValue": "''"
468
- }
469
- ]
470
- }
471
- ],
472
- "cssPrefix": [
473
- "pf-v6-c-data-list"
474
- ],
475
- "examples": [
476
- "Basic",
477
- "Compact",
478
- "Plain",
479
- "Checkboxes, actions and additional cells",
480
- "Actions: single and multiple",
481
- "Expandable",
482
- "Mixed expandable",
483
- "Width modifiers",
484
- "Clickable rows",
485
- "Controlling text",
486
- "Draggable",
487
- "Draggable with multiple drop zones",
488
- "Small grid breakpoint"
489
- ]
490
- };
491
- pageData.liveContext = {
492
- Fragment,
493
- useState,
494
- RhUiBranchFillIcon,
495
- RhMicronsCaretDownIcon,
496
- RhMicronsCaretRightIcon,
497
- RhUiEllipsisVerticalFillIcon,
498
- css,
499
- DragDropSort,
500
- DragDropContainer,
501
- NewDroppable
502
- };
503
- pageData.examples = {
504
- 'Basic': props =>
505
- <Example {...pageData} {...props} {...{"code":"import { DataList, DataListItem, DataListItemRow, DataListItemCells, DataListCell } from '@patternfly/react-core';\n\nexport const DataListBasic: React.FunctionComponent = () => (\n <DataList aria-label=\"Simple data list example\">\n <DataListItem aria-labelledby=\"simple-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"simple-item1\">Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Secondary content</DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"simple-item2\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell isFilled={false} key=\"secondary content fill\">\n <span id=\"simple-item2\">Secondary content (pf-m-no-fill)</span>\n </DataListCell>,\n <DataListCell isFilled={false} alignRight key=\"secondary content align\">\n Secondary content (pf-m-align-right pf-m-no-fill)\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n);\n","title":"Basic","lang":"ts","className":""}}>
506
-
507
- </Example>,
508
- 'Compact': props =>
509
- <Example {...pageData} {...props} {...{"code":"import { DataList, DataListItem, DataListItemRow, DataListItemCells, DataListCell } from '@patternfly/react-core';\n\nexport const DataListCompact: React.FunctionComponent = () => (\n <DataList aria-label=\"Compact data list example\" isCompact>\n <DataListItem aria-labelledby=\"compact-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"compact-item1\">Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Secondary content</DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"compact-item2\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell isFilled={false} key=\"secondary content fill\">\n <span id=\"compact-item2\">Secondary content (pf-m-no-fill)</span>\n </DataListCell>,\n <DataListCell isFilled={false} alignRight key=\"secondary content align\">\n Secondary content (pf-m-align-right pf-m-no-fill)\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n);\n","title":"Compact","lang":"ts","className":""}}>
510
-
511
- </Example>,
512
- 'Plain': props =>
513
- <Example {...pageData} {...props} {...{"code":"import { DataList, DataListItem, DataListItemRow, DataListItemCells, DataListCell } from '@patternfly/react-core';\n\nexport const DataListPlain: React.FunctionComponent = () => (\n <DataList aria-label=\"Plain data list example\" isPlain>\n <DataListItem aria-labelledby=\"plain-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"plain-item1\">Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Secondary content</DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"plain-item2\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell isFilled={false} key=\"secondary content fill\">\n <span id=\"plain-item2\">Secondary content (pf-m-no-fill)</span>\n </DataListCell>,\n <DataListCell isFilled={false} alignRight key=\"secondary content align\">\n Secondary content (pf-m-align-right pf-m-no-fill)\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n);\n","title":"Plain","lang":"ts","className":""}}>
514
-
515
- </Example>,
516
- 'Checkboxes, actions and additional cells': props =>
517
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Button,\n DataList,\n DataListItem,\n DataListItemCells,\n DataListItemRow,\n DataListCell,\n DataListCheck,\n DataListAction,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\n\nexport const DataListCheckboxes: React.FunctionComponent = () => {\n const [isOpen1, setIsOpen1] = useState(false);\n const [isOpen2, setIsOpen2] = useState(false);\n const [isOpen3, setIsOpen3] = useState(false);\n\n const onToggle1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onSelect1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onToggle2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelect2 = () => {\n setIsOpen2(!isOpen2);\n };\n const onToggle3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n const onSelect3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n return (\n <DataList aria-label=\"Checkbox and action data list example\">\n <DataListItem aria-labelledby=\"check-action-item1\">\n <DataListItemRow>\n <DataListCheck id=\"check-item1\" aria-labelledby=\"check-action-item1\" name=\"check-action-check1\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"check-action-item1\">Primary content</span> Dolor sit amet, consectetur adipisicing elit, sed\n do eiusmod.\n </DataListCell>,\n <DataListCell key=\"secondary content 1\">\n Secondary content. Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Tertiary content</span> Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>,\n <DataListCell key=\"more content 1\">\n <span>More content</span> Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>,\n <DataListCell key=\"more content 2\">\n <span>More content</span> Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"check-action-item1 check-action-action1\"\n id=\"check-action-action1\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect1}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen1}\n onClick={onToggle1}\n variant=\"plain\"\n aria-label=\"Data list with checkboxes, actions and additional cells example kebab toggle 1\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen1}\n onOpenChange={(isOpen: boolean) => setIsOpen1(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"check-action-item2\">\n <DataListItemRow>\n <DataListCheck id=\"check-item2\" aria-labelledby=\"check-action-item2\" name=\"check-action-check2\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"check-action-item2\">Primary content - Lorem ipsum</span> dolor sit amet, consectetur\n adipisicing elit, sed do eiusmod.\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n Secondary content. Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>\n ]}\n />\n <DataListAction\n visibility={{ lg: 'hidden' }}\n aria-labelledby=\"check-action-item2 check-action-action2\"\n id=\"check-action-action2\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect2}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle2}\n variant=\"plain\"\n aria-label=\"Data list with checkboxes, actions and additional cells example kebab toggle 2\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen2}\n onOpenChange={(isOpen: boolean) => setIsOpen2(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action2\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link2\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action2\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link2\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n <DataListAction\n visibility={{ default: 'hidden', lg: 'visible' }}\n aria-labelledby=\"check-action-item2 check-action-action2a\"\n id=\"check-action-action2a\"\n aria-label=\"Actions\"\n >\n <Button variant=\"primary\">Primary</Button>\n <Button variant=\"secondary\">Secondary</Button>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"check-action-item3\">\n <DataListItemRow>\n <DataListCheck id=\"check-item3\" aria-labelledby=\"check-action-item3\" name=\"check-action-check3\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"check-action-item3\">Primary content - Lorem ipsum</span> dolor sit amet, consectetur\n adipisicing elit, sed do eiusmod.\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n Secondary content. Dolor sit amet, consectetur adipisicing elit, sed do eiusmod.\n </DataListCell>\n ]}\n />\n <DataListAction\n visibility={{ xl: 'hidden' }}\n aria-labelledby=\"check-action-item3 check-action-action3\"\n id=\"check-action-action3\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect3}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen3}\n onClick={onToggle3}\n variant=\"plain\"\n aria-label=\"Data list with checkboxes, actions and additional cells example kebab toggle 3\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen3}\n onOpenChange={(isOpen: boolean) => setIsOpen3(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action3\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link3\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action3\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link3\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n <DataListAction\n visibility={{ default: 'hidden', xl: 'visible' }}\n aria-labelledby=\"check-action-item3 check-action-action3a\"\n id=\"check-action-action3a\"\n aria-label=\"Actions\"\n >\n <Button variant=\"primary\">Primary</Button>\n <Button variant=\"secondary\">Secondary</Button>\n <Button variant=\"secondary\">Secondary</Button>\n <Button variant=\"secondary\">Secondary</Button>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n </DataList>\n );\n};\n","title":"Checkboxes, actions and additional cells","lang":"ts","className":""}}>
518
-
519
- </Example>,
520
- 'Actions: single and multiple': props =>
521
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport {\n Button,\n DataList,\n DataListItem,\n DataListCell,\n DataListItemRow,\n DataListItemCells,\n DataListAction,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\n\nexport const DataListActions: React.FunctionComponent = () => {\n const [isOpen, setIsOpen] = useState(false);\n const [isDeleted, setIsDeleted] = useState(false);\n\n const onToggle = () => {\n setIsOpen(!isOpen);\n };\n\n const onSelect = () => {\n setIsOpen(!isOpen);\n };\n\n return (\n <Fragment>\n <DataList aria-label=\"single action data list example \">\n {!isDeleted && (\n <DataListItem aria-labelledby=\"single-action-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"single-action-item1\">Single actionable Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Single actionable Secondary content</DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"single-action-item1 single-action-action1\"\n id=\"single-action-action1\"\n aria-label=\"Actions\"\n >\n <Button\n onClick={() => {\n if (confirm('Are you sure?')) {\n setIsDeleted(true);\n }\n }}\n variant=\"primary\"\n key=\"delete-action\"\n >\n Delete\n </Button>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n )}\n <DataListItem aria-labelledby=\"multi-actions-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"multi-actions-item1\">Multi actions Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Multi actions Secondary content</DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"multi-actions-item1 multi-actions-action1\"\n id=\"multi-actions-action1\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen}\n onClick={onToggle}\n variant=\"plain\"\n aria-label=\"Data list with actions example kebab toggle\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen}\n onOpenChange={(isOpen: boolean) => setIsOpen(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n </DataList>\n </Fragment>\n );\n};\n","title":"Actions: single and multiple","lang":"ts","className":""}}>
522
-
523
- </Example>,
524
- 'Expandable': props =>
525
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport {\n DataList,\n DataListItem,\n DataListItemRow,\n DataListCell,\n DataListAction,\n DataListToggle,\n DataListContent,\n DataListItemCells,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\n\nexport const DataListExpandable: React.FunctionComponent = () => {\n const [isOpen1, setIsOpen1] = useState(false);\n const [isOpen2, setIsOpen2] = useState(false);\n const [isOpen3, setIsOpen3] = useState(false);\n const [expanded, setExpanded] = useState(['ex-toggle1', 'ex-toggle3']);\n\n const onToggle1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onSelect1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onToggle2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelect2 = () => {\n setIsOpen2(!isOpen2);\n };\n const onToggle3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n const onSelect3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n const toggle = (id) => {\n const index = expanded.indexOf(id);\n const newExpanded =\n index >= 0 ? [...expanded.slice(0, index), ...expanded.slice(index + 1, expanded.length)] : [...expanded, id];\n setExpanded(newExpanded);\n };\n return (\n <Fragment>\n <DataList aria-label=\"Expandable data list example\">\n <DataListItem aria-labelledby=\"ex-item1\" isExpanded={expanded.includes('ex-toggle1')}>\n <DataListItemRow>\n <DataListToggle\n onClick={() => toggle('ex-toggle1')}\n isExpanded={expanded.includes('ex-toggle1')}\n id=\"ex-toggle1\"\n aria-controls=\"ex-expand1\"\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"primary content\">\n <div id=\"ex-item1\">Primary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n <a href=\"#\">link</a>\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"ex-item1 ex-action1\" id=\"ex-action1\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect1}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen1}\n onClick={onToggle1}\n variant=\"plain\"\n aria-label=\"Data list exapndable example kebaby toggle 1\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen1}\n onOpenChange={(isOpen: boolean) => setIsOpen1(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent\n aria-label=\"First expandable content details\"\n id=\"ex-expand1\"\n isHidden={!expanded.includes('ex-toggle1')}\n >\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n </p>\n </DataListContent>\n </DataListItem>\n <DataListItem aria-labelledby=\"ex-item2\" isExpanded={expanded.includes('ex-toggle2')}>\n <DataListItemRow>\n <DataListToggle\n onClick={() => toggle('ex-toggle2')}\n isExpanded={expanded.includes('ex-toggle2')}\n id=\"ex-toggle2\"\n aria-controls=\"ex-expand2\"\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <div id=\"ex-item2\">Secondary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content3\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"ex-item2 ex-action2\" id=\"ex-action2\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect2}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle2}\n variant=\"plain\"\n aria-label=\"Data list exapndable example kebaby toggle 2\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen2}\n onOpenChange={(isOpen: boolean) => setIsOpen2(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action2\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link2\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action2\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link2\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent\n aria-label=\"Second expandable content details\"\n id=\"ex-expand2\"\n isHidden={!expanded.includes('ex-toggle2')}\n >\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n </p>\n </DataListContent>\n </DataListItem>\n <DataListItem aria-labelledby=\"ex-item3\" isExpanded={expanded.includes('ex-toggle3')}>\n <DataListItemRow>\n <DataListToggle\n onClick={() => toggle('ex-toggle3')}\n isExpanded={expanded.includes('ex-toggle3')}\n id=\"ex-toggle3\"\n aria-controls=\"ex-expand3\"\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"tertiary content\">\n <div id=\"ex-item3\">Tertiary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <span>Lorem ipsum dolor sit amet.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"ex-item3 ex-action3\" id=\"ex-action3\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect3}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen3}\n onClick={onToggle3}\n variant=\"plain\"\n aria-label=\"Data list exapndable example kebaby toggle 3\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen3}\n onOpenChange={(isOpen: boolean) => setIsOpen3(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action3\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link3\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action3\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link3\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent\n aria-label=\"Third expandable content details\"\n id=\"ex-expand3\"\n isHidden={!expanded.includes('ex-toggle3')}\n hasNoPadding\n >\n This expanded section has no padding.\n </DataListContent>\n </DataListItem>\n </DataList>\n </Fragment>\n );\n};\n","title":"Expandable","lang":"ts","className":""}}>
526
-
527
- </Example>,
528
- 'Mixed expandable': props =>
529
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport {\n DataList,\n DataListItem,\n DataListItemRow,\n DataListCell,\n DataListAction,\n DataListToggle,\n DataListContent,\n DataListItemCells,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\nimport RhUiBranchFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-branch-fill-icon';\n\nexport const DataListMixedExpandable: React.FunctionComponent = () => {\n const [isOpen1, setIsOpen1] = useState(false);\n const [isOpen2, setIsOpen2] = useState(false);\n const [isOpen3, setIsOpen3] = useState(false);\n const [expanded, setExpanded] = useState(['m-ex-toggle1', 'm-ex-toggle3']);\n\n const onToggle1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onSelect1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onToggle2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelect2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onToggle3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n const onSelect3 = () => {\n setIsOpen3(!isOpen3);\n };\n\n const toggle = (id) => {\n const index = expanded.indexOf(id);\n const newExpanded =\n index >= 0 ? [...expanded.slice(0, index), ...expanded.slice(index + 1, expanded.length)] : [...expanded, id];\n setExpanded(newExpanded);\n };\n\n return (\n <Fragment>\n <DataList aria-label=\"Mixed expandable data list example\">\n <DataListItem aria-labelledby=\"m-ex-item1\" isExpanded={expanded.includes('m-ex-toggle1')}>\n <DataListItemRow>\n <DataListToggle\n onClick={() => toggle('m-ex-toggle1')}\n isExpanded={expanded.includes('m-ex-toggle1')}\n id=\"m-ex-toggle1\"\n aria-controls=\"m-ex-expand1\"\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"primary content\">\n <div id=\"m-ex-item1\">Primary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n <a href=\"#\">link</a>\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"m-ex-item1 m-ex-action1\" id=\"m-ex-action1\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect1}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen1}\n onClick={onToggle1}\n variant=\"plain\"\n aria-label=\"Data list mixed expandable example kebab toggle 1\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen1}\n onOpenChange={(isOpen: boolean) => setIsOpen1(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent\n aria-label=\"First mixed expandable content details\"\n id=\"m-ex-expand1\"\n isHidden={!expanded.includes('m-ex-toggle1')}\n >\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n </p>\n </DataListContent>\n </DataListItem>\n <DataListItem aria-labelledby=\"m-ex-item2\">\n <DataListItemRow>\n <DataListToggle\n id=\"m-ex-toggle2\"\n buttonProps={{\n disabled: true,\n 'aria-hidden': 'true',\n style: { visibility: 'hidden' }\n }}\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <div id=\"m-ex-item2\">Secondary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content3\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"m-ex-item2 m-ex-action2\" id=\"m-ex-action2\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect2}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle2}\n variant=\"plain\"\n aria-label=\"Data list mixed expandable example kebab toggle 2\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen2}\n onOpenChange={(isOpen: boolean) => setIsOpen2(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action2\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link2\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action2\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link2\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"m-ex-item3\" isExpanded={expanded.includes('m-ex-toggle3')}>\n <DataListItemRow>\n <DataListToggle\n onClick={() => toggle('m-ex-toggle3')}\n isExpanded={expanded.includes('m-ex-toggle3')}\n id=\"m-ex-toggle3\"\n aria-controls=\"m-ex-expand3\"\n />\n <DataListItemCells\n dataListCells={[\n <DataListCell isIcon key=\"icon\">\n <RhUiBranchFillIcon />\n </DataListCell>,\n <DataListCell key=\"tertiary content\">\n <div id=\"m-ex-item3\">Tertiary content</div>\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n <span>Lorem ipsum dolor sit amet.</span>\n </DataListCell>,\n <DataListCell key=\"secondary content 2\">\n <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>\n </DataListCell>\n ]}\n />\n <DataListAction aria-labelledby=\"m-ex-item3 m-ex-action3\" id=\"m-ex-action3\" aria-label=\"Actions\">\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect3}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen3}\n onClick={onToggle3}\n variant=\"plain\"\n aria-label=\"Data list mixed expandable example kebab toggle 3\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen3}\n onOpenChange={(isOpen: boolean) => setIsOpen3(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action3\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link3\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action3\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link3\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent\n aria-label=\"Third mixed expandable content details\"\n id=\"m-ex-expand3\"\n isHidden={!expanded.includes('m-ex-toggle3')}\n >\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n </p>\n </DataListContent>\n </DataListItem>\n </DataList>\n </Fragment>\n );\n};\n","title":"Mixed expandable","lang":"ts","className":""}}>
530
-
531
- </Example>,
532
- 'Width modifiers': props =>
533
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Content,\n DataList,\n DataListItem,\n DataListCell,\n DataListCheck,\n DataListAction,\n DataListToggle,\n DataListContent,\n DataListItemCells,\n DataListItemRow,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\n\nexport const DataListWidthModifiers: React.FunctionComponent = () => {\n const [show, setShow] = useState(true);\n const [isOpen1, setIsOpen1] = useState(false);\n const [isOpen2, setIsOpen2] = useState(false);\n\n const onToggle1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onSelect1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onToggle2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelect2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n return (\n <>\n <div key=\"example-1\">\n <Content>\n <h4>Default fitting - example 1</h4>\n </Content>\n <DataList aria-label=\"Width modifier data list example 1\">\n <DataListItem aria-labelledby=\"width-ex1-item1\">\n <DataListItemRow>\n <DataListCheck id=\"check-width-ex1-item1\" aria-labelledby=\"width-ex1-item1\" name=\"width-ex1-item1\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"default\">\n <b id=\"width-ex1-item1\">default</b>\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>\n </DataListCell>,\n <DataListCell key=\"default2\">\n <b>default</b>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua.\n </p>\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n </div>\n <div key=\"example-2\">\n <Content>\n <h4>Flex modifiers - example 2</h4>\n </Content>\n <DataList aria-label=\"Width modifier data list example 2\">\n <DataListItem aria-labelledby=\"width-ex2-item1\">\n <DataListItemRow>\n <DataListCheck id=\"check-width-ex2-item1\" aria-labelledby=\"width-ex2-item1\" name=\"width-ex2-item1\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell width={2} key=\"width 2\">\n <b id=\"width-ex2-item1\">width 2</b>\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</p>\n </DataListCell>,\n <DataListCell width={4} key=\"width 4\">\n <b>width 4</b>\n <p>Lorem ipsum dolor sit amet.</p>\n </DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"width-ex2-item1 width-ex2-action1\"\n id=\"width-ex2-action1\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect1}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen1}\n onClick={onToggle1}\n variant=\"plain\"\n aria-label=\"Data list width modifiers example kebab toggle 1\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen1}\n onOpenChange={(isOpen: boolean) => setIsOpen1(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem\n key=\"disabled link\"\n isDisabled\n to=\"#\"\n onClick={(event: any) => event.preventDefault()}\n >\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n </DataList>\n </div>\n <div key=\"example-3\">\n <Content>\n <h4>Flex modifiers - example 3</h4>\n </Content>\n <DataList aria-label=\"Width modifier data list example 3\">\n <DataListItem aria-labelledby=\"width-ex3-item1\" isExpanded={show}>\n <DataListItemRow>\n <DataListToggle\n isExpanded={show}\n id=\"width-ex3-toggle1\"\n aria-controls=\"width-ex3-expand1\"\n onClick={() => setShow(!show)}\n />\n <DataListCheck id=\"check-width-ex3-item1\" aria-labelledby=\"width-ex3-item1\" name=\"width-ex3-item1\" />\n <DataListItemCells\n dataListCells={[\n <DataListCell width={5} key=\"width 5\">\n <b id=\"width-ex3-item1\">width 5</b>\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>\n </DataListCell>,\n <DataListCell width={2} key=\"width 2\">\n <b>width 2</b>\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>\n </DataListCell>,\n <DataListCell key=\"default\">default</DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"width-ex3-item1 width-ex3-action1\"\n id=\"width-ex3-action1\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect2}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle2}\n variant=\"plain\"\n aria-label=\"Data list width modifiers example kebab toggle 2\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen2}\n onOpenChange={(isOpen: boolean) => setIsOpen2(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action2\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link2\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action2\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem\n key=\"disabled link2\"\n isDisabled\n to=\"#\"\n onClick={(event: any) => event.preventDefault()}\n >\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n <DataListContent aria-label=\"Primary Content Details\" id=\"width-ex3-expand1\" isHidden={!show}>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n </p>\n </DataListContent>\n </DataListItem>\n </DataList>\n </div>\n </>\n );\n};\n","title":"Width modifiers","lang":"ts","className":""}}>
534
-
535
- </Example>,
536
- 'Clickable rows': props =>
537
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport {\n DataList,\n DataListItem,\n DataListCell,\n DataListItemRow,\n DataListItemCells,\n DataListAction,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\n\nexport const DataListClickableRows: React.FunctionComponent = () => {\n const [isOpen1, setIsOpen1] = useState(false);\n const [isOpen2, setIsOpen2] = useState(false);\n const [selectedDataListItemId, setSelectedDataListItemId] = useState('');\n\n const onToggle1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onSelect1 = () => {\n setIsOpen1(!isOpen1);\n };\n\n const onToggle2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelect2 = () => {\n setIsOpen2(!isOpen2);\n };\n\n const onSelectDataListItem = (_event: React.MouseEvent | React.KeyboardEvent, id: string) => {\n setSelectedDataListItemId(id);\n };\n\n const handleInputChange = (_event: React.FormEvent<HTMLInputElement>, id: string) => {\n setSelectedDataListItemId(id);\n };\n\n return (\n <Fragment>\n <DataList\n aria-label=\"clickable data list example\"\n selectedDataListItemId={selectedDataListItemId}\n onSelectDataListItem={onSelectDataListItem}\n onSelectableRowChange={handleInputChange}\n >\n <DataListItem aria-labelledby=\"clickable-action-item1\" id=\"item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"clickable-action-item1\">Single actionable Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">Single actionable Secondary content</DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"clickable-action-item1 clickable-action-action1\"\n id=\"clickable-action-action1\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect1}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen1}\n onClick={onToggle1}\n variant=\"plain\"\n aria-label=\"Data list clickable rows example kebab toggle 1\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen1}\n onOpenChange={(isOpen: boolean) => setIsOpen1(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n <DataListItem aria-labelledby=\"clickable-actions-item2\" id=\"item2\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"clickable-actions-item2\">clickable actions Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">clickable actions Secondary content</DataListCell>\n ]}\n />\n <DataListAction\n aria-labelledby=\"clickable-actions-item2 clickable-actions-action2\"\n id=\"clickable-actions-action2\"\n aria-label=\"Actions\"\n >\n <Dropdown\n popperProps={{ position: 'right' }}\n onSelect={onSelect2}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle2}\n variant=\"plain\"\n aria-label=\"Data list clickable rows example kebab toggle 2\"\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n isOpen={isOpen2}\n onOpenChange={(isOpen: boolean) => setIsOpen2(isOpen)}\n >\n <DropdownList>\n <DropdownItem key=\"action2\">Action</DropdownItem>\n {/* Prevent default onClick functionality for example\n purposes */}\n <DropdownItem key=\"link2\" to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Link\n </DropdownItem>\n <DropdownItem key=\"disabled action2\" isDisabled>\n Disabled Action\n </DropdownItem>\n <DropdownItem key=\"disabled link2\" isDisabled to=\"#\" onClick={(event: any) => event.preventDefault()}>\n Disabled Link\n </DropdownItem>\n </DropdownList>\n </Dropdown>\n </DataListAction>\n </DataListItemRow>\n </DataListItem>\n </DataList>\n </Fragment>\n );\n};\n","title":"Clickable rows","lang":"ts","className":""}}>
538
-
539
- </Example>,
540
- 'Controlling text': props =>
541
- <Example {...pageData} {...props} {...{"code":"import {\n DataList,\n DataListItem,\n DataListItemRow,\n DataListItemCells,\n DataListCell,\n DataListWrapModifier\n} from '@patternfly/react-core';\n\nexport const DataListControllingText: React.FunctionComponent = () => (\n <DataList aria-label=\"Controlling text data list example\">\n <DataListItem aria-labelledby=\"controlling-text-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\" wrapModifier={DataListWrapModifier.breakWord}>\n <span id=\"controlling-text-item1\">Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\" wrapModifier={DataListWrapModifier.truncate}>\n Really really really really really really really really really really really really really really long\n description that should be truncated before it ends\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n);\n","title":"Controlling text","lang":"ts","className":""}}>
542
-
543
- </Example>,
544
- 'Draggable': props =>
545
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { DataList, DataListCell, DataListCheck, DataListControl, DataListItemCells } from '@patternfly/react-core';\nimport { DragDropSort, DraggableObject } from '@patternfly/react-drag-drop';\n\nconst getItems = (count: number): DraggableObject[] =>\n Array.from({ length: count }, (_, idx) => idx).map((idx) => ({\n id: `data-list-item-${idx}`,\n content: (\n <>\n <DataListControl>\n <DataListCheck id={`check-drag-${idx}`} aria-labelledby={`item-${idx}`} name={`item-${idx}`} otherControls />\n </DataListControl>\n <DataListItemCells\n dataListCells={[\n <DataListCell key={`item-${idx}`}>\n <span id={`item-${idx}`}>{`item-${idx}`}</span>\n </DataListCell>\n ]}\n />\n </>\n )\n }));\n\nexport const DataListDraggable: React.FunctionComponent = (props) => {\n const [items, setItems] = useState<DraggableObject[]>(getItems(10));\n\n return (\n <DragDropSort\n items={items}\n onDrop={(_, newItems) => {\n setItems(newItems);\n }}\n variant=\"DataList\"\n overlayProps={{ isCompact: true }}\n >\n <DataList aria-label=\"draggable data list example\" isCompact {...props} />\n </DragDropSort>\n );\n};\n","title":"Draggable","lang":"ts","className":""}}>
546
-
547
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
548
- {`To enable drag and drop, wrap the `}
549
-
550
- <code {...{"className":"ws-code "}}>
551
- {`<DataList>`}
552
- </code>
553
- {` component with `}
554
-
555
- <code {...{"className":"ws-code "}}>
556
- {`<DragDropSort>`}
557
- </code>
558
- {`, define the `}
559
-
560
- <code {...{"className":"ws-code "}}>
561
- {`variant`}
562
- </code>
563
- {` property as "DataList", and pass both the sortable items and `}
564
-
565
- <code {...{"className":"ws-code "}}>
566
- {`onDrop`}
567
- </code>
568
- {` callback to `}
569
-
570
- <code {...{"className":"ws-code "}}>
571
- {`<DragDropSort>`}
572
- </code>
573
- {`. `}
574
-
575
- <code {...{"className":"ws-code "}}>
576
- {`<DragDropSort>`}
577
- </code>
578
- {` will create the component's usual children internally based on the items property, so children should not be passed to the wrapped component.`}
579
- </p>
580
-
581
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
582
- {`Full drag and drop details can be found on the `}
583
-
584
- <PatternflyThemeLink {...{"to":"/components/drag-and-drop","className":""}}>
585
- {`drag and drop`}
586
- </PatternflyThemeLink>
587
- {` component page.`}
588
- </p>
589
- </Example>,
590
- 'Draggable with multiple drop zones': props =>
591
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n DataList,\n DataListCell,\n DataListCheck,\n DataListControl,\n DataListItemCells,\n Grid,\n GridItem\n} from '@patternfly/react-core';\nimport { DragDropContainer, DraggableObject, Droppable as NewDroppable } from '@patternfly/react-drag-drop';\n\nconst getItems = (from: number, count: number): DraggableObject[] =>\n Array.from({ length: count }, (_, idx) => from + idx).map((idx) => ({\n id: `data-list-item-${idx}`,\n content: (\n <>\n <DataListControl>\n <DataListCheck\n id={`check-dragdrop=${idx}`}\n aria-labelledby={`item-${idx}`}\n name={`item-${idx}`}\n otherControls\n />\n </DataListControl>\n <DataListItemCells\n dataListCells={[\n <DataListCell key={`item-${idx}`}>\n <span id={`item-${idx}`}>{`item-${idx}`}</span>\n </DataListCell>\n ]}\n />\n </>\n )\n }));\n\nexport const DataListDraggable: React.FunctionComponent = (props) => {\n const [items, setItems] = useState<Record<string, DraggableObject[]>>({\n group1: getItems(0, 5),\n group2: getItems(5, 5)\n });\n\n return (\n <DragDropContainer\n items={items}\n onDrop={(_, newItems) => {\n setItems(newItems);\n }}\n onContainerMove={(_, newItems) => {\n setItems(newItems);\n }}\n onCancel={(_, prevItems) => {\n setItems(prevItems);\n }}\n variant=\"DataList\"\n overlayProps={{ isCompact: true }}\n >\n <Grid hasGutter>\n <GridItem span={6}>\n <h1>group 1</h1>\n <NewDroppable\n id=\"group1\"\n items={items.group1}\n variant=\"DataList\"\n wrapper={<DataList aria-label=\"draggable data list example\" isCompact {...props} />}\n />\n </GridItem>\n <GridItem span={6}>\n <h1>group 2</h1>\n <NewDroppable\n id=\"group2\"\n items={items.group2}\n variant=\"DataList\"\n wrapper={<DataList aria-label=\"draggable data list example\" isCompact {...props} />}\n />\n </GridItem>\n </Grid>\n </DragDropContainer>\n );\n};\n","title":"Draggable with multiple drop zones","lang":"ts","className":""}}>
592
-
593
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
594
- {`To enable multiple drop zones, and create the desired amount of `}
595
-
596
- <code {...{"className":"ws-code "}}>
597
- {`<Droppable>`}
598
- </code>
599
- {` components within a `}
600
-
601
- <code {...{"className":"ws-code "}}>
602
- {`<DragDropContainer>`}
603
- </code>
604
- {`.`}
605
- </p>
606
-
607
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
608
- {`Each `}
609
-
610
- <code {...{"className":"ws-code "}}>
611
- {`<Droppable>`}
612
- </code>
613
- {` should define the `}
614
-
615
- <code {...{"className":"ws-code "}}>
616
- {`wrapper`}
617
- </code>
618
- {` property as the component that acts as the drop zone, `}
619
-
620
- <code {...{"className":"ws-code "}}>
621
- {`<DataList>`}
622
- </code>
623
- {`, and the `}
624
-
625
- <code {...{"className":"ws-code "}}>
626
- {`items`}
627
- </code>
628
- {` property of their respective draggable items as an array of `}
629
-
630
- <code {...{"className":"ws-code "}}>
631
- {`<DraggableObject>`}
632
- </code>
633
- {` data. `}
634
-
635
- <code {...{"className":"ws-code "}}>
636
- {`<DragDropContainer>`}
637
- </code>
638
- {` should be passed the `}
639
-
640
- <code {...{"className":"ws-code "}}>
641
- {`onDrop`}
642
- </code>
643
- {`, `}
644
-
645
- <code {...{"className":"ws-code "}}>
646
- {`onContainerMove`}
647
- </code>
648
- {`, and `}
649
-
650
- <code {...{"className":"ws-code "}}>
651
- {`onCancel`}
652
- </code>
653
- {` callbacks to handle items being dropped, items moving between droppable containers, and what happens if the drag is cancelled respectively. `}
654
-
655
- <code {...{"className":"ws-code "}}>
656
- {`<DragDropContainer>`}
657
- </code>
658
- {` should also be given a `}
659
-
660
- <code {...{"className":"ws-code "}}>
661
- {`Record`}
662
- </code>
663
- {` representing all sortable drop zones' items. Both components should define the `}
664
-
665
- <code {...{"className":"ws-code "}}>
666
- {`variant`}
667
- </code>
668
- {` property as "DataList".`}
669
- </p>
670
-
671
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
672
- {`Full drag and drop details can be found on the `}
673
-
674
- <PatternflyThemeLink {...{"to":"/components/drag-and-drop","className":""}}>
675
- {`drag and drop`}
676
- </PatternflyThemeLink>
677
- {` component page.`}
678
- </p>
679
- </Example>,
680
- 'Small grid breakpoint': props =>
681
- <Example {...pageData} {...props} {...{"code":"import { DataList, DataListItem, DataListItemRow, DataListItemCells, DataListCell } from '@patternfly/react-core';\n\nexport const DataListSmGridBreakpoint: React.FunctionComponent = () => (\n <DataList aria-label=\"Small grid breakpoint list example\" gridBreakpoint=\"sm\">\n <DataListItem aria-labelledby=\"sm-grid-item1\">\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key=\"primary content\">\n <span id=\"sm-grid-item1\">Primary content</span>\n </DataListCell>,\n <DataListCell key=\"secondary content\">\n Really really really really really really really really really really really really really really long\n description that should be truncated before it ends\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n </DataList>\n);\n","title":"Small grid breakpoint","lang":"ts","className":""}}>
682
-
683
- </Example>
684
- };
685
-
686
- const Component = () => (
687
- <React.Fragment>
688
- <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
689
- {`Examples`}
690
- </AutoLinkHeader>
691
- {React.createElement(pageData.examples["Basic"])}
692
- {React.createElement(pageData.examples["Compact"])}
693
- {React.createElement(pageData.examples["Plain"])}
694
- {React.createElement(pageData.examples["Checkboxes, actions and additional cells"])}
695
- {React.createElement(pageData.examples["Actions: single and multiple"])}
696
- {React.createElement(pageData.examples["Expandable"])}
697
- {React.createElement(pageData.examples["Mixed expandable"])}
698
- {React.createElement(pageData.examples["Width modifiers"])}
699
- {React.createElement(pageData.examples["Clickable rows"])}
700
- {React.createElement(pageData.examples["Controlling text"])}
701
- {React.createElement(pageData.examples["Draggable"])}
702
- {React.createElement(pageData.examples["Draggable with multiple drop zones"])}
703
- {React.createElement(pageData.examples["Small grid breakpoint"])}
704
- </React.Fragment>
705
- );
706
- Component.displayName = 'ComponentsDataListReactDocs';
707
- Component.pageData = pageData;
708
-
709
- export default Component;