@patternfly/react-core 4.213.1 → 4.213.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 +11 -0
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -9
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts +2 -9
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +2 -9
- 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/OptionsMenu/OptionsMenu.d.ts +2 -9
- package/dist/esm/components/OptionsMenu/OptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +2 -9
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.d.ts +10 -0
- package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts +2 -9
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.d.ts +2 -9
- package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +2 -9
- 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/OptionsMenu/OptionsMenu.d.ts +2 -9
- package/dist/js/components/OptionsMenu/OptionsMenu.d.ts.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +2 -9
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.d.ts +10 -0
- package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/umd/react-core.css +640 -640
- package/dist/umd/react-core.js +2 -2
- package/dist/umd/react-core.min.css +107 -107
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/ApplicationLauncher/ApplicationLauncher.tsx +2 -9
- package/src/components/ContextSelector/ContextSelector.tsx +2 -9
- package/src/components/Dropdown/Dropdown.tsx +3 -11
- package/src/components/OptionsMenu/OptionsMenu.tsx +2 -9
- package/src/components/Select/Select.tsx +3 -10
- package/src/helpers/Popper/Popper.tsx +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.213.
|
|
3
|
+
"version": "4.213.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",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.64.
|
|
38
|
-
"@patternfly/react-styles": "^4.63.
|
|
39
|
-
"@patternfly/react-tokens": "^4.65.
|
|
37
|
+
"@patternfly/react-icons": "^4.64.2",
|
|
38
|
+
"@patternfly/react-styles": "^4.63.2",
|
|
39
|
+
"@patternfly/react-tokens": "^4.65.2",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "42579815df2b03fd9efa0082f41dd349fa04bfe4"
|
|
64
64
|
}
|
|
@@ -9,9 +9,10 @@ import { ApplicationLauncherGroup } from './ApplicationLauncherGroup';
|
|
|
9
9
|
import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
|
|
10
10
|
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
|
|
11
11
|
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
|
|
12
|
+
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
|
|
12
13
|
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';
|
|
13
14
|
|
|
14
|
-
export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement> {
|
|
15
|
+
export interface ApplicationLauncherProps extends ToggleMenuBaseProps, React.HTMLProps<HTMLDivElement> {
|
|
15
16
|
/** Additional element css classes */
|
|
16
17
|
className?: string;
|
|
17
18
|
/** Display menu above or below dropdown toggle */
|
|
@@ -34,14 +35,6 @@ export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement
|
|
|
34
35
|
isGrouped?: boolean;
|
|
35
36
|
/** Toggle Icon, optional to override the icon used for the toggle */
|
|
36
37
|
toggleIcon?: React.ReactNode;
|
|
37
|
-
/** The container to append the menu to. Defaults to 'inline'.
|
|
38
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
39
|
-
* Some examples:
|
|
40
|
-
* menuAppendTo="parent"
|
|
41
|
-
* menuAppendTo={() => document.body}
|
|
42
|
-
* menuAppendTo={document.getElementById('target')}
|
|
43
|
-
*/
|
|
44
|
-
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
45
38
|
/** ID list of favorited ApplicationLauncherItems */
|
|
46
39
|
favorites?: string[];
|
|
47
40
|
/** Enables favorites. Callback called when an ApplicationLauncherItem's favorite button is clicked */
|
|
@@ -10,6 +10,7 @@ import { TextInput } from '../TextInput';
|
|
|
10
10
|
import { InputGroup } from '../InputGroup';
|
|
11
11
|
import { KEY_CODES } from '../../helpers/constants';
|
|
12
12
|
import { FocusTrap } from '../../helpers';
|
|
13
|
+
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
|
|
13
14
|
import { Popper } from '../../helpers/Popper/Popper';
|
|
14
15
|
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';
|
|
15
16
|
|
|
@@ -17,7 +18,7 @@ import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';
|
|
|
17
18
|
let currentId = 0;
|
|
18
19
|
const newId = currentId++;
|
|
19
20
|
|
|
20
|
-
export interface ContextSelectorProps extends OUIAProps {
|
|
21
|
+
export interface ContextSelectorProps extends ToggleMenuBaseProps, OUIAProps {
|
|
21
22
|
/** content rendered inside the Context Selector */
|
|
22
23
|
children?: React.ReactNode;
|
|
23
24
|
/** Classes applied to root element of Context Selector */
|
|
@@ -28,14 +29,6 @@ export interface ContextSelectorProps extends OUIAProps {
|
|
|
28
29
|
onToggle?: (event: any, value: boolean) => void;
|
|
29
30
|
/** Function callback called when user selects item */
|
|
30
31
|
onSelect?: (event: any, value: React.ReactNode) => void;
|
|
31
|
-
/** The container to append the menu to. Defaults to 'inline'.
|
|
32
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
33
|
-
* Some examples:
|
|
34
|
-
* menuAppendTo="parent"
|
|
35
|
-
* menuAppendTo={() => document.body}
|
|
36
|
-
* menuAppendTo={document.getElementById('target')}
|
|
37
|
-
*/
|
|
38
|
-
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
39
32
|
/** Flag indicating that the context selector should expand to full height */
|
|
40
33
|
isFullHeight?: boolean;
|
|
41
34
|
/** Labels the Context Selector for Screen Readers */
|
|
@@ -2,9 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Dropdown/dropdown';
|
|
3
3
|
import { DropdownPosition, DropdownDirection, DropdownContext } from './dropdownConstants';
|
|
4
4
|
import { DropdownWithContext } from './DropdownWithContext';
|
|
5
|
+
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
|
|
5
6
|
import { OUIAProps, useOUIAId } from '../../helpers';
|
|
6
7
|
|
|
7
|
-
export interface DropdownProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
8
|
+
export interface DropdownProps extends ToggleMenuBaseProps, React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
8
9
|
/** Anything which can be rendered in a dropdown */
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
/** Classes applied to root element of dropdown */
|
|
@@ -31,14 +32,6 @@ export interface DropdownProps extends React.HTMLProps<HTMLDivElement>, OUIAProp
|
|
|
31
32
|
};
|
|
32
33
|
/** Display menu above or below dropdown toggle */
|
|
33
34
|
direction?: DropdownDirection | 'up' | 'down';
|
|
34
|
-
/** The container to append the menu to. Defaults to 'inline'.
|
|
35
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
36
|
-
* Some examples:
|
|
37
|
-
* menuAppendTo="parent"
|
|
38
|
-
* menuAppendTo={() => document.body}
|
|
39
|
-
* menuAppendTo={document.getElementById('target')}
|
|
40
|
-
*/
|
|
41
|
-
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
42
35
|
/** Flag to indicate if dropdown has groups */
|
|
43
36
|
isGrouped?: boolean;
|
|
44
37
|
/** Toggle for the dropdown, examples: <DropdownToggle> or <DropdownToggleCheckbox> */
|
|
@@ -61,7 +54,6 @@ export const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
61
54
|
ouiaSafe,
|
|
62
55
|
alignments,
|
|
63
56
|
contextProps,
|
|
64
|
-
menuAppendTo = 'inline',
|
|
65
57
|
...props
|
|
66
58
|
}: DropdownProps) => (
|
|
67
59
|
<DropdownContext.Provider
|
|
@@ -87,7 +79,7 @@ export const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
87
79
|
...contextProps
|
|
88
80
|
}}
|
|
89
81
|
>
|
|
90
|
-
<DropdownWithContext
|
|
82
|
+
<DropdownWithContext {...props} />
|
|
91
83
|
</DropdownContext.Provider>
|
|
92
84
|
);
|
|
93
85
|
Dropdown.displayName = 'Dropdown';
|
|
@@ -3,6 +3,7 @@ import styles from '@patternfly/react-styles/css/components/OptionsMenu/options-
|
|
|
3
3
|
import { DropdownContext } from '../Dropdown';
|
|
4
4
|
import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
|
|
5
5
|
import { OUIAProps, useOUIAId } from '../../helpers';
|
|
6
|
+
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
|
|
6
7
|
|
|
7
8
|
export enum OptionsMenuPosition {
|
|
8
9
|
right = 'right',
|
|
@@ -14,7 +15,7 @@ export enum OptionsMenuDirection {
|
|
|
14
15
|
down = 'down'
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export interface OptionsMenuProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
18
|
+
export interface OptionsMenuProps extends ToggleMenuBaseProps, React.HTMLProps<HTMLDivElement>, OUIAProps {
|
|
18
19
|
/** Classes applied to root element of the options menu */
|
|
19
20
|
className?: string;
|
|
20
21
|
/** Id of the root element of the options menu */
|
|
@@ -35,14 +36,6 @@ export interface OptionsMenuProps extends React.HTMLProps<HTMLDivElement>, OUIAP
|
|
|
35
36
|
position?: 'right' | 'left';
|
|
36
37
|
/** Menu will open up or open down from the options menu toggle */
|
|
37
38
|
direction?: 'up' | 'down';
|
|
38
|
-
/** The container to append the menu to. Defaults to 'inline'.
|
|
39
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
40
|
-
* Some examples:
|
|
41
|
-
* menuAppendTo="parent"
|
|
42
|
-
* menuAppendTo={() => document.body}
|
|
43
|
-
* menuAppendTo={document.getElementById('target')}
|
|
44
|
-
*/
|
|
45
|
-
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
46
39
|
}
|
|
47
40
|
|
|
48
41
|
export const OptionsMenu: React.FunctionComponent<OptionsMenuProps> = ({
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from '../../helpers';
|
|
34
34
|
import { KeyTypes } from '../../helpers/constants';
|
|
35
35
|
import { Divider } from '../Divider';
|
|
36
|
-
import { Popper } from '../../helpers/Popper/Popper';
|
|
36
|
+
import { ToggleMenuBaseProps, Popper } from '../../helpers/Popper/Popper';
|
|
37
37
|
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';
|
|
38
38
|
import { ValidatedOptions } from '../../helpers/constants';
|
|
39
39
|
import { findTabbableElements } from '../../helpers/util';
|
|
@@ -48,7 +48,8 @@ export interface SelectViewMoreObject {
|
|
|
48
48
|
onClick: (event: React.MouseEvent | React.ChangeEvent) => void;
|
|
49
49
|
}
|
|
50
50
|
export interface SelectProps
|
|
51
|
-
extends
|
|
51
|
+
extends ToggleMenuBaseProps,
|
|
52
|
+
Omit<React.HTMLProps<HTMLDivElement>, 'onSelect' | 'ref' | 'checked' | 'selected'>,
|
|
52
53
|
OUIAProps {
|
|
53
54
|
/** Content rendered inside the Select. Must be React.ReactElement<SelectGroupProps>[] */
|
|
54
55
|
children?: React.ReactElement[];
|
|
@@ -164,14 +165,6 @@ export interface SelectProps
|
|
|
164
165
|
shouldResetOnSelect?: boolean;
|
|
165
166
|
/** Content rendered in the footer of the select menu */
|
|
166
167
|
footer?: React.ReactNode;
|
|
167
|
-
/** The container to append the menu to. Defaults to 'inline'.
|
|
168
|
-
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
169
|
-
* Some examples:
|
|
170
|
-
* menuAppendTo="parent"
|
|
171
|
-
* menuAppendTo={() => document.body}
|
|
172
|
-
* menuAppendTo={document.getElementById('target')}
|
|
173
|
-
*/
|
|
174
|
-
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
175
168
|
}
|
|
176
169
|
|
|
177
170
|
export interface SelectState {
|
|
@@ -14,6 +14,17 @@ const getOppositePlacement = (placement: Placement): any =>
|
|
|
14
14
|
(matched: string) => hash[matched as 'left' | 'right' | 'bottom' | 'top'] as BasePlacement
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
+
export interface ToggleMenuBaseProps {
|
|
18
|
+
/** The container to append the menu to. Defaults to 'inline'
|
|
19
|
+
* If your menu is being cut off you can append it to an element higher up the DOM tree.
|
|
20
|
+
* Some examples:
|
|
21
|
+
* menuAppendTo="parent"
|
|
22
|
+
* menuAppendTo={() => document.body}
|
|
23
|
+
* menuAppendTo={document.getElementById('target')}
|
|
24
|
+
*/
|
|
25
|
+
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'parent' | 'inline';
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
export const getOpacityTransition = (animationDuration: number) =>
|
|
18
29
|
`opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;
|
|
19
30
|
|