@patternfly/react-core 4.198.12 → 4.198.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/esm/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/esm/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/esm/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +5 -2
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts +3 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +4 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Nav/NavGroup.d.ts +1 -1
- package/dist/esm/components/Nav/NavGroup.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavGroup.js +7 -2
- package/dist/esm/components/Nav/NavGroup.js.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.d.ts +3 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.d.ts.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.js +4 -3
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.d.ts +3 -1
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +4 -3
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabButton.d.ts +2 -0
- package/dist/esm/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabButton.js +2 -2
- package/dist/esm/components/Tabs/TabButton.js.map +1 -1
- package/dist/esm/components/Tile/Tile.d.ts.map +1 -1
- package/dist/esm/components/Tile/Tile.js +1 -1
- package/dist/esm/components/Tile/Tile.js.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts +3 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +4 -3
- package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.d.ts +2 -0
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.js +4 -3
- package/dist/esm/components/Toolbar/ToolbarChipGroupContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js +4 -3
- package/dist/esm/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarUtils.d.ts +1 -0
- package/dist/esm/components/Toolbar/ToolbarUtils.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarUtils.js.map +1 -1
- package/dist/js/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/js/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/js/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/js/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +5 -2
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts +3 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +4 -4
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Nav/NavGroup.d.ts +1 -1
- package/dist/js/components/Nav/NavGroup.d.ts.map +1 -1
- package/dist/js/components/Nav/NavGroup.js +7 -2
- package/dist/js/components/Nav/NavGroup.js.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawer.d.ts +3 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawer.d.ts.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawer.js +4 -4
- package/dist/js/components/NotificationDrawer/NotificationDrawer.js.map +1 -1
- package/dist/js/components/Tabs/Tab.d.ts +3 -1
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tab.js +4 -3
- package/dist/js/components/Tabs/Tab.js.map +1 -1
- package/dist/js/components/Tabs/TabButton.d.ts +2 -0
- package/dist/js/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabButton.js +2 -2
- package/dist/js/components/Tabs/TabButton.js.map +1 -1
- package/dist/js/components/Tile/Tile.d.ts.map +1 -1
- package/dist/js/components/Tile/Tile.js +1 -1
- package/dist/js/components/Tile/Tile.js.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts +3 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.js +4 -3
- package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.d.ts +2 -0
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.js +4 -3
- package/dist/js/components/Toolbar/ToolbarChipGroupContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js +4 -3
- package/dist/js/components/Toolbar/ToolbarExpandableContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarUtils.d.ts +1 -0
- package/dist/js/components/Toolbar/ToolbarUtils.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarUtils.js.map +1 -1
- package/dist/umd/react-core.js +38 -25
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Form/FormFieldGroup.tsx +1 -1
- package/src/components/Form/FormFieldGroupExpandable.tsx +2 -2
- package/src/components/Form/FormFieldGroupHeader.tsx +5 -1
- package/src/components/Form/InternalFormFieldGroup.tsx +2 -2
- package/src/components/Form/__tests__/FormFieldGroup.test.tsx +1 -1
- package/src/components/Form/__tests__/__snapshots__/FormFieldGroup.test.tsx.snap +1 -1
- package/src/components/Form/examples/Form.md +1 -1
- package/src/components/Label/Label.tsx +5 -2
- package/src/components/Menu/MenuItem.tsx +9 -1
- package/src/components/Menu/examples/Menu.md +57 -32
- package/src/components/Nav/NavGroup.tsx +20 -9
- package/src/components/Nav/examples/Nav.md +2 -0
- package/src/components/NotificationDrawer/NotificationDrawer.tsx +8 -2
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap +1 -1
- package/src/components/Tabs/Tab.tsx +31 -24
- package/src/components/Tabs/TabButton.tsx +5 -1
- package/src/components/Tabs/examples/Tabs.md +527 -256
- package/src/components/Tile/Tile.tsx +3 -0
- package/src/components/Tile/__tests__/__snapshots__/Tile.test.tsx.snap +9 -0
- package/src/components/Tile/examples/Tile.md +41 -39
- package/src/components/Toolbar/Toolbar.tsx +7 -2
- package/src/components/Toolbar/ToolbarChipGroupContent.tsx +5 -1
- package/src/components/Toolbar/ToolbarExpandableContent.tsx +3 -2
- package/src/components/Toolbar/ToolbarUtils.tsx +1 -0
- package/src/components/Toolbar/__tests__/ToolbarToggleGroup.test.tsx +71 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarToggleGroup.test.tsx.snap +394 -0
- package/src/components/Toolbar/examples/Toolbar.md +8 -1
- package/src/components/Toolbar/examples/ToolbarCustomChipGroupContent.tsx +166 -0
- package/src/demos/Nav.md +7 -3
- package/src/demos/NotificationDrawer/NotificationDrawer.md +31 -4
- package/src/demos/Page/Page.md +7 -3
- package/src/demos/TileDemo.md +17 -35
- package/src/demos/examples/DashboardHeader.js +2 -1
|
@@ -55,6 +55,400 @@ exports[`Toolbar should render inset 1`] = `
|
|
|
55
55
|
</div>
|
|
56
56
|
`;
|
|
57
57
|
|
|
58
|
+
exports[`Toolbar should render with custom chip content 1`] = `
|
|
59
|
+
<div>
|
|
60
|
+
<div
|
|
61
|
+
class="pf-c-toolbar pf-m-toggle-group-container"
|
|
62
|
+
data-ouia-component-id="OUIA-Generated-Toolbar-3"
|
|
63
|
+
data-ouia-component-type="PF4/Toolbar"
|
|
64
|
+
data-ouia-safe="true"
|
|
65
|
+
id="toolbar-with-filter"
|
|
66
|
+
>
|
|
67
|
+
<div
|
|
68
|
+
class="pf-c-toolbar__content"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
class="pf-c-toolbar__content-section"
|
|
72
|
+
>
|
|
73
|
+
<div
|
|
74
|
+
class="pf-c-toolbar__group pf-m-toggle-group pf-m-show-on-xl"
|
|
75
|
+
>
|
|
76
|
+
<div
|
|
77
|
+
class="pf-c-toolbar__toggle"
|
|
78
|
+
>
|
|
79
|
+
<button
|
|
80
|
+
aria-controls="toolbar-with-filter-expandable-content-3"
|
|
81
|
+
aria-disabled="false"
|
|
82
|
+
aria-haspopup="false"
|
|
83
|
+
aria-label="Show Filters"
|
|
84
|
+
class="pf-c-button pf-m-plain"
|
|
85
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
86
|
+
data-ouia-component-type="PF4/Button"
|
|
87
|
+
data-ouia-safe="true"
|
|
88
|
+
type="button"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
<div
|
|
92
|
+
class="pf-c-toolbar__group pf-m-filter-group"
|
|
93
|
+
>
|
|
94
|
+
<div
|
|
95
|
+
class="pf-c-toolbar__item"
|
|
96
|
+
>
|
|
97
|
+
<div
|
|
98
|
+
class="pf-c-select pf-m-expanded"
|
|
99
|
+
data-ouia-component-id="OUIA-Generated-Select-checkbox-2"
|
|
100
|
+
data-ouia-component-type="PF4/Select"
|
|
101
|
+
data-ouia-safe="true"
|
|
102
|
+
>
|
|
103
|
+
<button
|
|
104
|
+
aria-expanded="true"
|
|
105
|
+
aria-label="Options menu"
|
|
106
|
+
aria-labelledby=" pf-select-toggle-id-1"
|
|
107
|
+
class="pf-c-select__toggle"
|
|
108
|
+
id="pf-select-toggle-id-1"
|
|
109
|
+
type="button"
|
|
110
|
+
>
|
|
111
|
+
<div
|
|
112
|
+
class="pf-c-select__toggle-wrapper"
|
|
113
|
+
>
|
|
114
|
+
<span
|
|
115
|
+
class="pf-c-select__toggle-text"
|
|
116
|
+
>
|
|
117
|
+
Status
|
|
118
|
+
</span>
|
|
119
|
+
<div
|
|
120
|
+
class="pf-c-select__toggle-badge"
|
|
121
|
+
>
|
|
122
|
+
<span
|
|
123
|
+
class="pf-c-badge pf-m-read"
|
|
124
|
+
>
|
|
125
|
+
2
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<span
|
|
130
|
+
class="pf-c-select__toggle-arrow"
|
|
131
|
+
>
|
|
132
|
+
<svg
|
|
133
|
+
aria-hidden="true"
|
|
134
|
+
fill="currentColor"
|
|
135
|
+
height="1em"
|
|
136
|
+
role="img"
|
|
137
|
+
style="vertical-align: -0.125em;"
|
|
138
|
+
viewBox="0 0 320 512"
|
|
139
|
+
width="1em"
|
|
140
|
+
>
|
|
141
|
+
<path
|
|
142
|
+
d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
|
|
143
|
+
/>
|
|
144
|
+
</svg>
|
|
145
|
+
</span>
|
|
146
|
+
</button>
|
|
147
|
+
<ul
|
|
148
|
+
aria-label="Status"
|
|
149
|
+
class="pf-c-select__menu"
|
|
150
|
+
role="listbox"
|
|
151
|
+
>
|
|
152
|
+
<label
|
|
153
|
+
class="pf-c-check pf-c-select__menu-item"
|
|
154
|
+
>
|
|
155
|
+
<input
|
|
156
|
+
checked=""
|
|
157
|
+
class="pf-c-check__input"
|
|
158
|
+
id="pf-random-id-1-New"
|
|
159
|
+
type="checkbox"
|
|
160
|
+
/>
|
|
161
|
+
<span
|
|
162
|
+
class="pf-c-check__label"
|
|
163
|
+
>
|
|
164
|
+
New
|
|
165
|
+
</span>
|
|
166
|
+
</label>
|
|
167
|
+
<label
|
|
168
|
+
class="pf-c-check pf-c-select__menu-item"
|
|
169
|
+
>
|
|
170
|
+
<input
|
|
171
|
+
checked=""
|
|
172
|
+
class="pf-c-check__input"
|
|
173
|
+
id="pf-random-id-1-Pending"
|
|
174
|
+
type="checkbox"
|
|
175
|
+
/>
|
|
176
|
+
<span
|
|
177
|
+
class="pf-c-check__label"
|
|
178
|
+
>
|
|
179
|
+
Pending
|
|
180
|
+
</span>
|
|
181
|
+
</label>
|
|
182
|
+
<label
|
|
183
|
+
class="pf-c-check pf-c-select__menu-item"
|
|
184
|
+
>
|
|
185
|
+
<input
|
|
186
|
+
class="pf-c-check__input"
|
|
187
|
+
id="pf-random-id-1-Running"
|
|
188
|
+
type="checkbox"
|
|
189
|
+
/>
|
|
190
|
+
<span
|
|
191
|
+
class="pf-c-check__label"
|
|
192
|
+
>
|
|
193
|
+
Running
|
|
194
|
+
</span>
|
|
195
|
+
</label>
|
|
196
|
+
<label
|
|
197
|
+
class="pf-c-check pf-c-select__menu-item"
|
|
198
|
+
>
|
|
199
|
+
<input
|
|
200
|
+
class="pf-c-check__input"
|
|
201
|
+
id="pf-random-id-1-Cancelled"
|
|
202
|
+
type="checkbox"
|
|
203
|
+
/>
|
|
204
|
+
<span
|
|
205
|
+
class="pf-c-check__label"
|
|
206
|
+
>
|
|
207
|
+
Cancelled
|
|
208
|
+
</span>
|
|
209
|
+
</label>
|
|
210
|
+
</ul>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div
|
|
217
|
+
class="pf-c-toolbar__expandable-content"
|
|
218
|
+
id="toolbar-with-filter-expandable-content-3"
|
|
219
|
+
>
|
|
220
|
+
<div
|
|
221
|
+
class="pf-c-toolbar__group"
|
|
222
|
+
/>
|
|
223
|
+
<div
|
|
224
|
+
class="pf-c-toolbar__group pf-m-chip-container"
|
|
225
|
+
>
|
|
226
|
+
<div
|
|
227
|
+
class="pf-c-toolbar__group"
|
|
228
|
+
/>
|
|
229
|
+
<div
|
|
230
|
+
class="pf-c-toolbar__item"
|
|
231
|
+
>
|
|
232
|
+
<button
|
|
233
|
+
aria-disabled="false"
|
|
234
|
+
class="pf-c-button pf-m-link pf-m-inline"
|
|
235
|
+
data-ouia-component-id="OUIA-Generated-Button-link-3"
|
|
236
|
+
data-ouia-component-type="PF4/Button"
|
|
237
|
+
data-ouia-safe="true"
|
|
238
|
+
type="button"
|
|
239
|
+
>
|
|
240
|
+
Save filters
|
|
241
|
+
</button>
|
|
242
|
+
</div>
|
|
243
|
+
<div
|
|
244
|
+
class="pf-c-toolbar__item"
|
|
245
|
+
>
|
|
246
|
+
<button
|
|
247
|
+
aria-disabled="false"
|
|
248
|
+
class="pf-c-button pf-m-link pf-m-inline"
|
|
249
|
+
data-ouia-component-id="OUIA-Generated-Button-link-4"
|
|
250
|
+
data-ouia-component-type="PF4/Button"
|
|
251
|
+
data-ouia-safe="true"
|
|
252
|
+
type="button"
|
|
253
|
+
>
|
|
254
|
+
Clear all filters
|
|
255
|
+
</button>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
<div
|
|
261
|
+
class="pf-c-toolbar__content"
|
|
262
|
+
>
|
|
263
|
+
<div
|
|
264
|
+
aria-hidden="true"
|
|
265
|
+
class="pf-c-toolbar__group pf-m-hidden"
|
|
266
|
+
hidden=""
|
|
267
|
+
>
|
|
268
|
+
<div
|
|
269
|
+
class="pf-c-toolbar__item pf-m-chip-group"
|
|
270
|
+
>
|
|
271
|
+
<div
|
|
272
|
+
aria-labelledby="pf-random-id-2"
|
|
273
|
+
class="pf-c-chip-group pf-m-category"
|
|
274
|
+
data-ouia-component-type="PF4/ChipGroup"
|
|
275
|
+
data-ouia-safe="true"
|
|
276
|
+
role="group"
|
|
277
|
+
>
|
|
278
|
+
<div
|
|
279
|
+
class="pf-c-chip-group__main"
|
|
280
|
+
>
|
|
281
|
+
<span
|
|
282
|
+
class="pf-c-chip-group__label"
|
|
283
|
+
id="pf-random-id-2"
|
|
284
|
+
>
|
|
285
|
+
Status
|
|
286
|
+
</span>
|
|
287
|
+
<ul
|
|
288
|
+
aria-labelledby="pf-random-id-2"
|
|
289
|
+
class="pf-c-chip-group__list"
|
|
290
|
+
role="list"
|
|
291
|
+
>
|
|
292
|
+
<li
|
|
293
|
+
class="pf-c-chip-group__list-item"
|
|
294
|
+
>
|
|
295
|
+
<div
|
|
296
|
+
class="pf-c-chip"
|
|
297
|
+
data-ouia-component-id="OUIA-Generated-Chip-1"
|
|
298
|
+
data-ouia-component-type="PF4/Chip"
|
|
299
|
+
data-ouia-safe="true"
|
|
300
|
+
>
|
|
301
|
+
<span
|
|
302
|
+
class="pf-c-chip__text"
|
|
303
|
+
id="pf-random-id-3"
|
|
304
|
+
>
|
|
305
|
+
New
|
|
306
|
+
</span>
|
|
307
|
+
<button
|
|
308
|
+
aria-disabled="false"
|
|
309
|
+
aria-label="close"
|
|
310
|
+
aria-labelledby="remove_pf-random-id-3 pf-random-id-3"
|
|
311
|
+
class="pf-c-button pf-m-plain"
|
|
312
|
+
data-ouia-component-id="close"
|
|
313
|
+
data-ouia-component-type="PF4/Button"
|
|
314
|
+
data-ouia-safe="true"
|
|
315
|
+
id="remove_pf-random-id-3"
|
|
316
|
+
type="button"
|
|
317
|
+
>
|
|
318
|
+
<svg
|
|
319
|
+
aria-hidden="true"
|
|
320
|
+
fill="currentColor"
|
|
321
|
+
height="1em"
|
|
322
|
+
role="img"
|
|
323
|
+
style="vertical-align: -0.125em;"
|
|
324
|
+
viewBox="0 0 352 512"
|
|
325
|
+
width="1em"
|
|
326
|
+
>
|
|
327
|
+
<path
|
|
328
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
329
|
+
/>
|
|
330
|
+
</svg>
|
|
331
|
+
</button>
|
|
332
|
+
</div>
|
|
333
|
+
</li>
|
|
334
|
+
<li
|
|
335
|
+
class="pf-c-chip-group__list-item"
|
|
336
|
+
>
|
|
337
|
+
<div
|
|
338
|
+
class="pf-c-chip"
|
|
339
|
+
data-ouia-component-id="OUIA-Generated-Chip-2"
|
|
340
|
+
data-ouia-component-type="PF4/Chip"
|
|
341
|
+
data-ouia-safe="true"
|
|
342
|
+
>
|
|
343
|
+
<span
|
|
344
|
+
class="pf-c-chip__text"
|
|
345
|
+
id="pf-random-id-4"
|
|
346
|
+
>
|
|
347
|
+
Pending
|
|
348
|
+
</span>
|
|
349
|
+
<button
|
|
350
|
+
aria-disabled="false"
|
|
351
|
+
aria-label="close"
|
|
352
|
+
aria-labelledby="remove_pf-random-id-4 pf-random-id-4"
|
|
353
|
+
class="pf-c-button pf-m-plain"
|
|
354
|
+
data-ouia-component-id="close"
|
|
355
|
+
data-ouia-component-type="PF4/Button"
|
|
356
|
+
data-ouia-safe="true"
|
|
357
|
+
id="remove_pf-random-id-4"
|
|
358
|
+
type="button"
|
|
359
|
+
>
|
|
360
|
+
<svg
|
|
361
|
+
aria-hidden="true"
|
|
362
|
+
fill="currentColor"
|
|
363
|
+
height="1em"
|
|
364
|
+
role="img"
|
|
365
|
+
style="vertical-align: -0.125em;"
|
|
366
|
+
viewBox="0 0 352 512"
|
|
367
|
+
width="1em"
|
|
368
|
+
>
|
|
369
|
+
<path
|
|
370
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
371
|
+
/>
|
|
372
|
+
</svg>
|
|
373
|
+
</button>
|
|
374
|
+
</div>
|
|
375
|
+
</li>
|
|
376
|
+
</ul>
|
|
377
|
+
</div>
|
|
378
|
+
<div
|
|
379
|
+
class="pf-c-chip-group__close"
|
|
380
|
+
>
|
|
381
|
+
<button
|
|
382
|
+
aria-disabled="false"
|
|
383
|
+
aria-label="Close chip group"
|
|
384
|
+
aria-labelledby="remove_group_pf-random-id-2 pf-random-id-2"
|
|
385
|
+
class="pf-c-button pf-m-plain"
|
|
386
|
+
data-ouia-component-id="Close chip group"
|
|
387
|
+
data-ouia-component-type="PF4/Button"
|
|
388
|
+
data-ouia-safe="true"
|
|
389
|
+
id="remove_group_pf-random-id-2"
|
|
390
|
+
type="button"
|
|
391
|
+
>
|
|
392
|
+
<svg
|
|
393
|
+
aria-hidden="true"
|
|
394
|
+
fill="currentColor"
|
|
395
|
+
height="1em"
|
|
396
|
+
role="img"
|
|
397
|
+
style="vertical-align: -0.125em;"
|
|
398
|
+
viewBox="0 0 512 512"
|
|
399
|
+
width="1em"
|
|
400
|
+
>
|
|
401
|
+
<path
|
|
402
|
+
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"
|
|
403
|
+
/>
|
|
404
|
+
</svg>
|
|
405
|
+
</button>
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
<div
|
|
411
|
+
class="pf-c-toolbar__group"
|
|
412
|
+
>
|
|
413
|
+
<div
|
|
414
|
+
class="pf-c-toolbar__item"
|
|
415
|
+
>
|
|
416
|
+
2 filters applied
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
<div
|
|
420
|
+
class="pf-c-toolbar__item"
|
|
421
|
+
>
|
|
422
|
+
<button
|
|
423
|
+
aria-disabled="false"
|
|
424
|
+
class="pf-c-button pf-m-link pf-m-inline"
|
|
425
|
+
data-ouia-component-id="OUIA-Generated-Button-link-1"
|
|
426
|
+
data-ouia-component-type="PF4/Button"
|
|
427
|
+
data-ouia-safe="true"
|
|
428
|
+
type="button"
|
|
429
|
+
>
|
|
430
|
+
Save filters
|
|
431
|
+
</button>
|
|
432
|
+
</div>
|
|
433
|
+
<div
|
|
434
|
+
class="pf-c-toolbar__item"
|
|
435
|
+
>
|
|
436
|
+
<button
|
|
437
|
+
aria-disabled="false"
|
|
438
|
+
class="pf-c-button pf-m-link pf-m-inline"
|
|
439
|
+
data-ouia-component-id="OUIA-Generated-Button-link-2"
|
|
440
|
+
data-ouia-component-type="PF4/Button"
|
|
441
|
+
data-ouia-safe="true"
|
|
442
|
+
type="button"
|
|
443
|
+
>
|
|
444
|
+
Clear all filters
|
|
445
|
+
</button>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
</div>
|
|
450
|
+
`;
|
|
451
|
+
|
|
58
452
|
exports[`Toolbar should render with page inset flag 1`] = `
|
|
59
453
|
<div>
|
|
60
454
|
<div
|
|
@@ -253,7 +253,7 @@ const ToolbarItems = () => {
|
|
|
253
253
|
const [isSticky, setIsSticky] = React.useState(true);
|
|
254
254
|
const [showEvenOnly, setShowEvenOnly] = React.useState(true);
|
|
255
255
|
const array = [...Array(30).keys()];
|
|
256
|
-
const numbers = showEvenOnly ?
|
|
256
|
+
const numbers = showEvenOnly ? array.filter(number => number % 2 === 0) : array;
|
|
257
257
|
|
|
258
258
|
return (
|
|
259
259
|
<React.Fragment>
|
|
@@ -1087,6 +1087,13 @@ class ToolbarWithFilterExample extends React.Component {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
```
|
|
1089
1089
|
|
|
1090
|
+
### With custom chip group content
|
|
1091
|
+
|
|
1092
|
+
The chip groups generated by toolbar filters may be further customized through the `customChipGroupContent` property, which will append to the filter chip groups. This property will remove the default `Clear all filters` button.
|
|
1093
|
+
|
|
1094
|
+
```ts file="./ToolbarCustomChipGroupContent.tsx"
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1090
1097
|
### Stacked example
|
|
1091
1098
|
|
|
1092
1099
|
There may be situations where all of the required elements simply cannot fit in a single line.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Toolbar,
|
|
4
|
+
ToolbarItem,
|
|
5
|
+
ToolbarContent,
|
|
6
|
+
ToolbarFilter,
|
|
7
|
+
ToolbarToggleGroup,
|
|
8
|
+
ToolbarGroup,
|
|
9
|
+
Button,
|
|
10
|
+
Select,
|
|
11
|
+
SelectOption,
|
|
12
|
+
SelectVariant
|
|
13
|
+
} from '@patternfly/react-core';
|
|
14
|
+
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
15
|
+
import EditIcon from '@patternfly/react-icons/dist/esm/icons/edit-icon';
|
|
16
|
+
import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
|
|
17
|
+
import SyncIcon from '@patternfly/react-icons/dist/esm/icons/sync-icon';
|
|
18
|
+
|
|
19
|
+
export const ToolbarCustomChipGroupContent: React.FunctionComponent = () => {
|
|
20
|
+
const [statusIsExpanded, setStatusIsExpanded] = React.useState<boolean>(false);
|
|
21
|
+
const [riskIsExpanded, setRiskIsExpanded] = React.useState<boolean>(false);
|
|
22
|
+
const [filters, setFilters] = React.useState({
|
|
23
|
+
risk: ['Low'],
|
|
24
|
+
status: ['New', 'Pending']
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const onDelete = (type: string, id: string) => {
|
|
28
|
+
if (type === 'Risk') {
|
|
29
|
+
setFilters({ risk: filters.risk.filter((fil: string) => fil !== id), status: filters.status });
|
|
30
|
+
} else if (type === 'Status') {
|
|
31
|
+
setFilters({ risk: filters.risk, status: filters.status.filter((fil: string) => fil !== id) });
|
|
32
|
+
} else {
|
|
33
|
+
setFilters({ risk: [], status: [] });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const onDeleteGroup = (type: string) => {
|
|
38
|
+
if (type === 'Risk') {
|
|
39
|
+
setFilters({ risk: [], status: filters.status });
|
|
40
|
+
} else if (type === 'Status') {
|
|
41
|
+
setFilters({ risk: filters.risk, status: [] });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const onSelect = (type: 'Risk' | 'Status', event: React.MouseEvent | React.ChangeEvent, selection: string) => {
|
|
46
|
+
const checked = (event.target as any).checked;
|
|
47
|
+
if (type === 'Risk') {
|
|
48
|
+
setFilters({
|
|
49
|
+
risk: checked ? [...filters.risk, selection] : filters.risk.filter((fil: string) => fil !== selection),
|
|
50
|
+
status: filters.status
|
|
51
|
+
});
|
|
52
|
+
} else if (type === 'Status') {
|
|
53
|
+
setFilters({
|
|
54
|
+
risk: filters.risk,
|
|
55
|
+
status: checked ? [...filters.status, selection] : filters.status.filter((fil: string) => fil !== selection)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const statusMenuItems = [
|
|
61
|
+
<SelectOption key="statusNew" value="New" />,
|
|
62
|
+
<SelectOption key="statusPending" value="Pending" />,
|
|
63
|
+
<SelectOption key="statusRunning" value="Running" />,
|
|
64
|
+
<SelectOption key="statusCancelled" value="Cancelled" />
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const riskMenuItems = [
|
|
68
|
+
<SelectOption key="riskLow" value="Low" />,
|
|
69
|
+
<SelectOption key="riskMedium" value="Medium" />,
|
|
70
|
+
<SelectOption key="riskHigh" value="High" />
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const toggleGroupItems = (
|
|
74
|
+
<React.Fragment>
|
|
75
|
+
<ToolbarGroup variant="filter-group">
|
|
76
|
+
<ToolbarFilter
|
|
77
|
+
chips={filters.status}
|
|
78
|
+
deleteChip={(category, chip) => onDelete(category as string, chip as string)}
|
|
79
|
+
deleteChipGroup={category => onDeleteGroup(category as string)}
|
|
80
|
+
categoryName="Status"
|
|
81
|
+
>
|
|
82
|
+
<Select
|
|
83
|
+
variant={SelectVariant.checkbox}
|
|
84
|
+
aria-label="Status"
|
|
85
|
+
onToggle={(isExpanded: boolean) => setStatusIsExpanded(isExpanded)}
|
|
86
|
+
onSelect={(event, selection) => onSelect('Status', event, selection as string)}
|
|
87
|
+
selections={filters.status}
|
|
88
|
+
isOpen={statusIsExpanded}
|
|
89
|
+
placeholderText="Status"
|
|
90
|
+
>
|
|
91
|
+
{statusMenuItems}
|
|
92
|
+
</Select>
|
|
93
|
+
</ToolbarFilter>
|
|
94
|
+
<ToolbarFilter
|
|
95
|
+
chips={filters.risk}
|
|
96
|
+
deleteChip={(category, chip) => onDelete(category as string, chip as string)}
|
|
97
|
+
deleteChipGroup={category => onDeleteGroup(category as string)}
|
|
98
|
+
categoryName="Risk"
|
|
99
|
+
>
|
|
100
|
+
<Select
|
|
101
|
+
variant={SelectVariant.checkbox}
|
|
102
|
+
aria-label="Risk"
|
|
103
|
+
onToggle={(isExpanded: boolean) => setRiskIsExpanded(isExpanded)}
|
|
104
|
+
onSelect={(event, selection) => onSelect('Risk', event, selection as string)}
|
|
105
|
+
selections={filters.risk}
|
|
106
|
+
isOpen={riskIsExpanded}
|
|
107
|
+
placeholderText="Risk"
|
|
108
|
+
>
|
|
109
|
+
{riskMenuItems}
|
|
110
|
+
</Select>
|
|
111
|
+
</ToolbarFilter>
|
|
112
|
+
</ToolbarGroup>
|
|
113
|
+
</React.Fragment>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const toolbarItems = (
|
|
117
|
+
<React.Fragment>
|
|
118
|
+
<ToolbarToggleGroup toggleIcon={<FilterIcon />} breakpoint="xl">
|
|
119
|
+
{toggleGroupItems}
|
|
120
|
+
</ToolbarToggleGroup>
|
|
121
|
+
<ToolbarGroup variant="icon-button-group">
|
|
122
|
+
<ToolbarItem>
|
|
123
|
+
<Button variant="plain" aria-label="edit">
|
|
124
|
+
<EditIcon />
|
|
125
|
+
</Button>
|
|
126
|
+
</ToolbarItem>
|
|
127
|
+
<ToolbarItem>
|
|
128
|
+
<Button variant="plain" aria-label="clone">
|
|
129
|
+
<CloneIcon />
|
|
130
|
+
</Button>
|
|
131
|
+
</ToolbarItem>
|
|
132
|
+
<ToolbarItem>
|
|
133
|
+
<Button variant="plain" aria-label="sync">
|
|
134
|
+
<SyncIcon />
|
|
135
|
+
</Button>
|
|
136
|
+
</ToolbarItem>
|
|
137
|
+
</ToolbarGroup>
|
|
138
|
+
</React.Fragment>
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
const customChipGroupContent = (
|
|
142
|
+
<React.Fragment>
|
|
143
|
+
<ToolbarItem>
|
|
144
|
+
<Button variant="link" onClick={() => {}} isInline>
|
|
145
|
+
Save filters
|
|
146
|
+
</Button>
|
|
147
|
+
</ToolbarItem>
|
|
148
|
+
<ToolbarItem>
|
|
149
|
+
<Button variant="link" onClick={() => onDelete('', '')} isInline>
|
|
150
|
+
Clear all filters
|
|
151
|
+
</Button>
|
|
152
|
+
</ToolbarItem>
|
|
153
|
+
</React.Fragment>
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<Toolbar
|
|
158
|
+
id="toolbar-with-filter"
|
|
159
|
+
className="pf-m-toggle-group-container"
|
|
160
|
+
collapseListedFiltersBreakpoint="xl"
|
|
161
|
+
customChipGroupContent={customChipGroupContent}
|
|
162
|
+
>
|
|
163
|
+
<ToolbarContent>{toolbarItems}</ToolbarContent>
|
|
164
|
+
</Toolbar>
|
|
165
|
+
);
|
|
166
|
+
};
|
package/src/demos/Nav.md
CHANGED
|
@@ -7,6 +7,7 @@ import { DashboardBreadcrumb } from './examples/DashboardWrapper';
|
|
|
7
7
|
import DashboardHeader from './examples/DashboardHeader';
|
|
8
8
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
9
9
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
10
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
10
11
|
import imgBrand from '@patternfly/react-core/src/components/Brand/examples/pfLogo.svg';
|
|
11
12
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
12
13
|
import imgColorBrand from '@patternfly/react-core/src/demos/examples/pfColorLogo.svg';
|
|
@@ -382,6 +383,7 @@ import {
|
|
|
382
383
|
import { DashboardBreadcrumb } from './examples/DashboardWrapper';
|
|
383
384
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
384
385
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
386
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
385
387
|
import imgBrand from '@patternfly/react-core/src/components/Brand/examples/pfLogo.svg';
|
|
386
388
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
387
389
|
|
|
@@ -481,7 +483,7 @@ class PageLayoutHorizontalNav extends React.Component {
|
|
|
481
483
|
</PageHeaderToolsItem>
|
|
482
484
|
<PageHeaderToolsItem>
|
|
483
485
|
<Button aria-label="Help actions" variant={ButtonVariant.plain}>
|
|
484
|
-
<
|
|
486
|
+
<QuestionCircleIcon />
|
|
485
487
|
</Button>
|
|
486
488
|
</PageHeaderToolsItem>
|
|
487
489
|
</PageHeaderToolsGroup>
|
|
@@ -738,6 +740,7 @@ import {
|
|
|
738
740
|
import { DashboardBreadcrumb } from './examples/DashboardWrapper';
|
|
739
741
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
740
742
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
743
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
741
744
|
import imgColorBrand from '@patternfly/react-core/src/demos/examples/pfColorLogo.svg';
|
|
742
745
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
743
746
|
|
|
@@ -850,7 +853,7 @@ class HorizontalNavWithSubnav extends React.Component {
|
|
|
850
853
|
</PageHeaderToolsItem>
|
|
851
854
|
<PageHeaderToolsItem>
|
|
852
855
|
<Button aria-label="Help actions" variant={ButtonVariant.plain}>
|
|
853
|
-
<
|
|
856
|
+
<QuestionCircleIcon />
|
|
854
857
|
</Button>
|
|
855
858
|
</PageHeaderToolsItem>
|
|
856
859
|
</PageHeaderToolsGroup>
|
|
@@ -1200,6 +1203,7 @@ import {
|
|
|
1200
1203
|
} from '@patternfly/react-core';
|
|
1201
1204
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
1202
1205
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
1206
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
1203
1207
|
import imgBrand from '@patternfly/react-core/src/components/Brand/examples/pfLogo.svg';
|
|
1204
1208
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
1205
1209
|
|
|
@@ -1327,7 +1331,7 @@ class PageLayoutManualNav extends React.Component {
|
|
|
1327
1331
|
</PageHeaderToolsItem>
|
|
1328
1332
|
<PageHeaderToolsItem>
|
|
1329
1333
|
<Button aria-label="Help actions" variant={ButtonVariant.plain}>
|
|
1330
|
-
<
|
|
1334
|
+
<QuestionCircleIcon />
|
|
1331
1335
|
</Button>
|
|
1332
1336
|
</PageHeaderToolsItem>
|
|
1333
1337
|
</PageHeaderToolsGroup>
|