@exmg/exm-navigation 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +16 -0
- package/index.js +17 -0
- package/package.json +54 -0
- package/src/exm-navigation-base.d.ts +30 -0
- package/src/exm-navigation-base.js +85 -0
- package/src/exm-navigation-drawer-base.d.ts +29 -0
- package/src/exm-navigation-drawer-base.js +173 -0
- package/src/exm-navigation-drawer-nav.d.ts +9 -0
- package/src/exm-navigation-drawer-nav.js +47 -0
- package/src/exm-navigation-drawer.d.ts +9 -0
- package/src/exm-navigation-drawer.js +12 -0
- package/src/exm-navigation-rail-base.d.ts +4 -0
- package/src/exm-navigation-rail-base.js +10 -0
- package/src/exm-navigation-rail-nav-base.d.ts +4 -0
- package/src/exm-navigation-rail-nav-base.js +9 -0
- package/src/exm-navigation-rail-nav-item-base.d.ts +14 -0
- package/src/exm-navigation-rail-nav-item-base.js +69 -0
- package/src/exm-navigation-rail-nav-item.d.ts +9 -0
- package/src/exm-navigation-rail-nav-item.js +12 -0
- package/src/exm-navigation-rail-nav.d.ts +9 -0
- package/src/exm-navigation-rail-nav.js +12 -0
- package/src/exm-navigation-rail.d.ts +9 -0
- package/src/exm-navigation-rail.js +12 -0
- package/src/exm-navigation-signals.d.ts +11 -0
- package/src/exm-navigation-signals.js +11 -0
- package/src/exm-navigation-toolbar-base.d.ts +8 -0
- package/src/exm-navigation-toolbar-base.js +33 -0
- package/src/exm-navigation-toolbar.d.ts +9 -0
- package/src/exm-navigation-toolbar.js +12 -0
- package/src/styles/exm-navigation-drawer-css.d.ts +2 -0
- package/src/styles/exm-navigation-drawer-css.js +4 -0
- package/src/styles/exm-navigation-drawer.scss +29 -0
- package/src/styles/exm-navigation-rail-css.d.ts +2 -0
- package/src/styles/exm-navigation-rail-css.js +4 -0
- package/src/styles/exm-navigation-rail-nav-css.d.ts +2 -0
- package/src/styles/exm-navigation-rail-nav-css.js +4 -0
- package/src/styles/exm-navigation-rail-nav-item-css.d.ts +2 -0
- package/src/styles/exm-navigation-rail-nav-item-css.js +4 -0
- package/src/styles/exm-navigation-rail-nav-item.scss +107 -0
- package/src/styles/exm-navigation-rail-nav.scss +7 -0
- package/src/styles/exm-navigation-rail.scss +35 -0
- package/src/styles/exm-navigation-styles-css.d.ts +2 -0
- package/src/styles/exm-navigation-styles-css.js +4 -0
- package/src/styles/exm-navigation-styles.scss +46 -0
- package/src/styles/exm-navigation-toolbar-css.d.ts +2 -0
- package/src/styles/exm-navigation-toolbar-css.js +4 -0
- package/src/styles/exm-navigation-toolbar.scss +18 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { ExmgNavigationRailNavItem } from './src/exm-navigation-rail-nav-item.js';
|
|
2
|
+
export { ExmgNavigationRailNav } from './src/exm-navigation-rail-nav.js';
|
|
3
|
+
export { ExmgNavigationRailBase } from './src/exm-navigation-rail-base.js';
|
|
4
|
+
export { ExmgNavigationRail } from './src/exm-navigation-rail.js';
|
|
5
|
+
export { ExmgNavigationDrawerBase } from './src/exm-navigation-drawer-base.js';
|
|
6
|
+
export { ExmgNavigationDrawer } from './src/exm-navigation-drawer.js';
|
|
7
|
+
export { ExmgNavigationToolbarBase } from './src/exm-navigation-toolbar-base.js';
|
|
8
|
+
export { ExmgNavigationBase } from './src/exm-navigation-base.js';
|
|
9
|
+
export { navigationItemHover, navigationDrawerHover, navigationDrawerOpen, navigationRailSelected, navigationRailActive, navigationDrawerPersistent, navigationRailHidden, navigationActiveHasSubmenu, navigationSubSelected, } from './src/exm-navigation-signals.js';
|
|
10
|
+
export { SignalWatcher } from '@lit-labs/preact-signals';
|
|
11
|
+
export { style as exmgRailStyles } from './src/styles/exm-navigation-rail-css.js';
|
|
12
|
+
export { style as exmgRailNavStyles } from './src/styles/exm-navigation-rail-nav-css.js';
|
|
13
|
+
export { style as exmgRailNavItemStyles } from './src/styles/exm-navigation-rail-nav-item-css.js';
|
|
14
|
+
export { style as exmgDrawerStyles } from './src/styles/exm-navigation-drawer-css.js';
|
|
15
|
+
export { style as exmgToolbarStyles } from './src/styles/exm-navigation-toolbar-css.js';
|
|
16
|
+
export { style as exmgNavigationDrawerStyles } from './src/styles/exm-navigation-styles-css.js';
|
package/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { ExmgNavigationRailNavItem } from './src/exm-navigation-rail-nav-item.js';
|
|
2
|
+
export { ExmgNavigationRailNav } from './src/exm-navigation-rail-nav.js';
|
|
3
|
+
export { ExmgNavigationRailBase } from './src/exm-navigation-rail-base.js';
|
|
4
|
+
export { ExmgNavigationRail } from './src/exm-navigation-rail.js';
|
|
5
|
+
export { ExmgNavigationDrawerBase } from './src/exm-navigation-drawer-base.js';
|
|
6
|
+
export { ExmgNavigationDrawer } from './src/exm-navigation-drawer.js';
|
|
7
|
+
export { ExmgNavigationToolbarBase } from './src/exm-navigation-toolbar-base.js';
|
|
8
|
+
export { ExmgNavigationBase } from './src/exm-navigation-base.js';
|
|
9
|
+
export { navigationItemHover, navigationDrawerHover, navigationDrawerOpen, navigationRailSelected, navigationRailActive, navigationDrawerPersistent, navigationRailHidden, navigationActiveHasSubmenu, navigationSubSelected, } from './src/exm-navigation-signals.js';
|
|
10
|
+
export { SignalWatcher } from '@lit-labs/preact-signals';
|
|
11
|
+
export { style as exmgRailStyles } from './src/styles/exm-navigation-rail-css.js';
|
|
12
|
+
export { style as exmgRailNavStyles } from './src/styles/exm-navigation-rail-nav-css.js';
|
|
13
|
+
export { style as exmgRailNavItemStyles } from './src/styles/exm-navigation-rail-nav-item-css.js';
|
|
14
|
+
export { style as exmgDrawerStyles } from './src/styles/exm-navigation-drawer-css.js';
|
|
15
|
+
export { style as exmgToolbarStyles } from './src/styles/exm-navigation-toolbar-css.js';
|
|
16
|
+
export { style as exmgNavigationDrawerStyles } from './src/styles/exm-navigation-styles-css.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exmg/exm-navigation",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js",
|
|
9
|
+
"./exm-navigation-rail.js": "./src/exm-navigation-rail.js",
|
|
10
|
+
"./exm-navigation-rail-nav.js": "./src/exm-navigation-rail-nav.js",
|
|
11
|
+
"./exm-navigation-rail-nav-item.js": "./src/exm-navigation-rail-nav-item.js",
|
|
12
|
+
"./exm-navigation-drawer.js": "./src/exm-navigation-drawer.js",
|
|
13
|
+
"./exm-navigation-toolbar.js": "./src/exm-navigation-toolbar.js",
|
|
14
|
+
"./exm-navigation-drawer-nav.js": "./src/exm-navigation-drawer-nav.js",
|
|
15
|
+
"./exm-navigation-base.js": "./src/ExmgNavigationBase.js"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@exmg/lit-base": "^2.0.1",
|
|
19
|
+
"@lit-labs/observers": "^2.0.2",
|
|
20
|
+
"@lit-labs/preact-signals": "^1.0.1",
|
|
21
|
+
"@material/mwc-drawer": "^0.27.0",
|
|
22
|
+
"@material/mwc-top-app-bar-fixed": "^0.27.0",
|
|
23
|
+
"@material/web": "^1.3.0",
|
|
24
|
+
"lit": "^3.0.0",
|
|
25
|
+
"tslib": "^2.6.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@exmg/lit-cli": "1.1.13"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"web-components",
|
|
32
|
+
"lit",
|
|
33
|
+
"navigation"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"**/*.scss",
|
|
37
|
+
"**/*.js",
|
|
38
|
+
"**/*.d.ts"
|
|
39
|
+
],
|
|
40
|
+
"homepage": "https://github.com/exmg/exmachina-web-components",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git@github.com:exmg/exm-web-components.git",
|
|
44
|
+
"directory": "packages/exm-navigation"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build:styles": "exmg-lit-cli sass -f \"./**/*.scss\""
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "0907b55c89325d59902b98a64c352bf6e1fc81ff"
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ExmgNavigationDrawer } from './exm-navigation-drawer.js';
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
items?: MenuItem[];
|
|
10
|
+
}
|
|
11
|
+
declare const ExmgNavigationBase_base: typeof LitElement;
|
|
12
|
+
export declare class ExmgNavigationBase extends ExmgNavigationBase_base {
|
|
13
|
+
pageId: string;
|
|
14
|
+
drawer?: ExmgNavigationDrawer;
|
|
15
|
+
menu: MenuItem[];
|
|
16
|
+
expandedItems: {
|
|
17
|
+
[k: string]: boolean;
|
|
18
|
+
};
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
isSubMenuExpanded(id: string): boolean;
|
|
21
|
+
toggleExpanded(id: string): void;
|
|
22
|
+
getItemsFromParentId(id: string): MenuItem[];
|
|
23
|
+
getActiveSubmenuParent(): string | null;
|
|
24
|
+
loadPage(id: string): void;
|
|
25
|
+
handlSubMenuBackClick(): void;
|
|
26
|
+
handleNavigationSubClicked(i: MenuItem, parentId: string): void;
|
|
27
|
+
handleRailClick(id: string): void;
|
|
28
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { SignalWatcher } from '@lit-labs/preact-signals';
|
|
3
|
+
import { LitElement, html } from 'lit';
|
|
4
|
+
import { navigationDrawerHover, navigationDrawerPersistent, navigationItemHover, navigationRailActive, navigationRailSelected, navigationSubSelected, } from './exm-navigation-signals.js';
|
|
5
|
+
import { property, query } from 'lit/decorators.js';
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
export class ExmgNavigationBase extends SignalWatcher(LitElement) {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.pageId = 'chat';
|
|
11
|
+
this.menu = [];
|
|
12
|
+
this.expandedItems = {};
|
|
13
|
+
}
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
super.connectedCallback();
|
|
16
|
+
navigationRailSelected.value = this.pageId;
|
|
17
|
+
navigationRailActive.value = this.pageId;
|
|
18
|
+
}
|
|
19
|
+
isSubMenuExpanded(id) {
|
|
20
|
+
return !!this.expandedItems[id];
|
|
21
|
+
}
|
|
22
|
+
toggleExpanded(id) {
|
|
23
|
+
const expanded = this.isSubMenuExpanded(id);
|
|
24
|
+
this.expandedItems[id] = !expanded;
|
|
25
|
+
this.requestUpdate();
|
|
26
|
+
}
|
|
27
|
+
getItemsFromParentId(id) {
|
|
28
|
+
var _a;
|
|
29
|
+
return ((_a = this.menu.find((i) => i.id === id)) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
30
|
+
}
|
|
31
|
+
getActiveSubmenuParent() {
|
|
32
|
+
// On hover show howver content and otherwise show the selected submenu
|
|
33
|
+
const parentId = !navigationItemHover.value && !navigationDrawerHover.value
|
|
34
|
+
? navigationRailSelected.value
|
|
35
|
+
: navigationRailActive.value;
|
|
36
|
+
if (parentId === null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return parentId;
|
|
40
|
+
}
|
|
41
|
+
loadPage(id) {
|
|
42
|
+
this.pageId = id;
|
|
43
|
+
}
|
|
44
|
+
handlSubMenuBackClick() {
|
|
45
|
+
navigationRailActive.value = null;
|
|
46
|
+
}
|
|
47
|
+
handleNavigationSubClicked(i, parentId) {
|
|
48
|
+
navigationRailSelected.value = parentId;
|
|
49
|
+
if ((i.items || []).length > 0) {
|
|
50
|
+
this.toggleExpanded(i.id);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
navigationSubSelected.value = i.id;
|
|
54
|
+
this.loadPage(navigationSubSelected.value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
handleRailClick(id) {
|
|
58
|
+
var _a;
|
|
59
|
+
if (navigationRailSelected.value !== id) {
|
|
60
|
+
// Set new selected rail item
|
|
61
|
+
navigationRailSelected.value = id;
|
|
62
|
+
// Reset selected sub menu item
|
|
63
|
+
navigationSubSelected.value = null;
|
|
64
|
+
const items = ((_a = this.menu.find((i) => i.id === id)) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
65
|
+
if (items.length > 0) {
|
|
66
|
+
navigationRailActive.value = id;
|
|
67
|
+
}
|
|
68
|
+
// If persistent menu close the drawer when a item is clicked and does not has children items
|
|
69
|
+
if (navigationDrawerPersistent.value) {
|
|
70
|
+
this.drawer.open = items.length > 0 ? true : false;
|
|
71
|
+
}
|
|
72
|
+
this.loadPage(navigationRailSelected.value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
return html ``;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: String })
|
|
81
|
+
], ExmgNavigationBase.prototype, "pageId", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
query('#drawer')
|
|
84
|
+
], ExmgNavigationBase.prototype, "drawer", void 0);
|
|
85
|
+
//# sourceMappingURL=exm-navigation-base.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@material/mwc-drawer';
|
|
3
|
+
import { Drawer } from '@material/mwc-drawer';
|
|
4
|
+
declare const ExmgNavigationDrawerBase_base: typeof LitElement;
|
|
5
|
+
export declare class ExmgNavigationDrawerBase extends ExmgNavigationDrawerBase_base {
|
|
6
|
+
open: boolean;
|
|
7
|
+
drawer?: Drawer;
|
|
8
|
+
persistent: boolean;
|
|
9
|
+
hoverIn: () => void;
|
|
10
|
+
handleClose: () => void;
|
|
11
|
+
hoverOut: () => void;
|
|
12
|
+
private _itemHover;
|
|
13
|
+
private _drawerHover;
|
|
14
|
+
private _asideElement?;
|
|
15
|
+
private _observer;
|
|
16
|
+
hasActiveSubmenu(): boolean;
|
|
17
|
+
updateInlineStyles(): void;
|
|
18
|
+
constructor();
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
toggle(): void;
|
|
21
|
+
_handleClose(): void;
|
|
22
|
+
_hoverIn(): void;
|
|
23
|
+
_hoverOut(): void;
|
|
24
|
+
hidemenu(): void;
|
|
25
|
+
protected updated(): void;
|
|
26
|
+
protected firstUpdated(): Promise<void>;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { property, query } from 'lit/decorators.js';
|
|
4
|
+
import '@material/mwc-drawer';
|
|
5
|
+
import { ResizeController } from '@lit-labs/observers/resize-controller.js';
|
|
6
|
+
import { navigationDrawerHover, navigationItemHover, navigationDrawerOpen, navigationRailHidden, navigationDrawerPersistent, navigationActiveHasSubmenu, } from './exm-navigation-signals.js';
|
|
7
|
+
import { SignalWatcher } from '@lit-labs/preact-signals';
|
|
8
|
+
import { observer } from '@exmg/lit-base';
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
export class ExmgNavigationDrawerBase extends SignalWatcher(LitElement) {
|
|
11
|
+
hasActiveSubmenu() {
|
|
12
|
+
let activeHasSubMenu = false;
|
|
13
|
+
for (const key in navigationActiveHasSubmenu.value) {
|
|
14
|
+
// eslint-disable-next-line
|
|
15
|
+
if (navigationActiveHasSubmenu.value.hasOwnProperty(key) && navigationActiveHasSubmenu.value[key]) {
|
|
16
|
+
activeHasSubMenu = true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return activeHasSubMenu;
|
|
20
|
+
}
|
|
21
|
+
updateInlineStyles() {
|
|
22
|
+
const drawer = this.drawer;
|
|
23
|
+
if (drawer) {
|
|
24
|
+
const shadowRoot = drawer.shadowRoot;
|
|
25
|
+
const asideElement = shadowRoot.querySelector('aside');
|
|
26
|
+
if (asideElement) {
|
|
27
|
+
asideElement.style.left = navigationRailHidden.value ? '0px' : 'var(--_exm-navigation-rail-nav-width)';
|
|
28
|
+
}
|
|
29
|
+
const contentElement = shadowRoot.querySelector('div.mdc-drawer-app-content');
|
|
30
|
+
if (contentElement) {
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
contentElement.style.marginLeft = navigationRailHidden.value
|
|
33
|
+
? '0px'
|
|
34
|
+
: this.open
|
|
35
|
+
? 'var(--mdc-drawer-width, 256px)'
|
|
36
|
+
: '0px';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.open = false;
|
|
43
|
+
this.persistent = false;
|
|
44
|
+
this._itemHover = false;
|
|
45
|
+
this._drawerHover = false;
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
this._observer = new ResizeController(this, {
|
|
48
|
+
target: window.document.body,
|
|
49
|
+
callback: (entries) => {
|
|
50
|
+
const entry = entries.pop();
|
|
51
|
+
if (!entry || !entry.contentRect)
|
|
52
|
+
return;
|
|
53
|
+
const width = entry.contentRect.width;
|
|
54
|
+
const persistentWidth = width > 1560;
|
|
55
|
+
const activeHasSubMenu = this.hasActiveSubmenu();
|
|
56
|
+
// If root nav item set and has submenu and persistent width meets the criteria
|
|
57
|
+
const persistent = activeHasSubMenu && persistentWidth;
|
|
58
|
+
if (this.persistent !== persistent) {
|
|
59
|
+
if (!persistent) {
|
|
60
|
+
this.open = false;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.open = true;
|
|
64
|
+
}
|
|
65
|
+
this.persistent = persistent;
|
|
66
|
+
}
|
|
67
|
+
navigationRailHidden.value = width < 961;
|
|
68
|
+
this.updateInlineStyles();
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
// Bind methods to ensure the correct 'this' context
|
|
72
|
+
this.hoverIn = this._hoverIn.bind(this);
|
|
73
|
+
this.hoverOut = this._hoverOut.bind(this);
|
|
74
|
+
this.handleClose = this._handleClose.bind(this);
|
|
75
|
+
}
|
|
76
|
+
disconnectedCallback() {
|
|
77
|
+
// Clean up listeners
|
|
78
|
+
this._asideElement.removeEventListener('mouseenter', this.hoverIn);
|
|
79
|
+
this._asideElement.removeEventListener('mouseleave', this.hoverOut);
|
|
80
|
+
this.removeEventListener('drawer-close', this.handleClose);
|
|
81
|
+
}
|
|
82
|
+
toggle() {
|
|
83
|
+
this.open = !this.open;
|
|
84
|
+
}
|
|
85
|
+
_handleClose() {
|
|
86
|
+
this.open = false;
|
|
87
|
+
}
|
|
88
|
+
_hoverIn() {
|
|
89
|
+
navigationDrawerHover.value = true;
|
|
90
|
+
}
|
|
91
|
+
_hoverOut() {
|
|
92
|
+
navigationDrawerHover.value = false;
|
|
93
|
+
}
|
|
94
|
+
hidemenu() {
|
|
95
|
+
// Hide submenu when drawer is not persistent when mouse leaves the drawer or menu items
|
|
96
|
+
if (!this._itemHover && !this._drawerHover && !(this.persistent && this.hasActiveSubmenu())) {
|
|
97
|
+
this.open = false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
updated() {
|
|
101
|
+
if (this._itemHover !== navigationItemHover.value) {
|
|
102
|
+
this._itemHover = navigationItemHover.value;
|
|
103
|
+
if (this._itemHover) {
|
|
104
|
+
this.open = true;
|
|
105
|
+
}
|
|
106
|
+
if (!this._itemHover) {
|
|
107
|
+
// Timeout to allow for mouse transition to the content element
|
|
108
|
+
setTimeout(this.hidemenu.bind(this), 100);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.hidemenu();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (this._drawerHover !== navigationDrawerHover.value) {
|
|
115
|
+
this._drawerHover = navigationDrawerHover.value;
|
|
116
|
+
this.hidemenu();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async firstUpdated() {
|
|
120
|
+
await this.updateComplete;
|
|
121
|
+
const drawer = this.drawer;
|
|
122
|
+
if (drawer) {
|
|
123
|
+
const shadowRoot = drawer.shadowRoot;
|
|
124
|
+
if (shadowRoot) {
|
|
125
|
+
const asideElement = shadowRoot.querySelector('aside');
|
|
126
|
+
if (asideElement) {
|
|
127
|
+
// Hack custom styles in the aside element
|
|
128
|
+
asideElement.style.borderRightWidth = '0px';
|
|
129
|
+
asideElement.style.borderRadius = '0px 16px 16px 0px';
|
|
130
|
+
asideElement.style.top = '0px';
|
|
131
|
+
asideElement.style.bottom = '0px';
|
|
132
|
+
asideElement.style.height = 'unset';
|
|
133
|
+
asideElement.style.transitionProperty = 'transform, box-shadow';
|
|
134
|
+
asideElement.style.transitionDuration = '300ms';
|
|
135
|
+
asideElement.style.transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
|
|
136
|
+
asideElement.style.background = `var(--md-sys-color-surface-container)`;
|
|
137
|
+
asideElement.style.borderLeft = '1px solid var(--md-sys-color-outline-variant)';
|
|
138
|
+
asideElement.style.left = 'var(--_exm-navigation-rail-nav-width)';
|
|
139
|
+
// Add event listeners to the aside element
|
|
140
|
+
asideElement.addEventListener('mouseenter', this.hoverIn);
|
|
141
|
+
asideElement.addEventListener('mouseleave', this.hoverOut);
|
|
142
|
+
this._asideElement = asideElement;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
this.addEventListener('drawer-close', this.handleClose);
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
return html `<mwc-drawer type="dismissible" ?open=${this.open}>
|
|
150
|
+
<div class="content">
|
|
151
|
+
<slot></slot>
|
|
152
|
+
</div>
|
|
153
|
+
<slot name="appContent" slot="appContent"></slot>
|
|
154
|
+
</mwc-drawer>`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: Boolean }),
|
|
159
|
+
observer(function (value) {
|
|
160
|
+
navigationDrawerOpen.value = value;
|
|
161
|
+
this.updateInlineStyles();
|
|
162
|
+
})
|
|
163
|
+
], ExmgNavigationDrawerBase.prototype, "open", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
query('mwc-drawer')
|
|
166
|
+
], ExmgNavigationDrawerBase.prototype, "drawer", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ type: Boolean }),
|
|
169
|
+
observer(function (value) {
|
|
170
|
+
navigationDrawerPersistent.value = value;
|
|
171
|
+
})
|
|
172
|
+
], ExmgNavigationDrawerBase.prototype, "persistent", void 0);
|
|
173
|
+
//# sourceMappingURL=exm-navigation-drawer-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import '@material/web/list/list.js';
|
|
2
|
+
import '@material/web/list/list-item.js';
|
|
3
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
4
|
+
declare const ExmgNavigationDrawerNav_base: typeof ExmgElement;
|
|
5
|
+
export declare class ExmgNavigationDrawerNav extends ExmgNavigationDrawerNav_base {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { navigationRailHidden, navigationRailActive } from './exm-navigation-signals.js';
|
|
5
|
+
import { SignalWatcher } from '@lit-labs/preact-signals';
|
|
6
|
+
import '@material/web/list/list.js';
|
|
7
|
+
import '@material/web/list/list-item.js';
|
|
8
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
9
|
+
let ExmgNavigationDrawerNav = class ExmgNavigationDrawerNav extends SignalWatcher(ExmgElement) {
|
|
10
|
+
render() {
|
|
11
|
+
return navigationRailHidden.value
|
|
12
|
+
? html `<div class="nav">
|
|
13
|
+
<div class="header">
|
|
14
|
+
<md-icon-button @click=${() => this.fire('drawer-close', null, true)}
|
|
15
|
+
><md-icon>menu_open</md-icon></md-icon-button
|
|
16
|
+
>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="navigation">
|
|
19
|
+
${navigationRailActive.value === null
|
|
20
|
+
? html `<div class="nav top-level"><slot name="topLevel"></slot></div>`
|
|
21
|
+
: html `<div class="nav"><slot name="navTop"></slot><slot></slot></div>`}
|
|
22
|
+
</div>
|
|
23
|
+
</div>`
|
|
24
|
+
: html `<slot></slot>`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
ExmgNavigationDrawerNav.styles = [
|
|
28
|
+
css `
|
|
29
|
+
:host {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.nav {
|
|
34
|
+
margin: 8px 0 auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.header md-icon-button {
|
|
38
|
+
margin: 4px 12px 8px 16px;
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
];
|
|
42
|
+
ExmgNavigationDrawerNav = __decorate([
|
|
43
|
+
customElement('exm-navigation-drawer-nav')
|
|
44
|
+
// eslint-disable-next-line
|
|
45
|
+
], ExmgNavigationDrawerNav);
|
|
46
|
+
export { ExmgNavigationDrawerNav };
|
|
47
|
+
//# sourceMappingURL=exm-navigation-drawer-nav.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgNavigationDrawerBase } from './exm-navigation-drawer-base.js';
|
|
2
|
+
export declare class ExmgNavigationDrawer extends ExmgNavigationDrawerBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-navigation-drawer': ExmgNavigationDrawer;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ExmgNavigationDrawerBase } from './exm-navigation-drawer-base.js';
|
|
4
|
+
import { style } from './styles/exm-navigation-drawer-css.js';
|
|
5
|
+
let ExmgNavigationDrawer = class ExmgNavigationDrawer extends ExmgNavigationDrawerBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgNavigationDrawer.styles = [style];
|
|
8
|
+
ExmgNavigationDrawer = __decorate([
|
|
9
|
+
customElement('exm-navigation-drawer')
|
|
10
|
+
], ExmgNavigationDrawer);
|
|
11
|
+
export { ExmgNavigationDrawer };
|
|
12
|
+
//# sourceMappingURL=exm-navigation-drawer.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
3
|
+
export class ExmgNavigationRailBase extends ExmgElement {
|
|
4
|
+
render() {
|
|
5
|
+
return html `<div class="top"><slot name="top"></slot></div>
|
|
6
|
+
<div class="nav"><slot></slot></div>
|
|
7
|
+
<div class="bottom"><slot name="bottom"></slot></div>`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=exm-navigation-rail-base.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@material/web/focus/md-focus-ring.js';
|
|
3
|
+
export declare class ExmgNavigationRailNavItemBase extends LitElement {
|
|
4
|
+
icon: string;
|
|
5
|
+
itemId?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
hasSubMenu: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
deselectOtherOptions(id: string): void;
|
|
11
|
+
hoverIn(): void;
|
|
12
|
+
hoverOut(): void;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { navigationItemHover, navigationRailActive, navigationActiveHasSubmenu } from './exm-navigation-signals.js';
|
|
5
|
+
import '@material/web/focus/md-focus-ring.js';
|
|
6
|
+
import { observer } from '@exmg/lit-base';
|
|
7
|
+
export class ExmgNavigationRailNavItemBase extends LitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.icon = '';
|
|
11
|
+
this.selected = false;
|
|
12
|
+
this.hasSubMenu = false;
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
this.setAttribute('role', 'link');
|
|
15
|
+
// Bind methods to ensure the correct 'this' context
|
|
16
|
+
this.hoverIn = this.hoverIn.bind(this);
|
|
17
|
+
this.hoverOut = this.hoverOut.bind(this);
|
|
18
|
+
// Add event listeners in the constructor
|
|
19
|
+
this.addEventListener('mouseenter', this.hoverIn);
|
|
20
|
+
this.addEventListener('mouseleave', this.hoverOut);
|
|
21
|
+
}
|
|
22
|
+
deselectOtherOptions(id) {
|
|
23
|
+
for (const key in navigationActiveHasSubmenu.value) {
|
|
24
|
+
// eslint-disable-next-line
|
|
25
|
+
if (navigationActiveHasSubmenu.value.hasOwnProperty(key) && key !== id) {
|
|
26
|
+
navigationActiveHasSubmenu.value[key] = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
hoverIn() {
|
|
31
|
+
if (this.hasSubMenu) {
|
|
32
|
+
navigationItemHover.value = true;
|
|
33
|
+
navigationRailActive.value = this.itemId;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
hoverOut() {
|
|
37
|
+
navigationItemHover.value = false;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return html ` <button>
|
|
41
|
+
<md-focus-ring></md-focus-ring><span class="symbols">${this.icon}</span>
|
|
42
|
+
<div class="label">${this.label}</div>
|
|
43
|
+
</button>`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ type: String })
|
|
48
|
+
], ExmgNavigationRailNavItemBase.prototype, "icon", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
property({ type: String })
|
|
51
|
+
], ExmgNavigationRailNavItemBase.prototype, "itemId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
property({ type: String })
|
|
54
|
+
], ExmgNavigationRailNavItemBase.prototype, "label", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
property({ type: Boolean, reflect: true }),
|
|
57
|
+
observer(function (value) {
|
|
58
|
+
if (this.itemId) {
|
|
59
|
+
navigationActiveHasSubmenu.value[this.itemId] = value && this.hasSubMenu;
|
|
60
|
+
if (navigationActiveHasSubmenu.value[this.itemId] && value) {
|
|
61
|
+
this.deselectOtherOptions(this.itemId);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
], ExmgNavigationRailNavItemBase.prototype, "selected", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ type: Boolean })
|
|
68
|
+
], ExmgNavigationRailNavItemBase.prototype, "hasSubMenu", void 0);
|
|
69
|
+
//# sourceMappingURL=exm-navigation-rail-nav-item-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
2
|
+
export declare class ExmgNavigationRailNavItem extends ExmgNavigationRailNavItemBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-navigation-rail-nav-item': ExmgNavigationRailNavItem;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { style } from './styles/exm-navigation-rail-nav-item-css.js';
|
|
4
|
+
import { ExmgNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
5
|
+
let ExmgNavigationRailNavItem = class ExmgNavigationRailNavItem extends ExmgNavigationRailNavItemBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgNavigationRailNavItem.styles = [style];
|
|
8
|
+
ExmgNavigationRailNavItem = __decorate([
|
|
9
|
+
customElement('exm-navigation-rail-nav-item')
|
|
10
|
+
], ExmgNavigationRailNavItem);
|
|
11
|
+
export { ExmgNavigationRailNavItem };
|
|
12
|
+
//# sourceMappingURL=exm-navigation-rail-nav-item.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgNavigationRailNavBase } from './exm-navigation-rail-nav-base.js';
|
|
2
|
+
export declare class ExmgNavigationRailNav extends ExmgNavigationRailNavBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-navigation-rail-nav': ExmgNavigationRailNav;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { style } from './styles/exm-navigation-rail-nav-css.js';
|
|
4
|
+
import { ExmgNavigationRailNavBase } from './exm-navigation-rail-nav-base.js';
|
|
5
|
+
let ExmgNavigationRailNav = class ExmgNavigationRailNav extends ExmgNavigationRailNavBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgNavigationRailNav.styles = [style];
|
|
8
|
+
ExmgNavigationRailNav = __decorate([
|
|
9
|
+
customElement('exm-navigation-rail-nav')
|
|
10
|
+
], ExmgNavigationRailNav);
|
|
11
|
+
export { ExmgNavigationRailNav };
|
|
12
|
+
//# sourceMappingURL=exm-navigation-rail-nav.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgNavigationRailBase } from './exm-navigation-rail-base.js';
|
|
2
|
+
export declare class ExmgNavigationRail extends ExmgNavigationRailBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-navigation-rail': ExmgNavigationRail;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators/custom-element.js';
|
|
3
|
+
import { ExmgNavigationRailBase } from './exm-navigation-rail-base.js';
|
|
4
|
+
import { style } from './styles/exm-navigation-rail-css.js';
|
|
5
|
+
let ExmgNavigationRail = class ExmgNavigationRail extends ExmgNavigationRailBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgNavigationRail.styles = [style];
|
|
8
|
+
ExmgNavigationRail = __decorate([
|
|
9
|
+
customElement('exm-navigation-rail')
|
|
10
|
+
], ExmgNavigationRail);
|
|
11
|
+
export { ExmgNavigationRail };
|
|
12
|
+
//# sourceMappingURL=exm-navigation-rail.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const navigationItemHover: import("@preact/signals-core").Signal<boolean>;
|
|
2
|
+
export declare const navigationDrawerHover: import("@preact/signals-core").Signal<boolean>;
|
|
3
|
+
export declare const navigationDrawerOpen: import("@preact/signals-core").Signal<boolean>;
|
|
4
|
+
export declare const navigationActiveHasSubmenu: import("@preact/signals-core").Signal<{
|
|
5
|
+
[k: string]: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const navigationRailSelected: import("@preact/signals-core").Signal<string | null>;
|
|
8
|
+
export declare const navigationSubSelected: import("@preact/signals-core").Signal<string | null>;
|
|
9
|
+
export declare const navigationRailActive: import("@preact/signals-core").Signal<string | null>;
|
|
10
|
+
export declare const navigationRailHidden: import("@preact/signals-core").Signal<boolean>;
|
|
11
|
+
export declare const navigationDrawerPersistent: import("@preact/signals-core").Signal<boolean>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { signal } from '@lit-labs/preact-signals';
|
|
2
|
+
export const navigationItemHover = signal(false);
|
|
3
|
+
export const navigationDrawerHover = signal(false);
|
|
4
|
+
export const navigationDrawerOpen = signal(false);
|
|
5
|
+
export const navigationActiveHasSubmenu = signal({});
|
|
6
|
+
export const navigationRailSelected = signal(null);
|
|
7
|
+
export const navigationSubSelected = signal(null);
|
|
8
|
+
export const navigationRailActive = signal(null);
|
|
9
|
+
export const navigationRailHidden = signal(false);
|
|
10
|
+
export const navigationDrawerPersistent = signal(false);
|
|
11
|
+
//# sourceMappingURL=exm-navigation-signals.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
2
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
3
|
+
import '@material/web/icon/icon.js';
|
|
4
|
+
import '@material/mwc-top-app-bar-fixed';
|
|
5
|
+
export declare class ExmgNavigationToolbarBase extends ExmgElement {
|
|
6
|
+
protected firstUpdated(): void;
|
|
7
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
4
|
+
import '@material/web/icon/icon.js';
|
|
5
|
+
import '@material/mwc-top-app-bar-fixed';
|
|
6
|
+
export class ExmgNavigationToolbarBase extends ExmgElement {
|
|
7
|
+
firstUpdated() {
|
|
8
|
+
const appToolbar = this.shadowRoot.querySelector('mwc-top-app-bar-fixed');
|
|
9
|
+
if (appToolbar) {
|
|
10
|
+
const observer = new MutationObserver((_, obs) => {
|
|
11
|
+
const shadowRoot = appToolbar.shadowRoot;
|
|
12
|
+
const header = shadowRoot ? shadowRoot.querySelector('header') : null;
|
|
13
|
+
if (header) {
|
|
14
|
+
header.style.left = '0px';
|
|
15
|
+
header.style.right = '0px';
|
|
16
|
+
obs.disconnect(); // Stop observing once we have made the changes
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
observer.observe(appToolbar.shadowRoot, {
|
|
20
|
+
childList: true,
|
|
21
|
+
subtree: true,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return html `<mwc-top-app-bar-fixed>
|
|
27
|
+
<slot name="navigationIcon" slot="navigationIcon"></slot>
|
|
28
|
+
<slot name="title" slot="title"></slot>
|
|
29
|
+
<slot name="actionItems" slot="actionItems"></slot>
|
|
30
|
+
</mwc-top-app-bar-fixed>`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=exm-navigation-toolbar-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgNavigationToolbarBase } from './exm-navigation-toolbar-base.js';
|
|
2
|
+
export declare class ExmgNavigationToolbar extends ExmgNavigationToolbarBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-navigation-toolbar': ExmgNavigationToolbar;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { style } from './styles/exm-navigation-toolbar-css.js';
|
|
4
|
+
import { ExmgNavigationToolbarBase } from './exm-navigation-toolbar-base.js';
|
|
5
|
+
let ExmgNavigationToolbar = class ExmgNavigationToolbar extends ExmgNavigationToolbarBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgNavigationToolbar.styles = [style];
|
|
8
|
+
ExmgNavigationToolbar = __decorate([
|
|
9
|
+
customElement('exm-navigation-toolbar')
|
|
10
|
+
], ExmgNavigationToolbar);
|
|
11
|
+
export { ExmgNavigationToolbar };
|
|
12
|
+
//# sourceMappingURL=exm-navigation-toolbar.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{display:block;height:100vh;width:100%;box-sizing:border-box}mwc-drawer{--mdc-drawer-width: 240px}@media screen and (min-width: 961px){:host{padding-left:0}mwc-drawer{margin-left:88px}}@media screen and (max-width: 961px){:host{padding-left:0}mwc-drawer{margin-left:0;--mdc-drawer-width: 319px}}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-drawer-css.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
mwc-drawer {
|
|
9
|
+
--mdc-drawer-width: 240px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media screen and (min-width: 961px) {
|
|
13
|
+
:host {
|
|
14
|
+
padding-left: 0;
|
|
15
|
+
}
|
|
16
|
+
mwc-drawer {
|
|
17
|
+
margin-left: 88px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media screen and (max-width: 961px) {
|
|
22
|
+
:host {
|
|
23
|
+
padding-left: 0;
|
|
24
|
+
}
|
|
25
|
+
mwc-drawer {
|
|
26
|
+
margin-left: 0;
|
|
27
|
+
--mdc-drawer-width: 319px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{--_exm-navigation-rail-background-color: var( --exm-navigation-rail-background-color, var(--md-sys-color-surface-container) );display:none;position:fixed;top:0;left:0;flex-direction:column;justify-content:space-between;height:100%;background:var(--_exm-navigation-rail-background-color);overflow-y:auto;z-index:8;box-sizing:border-box}@media screen and (min-width: 961px){:host{display:flex}}.nav{flex:1}.bottom{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-end}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-rail-css.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{display:flex;flex-direction:column;--_exm-navigation-rail-nav-width: var(--exm-navigation-rail-nav-width, 88px);width:var(--_exm-navigation-rail-nav-width);margin-top:20px}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-rail-nav-css.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{--_exm-navigation-rail-nav-item-color: var( --exm-navigation-rail-nav-item-color, var(--md-sys-color-on-surface-variant) );--_exm-navigation-rail-nav-item-icon-color: var( --exm-navigation-rail-nav-item-icon-color, var(--md-sys-color-on-surface-variant) );--_exm-navigation-rail-nav-item-icon-color-hover: var( --exm-navigation-rail-nav-item-icon-color-hover, var(--md-sys-color-surface-container-highest) );--_exm-navigation-rail-nav-item-icon-color-selected: var( --exm-navigation-rail-nav-item-icon-color-selected, var(--md-sys-color-secondary) );--_exm-navigation-rail-nav-item-color-selected: var( --exm-navigation-rail-nav-item-color-selected, var(--md-sys-color-on-secondary) );display:flex;flex-direction:column;width:80px;margin:-2px auto 14px;padding:2px;vertical-align:baseline;align-items:center;cursor:pointer}button{position:relative;background:none;border:none;color:var(--_exm-navigation-rail-nav-item-color)}button:focus{outline:none}.symbols{display:flex;text-align:center;position:relative;align-items:center;justify-content:center;width:56px;height:32px;margin-right:auto;margin-bottom:4px;margin-left:auto;font-variation-settings:"wght" 400,"opsz" 24;transition:font-variation-settings .2s cubic-bezier(0.2, 0, 0, 1);border-radius:16px}.symbols{font-family:"Material Symbols Outlined";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased}.symbols:before{position:absolute;width:100%;height:100%;opacity:0;transform:scaleX(0.32);transition-duration:.2s;transition-property:transform,opacity;transition-timing-function:linear;border-radius:100px;background:var(--md-sys-color-secondary-container);content:"";z-index:-1}.symbols{color:var(--_exm-navigation-rail-nav-item-icon-color);font-variation-settings:"FILL" 1,"wght" 400,"opsz" 24}:host(:hover) .symbols{background:var(--_exm-navigation-rail-nav-item-icon-color-hover);font-variation-settings:"wght" 600,"opsz" 24}:host([selected]) .symbols{background:var(--_exm-navigation-rail-nav-item-icon-color-selected);color:var(--_exm-navigation-rail-nav-item-color-selected);font-variation-settings:"wght" 600,"opsz" 24}:host([selected]:hover) .symbols{opacity:.7}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-rail-nav-item-css.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--_exm-navigation-rail-nav-item-color: var(
|
|
3
|
+
--exm-navigation-rail-nav-item-color,
|
|
4
|
+
var(--md-sys-color-on-surface-variant)
|
|
5
|
+
);
|
|
6
|
+
--_exm-navigation-rail-nav-item-icon-color: var(
|
|
7
|
+
--exm-navigation-rail-nav-item-icon-color,
|
|
8
|
+
var(--md-sys-color-on-surface-variant)
|
|
9
|
+
);
|
|
10
|
+
--_exm-navigation-rail-nav-item-icon-color-hover: var(
|
|
11
|
+
--exm-navigation-rail-nav-item-icon-color-hover,
|
|
12
|
+
var(--md-sys-color-surface-container-highest)
|
|
13
|
+
);
|
|
14
|
+
--_exm-navigation-rail-nav-item-icon-color-selected: var(
|
|
15
|
+
--exm-navigation-rail-nav-item-icon-color-selected,
|
|
16
|
+
var(--md-sys-color-secondary)
|
|
17
|
+
);
|
|
18
|
+
--_exm-navigation-rail-nav-item-color-selected: var(
|
|
19
|
+
--exm-navigation-rail-nav-item-color-selected,
|
|
20
|
+
var(--md-sys-color-on-secondary)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
width: 80px;
|
|
26
|
+
margin: -2px auto 14px;
|
|
27
|
+
padding: 2px;
|
|
28
|
+
vertical-align: baseline;
|
|
29
|
+
align-items: center;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button {
|
|
34
|
+
position: relative;
|
|
35
|
+
background: none;
|
|
36
|
+
border: none;
|
|
37
|
+
color: var(--_exm-navigation-rail-nav-item-color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
button:focus {
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.symbols {
|
|
45
|
+
display: flex;
|
|
46
|
+
text-align: center;
|
|
47
|
+
position: relative;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
width: 56px;
|
|
51
|
+
height: 32px;
|
|
52
|
+
margin-right: auto;
|
|
53
|
+
margin-bottom: 4px;
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
font-variation-settings: 'wght' 400, 'opsz' 24;
|
|
56
|
+
transition: font-variation-settings 0.2s cubic-bezier(0.2, 0, 0, 1);
|
|
57
|
+
border-radius: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.symbols {
|
|
61
|
+
font-family: 'Material Symbols Outlined';
|
|
62
|
+
font-weight: normal;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-size: 24px;
|
|
65
|
+
line-height: 1;
|
|
66
|
+
letter-spacing: normal;
|
|
67
|
+
text-transform: none;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
word-wrap: normal;
|
|
70
|
+
direction: ltr;
|
|
71
|
+
-webkit-font-smoothing: antialiased;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.symbols:before {
|
|
75
|
+
position: absolute;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transform: scaleX(0.32);
|
|
80
|
+
transition-duration: 0.2s;
|
|
81
|
+
transition-property: transform, opacity;
|
|
82
|
+
transition-timing-function: linear;
|
|
83
|
+
border-radius: 100px;
|
|
84
|
+
background: var(--md-sys-color-secondary-container);
|
|
85
|
+
content: '';
|
|
86
|
+
z-index: -1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.symbols {
|
|
90
|
+
color: var(--_exm-navigation-rail-nav-item-icon-color);
|
|
91
|
+
font-variation-settings: 'FILL' 1, 'wght' 400, 'opsz' 24;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host(:hover) .symbols {
|
|
95
|
+
background: var(--_exm-navigation-rail-nav-item-icon-color-hover);
|
|
96
|
+
font-variation-settings: 'wght' 600, 'opsz' 24;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([selected]) .symbols {
|
|
100
|
+
background: var(--_exm-navigation-rail-nav-item-icon-color-selected);
|
|
101
|
+
color: var(--_exm-navigation-rail-nav-item-color-selected);
|
|
102
|
+
font-variation-settings: 'wght' 600, 'opsz' 24;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([selected]:hover) .symbols {
|
|
106
|
+
opacity: 0.7;
|
|
107
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--_exm-navigation-rail-background-color: var(
|
|
3
|
+
--exm-navigation-rail-background-color,
|
|
4
|
+
var(--md-sys-color-surface-container)
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
display: none;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
height: 100%;
|
|
14
|
+
background: var(--_exm-navigation-rail-background-color);
|
|
15
|
+
overflow-y: auto;
|
|
16
|
+
z-index: 8;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media screen and (min-width: 961px) {
|
|
21
|
+
:host {
|
|
22
|
+
display: flex;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.nav {
|
|
27
|
+
flex: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bottom {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
justify-content: flex-end;
|
|
35
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{--_exm-navigation-item-background-color-selected: var( --exm-navigation-item-background-color-selected, var(--md-sys-color-secondary) );--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary))}exm-navigation-drawer{--md-list-container-color: none;--md-list-item-label-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-supporting-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-trailing-supporting-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-container-shape: 24px}exm-navigation-drawer md-list-item{margin-right:8px;margin-left:8px;border-radius:24px;--md-list-item-container-shape: 24px}exm-navigation-drawer md-list-item[selected]{--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);background-color:var(--_exm-navigation-item-background-color-selected);--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected) --md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected)}exm-navigation-drawer md-list-item.collapsed-item[selected]{--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);background-color:var(--_exm-navigation-item-background-color-selected)}exm-navigation-drawer md-list-item[selected] md-icon{color:var(--md-sys-color-primary)}.sub-menu{margin-left:.8rem}.left-margin{margin-left:2.5rem}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-styles-css.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--_exm-navigation-item-background-color-selected: var(
|
|
3
|
+
--exm-navigation-item-background-color-selected,
|
|
4
|
+
var(--md-sys-color-secondary)
|
|
5
|
+
);
|
|
6
|
+
--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exm-navigation-drawer {
|
|
10
|
+
--md-list-container-color: none;
|
|
11
|
+
--md-list-item-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
12
|
+
--md-list-item-supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
13
|
+
--md-list-item-trailing-supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
14
|
+
--md-list-item-container-shape: 24px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exm-navigation-drawer md-list-item {
|
|
18
|
+
margin-right: 8px;
|
|
19
|
+
margin-left: 8px;
|
|
20
|
+
border-radius: 24px;
|
|
21
|
+
--md-list-item-container-shape: 24px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exm-navigation-drawer md-list-item[selected] {
|
|
25
|
+
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
26
|
+
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
27
|
+
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected)
|
|
28
|
+
--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exm-navigation-drawer md-list-item.collapsed-item[selected] {
|
|
32
|
+
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
33
|
+
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exm-navigation-drawer md-list-item[selected] md-icon {
|
|
37
|
+
color: var(--md-sys-color-primary);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.sub-menu {
|
|
41
|
+
margin-left: 0.8rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.left-margin {
|
|
45
|
+
margin-left: 2.5rem;
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{display:block}mwc-top-app-bar-fixed{--mdc-theme-primary: var(--exm-navigation-toolbar-primary, var(--md-sys-color-background));--mdc-theme-on-primary: var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background))}md-icon{fill:var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background))}@media screen and (min-width: 961px){slot[name=navigationIcon]{display:none}}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-toolbar-css.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
mwc-top-app-bar-fixed {
|
|
6
|
+
--mdc-theme-primary: var(--exm-navigation-toolbar-primary, var(--md-sys-color-background));
|
|
7
|
+
--mdc-theme-on-primary: var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
md-icon {
|
|
11
|
+
fill: var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media screen and (min-width: 961px) {
|
|
15
|
+
slot[name='navigationIcon'] {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|