@patternfly/react-core 4.169.1 → 4.170.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 +35 -0
- package/dist/esm/components/FileUpload/FileUpload.d.ts +11 -3
- package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.js +28 -5
- package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.d.ts +2 -0
- package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.js +2 -1
- package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +2 -0
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js +2 -2
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +2 -0
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +15 -12
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/Popover/Popover.d.ts +2 -0
- package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
- package/dist/esm/components/Popover/Popover.js +5 -3
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/PopoverContext.d.ts +7 -0
- package/dist/esm/components/Popover/PopoverContext.d.ts.map +1 -0
- package/dist/esm/components/Popover/PopoverContext.js +3 -0
- package/dist/esm/components/Popover/PopoverContext.js.map +1 -0
- package/dist/esm/components/Popover/PopoverHeader.d.ts.map +1 -1
- package/dist/esm/components/Popover/PopoverHeader.js +2 -1
- package/dist/esm/components/Popover/PopoverHeader.js.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts +11 -3
- package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.js +27 -4
- package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.d.ts +2 -0
- package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.js +2 -1
- package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +2 -0
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js +2 -2
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +1 -1
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +2 -0
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +15 -12
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/Popover/Popover.d.ts +2 -0
- package/dist/js/components/Popover/Popover.d.ts.map +1 -1
- package/dist/js/components/Popover/Popover.js +5 -3
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/Popover/PopoverContext.d.ts +7 -0
- package/dist/js/components/Popover/PopoverContext.d.ts.map +1 -0
- package/dist/js/components/Popover/PopoverContext.js +7 -0
- package/dist/js/components/Popover/PopoverContext.js.map +1 -0
- package/dist/js/components/Popover/PopoverHeader.d.ts.map +1 -1
- package/dist/js/components/Popover/PopoverHeader.js +2 -1
- package/dist/js/components/Popover/PopoverHeader.js.map +1 -1
- package/dist/umd/react-core.css +59 -39
- package/dist/umd/react-core.js +1599 -1309
- package/dist/umd/react-core.min.css +47 -27
- package/dist/umd/react-core.min.js +5 -6
- package/package.json +7 -7
- package/src/components/FileUpload/FileUpload.tsx +77 -30
- package/src/components/FileUpload/FileUploadField.tsx +5 -0
- package/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap +3 -7
- package/src/components/FileUpload/examples/FileUpload.md +54 -17
- package/src/components/Modal/examples/Modal.md +203 -0
- package/src/components/Pagination/OptionsToggle.tsx +5 -1
- package/src/components/Pagination/Pagination.tsx +1 -0
- package/src/components/Pagination/PaginationOptionsMenu.tsx +18 -10
- package/src/components/Pagination/__tests__/Generated/__snapshots__/Pagination.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/Generated/__snapshots__/PaginationOptionsMenu.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +62 -0
- package/src/components/Popover/Popover.tsx +24 -18
- package/src/components/Popover/PopoverContext.tsx +7 -0
- package/src/components/Popover/PopoverHeader.tsx +8 -3
- package/src/components/Popover/__tests__/Generated/__snapshots__/Popover.test.tsx.snap +91 -83
- package/src/components/Popover/__tests__/Generated/__snapshots__/PopoverHeader.test.tsx.snap +3 -9
- package/src/components/Popover/__tests__/__snapshots__/Popover.test.tsx.snap +406 -374
|
@@ -35,6 +35,8 @@ export interface OptionsToggleProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
35
35
|
toggleTemplate?: ((props: ToggleTemplateProps) => React.ReactElement) | string;
|
|
36
36
|
/** Callback for toggle open on keyboard entry */
|
|
37
37
|
onEnter?: () => void;
|
|
38
|
+
/** Label for the English word "of" */
|
|
39
|
+
ofWord?: string;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
let toggleId = 0;
|
|
@@ -43,6 +45,7 @@ export const OptionsToggle: React.FunctionComponent<OptionsToggleProps> = ({
|
|
|
43
45
|
optionsToggle = 'Items per page',
|
|
44
46
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
47
|
itemsPerPageTitle = 'Items per page',
|
|
48
|
+
ofWord = 'of',
|
|
46
49
|
firstIndex = 0,
|
|
47
50
|
lastIndex = 0,
|
|
48
51
|
itemCount = 0,
|
|
@@ -68,11 +71,12 @@ export const OptionsToggle: React.FunctionComponent<OptionsToggleProps> = ({
|
|
|
68
71
|
<React.Fragment>
|
|
69
72
|
<span className={css(styles.optionsMenuToggleText)}>
|
|
70
73
|
{typeof ToggleTemplate === 'string' ? (
|
|
71
|
-
fillTemplate(ToggleTemplate, { firstIndex, lastIndex, itemCount, itemsTitle })
|
|
74
|
+
fillTemplate(ToggleTemplate, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle })
|
|
72
75
|
) : (
|
|
73
76
|
<ToggleTemplate
|
|
74
77
|
firstIndex={firstIndex}
|
|
75
78
|
lastIndex={lastIndex}
|
|
79
|
+
ofWord={ofWord}
|
|
76
80
|
itemCount={itemCount}
|
|
77
81
|
itemsTitle={itemsTitle}
|
|
78
82
|
/>
|
|
@@ -305,6 +305,7 @@ export class Pagination extends React.Component<PaginationProps, { ouiaStateId:
|
|
|
305
305
|
perPageOptions={perPageOptions}
|
|
306
306
|
firstIndex={itemsStart !== null ? itemsStart : firstIndex}
|
|
307
307
|
lastIndex={itemsEnd !== null ? itemsEnd : lastIndex}
|
|
308
|
+
ofWord={titles.ofWord}
|
|
308
309
|
defaultToFullPage={defaultToFullPage}
|
|
309
310
|
itemCount={itemCount}
|
|
310
311
|
page={page}
|
|
@@ -44,6 +44,8 @@ export interface PaginationOptionsMenuProps extends React.HTMLProps<HTMLDivEleme
|
|
|
44
44
|
toggleTemplate?: ((props: ToggleTemplateProps) => React.ReactElement) | string;
|
|
45
45
|
/** Function called when user selects number of items per page. */
|
|
46
46
|
onPerPageSelect?: OnPerPageSelect;
|
|
47
|
+
/** Label for the English word "of" */
|
|
48
|
+
ofWord?: string;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
interface PaginationOptionsMenuState {
|
|
@@ -62,20 +64,13 @@ export class PaginationOptionsMenu extends React.Component<PaginationOptionsMenu
|
|
|
62
64
|
itemsPerPageTitle: 'Items per page',
|
|
63
65
|
perPageSuffix: 'per page',
|
|
64
66
|
optionsToggle: 'Items per page',
|
|
67
|
+
ofWord: 'of',
|
|
65
68
|
perPage: 0,
|
|
66
69
|
firstIndex: 0,
|
|
67
70
|
lastIndex: 0,
|
|
68
71
|
defaultToFullPage: false,
|
|
69
72
|
itemCount: 0,
|
|
70
73
|
itemsTitle: 'items',
|
|
71
|
-
toggleTemplate: ({ firstIndex, lastIndex, itemCount, itemsTitle }: ToggleTemplateProps) => (
|
|
72
|
-
<React.Fragment>
|
|
73
|
-
<b>
|
|
74
|
-
{firstIndex} - {lastIndex}
|
|
75
|
-
</b>{' '}
|
|
76
|
-
of<b>{itemCount}</b> {itemsTitle}
|
|
77
|
-
</React.Fragment>
|
|
78
|
-
),
|
|
79
74
|
onPerPageSelect: () => null as any
|
|
80
75
|
};
|
|
81
76
|
|
|
@@ -148,7 +143,8 @@ export class PaginationOptionsMenu extends React.Component<PaginationOptionsMenu
|
|
|
148
143
|
firstIndex,
|
|
149
144
|
lastIndex,
|
|
150
145
|
itemCount,
|
|
151
|
-
itemsTitle
|
|
146
|
+
itemsTitle,
|
|
147
|
+
ofWord
|
|
152
148
|
} = this.props;
|
|
153
149
|
const { isOpen } = this.state;
|
|
154
150
|
|
|
@@ -184,7 +180,19 @@ export class PaginationOptionsMenu extends React.Component<PaginationOptionsMenu
|
|
|
184
180
|
lastIndex={lastIndex}
|
|
185
181
|
itemCount={itemCount}
|
|
186
182
|
itemsTitle={itemsTitle}
|
|
187
|
-
|
|
183
|
+
ofWord={ofWord}
|
|
184
|
+
toggleTemplate={
|
|
185
|
+
toggleTemplate
|
|
186
|
+
? toggleTemplate
|
|
187
|
+
: ({ firstIndex, lastIndex, itemCount, ofWord, itemsTitle }: ToggleTemplateProps) => (
|
|
188
|
+
<React.Fragment>
|
|
189
|
+
<b>
|
|
190
|
+
{firstIndex} - {lastIndex}
|
|
191
|
+
</b>{' '}
|
|
192
|
+
{ofWord} <b>{itemCount}</b> {itemsTitle}
|
|
193
|
+
</React.Fragment>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
188
196
|
parentRef={this.parentRef.current}
|
|
189
197
|
isDisabled={isDisabled}
|
|
190
198
|
/>
|
|
@@ -104,6 +104,7 @@ exports[`component render custom pagination toggle 1`] = `
|
|
|
104
104
|
itemsTitle=""
|
|
105
105
|
lastIndex={10}
|
|
106
106
|
lastPage={4}
|
|
107
|
+
ofWord="of"
|
|
107
108
|
onPerPageSelect={[Function]}
|
|
108
109
|
optionsToggle="Items per page"
|
|
109
110
|
page={1}
|
|
@@ -200,6 +201,7 @@ exports[`component render custom pagination toggle 1`] = `
|
|
|
200
201
|
itemsPerPageTitle="Items per page"
|
|
201
202
|
itemsTitle=""
|
|
202
203
|
lastIndex={10}
|
|
204
|
+
ofWord="of"
|
|
203
205
|
onToggle={[Function]}
|
|
204
206
|
optionsToggle="Items per page"
|
|
205
207
|
parentRef={null}
|
|
@@ -227,6 +229,7 @@ exports[`component render custom pagination toggle 1`] = `
|
|
|
227
229
|
itemsTitle=""
|
|
228
230
|
key=".0"
|
|
229
231
|
lastIndex={10}
|
|
232
|
+
ofWord="of"
|
|
230
233
|
onEnter={[Function]}
|
|
231
234
|
onToggle={[Function]}
|
|
232
235
|
optionsToggle="Items per page"
|
|
@@ -844,6 +847,7 @@ exports[`component render custom perPageOptions 1`] = `
|
|
|
844
847
|
itemsTitle=""
|
|
845
848
|
lastIndex={10}
|
|
846
849
|
lastPage={4}
|
|
850
|
+
ofWord="of"
|
|
847
851
|
onPerPageSelect={[Function]}
|
|
848
852
|
optionsToggle="Items per page"
|
|
849
853
|
page={1}
|
|
@@ -892,6 +896,7 @@ exports[`component render custom perPageOptions 1`] = `
|
|
|
892
896
|
itemsPerPageTitle="Items per page"
|
|
893
897
|
itemsTitle=""
|
|
894
898
|
lastIndex={10}
|
|
899
|
+
ofWord="of"
|
|
895
900
|
onToggle={[Function]}
|
|
896
901
|
optionsToggle="Items per page"
|
|
897
902
|
parentRef={null}
|
|
@@ -919,6 +924,7 @@ exports[`component render custom perPageOptions 1`] = `
|
|
|
919
924
|
itemsTitle=""
|
|
920
925
|
key=".0"
|
|
921
926
|
lastIndex={10}
|
|
927
|
+
ofWord="of"
|
|
922
928
|
onEnter={[Function]}
|
|
923
929
|
onToggle={[Function]}
|
|
924
930
|
optionsToggle="Items per page"
|
|
@@ -996,6 +1002,7 @@ exports[`component render custom perPageOptions 1`] = `
|
|
|
996
1002
|
itemCount={40}
|
|
997
1003
|
itemsTitle=""
|
|
998
1004
|
lastIndex={10}
|
|
1005
|
+
ofWord="of"
|
|
999
1006
|
>
|
|
1000
1007
|
<b>
|
|
1001
1008
|
1
|
|
@@ -1602,6 +1609,7 @@ exports[`component render custom start end 1`] = `
|
|
|
1602
1609
|
itemsTitle=""
|
|
1603
1610
|
lastIndex={15}
|
|
1604
1611
|
lastPage={4}
|
|
1612
|
+
ofWord="of"
|
|
1605
1613
|
onPerPageSelect={[Function]}
|
|
1606
1614
|
optionsToggle="Items per page"
|
|
1607
1615
|
page={1}
|
|
@@ -1698,6 +1706,7 @@ exports[`component render custom start end 1`] = `
|
|
|
1698
1706
|
itemsPerPageTitle="Items per page"
|
|
1699
1707
|
itemsTitle=""
|
|
1700
1708
|
lastIndex={15}
|
|
1709
|
+
ofWord="of"
|
|
1701
1710
|
onToggle={[Function]}
|
|
1702
1711
|
optionsToggle="Items per page"
|
|
1703
1712
|
parentRef={null}
|
|
@@ -1725,6 +1734,7 @@ exports[`component render custom start end 1`] = `
|
|
|
1725
1734
|
itemsTitle=""
|
|
1726
1735
|
key=".0"
|
|
1727
1736
|
lastIndex={15}
|
|
1737
|
+
ofWord="of"
|
|
1728
1738
|
onEnter={[Function]}
|
|
1729
1739
|
onToggle={[Function]}
|
|
1730
1740
|
optionsToggle="Items per page"
|
|
@@ -1802,6 +1812,7 @@ exports[`component render custom start end 1`] = `
|
|
|
1802
1812
|
itemCount={40}
|
|
1803
1813
|
itemsTitle=""
|
|
1804
1814
|
lastIndex={15}
|
|
1815
|
+
ofWord="of"
|
|
1805
1816
|
>
|
|
1806
1817
|
<b>
|
|
1807
1818
|
5
|
|
@@ -2387,6 +2398,7 @@ exports[`component render empty per page options 1`] = `
|
|
|
2387
2398
|
itemsTitle=""
|
|
2388
2399
|
lastIndex={10}
|
|
2389
2400
|
lastPage={4}
|
|
2401
|
+
ofWord="of"
|
|
2390
2402
|
onPerPageSelect={[Function]}
|
|
2391
2403
|
optionsToggle="Items per page"
|
|
2392
2404
|
page={1}
|
|
@@ -2416,6 +2428,7 @@ exports[`component render empty per page options 1`] = `
|
|
|
2416
2428
|
itemsPerPageTitle="Items per page"
|
|
2417
2429
|
itemsTitle=""
|
|
2418
2430
|
lastIndex={10}
|
|
2431
|
+
ofWord="of"
|
|
2419
2432
|
onToggle={[Function]}
|
|
2420
2433
|
optionsToggle="Items per page"
|
|
2421
2434
|
parentRef={null}
|
|
@@ -2443,6 +2456,7 @@ exports[`component render empty per page options 1`] = `
|
|
|
2443
2456
|
itemsTitle=""
|
|
2444
2457
|
key=".0"
|
|
2445
2458
|
lastIndex={10}
|
|
2459
|
+
ofWord="of"
|
|
2446
2460
|
onEnter={[Function]}
|
|
2447
2461
|
onToggle={[Function]}
|
|
2448
2462
|
optionsToggle="Items per page"
|
|
@@ -2867,6 +2881,7 @@ exports[`component render last page 1`] = `
|
|
|
2867
2881
|
itemsTitle=""
|
|
2868
2882
|
lastIndex={20}
|
|
2869
2883
|
lastPage={2}
|
|
2884
|
+
ofWord="of"
|
|
2870
2885
|
onPerPageSelect={[Function]}
|
|
2871
2886
|
optionsToggle="Items per page"
|
|
2872
2887
|
page={2}
|
|
@@ -2963,6 +2978,7 @@ exports[`component render last page 1`] = `
|
|
|
2963
2978
|
itemsPerPageTitle="Items per page"
|
|
2964
2979
|
itemsTitle=""
|
|
2965
2980
|
lastIndex={20}
|
|
2981
|
+
ofWord="of"
|
|
2966
2982
|
onToggle={[Function]}
|
|
2967
2983
|
optionsToggle="Items per page"
|
|
2968
2984
|
parentRef={null}
|
|
@@ -2990,6 +3006,7 @@ exports[`component render last page 1`] = `
|
|
|
2990
3006
|
itemsTitle=""
|
|
2991
3007
|
key=".0"
|
|
2992
3008
|
lastIndex={20}
|
|
3009
|
+
ofWord="of"
|
|
2993
3010
|
onEnter={[Function]}
|
|
2994
3011
|
onToggle={[Function]}
|
|
2995
3012
|
optionsToggle="Items per page"
|
|
@@ -3067,6 +3084,7 @@ exports[`component render last page 1`] = `
|
|
|
3067
3084
|
itemCount={20}
|
|
3068
3085
|
itemsTitle=""
|
|
3069
3086
|
lastIndex={20}
|
|
3087
|
+
ofWord="of"
|
|
3070
3088
|
>
|
|
3071
3089
|
<b>
|
|
3072
3090
|
11
|
|
@@ -3673,6 +3691,7 @@ exports[`component render limited number of pages 1`] = `
|
|
|
3673
3691
|
itemsTitle=""
|
|
3674
3692
|
lastIndex={20}
|
|
3675
3693
|
lastPage={1}
|
|
3694
|
+
ofWord="of"
|
|
3676
3695
|
onPerPageSelect={[Function]}
|
|
3677
3696
|
optionsToggle="Items per page"
|
|
3678
3697
|
page={1}
|
|
@@ -3769,6 +3788,7 @@ exports[`component render limited number of pages 1`] = `
|
|
|
3769
3788
|
itemsPerPageTitle="Items per page"
|
|
3770
3789
|
itemsTitle=""
|
|
3771
3790
|
lastIndex={20}
|
|
3791
|
+
ofWord="of"
|
|
3772
3792
|
onToggle={[Function]}
|
|
3773
3793
|
optionsToggle="Items per page"
|
|
3774
3794
|
parentRef={null}
|
|
@@ -3796,6 +3816,7 @@ exports[`component render limited number of pages 1`] = `
|
|
|
3796
3816
|
itemsTitle=""
|
|
3797
3817
|
key=".0"
|
|
3798
3818
|
lastIndex={20}
|
|
3819
|
+
ofWord="of"
|
|
3799
3820
|
onEnter={[Function]}
|
|
3800
3821
|
onToggle={[Function]}
|
|
3801
3822
|
optionsToggle="Items per page"
|
|
@@ -3873,6 +3894,7 @@ exports[`component render limited number of pages 1`] = `
|
|
|
3873
3894
|
itemCount={20}
|
|
3874
3895
|
itemsTitle=""
|
|
3875
3896
|
lastIndex={20}
|
|
3897
|
+
ofWord="of"
|
|
3876
3898
|
>
|
|
3877
3899
|
<b>
|
|
3878
3900
|
1
|
|
@@ -4481,6 +4503,7 @@ exports[`component render no items 1`] = `
|
|
|
4481
4503
|
itemsTitle=""
|
|
4482
4504
|
lastIndex={0}
|
|
4483
4505
|
lastPage={0}
|
|
4506
|
+
ofWord="of"
|
|
4484
4507
|
onPerPageSelect={[Function]}
|
|
4485
4508
|
optionsToggle="Items per page"
|
|
4486
4509
|
page={0}
|
|
@@ -4577,6 +4600,7 @@ exports[`component render no items 1`] = `
|
|
|
4577
4600
|
itemsPerPageTitle="Items per page"
|
|
4578
4601
|
itemsTitle=""
|
|
4579
4602
|
lastIndex={0}
|
|
4603
|
+
ofWord="of"
|
|
4580
4604
|
onToggle={[Function]}
|
|
4581
4605
|
optionsToggle="Items per page"
|
|
4582
4606
|
parentRef={null}
|
|
@@ -4604,6 +4628,7 @@ exports[`component render no items 1`] = `
|
|
|
4604
4628
|
itemsTitle=""
|
|
4605
4629
|
key=".0"
|
|
4606
4630
|
lastIndex={0}
|
|
4631
|
+
ofWord="of"
|
|
4607
4632
|
onEnter={[Function]}
|
|
4608
4633
|
onToggle={[Function]}
|
|
4609
4634
|
optionsToggle="Items per page"
|
|
@@ -4682,6 +4707,7 @@ exports[`component render no items 1`] = `
|
|
|
4682
4707
|
itemCount={0}
|
|
4683
4708
|
itemsTitle=""
|
|
4684
4709
|
lastIndex={0}
|
|
4710
|
+
ofWord="of"
|
|
4685
4711
|
>
|
|
4686
4712
|
<b>
|
|
4687
4713
|
0
|
|
@@ -5268,6 +5294,7 @@ exports[`component render should render correctly bottom 1`] = `
|
|
|
5268
5294
|
itemsTitle=""
|
|
5269
5295
|
lastIndex={10}
|
|
5270
5296
|
lastPage={2}
|
|
5297
|
+
ofWord="of"
|
|
5271
5298
|
onPerPageSelect={[Function]}
|
|
5272
5299
|
optionsToggle="Items per page"
|
|
5273
5300
|
page={1}
|
|
@@ -5364,6 +5391,7 @@ exports[`component render should render correctly bottom 1`] = `
|
|
|
5364
5391
|
itemsPerPageTitle="Items per page"
|
|
5365
5392
|
itemsTitle=""
|
|
5366
5393
|
lastIndex={10}
|
|
5394
|
+
ofWord="of"
|
|
5367
5395
|
onToggle={[Function]}
|
|
5368
5396
|
optionsToggle="Items per page"
|
|
5369
5397
|
parentRef={null}
|
|
@@ -5391,6 +5419,7 @@ exports[`component render should render correctly bottom 1`] = `
|
|
|
5391
5419
|
itemsTitle=""
|
|
5392
5420
|
key=".0"
|
|
5393
5421
|
lastIndex={10}
|
|
5422
|
+
ofWord="of"
|
|
5394
5423
|
onEnter={[Function]}
|
|
5395
5424
|
onToggle={[Function]}
|
|
5396
5425
|
optionsToggle="Items per page"
|
|
@@ -5468,6 +5497,7 @@ exports[`component render should render correctly bottom 1`] = `
|
|
|
5468
5497
|
itemCount={20}
|
|
5469
5498
|
itemsTitle=""
|
|
5470
5499
|
lastIndex={10}
|
|
5500
|
+
ofWord="of"
|
|
5471
5501
|
>
|
|
5472
5502
|
<b>
|
|
5473
5503
|
1
|
|
@@ -6050,6 +6080,7 @@ exports[`component render should render correctly bottom sticky 1`] = `
|
|
|
6050
6080
|
itemsTitle=""
|
|
6051
6081
|
lastIndex={10}
|
|
6052
6082
|
lastPage={2}
|
|
6083
|
+
ofWord="of"
|
|
6053
6084
|
onPerPageSelect={[Function]}
|
|
6054
6085
|
optionsToggle="Items per page"
|
|
6055
6086
|
page={1}
|
|
@@ -6146,6 +6177,7 @@ exports[`component render should render correctly bottom sticky 1`] = `
|
|
|
6146
6177
|
itemsPerPageTitle="Items per page"
|
|
6147
6178
|
itemsTitle=""
|
|
6148
6179
|
lastIndex={10}
|
|
6180
|
+
ofWord="of"
|
|
6149
6181
|
onToggle={[Function]}
|
|
6150
6182
|
optionsToggle="Items per page"
|
|
6151
6183
|
parentRef={null}
|
|
@@ -6173,6 +6205,7 @@ exports[`component render should render correctly bottom sticky 1`] = `
|
|
|
6173
6205
|
itemsTitle=""
|
|
6174
6206
|
key=".0"
|
|
6175
6207
|
lastIndex={10}
|
|
6208
|
+
ofWord="of"
|
|
6176
6209
|
onEnter={[Function]}
|
|
6177
6210
|
onToggle={[Function]}
|
|
6178
6211
|
optionsToggle="Items per page"
|
|
@@ -6250,6 +6283,7 @@ exports[`component render should render correctly bottom sticky 1`] = `
|
|
|
6250
6283
|
itemCount={20}
|
|
6251
6284
|
itemsTitle=""
|
|
6252
6285
|
lastIndex={10}
|
|
6286
|
+
ofWord="of"
|
|
6253
6287
|
>
|
|
6254
6288
|
<b>
|
|
6255
6289
|
1
|
|
@@ -6856,6 +6890,7 @@ exports[`component render should render correctly compact 1`] = `
|
|
|
6856
6890
|
itemsTitle=""
|
|
6857
6891
|
lastIndex={10}
|
|
6858
6892
|
lastPage={2}
|
|
6893
|
+
ofWord="of"
|
|
6859
6894
|
onPerPageSelect={[Function]}
|
|
6860
6895
|
optionsToggle="Items per page"
|
|
6861
6896
|
page={1}
|
|
@@ -6952,6 +6987,7 @@ exports[`component render should render correctly compact 1`] = `
|
|
|
6952
6987
|
itemsPerPageTitle="Items per page"
|
|
6953
6988
|
itemsTitle=""
|
|
6954
6989
|
lastIndex={10}
|
|
6990
|
+
ofWord="of"
|
|
6955
6991
|
onToggle={[Function]}
|
|
6956
6992
|
optionsToggle="Items per page"
|
|
6957
6993
|
parentRef={null}
|
|
@@ -6979,6 +7015,7 @@ exports[`component render should render correctly compact 1`] = `
|
|
|
6979
7015
|
itemsTitle=""
|
|
6980
7016
|
key=".0"
|
|
6981
7017
|
lastIndex={10}
|
|
7018
|
+
ofWord="of"
|
|
6982
7019
|
onEnter={[Function]}
|
|
6983
7020
|
onToggle={[Function]}
|
|
6984
7021
|
optionsToggle="Items per page"
|
|
@@ -7056,6 +7093,7 @@ exports[`component render should render correctly compact 1`] = `
|
|
|
7056
7093
|
itemCount={20}
|
|
7057
7094
|
itemsTitle=""
|
|
7058
7095
|
lastIndex={10}
|
|
7096
|
+
ofWord="of"
|
|
7059
7097
|
>
|
|
7060
7098
|
<b>
|
|
7061
7099
|
1
|
|
@@ -7521,6 +7559,7 @@ exports[`component render should render correctly disabled 1`] = `
|
|
|
7521
7559
|
itemsTitle=""
|
|
7522
7560
|
lastIndex={10}
|
|
7523
7561
|
lastPage={2}
|
|
7562
|
+
ofWord="of"
|
|
7524
7563
|
onPerPageSelect={[Function]}
|
|
7525
7564
|
optionsToggle="Items per page"
|
|
7526
7565
|
page={1}
|
|
@@ -7617,6 +7656,7 @@ exports[`component render should render correctly disabled 1`] = `
|
|
|
7617
7656
|
itemsPerPageTitle="Items per page"
|
|
7618
7657
|
itemsTitle=""
|
|
7619
7658
|
lastIndex={10}
|
|
7659
|
+
ofWord="of"
|
|
7620
7660
|
onToggle={[Function]}
|
|
7621
7661
|
optionsToggle="Items per page"
|
|
7622
7662
|
parentRef={null}
|
|
@@ -7644,6 +7684,7 @@ exports[`component render should render correctly disabled 1`] = `
|
|
|
7644
7684
|
itemsTitle=""
|
|
7645
7685
|
key=".0"
|
|
7646
7686
|
lastIndex={10}
|
|
7687
|
+
ofWord="of"
|
|
7647
7688
|
onEnter={[Function]}
|
|
7648
7689
|
onToggle={[Function]}
|
|
7649
7690
|
optionsToggle="Items per page"
|
|
@@ -7722,6 +7763,7 @@ exports[`component render should render correctly disabled 1`] = `
|
|
|
7722
7763
|
itemCount={20}
|
|
7723
7764
|
itemsTitle=""
|
|
7724
7765
|
lastIndex={10}
|
|
7766
|
+
ofWord="of"
|
|
7725
7767
|
>
|
|
7726
7768
|
<b>
|
|
7727
7769
|
1
|
|
@@ -8332,6 +8374,7 @@ exports[`component render should render correctly sticky 1`] = `
|
|
|
8332
8374
|
itemsTitle=""
|
|
8333
8375
|
lastIndex={10}
|
|
8334
8376
|
lastPage={2}
|
|
8377
|
+
ofWord="of"
|
|
8335
8378
|
onPerPageSelect={[Function]}
|
|
8336
8379
|
optionsToggle="Items per page"
|
|
8337
8380
|
page={1}
|
|
@@ -8428,6 +8471,7 @@ exports[`component render should render correctly sticky 1`] = `
|
|
|
8428
8471
|
itemsPerPageTitle="Items per page"
|
|
8429
8472
|
itemsTitle=""
|
|
8430
8473
|
lastIndex={10}
|
|
8474
|
+
ofWord="of"
|
|
8431
8475
|
onToggle={[Function]}
|
|
8432
8476
|
optionsToggle="Items per page"
|
|
8433
8477
|
parentRef={null}
|
|
@@ -8455,6 +8499,7 @@ exports[`component render should render correctly sticky 1`] = `
|
|
|
8455
8499
|
itemsTitle=""
|
|
8456
8500
|
key=".0"
|
|
8457
8501
|
lastIndex={10}
|
|
8502
|
+
ofWord="of"
|
|
8458
8503
|
onEnter={[Function]}
|
|
8459
8504
|
onToggle={[Function]}
|
|
8460
8505
|
optionsToggle="Items per page"
|
|
@@ -8532,6 +8577,7 @@ exports[`component render should render correctly sticky 1`] = `
|
|
|
8532
8577
|
itemCount={20}
|
|
8533
8578
|
itemsTitle=""
|
|
8534
8579
|
lastIndex={10}
|
|
8580
|
+
ofWord="of"
|
|
8535
8581
|
>
|
|
8536
8582
|
<b>
|
|
8537
8583
|
1
|
|
@@ -9138,6 +9184,7 @@ exports[`component render should render correctly top 1`] = `
|
|
|
9138
9184
|
itemsTitle=""
|
|
9139
9185
|
lastIndex={10}
|
|
9140
9186
|
lastPage={2}
|
|
9187
|
+
ofWord="of"
|
|
9141
9188
|
onPerPageSelect={[Function]}
|
|
9142
9189
|
optionsToggle="Items per page"
|
|
9143
9190
|
page={1}
|
|
@@ -9234,6 +9281,7 @@ exports[`component render should render correctly top 1`] = `
|
|
|
9234
9281
|
itemsPerPageTitle="Items per page"
|
|
9235
9282
|
itemsTitle=""
|
|
9236
9283
|
lastIndex={10}
|
|
9284
|
+
ofWord="of"
|
|
9237
9285
|
onToggle={[Function]}
|
|
9238
9286
|
optionsToggle="Items per page"
|
|
9239
9287
|
parentRef={null}
|
|
@@ -9261,6 +9309,7 @@ exports[`component render should render correctly top 1`] = `
|
|
|
9261
9309
|
itemsTitle=""
|
|
9262
9310
|
key=".0"
|
|
9263
9311
|
lastIndex={10}
|
|
9312
|
+
ofWord="of"
|
|
9264
9313
|
onEnter={[Function]}
|
|
9265
9314
|
onToggle={[Function]}
|
|
9266
9315
|
optionsToggle="Items per page"
|
|
@@ -9338,6 +9387,7 @@ exports[`component render should render correctly top 1`] = `
|
|
|
9338
9387
|
itemCount={20}
|
|
9339
9388
|
itemsTitle=""
|
|
9340
9389
|
lastIndex={10}
|
|
9390
|
+
ofWord="of"
|
|
9341
9391
|
>
|
|
9342
9392
|
<b>
|
|
9343
9393
|
1
|
|
@@ -9934,6 +9984,7 @@ exports[`component render titles 1`] = `
|
|
|
9934
9984
|
itemsTitle="values"
|
|
9935
9985
|
lastIndex={10}
|
|
9936
9986
|
lastPage={4}
|
|
9987
|
+
ofWord="of"
|
|
9937
9988
|
onPerPageSelect={[Function]}
|
|
9938
9989
|
optionsToggle="Items per page"
|
|
9939
9990
|
page={1}
|
|
@@ -10030,6 +10081,7 @@ exports[`component render titles 1`] = `
|
|
|
10030
10081
|
itemsPerPageTitle="Items per page"
|
|
10031
10082
|
itemsTitle="values"
|
|
10032
10083
|
lastIndex={10}
|
|
10084
|
+
ofWord="of"
|
|
10033
10085
|
onToggle={[Function]}
|
|
10034
10086
|
optionsToggle="Items per page"
|
|
10035
10087
|
parentRef={null}
|
|
@@ -10057,6 +10109,7 @@ exports[`component render titles 1`] = `
|
|
|
10057
10109
|
itemsTitle="values"
|
|
10058
10110
|
key=".0"
|
|
10059
10111
|
lastIndex={10}
|
|
10112
|
+
ofWord="of"
|
|
10060
10113
|
onEnter={[Function]}
|
|
10061
10114
|
onToggle={[Function]}
|
|
10062
10115
|
optionsToggle="Items per page"
|
|
@@ -10134,6 +10187,7 @@ exports[`component render titles 1`] = `
|
|
|
10134
10187
|
itemCount={40}
|
|
10135
10188
|
itemsTitle="values"
|
|
10136
10189
|
lastIndex={10}
|
|
10190
|
+
ofWord="of"
|
|
10137
10191
|
>
|
|
10138
10192
|
<b>
|
|
10139
10193
|
1
|
|
@@ -10742,6 +10796,7 @@ exports[`component render up drop direction 1`] = `
|
|
|
10742
10796
|
itemsTitle=""
|
|
10743
10797
|
lastIndex={10}
|
|
10744
10798
|
lastPage={4}
|
|
10799
|
+
ofWord="of"
|
|
10745
10800
|
onPerPageSelect={[Function]}
|
|
10746
10801
|
optionsToggle="Items per page"
|
|
10747
10802
|
page={1}
|
|
@@ -10838,6 +10893,7 @@ exports[`component render up drop direction 1`] = `
|
|
|
10838
10893
|
itemsPerPageTitle="Items per page"
|
|
10839
10894
|
itemsTitle=""
|
|
10840
10895
|
lastIndex={10}
|
|
10896
|
+
ofWord="of"
|
|
10841
10897
|
onToggle={[Function]}
|
|
10842
10898
|
optionsToggle="Items per page"
|
|
10843
10899
|
parentRef={null}
|
|
@@ -10865,6 +10921,7 @@ exports[`component render up drop direction 1`] = `
|
|
|
10865
10921
|
itemsTitle=""
|
|
10866
10922
|
key=".0"
|
|
10867
10923
|
lastIndex={10}
|
|
10924
|
+
ofWord="of"
|
|
10868
10925
|
onEnter={[Function]}
|
|
10869
10926
|
onToggle={[Function]}
|
|
10870
10927
|
optionsToggle="Items per page"
|
|
@@ -10942,6 +10999,7 @@ exports[`component render up drop direction 1`] = `
|
|
|
10942
10999
|
itemCount={40}
|
|
10943
11000
|
itemsTitle=""
|
|
10944
11001
|
lastIndex={10}
|
|
11002
|
+
ofWord="of"
|
|
10945
11003
|
>
|
|
10946
11004
|
<b>
|
|
10947
11005
|
1
|
|
@@ -11548,6 +11606,7 @@ exports[`component render zero results 1`] = `
|
|
|
11548
11606
|
itemsTitle=""
|
|
11549
11607
|
lastIndex={0}
|
|
11550
11608
|
lastPage={0}
|
|
11609
|
+
ofWord="of"
|
|
11551
11610
|
onPerPageSelect={[Function]}
|
|
11552
11611
|
optionsToggle="Items per page"
|
|
11553
11612
|
page={0}
|
|
@@ -11644,6 +11703,7 @@ exports[`component render zero results 1`] = `
|
|
|
11644
11703
|
itemsPerPageTitle="Items per page"
|
|
11645
11704
|
itemsTitle=""
|
|
11646
11705
|
lastIndex={0}
|
|
11706
|
+
ofWord="of"
|
|
11647
11707
|
onToggle={[Function]}
|
|
11648
11708
|
optionsToggle="Items per page"
|
|
11649
11709
|
parentRef={null}
|
|
@@ -11671,6 +11731,7 @@ exports[`component render zero results 1`] = `
|
|
|
11671
11731
|
itemsTitle=""
|
|
11672
11732
|
key=".0"
|
|
11673
11733
|
lastIndex={0}
|
|
11734
|
+
ofWord="of"
|
|
11674
11735
|
onEnter={[Function]}
|
|
11675
11736
|
onToggle={[Function]}
|
|
11676
11737
|
optionsToggle="Items per page"
|
|
@@ -11749,6 +11810,7 @@ exports[`component render zero results 1`] = `
|
|
|
11749
11810
|
itemCount={0}
|
|
11750
11811
|
itemsTitle=""
|
|
11751
11812
|
lastIndex={0}
|
|
11813
|
+
ofWord="of"
|
|
11752
11814
|
>
|
|
11753
11815
|
<b>
|
|
11754
11816
|
0
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { KEY_CODES } from '../../helpers/constants';
|
|
4
4
|
import styles from '@patternfly/react-styles/css/components/Popover/popover';
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
|
+
import { PopoverContext } from './PopoverContext';
|
|
6
7
|
import { PopoverContent } from './PopoverContent';
|
|
7
8
|
import { PopoverBody } from './PopoverBody';
|
|
8
9
|
import { PopoverHeader } from './PopoverHeader';
|
|
@@ -109,6 +110,8 @@ export interface PopoverProps {
|
|
|
109
110
|
* i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}
|
|
110
111
|
*/
|
|
111
112
|
headerContent?: React.ReactNode | ((hide: () => void) => React.ReactNode);
|
|
113
|
+
/** Sets the heading level to use for the popover header. Default is h6. */
|
|
114
|
+
headerComponent?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
112
115
|
/** Hides the popover when a click occurs outside (only works if isVisible is not controlled by the user) */
|
|
113
116
|
hideOnOutsideClick?: boolean;
|
|
114
117
|
/**
|
|
@@ -206,6 +209,7 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
206
209
|
'aria-label': ariaLabel = '',
|
|
207
210
|
bodyContent,
|
|
208
211
|
headerContent = null,
|
|
212
|
+
headerComponent = 'h6',
|
|
209
213
|
footerContent = null,
|
|
210
214
|
appendTo = () => document.body,
|
|
211
215
|
hideOnOutsideClick = true,
|
|
@@ -435,24 +439,26 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
435
439
|
);
|
|
436
440
|
|
|
437
441
|
return (
|
|
438
|
-
<
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
442
|
+
<PopoverContext.Provider value={{ headerComponent }}>
|
|
443
|
+
<Popper
|
|
444
|
+
trigger={children}
|
|
445
|
+
reference={reference}
|
|
446
|
+
popper={content}
|
|
447
|
+
popperMatchesTriggerWidth={false}
|
|
448
|
+
appendTo={appendTo}
|
|
449
|
+
isVisible={visible}
|
|
450
|
+
positionModifiers={positionModifiers}
|
|
451
|
+
distance={distance}
|
|
452
|
+
placement={position}
|
|
453
|
+
onTriggerClick={onTriggerClick}
|
|
454
|
+
onTriggerEnter={onTriggerEnter}
|
|
455
|
+
onDocumentClick={onDocumentClick}
|
|
456
|
+
onDocumentKeyDown={onDocumentKeyDown}
|
|
457
|
+
enableFlip={enableFlip}
|
|
458
|
+
zIndex={zIndex}
|
|
459
|
+
flipBehavior={flipBehavior}
|
|
460
|
+
/>
|
|
461
|
+
</PopoverContext.Provider>
|
|
456
462
|
);
|
|
457
463
|
};
|
|
458
464
|
Popover.displayName = 'Popover';
|