@patternfly/react-core 4.176.0 → 4.179.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/dist/esm/components/Card/Card.d.ts +5 -7
- package/dist/esm/components/Card/Card.d.ts.map +1 -1
- package/dist/esm/components/Card/Card.js +14 -2
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.js +5 -1
- package/dist/esm/components/DragDrop/Droppable.js.map +1 -1
- 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/MenuToggle/MenuToggle.d.ts +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +2 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
- package/dist/esm/components/Popover/Popover.js +2 -22
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/Card/Card.d.ts +5 -7
- package/dist/js/components/Card/Card.d.ts.map +1 -1
- package/dist/js/components/Card/Card.js +14 -2
- package/dist/js/components/Card/Card.js.map +1 -1
- package/dist/js/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Droppable.js +5 -1
- package/dist/js/components/DragDrop/Droppable.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/MenuToggle/MenuToggle.d.ts +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +2 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Popover/Popover.d.ts.map +1 -1
- package/dist/js/components/Popover/Popover.js +2 -22
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Black.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-BlackItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Bold.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-BoldItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Light.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-LightItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Medium.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-MediumItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplay-updated-Regular.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplayVF-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatDisplay/RedHatDisplayVF-updated.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-Bold.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-BoldItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-Light.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-LightItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-Medium.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-MediumItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMono-updated-Regular.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMonoVF-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatMono/RedHatMonoVF-updated.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-Bold.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-BoldItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-Light.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-LightItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-Medium.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-MediumItalic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatText-updated-Regular.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatTextVF-updated-Italic.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/RedHatText/RedHatTextVF-updated.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/modified/RedHatDisplayVF-updated-ItalicModified.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/modified/RedHatDisplayVFModified-updated.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/modified/RedHatTextVF-updated-ItalicModified.woff2 +0 -0
- package/dist/styles/assets/fonts/RedHatFont-updated/modified/RedHatTextVFModified-updated.woff2 +0 -0
- package/dist/styles/base-no-reset.css +121 -0
- package/dist/styles/base.css +121 -15
- package/dist/umd/react-core.css +183 -12
- package/dist/umd/react-core.js +44 -35
- package/dist/umd/react-core.min.css +4004 -3833
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- 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/Card/Card.tsx +23 -17
- package/src/components/Card/__tests__/Card.test.tsx +8 -14
- package/src/components/Card/__tests__/__snapshots__/Card.test.tsx.snap +2 -12
- package/src/components/Card/examples/Card.md +230 -264
- package/src/components/DragDrop/Droppable.tsx +5 -1
- package/src/components/DragDrop/examples/DragDrop.md +2 -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/MenuToggle/MenuToggle.tsx +5 -2
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +5 -0
- package/src/components/MenuToggle/__tests__/__snapshots__/MenuToggle.test.tsx.snap +59 -0
- package/src/components/MenuToggle/examples/MenuToggle.md +60 -67
- 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/Popover/Popover.tsx +1 -19
- package/src/components/Popover/__tests__/Generated/__snapshots__/Popover.test.tsx.snap +0 -1
- package/src/components/Popover/__tests__/__snapshots__/Popover.test.tsx.snap +0 -4
- package/src/demos/Card/Card.md +47 -23
- package/src/demos/CardDemos.md +65 -91
- package/src/demos/Tabs/NestedTabsDemo.js +151 -0
- package/src/demos/Tabs.md +4 -0
- package/src/demos/TextInputGroupDemo.md +8 -246
- package/src/demos/examples/TextInputGroup/AttributeValueFiltering.js +250 -0
- package/src/demos/examples/TextInputGroup/AutoCompleteSearch.js +230 -0
|
@@ -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}
|
|
@@ -334,23 +334,6 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
|
-
const onTriggerEnter = (event: KeyboardEvent) => {
|
|
338
|
-
if (event.keyCode === KEY_CODES.ENTER) {
|
|
339
|
-
if (!visible) {
|
|
340
|
-
if (triggerManually) {
|
|
341
|
-
shouldOpen(show, event);
|
|
342
|
-
} else {
|
|
343
|
-
show(true);
|
|
344
|
-
}
|
|
345
|
-
} else {
|
|
346
|
-
if (triggerManually) {
|
|
347
|
-
shouldClose(null, hide, event);
|
|
348
|
-
} else {
|
|
349
|
-
hide();
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
337
|
const onTriggerClick = (event: MouseEvent) => {
|
|
355
338
|
if (triggerManually) {
|
|
356
339
|
if (visible) {
|
|
@@ -362,7 +345,7 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
362
345
|
if (visible) {
|
|
363
346
|
hide();
|
|
364
347
|
} else {
|
|
365
|
-
show();
|
|
348
|
+
show(true);
|
|
366
349
|
}
|
|
367
350
|
}
|
|
368
351
|
};
|
|
@@ -451,7 +434,6 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
451
434
|
distance={distance}
|
|
452
435
|
placement={position}
|
|
453
436
|
onTriggerClick={onTriggerClick}
|
|
454
|
-
onTriggerEnter={onTriggerEnter}
|
|
455
437
|
onDocumentClick={onDocumentClick}
|
|
456
438
|
onDocumentKeyDown={onDocumentKeyDown}
|
|
457
439
|
enableFlip={enableFlip}
|
|
@@ -27,7 +27,6 @@ exports[`popover can close from content (uncontrolled) 1`] = `
|
|
|
27
27
|
onDocumentClick={[Function]}
|
|
28
28
|
onDocumentKeyDown={[Function]}
|
|
29
29
|
onTriggerClick={[Function]}
|
|
30
|
-
onTriggerEnter={[Function]}
|
|
31
30
|
placement="top"
|
|
32
31
|
popper={
|
|
33
32
|
<FocusTrap
|
|
@@ -150,7 +149,6 @@ exports[`popover can have a custom minimum width 1`] = `
|
|
|
150
149
|
onDocumentClick={[Function]}
|
|
151
150
|
onDocumentKeyDown={[Function]}
|
|
152
151
|
onTriggerClick={[Function]}
|
|
153
|
-
onTriggerEnter={[Function]}
|
|
154
152
|
placement="top"
|
|
155
153
|
popper={
|
|
156
154
|
<FocusTrap
|
|
@@ -256,7 +254,6 @@ exports[`popover can specify position as object value 1`] = `
|
|
|
256
254
|
onDocumentClick={[Function]}
|
|
257
255
|
onDocumentKeyDown={[Function]}
|
|
258
256
|
onTriggerClick={[Function]}
|
|
259
|
-
onTriggerEnter={[Function]}
|
|
260
257
|
placement="right"
|
|
261
258
|
popper={
|
|
262
259
|
<FocusTrap
|
|
@@ -362,7 +359,6 @@ exports[`popover renders close-button, header and body 1`] = `
|
|
|
362
359
|
onDocumentClick={[Function]}
|
|
363
360
|
onDocumentKeyDown={[Function]}
|
|
364
361
|
onTriggerClick={[Function]}
|
|
365
|
-
onTriggerEnter={[Function]}
|
|
366
362
|
placement="top"
|
|
367
363
|
popper={
|
|
368
364
|
<FocusTrap
|
package/src/demos/Card/Card.md
CHANGED
|
@@ -86,8 +86,6 @@ class CardViewBasic extends React.Component {
|
|
|
86
86
|
constructor(props) {
|
|
87
87
|
super(props);
|
|
88
88
|
|
|
89
|
-
this.handleCheckboxClick = this.handleCheckboxClick.bind(this);
|
|
90
|
-
|
|
91
89
|
this.state = {
|
|
92
90
|
filters: {
|
|
93
91
|
products: []
|
|
@@ -199,6 +197,39 @@ class CardViewBasic extends React.Component {
|
|
|
199
197
|
});
|
|
200
198
|
}
|
|
201
199
|
};
|
|
200
|
+
|
|
201
|
+
this.onKeyDown = (event, productId) => {
|
|
202
|
+
console.log(productId);
|
|
203
|
+
if (event.target !== event.currentTarget) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if ([' ', 'Enter'].includes(event.key)) {
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
this.setState(prevState => {
|
|
209
|
+
return prevState.selectedItems.includes(productId*1) ?
|
|
210
|
+
{
|
|
211
|
+
selectedItems: [...prevState.selectedItems.filter(id => productId * 1 != id)],
|
|
212
|
+
areAllSelected: false
|
|
213
|
+
} : {
|
|
214
|
+
selectedItems: [...prevState.selectedItems, productId * 1],
|
|
215
|
+
areAllSelected: prevState.totalItemCount === prevState.selectedItems.length + 1
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
this.onClick = productId => {
|
|
222
|
+
this.setState(prevState => {
|
|
223
|
+
return prevState.selectedItems.includes(productId*1) ?
|
|
224
|
+
{
|
|
225
|
+
selectedItems: [...prevState.selectedItems.filter(id => productId * 1 != id)],
|
|
226
|
+
areAllSelected: false
|
|
227
|
+
} : {
|
|
228
|
+
selectedItems: [...prevState.selectedItems, productId * 1],
|
|
229
|
+
areAllSelected: prevState.totalItemCount === prevState.selectedItems.length + 1
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
};
|
|
202
233
|
}
|
|
203
234
|
|
|
204
235
|
selectedItems(e) {
|
|
@@ -294,24 +325,6 @@ class CardViewBasic extends React.Component {
|
|
|
294
325
|
return collection;
|
|
295
326
|
}
|
|
296
327
|
|
|
297
|
-
handleCheckboxClick(checked, e) {
|
|
298
|
-
const { value } = e.target;
|
|
299
|
-
const { totalItemCount } = this.state;
|
|
300
|
-
|
|
301
|
-
if (checked) {
|
|
302
|
-
const collection = this.getAllItems();
|
|
303
|
-
this.setState(prevState => ({
|
|
304
|
-
selectedItems: [...prevState.selectedItems, value * 1],
|
|
305
|
-
areAllSelected: totalItemCount === prevState.selectedItems.length + 1
|
|
306
|
-
}));
|
|
307
|
-
} else {
|
|
308
|
-
this.setState(prevState => ({
|
|
309
|
-
selectedItems: prevState.selectedItems.filter(item => item != value),
|
|
310
|
-
areAllSelected: false
|
|
311
|
-
}));
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
328
|
updateSelected() {
|
|
316
329
|
const { res, selectedItems } = this.state;
|
|
317
330
|
let rows = res.map(post => {
|
|
@@ -547,7 +560,11 @@ class CardViewBasic extends React.Component {
|
|
|
547
560
|
</PageSection>
|
|
548
561
|
<PageSection isFilled>
|
|
549
562
|
<Gallery hasGutter>
|
|
550
|
-
<Card
|
|
563
|
+
<Card
|
|
564
|
+
isSelectable
|
|
565
|
+
selectableVariant="raised"
|
|
566
|
+
isCompact
|
|
567
|
+
>
|
|
551
568
|
<Bullseye>
|
|
552
569
|
<EmptyState variant={EmptyStateVariant.xs}>
|
|
553
570
|
<EmptyStateIcon icon={PlusCircleIcon} />
|
|
@@ -561,7 +578,15 @@ class CardViewBasic extends React.Component {
|
|
|
561
578
|
</Bullseye>
|
|
562
579
|
</Card>
|
|
563
580
|
{filtered.map((product, key) => (
|
|
564
|
-
<Card
|
|
581
|
+
<Card
|
|
582
|
+
isSelectable
|
|
583
|
+
selectableVariant="raised"
|
|
584
|
+
isCompact
|
|
585
|
+
key={product.name}
|
|
586
|
+
onKeyDown={(e) => this.onKeyDown(e, product.id)}
|
|
587
|
+
onClick={() => this.onClick(product.id)}
|
|
588
|
+
isSelected={selectedItems.includes(product.id)}
|
|
589
|
+
>
|
|
565
590
|
<CardHeader>
|
|
566
591
|
<img src={icons[product.icon]} alt={`${product.name} icon`} style={{ maxWidth: '60px' }} />
|
|
567
592
|
<CardActions>
|
|
@@ -587,7 +612,6 @@ class CardViewBasic extends React.Component {
|
|
|
587
612
|
<Checkbox
|
|
588
613
|
checked={isChecked}
|
|
589
614
|
value={product.id}
|
|
590
|
-
onChange={this.handleCheckboxClick}
|
|
591
615
|
isChecked={selectedItems.includes(product.id)}
|
|
592
616
|
aria-label="card checkbox example"
|
|
593
617
|
id={`check-${product.id}`}
|
package/src/demos/CardDemos.md
CHANGED
|
@@ -1233,10 +1233,8 @@ import {
|
|
|
1233
1233
|
Stack,
|
|
1234
1234
|
StackItem,
|
|
1235
1235
|
Divider,
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
DropdownToggle,
|
|
1239
|
-
DropdownSeparator
|
|
1236
|
+
Select,
|
|
1237
|
+
SelectOption
|
|
1240
1238
|
} from '@patternfly/react-core';
|
|
1241
1239
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
1242
1240
|
import { Chart, ChartStack, ChartBar, ChartTooltip } from '@patternfly/react-charts';
|
|
@@ -1248,16 +1246,11 @@ import chart_color_red_100 from '@patternfly/react-tokens/dist/esm/chart_color_r
|
|
|
1248
1246
|
const UtilizationCard3: React.FunctionComponent = () => {
|
|
1249
1247
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
1250
1248
|
|
|
1251
|
-
const
|
|
1252
|
-
<
|
|
1253
|
-
<
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
<DropdownItem key="disabled link" isDisabled href="www.google.com">
|
|
1257
|
-
Disabled link
|
|
1258
|
-
</DropdownItem>,
|
|
1259
|
-
<DropdownSeparator key="separator" />,
|
|
1260
|
-
<DropdownItem key="separated link">Separated link</DropdownItem>
|
|
1249
|
+
const selectItems = [
|
|
1250
|
+
<SelectOption value="Last hour" key="option1" />,
|
|
1251
|
+
<SelectOption value="Last 6 hours" key="option2" />,
|
|
1252
|
+
<SelectOption value="Last 24 hours" key="option3" />,
|
|
1253
|
+
<SelectOption value="Last 7 days" key="option4" />
|
|
1261
1254
|
];
|
|
1262
1255
|
|
|
1263
1256
|
return (
|
|
@@ -1271,13 +1264,16 @@ const UtilizationCard3: React.FunctionComponent = () => {
|
|
|
1271
1264
|
</Title>
|
|
1272
1265
|
</CardTitle>
|
|
1273
1266
|
<CardActions>
|
|
1274
|
-
<
|
|
1267
|
+
<Select
|
|
1275
1268
|
onSelect={() => setIsOpen(!isOpen)}
|
|
1276
|
-
|
|
1269
|
+
onToggle={() => setIsOpen(!isOpen)}
|
|
1277
1270
|
isOpen={isOpen}
|
|
1278
|
-
|
|
1271
|
+
placeholderText="Filter"
|
|
1279
1272
|
position="right"
|
|
1280
|
-
|
|
1273
|
+
isPlain
|
|
1274
|
+
>
|
|
1275
|
+
{selectItems}
|
|
1276
|
+
</Select>
|
|
1281
1277
|
</CardActions>
|
|
1282
1278
|
</CardHeader>
|
|
1283
1279
|
<CardBody>
|
|
@@ -2427,26 +2423,20 @@ import {
|
|
|
2427
2423
|
GalleryItem,
|
|
2428
2424
|
Flex,
|
|
2429
2425
|
FlexItem,
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
DropdownToggle
|
|
2426
|
+
Divider,
|
|
2427
|
+
Select,
|
|
2428
|
+
SelectOption
|
|
2434
2429
|
} from '@patternfly/react-core';
|
|
2435
2430
|
import { ChartArea, ChartContainer, ChartGroup, ChartLabel, ChartVoronoiContainer } from '@patternfly/react-charts';
|
|
2436
2431
|
|
|
2437
2432
|
const TrendCard1: React.FunctionComponent = () => {
|
|
2438
2433
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
2439
2434
|
|
|
2440
|
-
const
|
|
2441
|
-
<
|
|
2442
|
-
<
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
<DropdownItem key="disabled link" isDisabled href="www.google.com">
|
|
2446
|
-
Disabled link
|
|
2447
|
-
</DropdownItem>,
|
|
2448
|
-
<DropdownSeparator key="separator" />,
|
|
2449
|
-
<DropdownItem key="separated link">Separated link</DropdownItem>
|
|
2435
|
+
const selectItems = [
|
|
2436
|
+
<SelectOption value="Last hour" key="option1" />,
|
|
2437
|
+
<SelectOption value="Last 6 hours" key="option2" />,
|
|
2438
|
+
<SelectOption value="Last 24 hours" key="option3" />,
|
|
2439
|
+
<SelectOption value="Last 7 days" key="option4" />
|
|
2450
2440
|
];
|
|
2451
2441
|
return (
|
|
2452
2442
|
<Gallery hasGutter minWidths={{ default: '360px' }}>
|
|
@@ -2464,13 +2454,16 @@ const TrendCard1: React.FunctionComponent = () => {
|
|
|
2464
2454
|
</FlexItem>
|
|
2465
2455
|
</Flex>
|
|
2466
2456
|
<CardActions>
|
|
2467
|
-
<
|
|
2457
|
+
<Select
|
|
2468
2458
|
onSelect={() => setIsOpen(!isOpen)}
|
|
2469
|
-
|
|
2459
|
+
onToggle={() => setIsOpen(!isOpen)}
|
|
2460
|
+
placeholderText="Filter"
|
|
2470
2461
|
isOpen={isOpen}
|
|
2471
|
-
dropdownItems={dropdownItems}
|
|
2472
2462
|
position="right"
|
|
2473
|
-
|
|
2463
|
+
isPlain
|
|
2464
|
+
>
|
|
2465
|
+
{selectItems}
|
|
2466
|
+
</Select>
|
|
2474
2467
|
</CardActions>
|
|
2475
2468
|
</CardHeader>
|
|
2476
2469
|
<CardBody>
|
|
@@ -2600,39 +2593,27 @@ import {
|
|
|
2600
2593
|
DescriptionListGroup,
|
|
2601
2594
|
DescriptionListTerm,
|
|
2602
2595
|
DescriptionListDescription,
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
DropdownToggle,
|
|
2596
|
+
Select,
|
|
2597
|
+
SelectOption,
|
|
2606
2598
|
Divider
|
|
2607
2599
|
} from '@patternfly/react-core';
|
|
2608
2600
|
|
|
2609
2601
|
CardLogViewDemo = () => {
|
|
2610
|
-
const [
|
|
2602
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
2611
2603
|
|
|
2612
2604
|
const onActionSelect = event => {
|
|
2613
|
-
|
|
2605
|
+
setIsOpen(!isOpen);
|
|
2614
2606
|
};
|
|
2615
2607
|
|
|
2616
2608
|
const onActionToggle = isOpen => {
|
|
2617
|
-
|
|
2609
|
+
setIsOpen(isOpen);
|
|
2618
2610
|
};
|
|
2619
2611
|
|
|
2620
|
-
const
|
|
2621
|
-
<
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
<
|
|
2625
|
-
Action
|
|
2626
|
-
</DropdownItem>,
|
|
2627
|
-
<DropdownItem key="disabled action3" isDisabled component="a">
|
|
2628
|
-
Disabled link
|
|
2629
|
-
</DropdownItem>,
|
|
2630
|
-
<DropdownItem key="action4" component="button">
|
|
2631
|
-
Disabled action
|
|
2632
|
-
</DropdownItem>,
|
|
2633
|
-
<DropdownItem key="action5" component="a">
|
|
2634
|
-
Separated link
|
|
2635
|
-
</DropdownItem>
|
|
2612
|
+
const selectItems = [
|
|
2613
|
+
<SelectOption value="Most recent" key="option1" />,
|
|
2614
|
+
<SelectOption value="Last 6 hours" key="option2" />,
|
|
2615
|
+
<SelectOption value="Last 24 hours" key="option3" />,
|
|
2616
|
+
<SelectOption value="Last 7 days" key="option4" />
|
|
2636
2617
|
];
|
|
2637
2618
|
|
|
2638
2619
|
return (
|
|
@@ -2640,13 +2621,16 @@ CardLogViewDemo = () => {
|
|
|
2640
2621
|
<Card id="card-log-view-example">
|
|
2641
2622
|
<CardHeader>
|
|
2642
2623
|
<CardActions>
|
|
2643
|
-
<
|
|
2624
|
+
<Select
|
|
2644
2625
|
onSelect={onActionSelect}
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2626
|
+
onToggle={onActionToggle}
|
|
2627
|
+
placeholderText="Most recent"
|
|
2628
|
+
isOpen={isOpen}
|
|
2648
2629
|
position="right"
|
|
2649
|
-
|
|
2630
|
+
isPlain
|
|
2631
|
+
>
|
|
2632
|
+
{selectItems}
|
|
2633
|
+
</Select>
|
|
2650
2634
|
</CardActions>
|
|
2651
2635
|
<CardTitle>
|
|
2652
2636
|
<Title headingLevel="h2" size="xl">
|
|
@@ -2721,41 +2705,28 @@ import {
|
|
|
2721
2705
|
DescriptionListTerm,
|
|
2722
2706
|
DescriptionListDescription,
|
|
2723
2707
|
Spinner,
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
DropdownToggle,
|
|
2708
|
+
Select,
|
|
2709
|
+
SelectOption,
|
|
2727
2710
|
Divider
|
|
2728
2711
|
} from '@patternfly/react-core';
|
|
2729
2712
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
2730
2713
|
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
2731
2714
|
|
|
2732
2715
|
CardEventViewDemo = () => {
|
|
2733
|
-
const [
|
|
2716
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
2734
2717
|
|
|
2735
2718
|
const onActionSelect = event => {
|
|
2736
|
-
|
|
2719
|
+
setIsOpen(!isOpen);
|
|
2737
2720
|
};
|
|
2738
2721
|
|
|
2739
2722
|
const onActionToggle = isOpen => {
|
|
2740
|
-
|
|
2723
|
+
setIsOpen(isOpen);
|
|
2741
2724
|
};
|
|
2742
|
-
|
|
2743
|
-
const
|
|
2744
|
-
<
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
<DropdownItem key="action2" component="button">
|
|
2748
|
-
Action
|
|
2749
|
-
</DropdownItem>,
|
|
2750
|
-
<DropdownItem key="disabled action3" isDisabled component="a">
|
|
2751
|
-
Disabled link
|
|
2752
|
-
</DropdownItem>,
|
|
2753
|
-
<DropdownItem key="disabled action4" isDisabled component="button">
|
|
2754
|
-
Disabled action
|
|
2755
|
-
</DropdownItem>,
|
|
2756
|
-
<DropdownItem key="action5" component="a">
|
|
2757
|
-
Separated link
|
|
2758
|
-
</DropdownItem>
|
|
2725
|
+
|
|
2726
|
+
const selectItems = [
|
|
2727
|
+
<SelectOption value="Success" key="option1" />,
|
|
2728
|
+
<SelectOption value="Error" key="option2" />,
|
|
2729
|
+
<SelectOption value="Warning" key="option3" />
|
|
2759
2730
|
];
|
|
2760
2731
|
|
|
2761
2732
|
return (
|
|
@@ -2763,13 +2734,16 @@ CardEventViewDemo = () => {
|
|
|
2763
2734
|
<Card id="card-events-view-example">
|
|
2764
2735
|
<CardHeader>
|
|
2765
2736
|
<CardActions>
|
|
2766
|
-
<
|
|
2737
|
+
<Select
|
|
2767
2738
|
onSelect={onActionSelect}
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2739
|
+
onToggle={onActionToggle}
|
|
2740
|
+
placeholderText="Status"
|
|
2741
|
+
isOpen={isOpen}
|
|
2771
2742
|
position="right"
|
|
2772
|
-
|
|
2743
|
+
isPlain
|
|
2744
|
+
>
|
|
2745
|
+
{selectItems}
|
|
2746
|
+
</Select>
|
|
2773
2747
|
</CardActions>
|
|
2774
2748
|
<CardTitle>
|
|
2775
2749
|
<Title headingLevel="h2" size="xl">
|