@patternfly/react-core 4.175.15 → 4.177.0
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 +49 -0
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts +3 -1
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownToggle.js +4 -4
- package/dist/esm/components/Dropdown/DropdownToggle.js.map +1 -1
- package/dist/esm/components/Dropdown/Toggle.d.ts +3 -1
- package/dist/esm/components/Dropdown/Toggle.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Toggle.js +8 -3
- package/dist/esm/components/Dropdown/Toggle.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +7 -9
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js +9 -6
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/helpers/OUIA/ouia.d.ts.map +1 -1
- package/dist/esm/helpers/OUIA/ouia.js +9 -1
- package/dist/esm/helpers/OUIA/ouia.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.d.ts +3 -1
- package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.js +4 -4
- package/dist/js/components/Dropdown/DropdownToggle.js.map +1 -1
- package/dist/js/components/Dropdown/Toggle.d.ts +3 -1
- package/dist/js/components/Dropdown/Toggle.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Toggle.js +8 -3
- package/dist/js/components/Dropdown/Toggle.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +2 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +7 -9
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js +9 -6
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/helpers/OUIA/ouia.d.ts.map +1 -1
- package/dist/js/helpers/OUIA/ouia.js +9 -1
- package/dist/js/helpers/OUIA/ouia.js.map +1 -1
- package/dist/umd/react-core.js +37 -23
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +5 -5
- package/src/components/Alert/examples/Alert.md +201 -382
- package/src/components/Alert/examples/AlertAsyncLiveRegion.tsx +61 -0
- package/src/components/Alert/examples/AlertDynamicLiveRegion.tsx +61 -0
- package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +6 -0
- package/src/components/Dropdown/DropdownToggle.tsx +6 -1
- package/src/components/Dropdown/Toggle.tsx +11 -1
- package/src/components/Dropdown/__tests__/DropdownToggle.test.tsx +51 -0
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +8 -0
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +346 -4
- package/src/components/Dropdown/__tests__/__snapshots__/Toggle.test.tsx.snap +1 -0
- package/src/components/Dropdown/examples/Dropdown.md +160 -91
- package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +7 -0
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +15 -0
- package/src/components/Select/Select.tsx +9 -1
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +25 -0
- package/src/components/Select/examples/Select.md +75 -9
- package/src/components/Slider/Slider.tsx +9 -6
- package/src/components/Slider/examples/Slider.md +27 -0
- package/src/demos/CardDemos.md +65 -91
- package/src/demos/Tabs/NestedTabsDemo.js +151 -0
- package/src/demos/Tabs.md +4 -0
- package/src/helpers/OUIA/ouia.ts +8 -1
|
@@ -22,12 +22,7 @@ import avatarImg from '../../Avatar/examples/avatarImg.svg';
|
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
24
|
import React from 'react';
|
|
25
|
-
import {
|
|
26
|
-
Dropdown,
|
|
27
|
-
DropdownToggle,
|
|
28
|
-
DropdownItem,
|
|
29
|
-
DropdownSeparator
|
|
30
|
-
} from '@patternfly/react-core';
|
|
25
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
31
26
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
32
27
|
|
|
33
28
|
class SimpleDropdown extends React.Component {
|
|
@@ -63,12 +58,12 @@ class SimpleDropdown extends React.Component {
|
|
|
63
58
|
<DropdownItem key="disabled link" isDisabled href="www.google.com">
|
|
64
59
|
Disabled link
|
|
65
60
|
</DropdownItem>,
|
|
66
|
-
<DropdownItem
|
|
67
|
-
key="disabled action"
|
|
68
|
-
isAriaDisabled
|
|
61
|
+
<DropdownItem
|
|
62
|
+
key="disabled action"
|
|
63
|
+
isAriaDisabled
|
|
69
64
|
component="button"
|
|
70
|
-
tooltip="Tooltip for disabled item"
|
|
71
|
-
tooltipProps={{position:
|
|
65
|
+
tooltip="Tooltip for disabled item"
|
|
66
|
+
tooltipProps={{ position: 'top' }}
|
|
72
67
|
>
|
|
73
68
|
Disabled action
|
|
74
69
|
</DropdownItem>,
|
|
@@ -98,12 +93,7 @@ class SimpleDropdown extends React.Component {
|
|
|
98
93
|
|
|
99
94
|
```js
|
|
100
95
|
import React from 'react';
|
|
101
|
-
import {
|
|
102
|
-
Dropdown,
|
|
103
|
-
DropdownToggle,
|
|
104
|
-
DropdownItem,
|
|
105
|
-
DropdownSeparator
|
|
106
|
-
} from '@patternfly/react-core';
|
|
96
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
107
97
|
|
|
108
98
|
class IntialSelectionDropdown extends React.Component {
|
|
109
99
|
constructor(props) {
|
|
@@ -236,12 +226,7 @@ class GroupedDropdown extends React.Component {
|
|
|
236
226
|
|
|
237
227
|
```js
|
|
238
228
|
import React from 'react';
|
|
239
|
-
import {
|
|
240
|
-
Dropdown,
|
|
241
|
-
DropdownToggle,
|
|
242
|
-
DropdownItem,
|
|
243
|
-
DropdownSeparator
|
|
244
|
-
} from '@patternfly/react-core';
|
|
229
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
245
230
|
|
|
246
231
|
class DisabledDropdown extends React.Component {
|
|
247
232
|
constructor(props) {
|
|
@@ -300,12 +285,7 @@ class DisabledDropdown extends React.Component {
|
|
|
300
285
|
|
|
301
286
|
```js
|
|
302
287
|
import React from 'react';
|
|
303
|
-
import {
|
|
304
|
-
Dropdown,
|
|
305
|
-
DropdownToggle,
|
|
306
|
-
DropdownItem,
|
|
307
|
-
DropdownSeparator
|
|
308
|
-
} from '@patternfly/react-core';
|
|
288
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
309
289
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
310
290
|
|
|
311
291
|
class PrimaryDropdown extends React.Component {
|
|
@@ -366,17 +346,67 @@ class PrimaryDropdown extends React.Component {
|
|
|
366
346
|
}
|
|
367
347
|
```
|
|
368
348
|
|
|
349
|
+
### Secondary toggle
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
import React from 'react';
|
|
353
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
354
|
+
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
355
|
+
|
|
356
|
+
const SecondaryDropdown = () => {
|
|
357
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
358
|
+
|
|
359
|
+
const onFocus = () => {
|
|
360
|
+
const element = document.getElementById('toggle-id-secondary');
|
|
361
|
+
element.focus();
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const dropdownItems = [
|
|
365
|
+
<DropdownItem key="link">Link</DropdownItem>,
|
|
366
|
+
<DropdownItem key="action" component="button">
|
|
367
|
+
Action
|
|
368
|
+
</DropdownItem>,
|
|
369
|
+
<DropdownItem key="disabled link" isDisabled>
|
|
370
|
+
Disabled link
|
|
371
|
+
</DropdownItem>,
|
|
372
|
+
<DropdownItem key="disabled action" isDisabled component="button">
|
|
373
|
+
Disabled action
|
|
374
|
+
</DropdownItem>,
|
|
375
|
+
<DropdownSeparator key="separator" />,
|
|
376
|
+
<DropdownItem key="separated link">Separated link</DropdownItem>,
|
|
377
|
+
<DropdownItem key="separated action" component="button">
|
|
378
|
+
Separated action
|
|
379
|
+
</DropdownItem>
|
|
380
|
+
];
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<Dropdown
|
|
384
|
+
onSelect={() => {
|
|
385
|
+
setIsOpen(!isOpen);
|
|
386
|
+
onFocus();
|
|
387
|
+
}}
|
|
388
|
+
toggle={
|
|
389
|
+
<DropdownToggle
|
|
390
|
+
onToggle={next => setIsOpen(next)}
|
|
391
|
+
toggleIndicator={CaretDownIcon}
|
|
392
|
+
toggleVariant="secondary"
|
|
393
|
+
id="toggle-id-secondary"
|
|
394
|
+
>
|
|
395
|
+
Dropdown
|
|
396
|
+
</DropdownToggle>
|
|
397
|
+
}
|
|
398
|
+
isOpen={isOpen}
|
|
399
|
+
dropdownItems={dropdownItems}
|
|
400
|
+
/>
|
|
401
|
+
);
|
|
402
|
+
};
|
|
403
|
+
```
|
|
404
|
+
|
|
369
405
|
### Position right
|
|
370
406
|
|
|
371
407
|
```js
|
|
372
408
|
import React from 'react';
|
|
373
|
-
import {
|
|
374
|
-
Dropdown,
|
|
375
|
-
DropdownToggle,
|
|
376
|
-
DropdownItem,
|
|
377
|
-
DropdownSeparator,
|
|
378
|
-
DropdownPosition
|
|
379
|
-
} from '@patternfly/react-core';
|
|
409
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator, DropdownPosition } from '@patternfly/react-core';
|
|
380
410
|
|
|
381
411
|
class PositionRightDropdown extends React.Component {
|
|
382
412
|
constructor(props) {
|
|
@@ -437,12 +467,7 @@ class PositionRightDropdown extends React.Component {
|
|
|
437
467
|
|
|
438
468
|
```js
|
|
439
469
|
import React from 'react';
|
|
440
|
-
import {
|
|
441
|
-
Dropdown,
|
|
442
|
-
DropdownToggle,
|
|
443
|
-
DropdownItem,
|
|
444
|
-
DropdownSeparator
|
|
445
|
-
} from '@patternfly/react-core';
|
|
470
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
446
471
|
|
|
447
472
|
class AlignmentsDropdown extends React.Component {
|
|
448
473
|
constructor(props) {
|
|
@@ -509,13 +534,7 @@ class AlignmentsDropdown extends React.Component {
|
|
|
509
534
|
|
|
510
535
|
```js
|
|
511
536
|
import React from 'react';
|
|
512
|
-
import {
|
|
513
|
-
Dropdown,
|
|
514
|
-
DropdownToggle,
|
|
515
|
-
DropdownItem,
|
|
516
|
-
DropdownSeparator,
|
|
517
|
-
DropdownDirection
|
|
518
|
-
} from '@patternfly/react-core';
|
|
537
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator, DropdownDirection } from '@patternfly/react-core';
|
|
519
538
|
|
|
520
539
|
class DirectionUpDropdown extends React.Component {
|
|
521
540
|
constructor(props) {
|
|
@@ -575,12 +594,7 @@ class DirectionUpDropdown extends React.Component {
|
|
|
575
594
|
|
|
576
595
|
```js
|
|
577
596
|
import React from 'react';
|
|
578
|
-
import {
|
|
579
|
-
Dropdown,
|
|
580
|
-
DropdownItem,
|
|
581
|
-
DropdownSeparator,
|
|
582
|
-
KebabToggle
|
|
583
|
-
} from '@patternfly/react-core';
|
|
597
|
+
import { Dropdown, DropdownItem, DropdownSeparator, KebabToggle } from '@patternfly/react-core';
|
|
584
598
|
|
|
585
599
|
class KebabDropdown extends React.Component {
|
|
586
600
|
constructor(props) {
|
|
@@ -641,11 +655,7 @@ class KebabDropdown extends React.Component {
|
|
|
641
655
|
|
|
642
656
|
```js
|
|
643
657
|
import React from 'react';
|
|
644
|
-
import {
|
|
645
|
-
Dropdown,
|
|
646
|
-
DropdownItem,
|
|
647
|
-
BadgeToggle
|
|
648
|
-
} from '@patternfly/react-core';
|
|
658
|
+
import { Dropdown, DropdownItem, BadgeToggle } from '@patternfly/react-core';
|
|
649
659
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
650
660
|
|
|
651
661
|
class BadgeDropdown extends React.Component {
|
|
@@ -704,12 +714,7 @@ class BadgeDropdown extends React.Component {
|
|
|
704
714
|
|
|
705
715
|
```js
|
|
706
716
|
import React from 'react';
|
|
707
|
-
import {
|
|
708
|
-
Dropdown,
|
|
709
|
-
DropdownToggle,
|
|
710
|
-
DropdownItem,
|
|
711
|
-
DropdownSeparator
|
|
712
|
-
} from '@patternfly/react-core';
|
|
717
|
+
import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator } from '@patternfly/react-core';
|
|
713
718
|
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
714
719
|
|
|
715
720
|
class IconDropdown extends React.Component {
|
|
@@ -1071,12 +1076,7 @@ class SplitButtonDisabledDropdown extends React.Component {
|
|
|
1071
1076
|
|
|
1072
1077
|
```js
|
|
1073
1078
|
import React from 'react';
|
|
1074
|
-
import {
|
|
1075
|
-
Dropdown,
|
|
1076
|
-
DropdownToggle,
|
|
1077
|
-
DropdownToggleAction,
|
|
1078
|
-
DropdownItem
|
|
1079
|
-
} from '@patternfly/react-core';
|
|
1079
|
+
import { Dropdown, DropdownToggle, DropdownToggleAction, DropdownItem } from '@patternfly/react-core';
|
|
1080
1080
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
1081
1081
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
1082
1082
|
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
@@ -1180,14 +1180,95 @@ class SplitButtonActionDropdown extends React.Component {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
```
|
|
1182
1182
|
|
|
1183
|
+
### Split button primary action
|
|
1184
|
+
|
|
1185
|
+
```ts
|
|
1186
|
+
import React from 'react';
|
|
1187
|
+
import { Dropdown, DropdownToggle, DropdownToggleAction, DropdownItem } from '@patternfly/react-core';
|
|
1188
|
+
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
1189
|
+
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
1190
|
+
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
1191
|
+
|
|
1192
|
+
const PrimarySplitActionDropdown = () => {
|
|
1193
|
+
const [isActionOpen, setIsActionOpen] = React.useState(false);
|
|
1194
|
+
const [isCogOpen, setIsCogOpen] = React.useState(false);
|
|
1195
|
+
|
|
1196
|
+
const onActionClick = () => {
|
|
1197
|
+
window.alert('You selected an action button!');
|
|
1198
|
+
};
|
|
1199
|
+
const onCogClick = () => {
|
|
1200
|
+
window.alert('You selected the Cog!');
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
const dropdownItems = [
|
|
1204
|
+
<DropdownItem key="action" component="button" onClick={onActionClick}>
|
|
1205
|
+
Action
|
|
1206
|
+
</DropdownItem>,
|
|
1207
|
+
<DropdownItem key="disabled link" component="button" isDisabled onClick={onActionClick}>
|
|
1208
|
+
Disabled action
|
|
1209
|
+
</DropdownItem>,
|
|
1210
|
+
<DropdownItem key="other action" component="button" onClick={onActionClick}>
|
|
1211
|
+
Other action
|
|
1212
|
+
</DropdownItem>
|
|
1213
|
+
];
|
|
1214
|
+
const dropdownIconItems = [
|
|
1215
|
+
<DropdownItem key="action" component="button" icon={<CogIcon />} onClick={onActionClick}>
|
|
1216
|
+
Action
|
|
1217
|
+
</DropdownItem>,
|
|
1218
|
+
<DropdownItem key="disabled link" component="button" icon={<BellIcon />} isDisabled onClick={onActionClick}>
|
|
1219
|
+
Disabled action
|
|
1220
|
+
</DropdownItem>,
|
|
1221
|
+
<DropdownItem key="other action" component="button" icon={<CubesIcon />} onClick={onActionClick}>
|
|
1222
|
+
Other action
|
|
1223
|
+
</DropdownItem>
|
|
1224
|
+
];
|
|
1225
|
+
|
|
1226
|
+
return (
|
|
1227
|
+
<React.Fragment>
|
|
1228
|
+
<Dropdown
|
|
1229
|
+
onSelect={() => setIsActionOpen(!isActionOpen)}
|
|
1230
|
+
toggle={
|
|
1231
|
+
<DropdownToggle
|
|
1232
|
+
splitButtonItems={[
|
|
1233
|
+
<DropdownToggleAction key="action" onClick={onActionClick}>
|
|
1234
|
+
Action
|
|
1235
|
+
</DropdownToggleAction>
|
|
1236
|
+
]}
|
|
1237
|
+
toggleVariant="primary"
|
|
1238
|
+
splitButtonVariant="action"
|
|
1239
|
+
onToggle={next => setIsActionOpen(next)}
|
|
1240
|
+
/>
|
|
1241
|
+
}
|
|
1242
|
+
isOpen={isActionOpen}
|
|
1243
|
+
dropdownItems={dropdownItems}
|
|
1244
|
+
/>{' '}
|
|
1245
|
+
<Dropdown
|
|
1246
|
+
onSelect={() => setIsCogOpen(!isCogOpen)}
|
|
1247
|
+
toggle={
|
|
1248
|
+
<DropdownToggle
|
|
1249
|
+
splitButtonItems={[
|
|
1250
|
+
<DropdownToggleAction key="cog-action" aria-label="Action" onClick={onCogClick}>
|
|
1251
|
+
<CogIcon />
|
|
1252
|
+
</DropdownToggleAction>
|
|
1253
|
+
]}
|
|
1254
|
+
toggleVariant="primary"
|
|
1255
|
+
splitButtonVariant="action"
|
|
1256
|
+
onToggle={next => setIsCogOpen(next)}
|
|
1257
|
+
/>
|
|
1258
|
+
}
|
|
1259
|
+
isOpen={isCogOpen}
|
|
1260
|
+
dropdownItems={dropdownIconItems}
|
|
1261
|
+
/>
|
|
1262
|
+
</React.Fragment>
|
|
1263
|
+
);
|
|
1264
|
+
};
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1183
1267
|
### Basic panel
|
|
1184
1268
|
|
|
1185
1269
|
```js
|
|
1186
1270
|
import React from 'react';
|
|
1187
|
-
import {
|
|
1188
|
-
Dropdown,
|
|
1189
|
-
DropdownToggle
|
|
1190
|
-
} from '@patternfly/react-core';
|
|
1271
|
+
import { Dropdown, DropdownToggle } from '@patternfly/react-core';
|
|
1191
1272
|
|
|
1192
1273
|
class DropdownPanel extends React.Component {
|
|
1193
1274
|
constructor(props) {
|
|
@@ -1226,11 +1307,7 @@ class DropdownPanel extends React.Component {
|
|
|
1226
1307
|
|
|
1227
1308
|
```js
|
|
1228
1309
|
import React from 'react';
|
|
1229
|
-
import {
|
|
1230
|
-
Dropdown,
|
|
1231
|
-
DropdownToggle,
|
|
1232
|
-
DropdownItem
|
|
1233
|
-
} from '@patternfly/react-core';
|
|
1310
|
+
import { Dropdown, DropdownToggle, DropdownItem } from '@patternfly/react-core';
|
|
1234
1311
|
import { Link } from '@reach/router';
|
|
1235
1312
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
1236
1313
|
|
|
@@ -1359,11 +1436,7 @@ class ImageTextDropdown extends React.Component {
|
|
|
1359
1436
|
|
|
1360
1437
|
```js
|
|
1361
1438
|
import React from 'react';
|
|
1362
|
-
import {
|
|
1363
|
-
Dropdown,
|
|
1364
|
-
DropdownToggle,
|
|
1365
|
-
DropdownItem
|
|
1366
|
-
} from '@patternfly/react-core';
|
|
1439
|
+
import { Dropdown, DropdownToggle, DropdownItem } from '@patternfly/react-core';
|
|
1367
1440
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
1368
1441
|
|
|
1369
1442
|
class MenuOnDocumentBodyDropdown extends React.Component {
|
|
@@ -1415,11 +1488,7 @@ class MenuOnDocumentBodyDropdown extends React.Component {
|
|
|
1415
1488
|
|
|
1416
1489
|
```js
|
|
1417
1490
|
import React from 'react';
|
|
1418
|
-
import {
|
|
1419
|
-
Dropdown,
|
|
1420
|
-
DropdownToggle,
|
|
1421
|
-
DropdownItem
|
|
1422
|
-
} from '@patternfly/react-core';
|
|
1491
|
+
import { Dropdown, DropdownToggle, DropdownItem } from '@patternfly/react-core';
|
|
1423
1492
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
1424
1493
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
1425
1494
|
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
@@ -697,6 +697,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
697
697
|
</div>,
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
+
toggleVariant="default"
|
|
700
701
|
>
|
|
701
702
|
<button
|
|
702
703
|
aria-expanded={true}
|
|
@@ -1504,6 +1505,7 @@ exports[`optionsMenu isDisabled 1`] = `
|
|
|
1504
1505
|
</div>,
|
|
1505
1506
|
}
|
|
1506
1507
|
}
|
|
1508
|
+
toggleVariant="default"
|
|
1507
1509
|
>
|
|
1508
1510
|
<button
|
|
1509
1511
|
aria-expanded={false}
|
|
@@ -1833,6 +1835,7 @@ exports[`optionsMenu open up 1`] = `
|
|
|
1833
1835
|
</div>,
|
|
1834
1836
|
}
|
|
1835
1837
|
}
|
|
1838
|
+
toggleVariant="default"
|
|
1836
1839
|
>
|
|
1837
1840
|
<button
|
|
1838
1841
|
aria-expanded={false}
|
|
@@ -2106,6 +2109,7 @@ exports[`optionsMenu plain 1`] = `
|
|
|
2106
2109
|
</div>,
|
|
2107
2110
|
}
|
|
2108
2111
|
}
|
|
2112
|
+
toggleVariant="default"
|
|
2109
2113
|
>
|
|
2110
2114
|
<button
|
|
2111
2115
|
aria-expanded={false}
|
|
@@ -2406,6 +2410,7 @@ exports[`optionsMenu regular 1`] = `
|
|
|
2406
2410
|
</div>,
|
|
2407
2411
|
}
|
|
2408
2412
|
}
|
|
2413
|
+
toggleVariant="default"
|
|
2409
2414
|
>
|
|
2410
2415
|
<button
|
|
2411
2416
|
aria-expanded={false}
|
|
@@ -2736,6 +2741,7 @@ exports[`optionsMenu right aligned + open up 1`] = `
|
|
|
2736
2741
|
</div>,
|
|
2737
2742
|
}
|
|
2738
2743
|
}
|
|
2744
|
+
toggleVariant="default"
|
|
2739
2745
|
>
|
|
2740
2746
|
<button
|
|
2741
2747
|
aria-expanded={false}
|
|
@@ -3065,6 +3071,7 @@ exports[`optionsMenu right aligned 1`] = `
|
|
|
3065
3071
|
</div>,
|
|
3066
3072
|
}
|
|
3067
3073
|
}
|
|
3074
|
+
toggleVariant="default"
|
|
3068
3075
|
>
|
|
3069
3076
|
<button
|
|
3070
3077
|
aria-expanded={false}
|
|
@@ -393,6 +393,7 @@ exports[`component render custom pagination toggle 1`] = `
|
|
|
393
393
|
</div>,
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
+
toggleVariant="default"
|
|
396
397
|
>
|
|
397
398
|
<button
|
|
398
399
|
aria-expanded={false}
|
|
@@ -1143,6 +1144,7 @@ exports[`component render custom perPageOptions 1`] = `
|
|
|
1143
1144
|
</div>,
|
|
1144
1145
|
}
|
|
1145
1146
|
}
|
|
1147
|
+
toggleVariant="default"
|
|
1146
1148
|
>
|
|
1147
1149
|
<button
|
|
1148
1150
|
aria-expanded={false}
|
|
@@ -1953,6 +1955,7 @@ exports[`component render custom start end 1`] = `
|
|
|
1953
1955
|
</div>,
|
|
1954
1956
|
}
|
|
1955
1957
|
}
|
|
1958
|
+
toggleVariant="default"
|
|
1956
1959
|
>
|
|
1957
1960
|
<button
|
|
1958
1961
|
aria-expanded={false}
|
|
@@ -3251,6 +3254,7 @@ exports[`component render last page 1`] = `
|
|
|
3251
3254
|
</div>,
|
|
3252
3255
|
}
|
|
3253
3256
|
}
|
|
3257
|
+
toggleVariant="default"
|
|
3254
3258
|
>
|
|
3255
3259
|
<button
|
|
3256
3260
|
aria-expanded={false}
|
|
@@ -4061,6 +4065,7 @@ exports[`component render limited number of pages 1`] = `
|
|
|
4061
4065
|
</div>,
|
|
4062
4066
|
}
|
|
4063
4067
|
}
|
|
4068
|
+
toggleVariant="default"
|
|
4064
4069
|
>
|
|
4065
4070
|
<button
|
|
4066
4071
|
aria-expanded={false}
|
|
@@ -4873,6 +4878,7 @@ exports[`component render no items 1`] = `
|
|
|
4873
4878
|
</div>,
|
|
4874
4879
|
}
|
|
4875
4880
|
}
|
|
4881
|
+
toggleVariant="default"
|
|
4876
4882
|
>
|
|
4877
4883
|
<button
|
|
4878
4884
|
aria-expanded={false}
|
|
@@ -5661,6 +5667,7 @@ exports[`component render should render correctly bottom 1`] = `
|
|
|
5661
5667
|
</div>,
|
|
5662
5668
|
}
|
|
5663
5669
|
}
|
|
5670
|
+
toggleVariant="default"
|
|
5664
5671
|
>
|
|
5665
5672
|
<button
|
|
5666
5673
|
aria-expanded={false}
|
|
@@ -6447,6 +6454,7 @@ exports[`component render should render correctly bottom sticky 1`] = `
|
|
|
6447
6454
|
</div>,
|
|
6448
6455
|
}
|
|
6449
6456
|
}
|
|
6457
|
+
toggleVariant="default"
|
|
6450
6458
|
>
|
|
6451
6459
|
<button
|
|
6452
6460
|
aria-expanded={false}
|
|
@@ -7257,6 +7265,7 @@ exports[`component render should render correctly compact 1`] = `
|
|
|
7257
7265
|
</div>,
|
|
7258
7266
|
}
|
|
7259
7267
|
}
|
|
7268
|
+
toggleVariant="default"
|
|
7260
7269
|
>
|
|
7261
7270
|
<button
|
|
7262
7271
|
aria-expanded={false}
|
|
@@ -7929,6 +7938,7 @@ exports[`component render should render correctly disabled 1`] = `
|
|
|
7929
7938
|
</div>,
|
|
7930
7939
|
}
|
|
7931
7940
|
}
|
|
7941
|
+
toggleVariant="default"
|
|
7932
7942
|
>
|
|
7933
7943
|
<button
|
|
7934
7944
|
aria-expanded={false}
|
|
@@ -8741,6 +8751,7 @@ exports[`component render should render correctly sticky 1`] = `
|
|
|
8741
8751
|
</div>,
|
|
8742
8752
|
}
|
|
8743
8753
|
}
|
|
8754
|
+
toggleVariant="default"
|
|
8744
8755
|
>
|
|
8745
8756
|
<button
|
|
8746
8757
|
aria-expanded={false}
|
|
@@ -9551,6 +9562,7 @@ exports[`component render should render correctly top 1`] = `
|
|
|
9551
9562
|
</div>,
|
|
9552
9563
|
}
|
|
9553
9564
|
}
|
|
9565
|
+
toggleVariant="default"
|
|
9554
9566
|
>
|
|
9555
9567
|
<button
|
|
9556
9568
|
aria-expanded={false}
|
|
@@ -10352,6 +10364,7 @@ exports[`component render titles 1`] = `
|
|
|
10352
10364
|
</div>,
|
|
10353
10365
|
}
|
|
10354
10366
|
}
|
|
10367
|
+
toggleVariant="default"
|
|
10355
10368
|
>
|
|
10356
10369
|
<button
|
|
10357
10370
|
aria-expanded={false}
|
|
@@ -11191,6 +11204,7 @@ exports[`component render up drop direction 1`] = `
|
|
|
11191
11204
|
</div>,
|
|
11192
11205
|
}
|
|
11193
11206
|
}
|
|
11207
|
+
toggleVariant="default"
|
|
11194
11208
|
>
|
|
11195
11209
|
<button
|
|
11196
11210
|
aria-expanded={false}
|
|
@@ -12001,6 +12015,7 @@ exports[`component render zero results 1`] = `
|
|
|
12001
12015
|
</div>,
|
|
12002
12016
|
}
|
|
12003
12017
|
}
|
|
12018
|
+
toggleVariant="default"
|
|
12004
12019
|
>
|
|
12005
12020
|
<button
|
|
12006
12021
|
aria-expanded={false}
|
|
@@ -146,6 +146,8 @@ export interface SelectProps
|
|
|
146
146
|
chipGroupComponent?: React.ReactNode;
|
|
147
147
|
/** Flag for retaining keyboard-entered value in typeahead text field when focus leaves input away */
|
|
148
148
|
isInputValuePersisted?: boolean;
|
|
149
|
+
/** @beta Flag for retaining filter results on blur from keyboard-entered typeahead text */
|
|
150
|
+
isInputFilterPersisted?: boolean;
|
|
149
151
|
/** Content rendered in the footer of the select menu */
|
|
150
152
|
footer?: React.ReactNode;
|
|
151
153
|
}
|
|
@@ -217,6 +219,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
217
219
|
ouiaSafe: true,
|
|
218
220
|
chipGroupComponent: null,
|
|
219
221
|
isInputValuePersisted: false,
|
|
222
|
+
isInputFilterPersisted: false,
|
|
220
223
|
isCreateSelectOptionObject: false
|
|
221
224
|
};
|
|
222
225
|
|
|
@@ -319,10 +322,14 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
319
322
|
};
|
|
320
323
|
|
|
321
324
|
onClose = () => {
|
|
325
|
+
const { isInputFilterPersisted } = this.props;
|
|
326
|
+
|
|
322
327
|
this.setState({
|
|
323
328
|
focusFirstOption: false,
|
|
324
329
|
typeaheadInputValue: null,
|
|
325
|
-
|
|
330
|
+
...(!isInputFilterPersisted && {
|
|
331
|
+
typeaheadFilteredChildren: React.Children.toArray(this.props.children)
|
|
332
|
+
}),
|
|
326
333
|
typeaheadCurrIndex: -1,
|
|
327
334
|
tabbedIntoFavoritesMenu: false
|
|
328
335
|
});
|
|
@@ -778,6 +785,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
778
785
|
inputIdPrefix,
|
|
779
786
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
780
787
|
isInputValuePersisted,
|
|
788
|
+
isInputFilterPersisted,
|
|
781
789
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
782
790
|
menuAppendTo,
|
|
783
791
|
favorites,
|