@exmg/exm-navigation 1.0.3 → 1.1.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 +11 -15
- package/index.js +11 -15
- package/package.json +10 -9
- package/src/exm-navigation-base.d.ts +94 -19
- package/src/exm-navigation-base.js +288 -58
- package/src/exm-navigation-drawer-base.d.ts +8 -23
- package/src/exm-navigation-drawer-base.js +25 -149
- package/src/exm-navigation-drawer-menu-base.d.ts +12 -0
- package/src/exm-navigation-drawer-menu-base.js +45 -0
- package/src/exm-navigation-drawer-menu.d.ts +9 -0
- package/src/exm-navigation-drawer-menu.js +12 -0
- package/src/exm-navigation-drawer-nav-item-base.d.ts +14 -0
- package/src/exm-navigation-drawer-nav-item-base.js +45 -0
- package/src/exm-navigation-drawer-nav-item.d.ts +8 -0
- package/src/exm-navigation-drawer-nav-item.js +10 -0
- package/src/exm-navigation-drawer.d.ts +0 -1
- package/src/exm-navigation-drawer.js +0 -2
- package/src/exm-navigation-icon-base.d.ts +7 -0
- package/src/exm-navigation-icon-base.js +20 -0
- package/src/exm-navigation-icon-button-base.d.ts +9 -0
- package/src/exm-navigation-icon-button-base.js +34 -0
- package/src/exm-navigation-icon-button.d.ts +8 -0
- package/src/exm-navigation-icon-button.js +10 -0
- package/src/exm-navigation-icon.d.ts +8 -0
- package/src/exm-navigation-icon.js +10 -0
- package/src/exm-navigation-menu-button-base.d.ts +7 -0
- package/src/exm-navigation-menu-button.d.ts +9 -0
- package/src/exm-navigation-rail-base.d.ts +8 -0
- package/src/exm-navigation-rail-base.js +46 -1
- package/src/exm-navigation-rail-nav-item-base.d.ts +2 -4
- package/src/exm-navigation-rail-nav-item-base.js +7 -39
- package/src/exm-navigation-rail-nav-item.d.ts +0 -1
- package/src/exm-navigation-rail-nav-item.js +0 -2
- package/src/exm-navigation-rail.d.ts +0 -1
- package/src/exm-navigation-rail.js +0 -2
- package/src/exm-navigation-signals.d.ts +1 -8
- package/src/exm-navigation-sub-menu-base.d.ts +17 -0
- package/src/exm-navigation-sub-menu-base.js +88 -0
- package/src/exm-navigation-sub-menu.d.ts +8 -0
- package/src/exm-navigation-sub-menu.js +10 -0
- package/src/exm-navigation-topbar-base.d.ts +10 -0
- package/src/exm-navigation-topbar-base.js +33 -0
- package/src/exm-navigation-topbar.d.ts +8 -0
- package/src/exm-navigation-topbar.js +10 -0
- package/src/exm-navigation.d.ts +8 -0
- package/src/exm-navigation.js +10 -0
- package/src/mediaQueries.d.ts +7 -0
- package/src/mixins/media-queries.d.ts +7 -0
- package/src/mixins/media-queries.js +45 -0
- package/src/styles/exm-navigate-drawer-nav-item-css.js +4 -0
- package/src/styles/exm-navigation-css.js +4 -0
- package/src/styles/exm-navigation-drawer-css.js +1 -1
- package/src/styles/exm-navigation-drawer-nav-item-css.js +4 -0
- package/src/styles/{exm-navigation-styles.scss → exm-navigation-drawer-nav-item.scss} +11 -21
- package/src/styles/exm-navigation-drawer.scss +14 -19
- package/src/styles/exm-navigation-icon-button-css.d.ts +2 -0
- package/src/styles/exm-navigation-icon-button-css.js +4 -0
- package/src/styles/exm-navigation-icon-button.scss +19 -0
- package/src/styles/exm-navigation-icon-css.d.ts +2 -0
- package/src/styles/exm-navigation-icon-css.js +4 -0
- package/src/styles/exm-navigation-icon.scss +18 -0
- package/src/styles/exm-navigation-rail-css.js +1 -1
- package/src/styles/exm-navigation-rail-nav-item-css.js +1 -1
- package/src/styles/exm-navigation-rail-nav-item.scss +14 -29
- package/src/styles/exm-navigation-rail.scss +14 -5
- package/src/styles/exm-navigation-sub-menu-css.d.ts +2 -0
- package/src/styles/exm-navigation-sub-menu-css.js +4 -0
- package/src/styles/exm-navigation-sub-menu.scss +34 -0
- package/src/styles/exm-navigation-topbar-css.d.ts +2 -0
- package/src/styles/exm-navigation-topbar-css.js +4 -0
- package/src/styles/exm-navigation-topbar.scss +27 -0
- package/src/styles/exm-navigation.scss +52 -0
- package/src/types.d.ts +8 -0
- package/src/types.js +2 -0
- 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.js +0 -11
- 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-navigation-rail-nav-css.js +0 -4
- package/src/styles/exm-navigation-rail-nav.scss +0 -7
- package/src/styles/exm-navigation-styles-css.js +0 -4
- package/src/styles/exm-navigation-toolbar-css.js +0 -4
- package/src/styles/exm-navigation-toolbar.scss +0 -18
- /package/src/styles/{exm-navigation-rail-nav-css.d.ts → exm-navigate-drawer-nav-item-css.d.ts} +0 -0
- /package/src/styles/{exm-navigation-styles-css.d.ts → exm-navigation-css.d.ts} +0 -0
- /package/src/styles/{exm-navigation-toolbar-css.d.ts → exm-navigation-drawer-nav-item-css.d.ts} +0 -0
|
@@ -1,48 +1,24 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
4
|
+
import { style } from './styles/exm-navigation-rail-nav-item-css.js';
|
|
5
5
|
import '@material/web/focus/md-focus-ring.js';
|
|
6
|
-
import
|
|
6
|
+
import './exm-navigation-icon.js';
|
|
7
7
|
export class ExmNavigationRailNavItemBase extends LitElement {
|
|
8
8
|
constructor() {
|
|
9
|
-
super();
|
|
9
|
+
super(...arguments);
|
|
10
10
|
this.icon = '';
|
|
11
11
|
this.selected = false;
|
|
12
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
13
|
}
|
|
39
14
|
render() {
|
|
40
|
-
return html
|
|
41
|
-
<md-focus-ring></md-focus-ring><
|
|
15
|
+
return html `<button role="link">
|
|
16
|
+
<md-focus-ring></md-focus-ring><exm-navigation-icon class="symbols" icon=${this.icon}></exm-navigation-icon>
|
|
42
17
|
<div class="label">${this.label}</div>
|
|
43
18
|
</button>`;
|
|
44
19
|
}
|
|
45
20
|
}
|
|
21
|
+
ExmNavigationRailNavItemBase.styles = [style];
|
|
46
22
|
__decorate([
|
|
47
23
|
property({ type: String })
|
|
48
24
|
], ExmNavigationRailNavItemBase.prototype, "icon", void 0);
|
|
@@ -53,15 +29,7 @@ __decorate([
|
|
|
53
29
|
property({ type: String })
|
|
54
30
|
], ExmNavigationRailNavItemBase.prototype, "label", void 0);
|
|
55
31
|
__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
|
-
})
|
|
32
|
+
property({ type: Boolean, reflect: true })
|
|
65
33
|
], ExmNavigationRailNavItemBase.prototype, "selected", void 0);
|
|
66
34
|
__decorate([
|
|
67
35
|
property({ type: Boolean })
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ExmNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
2
2
|
export declare class ExmNavigationRailNavItem extends ExmNavigationRailNavItemBase {
|
|
3
|
-
static styles: import("lit").CSSResult[];
|
|
4
3
|
}
|
|
5
4
|
declare global {
|
|
6
5
|
interface HTMLElementTagNameMap {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { style } from './styles/exm-navigation-rail-nav-item-css.js';
|
|
4
3
|
import { ExmNavigationRailNavItemBase } from './exm-navigation-rail-nav-item-base.js';
|
|
5
4
|
let ExmNavigationRailNavItem = class ExmNavigationRailNavItem extends ExmNavigationRailNavItemBase {
|
|
6
5
|
};
|
|
7
|
-
ExmNavigationRailNavItem.styles = [style];
|
|
8
6
|
ExmNavigationRailNavItem = __decorate([
|
|
9
7
|
customElement('exm-navigation-rail-nav-item')
|
|
10
8
|
], ExmNavigationRailNavItem);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from 'lit/decorators/custom-element.js';
|
|
3
3
|
import { ExmNavigationRailBase } from './exm-navigation-rail-base.js';
|
|
4
|
-
import { style } from './styles/exm-navigation-rail-css.js';
|
|
5
4
|
let ExmNavigationRail = class ExmNavigationRail extends ExmNavigationRailBase {
|
|
6
5
|
};
|
|
7
|
-
ExmNavigationRail.styles = [style];
|
|
8
6
|
ExmNavigationRail = __decorate([
|
|
9
7
|
customElement('exm-navigation-rail')
|
|
10
8
|
], ExmNavigationRail);
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export declare const navigationItemHover: import("@preact/signals-core").Signal<boolean>;
|
|
2
1
|
export declare const navigationDrawerHover: import("@preact/signals-core").Signal<boolean>;
|
|
3
|
-
export declare const navigationDrawerOpen: import("@preact/signals-core").Signal<boolean>;
|
|
4
2
|
export declare const navigationActiveHasSubmenu: import("@preact/signals-core").Signal<{
|
|
5
|
-
[
|
|
3
|
+
[menuItem: string]: boolean;
|
|
6
4
|
}>;
|
|
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,17 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
3
|
+
import { MenuItem } from './types.js';
|
|
4
|
+
import './exm-navigation-rail-nav-item.js';
|
|
5
|
+
import './exm-navigation-drawer-nav-item.js';
|
|
6
|
+
import '@material/web/list/list.js';
|
|
7
|
+
import '@exmg/exm-collapsed/exm-collapsed.js';
|
|
8
|
+
export declare class ExmNavigationSubMenuBase extends ExmgElement {
|
|
9
|
+
items: MenuItem[];
|
|
10
|
+
path: (string | null)[];
|
|
11
|
+
currentItem?: MenuItem['items'];
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
14
|
+
private handleSubMenuItemClick;
|
|
15
|
+
private renderSubMenu;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
4
|
+
import { property, 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 './exm-navigation-rail-nav-item.js';
|
|
8
|
+
import './exm-navigation-drawer-nav-item.js';
|
|
9
|
+
import '@material/web/list/list.js';
|
|
10
|
+
import '@exmg/exm-collapsed/exm-collapsed.js';
|
|
11
|
+
export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.items = [];
|
|
15
|
+
this.path = [];
|
|
16
|
+
}
|
|
17
|
+
updated(changedProperties) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (changedProperties.has('path') || changedProperties.has('items')) {
|
|
20
|
+
console.log('updated', this.path);
|
|
21
|
+
this.currentItem = ((_a = this.items.find((item) => item.id === this.path[0])) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
handleSubMenuItemClick(path) {
|
|
25
|
+
this.fire('sub-menu-item-click', path);
|
|
26
|
+
}
|
|
27
|
+
renderSubMenu(item, path) {
|
|
28
|
+
return html `
|
|
29
|
+
<exm-navigation-drawer-nav-item
|
|
30
|
+
type="button"
|
|
31
|
+
?selected=${this.path.includes(item.id)}
|
|
32
|
+
class="has-submenu"
|
|
33
|
+
@click=${this.handleSubMenuItemClick.bind(this, [...path])}
|
|
34
|
+
?has-submenu=${true}
|
|
35
|
+
submenu-icon=${this.path.includes(item.id) ? 'expand_less' : 'expand_more'}
|
|
36
|
+
>${item.label}
|
|
37
|
+
</exm-navigation-drawer-nav-item>
|
|
38
|
+
<exm-collapsed id="collapsed" ?opened=${this.path.includes(item.id)}>
|
|
39
|
+
<div class="sub-menu">
|
|
40
|
+
<md-list>
|
|
41
|
+
<!-- Need to check for multiple items -->
|
|
42
|
+
${(item.items || []).map((subItem) => (subItem.items || []).length === 0
|
|
43
|
+
? html `
|
|
44
|
+
<exm-navigation-drawer-nav-item
|
|
45
|
+
class="collapsed-item"
|
|
46
|
+
?selected=${this.path.includes(subItem.id)}
|
|
47
|
+
@click=${this.handleSubMenuItemClick.bind(this, [...path, subItem.id])}
|
|
48
|
+
>
|
|
49
|
+
${subItem.label}
|
|
50
|
+
</exm-navigation-drawer-nav-item>
|
|
51
|
+
`
|
|
52
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]))}
|
|
53
|
+
</md-list>
|
|
54
|
+
</div>
|
|
55
|
+
</exm-collapsed>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return html `<div class="top"><slot name="top"></slot></div>
|
|
60
|
+
<nav class="nav">
|
|
61
|
+
<md-list>
|
|
62
|
+
${repeat(this.currentItem || [], ({ id }) => id, (item) => (item.items || []).length === 0
|
|
63
|
+
? html `
|
|
64
|
+
<exm-navigation-drawer-nav-item
|
|
65
|
+
type="button"
|
|
66
|
+
?selected=${this.path.includes(item.id)}
|
|
67
|
+
@click=${this.handleSubMenuItemClick.bind(this, [this.path[0] || '', item.id])}
|
|
68
|
+
>
|
|
69
|
+
${item.label}
|
|
70
|
+
</exm-navigation-drawer-nav-item>
|
|
71
|
+
`
|
|
72
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]))}
|
|
73
|
+
</md-list>
|
|
74
|
+
</nav>
|
|
75
|
+
<div class="bottom"><slot name="bottom"></slot></div>`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
ExmNavigationSubMenuBase.styles = [style];
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Array })
|
|
81
|
+
], ExmNavigationSubMenuBase.prototype, "items", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Array })
|
|
84
|
+
], ExmNavigationSubMenuBase.prototype, "path", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
state()
|
|
87
|
+
], ExmNavigationSubMenuBase.prototype, "currentItem", void 0);
|
|
88
|
+
//# sourceMappingURL=exm-navigation-sub-menu-base.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExmNavigationSubMenuBase } from './exm-navigation-sub-menu-base.js';
|
|
2
|
+
export declare class ExmNavigationSubMenu extends ExmNavigationSubMenuBase {
|
|
3
|
+
}
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'exm-navigation-sub-menu': ExmNavigationSubMenu;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators/custom-element.js';
|
|
3
|
+
import { ExmNavigationSubMenuBase } from './exm-navigation-sub-menu-base.js';
|
|
4
|
+
let ExmNavigationSubMenu = class ExmNavigationSubMenu extends ExmNavigationSubMenuBase {
|
|
5
|
+
};
|
|
6
|
+
ExmNavigationSubMenu = __decorate([
|
|
7
|
+
customElement('exm-navigation-sub-menu')
|
|
8
|
+
], ExmNavigationSubMenu);
|
|
9
|
+
export { ExmNavigationSubMenu };
|
|
10
|
+
//# sourceMappingURL=exm-navigation-sub-menu.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
2
|
+
import { MenuItem } from './types.js';
|
|
3
|
+
import './exm-navigation-rail-nav-item.js';
|
|
4
|
+
export declare class ExmNavigationTopbarBase extends ExmgElement {
|
|
5
|
+
items: MenuItem[];
|
|
6
|
+
drawerOpen: boolean;
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
handleMenuButtonClick(itemId: string): void;
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
5
|
+
import { style } from './styles/exm-navigation-topbar-css.js';
|
|
6
|
+
import './exm-navigation-rail-nav-item.js';
|
|
7
|
+
export class ExmNavigationTopbarBase extends ExmgElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.items = [];
|
|
11
|
+
this.drawerOpen = false;
|
|
12
|
+
}
|
|
13
|
+
handleMenuButtonClick(itemId) {
|
|
14
|
+
this.fire('topbar-menu-click', itemId);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<exm-navigation-icon-button
|
|
19
|
+
icon=${this.drawerOpen ? 'menu_open' : 'menu'}
|
|
20
|
+
@navigation-icon-button-click=${this.handleMenuButtonClick}
|
|
21
|
+
></exm-navigation-icon-button>
|
|
22
|
+
<slot name="topbar-title"></slot>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ExmNavigationTopbarBase.styles = [style];
|
|
27
|
+
__decorate([
|
|
28
|
+
property({ type: Array })
|
|
29
|
+
], ExmNavigationTopbarBase.prototype, "items", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Boolean, attribute: 'drawer-open' })
|
|
32
|
+
], ExmNavigationTopbarBase.prototype, "drawerOpen", void 0);
|
|
33
|
+
//# sourceMappingURL=exm-navigation-topbar-base.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExmNavigationTopbarBase } from './exm-navigation-topbar-base.js';
|
|
2
|
+
export declare class ExmNavigationTopbar extends ExmNavigationTopbarBase {
|
|
3
|
+
}
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'exm-navigation-topbar': ExmNavigationTopbar;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators/custom-element.js';
|
|
3
|
+
import { ExmNavigationTopbarBase } from './exm-navigation-topbar-base.js';
|
|
4
|
+
let ExmNavigationTopbar = class ExmNavigationTopbar extends ExmNavigationTopbarBase {
|
|
5
|
+
};
|
|
6
|
+
ExmNavigationTopbar = __decorate([
|
|
7
|
+
customElement('exm-navigation-topbar')
|
|
8
|
+
], ExmNavigationTopbar);
|
|
9
|
+
export { ExmNavigationTopbar };
|
|
10
|
+
//# sourceMappingURL=exm-navigation-topbar.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ExmNavigationBase } from './exm-navigation-base.js';
|
|
4
|
+
let ExmNavigation = class ExmNavigation extends ExmNavigationBase {
|
|
5
|
+
};
|
|
6
|
+
ExmNavigation = __decorate([
|
|
7
|
+
customElement('exm-navigation')
|
|
8
|
+
], ExmNavigation);
|
|
9
|
+
export { ExmNavigation };
|
|
10
|
+
//# sourceMappingURL=exm-navigation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
3
|
+
type MediaType = 'mobile' | 'tablet' | 'desktop';
|
|
4
|
+
export declare const MediaQueries: <T extends Constructor<LitElement>>(superClass: T) => Constructor<{
|
|
5
|
+
media: MediaType;
|
|
6
|
+
}> & T;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
3
|
+
type MediaType = 'mobile' | 'tablet' | 'desktop';
|
|
4
|
+
export declare const MediaQueries: <T extends Constructor<LitElement>>(superClass: T) => Constructor<{
|
|
5
|
+
media: MediaType;
|
|
6
|
+
}> & T;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
export const MediaQueries = (superClass) => {
|
|
4
|
+
class MediaQueryClass extends superClass {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.media = 'desktop';
|
|
8
|
+
this.mobileMedia = window.matchMedia('(max-width: 400px)');
|
|
9
|
+
this.tabletMedia = window.matchMedia('(min-width: 401px) and (max-width: 1200px)');
|
|
10
|
+
this.desktopMedia = window.matchMedia('(min-width: 1201px)');
|
|
11
|
+
}
|
|
12
|
+
updateMedia(media) {
|
|
13
|
+
return (mediaMatch) => {
|
|
14
|
+
if (mediaMatch.matches) {
|
|
15
|
+
this.media = media;
|
|
16
|
+
this.requestUpdate();
|
|
17
|
+
}
|
|
18
|
+
console.log(media, mediaMatch.matches);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
super.connectedCallback();
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
this.updateMedia('mobile')(this.mobileMedia);
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
this.updateMedia('tablet')(this.tabletMedia);
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
this.updateMedia('desktop')(this.desktopMedia);
|
|
29
|
+
// eslint-disable-next-line
|
|
30
|
+
this.mobileMedia.addEventListener('change', this.updateMedia('mobile').bind(this));
|
|
31
|
+
this.tabletMedia.addEventListener('change', this.updateMedia('tablet').bind(this));
|
|
32
|
+
this.desktopMedia.addEventListener('change', this.updateMedia('desktop').bind(this));
|
|
33
|
+
}
|
|
34
|
+
updated(changedProperties) {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = super.updated) === null || _a === void 0 ? void 0 : _a.call(this, changedProperties);
|
|
37
|
+
console.log(`${this.media} was updated`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ type: String })
|
|
42
|
+
], MediaQueryClass.prototype, "media", void 0);
|
|
43
|
+
return MediaQueryClass;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=media-queries.js.map
|
|
@@ -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))}md-list-item{margin-right:8px;margin-left:8px;border-radius:1rem;--md-list-item-container-shape: 1rem;display:grid;grid-template-columns:auto 1fr auto}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)}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)}md-list-item[selected] md-icon{color:var(--md-sys-color-primary)}.sub-menu{margin-left:1rem}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigate-drawer-nav-item-css.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `.navigation-container{display:grid;grid-template-columns:auto var(--exm-drawer-width, 500px) 1fr;grid-template-rows:1fr;width:100%;transition:grid-template-columns .3s ease}.navigation-container.show-topbar{grid-template-columns:1fr;grid-template-rows:auto 1fr}.navigation-container.show-topbar exm-navigation-topbar{grid-area:1/1/2/2;z-index:2}.navigation-container.show-topbar exm-navigation-drawer{grid-area:1/1/3/2}.navigation-container.show-topbar .content{grid-area:2/1/3/2}exm-navigation-rail{grid-area:1/1/2/2}exm-navigation-drawer{grid-area:1/2/2/3}.content{grid-area:1/3/2/4;z-index:1}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;--mdc-theme-surface: var(--md-sys-color-surface-container-high);--mdc-shape-large: 1rem}.left-margin{margin-left:2.5rem}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-css.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{display:
|
|
2
|
+
export const style = css `:root{--md-sys-color-background: var(--md-sys-color-surface-container-high)}:host{--mdc-drawer-width: 319px;display:grid;grid-template-columns:var(--mdc-drawer-width, 300px) 1fr;height:100vh;width:100%;box-sizing:border-box;transition:grid-template-columns .3s ease;position:relative}@media screen and (min-width: 961px){slot[name=appContent]{background-color:rgba(0,0,0,0)}}`;
|
|
3
3
|
export default style;
|
|
4
4
|
//# sourceMappingURL=exm-navigation-drawer-css.js.map
|
|
@@ -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))}md-list-item{margin-right:8px;margin-left:8px;border-radius:1rem;--md-list-item-container-shape: 1rem}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);--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected) --md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected)}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)}md-list-item[selected] md-icon{color:var(--md-sys-color-primary)}.sub-menu{margin-left:1rem}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-drawer-nav-item-css.js.map
|
|
@@ -6,41 +6,31 @@
|
|
|
6
6
|
--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
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 {
|
|
9
|
+
md-list-item {
|
|
18
10
|
margin-right: 8px;
|
|
19
11
|
margin-left: 8px;
|
|
20
|
-
border-radius:
|
|
21
|
-
--md-list-item-container-shape:
|
|
12
|
+
border-radius: 1rem;
|
|
13
|
+
--md-list-item-container-shape: 1rem;
|
|
22
14
|
}
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
md-list-item[selected] {
|
|
25
17
|
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
26
18
|
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
27
|
-
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected)
|
|
28
|
-
|
|
19
|
+
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected) --md-list-item-trailing-icon-color:
|
|
20
|
+
var(--_exm-navigation-item-color-selected);
|
|
21
|
+
--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected) --md-list-item-trailing-icon-color:
|
|
22
|
+
var(--_exm-navigation-item-color-selected);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
md-list-item.collapsed-item[selected] {
|
|
32
26
|
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
33
27
|
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
md-list-item[selected] md-icon {
|
|
37
31
|
color: var(--md-sys-color-primary);
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
.sub-menu {
|
|
41
|
-
margin-left:
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.left-margin {
|
|
45
|
-
margin-left: 2.5rem;
|
|
35
|
+
margin-left: 1rem;
|
|
46
36
|
}
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--md-sys-color-background: var(--md-sys-color-surface-container-high);
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
:host {
|
|
2
|
-
|
|
6
|
+
--mdc-drawer-width: 319px;
|
|
7
|
+
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: var(--mdc-drawer-width, 300px) 1fr;
|
|
3
10
|
height: 100vh;
|
|
4
11
|
width: 100%;
|
|
5
12
|
box-sizing: border-box;
|
|
6
|
-
|
|
13
|
+
transition: grid-template-columns 0.3s ease;
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
// This is needed because the aside is positioned absolute.
|
|
16
|
+
// This will tie them together and makes positioning the aside easier
|
|
17
|
+
position: relative;
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
@media screen and (min-width: 961px) {
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
21
|
+
slot[name='appContent'] {
|
|
22
|
+
background-color: transparent;
|
|
28
23
|
}
|
|
29
24
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `.icon-button{border:none;background-color:rgba(0,0,0,0);color:#fff;width:48px;height:48px;display:flex;align-items:center}.icon-button.has-label{width:auto}.icon-button .label{padding:0 8px;white-space:nowrap;font-size:16px}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-icon-button-css.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.icon-button {
|
|
2
|
+
border: none;
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
color: white;
|
|
5
|
+
width: 48px;
|
|
6
|
+
height: 48px;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
&.has-label {
|
|
11
|
+
width: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.label {
|
|
15
|
+
padding: 0 8px;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `.icon{align-items:center;justify-content:center;display:flex;position:relative;height:100%;width:100%;font-variation-settings:"wght" 400,"opsz" 24;transition:font-variation-settings .2s cubic-bezier(0.2, 0, 0, 1);border-radius:16px;font-family:"Material Symbols Outlined";font-size:24px;line-height:1;direction:ltr;-webkit-font-smoothing:antialiased}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-navigation-icon-css.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.icon {
|
|
2
|
+
align-items: center;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
display: flex;
|
|
5
|
+
position: relative;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
font-variation-settings:
|
|
9
|
+
'wght' 400,
|
|
10
|
+
'opsz' 24;
|
|
11
|
+
transition: font-variation-settings 0.2s cubic-bezier(0.2, 0, 0, 1);
|
|
12
|
+
border-radius: 16px;
|
|
13
|
+
font-family: 'Material Symbols Outlined';
|
|
14
|
+
font-size: 24px;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
direction: ltr;
|
|
17
|
+
-webkit-font-smoothing: antialiased;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
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:
|
|
2
|
+
export const style = css `:host{--_exm-navigation-rail-background-color: var( --exm-navigation-rail-background-color, var(--md-sys-color-surface-container) );--_exm-navigation-rail-width: var(--exm-navigation-rail-nav-width, 88px);display:flex;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;width:var(--_exm-navigation-rail-width)}@media screen and (min-width: 961px){:host{display:flex}}nav{flex:1}nav ul{list-style:none;padding:0;margin:0}nav li{padding:0;margin:0}.bottom{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-end}`;
|
|
3
3
|
export default style;
|
|
4
4
|
//# sourceMappingURL=exm-navigation-rail-css.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
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:
|
|
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) );--_exm-navigation-rail-nav-item-width: var(--exm-navigation-rail-nav-item-width, 80px);display:flex;flex-direction:column;width:var(--_exm-navigation-rail-nav-item-width);margin:-2px 0 14px;padding:2px 0;vertical-align:baseline;align-items:center;cursor:pointer;width:100%}button{position:relative;background:none;border:none;color:var(--_exm-navigation-rail-nav-item-color)}button:focus{outline:none}.symbols{display:flex;position:relative;align-items:center;justify-content:center;width:56px;height:32px;margin:0 auto 4px;transition:font-variation-settings .2s cubic-bezier(0.2, 0, 0, 1);border-radius:16px;color:var(--_exm-navigation-rail-nav-item-icon-color)}.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}: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
3
|
export default style;
|
|
4
4
|
//# sourceMappingURL=exm-navigation-rail-nav-item-css.js.map
|