@patternfly/react-core 5.0.0-alpha.49 → 5.0.0-alpha.50
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 +4 -0
- package/components/index.d.ts +0 -1
- package/components/index.d.ts.map +1 -1
- package/components/index.js +0 -1
- package/components/index.js.map +1 -1
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncher.d.ts +1 -1
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -0
- package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncher.js +4 -4
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherContent.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherContent.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherContext.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts +4 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts.map +1 -0
- package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherGroup.js +1 -1
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherIcon.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherIcon.js.map +1 -0
- package/dist/{js → esm/deprecated}/components/ApplicationLauncher/ApplicationLauncherItem.d.ts +1 -1
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherItem.d.ts.map +1 -0
- package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItem.js +2 -2
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherItem.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherItemContext.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherItemContext.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts +4 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts.map +1 -0
- package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherSeparator.js +1 -1
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherText.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/ApplicationLauncherText.js.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/index.d.ts.map +1 -0
- package/dist/esm/deprecated/components/ApplicationLauncher/index.js.map +1 -0
- package/dist/esm/deprecated/components/index.d.ts +2 -1
- package/dist/esm/deprecated/components/index.d.ts.map +1 -1
- package/dist/esm/deprecated/components/index.js +2 -1
- package/dist/esm/deprecated/components/index.js.map +1 -1
- package/dist/esm/helpers/favorites.js +1 -1
- package/dist/esm/helpers/favorites.js.map +1 -1
- package/dist/js/components/index.d.ts +0 -1
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +0 -1
- package/dist/js/components/index.js.map +1 -1
- package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncher.d.ts +1 -1
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -0
- package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncher.js +4 -4
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherContent.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherContent.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherContext.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts +4 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts.map +1 -0
- package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherGroup.js +1 -1
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherGroup.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherIcon.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherIcon.js.map +1 -0
- package/dist/{esm → js/deprecated}/components/ApplicationLauncher/ApplicationLauncherItem.d.ts +1 -1
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherItem.d.ts.map +1 -0
- package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItem.js +2 -2
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherItem.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherItemContext.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherItemContext.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts +4 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts.map +1 -0
- package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherSeparator.js +1 -1
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherSeparator.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherText.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/ApplicationLauncherText.js.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/index.d.ts.map +1 -0
- package/dist/js/deprecated/components/ApplicationLauncher/index.js.map +1 -0
- package/dist/js/deprecated/components/index.d.ts +2 -1
- package/dist/js/deprecated/components/index.d.ts.map +1 -1
- package/dist/js/deprecated/components/index.js +2 -1
- package/dist/js/deprecated/components/index.js.map +1 -1
- package/dist/js/helpers/favorites.js +1 -1
- package/dist/js/helpers/favorites.js.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +2 -2
- package/src/components/index.ts +0 -1
- package/src/demos/ComposableMenu/examples/ComposableApplicationLauncher.tsx +1 -1
- package/src/demos/Masthead.md +3 -0
- package/src/demos/examples/DashboardHeader.js +2 -35
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +262 -25
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +1 -30
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +0 -29
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +0 -29
- package/src/demos/examples/Page/PageStickySectionGroupUsingPageHeader.tsx +0 -29
- package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncher.tsx +4 -4
- package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherGroup.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItem.tsx +2 -2
- package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherSeparator.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx +1 -2
- package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherAlignRight.tsx +2 -2
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherAlignTop.tsx +1 -2
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherBasic.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherCustomIcon.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherDisabled.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherDocumentBody.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherFavoritesAndSearch.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherRouterLink.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherSectionsAndIcons.tsx +1 -1
- package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncherTooltip.tsx +1 -1
- package/src/deprecated/components/index.ts +2 -1
- package/src/helpers/favorites.ts +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContent.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContent.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherContext.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts +0 -4
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherGroup.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherIcon.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherIcon.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItem.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItem.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItemContext.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherItemContext.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts +0 -4
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherSeparator.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherText.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncherText.js.map +0 -1
- package/dist/esm/components/ApplicationLauncher/index.d.ts.map +0 -1
- package/dist/esm/components/ApplicationLauncher/index.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContent.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContent.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherContext.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts +0 -4
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherGroup.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherGroup.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherIcon.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherIcon.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItem.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItem.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItemContext.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherItemContext.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts +0 -4
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherSeparator.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherSeparator.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherText.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncherText.js.map +0 -1
- package/dist/js/components/ApplicationLauncher/index.d.ts.map +0 -1
- package/dist/js/components/ApplicationLauncher/index.js.map +0 -1
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContent.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContent.js +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContext.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContext.js +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherIcon.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherIcon.js +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItemContext.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItemContext.js +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherText.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherText.js +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/index.d.ts +0 -0
- /package/dist/esm/{components → deprecated/components}/ApplicationLauncher/index.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContent.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContent.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContext.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContext.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherIcon.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherIcon.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItemContext.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItemContext.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherText.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherText.js +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/index.d.ts +0 -0
- /package/dist/js/{components → deprecated/components}/ApplicationLauncher/index.js +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContent.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherContext.ts +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherIcon.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherItemContext.ts +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/ApplicationLauncherText.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/ApplicationLauncherContent.test.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/ApplicationLauncherGroup.test.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/ApplicationLauncherIcon.test.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/ApplicationLauncherText.test.tsx +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherContent.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherGroup.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherIcon.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherText.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/examples/ApplicationLauncher.md +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/examples/pf-logo-small.svg +0 -0
- /package/src/{components → deprecated/components}/ApplicationLauncher/index.ts +0 -0
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.50",
|
|
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": "^17 || ^18",
|
|
71
71
|
"react-dom": "^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "c61ae62dda93e9b27afc23874d7219d10eac353d"
|
|
74
74
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -50,7 +50,7 @@ export const ComposableApplicationLauncher: React.FunctionComponent = () => {
|
|
|
50
50
|
'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
|
|
51
51
|
);
|
|
52
52
|
firstElement && (firstElement as HTMLElement).focus();
|
|
53
|
-
setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])')));
|
|
53
|
+
setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])>*:first-child')));
|
|
54
54
|
}
|
|
55
55
|
}, 0);
|
|
56
56
|
setIsOpen(!isOpen);
|
package/src/demos/Masthead.md
CHANGED
|
@@ -7,6 +7,7 @@ import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
|
7
7
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
8
8
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
9
9
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
10
|
+
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
10
11
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
11
12
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
12
13
|
import {
|
|
@@ -16,6 +17,8 @@ DropdownItem as DropdownItemDeprecated,
|
|
|
16
17
|
DropdownToggle,
|
|
17
18
|
KebabToggle
|
|
18
19
|
} from '@patternfly/react-core/deprecated';
|
|
20
|
+
import pfIcon from './Card/pf-logo-small.svg';
|
|
21
|
+
import { Link } from '@reach/router';
|
|
19
22
|
|
|
20
23
|
## Demos
|
|
21
24
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ApplicationLauncher,
|
|
4
|
-
ApplicationLauncherItem,
|
|
5
3
|
Avatar,
|
|
6
4
|
Brand,
|
|
7
5
|
Button,
|
|
@@ -16,7 +14,7 @@ import {
|
|
|
16
14
|
ToolbarContent,
|
|
17
15
|
ToolbarGroup,
|
|
18
16
|
ToolbarItem,
|
|
19
|
-
PageToggleButton
|
|
17
|
+
PageToggleButton,
|
|
20
18
|
} from '@patternfly/react-core';
|
|
21
19
|
import {
|
|
22
20
|
Dropdown as DropdownDeprecated,
|
|
@@ -40,7 +38,6 @@ export default class DashboardHeader extends React.Component {
|
|
|
40
38
|
isDropdownOpen: false,
|
|
41
39
|
isKebabDropdownOpen: false,
|
|
42
40
|
isFullKebabDropdownOpen: false,
|
|
43
|
-
isAppLauncherOpen: false,
|
|
44
41
|
activeItem: 0
|
|
45
42
|
};
|
|
46
43
|
|
|
@@ -79,22 +76,10 @@ export default class DashboardHeader extends React.Component {
|
|
|
79
76
|
isFullKebabDropdownOpen: !this.state.isFullKebabDropdownOpen
|
|
80
77
|
});
|
|
81
78
|
};
|
|
82
|
-
|
|
83
|
-
this.onAppLauncherToggle = (_event, isAppLauncherOpen) => {
|
|
84
|
-
this.setState({
|
|
85
|
-
isAppLauncherOpen
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
this.onAppLauncherSelect = () => {
|
|
90
|
-
this.setState({
|
|
91
|
-
isAppLauncherOpen: !this.state.isAppLauncherOpen
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
79
|
}
|
|
95
80
|
|
|
96
81
|
render() {
|
|
97
|
-
const { isDropdownOpen, isKebabDropdownOpen, isFullKebabDropdownOpen
|
|
82
|
+
const { isDropdownOpen, isKebabDropdownOpen, isFullKebabDropdownOpen } = this.state;
|
|
98
83
|
const { notificationBadge } = this.props;
|
|
99
84
|
|
|
100
85
|
const kebabDropdownItems = [
|
|
@@ -133,15 +118,6 @@ export default class DashboardHeader extends React.Component {
|
|
|
133
118
|
</DropdownGroupDeprecated>
|
|
134
119
|
];
|
|
135
120
|
|
|
136
|
-
const appLauncherItems = [
|
|
137
|
-
<ApplicationLauncherItem key="application_1a" href="#">
|
|
138
|
-
Application 1 (anchor link)
|
|
139
|
-
</ApplicationLauncherItem>,
|
|
140
|
-
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
|
|
141
|
-
Application 2 (button with onClick)
|
|
142
|
-
</ApplicationLauncherItem>
|
|
143
|
-
];
|
|
144
|
-
|
|
145
121
|
const headerToolbar = (
|
|
146
122
|
<Toolbar id="toolbar" isFullHeight isStatic>
|
|
147
123
|
<ToolbarContent>
|
|
@@ -163,15 +139,6 @@ export default class DashboardHeader extends React.Component {
|
|
|
163
139
|
</ToolbarItem>
|
|
164
140
|
)}
|
|
165
141
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
166
|
-
<ToolbarItem>
|
|
167
|
-
<ApplicationLauncher
|
|
168
|
-
onSelect={this.onAppLauncherSelect}
|
|
169
|
-
onToggle={this.onAppLauncherToggle}
|
|
170
|
-
isOpen={isAppLauncherOpen}
|
|
171
|
-
items={appLauncherItems}
|
|
172
|
-
toggleId="dashboard-header-app-launcher"
|
|
173
|
-
/>
|
|
174
|
-
</ToolbarItem>
|
|
175
142
|
<ToolbarItem>
|
|
176
143
|
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
|
|
177
144
|
</ToolbarItem>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ApplicationLauncher,
|
|
4
|
-
ApplicationLauncherItem,
|
|
5
3
|
Avatar,
|
|
6
4
|
Brand,
|
|
7
5
|
Breadcrumb,
|
|
@@ -18,6 +16,11 @@ import {
|
|
|
18
16
|
MastheadContent,
|
|
19
17
|
MastheadMain,
|
|
20
18
|
MastheadToggle,
|
|
19
|
+
Menu,
|
|
20
|
+
MenuContent,
|
|
21
|
+
MenuList,
|
|
22
|
+
MenuItem,
|
|
23
|
+
MenuToggle,
|
|
21
24
|
Nav,
|
|
22
25
|
NavItem,
|
|
23
26
|
NavList,
|
|
@@ -26,13 +29,18 @@ import {
|
|
|
26
29
|
PageSectionVariants,
|
|
27
30
|
PageSidebar,
|
|
28
31
|
PageToggleButton,
|
|
32
|
+
Popper,
|
|
29
33
|
SkipToContent,
|
|
30
34
|
Text,
|
|
31
35
|
TextContent,
|
|
32
36
|
Toolbar,
|
|
33
37
|
ToolbarContent,
|
|
34
38
|
ToolbarGroup,
|
|
35
|
-
ToolbarItem
|
|
39
|
+
ToolbarItem,
|
|
40
|
+
MenuGroup,
|
|
41
|
+
MenuInput,
|
|
42
|
+
SearchInput,
|
|
43
|
+
Tooltip
|
|
36
44
|
} from '@patternfly/react-core';
|
|
37
45
|
import {
|
|
38
46
|
Dropdown as DropdownDeprecated,
|
|
@@ -41,12 +49,15 @@ import {
|
|
|
41
49
|
DropdownToggle,
|
|
42
50
|
KebabToggle
|
|
43
51
|
} from '@patternfly/react-core/deprecated';
|
|
52
|
+
import { Link } from '@reach/router';
|
|
44
53
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
45
54
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
46
55
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
47
56
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
57
|
+
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
48
58
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
49
59
|
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
|
|
60
|
+
import pfIcon from './pf-logo-small.svg';
|
|
50
61
|
|
|
51
62
|
interface NavOnSelectProps {
|
|
52
63
|
groupId: number | string;
|
|
@@ -59,9 +70,15 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
59
70
|
const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);
|
|
60
71
|
const [isKebabDropdownOpen, setIsKebabDropdownOpen] = React.useState(false);
|
|
61
72
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = React.useState(false);
|
|
62
|
-
const [isAppLauncherOpen, setIsAppLauncherOpen] = React.useState(false);
|
|
63
73
|
const [activeItem, setActiveItem] = React.useState(1);
|
|
64
74
|
|
|
75
|
+
const [isOpen, setIsOpen] = React.useState<boolean>(false);
|
|
76
|
+
const [refFullOptions, setRefFullOptions] = React.useState<Element[]>();
|
|
77
|
+
const [favorites, setFavorites] = React.useState<string[]>([]);
|
|
78
|
+
const [filteredIds, setFilteredIds] = React.useState<string[]>(['*']);
|
|
79
|
+
const menuRef = React.useRef<HTMLDivElement>(null);
|
|
80
|
+
const toggleRef = React.useRef<HTMLButtonElement>(null);
|
|
81
|
+
|
|
65
82
|
const onNavSelect = (selectedItem: NavOnSelectProps) => {
|
|
66
83
|
typeof selectedItem.itemId === 'number' && setActiveItem(selectedItem.itemId);
|
|
67
84
|
};
|
|
@@ -90,14 +107,249 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
90
107
|
setIsFullKebabDropdownOpen(!isFullKebabDropdownOpen);
|
|
91
108
|
};
|
|
92
109
|
|
|
93
|
-
const
|
|
94
|
-
|
|
110
|
+
const handleMenuKeys = (event: KeyboardEvent) => {
|
|
111
|
+
if (!isOpen) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (menuRef.current?.contains(event.target as Node) || toggleRef.current?.contains(event.target as Node)) {
|
|
115
|
+
if (event.key === 'Escape') {
|
|
116
|
+
setIsOpen(!isOpen);
|
|
117
|
+
toggleRef.current?.focus();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
123
|
+
if (isOpen && !menuRef.current?.contains(event.target as Node)) {
|
|
124
|
+
setIsOpen(false);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const onToggleClick = (ev: React.MouseEvent) => {
|
|
129
|
+
ev.stopPropagation(); // Stop handleClickOutside from handling
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
if (menuRef.current) {
|
|
132
|
+
const firstElement = menuRef.current.querySelector(
|
|
133
|
+
'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
|
|
134
|
+
);
|
|
135
|
+
firstElement && (firstElement as HTMLElement).focus();
|
|
136
|
+
setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])>*:first-child')));
|
|
137
|
+
}
|
|
138
|
+
}, 0);
|
|
139
|
+
setIsOpen(!isOpen);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
React.useEffect(() => {
|
|
143
|
+
window.addEventListener('keydown', handleMenuKeys);
|
|
144
|
+
window.addEventListener('click', handleClickOutside);
|
|
145
|
+
|
|
146
|
+
return () => {
|
|
147
|
+
window.removeEventListener('keydown', handleMenuKeys);
|
|
148
|
+
window.removeEventListener('click', handleClickOutside);
|
|
149
|
+
};
|
|
150
|
+
}, [isOpen, menuRef]);
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
const toggle = (
|
|
154
|
+
<MenuToggle
|
|
155
|
+
aria-label="Toggle"
|
|
156
|
+
ref={toggleRef}
|
|
157
|
+
variant="plain"
|
|
158
|
+
onClick={onToggleClick}
|
|
159
|
+
isExpanded={isOpen}
|
|
160
|
+
style={{ width: 'auto' }}
|
|
161
|
+
>
|
|
162
|
+
<ThIcon />
|
|
163
|
+
</MenuToggle>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const menuItems = [
|
|
167
|
+
<MenuGroup key="group1" label="Group 1">
|
|
168
|
+
<MenuList>
|
|
169
|
+
<MenuItem itemId="0" id="0" isFavorited={favorites.includes('0')}>
|
|
170
|
+
Application 1
|
|
171
|
+
</MenuItem>
|
|
172
|
+
<MenuItem
|
|
173
|
+
itemId="1"
|
|
174
|
+
id="1"
|
|
175
|
+
isFavorited={favorites.includes('1')}
|
|
176
|
+
to="#default-link2"
|
|
177
|
+
onClick={(ev) => ev.preventDefault()}
|
|
178
|
+
>
|
|
179
|
+
Application 2
|
|
180
|
+
</MenuItem>
|
|
181
|
+
</MenuList>
|
|
182
|
+
</MenuGroup>,
|
|
183
|
+
<Divider key="group1-divider" />,
|
|
184
|
+
<MenuGroup key="group2" label="Group 2">
|
|
185
|
+
<MenuList>
|
|
186
|
+
<MenuItem
|
|
187
|
+
itemId="2"
|
|
188
|
+
id="2"
|
|
189
|
+
isFavorited={favorites.includes('2')}
|
|
190
|
+
component={(props) => <Link {...props} to="#router-link" />}
|
|
191
|
+
>
|
|
192
|
+
@reach/router Link
|
|
193
|
+
</MenuItem>
|
|
194
|
+
<MenuItem
|
|
195
|
+
itemId="3"
|
|
196
|
+
id="3"
|
|
197
|
+
isFavorited={favorites.includes('3')}
|
|
198
|
+
isExternalLink
|
|
199
|
+
icon={<img src={pfIcon} />}
|
|
200
|
+
component={(props) => <Link {...props} to="#router-link2" />}
|
|
201
|
+
>
|
|
202
|
+
@reach/router Link with icon
|
|
203
|
+
</MenuItem>
|
|
204
|
+
</MenuList>
|
|
205
|
+
</MenuGroup>,
|
|
206
|
+
<Divider key="group2-divider" />,
|
|
207
|
+
<MenuList key="other-items">
|
|
208
|
+
<MenuItem key="tooltip-app" isFavorited={favorites.includes('4')} itemId="4" id="4">
|
|
209
|
+
<Tooltip content={<div>Launch Application 3</div>} position="right">
|
|
210
|
+
<span>Application 3 with tooltip</span>
|
|
211
|
+
</Tooltip>
|
|
212
|
+
</MenuItem>
|
|
213
|
+
<MenuItem key="disabled-app" itemId="5" id="5" isDisabled>
|
|
214
|
+
Unavailable Application
|
|
215
|
+
</MenuItem>
|
|
216
|
+
</MenuList>
|
|
217
|
+
];
|
|
218
|
+
|
|
219
|
+
const createFavorites = (favIds: string[]) => {
|
|
220
|
+
const favorites: unknown[] = [];
|
|
221
|
+
|
|
222
|
+
menuItems.forEach((item) => {
|
|
223
|
+
if (item.type === MenuList) {
|
|
224
|
+
item.props.children.filter((child) => {
|
|
225
|
+
if (favIds.includes(child.props.itemId)) {
|
|
226
|
+
favorites.push(child);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
} else if (item.type === MenuGroup) {
|
|
230
|
+
item.props.children.props.children.filter((child) => {
|
|
231
|
+
if (favIds.includes(child.props.itemId)) {
|
|
232
|
+
favorites.push(child);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
} else {
|
|
236
|
+
if (favIds.includes(item.props.itemId)) {
|
|
237
|
+
favorites.push(item);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
return favorites;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const filterItems = (items: any[], filteredIds: string[]) => {
|
|
246
|
+
if (filteredIds.length === 1 && filteredIds[0] === '*') {
|
|
247
|
+
return items;
|
|
248
|
+
}
|
|
249
|
+
let keepDivider = false;
|
|
250
|
+
const filteredCopy = items
|
|
251
|
+
.map((group) => {
|
|
252
|
+
if (group.type === MenuGroup) {
|
|
253
|
+
const filteredGroup = React.cloneElement(group, {
|
|
254
|
+
children: React.cloneElement(group.props.children, {
|
|
255
|
+
children: group.props.children.props.children.filter((child) => {
|
|
256
|
+
if (filteredIds.includes(child.props.itemId)) {
|
|
257
|
+
return child;
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
});
|
|
262
|
+
const filteredList = filteredGroup.props.children;
|
|
263
|
+
if (filteredList.props.children.length > 0) {
|
|
264
|
+
keepDivider = true;
|
|
265
|
+
return filteredGroup;
|
|
266
|
+
} else {
|
|
267
|
+
keepDivider = false;
|
|
268
|
+
}
|
|
269
|
+
} else if (group.type === MenuList) {
|
|
270
|
+
const filteredGroup = React.cloneElement(group, {
|
|
271
|
+
children: group.props.children.filter((child) => {
|
|
272
|
+
if (filteredIds.includes(child.props.itemId)) {
|
|
273
|
+
return child;
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
});
|
|
277
|
+
if (filteredGroup.props.children.length > 0) {
|
|
278
|
+
keepDivider = true;
|
|
279
|
+
return filteredGroup;
|
|
280
|
+
} else {
|
|
281
|
+
keepDivider = false;
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
if ((keepDivider && group.type === Divider) || filteredIds.includes(group.props.itemId)) {
|
|
285
|
+
return group;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
.filter((newGroup) => newGroup);
|
|
290
|
+
|
|
291
|
+
if (filteredCopy.length > 0) {
|
|
292
|
+
const lastGroup = filteredCopy.pop();
|
|
293
|
+
if (lastGroup.type !== Divider) {
|
|
294
|
+
filteredCopy.push(lastGroup);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return filteredCopy;
|
|
95
299
|
};
|
|
96
300
|
|
|
97
|
-
const
|
|
98
|
-
|
|
301
|
+
const onTextChange = (textValue: string) => {
|
|
302
|
+
if (textValue === '') {
|
|
303
|
+
setFilteredIds(['*']);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const filteredIds =
|
|
308
|
+
refFullOptions
|
|
309
|
+
?.filter((item) => (item as HTMLElement).innerText.toLowerCase().includes(textValue.toString().toLowerCase()))
|
|
310
|
+
.map((item) => item.id) || [];
|
|
311
|
+
setFilteredIds(filteredIds);
|
|
99
312
|
};
|
|
100
313
|
|
|
314
|
+
const onFavorite = (event: any, itemId: string, actionId: string) => {
|
|
315
|
+
event.stopPropagation();
|
|
316
|
+
if (actionId === 'fav') {
|
|
317
|
+
const isFavorite = favorites.includes(itemId);
|
|
318
|
+
if (isFavorite) {
|
|
319
|
+
setFavorites(favorites.filter((fav) => fav !== itemId));
|
|
320
|
+
} else {
|
|
321
|
+
setFavorites([...favorites, itemId]);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
const filteredFavorites = filterItems(createFavorites(favorites), filteredIds);
|
|
327
|
+
const filteredItems = filterItems(menuItems, filteredIds);
|
|
328
|
+
if (filteredItems.length === 0) {
|
|
329
|
+
filteredItems.push(<MenuItem key="no-items">No results found</MenuItem>);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const menu = (
|
|
333
|
+
// eslint-disable-next-line no-console
|
|
334
|
+
<Menu ref={menuRef} onActionClick={onFavorite} onSelect={(_ev, itemId) => console.log('selected', itemId)}>
|
|
335
|
+
<MenuInput>
|
|
336
|
+
<SearchInput aria-label="Filter menu items" type="search" onChange={(_event, value) => onTextChange(value)} />
|
|
337
|
+
</MenuInput>
|
|
338
|
+
<Divider />
|
|
339
|
+
<MenuContent>
|
|
340
|
+
{filteredFavorites.length > 0 && (
|
|
341
|
+
<React.Fragment>
|
|
342
|
+
<MenuGroup key="favorites-group" label="Favorites">
|
|
343
|
+
<MenuList>{filteredFavorites}</MenuList>
|
|
344
|
+
</MenuGroup>
|
|
345
|
+
<Divider key="favorites-divider" />
|
|
346
|
+
</React.Fragment>
|
|
347
|
+
)}
|
|
348
|
+
{filteredItems}
|
|
349
|
+
</MenuContent>
|
|
350
|
+
</Menu>
|
|
351
|
+
);
|
|
352
|
+
|
|
101
353
|
const dashboardBreadcrumb = (
|
|
102
354
|
<Breadcrumb>
|
|
103
355
|
<BreadcrumbItem>Section home</BreadcrumbItem>
|
|
@@ -144,16 +396,7 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
144
396
|
<DropdownItemDeprecated key="group 2 logout">Logout</DropdownItemDeprecated>
|
|
145
397
|
</DropdownGroupDeprecated>
|
|
146
398
|
];
|
|
147
|
-
|
|
148
|
-
const appLauncherItems = [
|
|
149
|
-
<ApplicationLauncherItem key="application_1a" href="#">
|
|
150
|
-
Application 1 (anchor link)
|
|
151
|
-
</ApplicationLauncherItem>,
|
|
152
|
-
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
|
|
153
|
-
Application 2 (button with onClick)
|
|
154
|
-
</ApplicationLauncherItem>
|
|
155
|
-
];
|
|
156
|
-
|
|
399
|
+
|
|
157
400
|
const headerToolbar = (
|
|
158
401
|
<Toolbar id="toolbar" isFullHeight isStatic>
|
|
159
402
|
<ToolbarContent>
|
|
@@ -167,13 +410,7 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
167
410
|
</ToolbarItem>
|
|
168
411
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
169
412
|
<ToolbarItem visibility={{ default: 'hidden', md: 'hidden', lg: 'visible' }}>
|
|
170
|
-
|
|
171
|
-
onSelect={onAppLauncherSelect}
|
|
172
|
-
onToggle={onAppLauncherToggle}
|
|
173
|
-
isOpen={isAppLauncherOpen}
|
|
174
|
-
items={appLauncherItems}
|
|
175
|
-
toggleId="dashboard-header-app-launcher"
|
|
176
|
-
/>
|
|
413
|
+
<Popper trigger={toggle} triggerRef={toggleRef} popper={menu} popperRef={menuRef} isVisible={isOpen} />
|
|
177
414
|
</ToolbarItem>
|
|
178
415
|
<ToolbarItem>
|
|
179
416
|
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ApplicationLauncher,
|
|
4
|
-
ApplicationLauncherItem,
|
|
5
3
|
Avatar,
|
|
6
4
|
Brand,
|
|
7
5
|
Breadcrumb,
|
|
@@ -32,7 +30,7 @@ import {
|
|
|
32
30
|
Toolbar,
|
|
33
31
|
ToolbarContent,
|
|
34
32
|
ToolbarGroup,
|
|
35
|
-
ToolbarItem
|
|
33
|
+
ToolbarItem,
|
|
36
34
|
} from '@patternfly/react-core';
|
|
37
35
|
import {
|
|
38
36
|
Dropdown as DropdownDeprecated,
|
|
@@ -59,7 +57,6 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
59
57
|
const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);
|
|
60
58
|
const [isKebabDropdownOpen, setIsKebabDropdownOpen] = React.useState(false);
|
|
61
59
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = React.useState(false);
|
|
62
|
-
const [isAppLauncherOpen, setIsAppLauncherOpen] = React.useState(false);
|
|
63
60
|
const [activeItem, setActiveItem] = React.useState(1);
|
|
64
61
|
|
|
65
62
|
const onNavSelect = (selectedItem: NavOnSelectProps) => {
|
|
@@ -90,14 +87,6 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
90
87
|
setIsFullKebabDropdownOpen(!isFullKebabDropdownOpen);
|
|
91
88
|
};
|
|
92
89
|
|
|
93
|
-
const onAppLauncherToggle = (_event: any, isOpen: boolean) => {
|
|
94
|
-
setIsAppLauncherOpen(isOpen);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const onAppLauncherSelect = () => {
|
|
98
|
-
setIsAppLauncherOpen(!isAppLauncherOpen);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
90
|
const dashboardBreadcrumb = (
|
|
102
91
|
<Breadcrumb>
|
|
103
92
|
<BreadcrumbItem>Section home</BreadcrumbItem>
|
|
@@ -145,15 +134,6 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
145
134
|
</DropdownGroupDeprecated>
|
|
146
135
|
];
|
|
147
136
|
|
|
148
|
-
const appLauncherItems = [
|
|
149
|
-
<ApplicationLauncherItem key="application_1a" href="#">
|
|
150
|
-
Application 1 (anchor link)
|
|
151
|
-
</ApplicationLauncherItem>,
|
|
152
|
-
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
|
|
153
|
-
Application 2 (button with onClick)
|
|
154
|
-
</ApplicationLauncherItem>
|
|
155
|
-
];
|
|
156
|
-
|
|
157
137
|
const headerToolbar = (
|
|
158
138
|
<Toolbar id="toolbar" isFullHeight isStatic>
|
|
159
139
|
<ToolbarContent>
|
|
@@ -166,15 +146,6 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
166
146
|
<Button aria-label="Notifications" variant={ButtonVariant.plain} icon={<BellIcon />} />
|
|
167
147
|
</ToolbarItem>
|
|
168
148
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
169
|
-
<ToolbarItem visibility={{ default: 'hidden', md: 'hidden', lg: 'visible' }}>
|
|
170
|
-
<ApplicationLauncher
|
|
171
|
-
onSelect={onAppLauncherSelect}
|
|
172
|
-
onToggle={onAppLauncherToggle}
|
|
173
|
-
isOpen={isAppLauncherOpen}
|
|
174
|
-
items={appLauncherItems}
|
|
175
|
-
toggleId="dashboard-header-app-launcher"
|
|
176
|
-
/>
|
|
177
|
-
</ToolbarItem>
|
|
178
149
|
<ToolbarItem>
|
|
179
150
|
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
|
|
180
151
|
</ToolbarItem>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ApplicationLauncher,
|
|
4
|
-
ApplicationLauncherItem,
|
|
5
3
|
Avatar,
|
|
6
4
|
Brand,
|
|
7
5
|
Breadcrumb,
|
|
@@ -59,7 +57,6 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
|
|
|
59
57
|
const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);
|
|
60
58
|
const [isKebabDropdownOpen, setIsKebabDropdownOpen] = React.useState(false);
|
|
61
59
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = React.useState(false);
|
|
62
|
-
const [isAppLauncherOpen, setIsAppLauncherOpen] = React.useState(false);
|
|
63
60
|
const [activeItem, setActiveItem] = React.useState(1);
|
|
64
61
|
|
|
65
62
|
const onNavSelect = (selectedItem: NavOnSelectProps) => {
|
|
@@ -90,14 +87,6 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
|
|
|
90
87
|
setIsFullKebabDropdownOpen(!isFullKebabDropdownOpen);
|
|
91
88
|
};
|
|
92
89
|
|
|
93
|
-
const onAppLauncherToggle = (_event: any, isOpen: boolean) => {
|
|
94
|
-
setIsAppLauncherOpen(isOpen);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const onAppLauncherSelect = () => {
|
|
98
|
-
setIsAppLauncherOpen(!isAppLauncherOpen);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
90
|
const dashboardBreadcrumb = (
|
|
102
91
|
<Breadcrumb>
|
|
103
92
|
<BreadcrumbItem>Section home</BreadcrumbItem>
|
|
@@ -145,15 +134,6 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
|
|
|
145
134
|
</DropdownGroupDeprecated>
|
|
146
135
|
];
|
|
147
136
|
|
|
148
|
-
const appLauncherItems = [
|
|
149
|
-
<ApplicationLauncherItem key="application_1a" href="#">
|
|
150
|
-
Application 1 (anchor link)
|
|
151
|
-
</ApplicationLauncherItem>,
|
|
152
|
-
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
|
|
153
|
-
Application 2 (button with onClick)
|
|
154
|
-
</ApplicationLauncherItem>
|
|
155
|
-
];
|
|
156
|
-
|
|
157
137
|
const headerToolbar = (
|
|
158
138
|
<Toolbar id="toolbar" isFullHeight isStatic>
|
|
159
139
|
<ToolbarContent>
|
|
@@ -166,15 +146,6 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
|
|
|
166
146
|
<Button aria-label="Notifications" variant={ButtonVariant.plain} icon={<BellIcon />} />
|
|
167
147
|
</ToolbarItem>
|
|
168
148
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
169
|
-
<ToolbarItem visibility={{ default: 'hidden', md: 'hidden', lg: 'visible' }}>
|
|
170
|
-
<ApplicationLauncher
|
|
171
|
-
onSelect={onAppLauncherSelect}
|
|
172
|
-
onToggle={onAppLauncherToggle}
|
|
173
|
-
isOpen={isAppLauncherOpen}
|
|
174
|
-
items={appLauncherItems}
|
|
175
|
-
toggleId="dashboard-header-app-launcher"
|
|
176
|
-
/>
|
|
177
|
-
</ToolbarItem>
|
|
178
149
|
<ToolbarItem>
|
|
179
150
|
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
|
|
180
151
|
</ToolbarItem>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ApplicationLauncher,
|
|
4
|
-
ApplicationLauncherItem,
|
|
5
3
|
Avatar,
|
|
6
4
|
Brand,
|
|
7
5
|
Breadcrumb,
|
|
@@ -61,7 +59,6 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
|
|
|
61
59
|
const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);
|
|
62
60
|
const [isKebabDropdownOpen, setIsKebabDropdownOpen] = React.useState(false);
|
|
63
61
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = React.useState(false);
|
|
64
|
-
const [isAppLauncherOpen, setIsAppLauncherOpen] = React.useState(false);
|
|
65
62
|
const [activeItem, setActiveItem] = React.useState(1);
|
|
66
63
|
|
|
67
64
|
const onNavSelect = (selectedItem: NavOnSelectProps) => {
|
|
@@ -92,14 +89,6 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
|
|
|
92
89
|
setIsFullKebabDropdownOpen(!isFullKebabDropdownOpen);
|
|
93
90
|
};
|
|
94
91
|
|
|
95
|
-
const onAppLauncherToggle = (_event: any, isOpen: boolean) => {
|
|
96
|
-
setIsAppLauncherOpen(isOpen);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const onAppLauncherSelect = () => {
|
|
100
|
-
setIsAppLauncherOpen(!isAppLauncherOpen);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
92
|
const kebabDropdownItems = [
|
|
104
93
|
<DropdownItemDeprecated key="settings">
|
|
105
94
|
<CogIcon /> Settings
|
|
@@ -136,15 +125,6 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
|
|
|
136
125
|
</DropdownItemDeprecated>
|
|
137
126
|
];
|
|
138
127
|
|
|
139
|
-
const appLauncherItems = [
|
|
140
|
-
<ApplicationLauncherItem key="application_1a" href="#">
|
|
141
|
-
Application 1 (anchor link)
|
|
142
|
-
</ApplicationLauncherItem>,
|
|
143
|
-
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
|
|
144
|
-
Application 2 (button with onClick)
|
|
145
|
-
</ApplicationLauncherItem>
|
|
146
|
-
];
|
|
147
|
-
|
|
148
128
|
const headerToolbar = (
|
|
149
129
|
<Toolbar id="toolbar" isFullHeight isStatic>
|
|
150
130
|
<ToolbarContent>
|
|
@@ -157,15 +137,6 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
|
|
|
157
137
|
<Button aria-label="Notifications" variant={ButtonVariant.plain} icon={<BellIcon />} />
|
|
158
138
|
</ToolbarItem>
|
|
159
139
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
160
|
-
<ToolbarItem visibility={{ default: 'hidden', md: 'hidden', lg: 'visible' }}>
|
|
161
|
-
<ApplicationLauncher
|
|
162
|
-
onSelect={onAppLauncherSelect}
|
|
163
|
-
onToggle={onAppLauncherToggle}
|
|
164
|
-
isOpen={isAppLauncherOpen}
|
|
165
|
-
items={appLauncherItems}
|
|
166
|
-
toggleId="dashboard-header-app-launcher"
|
|
167
|
-
/>
|
|
168
|
-
</ToolbarItem>
|
|
169
140
|
<ToolbarItem>
|
|
170
141
|
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
|
|
171
142
|
</ToolbarItem>
|