@patternfly/react-core 4.220.2 → 4.221.2
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 +27 -0
- package/dist/esm/components/DataList/DataList.d.ts +9 -0
- package/dist/esm/components/DataList/DataList.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataList.js +3 -2
- package/dist/esm/components/DataList/DataList.js.map +1 -1
- package/dist/esm/components/DataList/DataListItem.d.ts +2 -0
- package/dist/esm/components/DataList/DataListItem.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataListItem.js +13 -6
- package/dist/esm/components/DataList/DataListItem.js.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.d.ts +2 -0
- package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.js +3 -2
- package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +2 -0
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.js +12 -10
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +8 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +38 -28
- package/dist/esm/components/SearchInput/SearchInput.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 +8 -7
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts +2 -0
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.js +3 -2
- package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +2 -0
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +3 -2
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/js/components/DataList/DataList.d.ts +9 -0
- package/dist/js/components/DataList/DataList.d.ts.map +1 -1
- package/dist/js/components/DataList/DataList.js +3 -2
- package/dist/js/components/DataList/DataList.js.map +1 -1
- package/dist/js/components/DataList/DataListItem.d.ts +2 -0
- package/dist/js/components/DataList/DataListItem.d.ts.map +1 -1
- package/dist/js/components/DataList/DataListItem.js +13 -6
- package/dist/js/components/DataList/DataListItem.js.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.d.ts +2 -0
- package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.js +3 -2
- package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +2 -0
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.js +12 -10
- package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +8 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +38 -28
- package/dist/js/components/SearchInput/SearchInput.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 +8 -7
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts +2 -0
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.js +3 -2
- package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +2 -0
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js +3 -2
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/styles/assets/images/icon-github.hbs +4 -0
- package/dist/styles/assets/images/icon-google.hbs +4 -0
- package/dist/styles/assets/images/icon-red-hat.hbs +1 -0
- package/dist/styles/base-no-reset.css +93 -4
- package/dist/styles/base.css +93 -4
- package/dist/umd/react-core.css +790 -8
- package/dist/umd/react-core.js +433 -342
- package/dist/umd/react-core.min.css +790 -8
- package/dist/umd/react-core.min.js +6 -6
- package/package.json +6 -6
- package/src/components/DataList/DataList.tsx +12 -0
- package/src/components/DataList/DataListItem.tsx +32 -3
- package/src/components/DataList/__tests__/DataList.test.tsx +130 -0
- package/src/components/DataList/examples/DataList.md +1 -0
- package/src/components/DataList/examples/DataListSelectableRows.tsx +5 -0
- package/src/components/InputGroup/InputGroup.tsx +7 -1
- package/src/components/SearchInput/AdvancedSearchMenu.tsx +24 -18
- package/src/components/SearchInput/SearchInput.tsx +130 -113
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +1 -1
- package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +297 -301
- package/src/components/SearchInput/examples/SearchInput.md +5 -2
- package/src/components/Select/Select.tsx +8 -2
- package/src/components/TextInputGroup/TextInputGroup.tsx +18 -7
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +5 -0
- package/src/demos/PrimaryDetail.md +1 -1
|
@@ -99,7 +99,9 @@ class SearchInputWithNavigableOptions extends React.Component {
|
|
|
99
99
|
this.state = {
|
|
100
100
|
value: '',
|
|
101
101
|
resultsCount: 0,
|
|
102
|
-
currentResult: 1
|
|
102
|
+
currentResult: 1,
|
|
103
|
+
isPreviousNavigationButtonDisabled: false,
|
|
104
|
+
isNextNavigationButtonDisabled: false
|
|
103
105
|
};
|
|
104
106
|
|
|
105
107
|
this.onChange = (value, event) => {
|
|
@@ -135,7 +137,6 @@ class SearchInputWithNavigableOptions extends React.Component {
|
|
|
135
137
|
});
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
|
-
|
|
139
140
|
render() {
|
|
140
141
|
return (
|
|
141
142
|
<SearchInput
|
|
@@ -143,6 +144,8 @@ class SearchInputWithNavigableOptions extends React.Component {
|
|
|
143
144
|
value={this.state.value}
|
|
144
145
|
onChange={this.onChange}
|
|
145
146
|
onClear={this.onClear}
|
|
147
|
+
isNextNavigationButtonDisabled={this.state.currentResult === 3}
|
|
148
|
+
isPreviousNavigationButtonDisabled={this.state.currentResult === 1}
|
|
146
149
|
resultsCount={`${this.state.currentResult} / ${this.state.resultsCount}`}
|
|
147
150
|
onNextClick={this.onNext}
|
|
148
151
|
onPreviousClick={this.onPrevious}
|
|
@@ -103,6 +103,8 @@ export interface SelectProps
|
|
|
103
103
|
'aria-invalid'?: boolean;
|
|
104
104
|
/** Label for input field of type ahead select variants */
|
|
105
105
|
typeAheadAriaLabel?: string;
|
|
106
|
+
/** Id of div for input field of type ahead select variants */
|
|
107
|
+
typeAheadAriaDescribedby?: string;
|
|
106
108
|
/** Label for clear selection button of type ahead select variants */
|
|
107
109
|
clearSelectionsAriaLabel?: string;
|
|
108
110
|
/** Label for toggle of type ahead select variants */
|
|
@@ -222,6 +224,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
222
224
|
'aria-describedby': '',
|
|
223
225
|
'aria-invalid': false,
|
|
224
226
|
typeAheadAriaLabel: '',
|
|
227
|
+
typeAheadAriaDescribedby: '',
|
|
225
228
|
clearSelectionsAriaLabel: 'Clear all',
|
|
226
229
|
toggleAriaLabel: 'Options menu',
|
|
227
230
|
removeSelectionAriaLabel: 'Remove',
|
|
@@ -943,6 +946,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
943
946
|
validated,
|
|
944
947
|
selections: selectionsProp,
|
|
945
948
|
typeAheadAriaLabel,
|
|
949
|
+
typeAheadAriaDescribedby,
|
|
946
950
|
clearSelectionsAriaLabel,
|
|
947
951
|
toggleAriaLabel,
|
|
948
952
|
removeSelectionAriaLabel,
|
|
@@ -1247,7 +1251,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1247
1251
|
className
|
|
1248
1252
|
)}
|
|
1249
1253
|
{...(width && { style: { width } })}
|
|
1250
|
-
{...(
|
|
1254
|
+
{...(ariaDescribedby && { 'aria-describedby': ariaDescribedby })}
|
|
1251
1255
|
{...(validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })}
|
|
1252
1256
|
>
|
|
1253
1257
|
{isOpen && menuContainer}
|
|
@@ -1268,7 +1272,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1268
1272
|
ref={this.parentRef}
|
|
1269
1273
|
{...getOUIAProps(Select.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}
|
|
1270
1274
|
{...(width && { style: { width } })}
|
|
1271
|
-
{...(
|
|
1275
|
+
{...(ariaDescribedby && { 'aria-describedby': ariaDescribedby })}
|
|
1272
1276
|
{...(validated !== ValidatedOptions.default && { 'aria-invalid': ariaInvalid })}
|
|
1273
1277
|
>
|
|
1274
1278
|
<SelectToggle
|
|
@@ -1337,6 +1341,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1337
1341
|
aria-activedescendant={typeaheadActiveChild && typeaheadActiveChild.id}
|
|
1338
1342
|
id={`${selectToggleId}-select-typeahead`}
|
|
1339
1343
|
aria-label={typeAheadAriaLabel}
|
|
1344
|
+
{...(typeAheadAriaDescribedby && { 'aria-describedby': typeAheadAriaDescribedby })}
|
|
1340
1345
|
placeholder={placeholderText as string}
|
|
1341
1346
|
value={
|
|
1342
1347
|
typeaheadInputValue !== null
|
|
@@ -1365,6 +1370,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1365
1370
|
id={`${selectToggleId}-select-multi-typeahead-typeahead`}
|
|
1366
1371
|
aria-label={typeAheadAriaLabel}
|
|
1367
1372
|
aria-invalid={validated === ValidatedOptions.error}
|
|
1373
|
+
{...(typeAheadAriaDescribedby && { 'aria-describedby': typeAheadAriaDescribedby })}
|
|
1368
1374
|
placeholder={placeholderText as string}
|
|
1369
1375
|
value={typeaheadInputValue !== null ? typeaheadInputValue : ''}
|
|
1370
1376
|
type="text"
|
|
@@ -9,6 +9,8 @@ export interface TextInputGroupProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
/** Adds disabled styling and a disabled context value which text input group main hooks into for the input itself */
|
|
11
11
|
isDisabled?: boolean;
|
|
12
|
+
/** @hide A reference object to attach to the input box */
|
|
13
|
+
innerRef?: React.RefObject<any>;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export const TextInputGroupContext = React.createContext<Partial<TextInputGroupProps>>({
|
|
@@ -19,13 +21,22 @@ export const TextInputGroup: React.FunctionComponent<TextInputGroupProps> = ({
|
|
|
19
21
|
children,
|
|
20
22
|
className,
|
|
21
23
|
isDisabled,
|
|
24
|
+
innerRef,
|
|
22
25
|
...props
|
|
23
|
-
}: TextInputGroupProps) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
}: TextInputGroupProps) => {
|
|
27
|
+
const textInputGroupRef = innerRef || React.useRef(null);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<TextInputGroupContext.Provider value={{ isDisabled }}>
|
|
31
|
+
<div
|
|
32
|
+
ref={textInputGroupRef}
|
|
33
|
+
className={css(styles.textInputGroup, isDisabled && styles.modifiers.disabled, className)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</div>
|
|
38
|
+
</TextInputGroupContext.Provider>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
30
41
|
|
|
31
42
|
TextInputGroup.displayName = 'TextInputGroup';
|
|
@@ -37,6 +37,8 @@ export interface TextInputGroupMainProps extends Omit<React.HTMLProps<HTMLDivEle
|
|
|
37
37
|
value?: string | number;
|
|
38
38
|
/** Placeholder value for the input */
|
|
39
39
|
placeholder?: string;
|
|
40
|
+
/** @hide A reference object to attach to the input box */
|
|
41
|
+
innerRef?: React.RefObject<any>;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps> = ({
|
|
@@ -51,9 +53,11 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
|
|
|
51
53
|
'aria-label': ariaLabel = 'Type to filter',
|
|
52
54
|
value: inputValue,
|
|
53
55
|
placeholder: inputPlaceHolder,
|
|
56
|
+
innerRef,
|
|
54
57
|
...props
|
|
55
58
|
}: TextInputGroupMainProps) => {
|
|
56
59
|
const { isDisabled } = React.useContext(TextInputGroupContext);
|
|
60
|
+
const textInputGroupInputInputRef = innerRef || React.useRef(null);
|
|
57
61
|
|
|
58
62
|
const handleChange = (event: React.FormEvent<HTMLInputElement>) => {
|
|
59
63
|
onChange(event.currentTarget.value, event);
|
|
@@ -74,6 +78,7 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
|
|
|
74
78
|
)}
|
|
75
79
|
{icon && <span className={css(styles.textInputGroupIcon)}>{icon}</span>}
|
|
76
80
|
<input
|
|
81
|
+
ref={textInputGroupInputInputRef}
|
|
77
82
|
type={type}
|
|
78
83
|
className={css(styles.textInputGroupTextInput)}
|
|
79
84
|
aria-label={ariaLabel}
|
|
@@ -1274,7 +1274,7 @@ class PrimaryDetailCardView extends React.Component {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
|
|
1276
1276
|
const drawerContent = (
|
|
1277
|
-
<Gallery hasGutter aria-label="Selectable card container">
|
|
1277
|
+
<Gallery hasGutter role='region' aria-label="Selectable card container">
|
|
1278
1278
|
{filtered.map((product, key) => (
|
|
1279
1279
|
<React.Fragment>
|
|
1280
1280
|
<Card
|