@patternfly/react-core 4.258.7 → 4.259.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 +22 -0
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -0
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js +2 -2
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.js +4 -3
- package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js +2 -2
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.js +2 -2
- package/dist/esm/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts +2 -0
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavItem.js +2 -2
- package/dist/esm/components/Nav/NavItem.js.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenu.d.ts +2 -0
- package/dist/esm/components/OptionsMenu/OptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenu.js +2 -2
- package/dist/esm/components/OptionsMenu/OptionsMenu.js.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 +2 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +4 -3
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Tabs/OverflowTab.d.ts +2 -0
- package/dist/esm/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/OverflowTab.js +2 -2
- package/dist/esm/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/esm/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.js +4 -3
- package/dist/esm/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/next/components/Dropdown/Dropdown.js +2 -2
- package/dist/esm/next/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/next/components/Select/Select.d.ts +2 -0
- package/dist/esm/next/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/next/components/Select/Select.js +2 -2
- package/dist/esm/next/components/Select/Select.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -0
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js +2 -2
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.js +4 -3
- package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js +2 -2
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.js +2 -2
- package/dist/js/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts +2 -0
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavItem.js +2 -2
- package/dist/js/components/Nav/NavItem.js.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenu.d.ts +2 -0
- package/dist/js/components/OptionsMenu/OptionsMenu.d.ts.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenu.js +2 -2
- package/dist/js/components/OptionsMenu/OptionsMenu.js.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 +2 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +4 -3
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Tabs/OverflowTab.d.ts +2 -0
- package/dist/js/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/js/components/Tabs/OverflowTab.js +2 -2
- package/dist/js/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/js/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/js/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/js/components/TimePicker/TimePicker.js +4 -3
- package/dist/js/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/js/next/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/js/next/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/next/components/Dropdown/Dropdown.js +2 -2
- package/dist/js/next/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/next/components/Select/Select.d.ts +2 -0
- package/dist/js/next/components/Select/Select.d.ts.map +1 -1
- package/dist/js/next/components/Select/Select.js +2 -2
- package/dist/js/next/components/Select/Select.js.map +1 -1
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +2 -2
- package/src/components/ApplicationLauncher/ApplicationLauncher.tsx +4 -0
- package/src/components/ContextSelector/ContextSelector.tsx +6 -1
- package/src/components/Dropdown/Dropdown.tsx +4 -0
- package/src/components/Dropdown/DropdownWithContext.tsx +2 -0
- package/src/components/Nav/NavItem.tsx +4 -0
- package/src/components/OptionsMenu/OptionsMenu.tsx +4 -0
- package/src/components/SearchInput/SearchInput.tsx +4 -0
- package/src/components/Select/Select.tsx +6 -1
- package/src/components/Tabs/OverflowTab.tsx +4 -0
- package/src/components/TextArea/examples/TextArea.md +12 -260
- package/src/components/TextArea/examples/TextAreaAutoResizing.tsx +14 -0
- package/src/components/TextArea/examples/TextAreaBasic.tsx +7 -0
- package/src/components/TextArea/examples/TextAreaDisabled.tsx +6 -0
- package/src/components/TextArea/examples/TextAreaHorizontallyResizable.tsx +14 -0
- package/src/components/TextArea/examples/TextAreaIconSprite.tsx +41 -0
- package/src/components/TextArea/examples/TextAreaInvalid.tsx +15 -0
- package/src/components/TextArea/examples/TextAreaReadOnly.tsx +25 -0
- package/src/components/TextArea/examples/TextAreaUncontrolled.tsx +6 -0
- package/src/components/TextArea/examples/TextAreaValidated.tsx +52 -0
- package/src/components/TextArea/examples/TextAreaVerticallyResizable.tsx +14 -0
- package/src/components/TimePicker/TimePicker.tsx +6 -1
- package/src/components/ToggleGroup/examples/ToggleGroup.md +5 -191
- package/src/components/ToggleGroup/examples/ToggleGroupCompact.tsx +30 -0
- package/src/components/ToggleGroup/examples/ToggleGroupDefaultMultiple.tsx +43 -0
- package/src/components/ToggleGroup/examples/ToggleGroupDefaultSingle.tsx +32 -0
- package/src/components/ToggleGroup/examples/ToggleGroupIcon.tsx +42 -0
- package/src/components/ToggleGroup/examples/ToggleGroupTextIcon.tsx +42 -0
- package/src/demos/Card/Card.md +3 -2
- package/src/demos/PrimaryDetail.md +4 -6
- package/src/next/components/Dropdown/Dropdown.tsx +4 -0
- package/src/next/components/Select/Select.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.259.0",
|
|
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",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8 || ^17 || ^18",
|
|
71
71
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "7db13002a4532f26aa6982731a25c208224ae8da"
|
|
74
74
|
}
|
|
@@ -63,6 +63,8 @@ export interface ApplicationLauncherProps
|
|
|
63
63
|
toggleId?: string;
|
|
64
64
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
65
65
|
removeFindDomNode?: boolean;
|
|
66
|
+
/** z-index of the application launcher when menuAppendTo is not inline. */
|
|
67
|
+
zIndex?: number;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export class ApplicationLauncher extends React.Component<ApplicationLauncherProps> {
|
|
@@ -133,6 +135,7 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
|
|
|
133
135
|
searchNoResultsText,
|
|
134
136
|
menuAppendTo,
|
|
135
137
|
removeFindDomNode,
|
|
138
|
+
zIndex = 9999,
|
|
136
139
|
...props
|
|
137
140
|
} = this.props;
|
|
138
141
|
let renderableItems: React.ReactNode[] = [];
|
|
@@ -194,6 +197,7 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
|
|
|
194
197
|
aria-label={ariaLabel}
|
|
195
198
|
menuAppendTo={menuAppendTo}
|
|
196
199
|
removeFindDomNode={removeFindDomNode}
|
|
200
|
+
zIndex={zIndex}
|
|
197
201
|
toggle={
|
|
198
202
|
<DropdownToggle
|
|
199
203
|
id={toggleId}
|
|
@@ -68,6 +68,8 @@ export interface ContextSelectorProps extends Omit<ToggleMenuBaseProps, 'menuApp
|
|
|
68
68
|
id?: string;
|
|
69
69
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
70
70
|
removeFindDomNode?: boolean;
|
|
71
|
+
/** z-index of the context selector when menuAppendTo is not inline. */
|
|
72
|
+
zIndex?: number;
|
|
71
73
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
72
74
|
ouiaId?: number | string;
|
|
73
75
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
@@ -96,7 +98,8 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
96
98
|
isPlain: false,
|
|
97
99
|
isText: false,
|
|
98
100
|
isFlipEnabled: true,
|
|
99
|
-
removeFindDomNode: false
|
|
101
|
+
removeFindDomNode: false,
|
|
102
|
+
zIndex: 9999
|
|
100
103
|
};
|
|
101
104
|
constructor(props: ContextSelectorProps) {
|
|
102
105
|
super(props);
|
|
@@ -139,6 +142,7 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
139
142
|
isFlipEnabled,
|
|
140
143
|
id,
|
|
141
144
|
removeFindDomNode,
|
|
145
|
+
zIndex,
|
|
142
146
|
...props
|
|
143
147
|
} = this.props;
|
|
144
148
|
|
|
@@ -235,6 +239,7 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
235
239
|
appendTo={menuAppendTo === 'parent' ? getParentElement() : menuAppendTo}
|
|
236
240
|
isVisible={isOpen}
|
|
237
241
|
removeFindDomNode={removeFindDomNode}
|
|
242
|
+
zIndex={zIndex}
|
|
238
243
|
/>
|
|
239
244
|
);
|
|
240
245
|
}
|
|
@@ -62,6 +62,8 @@ export interface DropdownProps
|
|
|
62
62
|
isFlipEnabled?: boolean;
|
|
63
63
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
64
64
|
removeFindDomNode?: boolean;
|
|
65
|
+
/** z-index of the dropdown when menuAppendTo is not inline. */
|
|
66
|
+
zIndex?: number;
|
|
65
67
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
66
68
|
ouiaId?: number | string;
|
|
67
69
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
@@ -79,6 +81,7 @@ export const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
79
81
|
menuAppendTo = 'inline',
|
|
80
82
|
isFlipEnabled = true,
|
|
81
83
|
removeFindDomNode = false,
|
|
84
|
+
zIndex = 9999,
|
|
82
85
|
...props
|
|
83
86
|
}: DropdownProps) => (
|
|
84
87
|
<DropdownContext.Provider
|
|
@@ -108,6 +111,7 @@ export const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
108
111
|
menuAppendTo={menuAppendTo}
|
|
109
112
|
isFlipEnabled={isFlipEnabled}
|
|
110
113
|
removeFindDomNode={removeFindDomNode}
|
|
114
|
+
zIndex={zIndex}
|
|
111
115
|
{...props}
|
|
112
116
|
/>
|
|
113
117
|
</DropdownContext.Provider>
|
|
@@ -78,6 +78,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
|
|
|
78
78
|
menuAppendTo,
|
|
79
79
|
isFlipEnabled,
|
|
80
80
|
removeFindDomNode,
|
|
81
|
+
zIndex,
|
|
81
82
|
...props
|
|
82
83
|
} = this.props;
|
|
83
84
|
const id = toggle.props.id || `pf-dropdown-toggle-id-${DropdownWithContext.currentId++}`;
|
|
@@ -175,6 +176,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
|
|
|
175
176
|
appendTo={menuAppendTo === 'parent' ? getParentElement() : menuAppendTo}
|
|
176
177
|
isVisible={isOpen}
|
|
177
178
|
removeFindDomNode={removeFindDomNode}
|
|
179
|
+
zIndex={zIndex}
|
|
178
180
|
popperMatchesTriggerWidth={false}
|
|
179
181
|
/>
|
|
180
182
|
);
|
|
@@ -34,6 +34,8 @@ export interface NavItemProps extends Omit<React.HTMLProps<HTMLAnchorElement>, '
|
|
|
34
34
|
onShowFlyout?: () => void;
|
|
35
35
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
36
36
|
removeFindDomNode?: boolean;
|
|
37
|
+
/** z-index of the flyout nav item */
|
|
38
|
+
zIndex?: number;
|
|
37
39
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
38
40
|
ouiaId?: number | string;
|
|
39
41
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
@@ -56,6 +58,7 @@ export const NavItem: React.FunctionComponent<NavItemProps> = ({
|
|
|
56
58
|
ouiaId,
|
|
57
59
|
ouiaSafe,
|
|
58
60
|
removeFindDomNode = false,
|
|
61
|
+
zIndex = 9999,
|
|
59
62
|
...props
|
|
60
63
|
}: NavItemProps) => {
|
|
61
64
|
const { flyoutRef, setFlyoutRef } = React.useContext(NavContext);
|
|
@@ -225,6 +228,7 @@ export const NavItem: React.FunctionComponent<NavItemProps> = ({
|
|
|
225
228
|
isVisible={flyoutVisible}
|
|
226
229
|
onDocumentKeyDown={handleFlyout}
|
|
227
230
|
removeFindDomNode={removeFindDomNode}
|
|
231
|
+
zIndex={zIndex}
|
|
228
232
|
/>
|
|
229
233
|
);
|
|
230
234
|
|
|
@@ -49,6 +49,8 @@ export interface OptionsMenuProps
|
|
|
49
49
|
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
50
50
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
51
51
|
removeFindDomNode?: boolean;
|
|
52
|
+
/** z-index of the options menu when menuAppendTo is not inline. */
|
|
53
|
+
zIndex?: number;
|
|
52
54
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
53
55
|
ouiaId?: number | string;
|
|
54
56
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
@@ -68,6 +70,7 @@ export const OptionsMenu: React.FunctionComponent<OptionsMenuProps> = ({
|
|
|
68
70
|
ouiaId,
|
|
69
71
|
ouiaSafe = true,
|
|
70
72
|
removeFindDomNode = false,
|
|
73
|
+
zIndex = 9999,
|
|
71
74
|
...props
|
|
72
75
|
}: OptionsMenuProps) => (
|
|
73
76
|
<DropdownContext.Provider
|
|
@@ -96,6 +99,7 @@ export const OptionsMenu: React.FunctionComponent<OptionsMenuProps> = ({
|
|
|
96
99
|
toggle={toggle}
|
|
97
100
|
menuAppendTo={menuAppendTo}
|
|
98
101
|
removeFindDomNode={removeFindDomNode}
|
|
102
|
+
zIndex={zIndex}
|
|
99
103
|
{...props}
|
|
100
104
|
/>
|
|
101
105
|
</DropdownContext.Provider>
|
|
@@ -119,6 +119,8 @@ export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
119
119
|
previousNavigationButtonAriaLabel?: string;
|
|
120
120
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
121
121
|
removeFindDomNode?: boolean;
|
|
122
|
+
/** z-index of the advanced search form when appendTo is not inline. */
|
|
123
|
+
zIndex?: number;
|
|
122
124
|
/** Label for the button which resets the advanced search form and clears the search input. */
|
|
123
125
|
resetButtonLabel?: string;
|
|
124
126
|
/** The number of search results returned. Either a total number of results,
|
|
@@ -160,6 +162,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
160
162
|
isDisabled = false,
|
|
161
163
|
appendTo,
|
|
162
164
|
removeFindDomNode = false,
|
|
165
|
+
zIndex = 9999,
|
|
163
166
|
type = 'text',
|
|
164
167
|
...props
|
|
165
168
|
}: SearchInputProps) => {
|
|
@@ -416,6 +419,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
|
|
|
416
419
|
enableFlip={true}
|
|
417
420
|
appendTo={() => appendTo || searchInputRef.current}
|
|
418
421
|
removeFindDomNode={removeFindDomNode}
|
|
422
|
+
zIndex={zIndex}
|
|
419
423
|
/>
|
|
420
424
|
</div>
|
|
421
425
|
);
|
|
@@ -186,6 +186,8 @@ export interface SelectProps
|
|
|
186
186
|
isFlipEnabled?: boolean;
|
|
187
187
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
188
188
|
removeFindDomNode?: boolean;
|
|
189
|
+
/** z-index of the select menu when menuAppendTo is not inline. */
|
|
190
|
+
zIndex?: number;
|
|
189
191
|
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
190
192
|
ouiaId?: number | string;
|
|
191
193
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
@@ -267,7 +269,8 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
267
269
|
isCreateSelectOptionObject: false,
|
|
268
270
|
shouldResetOnSelect: true,
|
|
269
271
|
isFlipEnabled: true,
|
|
270
|
-
removeFindDomNode: false
|
|
272
|
+
removeFindDomNode: false,
|
|
273
|
+
zIndex: 9999
|
|
271
274
|
};
|
|
272
275
|
|
|
273
276
|
state: SelectState = {
|
|
@@ -1034,6 +1037,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1034
1037
|
shouldResetOnSelect,
|
|
1035
1038
|
isFlipEnabled,
|
|
1036
1039
|
removeFindDomNode,
|
|
1040
|
+
zIndex,
|
|
1037
1041
|
...props
|
|
1038
1042
|
} = this.props;
|
|
1039
1043
|
const {
|
|
@@ -1478,6 +1482,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
1478
1482
|
appendTo={menuAppendTo === 'parent' ? getParentElement() : menuAppendTo}
|
|
1479
1483
|
isVisible={isOpen}
|
|
1480
1484
|
removeFindDomNode={removeFindDomNode}
|
|
1485
|
+
zIndex={zIndex}
|
|
1481
1486
|
/>
|
|
1482
1487
|
)}
|
|
1483
1488
|
</SelectContext.Provider>
|
|
@@ -21,6 +21,8 @@ export interface OverflowTabProps extends React.HTMLProps<HTMLLIElement> {
|
|
|
21
21
|
toggleAriaLabel?: string;
|
|
22
22
|
/** @beta Opt-in for updated popper that does not use findDOMNode. */
|
|
23
23
|
removeFindDomNode?: boolean;
|
|
24
|
+
/** z-index of the overflow tab */
|
|
25
|
+
zIndex?: number;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
@@ -30,6 +32,7 @@ export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
|
30
32
|
defaultTitleText = 'More',
|
|
31
33
|
toggleAriaLabel,
|
|
32
34
|
removeFindDomNode = false,
|
|
35
|
+
zIndex = 9999,
|
|
33
36
|
...props
|
|
34
37
|
}: OverflowTabProps) => {
|
|
35
38
|
const menuRef = React.useRef<HTMLDivElement>();
|
|
@@ -139,6 +142,7 @@ export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
|
139
142
|
popperMatchesTriggerWidth={false}
|
|
140
143
|
appendTo={overflowLIRef.current}
|
|
141
144
|
removeFindDomNode={removeFindDomNode}
|
|
145
|
+
zIndex={zIndex}
|
|
142
146
|
/>
|
|
143
147
|
);
|
|
144
148
|
};
|
|
@@ -9,300 +9,52 @@ propComponents: ['TextArea']
|
|
|
9
9
|
|
|
10
10
|
### Basic
|
|
11
11
|
|
|
12
|
-
```
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import { TextArea } from '@patternfly/react-core';
|
|
15
|
-
|
|
16
|
-
class SimpleTextArea extends React.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
this.state = {
|
|
20
|
-
value: ''
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
this.handleTextAreaChange = value => {
|
|
24
|
-
this.setState({ value });
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
render() {
|
|
29
|
-
const { value } = this.state;
|
|
30
|
-
|
|
31
|
-
return <TextArea value={value} onChange={this.handleTextAreaChange} aria-label="text area example" />;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
12
|
+
```ts file="./TextAreaBasic.tsx"
|
|
34
13
|
```
|
|
35
14
|
|
|
36
15
|
### Invalid
|
|
37
16
|
|
|
38
|
-
```
|
|
39
|
-
import React from 'react';
|
|
40
|
-
import { TextArea } from '@patternfly/react-core';
|
|
41
|
-
|
|
42
|
-
class InvalidTextArea extends React.Component {
|
|
43
|
-
constructor(props) {
|
|
44
|
-
super(props);
|
|
45
|
-
this.state = {
|
|
46
|
-
value: ''
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
this.handleInvalidTextAreaChange = value => {
|
|
50
|
-
this.setState({ value });
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
render() {
|
|
55
|
-
const { value } = this.state;
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<TextArea
|
|
59
|
-
value={value}
|
|
60
|
-
onChange={this.handleInvalidTextAreaChange}
|
|
61
|
-
isRequired
|
|
62
|
-
validated={'error'}
|
|
63
|
-
aria-label="invalid text area example"
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
17
|
+
```ts file="./TextAreaInvalid.tsx"
|
|
68
18
|
```
|
|
69
19
|
|
|
70
20
|
### Validated
|
|
71
21
|
|
|
72
|
-
```
|
|
73
|
-
import React from 'react';
|
|
74
|
-
import { Form, FormGroup, TextArea } from '@patternfly/react-core';
|
|
75
|
-
|
|
76
|
-
class InvalidTextArea extends React.Component {
|
|
77
|
-
constructor(props) {
|
|
78
|
-
super(props);
|
|
79
|
-
this.state = {
|
|
80
|
-
value: '',
|
|
81
|
-
invalidText: 'You must have something to say',
|
|
82
|
-
validated: 'default',
|
|
83
|
-
helperText: 'Share your thoughts.'
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
this.simulateNetworkCall = callback => {
|
|
87
|
-
setTimeout(callback, 2000);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
this.handleTextAreaChange = value => {
|
|
91
|
-
this.setState(
|
|
92
|
-
{
|
|
93
|
-
value,
|
|
94
|
-
validated: 'default',
|
|
95
|
-
helperText: 'Validating...'
|
|
96
|
-
},
|
|
97
|
-
this.simulateNetworkCall(() => {
|
|
98
|
-
if (value && value.length > 0) {
|
|
99
|
-
if (value.length >= 10) {
|
|
100
|
-
this.setState({ validated: 'success', helperText: 'Thanks for your comments!' });
|
|
101
|
-
} else {
|
|
102
|
-
this.setState({
|
|
103
|
-
validated: 'error',
|
|
104
|
-
invalidText: 'Your being too brief, please enter at least 10 characters.'
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
this.setState({ validated: 'warning', helperText: 'You must have something to say' });
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
render() {
|
|
116
|
-
const { value, validated, helperText, invalidText } = this.state;
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<Form>
|
|
120
|
-
<FormGroup
|
|
121
|
-
label="Comments:"
|
|
122
|
-
type="string"
|
|
123
|
-
helperText={helperText}
|
|
124
|
-
helperTextInvalid={invalidText}
|
|
125
|
-
fieldId="selection"
|
|
126
|
-
validated={validated}
|
|
127
|
-
>
|
|
128
|
-
<TextArea
|
|
129
|
-
value={value}
|
|
130
|
-
onChange={this.handleTextAreaChange}
|
|
131
|
-
isRequired
|
|
132
|
-
validated={validated}
|
|
133
|
-
aria-label="invalid text area example"
|
|
134
|
-
/>
|
|
135
|
-
</FormGroup>
|
|
136
|
-
</Form>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
22
|
+
```ts file="./TextAreaValidated.tsx"
|
|
140
23
|
```
|
|
141
24
|
|
|
142
|
-
### Vertically resizable
|
|
143
|
-
|
|
144
|
-
```js
|
|
145
|
-
import React from 'react';
|
|
146
|
-
import { TextArea } from '@patternfly/react-core';
|
|
25
|
+
### Vertically resizable
|
|
147
26
|
|
|
148
|
-
|
|
149
|
-
constructor(props) {
|
|
150
|
-
super(props);
|
|
151
|
-
this.state = {
|
|
152
|
-
value: ''
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
this.handleTextAreaChange = value => {
|
|
156
|
-
this.setState({ value });
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
render() {
|
|
161
|
-
const { value } = this.state;
|
|
162
|
-
|
|
163
|
-
return (
|
|
164
|
-
<TextArea
|
|
165
|
-
value={value}
|
|
166
|
-
onChange={this.handleTextAreaChange}
|
|
167
|
-
resizeOrientation="vertical"
|
|
168
|
-
aria-label="text vertical resize example"
|
|
169
|
-
/>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
27
|
+
```ts file="./TextAreaVerticallyResizable.tsx"
|
|
173
28
|
```
|
|
174
29
|
|
|
175
|
-
### Horizontally resizable
|
|
176
|
-
|
|
177
|
-
```js
|
|
178
|
-
import React from 'react';
|
|
179
|
-
import { TextArea } from '@patternfly/react-core';
|
|
180
|
-
|
|
181
|
-
class HorizontalResizeTextArea extends React.Component {
|
|
182
|
-
constructor(props) {
|
|
183
|
-
super(props);
|
|
184
|
-
this.state = {
|
|
185
|
-
value: ''
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
this.handleTextAreaChange = value => {
|
|
189
|
-
this.setState({ value });
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
render() {
|
|
194
|
-
const { value } = this.state;
|
|
30
|
+
### Horizontally resizable
|
|
195
31
|
|
|
196
|
-
|
|
197
|
-
<TextArea
|
|
198
|
-
value={value}
|
|
199
|
-
onChange={this.handleTextAreaChange}
|
|
200
|
-
resizeOrientation="horizontal"
|
|
201
|
-
aria-label="text horizontal resize example"
|
|
202
|
-
/>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
32
|
+
```ts file="./TextAreaHorizontallyResizable.tsx"
|
|
206
33
|
```
|
|
207
34
|
|
|
208
35
|
### Uncontrolled
|
|
209
36
|
|
|
210
|
-
```
|
|
211
|
-
import React from 'react';
|
|
212
|
-
import { TextArea } from '@patternfly/react-core';
|
|
213
|
-
|
|
214
|
-
<TextArea defaultValue="default value" aria-label="uncontrolled text area example" />;
|
|
37
|
+
```ts file="./TextAreaUncontrolled.tsx"
|
|
215
38
|
```
|
|
216
39
|
|
|
217
40
|
### Disabled
|
|
218
41
|
|
|
219
|
-
```
|
|
220
|
-
import React from 'react';
|
|
221
|
-
import { TextArea } from '@patternfly/react-core';
|
|
222
|
-
|
|
223
|
-
<TextArea aria-label="disabled text area example" isDisabled />;
|
|
42
|
+
```ts file="./TextAreaDisabled.tsx"
|
|
224
43
|
```
|
|
225
44
|
|
|
226
45
|
### Read only
|
|
227
46
|
|
|
228
|
-
```
|
|
229
|
-
import React from 'react';
|
|
230
|
-
import { Checkbox, TextArea } from '@patternfly/react-core';
|
|
231
|
-
|
|
232
|
-
const ReadOnlyTextArea = () => {
|
|
233
|
-
const [isPlainChecked, setIsPlainChecked] = React.useState(false);
|
|
234
|
-
|
|
235
|
-
return (
|
|
236
|
-
<React.Fragment>
|
|
237
|
-
<div style={{ marginBottom: '12px' }}>
|
|
238
|
-
<Checkbox
|
|
239
|
-
id="isPlain"
|
|
240
|
-
key="isPlain"
|
|
241
|
-
label="Plain read only variant"
|
|
242
|
-
isChecked={isPlainChecked}
|
|
243
|
-
onChange={checked => setIsPlainChecked(checked)}
|
|
244
|
-
/>
|
|
245
|
-
</div>
|
|
246
|
-
<TextArea
|
|
247
|
-
aria-label="read only text area example"
|
|
248
|
-
value="read only text area example"
|
|
249
|
-
readOnlyVariant={isPlainChecked ? 'plain' : 'default'}
|
|
250
|
-
/>
|
|
251
|
-
</React.Fragment>
|
|
252
|
-
);
|
|
253
|
-
};
|
|
47
|
+
```ts file="./TextAreaReadOnly.tsx"
|
|
254
48
|
```
|
|
255
49
|
|
|
256
50
|
### Auto resizing
|
|
257
51
|
|
|
258
|
-
```
|
|
259
|
-
import React from 'react';
|
|
260
|
-
import { TextArea } from '@patternfly/react-core';
|
|
261
|
-
|
|
262
|
-
<TextArea aria-label="auto resizing text area example" autoResize />;
|
|
52
|
+
```ts file="./TextAreaAutoResizing.tsx"
|
|
263
53
|
```
|
|
264
54
|
|
|
265
55
|
### Icon sprite variants
|
|
266
56
|
|
|
267
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.
|
|
268
58
|
|
|
269
|
-
```
|
|
270
|
-
import React from 'react';
|
|
271
|
-
import { TextArea } from '@patternfly/react-core';
|
|
272
|
-
|
|
273
|
-
IconSpriteTextArea = () => {
|
|
274
|
-
const [success, setSuccess] = React.useState('');
|
|
275
|
-
const [warning, setWarning] = React.useState('');
|
|
276
|
-
const [error, setError] = React.useState('');
|
|
277
|
-
|
|
278
|
-
return (
|
|
279
|
-
<>
|
|
280
|
-
<TextArea
|
|
281
|
-
validated={ValidatedOptions.success}
|
|
282
|
-
isIconSprite
|
|
283
|
-
type="text"
|
|
284
|
-
onChange={value => setSuccess(value)}
|
|
285
|
-
aria-label="success icon sprite text area example"
|
|
286
|
-
/>
|
|
287
|
-
<br />
|
|
288
|
-
<br />
|
|
289
|
-
<TextArea
|
|
290
|
-
validated={ValidatedOptions.warning}
|
|
291
|
-
isIconSprite
|
|
292
|
-
type="text"
|
|
293
|
-
onChange={value => setWarning(value)}
|
|
294
|
-
aria-label="warning icon sprite text input example"
|
|
295
|
-
/>
|
|
296
|
-
<br />
|
|
297
|
-
<br />
|
|
298
|
-
<TextArea
|
|
299
|
-
validated={ValidatedOptions.error}
|
|
300
|
-
isIconSprite
|
|
301
|
-
type="text"
|
|
302
|
-
onChange={value => setError(value)}
|
|
303
|
-
aria-label="error icon sprite text area example"
|
|
304
|
-
/>
|
|
305
|
-
</>
|
|
306
|
-
);
|
|
307
|
-
};
|
|
59
|
+
```ts isBeta file="./TextAreaIconSprite.tsx"
|
|
308
60
|
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextAreaAutoResizing: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
return (
|
|
7
|
+
<TextArea
|
|
8
|
+
value={value}
|
|
9
|
+
onChange={value => setValue(value)}
|
|
10
|
+
aria-label="auto resizing text area example"
|
|
11
|
+
autoResize
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextAreaBasic: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
return <TextArea value={value} onChange={value => setValue(value)} aria-label="text area example" />;
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextAreaHorizontallyResizable: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
return (
|
|
7
|
+
<TextArea
|
|
8
|
+
value={value}
|
|
9
|
+
onChange={value => setValue(value)}
|
|
10
|
+
resizeOrientation="horizontal"
|
|
11
|
+
aria-label="text area horizontal resize example"
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextAreaIconSprite: React.FunctionComponent = () => {
|
|
5
|
+
const [success, setSuccess] = React.useState('');
|
|
6
|
+
const [warning, setWarning] = React.useState('');
|
|
7
|
+
const [error, setError] = React.useState('');
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<TextArea
|
|
12
|
+
validated={'success'}
|
|
13
|
+
isIconSprite
|
|
14
|
+
type="text"
|
|
15
|
+
onChange={value => setSuccess(value)}
|
|
16
|
+
value={success}
|
|
17
|
+
aria-label="success icon sprite text area example"
|
|
18
|
+
/>
|
|
19
|
+
<br />
|
|
20
|
+
<br />
|
|
21
|
+
<TextArea
|
|
22
|
+
validated={'warning'}
|
|
23
|
+
isIconSprite
|
|
24
|
+
type="text"
|
|
25
|
+
onChange={value => setWarning(value)}
|
|
26
|
+
value={warning}
|
|
27
|
+
aria-label="warning icon sprite text area example"
|
|
28
|
+
/>
|
|
29
|
+
<br />
|
|
30
|
+
<br />
|
|
31
|
+
<TextArea
|
|
32
|
+
validated={'error'}
|
|
33
|
+
isIconSprite
|
|
34
|
+
type="text"
|
|
35
|
+
onChange={value => setError(value)}
|
|
36
|
+
value={error}
|
|
37
|
+
aria-label="error icon sprite text area example"
|
|
38
|
+
/>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextArea } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextAreaInvalid: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
return (
|
|
7
|
+
<TextArea
|
|
8
|
+
value={value}
|
|
9
|
+
onChange={value => setValue(value)}
|
|
10
|
+
isRequired
|
|
11
|
+
validated={'error'}
|
|
12
|
+
aria-label="invalid text area example"
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
};
|