@patternfly/react-core 4.271.0 → 4.271.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 +19 -0
- package/components/DualListSelector/DualListSelectorPane.d.ts +3 -1
- package/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/components/DualListSelector/DualListSelectorPane.js +7 -3
- package/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/components/LoginPage/LoginPage.d.ts +1 -1
- package/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/components/Menu/MenuItem.d.ts +1 -1
- package/components/Menu/MenuItem.d.ts.map +1 -1
- package/components/SearchInput/SearchInput.d.ts +2 -0
- package/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/components/SearchInput/SearchInput.js +2 -2
- package/components/SearchInput/SearchInput.js.map +1 -1
- package/components/Select/Select.d.ts +3 -3
- package/components/Select/Select.d.ts.map +1 -1
- package/components/Tabs/Tabs.d.ts +3 -3
- package/components/Tabs/Tabs.d.ts.map +1 -1
- package/components/TextInputGroup/TextInputGroupMain.d.ts +2 -0
- package/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/components/TextInputGroup/TextInputGroupMain.js +2 -2
- package/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts +3 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.js +7 -3
- package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/esm/components/LoginPage/LoginPage.d.ts +1 -1
- package/dist/esm/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +2 -2
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +3 -3
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +3 -3
- package/dist/esm/components/Tabs/Tabs.d.ts.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 +2 -2
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts +3 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.js +7 -3
- package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/js/components/LoginPage/LoginPage.d.ts +1 -1
- package/dist/js/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +2 -2
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +3 -3
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +3 -3
- package/dist/js/components/Tabs/Tabs.d.ts.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 +2 -2
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Alert/examples/Alert.md +1 -1
- package/src/components/DualListSelector/DualListSelectorPane.tsx +14 -2
- package/src/components/DualListSelector/examples/DualListSelector.md +1 -0
- package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +76 -46
- package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +33 -7
- package/src/components/LoginPage/LoginPage.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/SearchInput/SearchInput.tsx +4 -0
- package/src/components/Select/Select.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Tabs/examples/Tabs.md +3 -3
- package/src/components/TextArea/examples/TextArea.md +1 -1
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.271.
|
|
3
|
+
"version": "4.271.2",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "27ec34e45b7fb806e04e402be185ff819b1bb781"
|
|
75
75
|
}
|
|
@@ -360,4 +360,4 @@ Alerts that are asynchronously appended into dynamic [alert groups](/components/
|
|
|
360
360
|
|
|
361
361
|
This example shows how an alert could be triggered by an asynchronous event in the application. Note that you can customize how the alert will be announced to assistive technology. See the [https://www.patternfly.org/v4/components/alert/accessibility](alert accessibility) for more information.
|
|
362
362
|
```ts file="AlertAsyncLiveRegion.tsx"
|
|
363
|
-
```
|
|
363
|
+
```
|
|
@@ -13,7 +13,7 @@ import { SearchInput } from '../SearchInput';
|
|
|
13
13
|
* such as sorting, can also be passed into this sub-component.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
export interface DualListSelectorPaneProps {
|
|
16
|
+
export interface DualListSelectorPaneProps extends Omit<React.HTMLProps<HTMLDivElement>, 'title'> {
|
|
17
17
|
/** Additional classes applied to the dual list selector pane. */
|
|
18
18
|
className?: string;
|
|
19
19
|
/** A dual list selector list or dual list selector tree to be rendered in the pane. */
|
|
@@ -65,6 +65,8 @@ export interface DualListSelectorPaneProps {
|
|
|
65
65
|
searchInputAriaLabel?: string;
|
|
66
66
|
/** @hide Callback for updating the filtered options in DualListSelector. To be used when isSearchable is true. */
|
|
67
67
|
onFilterUpdate?: (newFilteredOptions: React.ReactNode[], paneType: string, isSearchReset: boolean) => void;
|
|
68
|
+
/** Minimum height of the list of options rendered in the pane. **/
|
|
69
|
+
listMinHeight?: string;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneProps> = ({
|
|
@@ -87,6 +89,7 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
87
89
|
filterOption,
|
|
88
90
|
id = getUniqueId('dual-list-selector-pane'),
|
|
89
91
|
isDisabled = false,
|
|
92
|
+
listMinHeight,
|
|
90
93
|
...props
|
|
91
94
|
}: DualListSelectorPaneProps) => {
|
|
92
95
|
const [input, setInput] = React.useState('');
|
|
@@ -198,12 +201,21 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
198
201
|
displayOption={displayOption}
|
|
199
202
|
id={`${id}-list`}
|
|
200
203
|
isDisabled={isDisabled}
|
|
204
|
+
{...(listMinHeight && {
|
|
205
|
+
style: { '--pf-c-dual-list-selector__menu--MinHeight': listMinHeight } as React.CSSProperties
|
|
206
|
+
})}
|
|
201
207
|
>
|
|
202
208
|
{children}
|
|
203
209
|
</DualListSelectorListWrapper>
|
|
204
210
|
)}
|
|
205
211
|
{isTree && (
|
|
206
|
-
<DualListSelectorListWrapper
|
|
212
|
+
<DualListSelectorListWrapper
|
|
213
|
+
aria-labelledby={`${id}-status`}
|
|
214
|
+
id={`${id}-list`}
|
|
215
|
+
{...(listMinHeight && {
|
|
216
|
+
style: { '--pf-c-dual-list-selector__menu--MinHeight': listMinHeight } as React.CSSProperties
|
|
217
|
+
})}
|
|
218
|
+
>
|
|
207
219
|
{options.length > 0 ? (
|
|
208
220
|
<DualListSelectorList>
|
|
209
221
|
<DualListSelectorTree
|
|
@@ -20,6 +20,7 @@ import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-ico
|
|
|
20
20
|
import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-right-icon';
|
|
21
21
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
22
22
|
import PficonSortCommonAscIcon from '@patternfly/react-icons/dist/esm/icons/pficon-sort-common-asc-icon';
|
|
23
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
23
24
|
|
|
24
25
|
## Examples
|
|
25
26
|
|
|
@@ -8,13 +8,20 @@ import {
|
|
|
8
8
|
DualListSelectorListItem,
|
|
9
9
|
DualListSelectorControlsWrapper,
|
|
10
10
|
DualListSelectorControl,
|
|
11
|
-
SearchInput
|
|
11
|
+
SearchInput,
|
|
12
|
+
Title,
|
|
13
|
+
EmptyState,
|
|
14
|
+
EmptyStateVariant,
|
|
15
|
+
EmptyStateIcon,
|
|
16
|
+
EmptyStateBody,
|
|
17
|
+
EmptyStatePrimary
|
|
12
18
|
} from '@patternfly/react-core';
|
|
13
19
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
14
20
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
15
21
|
import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-right-icon';
|
|
16
22
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
17
23
|
import PficonSortCommonAscIcon from '@patternfly/react-icons/dist/esm/icons/pficon-sort-common-asc-icon';
|
|
24
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
18
25
|
|
|
19
26
|
interface Option {
|
|
20
27
|
text: string;
|
|
@@ -86,25 +93,23 @@ export const DualListSelectorComposable: React.FunctionComponent = () => {
|
|
|
86
93
|
}
|
|
87
94
|
};
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
option.isVisible = value === '' || option.text.toLowerCase().includes(value.toLowerCase());
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<SearchInput
|
|
101
|
-
value={isAvailable ? availableFilter : chosenFilter}
|
|
102
|
-
onChange={onChange}
|
|
103
|
-
onClear={() => onChange('')}
|
|
104
|
-
/>
|
|
105
|
-
);
|
|
96
|
+
const onFilterChange = (value: string, isAvailable: boolean) => {
|
|
97
|
+
isAvailable ? setAvailableFilter(value) : setChosenFilter(value);
|
|
98
|
+
const toFilter = isAvailable ? [...availableOptions] : [...chosenOptions];
|
|
99
|
+
toFilter.forEach(option => {
|
|
100
|
+
option.isVisible = value === '' || option.text.toLowerCase().includes(value.toLowerCase());
|
|
101
|
+
});
|
|
106
102
|
};
|
|
107
103
|
|
|
104
|
+
// builds a search input - used in each dual list selector pane
|
|
105
|
+
const buildSearchInput = (isAvailable: boolean) => (
|
|
106
|
+
<SearchInput
|
|
107
|
+
value={isAvailable ? availableFilter : chosenFilter}
|
|
108
|
+
onChange={value => onFilterChange(value, isAvailable)}
|
|
109
|
+
onClear={() => onFilterChange('', isAvailable)}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
|
|
108
113
|
// builds a sort control - passed to both dual list selector panes
|
|
109
114
|
const buildSort = (isAvailable: boolean) => {
|
|
110
115
|
const onSort = () => {
|
|
@@ -132,6 +137,21 @@ export const DualListSelectorComposable: React.FunctionComponent = () => {
|
|
|
132
137
|
);
|
|
133
138
|
};
|
|
134
139
|
|
|
140
|
+
const buildEmptyState = (isAvailable: boolean) => (
|
|
141
|
+
<EmptyState variant={EmptyStateVariant.small}>
|
|
142
|
+
<EmptyStateIcon icon={SearchIcon} />
|
|
143
|
+
<Title headingLevel="h4" size="md">
|
|
144
|
+
No results found
|
|
145
|
+
</Title>
|
|
146
|
+
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
147
|
+
<EmptyStatePrimary>
|
|
148
|
+
<Button variant="link" onClick={() => onFilterChange('', isAvailable)}>
|
|
149
|
+
Clear all filters
|
|
150
|
+
</Button>
|
|
151
|
+
</EmptyStatePrimary>
|
|
152
|
+
</EmptyState>
|
|
153
|
+
);
|
|
154
|
+
|
|
135
155
|
return (
|
|
136
156
|
<DualListSelector>
|
|
137
157
|
<DualListSelectorPane
|
|
@@ -141,21 +161,27 @@ export const DualListSelectorComposable: React.FunctionComponent = () => {
|
|
|
141
161
|
} options selected`}
|
|
142
162
|
searchInput={buildSearchInput(true)}
|
|
143
163
|
actions={[buildSort(true)]}
|
|
164
|
+
listMinHeight="300px"
|
|
144
165
|
>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
{availableFilter !== '' &&
|
|
167
|
+
availableOptions.filter(option => option.isVisible).length === 0 &&
|
|
168
|
+
buildEmptyState(true)}
|
|
169
|
+
{availableOptions.filter(option => option.isVisible).length > 0 && (
|
|
170
|
+
<DualListSelectorList>
|
|
171
|
+
{availableOptions.map((option, index) =>
|
|
172
|
+
option.isVisible ? (
|
|
173
|
+
<DualListSelectorListItem
|
|
174
|
+
key={index}
|
|
175
|
+
isSelected={option.selected}
|
|
176
|
+
id={`composable-available-option-${index}`}
|
|
177
|
+
onOptionSelect={e => onOptionSelect(e, index, false)}
|
|
178
|
+
>
|
|
179
|
+
{option.text}
|
|
180
|
+
</DualListSelectorListItem>
|
|
181
|
+
) : null
|
|
182
|
+
)}
|
|
183
|
+
</DualListSelectorList>
|
|
184
|
+
)}
|
|
159
185
|
</DualListSelectorPane>
|
|
160
186
|
<DualListSelectorControlsWrapper>
|
|
161
187
|
<DualListSelectorControl
|
|
@@ -199,21 +225,25 @@ export const DualListSelectorComposable: React.FunctionComponent = () => {
|
|
|
199
225
|
searchInput={buildSearchInput(false)}
|
|
200
226
|
actions={[buildSort(false)]}
|
|
201
227
|
isChosen
|
|
228
|
+
listMinHeight="300px"
|
|
202
229
|
>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
230
|
+
{chosenFilter !== '' && chosenOptions.filter(option => option.isVisible).length === 0 && buildEmptyState(false)}
|
|
231
|
+
{chosenOptions.filter(option => option.isVisible).length > 0 && (
|
|
232
|
+
<DualListSelectorList>
|
|
233
|
+
{chosenOptions.map((option, index) =>
|
|
234
|
+
option.isVisible ? (
|
|
235
|
+
<DualListSelectorListItem
|
|
236
|
+
key={index}
|
|
237
|
+
isSelected={option.selected}
|
|
238
|
+
id={`composable-chosen-option-${index}`}
|
|
239
|
+
onOptionSelect={e => onOptionSelect(e, index, true)}
|
|
240
|
+
>
|
|
241
|
+
{option.text}
|
|
242
|
+
</DualListSelectorListItem>
|
|
243
|
+
) : null
|
|
244
|
+
)}
|
|
245
|
+
</DualListSelectorList>
|
|
246
|
+
)}
|
|
217
247
|
</DualListSelectorPane>
|
|
218
248
|
</DualListSelector>
|
|
219
249
|
);
|
|
@@ -7,12 +7,20 @@ import {
|
|
|
7
7
|
DualListSelectorControl,
|
|
8
8
|
DualListSelectorTree,
|
|
9
9
|
DualListSelectorTreeItemData,
|
|
10
|
-
SearchInput
|
|
10
|
+
SearchInput,
|
|
11
|
+
Title,
|
|
12
|
+
Button,
|
|
13
|
+
EmptyState,
|
|
14
|
+
EmptyStateVariant,
|
|
15
|
+
EmptyStateIcon,
|
|
16
|
+
EmptyStateBody,
|
|
17
|
+
EmptyStatePrimary
|
|
11
18
|
} from '@patternfly/react-core';
|
|
12
19
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
13
20
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
14
21
|
import AngleDoubleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-right-icon';
|
|
15
22
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
23
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
16
24
|
|
|
17
25
|
interface FoodNode {
|
|
18
26
|
id: string;
|
|
@@ -235,19 +243,37 @@ export const DualListSelectorComposableTree: React.FunctionComponent<ExampleProp
|
|
|
235
243
|
isChosen ? chosenLeafIds.includes(id) : !chosenLeafIds.includes(id)
|
|
236
244
|
).length;
|
|
237
245
|
const status = `${numSelected} of ${numOptions} options selected`;
|
|
246
|
+
const filterApplied = isChosen ? chosenFilter !== '' : availableFilter !== '';
|
|
238
247
|
return (
|
|
239
248
|
<DualListSelectorPane
|
|
240
249
|
title={isChosen ? 'Chosen' : 'Available'}
|
|
241
250
|
status={status}
|
|
242
251
|
searchInput={buildSearchInput(isChosen)}
|
|
243
252
|
isChosen={isChosen}
|
|
253
|
+
listMinHeight="300px"
|
|
244
254
|
>
|
|
245
|
-
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
255
|
+
{filterApplied && options.length === 0 && (
|
|
256
|
+
<EmptyState variant={EmptyStateVariant.small}>
|
|
257
|
+
<EmptyStateIcon icon={SearchIcon} />
|
|
258
|
+
<Title headingLevel="h4" size="md">
|
|
259
|
+
No results found
|
|
260
|
+
</Title>
|
|
261
|
+
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
262
|
+
<EmptyStatePrimary>
|
|
263
|
+
<Button variant="link" onClick={() => (isChosen ? setChosenFilter('') : setAvailableFilter(''))}>
|
|
264
|
+
Clear all filters
|
|
265
|
+
</Button>
|
|
266
|
+
</EmptyStatePrimary>
|
|
267
|
+
</EmptyState>
|
|
268
|
+
)}
|
|
269
|
+
{options.length > 0 && (
|
|
270
|
+
<DualListSelectorList>
|
|
271
|
+
<DualListSelectorTree
|
|
272
|
+
data={options}
|
|
273
|
+
onOptionCheck={(e, isChecked, itemData) => onOptionCheck(e, isChecked, itemData, isChosen)}
|
|
274
|
+
/>
|
|
275
|
+
</DualListSelectorList>
|
|
276
|
+
)}
|
|
251
277
|
</DualListSelectorPane>
|
|
252
278
|
);
|
|
253
279
|
};
|
|
@@ -35,7 +35,7 @@ export interface LoginPageProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
35
35
|
loginTitle: string;
|
|
36
36
|
/** Subtitle for the login main body header of the login page */
|
|
37
37
|
loginSubtitle?: string;
|
|
38
|
-
/**
|
|
38
|
+
/** Header utilities for the login main body header of the login page */
|
|
39
39
|
headerUtilities?: React.ReactNode;
|
|
40
40
|
/** Content rendered inside of login main footer band to display a sign up for account message */
|
|
41
41
|
signUpForAccountMessage?: React.ReactNode;
|
|
@@ -24,7 +24,7 @@ export interface MenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onC
|
|
|
24
24
|
itemId?: any;
|
|
25
25
|
/** Target navigation link. Should not be used if the flyout prop is defined. */
|
|
26
26
|
to?: string;
|
|
27
|
-
/**
|
|
27
|
+
/** Flag indicating the item has a checkbox */
|
|
28
28
|
hasCheck?: boolean;
|
|
29
29
|
/** Flag indicating whether the item is active */
|
|
30
30
|
isActive?: boolean;
|
|
@@ -130,6 +130,8 @@ export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
130
130
|
submitSearchButtonLabel?: string;
|
|
131
131
|
/** Value of the search input. */
|
|
132
132
|
value?: string;
|
|
133
|
+
/** Name attribue for the search input */
|
|
134
|
+
name?: string;
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
@@ -164,6 +166,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
164
166
|
removeFindDomNode = false,
|
|
165
167
|
zIndex = 9999,
|
|
166
168
|
type = 'text',
|
|
169
|
+
name,
|
|
167
170
|
...props
|
|
168
171
|
}: SearchInputProps) => {
|
|
169
172
|
const [isSearchMenuOpen, setIsSearchMenuOpen] = React.useState(false);
|
|
@@ -304,6 +307,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
304
307
|
onKeyDown={onEnter}
|
|
305
308
|
onChange={onChangeHandler}
|
|
306
309
|
type={type}
|
|
310
|
+
name={name}
|
|
307
311
|
/>
|
|
308
312
|
{renderUtilities && (
|
|
309
313
|
<TextInputGroupUtilities>
|
|
@@ -73,7 +73,7 @@ export interface SelectProps
|
|
|
73
73
|
isCreateOptionOnTop?: boolean;
|
|
74
74
|
/** Flag indicating if placeholder styles should be applied */
|
|
75
75
|
hasPlaceholderStyle?: boolean;
|
|
76
|
-
/**
|
|
76
|
+
/** Flag indicating if the creatable option should set its value as a SelectOptionObject */
|
|
77
77
|
isCreateSelectOptionObject?: boolean;
|
|
78
78
|
/** Value to indicate if the select is modified to show that validation state.
|
|
79
79
|
* If set to success, select will be modified to indicate valid state.
|
|
@@ -81,7 +81,7 @@ export interface SelectProps
|
|
|
81
81
|
* If set to warning, select will be modified to indicate warning state.
|
|
82
82
|
*/
|
|
83
83
|
validated?: 'success' | 'warning' | 'error' | 'default';
|
|
84
|
-
/**
|
|
84
|
+
/** Loading variant to display either the spinner or the view more text button */
|
|
85
85
|
loadingVariant?: 'spinner' | SelectViewMoreObject;
|
|
86
86
|
/** Text displayed in typeahead select to prompt the user to create an item */
|
|
87
87
|
createText?: string;
|
|
@@ -165,7 +165,7 @@ export interface SelectProps
|
|
|
165
165
|
chipGroupComponent?: React.ReactNode;
|
|
166
166
|
/** Flag for retaining keyboard-entered value in typeahead text field when focus leaves input away */
|
|
167
167
|
isInputValuePersisted?: boolean;
|
|
168
|
-
/**
|
|
168
|
+
/** Flag for retaining filter results on blur from keyboard-entered typeahead text */
|
|
169
169
|
isInputFilterPersisted?: boolean;
|
|
170
170
|
/** Flag indicating the typeahead input value should reset upon selection */
|
|
171
171
|
shouldResetOnSelect?: boolean;
|
|
@@ -42,11 +42,11 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
|
|
|
42
42
|
defaultActiveKey?: number | string;
|
|
43
43
|
/** Callback to handle tab selection */
|
|
44
44
|
onSelect?: (event: React.MouseEvent<HTMLElement, MouseEvent>, eventKey: number | string) => void;
|
|
45
|
-
/**
|
|
45
|
+
/** Callback to handle tab closing and adds a basic close button to all tabs. This is overridden by the tab actions property. */
|
|
46
46
|
onClose?: (event: React.MouseEvent<HTMLElement, MouseEvent>, eventKey: number | string) => void;
|
|
47
|
-
/**
|
|
47
|
+
/** Callback for the add button. Passing this property inserts the add button */
|
|
48
48
|
onAdd?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
49
|
-
/**
|
|
49
|
+
/** Aria-label for the add button */
|
|
50
50
|
addButtonAriaLabel?: string;
|
|
51
51
|
/** Uniquely identifies the tabs */
|
|
52
52
|
id?: string;
|
|
@@ -141,15 +141,15 @@ The tooltip should also have the `id` prop passed in. The value given to this pr
|
|
|
141
141
|
|
|
142
142
|
To enable closeable tabs, pass the `onClose` property to `Tabs`, and to enable the add button, pass the `onAdd` property to `Tabs`. Aria labels may be controlled manually by passing `closeButtonAriaLabel` to `Tab` and `addButtonAriaLabel` to `Tabs`.
|
|
143
143
|
|
|
144
|
-
```ts file="./TabsDynamic.tsx"
|
|
144
|
+
```ts file="./TabsDynamic.tsx"
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
### Help action
|
|
148
148
|
|
|
149
|
-
```ts file="./TabsHelp.tsx"
|
|
149
|
+
```ts file="./TabsHelp.tsx"
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
### Help and close actions
|
|
153
153
|
|
|
154
|
-
```ts file="./TabsHelpAndClose.tsx"
|
|
154
|
+
```ts file="./TabsHelpAndClose.tsx"
|
|
155
155
|
```
|
|
@@ -56,5 +56,5 @@ propComponents: ['TextArea']
|
|
|
56
56
|
|
|
57
57
|
**Note:** The icons for the success, invalid, calendar, etc. variations in form control elements are applied as background images to the form element. By default, the image URLs for these icons are data URIs. However, there may be cases where data URIs are not ideal, such as in an application with a content security policy that disallows data URIs for security reasons. The `isIconSprite` variation changes the icon source to an external SVG file that serves as a sprite for all of the supported icons.
|
|
58
58
|
|
|
59
|
-
```ts
|
|
59
|
+
```ts file="./TextAreaIconSprite.tsx"
|
|
60
60
|
```
|
|
@@ -39,6 +39,8 @@ export interface TextInputGroupMainProps extends Omit<React.HTMLProps<HTMLDivEle
|
|
|
39
39
|
placeholder?: string;
|
|
40
40
|
/** A reference object to attach to the input box */
|
|
41
41
|
innerRef?: React.RefObject<any>;
|
|
42
|
+
/** Name for the input */
|
|
43
|
+
name?: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps> = ({
|
|
@@ -54,6 +56,7 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
|
|
|
54
56
|
value: inputValue,
|
|
55
57
|
placeholder: inputPlaceHolder,
|
|
56
58
|
innerRef,
|
|
59
|
+
name,
|
|
57
60
|
...props
|
|
58
61
|
}: TextInputGroupMainProps) => {
|
|
59
62
|
const { isDisabled } = React.useContext(TextInputGroupContext);
|
|
@@ -89,6 +92,7 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
|
|
|
89
92
|
onBlur={onBlur}
|
|
90
93
|
value={inputValue || ''}
|
|
91
94
|
placeholder={inputPlaceHolder}
|
|
95
|
+
name={name}
|
|
92
96
|
/>
|
|
93
97
|
</span>
|
|
94
98
|
</div>
|