@patternfly/react-core 4.224.9 → 4.224.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.js +8 -11
- package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js +2 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
- package/dist/esm/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/esm/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +6 -6
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts +1 -0
- package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.js +7 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
- package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +7 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +9 -4
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.js +7 -10
- package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.js +2 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +5 -5
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.d.ts +1 -0
- package/dist/js/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.js +7 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
- package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +7 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +9 -4
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/styles/base-no-reset.css +10 -10
- package/dist/styles/base.css +10 -10
- package/dist/umd/react-core.css +39 -209
- package/dist/umd/react-core.js +709 -726
- package/dist/umd/react-core.min.css +141 -311
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Accordion/examples/AccordionBordered.tsx +21 -21
- package/src/components/Accordion/examples/AccordionDefinitionList.tsx +21 -21
- package/src/components/ActionList/__tests__/ActionList.test.tsx +46 -11
- package/src/components/ActionList/__tests__/ActionListGroup.test.tsx +34 -7
- package/src/components/ActionList/__tests__/ActionListItem.test.tsx +34 -7
- package/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap +1 -11
- package/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap +1 -1
- package/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap +1 -1
- package/src/components/ActionList/examples/ActionListMultipleGroups.tsx +4 -4
- package/src/components/ActionList/examples/ActionListSingleGroup.tsx +4 -4
- package/src/components/ActionList/examples/ActionListWithCancelButton.tsx +5 -5
- package/src/components/ActionList/examples/ActionListWithIcons.tsx +2 -2
- package/src/components/Card/examples/CardSelectableA11yHighlight.tsx +4 -4
- package/src/components/CodeBlock/examples/CodeBlockBasic.tsx +1 -1
- package/src/components/CodeBlock/examples/CodeBlockExpandable.tsx +1 -1
- package/src/components/ContextSelector/ContextSelector.tsx +11 -10
- package/src/components/ContextSelector/ContextSelectorMenuList.tsx +2 -1
- package/src/components/ContextSelector/__tests__/ContextSelector.test.tsx +2 -2
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +11 -7
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorMenuList.test.tsx.snap +10 -0
- package/src/components/DataList/examples/DataListCompact.tsx +4 -4
- package/src/components/DataList/examples/DataListControllingText.tsx +3 -3
- package/src/components/DataList/examples/DataListDraggable.tsx +14 -7
- package/src/components/DataList/examples/DataListExpandable.tsx +3 -3
- package/src/components/DataList/examples/DataListSmGridBreakpoint.tsx +3 -3
- package/src/components/DragDrop/DragDrop.tsx +1 -1
- package/src/components/DualListSelector/DualListSelector.tsx +93 -89
- package/src/components/DualListSelector/DualListSelectorControlsWrapper.tsx +1 -1
- package/src/components/DualListSelector/DualListSelectorList.tsx +10 -4
- package/src/components/DualListSelector/DualListSelectorTree.tsx +3 -2
- package/src/components/DualListSelector/__tests__/__snapshots__/DualListSelector.test.tsx.snap +6 -20
- package/src/components/DualListSelector/examples/DualListSelector.md +3 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +1 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposableDragDrop.tsx +1 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +1 -1
- package/src/components/DualListSelector/examples/{DualListSelectorTree.tsx → DualListSelectorTreeExample.tsx} +1 -1
- package/src/components/FileUpload/examples/FileUploadCustomUpload.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadSimpleText.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadTextWithEdits.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadTextWithRestrictions.tsx +2 -2
- package/src/components/InputGroup/examples/InputGroupBasic.tsx +3 -3
- package/src/components/InputGroup/examples/InputGroupWithDropdown.tsx +1 -1
- package/src/components/InputGroup/examples/InputGroupWithPopover.tsx +12 -2
- package/src/components/InputGroup/examples/InputGroupWithSiblings.tsx +7 -2
- package/src/components/InputGroup/examples/InputGroupWithTextarea.tsx +1 -1
- package/src/components/LoginPage/examples/LoginPage.md +2 -325
- package/src/components/LoginPage/examples/LoginPageBasic.tsx +144 -0
- package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +145 -0
- package/src/components/NotificationDrawer/examples/NotificationDrawer.md +69 -68
- package/src/components/SearchInput/SearchInput.tsx +32 -5
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +37 -0
- package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +193 -4
|
@@ -80,11 +80,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
80
80
|
<NotificationDrawerHeader count={3} onClose={this.onDrawerClose}>
|
|
81
81
|
<Dropdown
|
|
82
82
|
onSelect={this.onSelect}
|
|
83
|
-
toggle={<KebabToggle onToggle={this.onToggle(0)} id="
|
|
83
|
+
toggle={<KebabToggle onToggle={this.onToggle(0)} id="basic-kebab-toggle" />}
|
|
84
84
|
isOpen={isOpen0}
|
|
85
85
|
isPlain
|
|
86
86
|
dropdownItems={dropdownItems}
|
|
87
|
-
id="notification-0"
|
|
87
|
+
id="basic-notification-0"
|
|
88
88
|
position={DropdownPosition.right}
|
|
89
89
|
/>
|
|
90
90
|
</NotificationDrawerHeader>
|
|
@@ -99,11 +99,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
99
99
|
<Dropdown
|
|
100
100
|
position={DropdownPosition.right}
|
|
101
101
|
onSelect={this.onSelect}
|
|
102
|
-
toggle={<KebabToggle onToggle={this.onToggle(1)} id="toggle-id-1" />}
|
|
102
|
+
toggle={<KebabToggle onToggle={this.onToggle(1)} id="basic-toggle-id-1" />}
|
|
103
103
|
isOpen={isOpen1}
|
|
104
104
|
isPlain
|
|
105
105
|
dropdownItems={dropdownItems}
|
|
106
|
-
id="notification-1"
|
|
106
|
+
id="basic-notification-1"
|
|
107
107
|
/>
|
|
108
108
|
</NotificationDrawerListItemHeader>
|
|
109
109
|
<NotificationDrawerListItemBody timestamp="5 minutes ago">
|
|
@@ -119,11 +119,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
119
119
|
<Dropdown
|
|
120
120
|
position={DropdownPosition.right}
|
|
121
121
|
onSelect={this.onSelect}
|
|
122
|
-
toggle={<KebabToggle onToggle={this.onToggle(2)} id="toggle-id-2" />}
|
|
122
|
+
toggle={<KebabToggle onToggle={this.onToggle(2)} id="basic-toggle-id-2" />}
|
|
123
123
|
isOpen={isOpen2}
|
|
124
124
|
isPlain
|
|
125
125
|
dropdownItems={dropdownItems}
|
|
126
|
-
id="notification-2"
|
|
126
|
+
id="basic-notification-2"
|
|
127
127
|
/>
|
|
128
128
|
</NotificationDrawerListItemHeader>
|
|
129
129
|
<NotificationDrawerListItemBody timestamp="10 minutes ago">
|
|
@@ -141,11 +141,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
141
141
|
<Dropdown
|
|
142
142
|
position={DropdownPosition.right}
|
|
143
143
|
onSelect={this.onSelect}
|
|
144
|
-
toggle={<KebabToggle onToggle={this.onToggle(3)} id="toggle-id-3" />}
|
|
144
|
+
toggle={<KebabToggle onToggle={this.onToggle(3)} id="basic-toggle-id-3" />}
|
|
145
145
|
isOpen={isOpen3}
|
|
146
146
|
isPlain
|
|
147
147
|
dropdownItems={dropdownItems}
|
|
148
|
-
id="notification-3"
|
|
148
|
+
id="basic-notification-3"
|
|
149
149
|
/>
|
|
150
150
|
</NotificationDrawerListItemHeader>
|
|
151
151
|
<NotificationDrawerListItemBody timestamp="10 minutes ago">
|
|
@@ -162,11 +162,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
162
162
|
<Dropdown
|
|
163
163
|
position={DropdownPosition.right}
|
|
164
164
|
onSelect={this.onSelect}
|
|
165
|
-
toggle={<KebabToggle onToggle={this.onToggle(4)} id="toggle-id-4" />}
|
|
165
|
+
toggle={<KebabToggle onToggle={this.onToggle(4)} id="basic-toggle-id-4" />}
|
|
166
166
|
isOpen={isOpen4}
|
|
167
167
|
isPlain
|
|
168
168
|
dropdownItems={dropdownItems}
|
|
169
|
-
id="notification-4"
|
|
169
|
+
id="basic-notification-4"
|
|
170
170
|
/>
|
|
171
171
|
</NotificationDrawerListItemHeader>
|
|
172
172
|
<NotificationDrawerListItemBody timestamp="20 minutes ago">
|
|
@@ -183,11 +183,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
183
183
|
position={DropdownPosition.right}
|
|
184
184
|
direction={DropdownDirection.up}
|
|
185
185
|
onSelect={this.onSelect}
|
|
186
|
-
toggle={<KebabToggle onToggle={this.onToggle(5)} id="toggle-id-5" />}
|
|
186
|
+
toggle={<KebabToggle onToggle={this.onToggle(5)} id="basic-toggle-id-5" />}
|
|
187
187
|
isOpen={isOpen5}
|
|
188
188
|
isPlain
|
|
189
189
|
dropdownItems={dropdownItems}
|
|
190
|
-
id="notification-5"
|
|
190
|
+
id="basic-notification-5"
|
|
191
191
|
/>
|
|
192
192
|
</NotificationDrawerListItemHeader>
|
|
193
193
|
<NotificationDrawerListItemBody timestamp="30 minutes ago">
|
|
@@ -199,11 +199,11 @@ class BasicNotificationDrawer extends React.Component {
|
|
|
199
199
|
<Dropdown
|
|
200
200
|
position={DropdownPosition.right}
|
|
201
201
|
onSelect={this.onSelect}
|
|
202
|
-
toggle={<KebabToggle onToggle={this.onToggle(6)} id="toggle-id-6" />}
|
|
202
|
+
toggle={<KebabToggle onToggle={this.onToggle(6)} id="basic-toggle-id-6" />}
|
|
203
203
|
isOpen={isOpen6}
|
|
204
204
|
isPlain
|
|
205
205
|
dropdownItems={dropdownItems}
|
|
206
|
-
id="notification-6"
|
|
206
|
+
id="basic-notification-6"
|
|
207
207
|
/>
|
|
208
208
|
</NotificationDrawerListItemHeader>
|
|
209
209
|
<NotificationDrawerListItemBody timestamp="35 minutes ago">
|
|
@@ -253,8 +253,8 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
253
253
|
this.state = {
|
|
254
254
|
isOpenMap: null,
|
|
255
255
|
firstGroupExpanded: false,
|
|
256
|
-
secondGroupExpanded:
|
|
257
|
-
thirdGroupExpanded:
|
|
256
|
+
secondGroupExpanded: false,
|
|
257
|
+
thirdGroupExpanded: true
|
|
258
258
|
};
|
|
259
259
|
this.onToggle = (id, isOpen) => {
|
|
260
260
|
this.setState({
|
|
@@ -299,11 +299,11 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
299
299
|
<NotificationDrawerHeader count={4}>
|
|
300
300
|
<Dropdown
|
|
301
301
|
onSelect={this.onSelect}
|
|
302
|
-
toggle={<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
303
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
302
|
+
toggle={<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-1', isOpen)} id="groups-kebab-toggle-1" />}
|
|
303
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-1']}
|
|
304
304
|
isPlain
|
|
305
305
|
dropdownItems={dropdownItems}
|
|
306
|
-
id="notification-
|
|
306
|
+
id="grouped-notification-1"
|
|
307
307
|
position={DropdownPosition.right}
|
|
308
308
|
/>
|
|
309
309
|
</NotificationDrawerHeader>
|
|
@@ -326,12 +326,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
326
326
|
position={DropdownPosition.right}
|
|
327
327
|
onSelect={this.onSelect}
|
|
328
328
|
toggle={
|
|
329
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
329
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-notification-kebab-toggle-2', isOpen)} id="groups-kebab-toggle-2" />
|
|
330
330
|
}
|
|
331
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
331
|
+
isOpen={isOpenMap && isOpenMap['groups-notification-kebab-toggle-2']}
|
|
332
332
|
isPlain
|
|
333
333
|
dropdownItems={dropdownItems}
|
|
334
|
-
id="notification-
|
|
334
|
+
id="grouped-notification-2"
|
|
335
335
|
/>
|
|
336
336
|
</NotificationDrawerListItemHeader>
|
|
337
337
|
<NotificationDrawerListItemBody timestamp="5 minutes ago">
|
|
@@ -348,12 +348,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
348
348
|
position={DropdownPosition.right}
|
|
349
349
|
onSelect={this.onSelect}
|
|
350
350
|
toggle={
|
|
351
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
351
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-3', isOpen)} id="groups-kebab-toggle-3" />
|
|
352
352
|
}
|
|
353
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
353
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-3']}
|
|
354
354
|
isPlain
|
|
355
355
|
dropdownItems={dropdownItems}
|
|
356
|
-
id="notification-
|
|
356
|
+
id="grouped-notification-3"
|
|
357
357
|
/>
|
|
358
358
|
</NotificationDrawerListItemHeader>
|
|
359
359
|
<NotificationDrawerListItemBody timestamp="10 minutes ago">
|
|
@@ -371,12 +371,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
371
371
|
position={DropdownPosition.right}
|
|
372
372
|
onSelect={this.onSelect}
|
|
373
373
|
toggle={
|
|
374
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
374
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-4', isOpen)} id="groups-kebab-toggle-4" />
|
|
375
375
|
}
|
|
376
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
376
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-4']}
|
|
377
377
|
isPlain
|
|
378
378
|
dropdownItems={dropdownItems}
|
|
379
|
-
id="notification-
|
|
379
|
+
id="grouped-notification-4"
|
|
380
380
|
/>
|
|
381
381
|
</NotificationDrawerListItemHeader>
|
|
382
382
|
<NotificationDrawerListItemBody timestamp="20 minutes ago">
|
|
@@ -394,12 +394,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
394
394
|
direction={DropdownDirection.up}
|
|
395
395
|
onSelect={this.onSelect}
|
|
396
396
|
toggle={
|
|
397
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
397
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-5', isOpen)} id="groups-kebab-toggle-5" />
|
|
398
398
|
}
|
|
399
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
399
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-5']}
|
|
400
400
|
isPlain
|
|
401
401
|
dropdownItems={dropdownItems}
|
|
402
|
-
id="notification-
|
|
402
|
+
id="grouped-notification-5"
|
|
403
403
|
/>
|
|
404
404
|
</NotificationDrawerListItemHeader>
|
|
405
405
|
<NotificationDrawerListItemBody timestamp="30 minutes ago">
|
|
@@ -408,13 +408,37 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
408
408
|
</NotificationDrawerListItem>
|
|
409
409
|
</NotificationDrawerList>
|
|
410
410
|
</NotificationDrawerGroup>
|
|
411
|
+
|
|
411
412
|
<NotificationDrawerGroup
|
|
412
|
-
title="Second notification group"
|
|
413
|
+
title="Second notification group. This is a long title to show how the title will be truncated if it is long and will be shown in a single line."
|
|
413
414
|
isExpanded={secondGroupExpanded}
|
|
414
|
-
count={
|
|
415
|
+
count={0}
|
|
415
416
|
onExpand={this.toggleSecondDrawer}
|
|
417
|
+
truncateTitle={1}
|
|
416
418
|
>
|
|
417
419
|
<NotificationDrawerList isHidden={!secondGroupExpanded}>
|
|
420
|
+
<EmptyState variant={EmptyStateVariant.full}>
|
|
421
|
+
<EmptyStateIcon icon={SearchIcon} />
|
|
422
|
+
<Title headingLevel="h2" size="lg">
|
|
423
|
+
No alerts found
|
|
424
|
+
</Title>
|
|
425
|
+
<EmptyStateBody>
|
|
426
|
+
There are currently no critical alerts firing. There may be firing alerts of other severities or
|
|
427
|
+
silenced critical alerts however.
|
|
428
|
+
</EmptyStateBody>
|
|
429
|
+
<EmptyStatePrimary>
|
|
430
|
+
<Button variant="link">Action</Button>
|
|
431
|
+
</EmptyStatePrimary>
|
|
432
|
+
</EmptyState>
|
|
433
|
+
</NotificationDrawerList>
|
|
434
|
+
</NotificationDrawerGroup>
|
|
435
|
+
<NotificationDrawerGroup
|
|
436
|
+
title="Third notification group"
|
|
437
|
+
isExpanded={thirdGroupExpanded}
|
|
438
|
+
count={2}
|
|
439
|
+
onExpand={this.toggleThirdDrawer}
|
|
440
|
+
>
|
|
441
|
+
<NotificationDrawerList isHidden={!thirdGroupExpanded}>
|
|
418
442
|
<NotificationDrawerListItem variant="info">
|
|
419
443
|
<NotificationDrawerListItemHeader
|
|
420
444
|
variant="info"
|
|
@@ -425,12 +449,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
425
449
|
position={DropdownPosition.right}
|
|
426
450
|
onSelect={this.onSelect}
|
|
427
451
|
toggle={
|
|
428
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
452
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-6', isOpen)} id="groups-kebab-toggle-6" />
|
|
429
453
|
}
|
|
430
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
454
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-6']}
|
|
431
455
|
isPlain
|
|
432
456
|
dropdownItems={dropdownItems}
|
|
433
|
-
id="notification-
|
|
457
|
+
id="grouped-notification-6"
|
|
434
458
|
/>
|
|
435
459
|
</NotificationDrawerListItemHeader>
|
|
436
460
|
<NotificationDrawerListItemBody timestamp="5 minutes ago">
|
|
@@ -447,12 +471,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
447
471
|
position={DropdownPosition.right}
|
|
448
472
|
onSelect={this.onSelect}
|
|
449
473
|
toggle={
|
|
450
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
474
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-7', isOpen)} id="groups-kebab-toggle-7" />
|
|
451
475
|
}
|
|
452
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
476
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-7']}
|
|
453
477
|
isPlain
|
|
454
478
|
dropdownItems={dropdownItems}
|
|
455
|
-
id="notification-
|
|
479
|
+
id="grouped-notification-7"
|
|
456
480
|
/>
|
|
457
481
|
</NotificationDrawerListItemHeader>
|
|
458
482
|
<NotificationDrawerListItemBody timestamp="10 minutes ago">
|
|
@@ -470,12 +494,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
470
494
|
position={DropdownPosition.right}
|
|
471
495
|
onSelect={this.onSelect}
|
|
472
496
|
toggle={
|
|
473
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
497
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-8', isOpen)} id="groups-kebab-toggle-8" />
|
|
474
498
|
}
|
|
475
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
499
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-8']}
|
|
476
500
|
isPlain
|
|
477
501
|
dropdownItems={dropdownItems}
|
|
478
|
-
id="notification-
|
|
502
|
+
id="grouped-notification-8"
|
|
479
503
|
/>
|
|
480
504
|
</NotificationDrawerListItemHeader>
|
|
481
505
|
<NotificationDrawerListItemBody timestamp="20 minutes ago">
|
|
@@ -493,12 +517,12 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
493
517
|
direction={DropdownDirection.up}
|
|
494
518
|
onSelect={this.onSelect}
|
|
495
519
|
toggle={
|
|
496
|
-
<KebabToggle onToggle={isOpen => this.onToggle('toggle-
|
|
520
|
+
<KebabToggle onToggle={isOpen => this.onToggle('groups-kebab-toggle-9', isOpen)} id="groups-kebab-toggle-9" />
|
|
497
521
|
}
|
|
498
|
-
isOpen={isOpenMap && isOpenMap['toggle-
|
|
522
|
+
isOpen={isOpenMap && isOpenMap['groups-kebab-toggle-9']}
|
|
499
523
|
isPlain
|
|
500
524
|
dropdownItems={dropdownItems}
|
|
501
|
-
id="notification-
|
|
525
|
+
id="grouped-notification-9"
|
|
502
526
|
/>
|
|
503
527
|
</NotificationDrawerListItemHeader>
|
|
504
528
|
<NotificationDrawerListItemBody timestamp="30 minutes ago">
|
|
@@ -507,29 +531,6 @@ class GroupNotificationDrawer extends React.Component {
|
|
|
507
531
|
</NotificationDrawerListItem>
|
|
508
532
|
</NotificationDrawerList>
|
|
509
533
|
</NotificationDrawerGroup>
|
|
510
|
-
<NotificationDrawerGroup
|
|
511
|
-
title="Third notification group. This is a long title to show how the title will be truncated if it is long and will be shown in a single line."
|
|
512
|
-
isExpanded={thirdGroupExpanded}
|
|
513
|
-
count={0}
|
|
514
|
-
onExpand={this.toggleThirdDrawer}
|
|
515
|
-
truncateTitle={1}
|
|
516
|
-
>
|
|
517
|
-
<NotificationDrawerList isHidden={!thirdGroupExpanded}>
|
|
518
|
-
<EmptyState variant={EmptyStateVariant.full}>
|
|
519
|
-
<EmptyStateIcon icon={SearchIcon} />
|
|
520
|
-
<Title headingLevel="h2" size="lg">
|
|
521
|
-
No alerts found
|
|
522
|
-
</Title>
|
|
523
|
-
<EmptyStateBody>
|
|
524
|
-
There are currently no critical alerts firing. There may be firing alerts of other severities or
|
|
525
|
-
silenced critical alerts however.
|
|
526
|
-
</EmptyStateBody>
|
|
527
|
-
<EmptyStatePrimary>
|
|
528
|
-
<Button variant="link">Action</Button>
|
|
529
|
-
</EmptyStatePrimary>
|
|
530
|
-
</EmptyState>
|
|
531
|
-
</NotificationDrawerList>
|
|
532
|
-
</NotificationDrawerGroup>
|
|
533
534
|
</NotificationDrawerGroupList>
|
|
534
535
|
</NotificationDrawerBody>
|
|
535
536
|
</NotificationDrawer>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
|
-
import styles from '@patternfly/react-styles/css/components/SearchInput/search-input';
|
|
4
3
|
import { Button, ButtonVariant } from '../Button';
|
|
5
4
|
import { Badge } from '../Badge';
|
|
6
5
|
import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
|
|
@@ -12,6 +11,7 @@ import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-i
|
|
|
12
11
|
import { AdvancedSearchMenu } from './AdvancedSearchMenu';
|
|
13
12
|
import { TextInputGroup, TextInputGroupMain, TextInputGroupUtilities } from '../TextInputGroup';
|
|
14
13
|
import { InputGroup } from '../InputGroup';
|
|
14
|
+
import { Popper } from '../../helpers';
|
|
15
15
|
|
|
16
16
|
export interface SearchAttribute {
|
|
17
17
|
/** The search attribute's value to be provided in the search input's query string.
|
|
@@ -83,6 +83,13 @@ export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
83
83
|
/** Delimiter in the query string for pairing attributes with search values.
|
|
84
84
|
* Required whenever attributes are passed as props */
|
|
85
85
|
advancedSearchDelimiter?: string;
|
|
86
|
+
/** The container to append the menu to.
|
|
87
|
+
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
88
|
+
* Some examples:
|
|
89
|
+
* appendTo={() => document.body}
|
|
90
|
+
* appendTo={document.getElementById('target')}
|
|
91
|
+
*/
|
|
92
|
+
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
@@ -112,6 +119,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
112
119
|
nextNavigationButtonAriaLabel = 'Next',
|
|
113
120
|
submitSearchButtonLabel = 'Search',
|
|
114
121
|
isDisabled = false,
|
|
122
|
+
appendTo,
|
|
115
123
|
...props
|
|
116
124
|
}: SearchInputProps) => {
|
|
117
125
|
const [isSearchMenuOpen, setIsSearchMenuOpen] = React.useState(false);
|
|
@@ -277,11 +285,9 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
277
285
|
|
|
278
286
|
if (!!onSearch || attributes.length > 0 || !!onToggleAdvancedSearch) {
|
|
279
287
|
if (attributes.length > 0) {
|
|
280
|
-
|
|
281
|
-
<
|
|
282
|
-
{buildSearchTextInputGroupWithExtraButtons()}
|
|
288
|
+
const AdvancedSearch = (
|
|
289
|
+
<span>
|
|
283
290
|
<AdvancedSearchMenu
|
|
284
|
-
className={styles.searchInputMenu}
|
|
285
291
|
value={value}
|
|
286
292
|
parentRef={searchInputRef}
|
|
287
293
|
parentInputRef={searchInputInputRef}
|
|
@@ -298,8 +304,29 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
298
304
|
getAttrValueMap={getAttrValueMap}
|
|
299
305
|
isSearchMenuOpen={isSearchMenuOpen}
|
|
300
306
|
/>
|
|
307
|
+
</span>
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
const AdvancedSearchWithPopper = (
|
|
311
|
+
<div className={css(className)} ref={searchInputRef} {...props}>
|
|
312
|
+
<Popper
|
|
313
|
+
trigger={buildSearchTextInputGroupWithExtraButtons()}
|
|
314
|
+
popper={AdvancedSearch}
|
|
315
|
+
isVisible={isSearchMenuOpen}
|
|
316
|
+
enableFlip={true}
|
|
317
|
+
appendTo={() => appendTo || searchInputRef.current}
|
|
318
|
+
/>
|
|
301
319
|
</div>
|
|
302
320
|
);
|
|
321
|
+
|
|
322
|
+
const AdvancedSearchInline = (
|
|
323
|
+
<div className={css(className)} ref={searchInputRef} {...props}>
|
|
324
|
+
{buildSearchTextInputGroupWithExtraButtons()}
|
|
325
|
+
{AdvancedSearch}
|
|
326
|
+
</div>
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
return appendTo !== 'inline' ? AdvancedSearchWithPopper : AdvancedSearchInline;
|
|
303
330
|
}
|
|
304
331
|
|
|
305
332
|
return buildSearchTextInputGroupWithExtraButtons({ ...searchInputProps });
|
|
@@ -81,6 +81,7 @@ describe('SearchInput', () => {
|
|
|
81
81
|
test('advanced search with custom attributes', () => {
|
|
82
82
|
const { asFragment } = render(
|
|
83
83
|
<SearchInput
|
|
84
|
+
data-testid="test-id"
|
|
84
85
|
attributes={[
|
|
85
86
|
{ attr: 'username', display: 'Username' },
|
|
86
87
|
{ attr: 'firstname', display: 'First name' }
|
|
@@ -102,7 +103,43 @@ describe('SearchInput', () => {
|
|
|
102
103
|
|
|
103
104
|
userEvent.click(screen.getByRole('button', { name: 'Search' }));
|
|
104
105
|
|
|
106
|
+
userEvent.click(screen.getByRole('button', { name: 'Open advanced search' }));
|
|
107
|
+
expect(screen.getByTestId('test-id')).toContainElement(screen.getByText('First name'))
|
|
108
|
+
|
|
105
109
|
expect(props.onSearch).toHaveBeenCalled();
|
|
106
110
|
expect(asFragment()).toMatchSnapshot();
|
|
107
111
|
});
|
|
112
|
+
|
|
113
|
+
test('advanced search with custom attributes and appendTo="inline', () => {
|
|
114
|
+
const {container} = render(
|
|
115
|
+
<SearchInput
|
|
116
|
+
data-testid="test-id"
|
|
117
|
+
attributes={[
|
|
118
|
+
{ attr: 'test', display: 'test' },
|
|
119
|
+
]}
|
|
120
|
+
appendTo='inline'
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
userEvent.click(screen.getByRole('button', { name: 'Open advanced search' }));
|
|
125
|
+
|
|
126
|
+
expect(screen.getByTestId('test-id')).toContainElement(screen.getByText('test'))
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test('advanced search with custom attributes and appendTo external DOM element', () => {
|
|
130
|
+
const {container} = render(
|
|
131
|
+
<SearchInput
|
|
132
|
+
data-testid="test-id"
|
|
133
|
+
attributes={[
|
|
134
|
+
{ attr: 'test', display: 'test' },
|
|
135
|
+
]}
|
|
136
|
+
appendTo={document.body}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
userEvent.click(screen.getByRole('button', { name: 'Open advanced search' }));
|
|
141
|
+
|
|
142
|
+
expect(screen.getByTestId('test-id')).not.toContainElement(screen.getByText('test'))
|
|
143
|
+
expect(document.body).toContainElement(screen.getByText('test'))
|
|
144
|
+
});
|
|
108
145
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`SearchInput advanced search 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="
|
|
6
|
+
class=""
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="pf-c-input-group"
|
|
@@ -125,7 +125,8 @@ exports[`SearchInput advanced search 1`] = `
|
|
|
125
125
|
exports[`SearchInput advanced search with custom attributes 1`] = `
|
|
126
126
|
<DocumentFragment>
|
|
127
127
|
<div
|
|
128
|
-
class="
|
|
128
|
+
class=""
|
|
129
|
+
data-testid="test-id"
|
|
129
130
|
>
|
|
130
131
|
<div
|
|
131
132
|
class="pf-c-input-group"
|
|
@@ -194,9 +195,9 @@ exports[`SearchInput advanced search with custom attributes 1`] = `
|
|
|
194
195
|
</div>
|
|
195
196
|
<button
|
|
196
197
|
aria-disabled="false"
|
|
197
|
-
aria-expanded="
|
|
198
|
+
aria-expanded="true"
|
|
198
199
|
aria-label="Open advanced search"
|
|
199
|
-
class="pf-c-button pf-m-control"
|
|
200
|
+
class="pf-c-button pf-m-control pf-m-expanded"
|
|
200
201
|
data-ouia-component-id="OUIA-Generated-Button-control-8"
|
|
201
202
|
data-ouia-component-type="PF4/Button"
|
|
202
203
|
data-ouia-safe="true"
|
|
@@ -240,6 +241,194 @@ exports[`SearchInput advanced search with custom attributes 1`] = `
|
|
|
240
241
|
</svg>
|
|
241
242
|
</button>
|
|
242
243
|
</div>
|
|
244
|
+
<span
|
|
245
|
+
class=""
|
|
246
|
+
style="position: absolute; left: 0px; top: 0px; z-index: 9999; width: 0px;"
|
|
247
|
+
>
|
|
248
|
+
<div
|
|
249
|
+
class="pf-c-panel pf-m-raised"
|
|
250
|
+
>
|
|
251
|
+
<div
|
|
252
|
+
class="pf-c-panel__main"
|
|
253
|
+
>
|
|
254
|
+
<div
|
|
255
|
+
class="pf-c-panel__main-body"
|
|
256
|
+
>
|
|
257
|
+
<form
|
|
258
|
+
class="pf-c-form"
|
|
259
|
+
novalidate=""
|
|
260
|
+
>
|
|
261
|
+
<div
|
|
262
|
+
class="pf-c-form__group"
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
class="pf-c-form__group-label"
|
|
266
|
+
>
|
|
267
|
+
<label
|
|
268
|
+
class="pf-c-form__label"
|
|
269
|
+
for="username_0"
|
|
270
|
+
>
|
|
271
|
+
<span
|
|
272
|
+
class="pf-c-form__label-text"
|
|
273
|
+
>
|
|
274
|
+
Username
|
|
275
|
+
</span>
|
|
276
|
+
</label>
|
|
277
|
+
|
|
278
|
+
</div>
|
|
279
|
+
<div
|
|
280
|
+
class="pf-c-form__group-control"
|
|
281
|
+
>
|
|
282
|
+
<input
|
|
283
|
+
aria-invalid="false"
|
|
284
|
+
class="pf-c-form-control"
|
|
285
|
+
data-ouia-component-id="OUIA-Generated-TextInputBase-1"
|
|
286
|
+
data-ouia-component-type="PF4/TextInput"
|
|
287
|
+
data-ouia-safe="true"
|
|
288
|
+
id="username_0"
|
|
289
|
+
type="text"
|
|
290
|
+
value="player"
|
|
291
|
+
/>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
<div
|
|
295
|
+
class="pf-c-form__group"
|
|
296
|
+
>
|
|
297
|
+
<div
|
|
298
|
+
class="pf-c-form__group-label"
|
|
299
|
+
>
|
|
300
|
+
<label
|
|
301
|
+
class="pf-c-form__label"
|
|
302
|
+
for="firstname_1"
|
|
303
|
+
>
|
|
304
|
+
<span
|
|
305
|
+
class="pf-c-form__label-text"
|
|
306
|
+
>
|
|
307
|
+
First name
|
|
308
|
+
</span>
|
|
309
|
+
</label>
|
|
310
|
+
|
|
311
|
+
</div>
|
|
312
|
+
<div
|
|
313
|
+
class="pf-c-form__group-control"
|
|
314
|
+
>
|
|
315
|
+
<input
|
|
316
|
+
aria-invalid="false"
|
|
317
|
+
class="pf-c-form-control"
|
|
318
|
+
data-ouia-component-id="OUIA-Generated-TextInputBase-2"
|
|
319
|
+
data-ouia-component-type="PF4/TextInput"
|
|
320
|
+
data-ouia-safe="true"
|
|
321
|
+
id="firstname_1"
|
|
322
|
+
type="text"
|
|
323
|
+
value="john"
|
|
324
|
+
/>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
<div
|
|
328
|
+
class="pf-c-form__group"
|
|
329
|
+
>
|
|
330
|
+
<div
|
|
331
|
+
class="pf-c-form__group-label"
|
|
332
|
+
>
|
|
333
|
+
<label
|
|
334
|
+
class="pf-c-form__label"
|
|
335
|
+
for="pf-random-id-2"
|
|
336
|
+
>
|
|
337
|
+
<span
|
|
338
|
+
class="pf-c-form__label-text"
|
|
339
|
+
>
|
|
340
|
+
Has words
|
|
341
|
+
</span>
|
|
342
|
+
</label>
|
|
343
|
+
|
|
344
|
+
</div>
|
|
345
|
+
<div
|
|
346
|
+
class="pf-c-form__group-control"
|
|
347
|
+
>
|
|
348
|
+
<input
|
|
349
|
+
aria-invalid="false"
|
|
350
|
+
class="pf-c-form-control"
|
|
351
|
+
data-ouia-component-id="OUIA-Generated-TextInputBase-3"
|
|
352
|
+
data-ouia-component-type="PF4/TextInput"
|
|
353
|
+
data-ouia-safe="true"
|
|
354
|
+
id="pf-random-id-2"
|
|
355
|
+
type="text"
|
|
356
|
+
value=""
|
|
357
|
+
/>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
<div
|
|
361
|
+
class="pf-c-form__group"
|
|
362
|
+
>
|
|
363
|
+
<div
|
|
364
|
+
class="pf-c-form__group-control"
|
|
365
|
+
>
|
|
366
|
+
<button
|
|
367
|
+
aria-disabled="false"
|
|
368
|
+
class="pf-c-button pf-m-link pf-m-inline"
|
|
369
|
+
data-ouia-component-id="OUIA-Generated-Button-link-1"
|
|
370
|
+
data-ouia-component-type="PF4/Button"
|
|
371
|
+
data-ouia-safe="true"
|
|
372
|
+
type="button"
|
|
373
|
+
>
|
|
374
|
+
Link
|
|
375
|
+
<span
|
|
376
|
+
class="pf-c-button__icon pf-m-end"
|
|
377
|
+
>
|
|
378
|
+
<svg
|
|
379
|
+
aria-hidden="true"
|
|
380
|
+
fill="currentColor"
|
|
381
|
+
height="1em"
|
|
382
|
+
role="img"
|
|
383
|
+
style="vertical-align: -0.125em;"
|
|
384
|
+
viewBox="0 0 448 512"
|
|
385
|
+
width="1em"
|
|
386
|
+
>
|
|
387
|
+
<path
|
|
388
|
+
d="M448 80v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h352c26.51 0 48 21.49 48 48zm-88 16H248.029c-21.313 0-32.08 25.861-16.971 40.971l31.984 31.987L67.515 364.485c-4.686 4.686-4.686 12.284 0 16.971l31.029 31.029c4.687 4.686 12.285 4.686 16.971 0l195.526-195.526 31.988 31.991C358.058 263.977 384 253.425 384 231.979V120c0-13.255-10.745-24-24-24z"
|
|
389
|
+
/>
|
|
390
|
+
</svg>
|
|
391
|
+
</span>
|
|
392
|
+
</button>
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
<div
|
|
396
|
+
class="pf-c-form__group pf-m-action"
|
|
397
|
+
>
|
|
398
|
+
<div
|
|
399
|
+
class="pf-c-form__group-control"
|
|
400
|
+
>
|
|
401
|
+
<div
|
|
402
|
+
class="pf-c-form__actions"
|
|
403
|
+
>
|
|
404
|
+
<button
|
|
405
|
+
aria-disabled="false"
|
|
406
|
+
class="pf-c-button pf-m-primary"
|
|
407
|
+
data-ouia-component-id="OUIA-Generated-Button-primary-1"
|
|
408
|
+
data-ouia-component-type="PF4/Button"
|
|
409
|
+
data-ouia-safe="true"
|
|
410
|
+
type="submit"
|
|
411
|
+
>
|
|
412
|
+
Search
|
|
413
|
+
</button>
|
|
414
|
+
<button
|
|
415
|
+
aria-disabled="false"
|
|
416
|
+
class="pf-c-button pf-m-link"
|
|
417
|
+
data-ouia-component-id="OUIA-Generated-Button-link-2"
|
|
418
|
+
data-ouia-component-type="PF4/Button"
|
|
419
|
+
data-ouia-safe="true"
|
|
420
|
+
type="reset"
|
|
421
|
+
>
|
|
422
|
+
Reset
|
|
423
|
+
</button>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
</form>
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</span>
|
|
243
432
|
</div>
|
|
244
433
|
</DocumentFragment>
|
|
245
434
|
`;
|