@patternfly/react-core 4.275.0 → 4.276.1
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 +20 -0
- package/components/Accordion/AccordionContent.d.ts +2 -0
- package/components/Accordion/AccordionContent.d.ts.map +1 -1
- package/components/Accordion/AccordionContent.js +13 -2
- package/components/Accordion/AccordionContent.js.map +1 -1
- package/components/Menu/Menu.d.ts +2 -2
- package/components/Menu/Menu.d.ts.map +1 -1
- package/components/Menu/Menu.js.map +1 -1
- package/components/Menu/MenuContext.d.ts +2 -2
- package/components/Menu/MenuContext.d.ts.map +1 -1
- package/components/Menu/MenuContext.js.map +1 -1
- package/components/Menu/MenuItem.d.ts.map +1 -1
- package/components/Menu/MenuItem.js +5 -5
- package/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Accordion/AccordionContent.d.ts +2 -0
- package/dist/esm/components/Accordion/AccordionContent.d.ts.map +1 -1
- package/dist/esm/components/Accordion/AccordionContent.js +13 -2
- package/dist/esm/components/Accordion/AccordionContent.js.map +1 -1
- package/dist/esm/components/Menu/Menu.d.ts +2 -2
- package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuContext.d.ts +2 -2
- package/dist/esm/components/Menu/MenuContext.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuContext.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +5 -5
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Accordion/AccordionContent.d.ts +2 -0
- package/dist/js/components/Accordion/AccordionContent.d.ts.map +1 -1
- package/dist/js/components/Accordion/AccordionContent.js +13 -2
- package/dist/js/components/Accordion/AccordionContent.js.map +1 -1
- package/dist/js/components/Menu/Menu.d.ts +2 -2
- package/dist/js/components/Menu/Menu.d.ts.map +1 -1
- package/dist/js/components/Menu/Menu.js.map +1 -1
- package/dist/js/components/Menu/MenuContext.d.ts +2 -2
- package/dist/js/components/Menu/MenuContext.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuContext.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +5 -5
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +2 -2
- package/src/components/Accordion/AccordionContent.tsx +45 -23
- package/src/components/Accordion/__tests__/AccordionContent.test.tsx +15 -2
- package/src/components/Accordion/examples/AccordionFixedWithMultipleExpandBehavior.tsx +15 -1
- package/src/components/Menu/Menu.tsx +7 -2
- package/src/components/Menu/MenuContext.ts +7 -2
- package/src/components/Menu/MenuItem.tsx +6 -5
- package/src/components/Menu/examples/Menu.md +96 -37
- package/src/components/Menu/examples/MenuFilterDrilldown.tsx +7 -2
- package/src/components/Menu/examples/MenuWithDrilldown.tsx +7 -2
- package/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx +51 -14
- package/src/components/Menu/examples/MenuWithDrilldownInitialState.tsx +7 -2
- package/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx +7 -2
- package/src/components/Nav/examples/NavDrilldown.tsx +7 -2
- package/src/demos/ComposableMenu/examples/ComposableDrilldownMenu.tsx +7 -2
- package/src/demos/examples/Nav/NavDrilldown.tsx +7 -2
|
@@ -14,13 +14,18 @@ export const MenuDrilldownInitialState: React.FunctionComponent = () => {
|
|
|
14
14
|
const [menuHeights, setMenuHeights] = React.useState<any>({ 'initial-state-rootMenu': 216 }); // The root menu height must be defined when starting from a drilled in state
|
|
15
15
|
const [activeMenu, setActiveMenu] = React.useState<string>('initial-state-drilldownMenuStartGrouping');
|
|
16
16
|
|
|
17
|
-
const drillIn = (
|
|
17
|
+
const drillIn = (
|
|
18
|
+
_event: React.KeyboardEvent | React.MouseEvent,
|
|
19
|
+
fromMenuId: string,
|
|
20
|
+
toMenuId: string,
|
|
21
|
+
pathId: string
|
|
22
|
+
) => {
|
|
18
23
|
setMenuDrilledIn([...menuDrilledIn, fromMenuId]);
|
|
19
24
|
setDrilldownPath([...drilldownPath, pathId]);
|
|
20
25
|
setActiveMenu(toMenuId);
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
const drillOut = (toMenuId: string) => {
|
|
28
|
+
const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {
|
|
24
29
|
const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);
|
|
25
30
|
const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);
|
|
26
31
|
setMenuDrilledIn(menuDrilledInSansLast);
|
|
@@ -11,13 +11,18 @@ export const MenuWithDrilldownSubmenuFunctions: React.FunctionComponent = () =>
|
|
|
11
11
|
const [menuHeights, setMenuHeights] = React.useState<any>({});
|
|
12
12
|
const [activeMenu, setActiveMenu] = React.useState<string>('functions-rootMenu');
|
|
13
13
|
|
|
14
|
-
const drillIn = (
|
|
14
|
+
const drillIn = (
|
|
15
|
+
_event: React.KeyboardEvent | React.MouseEvent,
|
|
16
|
+
fromMenuId: string,
|
|
17
|
+
toMenuId: string,
|
|
18
|
+
pathId: string
|
|
19
|
+
) => {
|
|
15
20
|
setMenuDrilledIn([...menuDrilledIn, fromMenuId]);
|
|
16
21
|
setDrilldownPath([...drilldownPath, pathId]);
|
|
17
22
|
setActiveMenu(toMenuId);
|
|
18
23
|
};
|
|
19
24
|
|
|
20
|
-
const drillOut = (toMenuId: string) => {
|
|
25
|
+
const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {
|
|
21
26
|
const menuDrilledInSansLast = menuDrilledIn.slice(0, menuDrilledIn.length - 1);
|
|
22
27
|
const pathSansLast = drilldownPath.slice(0, drilldownPath.length - 1);
|
|
23
28
|
setMenuDrilledIn(menuDrilledInSansLast);
|
|
@@ -51,13 +51,18 @@ export const NavigationDrilldown: React.FunctionComponent = () => {
|
|
|
51
51
|
const [menuHeights, setMenuHeights] = React.useState<MenuHeights>({});
|
|
52
52
|
const [activeMenu, setActiveMenu] = React.useState('rootMenu');
|
|
53
53
|
|
|
54
|
-
const onDrillIn = (
|
|
54
|
+
const onDrillIn = (
|
|
55
|
+
_event: React.KeyboardEvent | React.MouseEvent,
|
|
56
|
+
fromItemId: string,
|
|
57
|
+
toItemId: string,
|
|
58
|
+
itemId: string
|
|
59
|
+
) => {
|
|
55
60
|
setMenuDrilledIn(prevMenuDrilledIn => [...prevMenuDrilledIn, fromItemId]);
|
|
56
61
|
setDrilldownPath(prevDrilldownPath => [...prevDrilldownPath, itemId]);
|
|
57
62
|
setActiveMenu(toItemId);
|
|
58
63
|
};
|
|
59
64
|
|
|
60
|
-
const onDrillOut = (toItemId: string, _itemId: string) => {
|
|
65
|
+
const onDrillOut = (_event: React.KeyboardEvent | React.MouseEvent, toItemId: string, _itemId: string) => {
|
|
61
66
|
setMenuDrilledIn(prevMenuDrilledIn => prevMenuDrilledIn.slice(0, prevMenuDrilledIn.length - 1));
|
|
62
67
|
setDrilldownPath(prevDrilldownPath => prevDrilldownPath.slice(0, prevDrilldownPath.length - 1));
|
|
63
68
|
setActiveMenu(toItemId);
|
|
@@ -66,13 +66,18 @@ export const ComposableDrilldownMenu: React.FunctionComponent = () => {
|
|
|
66
66
|
setActiveMenu('rootMenu');
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
const drillIn = (
|
|
69
|
+
const drillIn = (
|
|
70
|
+
_event: React.KeyboardEvent | React.MouseEvent,
|
|
71
|
+
fromMenuId: string,
|
|
72
|
+
toMenuId: string,
|
|
73
|
+
pathId: string
|
|
74
|
+
) => {
|
|
70
75
|
setMenuDrilledIn([...menuDrilledIn, fromMenuId]);
|
|
71
76
|
setDrilldownPath([...drilldownPath, pathId]);
|
|
72
77
|
setActiveMenu(toMenuId);
|
|
73
78
|
};
|
|
74
79
|
|
|
75
|
-
const drillOut = (toMenuId: string) => {
|
|
80
|
+
const drillOut = (_event: React.KeyboardEvent | React.MouseEvent, toMenuId: string) => {
|
|
76
81
|
setMenuDrilledIn(menuDrilledIn.slice(0, menuDrilledIn.length - 1));
|
|
77
82
|
setDrilldownPath(drilldownPath.slice(0, drilldownPath.length - 1));
|
|
78
83
|
setActiveMenu(toMenuId);
|
|
@@ -70,13 +70,18 @@ export const NavDrilldown: React.FunctionComponent = () => {
|
|
|
70
70
|
const [activeMenuId, setActiveMenuId] = React.useState('rootMenu');
|
|
71
71
|
const navLayer = getNavLayer(activeMenuId);
|
|
72
72
|
|
|
73
|
-
const onDrillIn = (
|
|
73
|
+
const onDrillIn = (
|
|
74
|
+
_event: React.KeyboardEvent | React.MouseEvent,
|
|
75
|
+
fromItemId: string,
|
|
76
|
+
toItemId: string,
|
|
77
|
+
itemId: string
|
|
78
|
+
) => {
|
|
74
79
|
setMenuDrilledIn(prevMenuDrilledIn => [...prevMenuDrilledIn, fromItemId]);
|
|
75
80
|
setDrilldownPath(prevDrilldownPath => [...prevDrilldownPath, itemId]);
|
|
76
81
|
setActiveMenuId(toItemId);
|
|
77
82
|
};
|
|
78
83
|
|
|
79
|
-
const onDrillOut = (toItemId: string, _itemId: string) => {
|
|
84
|
+
const onDrillOut = (_event: React.KeyboardEvent | React.MouseEvent, toItemId: string, _itemId: string) => {
|
|
80
85
|
setMenuDrilledIn(prevMenuDrilledIn => prevMenuDrilledIn.slice(0, prevMenuDrilledIn.length - 1));
|
|
81
86
|
setDrilldownPath(prevDrilldownPath => prevDrilldownPath.slice(0, prevDrilldownPath.length - 1));
|
|
82
87
|
setActiveMenuId(toItemId);
|