@exmg/exm-navigation 1.1.1 → 1.1.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/{src → dist}/exm-navigation-base.d.ts +36 -10
- package/{src → dist}/exm-navigation-base.js +155 -84
- package/{src → dist}/exm-navigation-drawer-base.d.ts +1 -4
- package/{src → dist}/exm-navigation-drawer-base.js +10 -7
- package/{src → dist}/exm-navigation-drawer-nav-item-base.js +12 -8
- package/{src → dist}/exm-navigation-icon-button-base.js +2 -0
- package/{src → dist}/exm-navigation-sub-menu-base.d.ts +11 -0
- package/dist/exm-navigation-sub-menu-base.js +153 -0
- package/{src → dist}/exm-navigation-topbar-base.js +3 -4
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13 -0
- package/{src → dist}/mixins/media-queries.d.ts +1 -0
- package/{src → dist}/mixins/media-queries.js +16 -3
- package/{src → dist}/styles/exm-navigation-css.js +16 -0
- package/dist/styles/exm-navigation-drawer-css.js +35 -0
- package/dist/styles/exm-navigation-drawer-nav-item-css.js +84 -0
- package/dist/styles/exm-navigation-icon-button-css.js +29 -0
- package/{src → dist}/styles/exm-navigation-rail-css.js +1 -0
- package/dist/styles/exm-navigation-sub-menu-css.js +21 -0
- package/{src → dist}/styles/exm-navigation-topbar-css.js +4 -3
- package/package.json +19 -21
- package/index.d.ts +0 -12
- package/index.js +0 -13
- package/src/exm-navigation-drawer-nav.d.ts +0 -9
- package/src/exm-navigation-drawer-nav.js +0 -47
- package/src/exm-navigation-rail-nav-base.d.ts +0 -4
- package/src/exm-navigation-rail-nav-base.js +0 -9
- package/src/exm-navigation-rail-nav.d.ts +0 -9
- package/src/exm-navigation-rail-nav.js +0 -12
- package/src/exm-navigation-signals.d.ts +0 -11
- package/src/exm-navigation-signals.js +0 -11
- package/src/exm-navigation-sub-menu-base.js +0 -88
- package/src/exm-navigation-toolbar-base.d.ts +0 -8
- package/src/exm-navigation-toolbar-base.js +0 -33
- package/src/exm-navigation-toolbar.d.ts +0 -9
- package/src/exm-navigation-toolbar.js +0 -12
- package/src/styles/exm-navigate-drawer-nav-item-css.d.ts +0 -1
- package/src/styles/exm-navigate-drawer-nav-item-css.js +0 -40
- package/src/styles/exm-navigation-drawer-css.js +0 -24
- package/src/styles/exm-navigation-drawer-nav-item-css.js +0 -40
- package/src/styles/exm-navigation-icon-button-css.js +0 -23
- package/src/styles/exm-navigation-rail-nav-css.d.ts +0 -2
- package/src/styles/exm-navigation-rail-nav-css.js +0 -4
- package/src/styles/exm-navigation-styles-css.d.ts +0 -2
- package/src/styles/exm-navigation-styles-css.js +0 -4
- package/src/styles/exm-navigation-sub-menu-css.js +0 -38
- package/src/styles/exm-navigation-toolbar-css.d.ts +0 -2
- package/src/styles/exm-navigation-toolbar-css.js +0 -4
- /package/{src → dist}/exm-navigation-drawer-menu-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-drawer-menu-base.js +0 -0
- /package/{src → dist}/exm-navigation-drawer-menu.d.ts +0 -0
- /package/{src → dist}/exm-navigation-drawer-menu.js +0 -0
- /package/{src → dist}/exm-navigation-drawer-nav-item-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-drawer-nav-item.d.ts +0 -0
- /package/{src → dist}/exm-navigation-drawer-nav-item.js +0 -0
- /package/{src → dist}/exm-navigation-drawer.d.ts +0 -0
- /package/{src → dist}/exm-navigation-drawer.js +0 -0
- /package/{src → dist}/exm-navigation-icon-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-icon-base.js +0 -0
- /package/{src → dist}/exm-navigation-icon-button-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-icon-button.d.ts +0 -0
- /package/{src → dist}/exm-navigation-icon-button.js +0 -0
- /package/{src → dist}/exm-navigation-icon.d.ts +0 -0
- /package/{src → dist}/exm-navigation-icon.js +0 -0
- /package/{src → dist}/exm-navigation-rail-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-rail-base.js +0 -0
- /package/{src → dist}/exm-navigation-rail-nav-item-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-rail-nav-item-base.js +0 -0
- /package/{src → dist}/exm-navigation-rail-nav-item.d.ts +0 -0
- /package/{src → dist}/exm-navigation-rail-nav-item.js +0 -0
- /package/{src → dist}/exm-navigation-rail.d.ts +0 -0
- /package/{src → dist}/exm-navigation-rail.js +0 -0
- /package/{src → dist}/exm-navigation-sub-menu.d.ts +0 -0
- /package/{src → dist}/exm-navigation-sub-menu.js +0 -0
- /package/{src → dist}/exm-navigation-topbar-base.d.ts +0 -0
- /package/{src → dist}/exm-navigation-topbar.d.ts +0 -0
- /package/{src → dist}/exm-navigation-topbar.js +0 -0
- /package/{src → dist}/exm-navigation.d.ts +0 -0
- /package/{src → dist}/exm-navigation.js +0 -0
- /package/{src → dist}/styles/exm-navigation-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-drawer-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-drawer-nav-item-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-icon-button-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-icon-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-icon-css.js +0 -0
- /package/{src → dist}/styles/exm-navigation-rail-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-rail-nav-item-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-rail-nav-item-css.js +0 -0
- /package/{src → dist}/styles/exm-navigation-sub-menu-css.d.ts +0 -0
- /package/{src → dist}/styles/exm-navigation-topbar-css.d.ts +0 -0
- /package/{src → dist}/types.d.ts +0 -0
- /package/{src → dist}/types.js +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
4
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
5
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
6
|
+
import { style } from './styles/exm-navigation-sub-menu-css.js';
|
|
7
|
+
import { animate, fadeOut, fadeIn } from '@lit-labs/motion';
|
|
8
|
+
import './exm-navigation-rail-nav-item.js';
|
|
9
|
+
import './exm-navigation-drawer-nav-item.js';
|
|
10
|
+
import '@material/web/list/list.js';
|
|
11
|
+
import '@exmg/exm-collapsed/exm-collapsed.js';
|
|
12
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
13
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
14
|
+
export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.items = [];
|
|
18
|
+
this.path = [];
|
|
19
|
+
this.hasBackButton = false;
|
|
20
|
+
}
|
|
21
|
+
updated(changedProperties) {
|
|
22
|
+
var _a;
|
|
23
|
+
if (changedProperties.has('path') || changedProperties.has('items')) {
|
|
24
|
+
this.currentItem = ((_a = this.items.find((item) => item.id === this.path[0])) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
if (this.navigationElement) {
|
|
32
|
+
this.navigationElement.classList.remove('show');
|
|
33
|
+
}
|
|
34
|
+
super.disconnectedCallback();
|
|
35
|
+
}
|
|
36
|
+
handleSubMenuItemClick(path) {
|
|
37
|
+
this.fire('sub-menu-item-click', path);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* If a collapsable menuitem is not selected we can just pass the path.
|
|
41
|
+
* If it is selected, we remove the item from the path to collapse the menu again
|
|
42
|
+
*/
|
|
43
|
+
handleCollapsableSubMenuItemClick(path, id, selected) {
|
|
44
|
+
if (!selected) {
|
|
45
|
+
this.handleSubMenuItemClick(path);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const index = path.findIndex((item) => item === id);
|
|
49
|
+
this.fire('sub-menu-item-click', path.splice(0, index));
|
|
50
|
+
}
|
|
51
|
+
getItemStyle() {
|
|
52
|
+
return {
|
|
53
|
+
'grid-area': `${ExmNavigationSubMenuBase.itemIndex}/1/${ExmNavigationSubMenuBase.itemIndex + 1}/2`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
renderSubMenu(item, path) {
|
|
57
|
+
const selected = this.path.includes(item.id);
|
|
58
|
+
return html `
|
|
59
|
+
<exm-navigation-drawer-nav-item
|
|
60
|
+
${animate({
|
|
61
|
+
keyframeOptions: {
|
|
62
|
+
duration: 300,
|
|
63
|
+
},
|
|
64
|
+
out: fadeOut,
|
|
65
|
+
in: fadeIn,
|
|
66
|
+
properties: ['opacity'],
|
|
67
|
+
})}
|
|
68
|
+
style=${styleMap(this.getItemStyle())}
|
|
69
|
+
type="button"
|
|
70
|
+
?selected=${selected}
|
|
71
|
+
class="has-submenu ${this.path.includes(item.id) ? 'selected' : ''}"
|
|
72
|
+
@click=${this.handleCollapsableSubMenuItemClick.bind(this, [...path], item.id, selected)}
|
|
73
|
+
?has-submenu=${true}
|
|
74
|
+
submenu-icon=${this.path.includes(item.id) ? 'expand_less' : 'expand_more'}
|
|
75
|
+
>${item.label}
|
|
76
|
+
</exm-navigation-drawer-nav-item>
|
|
77
|
+
<exm-collapsed id="collapsed" ?opened=${this.path.includes(item.id)}>
|
|
78
|
+
<div class="sub-menu">
|
|
79
|
+
<md-list>
|
|
80
|
+
<!-- Need to check for multiple items -->
|
|
81
|
+
${(item.items || []).map((subItem) => {
|
|
82
|
+
ExmNavigationSubMenuBase.itemIndex += 1;
|
|
83
|
+
return (subItem.items || []).length === 0
|
|
84
|
+
? html `
|
|
85
|
+
<exm-navigation-drawer-nav-item
|
|
86
|
+
style=${styleMap(this.getItemStyle())}
|
|
87
|
+
class="collapsed-item"
|
|
88
|
+
?selected=${this.path.includes(subItem.id)}
|
|
89
|
+
@click=${this.handleSubMenuItemClick.bind(this, [...path, subItem.id])}
|
|
90
|
+
>
|
|
91
|
+
${subItem.label}
|
|
92
|
+
</exm-navigation-drawer-nav-item>
|
|
93
|
+
`
|
|
94
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]);
|
|
95
|
+
})}
|
|
96
|
+
</md-list>
|
|
97
|
+
</div>
|
|
98
|
+
</exm-collapsed>
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
const navClass = { nav: true, 'has-back-button': this.hasBackButton };
|
|
103
|
+
ExmNavigationSubMenuBase.itemIndex = 0;
|
|
104
|
+
return html `<div class="top"><slot name="top"></slot></div>
|
|
105
|
+
<nav id="exm-navigation-sub-menu" class=${classMap(navClass)}>
|
|
106
|
+
<md-list>
|
|
107
|
+
${repeat(this.currentItem || [], ({ id }) => id, (item) => {
|
|
108
|
+
ExmNavigationSubMenuBase.itemIndex += 1;
|
|
109
|
+
return (item.items || []).length === 0
|
|
110
|
+
? html `
|
|
111
|
+
<exm-navigation-drawer-nav-item
|
|
112
|
+
${animate({
|
|
113
|
+
keyframeOptions: {
|
|
114
|
+
duration: 300,
|
|
115
|
+
},
|
|
116
|
+
stabilizeOut: true,
|
|
117
|
+
out: fadeOut,
|
|
118
|
+
in: fadeIn,
|
|
119
|
+
properties: ['opacity'],
|
|
120
|
+
})}
|
|
121
|
+
style="${styleMap(this.getItemStyle())}"
|
|
122
|
+
type="button"
|
|
123
|
+
?selected=${this.path.includes(item.id)}
|
|
124
|
+
@click=${this.handleSubMenuItemClick.bind(this, [this.path[0] || '', item.id])}
|
|
125
|
+
>
|
|
126
|
+
${item.label}
|
|
127
|
+
</exm-navigation-drawer-nav-item>
|
|
128
|
+
`
|
|
129
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]);
|
|
130
|
+
})}
|
|
131
|
+
</md-list>
|
|
132
|
+
</nav>
|
|
133
|
+
<div class="bottom"><slot name="bottom"></slot></div>`;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
ExmNavigationSubMenuBase.itemIndex = 0;
|
|
137
|
+
ExmNavigationSubMenuBase.styles = [style];
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Array })
|
|
140
|
+
], ExmNavigationSubMenuBase.prototype, "items", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Array })
|
|
143
|
+
], ExmNavigationSubMenuBase.prototype, "path", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ type: Boolean, attribute: 'has-back-button' })
|
|
146
|
+
], ExmNavigationSubMenuBase.prototype, "hasBackButton", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
state()
|
|
149
|
+
], ExmNavigationSubMenuBase.prototype, "currentItem", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
query('nav')
|
|
152
|
+
], ExmNavigationSubMenuBase.prototype, "navigationElement", void 0);
|
|
153
|
+
//# sourceMappingURL=exm-navigation-sub-menu-base.js.map
|
|
@@ -15,10 +15,9 @@ export class ExmNavigationTopbarBase extends ExmgElement {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
return html `
|
|
18
|
-
<
|
|
19
|
-
icon
|
|
20
|
-
|
|
21
|
-
></exm-navigation-icon-button>
|
|
18
|
+
<md-icon-button @click=${this.handleMenuButtonClick}
|
|
19
|
+
><md-icon>${this.drawerOpen ? 'menu_open' : 'menu'}</md-icon></md-icon-button
|
|
20
|
+
>
|
|
22
21
|
<slot name="topbar-title" class="topbar-title"></slot>
|
|
23
22
|
<slot name="topbar-actions"></slot>
|
|
24
23
|
`;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ExmNavigation } from './exm-navigation.js';
|
|
2
|
+
export { ExmNavigationBase } from './exm-navigation-base.js';
|
|
3
|
+
export { ExmNavigationDrawerBase } from './exm-navigation-drawer-base.js';
|
|
4
|
+
export { ExmNavigationDrawerMenuBase } from './exm-navigation-drawer-menu-base.js';
|
|
5
|
+
export { ExmNavigationDrawerNavItemBase } from './exm-navigation-drawer-nav-item-base.js';
|
|
6
|
+
export { ExmNavigationIconBase } from './exm-navigation-icon-base.js';
|
|
7
|
+
export { ExmNavigationIconButtonBase } from './exm-navigation-icon-button-base.js';
|
|
8
|
+
export { ExmNavigationRailBase } from './exm-navigation-rail-base.js';
|
|
9
|
+
export { ExmNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
10
|
+
export { ExmNavigationSubMenuBase } from './exm-navigation-sub-menu-base.js';
|
|
11
|
+
export { ExmNavigationTopbarBase } from './exm-navigation-topbar-base.js';
|
|
12
|
+
export { style as exmgNavigationStyles } from './styles/exm-navigation-css.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ExmNavigation } from './exm-navigation.js';
|
|
2
|
+
export { ExmNavigationBase } from './exm-navigation-base.js';
|
|
3
|
+
export { ExmNavigationDrawerBase } from './exm-navigation-drawer-base.js';
|
|
4
|
+
export { ExmNavigationDrawerMenuBase } from './exm-navigation-drawer-menu-base.js';
|
|
5
|
+
export { ExmNavigationDrawerNavItemBase } from './exm-navigation-drawer-nav-item-base.js';
|
|
6
|
+
export { ExmNavigationIconBase } from './exm-navigation-icon-base.js';
|
|
7
|
+
export { ExmNavigationIconButtonBase } from './exm-navigation-icon-button-base.js';
|
|
8
|
+
export { ExmNavigationRailBase } from './exm-navigation-rail-base.js';
|
|
9
|
+
export { ExmNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
10
|
+
export { ExmNavigationSubMenuBase } from './exm-navigation-sub-menu-base.js';
|
|
11
|
+
export { ExmNavigationTopbarBase } from './exm-navigation-topbar-base.js';
|
|
12
|
+
export { style as exmgNavigationStyles } from './styles/exm-navigation-css.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -5,9 +5,11 @@ export const MediaQueries = (superClass) => {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.media = 'desktop';
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
8
|
+
this.touch = false;
|
|
9
|
+
this.mobileMedia = window.matchMedia('(max-width: 960px)');
|
|
10
|
+
this.tabletMedia = window.matchMedia('(min-width: 961px) and (max-width: 1200px)');
|
|
10
11
|
this.desktopMedia = window.matchMedia('(min-width: 1201px)');
|
|
12
|
+
this.hoverMedia = window.matchMedia('(hover: hover)');
|
|
11
13
|
}
|
|
12
14
|
updateMedia(media) {
|
|
13
15
|
return (mediaMatch) => {
|
|
@@ -17,6 +19,12 @@ export const MediaQueries = (superClass) => {
|
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
21
|
}
|
|
22
|
+
updateTouch() {
|
|
23
|
+
return (mediaMatch) => {
|
|
24
|
+
this.touch = !mediaMatch.matches;
|
|
25
|
+
this.requestUpdate();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
20
28
|
connectedCallback() {
|
|
21
29
|
super.connectedCallback();
|
|
22
30
|
// @ts-ignore
|
|
@@ -25,10 +33,12 @@ export const MediaQueries = (superClass) => {
|
|
|
25
33
|
this.updateMedia('tablet')(this.tabletMedia);
|
|
26
34
|
// @ts-ignore
|
|
27
35
|
this.updateMedia('desktop')(this.desktopMedia);
|
|
28
|
-
//
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
this.updateTouch()(this.hoverMedia);
|
|
29
38
|
this.mobileMedia.addEventListener('change', this.updateMedia('mobile').bind(this));
|
|
30
39
|
this.tabletMedia.addEventListener('change', this.updateMedia('tablet').bind(this));
|
|
31
40
|
this.desktopMedia.addEventListener('change', this.updateMedia('desktop').bind(this));
|
|
41
|
+
this.hoverMedia.addEventListener('change', this.updateTouch().bind(this));
|
|
32
42
|
}
|
|
33
43
|
updated(changedProperties) {
|
|
34
44
|
var _a;
|
|
@@ -39,6 +49,9 @@ export const MediaQueries = (superClass) => {
|
|
|
39
49
|
__decorate([
|
|
40
50
|
property({ type: String })
|
|
41
51
|
], MediaQueryClass.prototype, "media", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
property({ type: Boolean })
|
|
54
|
+
], MediaQueryClass.prototype, "touch", void 0);
|
|
42
55
|
return MediaQueryClass;
|
|
43
56
|
};
|
|
44
57
|
//# sourceMappingURL=media-queries.js.map
|
|
@@ -6,6 +6,7 @@ export const style = css `
|
|
|
6
6
|
grid-template-rows: 1fr;
|
|
7
7
|
width: 100%;
|
|
8
8
|
transition: grid-template-columns 0.3s ease;
|
|
9
|
+
max-height: 100vh;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.navigation-container.show-topbar {
|
|
@@ -37,6 +38,7 @@ export const style = css `
|
|
|
37
38
|
.content {
|
|
38
39
|
grid-area: 1/3/2/4;
|
|
39
40
|
z-index: 1;
|
|
41
|
+
overflow: scroll;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
exm-navigation-drawer {
|
|
@@ -52,5 +54,19 @@ export const style = css `
|
|
|
52
54
|
.left-margin {
|
|
53
55
|
margin-left: 2.5rem;
|
|
54
56
|
}
|
|
57
|
+
|
|
58
|
+
.drawer-menu-button {
|
|
59
|
+
padding: 0 8px;
|
|
60
|
+
height: var(--_exm-navigation-top-bar-height, 64px);
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: 48px 1fr;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.drawer-back-button {
|
|
69
|
+
padding: 0 8px;
|
|
70
|
+
}
|
|
55
71
|
`;
|
|
56
72
|
//# sourceMappingURL=exm-navigation-css.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:root {
|
|
4
|
+
--md-sys-color-background: var(--md-sys-color-surface-container-high);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
--exm-drawer-max-width: 319px;
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: var(--mdc-drawer-width, 300px) 1fr;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
transition: grid-template-columns 0.3s ease;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
aside {
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: -300px;
|
|
21
|
+
width: var(--exm-drawer-max-width, 300px);
|
|
22
|
+
height: 100%;
|
|
23
|
+
transition: left 0.3s ease-out;
|
|
24
|
+
z-index: 4;
|
|
25
|
+
background-color: var(--exm-drawer-container-color, var(--md-sys-color-surface-container, #f3edf7));
|
|
26
|
+
color: var(--exm-drawer-container-on-color, var(--md-sys-color-on-surface-container, #f3edf7));
|
|
27
|
+
border-radius: 0 var(--mdc-shape-large, 0) var(--mdc-shape-large, 0) 0;
|
|
28
|
+
border-left: 1px solid var(--md-sys-color-outline);
|
|
29
|
+
|
|
30
|
+
&.open {
|
|
31
|
+
left: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
//# sourceMappingURL=exm-navigation-drawer-css.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_exm-navigation-item-background-color-selected: var(
|
|
5
|
+
--exm-navigation-item-background-color-selected,
|
|
6
|
+
var(--md-sys-color-secondary)
|
|
7
|
+
);
|
|
8
|
+
--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary));
|
|
9
|
+
--_exm-navigation-item-color-sub-selected: var(
|
|
10
|
+
--exm-navigation-item-color-sub-selected,
|
|
11
|
+
var(--md-sys-color-on-surface)
|
|
12
|
+
);
|
|
13
|
+
--_exm-navigation-item-background-color-sub-selected: var(
|
|
14
|
+
--exm-navigation-item-background-color-sub-selected,
|
|
15
|
+
var(--md-sys-color-surface-container-highest)
|
|
16
|
+
);
|
|
17
|
+
--md-list-item-container-shape: 2rem;
|
|
18
|
+
--md-list-item-one-line-container-height: 48px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
button {
|
|
22
|
+
--background-color: transparent;
|
|
23
|
+
--text-color: var(--md-list-item-label-text-color);
|
|
24
|
+
|
|
25
|
+
border-radius: var(--md-list-item-container-shape);
|
|
26
|
+
height: var(--md-list-item-one-line-container-height);
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
padding: 0 16px;
|
|
29
|
+
display: grid;
|
|
30
|
+
align-items: center;
|
|
31
|
+
width: 100%;
|
|
32
|
+
grid-template-columns: auto 1fr auto;
|
|
33
|
+
background-color: var(--background-color);
|
|
34
|
+
position: relative;
|
|
35
|
+
border: none;
|
|
36
|
+
color: var(--md-sys-color-on-surface, black);
|
|
37
|
+
outline: none;
|
|
38
|
+
|
|
39
|
+
.label {
|
|
40
|
+
grid-area: 1/2/2/3;
|
|
41
|
+
text-align: start;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.selected {
|
|
45
|
+
--background-color: var(--_exm-navigation-item-background-color-selected);
|
|
46
|
+
--text-color: var(--_exm-navigation-item-color-selected);
|
|
47
|
+
color: var(--text-color, black);
|
|
48
|
+
|
|
49
|
+
&.has-sub-menu {
|
|
50
|
+
--background-color: var(--_exm-navigation-item-background-color-sub-selected);
|
|
51
|
+
--text-color: var(--_exm-navigation-item-color-sub-selected);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.has-icon {
|
|
56
|
+
padding-left: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.has-sub-menu {
|
|
60
|
+
padding-right: 4px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
& + button {
|
|
64
|
+
margin-top: 4px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
md-focus-ring {
|
|
68
|
+
color: white;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exm-navigation-icon {
|
|
72
|
+
width: 48px;
|
|
73
|
+
|
|
74
|
+
&.item-icon {
|
|
75
|
+
grid-area: 1/1/2/2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.has-submenu {
|
|
79
|
+
grid-area: 1/3/2/4;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
//# sourceMappingURL=exm-navigation-drawer-nav-item-css.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
.icon-button {
|
|
4
|
+
display: inline-grid;
|
|
5
|
+
grid-template-columns: 48px;
|
|
6
|
+
border: none;
|
|
7
|
+
background-color: rgba(0, 0, 0, 0);
|
|
8
|
+
height: 48px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: start;
|
|
11
|
+
padding: 0;
|
|
12
|
+
color: var(--md-sys-color-on-surface, black);
|
|
13
|
+
position: relative;
|
|
14
|
+
border-radius: 2rem;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-button.has-label {
|
|
19
|
+
grid-template-columns: 48px auto;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.icon-button .label {
|
|
24
|
+
padding: 0 8px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
//# sourceMappingURL=exm-navigation-icon-button-css.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
.nav {
|
|
4
|
+
padding: 8px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
md-list {
|
|
8
|
+
padding-top: 0;
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-rows: repeat(auto-fit, auto);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.has-back-button {
|
|
14
|
+
padding-left: 48px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sub-menu {
|
|
18
|
+
margin-left: 1rem;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
//# sourceMappingURL=exm-navigation-sub-menu-css.js.map
|
|
@@ -9,14 +9,15 @@ export const style = css `
|
|
|
9
9
|
background: var(--_exm-navigation-rail-background-color);
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
display: grid;
|
|
12
|
-
grid-template-columns:
|
|
12
|
+
grid-template-columns: auto 1fr auto;
|
|
13
13
|
height: var(--_exm-navigation-top-bar-height);
|
|
14
|
-
gap:
|
|
14
|
+
gap: 16px;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
width: 100%;
|
|
17
|
+
padding: 8px 12px;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
md-icon-button {
|
|
20
21
|
align-self: center;
|
|
21
22
|
grid-area: 1/1/2/2;
|
|
22
23
|
justify-self: center;
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-navigation",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2-alpha.2+b22c94c",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"module": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./index.js",
|
|
9
|
-
"./exm-navigation.js": "./
|
|
10
|
-
"./exm-navigation-drawer.js": "./
|
|
11
|
-
"./exm-navigation-drawer-menu.js": "./
|
|
12
|
-
"./exm-navigation-drawer-nav-item.js": "./
|
|
13
|
-
"./exm-navigation-icon.js": "./
|
|
14
|
-
"./exm-navigation-icon-button.js": "./
|
|
15
|
-
"./exm-navigation-rail.js": "./
|
|
16
|
-
"./exm-navigation-rail-nav-item.js": "./
|
|
17
|
-
"./exm-navigation-topbar.js": "./
|
|
18
|
-
"./exm-navigation-base.js": "./
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./exm-navigation.js": "./dist/exm-navigation.js",
|
|
10
|
+
"./exm-navigation-drawer.js": "./dist/exm-navigation-drawer.js",
|
|
11
|
+
"./exm-navigation-drawer-menu.js": "./dist/exm-navigation-drawer-menu.js",
|
|
12
|
+
"./exm-navigation-drawer-nav-item.js": "./dist/exm-navigation-drawer-nav-item.js",
|
|
13
|
+
"./exm-navigation-icon.js": "./dist/exm-navigation-icon.js",
|
|
14
|
+
"./exm-navigation-icon-button.js": "./dist/exm-navigation-icon-button.js",
|
|
15
|
+
"./exm-navigation-rail.js": "./dist/exm-navigation-rail.js",
|
|
16
|
+
"./exm-navigation-rail-nav-item.js": "./dist/exm-navigation-rail-nav-item.js",
|
|
17
|
+
"./exm-navigation-topbar.js": "./dist/exm-navigation-topbar.js",
|
|
18
|
+
"./exm-navigation-base.js": "./dist/ExmNavigationBase.js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@exmg/lit-base": "^3.0.0",
|
|
22
|
-
"@
|
|
22
|
+
"@lit-labs/motion": "^1.0.7",
|
|
23
23
|
"@material/mwc-top-app-bar-fixed": "^0.27.0",
|
|
24
24
|
"@material/web": "^2.2.0",
|
|
25
25
|
"lit": "^3.0.0",
|
|
@@ -38,18 +38,16 @@
|
|
|
38
38
|
"**/*.js",
|
|
39
39
|
"**/*.d.ts"
|
|
40
40
|
],
|
|
41
|
-
"homepage": "https://
|
|
41
|
+
"homepage": "https://bitbucket.org/exmachina/exm-web-components",
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
44
|
-
"url": "git@
|
|
44
|
+
"url": "git@bitbucket.org:exmachina/exm-web-components.git",
|
|
45
45
|
"directory": "packages/exm-navigation"
|
|
46
46
|
},
|
|
47
47
|
"license": "MIT",
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build:styles": "exmg-lit-cli sass -f \"./**/*.scss\""
|
|
50
|
-
},
|
|
48
|
+
"scripts": {},
|
|
51
49
|
"publishConfig": {
|
|
52
50
|
"access": "public"
|
|
53
51
|
},
|
|
54
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b22c94c314417991814f6ce678ef9559dfe96e7d"
|
|
55
53
|
}
|
package/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ExmNavigation } from './src/exm-navigation.js';
|
|
2
|
-
export { ExmNavigationBase } from './src/exm-navigation-base.js';
|
|
3
|
-
export { ExmNavigationDrawerBase } from './src/exm-navigation-drawer-base.js';
|
|
4
|
-
export { ExmNavigationDrawerMenuBase } from './src/exm-navigation-drawer-menu-base.js';
|
|
5
|
-
export { ExmNavigationDrawerNavItemBase } from './src/exm-navigation-drawer-nav-item-base.js';
|
|
6
|
-
export { ExmNavigationIconBase } from './src/exm-navigation-icon-base.js';
|
|
7
|
-
export { ExmNavigationIconButtonBase } from './src/exm-navigation-icon-button-base.js';
|
|
8
|
-
export { ExmNavigationRailBase } from './src/exm-navigation-rail-base.js';
|
|
9
|
-
export { ExmNavigationRailNavItemBase } from './src/exm-navigation-rail-nav-item-base.js';
|
|
10
|
-
export { ExmNavigationSubMenuBase } from './src/exm-navigation-sub-menu-base.js';
|
|
11
|
-
export { ExmNavigationTopbarBase } from './src/exm-navigation-topbar-base.js';
|
|
12
|
-
export { style as exmgNavigationStyles } from './src/styles/exm-navigation-css.js';
|
package/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { ExmNavigation } from './src/exm-navigation.js';
|
|
2
|
-
export { ExmNavigationBase } from './src/exm-navigation-base.js';
|
|
3
|
-
export { ExmNavigationDrawerBase } from './src/exm-navigation-drawer-base.js';
|
|
4
|
-
export { ExmNavigationDrawerMenuBase } from './src/exm-navigation-drawer-menu-base.js';
|
|
5
|
-
export { ExmNavigationDrawerNavItemBase } from './src/exm-navigation-drawer-nav-item-base.js';
|
|
6
|
-
export { ExmNavigationIconBase } from './src/exm-navigation-icon-base.js';
|
|
7
|
-
export { ExmNavigationIconButtonBase } from './src/exm-navigation-icon-button-base.js';
|
|
8
|
-
export { ExmNavigationRailBase } from './src/exm-navigation-rail-base.js';
|
|
9
|
-
export { ExmNavigationRailNavItemBase } from './src/exm-navigation-rail-nav-item-base.js';
|
|
10
|
-
export { ExmNavigationSubMenuBase } from './src/exm-navigation-sub-menu-base.js';
|
|
11
|
-
export { ExmNavigationTopbarBase } from './src/exm-navigation-topbar-base.js';
|
|
12
|
-
export { style as exmgNavigationStyles } from './src/styles/exm-navigation-css.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
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 ExmNavigationDrawerNav_base: typeof ExmgElement;
|
|
5
|
-
export declare class ExmNavigationDrawerNav extends ExmNavigationDrawerNav_base {
|
|
6
|
-
static styles: import("lit").CSSResult[];
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
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 ExmNavigationDrawerNav = class ExmNavigationDrawerNav 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
|
-
ExmNavigationDrawerNav.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
|
-
ExmNavigationDrawerNav = __decorate([
|
|
43
|
-
customElement('exm-navigation-drawer-nav')
|
|
44
|
-
// eslint-disable-next-line
|
|
45
|
-
], ExmNavigationDrawerNav);
|
|
46
|
-
export { ExmNavigationDrawerNav };
|
|
47
|
-
//# sourceMappingURL=exm-navigation-drawer-nav.js.map
|