@patternfly/react-core 5.0.0-alpha.16 → 5.0.0-alpha.18
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 +16 -0
- package/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -2
- package/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/components/ApplicationLauncher/ApplicationLauncher.js +1 -1
- package/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/components/ApplicationLauncher/ApplicationLauncherContext.d.ts +1 -1
- package/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +1 -1
- package/components/ApplicationLauncher/ApplicationLauncherContext.js +1 -1
- package/components/ApplicationLauncher/ApplicationLauncherContext.js.map +1 -1
- package/components/ApplicationLauncher/ApplicationLauncherItem.js +2 -2
- package/components/ApplicationLauncher/ApplicationLauncherItem.js.map +1 -1
- package/components/Checkbox/Checkbox.d.ts +1 -1
- package/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/ClipboardCopy/ClipboardCopy.d.ts +2 -2
- package/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/components/ClipboardCopy/ClipboardCopy.js +4 -4
- package/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/components/ClipboardCopy/ClipboardCopyExpanded.d.ts +1 -1
- package/components/ClipboardCopy/ClipboardCopyExpanded.d.ts.map +1 -1
- package/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
- package/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/components/Drawer/DrawerPanelContent.d.ts +1 -1
- package/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/components/Drawer/DrawerPanelContent.js +5 -5
- package/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/components/LoginPage/LoginForm.js +1 -1
- package/components/LoginPage/LoginForm.js.map +1 -1
- package/components/Menu/MenuContent.d.ts +1 -1
- package/components/Menu/MenuContent.d.ts.map +1 -1
- package/components/Menu/MenuItem.js +1 -1
- package/components/Menu/MenuItem.js.map +1 -1
- package/components/SkipToContent/SkipToContent.d.ts +2 -11
- package/components/SkipToContent/SkipToContent.d.ts.map +1 -1
- package/components/SkipToContent/SkipToContent.js +6 -20
- package/components/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -2
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.d.ts +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.js +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.js.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItem.js +2 -2
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItem.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +4 -4
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.d.ts +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +5 -5
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/LoginPage/LoginForm.js +1 -1
- package/dist/esm/components/LoginPage/LoginForm.js.map +1 -1
- package/dist/esm/components/Menu/MenuContent.d.ts +1 -1
- package/dist/esm/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/SkipToContent/SkipToContent.d.ts +2 -11
- package/dist/esm/components/SkipToContent/SkipToContent.d.ts.map +1 -1
- package/dist/esm/components/SkipToContent/SkipToContent.js +6 -20
- package/dist/esm/components/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -2
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.d.ts +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.js +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItem.js +2 -2
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItem.js.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/js/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.js +1 -1
- package/dist/js/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +4 -4
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.d.ts +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +5 -5
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/LoginPage/LoginForm.js +1 -1
- package/dist/js/components/LoginPage/LoginForm.js.map +1 -1
- package/dist/js/components/Menu/MenuContent.d.ts +1 -1
- package/dist/js/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +1 -1
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/SkipToContent/SkipToContent.d.ts +2 -11
- package/dist/js/components/SkipToContent/SkipToContent.d.ts.map +1 -1
- package/dist/js/components/SkipToContent/SkipToContent.js +7 -21
- package/dist/js/components/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +2 -2
- package/src/components/Accordion/examples/AccordionBordered.tsx +1 -1
- package/src/components/ApplicationLauncher/ApplicationLauncher.tsx +3 -3
- package/src/components/ApplicationLauncher/ApplicationLauncherContext.ts +1 -1
- package/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx +2 -2
- package/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx +2 -2
- package/src/components/Card/examples/CardExpandable.tsx +1 -1
- package/src/components/Card/examples/CardExpandableWithIcon.tsx +1 -1
- package/src/components/Card/examples/CardHeaderInCardHead.tsx +1 -1
- package/src/components/Card/examples/CardOnlyActionsInCardHead.tsx +1 -1
- package/src/components/Card/examples/CardWithImageAndActions.tsx +2 -2
- package/src/components/Card/examples/CardWithModifiers.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- package/src/components/Checkbox/examples/CheckboxControlled.tsx +1 -1
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +5 -5
- package/src/components/ClipboardCopy/ClipboardCopyExpanded.tsx +2 -2
- package/src/components/DescriptionList/examples/DescriptionListWithCard.tsx +1 -1
- package/src/components/DescriptionList/examples/DescriptionListWithLargeDisplaySize.tsx +1 -1
- package/src/components/DescriptionList/examples/DescriptionListWithLargeDisplaySizeAndCard.tsx +1 -1
- package/src/components/Drawer/DrawerPanelContent.tsx +9 -10
- package/src/components/Drawer/examples/DrawerLightGray.tsx +3 -3
- package/src/components/Drawer/examples/DrawerResizableOnRight.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadCustomUpload.tsx +1 -1
- package/src/components/Icon/examples/IconCustomProgress.tsx +1 -1
- package/src/components/Icon/examples/IconProgress.tsx +1 -1
- package/src/components/LoginPage/LoginForm.tsx +1 -1
- package/src/components/Menu/MenuContent.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/Menu/examples/MenuBasic.tsx +1 -1
- package/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx +1 -1
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +13 -5
- package/src/components/Popover/examples/PopoverAdvanced.tsx +2 -2
- package/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx +2 -2
- package/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx +2 -2
- package/src/components/SearchInput/examples/SearchInputAdvanced.tsx +2 -2
- package/src/components/Select/examples/Select.md +18 -18
- package/src/components/SkipToContent/SkipToContent.tsx +15 -32
- package/src/components/SkipToContent/__tests__/SkipToContent.test.tsx +0 -5
- package/src/components/SkipToContent/__tests__/__snapshots__/SkipToContent.test.tsx.snap +12 -13
- package/src/components/Slider/examples/SliderContinuous.tsx +1 -1
- package/src/components/Tabs/examples/TabsBoxLight.tsx +1 -1
- package/src/components/Tabs/examples/TabsDefault.tsx +1 -1
- package/src/components/Tabs/examples/TabsDefaultOverflow.tsx +1 -1
- package/src/components/Tabs/examples/TabsFilled.tsx +1 -1
- package/src/components/Tabs/examples/TabsFilledWithIcons.tsx +1 -1
- package/src/components/Tabs/examples/TabsInset.tsx +1 -1
- package/src/components/Tabs/examples/TabsPageInsets.tsx +1 -1
- package/src/components/Tabs/examples/TabsSubtabs.tsx +1 -1
- package/src/components/Tabs/examples/TabsTooltipReactRef.tsx +1 -1
- package/src/components/Tabs/examples/TabsVertical.tsx +1 -1
- package/src/components/TextArea/examples/TextAreaReadOnly.tsx +1 -1
- package/src/components/TextInput/examples/TextInputReadOnly.tsx +1 -1
- package/src/components/Toolbar/examples/ToolbarSticky.tsx +2 -2
- package/src/components/Tooltip/examples/TooltipOptions.tsx +7 -7
- package/src/demos/CardDemos.md +1 -1
- package/src/demos/Toolbar.md +2 -2
- package/src/next/components/Wizard/examples/WizardStepErrorStatus.tsx +1 -1
- package/src/next/components/Wizard/examples/WizardToggleStepVisibility.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.18",
|
|
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": "9235609a8831e00cbe785e6a88ae42f587837f49"
|
|
74
74
|
}
|
|
@@ -123,7 +123,7 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
123
123
|
<Checkbox
|
|
124
124
|
label="Display size large"
|
|
125
125
|
isChecked={isDisplayLarge}
|
|
126
|
-
onChange={setIsDisplayLarge}
|
|
126
|
+
onChange={(_event, checked) => setIsDisplayLarge(checked)}
|
|
127
127
|
aria-label="show display large variation checkbox"
|
|
128
128
|
id="toggle-display-lg"
|
|
129
129
|
name="toggle-display-lg"
|
|
@@ -48,9 +48,9 @@ export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement
|
|
|
48
48
|
/** ID list of favorited ApplicationLauncherItems */
|
|
49
49
|
favorites?: string[];
|
|
50
50
|
/** Enables favorites. Callback called when an ApplicationLauncherItem's favorite button is clicked */
|
|
51
|
-
onFavorite?: (itemId: string, isFavorite: boolean) => void;
|
|
51
|
+
onFavorite?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, itemId: string, isFavorite: boolean) => void;
|
|
52
52
|
/** Enables search. Callback called when text input is entered into search box */
|
|
53
|
-
onSearch?: (textInput: string) => void;
|
|
53
|
+
onSearch?: (event: React.FormEvent<HTMLInputElement>, textInput: string) => void;
|
|
54
54
|
/** Placeholder text for search input */
|
|
55
55
|
searchPlaceholderText?: string;
|
|
56
56
|
/** Text for search input when no results are found */
|
|
@@ -97,7 +97,7 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
|
|
|
97
97
|
customChild={
|
|
98
98
|
<SearchInput
|
|
99
99
|
placeholder={searchPlaceholderText}
|
|
100
|
-
onChange={
|
|
100
|
+
onChange={onSearch}
|
|
101
101
|
{...searchProps}
|
|
102
102
|
/>
|
|
103
103
|
}
|
|
@@ -2,5 +2,5 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export const ApplicationLauncherContext = React.createContext({
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
onFavorite: (itemId: string, isFavorite: boolean) => {}
|
|
5
|
+
onFavorite: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, itemId: string, isFavorite: boolean) => {}
|
|
6
6
|
});
|
|
@@ -75,8 +75,8 @@ export const ApplicationLauncherItem: React.FunctionComponent<ApplicationLaunche
|
|
|
75
75
|
<button
|
|
76
76
|
className={css(styles.appLauncherMenuItem, styles.modifiers.action)}
|
|
77
77
|
aria-label={isFavorite ? ariaIsFavoriteLabel : ariaIsNotFavoriteLabel}
|
|
78
|
-
onClick={() => {
|
|
79
|
-
onFavorite((id || getUniqueId('app-launcher-option')).replace('favorite-', ''), isFavorite);
|
|
78
|
+
onClick={(event) => {
|
|
79
|
+
onFavorite(event, (id || getUniqueId('app-launcher-option')).replace('favorite-', ''), isFavorite);
|
|
80
80
|
}}
|
|
81
81
|
>
|
|
82
82
|
<StarIcon />
|
package/src/components/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export const ApplicationLauncherFavoritesAndSearch: React.FunctionComponent = ()
|
|
|
45
45
|
setFilteredItems(null);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const onFavorite = (itemId: string, isFavorite: boolean) => {
|
|
48
|
+
const onFavorite = (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>, itemId: string, isFavorite: boolean) => {
|
|
49
49
|
let updatedFavorites: string[] = [...favorites, itemId];
|
|
50
50
|
|
|
51
51
|
if (isFavorite) {
|
|
@@ -55,7 +55,7 @@ export const ApplicationLauncherFavoritesAndSearch: React.FunctionComponent = ()
|
|
|
55
55
|
setFavorites(updatedFavorites);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const onSearch = (textInput: string) => {
|
|
58
|
+
const onSearch = (_event: React.FormEvent<HTMLInputElement>, textInput: string) => {
|
|
59
59
|
if (textInput === '') {
|
|
60
60
|
setFilteredItems(null);
|
|
61
61
|
} else {
|
|
@@ -54,7 +54,7 @@ export const CardOnlyActionsInCardHead: React.FunctionComponent = () => {
|
|
|
54
54
|
/>
|
|
55
55
|
<Checkbox
|
|
56
56
|
isChecked={isChecked}
|
|
57
|
-
onChange={onClick}
|
|
57
|
+
onChange={(_event, checked) => onClick(checked)}
|
|
58
58
|
aria-label="card checkbox example"
|
|
59
59
|
id="check-3"
|
|
60
60
|
name="check3"
|
|
@@ -67,7 +67,7 @@ export const CardWithImageAndActions: React.FunctionComponent = () => {
|
|
|
67
67
|
/>
|
|
68
68
|
<Checkbox
|
|
69
69
|
isChecked={isChecked}
|
|
70
|
-
onChange={onClick}
|
|
70
|
+
onChange={(_event, checked) => onClick(checked)}
|
|
71
71
|
aria-label="card checkbox example"
|
|
72
72
|
id="check-1"
|
|
73
73
|
name="check1"
|
|
@@ -82,7 +82,7 @@ export const CardWithImageAndActions: React.FunctionComponent = () => {
|
|
|
82
82
|
<Checkbox
|
|
83
83
|
label="actions hasNoOffset"
|
|
84
84
|
isChecked={hasNoOffset}
|
|
85
|
-
onChange={toggleOffset}
|
|
85
|
+
onChange={(_event, checked) => toggleOffset(checked)}
|
|
86
86
|
aria-label="remove actions offset"
|
|
87
87
|
id="toggle-actions-offset"
|
|
88
88
|
name="toggle-actions-offset"
|
|
@@ -20,7 +20,7 @@ export interface CheckboxProps
|
|
|
20
20
|
isChecked?: boolean | null;
|
|
21
21
|
checked?: boolean;
|
|
22
22
|
/** A callback for when the checkbox selection changes. */
|
|
23
|
-
onChange?: (
|
|
23
|
+
onChange?: (event: React.FormEvent<HTMLInputElement>, checked: boolean) => void;
|
|
24
24
|
/** Label text of the checkbox. */
|
|
25
25
|
label?: React.ReactNode;
|
|
26
26
|
/** Id of the checkbox. */
|
|
@@ -67,7 +67,7 @@ export class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
private handleChange = (event: React.FormEvent<HTMLInputElement>): void => {
|
|
70
|
-
this.props.onChange(event.currentTarget.checked
|
|
70
|
+
this.props.onChange(event, event.currentTarget.checked);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
render() {
|
|
@@ -7,7 +7,7 @@ export const CheckboxControlled: React.FunctionComponent = () => {
|
|
|
7
7
|
const [isChecked3, setIsChecked3] = React.useState<boolean>(false);
|
|
8
8
|
const [isChecked4, setIsChecked4] = React.useState<boolean>(false);
|
|
9
9
|
|
|
10
|
-
const handleChange = (
|
|
10
|
+
const handleChange = (event: React.FormEvent<HTMLInputElement>, checked: boolean) => {
|
|
11
11
|
const target = event.currentTarget;
|
|
12
12
|
const name = target.name;
|
|
13
13
|
|
|
@@ -72,7 +72,7 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
|
|
|
72
72
|
/** A function that is triggered on clicking the copy button. */
|
|
73
73
|
onCopy?: (event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => void;
|
|
74
74
|
/** A function that is triggered on changing the text. */
|
|
75
|
-
onChange?: (text?: string | number) => void;
|
|
75
|
+
onChange?: (event: React.FormEvent, text?: string | number) => void;
|
|
76
76
|
/** The text which is copied. */
|
|
77
77
|
children: React.ReactNode;
|
|
78
78
|
/** Additional actions for inline clipboard copy. Should be wrapped with ClipboardCopyAction. */
|
|
@@ -119,7 +119,7 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
|
|
|
119
119
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
120
120
|
componentDidUpdate = (prevProps: ClipboardCopyProps, prevState: ClipboardCopyState) => {
|
|
121
121
|
if (prevProps.children !== this.props.children) {
|
|
122
|
-
this.
|
|
122
|
+
this.setState({ text: this.props.children as string | number });
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
|
|
@@ -136,9 +136,9 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
|
|
|
136
136
|
}));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
updateText = (text: string | number) => {
|
|
139
|
+
updateText = (text: string | number, event: React.FormEvent) => {
|
|
140
140
|
this.setState({ text });
|
|
141
|
-
this.props.onChange(text);
|
|
141
|
+
this.props.onChange(event, text);
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
render = () => {
|
|
@@ -265,7 +265,7 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
|
|
|
265
265
|
isReadOnly={isReadOnly}
|
|
266
266
|
isCode={isCode}
|
|
267
267
|
id={`content-${id}`}
|
|
268
|
-
onChange={this.updateText}
|
|
268
|
+
onChange={(event, text) => this.updateText(text, event)}
|
|
269
269
|
>
|
|
270
270
|
{this.state.text}
|
|
271
271
|
</ClipboardCopyExpanded>
|
|
@@ -7,7 +7,7 @@ import { PickOptional } from '../../helpers/typeUtils';
|
|
|
7
7
|
export interface ClipboardCopyExpandedProps extends Omit<ClipboardCopyProps, 'onChange'> {
|
|
8
8
|
className?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
-
onChange?: (
|
|
10
|
+
onChange?: (e: React.FormEvent<HTMLDivElement>, text: string) => void;
|
|
11
11
|
isReadOnly?: boolean;
|
|
12
12
|
isCode?: boolean;
|
|
13
13
|
}
|
|
@@ -32,7 +32,7 @@ export class ClipboardCopyExpanded extends React.Component<ClipboardCopyExpanded
|
|
|
32
32
|
<div
|
|
33
33
|
suppressContentEditableWarning
|
|
34
34
|
className={css(styles.clipboardCopyExpandableContent, className)}
|
|
35
|
-
onInput={(e: any) => onChange(e.target.innerText
|
|
35
|
+
onInput={(e: any) => onChange(e, e.target.innerText)}
|
|
36
36
|
contentEditable={!isReadOnly}
|
|
37
37
|
{...props}
|
|
38
38
|
>
|
|
@@ -23,7 +23,7 @@ export const DescriptionListWithCard: React.FunctionComponent = () => {
|
|
|
23
23
|
<Checkbox
|
|
24
24
|
label="isSelectable"
|
|
25
25
|
isChecked={isChecked}
|
|
26
|
-
onChange={toggleSelectable}
|
|
26
|
+
onChange={(_event, checked) => toggleSelectable(checked)}
|
|
27
27
|
aria-label="set isSelectable"
|
|
28
28
|
id="toggle-isSelectable"
|
|
29
29
|
name="toggle-isSelectable"
|
|
@@ -24,7 +24,7 @@ export const DescriptionListWithLargeDisplaySize: React.FunctionComponent = () =
|
|
|
24
24
|
<Checkbox
|
|
25
25
|
label="displaySize 2xl"
|
|
26
26
|
isChecked={isChecked}
|
|
27
|
-
onChange={toggleDisplaySize}
|
|
27
|
+
onChange={(_event, checked) => toggleDisplaySize(checked)}
|
|
28
28
|
aria-label="set display size 2xl"
|
|
29
29
|
id="toggle-display-size"
|
|
30
30
|
name="toggle-display-size"
|
package/src/components/DescriptionList/examples/DescriptionListWithLargeDisplaySizeAndCard.tsx
CHANGED
|
@@ -24,7 +24,7 @@ export const DescriptionListWithLargeDisplaySizeAndCard: React.FunctionComponent
|
|
|
24
24
|
<Checkbox
|
|
25
25
|
label="displaySize 2xl"
|
|
26
26
|
isChecked={isChecked}
|
|
27
|
-
onChange={toggleDisplaySize}
|
|
27
|
+
onChange={(_event, checked) => toggleDisplaySize(checked)}
|
|
28
28
|
aria-label="set display size 2xl"
|
|
29
29
|
id="toggle-display-size-with-card"
|
|
30
30
|
name="toggle-display-size-with-card"
|
|
@@ -17,7 +17,7 @@ export interface DrawerPanelContentProps extends React.HTMLProps<HTMLDivElement>
|
|
|
17
17
|
/** Flag indicating that the drawer panel should be resizable. */
|
|
18
18
|
isResizable?: boolean;
|
|
19
19
|
/** Callback for resize end. */
|
|
20
|
-
onResize?: (width: number, id: string) => void;
|
|
20
|
+
onResize?: (event: MouseEvent | TouchEvent | React.KeyboardEvent, width: number, id: string) => void;
|
|
21
21
|
/** The minimum size of a drawer, in either pixels or percentage. */
|
|
22
22
|
minSize?: string;
|
|
23
23
|
/** The starting size of a resizable drawer, in either pixels or percentage. */
|
|
@@ -60,9 +60,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
60
60
|
const panel = React.useRef<HTMLDivElement>();
|
|
61
61
|
const splitterRef = React.useRef<HTMLDivElement>();
|
|
62
62
|
const [separatorValue, setSeparatorValue] = React.useState(0);
|
|
63
|
-
const { position, isExpanded, isStatic, onExpand, drawerRef, drawerContentRef, isInline } =
|
|
64
|
-
DrawerContext
|
|
65
|
-
);
|
|
63
|
+
const { position, isExpanded, isStatic, onExpand, drawerRef, drawerContentRef, isInline } =
|
|
64
|
+
React.useContext(DrawerContext);
|
|
66
65
|
const hidden = isStatic ? false : !isExpanded;
|
|
67
66
|
const [isExpandedInternal, setIsExpandedInternal] = React.useState(!hidden);
|
|
68
67
|
let currWidth: number = 0;
|
|
@@ -169,13 +168,13 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
169
168
|
setSeparatorValue(calcValueNow());
|
|
170
169
|
};
|
|
171
170
|
|
|
172
|
-
const handleMouseup = () => {
|
|
171
|
+
const handleMouseup = (e: MouseEvent) => {
|
|
173
172
|
if (!isResizing) {
|
|
174
173
|
return;
|
|
175
174
|
}
|
|
176
175
|
drawerRef.current.classList.remove(css(styles.modifiers.resizing));
|
|
177
176
|
isResizing = false;
|
|
178
|
-
onResize && onResize(currWidth, id);
|
|
177
|
+
onResize && onResize(e, currWidth, id);
|
|
179
178
|
setInitialVals = true;
|
|
180
179
|
document.removeEventListener('mousemove', callbackMouseMove);
|
|
181
180
|
document.removeEventListener('mouseup', callbackMouseUp);
|
|
@@ -187,7 +186,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
187
186
|
return;
|
|
188
187
|
}
|
|
189
188
|
isResizing = false;
|
|
190
|
-
onResize && onResize(currWidth, id);
|
|
189
|
+
onResize && onResize(e, currWidth, id);
|
|
191
190
|
document.removeEventListener('touchmove', callbackTouchMove);
|
|
192
191
|
document.removeEventListener('touchend', callbackTouchEnd);
|
|
193
192
|
};
|
|
@@ -215,7 +214,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
215
214
|
e.preventDefault();
|
|
216
215
|
|
|
217
216
|
if (key === 'Escape' || key === 'Enter') {
|
|
218
|
-
onResize && onResize(currWidth, id);
|
|
217
|
+
onResize && onResize(e, currWidth, id);
|
|
219
218
|
}
|
|
220
219
|
const panelRect = panel.current.getBoundingClientRect();
|
|
221
220
|
newSize = position === 'bottom' ? panelRect.height : panelRect.width;
|
|
@@ -249,7 +248,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
249
248
|
}
|
|
250
249
|
return (
|
|
251
250
|
<GenerateId prefix="pf-drawer-panel-">
|
|
252
|
-
{panelId => (
|
|
251
|
+
{(panelId) => (
|
|
253
252
|
<div
|
|
254
253
|
id={id || panelId}
|
|
255
254
|
className={css(
|
|
@@ -261,7 +260,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
261
260
|
className
|
|
262
261
|
)}
|
|
263
262
|
ref={panel}
|
|
264
|
-
onTransitionEnd={ev => {
|
|
263
|
+
onTransitionEnd={(ev) => {
|
|
265
264
|
if (!hidden && ev.nativeEvent.propertyName === 'transform') {
|
|
266
265
|
onExpand();
|
|
267
266
|
}
|
|
@@ -66,7 +66,7 @@ export const DrawerLightGray: React.FunctionComponent = () => {
|
|
|
66
66
|
<Checkbox
|
|
67
67
|
label="Gray panel"
|
|
68
68
|
isChecked={panelGray}
|
|
69
|
-
onChange={togglePanelGray}
|
|
69
|
+
onChange={(_event, checked) => togglePanelGray(checked)}
|
|
70
70
|
aria-label="Gray panel checkbox"
|
|
71
71
|
id="toggle-gray-panel"
|
|
72
72
|
name="toggle-gray-panel"
|
|
@@ -74,7 +74,7 @@ export const DrawerLightGray: React.FunctionComponent = () => {
|
|
|
74
74
|
<Checkbox
|
|
75
75
|
label="Gray content"
|
|
76
76
|
isChecked={contentGray}
|
|
77
|
-
onChange={toggleContentGray}
|
|
77
|
+
onChange={(_event, checked) => toggleContentGray(checked)}
|
|
78
78
|
aria-label="Gray content checkbox"
|
|
79
79
|
id="toggle-gray-content"
|
|
80
80
|
name="toggle-gray-content"
|
|
@@ -82,7 +82,7 @@ export const DrawerLightGray: React.FunctionComponent = () => {
|
|
|
82
82
|
<Checkbox
|
|
83
83
|
label="Gray section"
|
|
84
84
|
isChecked={sectionGray}
|
|
85
|
-
onChange={toggleSectionGray}
|
|
85
|
+
onChange={(_event, checked) => toggleSectionGray(checked)}
|
|
86
86
|
aria-label="Gray section checkbox"
|
|
87
87
|
id="toggle-gray-section"
|
|
88
88
|
name="toggle-gray-section"
|
|
@@ -26,7 +26,7 @@ export const DrawerResizableOnRight: React.FunctionComponent = () => {
|
|
|
26
26
|
setIsExpanded(false);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
const onResize = (newWidth: number, id: string) => {
|
|
29
|
+
const onResize = (_event: MouseEvent | TouchEvent | React.KeyboardEvent, newWidth: number, id: string) => {
|
|
30
30
|
// eslint-disable-next-line no-console
|
|
31
31
|
console.log(`${id} has new width of: ${newWidth}`);
|
|
32
32
|
};
|
|
@@ -89,7 +89,7 @@ export const CustomPreviewFileUpload: React.FunctionComponent = () => {
|
|
|
89
89
|
label={stateKey}
|
|
90
90
|
aria-label={stateKey}
|
|
91
91
|
isChecked={checkedState[index]}
|
|
92
|
-
onChange={checked => handleOnChange(checked, stateKey, index)}
|
|
92
|
+
onChange={(_event, checked) => handleOnChange(checked, stateKey, index)}
|
|
93
93
|
/>
|
|
94
94
|
))}
|
|
95
95
|
<br />
|
|
@@ -10,7 +10,7 @@ export const IconProgress: React.FunctionComponent = () => {
|
|
|
10
10
|
<Checkbox
|
|
11
11
|
label="Toggle in progress state"
|
|
12
12
|
isChecked={isInProgress}
|
|
13
|
-
onChange={checked => setIsInProgress(checked)}
|
|
13
|
+
onChange={(_event, checked) => setIsInProgress(checked)}
|
|
14
14
|
aria-label="Set icon progress state"
|
|
15
15
|
id="toggle-icon-progress-custom"
|
|
16
16
|
name="toggle-icon-progress-custom"
|
|
@@ -10,7 +10,7 @@ export const IconProgress: React.FunctionComponent = () => {
|
|
|
10
10
|
<Checkbox
|
|
11
11
|
label="Toggle in progress state"
|
|
12
12
|
isChecked={isInProgress}
|
|
13
|
-
onChange={checked => setIsInProgress(checked)}
|
|
13
|
+
onChange={(_event, checked) => setIsInProgress(checked)}
|
|
14
14
|
aria-label="Set icon progress state"
|
|
15
15
|
id="toggle-icon-progress"
|
|
16
16
|
name="toggle-icon-progress"
|
|
@@ -142,7 +142,7 @@ export const LoginForm: React.FunctionComponent<LoginFormProps> = ({
|
|
|
142
142
|
id="pf-login-remember-me-id"
|
|
143
143
|
label={rememberMeLabel}
|
|
144
144
|
isChecked={isRememberMeChecked}
|
|
145
|
-
onChange={onChangeRememberMe}
|
|
145
|
+
onChange={(event, checked) => onChangeRememberMe(checked, event)}
|
|
146
146
|
/>
|
|
147
147
|
</FormGroup>
|
|
148
148
|
)}
|
|
@@ -6,7 +6,7 @@ import { MenuContext } from './MenuContext';
|
|
|
6
6
|
export interface MenuContentProps extends React.HTMLProps<HTMLElement> {
|
|
7
7
|
/** Items within group */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
/** Forwarded ref */
|
|
9
|
+
/** @hide Forwarded ref */
|
|
10
10
|
innerRef?: React.Ref<any>;
|
|
11
11
|
/** Height of the menu content */
|
|
12
12
|
menuHeight?: string;
|
|
@@ -350,7 +350,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
350
350
|
id={randomId}
|
|
351
351
|
component="span"
|
|
352
352
|
isChecked={isSelected || false}
|
|
353
|
-
onChange={event => onItemSelect(event, onSelect)}
|
|
353
|
+
onChange={(event) => onItemSelect(event, onSelect)}
|
|
354
354
|
isDisabled={isDisabled}
|
|
355
355
|
/>
|
|
356
356
|
</span>
|
|
@@ -40,7 +40,7 @@ export const MenuBasic: React.FunctionComponent = () => {
|
|
|
40
40
|
<Checkbox
|
|
41
41
|
label="Plain menu"
|
|
42
42
|
isChecked={isPlain}
|
|
43
|
-
onChange={togglePlain}
|
|
43
|
+
onChange={(_event, checked) => togglePlain(checked)}
|
|
44
44
|
aria-label="plain menu checkbox"
|
|
45
45
|
id="toggle-plain"
|
|
46
46
|
name="toggle-plain"
|
|
@@ -264,7 +264,7 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
|
|
|
264
264
|
<Checkbox
|
|
265
265
|
label="Set max menu height"
|
|
266
266
|
isChecked={withMaxMenuHeight}
|
|
267
|
-
onChange={onToggleMaxMenuHeight}
|
|
267
|
+
onChange={(_event, checked) => onToggleMaxMenuHeight(checked)}
|
|
268
268
|
aria-label="Set max menu height checkbox"
|
|
269
269
|
id="toggle-max-menu-height"
|
|
270
270
|
name="toggle-max-menu-height"
|
|
@@ -1225,12 +1225,20 @@ exports[`Page Check page to verify skip to content points to main content region
|
|
|
1225
1225
|
data-testid="page-test-id"
|
|
1226
1226
|
id="PageId"
|
|
1227
1227
|
>
|
|
1228
|
-
<
|
|
1229
|
-
class="pf-c-
|
|
1230
|
-
href="#main-content-page-layout-test-nav"
|
|
1228
|
+
<div
|
|
1229
|
+
class="pf-c-skip-to-content"
|
|
1231
1230
|
>
|
|
1232
|
-
|
|
1233
|
-
|
|
1231
|
+
<a
|
|
1232
|
+
aria-disabled="false"
|
|
1233
|
+
class="pf-c-button pf-m-primary"
|
|
1234
|
+
data-ouia-component-id="OUIA-Generated-Button-primary-1"
|
|
1235
|
+
data-ouia-component-type="PF4/Button"
|
|
1236
|
+
data-ouia-safe="true"
|
|
1237
|
+
href="#main-content-page-layout-test-nav"
|
|
1238
|
+
>
|
|
1239
|
+
Skip to Content
|
|
1240
|
+
</a>
|
|
1241
|
+
</div>
|
|
1234
1242
|
<header
|
|
1235
1243
|
class="pf-c-page__header"
|
|
1236
1244
|
>
|
|
@@ -41,14 +41,14 @@ export const PopoverAdvanced: React.FunctionComponent = () => {
|
|
|
41
41
|
<Checkbox
|
|
42
42
|
label="Flip popover if the position falls outside the view"
|
|
43
43
|
isChecked={keepInViewChecked}
|
|
44
|
-
onChange={handleKeepInViewChange}
|
|
44
|
+
onChange={(_event, checked) => handleKeepInViewChange(checked)}
|
|
45
45
|
aria-label="Keep in view"
|
|
46
46
|
id="popover-advanced-check-1"
|
|
47
47
|
/>
|
|
48
48
|
<Checkbox
|
|
49
49
|
label="Toggle popover from outside"
|
|
50
50
|
isChecked={show}
|
|
51
|
-
onChange={handleProgrammaticChange}
|
|
51
|
+
onChange={(_event, checked) => handleProgrammaticChange(checked)}
|
|
52
52
|
aria-label="Toggle popover from outside"
|
|
53
53
|
id="popover-advanced-check-2"
|
|
54
54
|
/>
|
|
@@ -10,7 +10,7 @@ export const ProgressStepperBasicWithAlignment: React.FunctionComponent = () =>
|
|
|
10
10
|
<Checkbox
|
|
11
11
|
label="Vertical alignment"
|
|
12
12
|
isChecked={isVertical}
|
|
13
|
-
onChange={setIsVertical}
|
|
13
|
+
onChange={(_event, checked) => setIsVertical(checked)}
|
|
14
14
|
aria-label="Toggle vertical alignment"
|
|
15
15
|
id="toggle-vertical"
|
|
16
16
|
name="toggle-vertical"
|
|
@@ -18,7 +18,7 @@ export const ProgressStepperBasicWithAlignment: React.FunctionComponent = () =>
|
|
|
18
18
|
<Checkbox
|
|
19
19
|
label="Center alignment"
|
|
20
20
|
isChecked={isCenterAligned}
|
|
21
|
-
onChange={setIsCenterAligned}
|
|
21
|
+
onChange={(_event, checked) => setIsCenterAligned(checked)}
|
|
22
22
|
aria-label="Toggle center alignment"
|
|
23
23
|
id="toggle-center"
|
|
24
24
|
name="toggle-center"
|
|
@@ -10,7 +10,7 @@ export const ProgressStepperCompact: React.FunctionComponent = () => {
|
|
|
10
10
|
<Checkbox
|
|
11
11
|
label="Vertical alignment"
|
|
12
12
|
isChecked={isVertical}
|
|
13
|
-
onChange={setIsVertical}
|
|
13
|
+
onChange={(_event, checked) => setIsVertical(checked)}
|
|
14
14
|
aria-label="Toggle compact vertical alignment"
|
|
15
15
|
id="toggle-compact-vertical"
|
|
16
16
|
name="toggle-compact-vertical"
|
|
@@ -18,7 +18,7 @@ export const ProgressStepperCompact: React.FunctionComponent = () => {
|
|
|
18
18
|
<Checkbox
|
|
19
19
|
label="Center alignment"
|
|
20
20
|
isChecked={isCenterAligned}
|
|
21
|
-
onChange={setIsCenterAligned}
|
|
21
|
+
onChange={(_event, checked) => setIsCenterAligned(checked)}
|
|
22
22
|
aria-label="Toggle compact center alignment"
|
|
23
23
|
id="toggle-compact-center"
|
|
24
24
|
name="toggle-compact-center"
|
|
@@ -17,7 +17,7 @@ export const SearchInputAdvanced: React.FunctionComponent = () => {
|
|
|
17
17
|
<Checkbox
|
|
18
18
|
label="Use equal sign as search attribute delimiter"
|
|
19
19
|
isChecked={useEqualsAsDelimiter}
|
|
20
|
-
onChange={toggleDelimiter}
|
|
20
|
+
onChange={(_event, checked) => toggleDelimiter(checked)}
|
|
21
21
|
aria-label="change delimiter checkbox"
|
|
22
22
|
id="toggle-delimiter"
|
|
23
23
|
name="toggle-delimiter"
|
|
@@ -25,7 +25,7 @@ export const SearchInputAdvanced: React.FunctionComponent = () => {
|
|
|
25
25
|
<Checkbox
|
|
26
26
|
label="Add custom footer element after the attributes in the menu"
|
|
27
27
|
isChecked={useCustomFooter}
|
|
28
|
-
onChange={
|
|
28
|
+
onChange={(_event, checked) => setUseCustomFooter(checked)}
|
|
29
29
|
aria-label="change use custom footer checkbox"
|
|
30
30
|
id="toggle-custom-footer"
|
|
31
31
|
name="toggle-custom-footer"
|