@exmg/exm-navigation 1.0.2 → 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.
Files changed (93) hide show
  1. package/index.d.ts +11 -15
  2. package/index.js +11 -15
  3. package/package.json +11 -10
  4. package/src/exm-navigation-base.d.ts +94 -19
  5. package/src/exm-navigation-base.js +288 -58
  6. package/src/exm-navigation-drawer-base.d.ts +8 -23
  7. package/src/exm-navigation-drawer-base.js +25 -149
  8. package/src/exm-navigation-drawer-menu-base.d.ts +12 -0
  9. package/src/exm-navigation-drawer-menu-base.js +45 -0
  10. package/src/exm-navigation-drawer-menu.d.ts +9 -0
  11. package/src/exm-navigation-drawer-menu.js +12 -0
  12. package/src/exm-navigation-drawer-nav-item-base.d.ts +14 -0
  13. package/src/exm-navigation-drawer-nav-item-base.js +45 -0
  14. package/src/exm-navigation-drawer-nav-item.d.ts +8 -0
  15. package/src/exm-navigation-drawer-nav-item.js +10 -0
  16. package/src/exm-navigation-drawer.d.ts +0 -1
  17. package/src/exm-navigation-drawer.js +0 -2
  18. package/src/exm-navigation-icon-base.d.ts +7 -0
  19. package/src/exm-navigation-icon-base.js +20 -0
  20. package/src/exm-navigation-icon-button-base.d.ts +9 -0
  21. package/src/exm-navigation-icon-button-base.js +34 -0
  22. package/src/exm-navigation-icon-button.d.ts +8 -0
  23. package/src/exm-navigation-icon-button.js +10 -0
  24. package/src/exm-navigation-icon.d.ts +8 -0
  25. package/src/exm-navigation-icon.js +10 -0
  26. package/src/exm-navigation-menu-button-base.d.ts +7 -0
  27. package/src/exm-navigation-menu-button.d.ts +9 -0
  28. package/src/exm-navigation-rail-base.d.ts +8 -0
  29. package/src/exm-navigation-rail-base.js +46 -1
  30. package/src/exm-navigation-rail-nav-item-base.d.ts +2 -4
  31. package/src/exm-navigation-rail-nav-item-base.js +7 -39
  32. package/src/exm-navigation-rail-nav-item.d.ts +0 -1
  33. package/src/exm-navigation-rail-nav-item.js +0 -2
  34. package/src/exm-navigation-rail.d.ts +0 -1
  35. package/src/exm-navigation-rail.js +0 -2
  36. package/src/exm-navigation-signals.d.ts +1 -8
  37. package/src/exm-navigation-sub-menu-base.d.ts +17 -0
  38. package/src/exm-navigation-sub-menu-base.js +88 -0
  39. package/src/exm-navigation-sub-menu.d.ts +8 -0
  40. package/src/exm-navigation-sub-menu.js +10 -0
  41. package/src/exm-navigation-topbar-base.d.ts +10 -0
  42. package/src/exm-navigation-topbar-base.js +33 -0
  43. package/src/exm-navigation-topbar.d.ts +8 -0
  44. package/src/exm-navigation-topbar.js +10 -0
  45. package/src/exm-navigation.d.ts +8 -0
  46. package/src/exm-navigation.js +10 -0
  47. package/src/mediaQueries.d.ts +7 -0
  48. package/src/mixins/media-queries.d.ts +7 -0
  49. package/src/mixins/media-queries.js +45 -0
  50. package/src/styles/exm-navigate-drawer-nav-item-css.js +4 -0
  51. package/src/styles/exm-navigation-css.js +4 -0
  52. package/src/styles/exm-navigation-drawer-css.js +1 -1
  53. package/src/styles/exm-navigation-drawer-nav-item-css.js +4 -0
  54. package/src/styles/{exm-navigation-styles.scss → exm-navigation-drawer-nav-item.scss} +11 -21
  55. package/src/styles/exm-navigation-drawer.scss +14 -19
  56. package/src/styles/exm-navigation-icon-button-css.d.ts +2 -0
  57. package/src/styles/exm-navigation-icon-button-css.js +4 -0
  58. package/src/styles/exm-navigation-icon-button.scss +19 -0
  59. package/src/styles/exm-navigation-icon-css.d.ts +2 -0
  60. package/src/styles/exm-navigation-icon-css.js +4 -0
  61. package/src/styles/exm-navigation-icon.scss +18 -0
  62. package/src/styles/exm-navigation-rail-css.js +1 -1
  63. package/src/styles/exm-navigation-rail-nav-item-css.js +1 -1
  64. package/src/styles/exm-navigation-rail-nav-item.scss +14 -29
  65. package/src/styles/exm-navigation-rail.scss +14 -5
  66. package/src/styles/exm-navigation-sub-menu-css.d.ts +2 -0
  67. package/src/styles/exm-navigation-sub-menu-css.js +4 -0
  68. package/src/styles/exm-navigation-sub-menu.scss +34 -0
  69. package/src/styles/exm-navigation-topbar-css.d.ts +2 -0
  70. package/src/styles/exm-navigation-topbar-css.js +4 -0
  71. package/src/styles/exm-navigation-topbar.scss +27 -0
  72. package/src/styles/exm-navigation.scss +52 -0
  73. package/src/types.d.ts +8 -0
  74. package/src/types.js +2 -0
  75. package/src/exm-navigation-drawer-nav.d.ts +0 -9
  76. package/src/exm-navigation-drawer-nav.js +0 -47
  77. package/src/exm-navigation-rail-nav-base.d.ts +0 -4
  78. package/src/exm-navigation-rail-nav-base.js +0 -9
  79. package/src/exm-navigation-rail-nav.d.ts +0 -9
  80. package/src/exm-navigation-rail-nav.js +0 -12
  81. package/src/exm-navigation-signals.js +0 -11
  82. package/src/exm-navigation-toolbar-base.d.ts +0 -8
  83. package/src/exm-navigation-toolbar-base.js +0 -33
  84. package/src/exm-navigation-toolbar.d.ts +0 -9
  85. package/src/exm-navigation-toolbar.js +0 -12
  86. package/src/styles/exm-navigation-rail-nav-css.js +0 -4
  87. package/src/styles/exm-navigation-rail-nav.scss +0 -7
  88. package/src/styles/exm-navigation-styles-css.js +0 -4
  89. package/src/styles/exm-navigation-toolbar-css.js +0 -4
  90. package/src/styles/exm-navigation-toolbar.scss +0 -18
  91. /package/src/styles/{exm-navigation-rail-nav-css.d.ts → exm-navigate-drawer-nav-item-css.d.ts} +0 -0
  92. /package/src/styles/{exm-navigation-styles-css.d.ts → exm-navigation-css.d.ts} +0 -0
  93. /package/src/styles/{exm-navigation-toolbar-css.d.ts → exm-navigation-drawer-nav-item-css.d.ts} +0 -0
@@ -1,173 +1,49 @@
1
1
  import { __decorate } from "tslib";
2
- import { LitElement, html } from 'lit';
2
+ import { html } from 'lit';
3
3
  import { property, query } from 'lit/decorators.js';
4
+ import { ExmgElement } from '@exmg/lit-base';
5
+ import { style } from './styles/exm-navigation-drawer-css.js';
4
6
  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 ExmNavigationDrawerBase 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
- }
7
+ export class ExmNavigationDrawerBase extends ExmgElement {
40
8
  constructor() {
41
- super();
9
+ super(...arguments);
42
10
  this.open = false;
43
11
  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
12
  }
88
- _hoverIn() {
89
- navigationDrawerHover.value = true;
13
+ handleMouseEnter() {
14
+ this.fire('drawer-mouseenter');
90
15
  }
91
- _hoverOut() {
92
- navigationDrawerHover.value = false;
16
+ handleMouseLeave() {
17
+ this.fire('drawer-mouseleave');
93
18
  }
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
- }
19
+ handleDrawerClose() {
20
+ this.fire('drawer-mouseleave');
118
21
  }
119
22
  async firstUpdated() {
23
+ var _a;
120
24
  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
- }
25
+ if ((_a = this.drawer) === null || _a === void 0 ? void 0 : _a.shadowRoot) {
26
+ const asideElement = this.drawer.shadowRoot.querySelector('aside');
27
+ if (asideElement) {
28
+ // Add event listeners to the aside element
29
+ asideElement.addEventListener('mouseenter', this.handleMouseEnter.bind(this));
30
+ asideElement.addEventListener('mouseleave', this.handleMouseLeave.bind(this));
144
31
  }
145
32
  }
146
- this.addEventListener('drawer-close', this.handleClose);
33
+ this.addEventListener('drawer-close', this.handleDrawerClose.bind(this));
147
34
  }
148
35
  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>`;
36
+ return html `<mwc-drawer type="dismissible" ?open=${this.open}><slot></slot></mwc-drawer>`;
155
37
  }
156
38
  }
39
+ ExmNavigationDrawerBase.styles = [style];
157
40
  __decorate([
158
- property({ type: Boolean }),
159
- observer(function (value) {
160
- navigationDrawerOpen.value = value;
161
- this.updateInlineStyles();
162
- })
41
+ property({ type: Boolean })
163
42
  ], ExmNavigationDrawerBase.prototype, "open", void 0);
43
+ __decorate([
44
+ property({ type: Boolean })
45
+ ], ExmNavigationDrawerBase.prototype, "persistent", void 0);
164
46
  __decorate([
165
47
  query('mwc-drawer')
166
48
  ], ExmNavigationDrawerBase.prototype, "drawer", void 0);
167
- __decorate([
168
- property({ type: Boolean }),
169
- observer(function (value) {
170
- navigationDrawerPersistent.value = value;
171
- })
172
- ], ExmNavigationDrawerBase.prototype, "persistent", void 0);
173
49
  //# sourceMappingURL=exm-navigation-drawer-base.js.map
@@ -0,0 +1,12 @@
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
+ import { MenuItem } from './types.js';
3
+ import './exm-navigation-rail-nav-item.js';
4
+ import './exm-navigation-drawer-nav-item.js';
5
+ import '@material/web/list/list.js';
6
+ import '@exmg/exm-collapsed/exm-collapsed.js';
7
+ export declare class ExmNavigationDrawerMenuBase extends ExmgElement {
8
+ items: MenuItem[];
9
+ path: string[];
10
+ private handleDrawerMenuItemClick;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ }
@@ -0,0 +1,45 @@
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 { repeat } from 'lit/directives/repeat.js';
6
+ import './exm-navigation-rail-nav-item.js';
7
+ import './exm-navigation-drawer-nav-item.js';
8
+ import '@material/web/list/list.js';
9
+ import '@exmg/exm-collapsed/exm-collapsed.js';
10
+ export class ExmNavigationDrawerMenuBase extends ExmgElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.items = [];
14
+ this.path = [];
15
+ }
16
+ handleDrawerMenuItemClick(path) {
17
+ this.fire('drawer-menu-item-click', path);
18
+ }
19
+ render() {
20
+ return html `<div class="top"><slot name="top"></slot></div>
21
+ <nav class="nav">
22
+ <md-list>
23
+ ${repeat(this.items || [], ({ id }) => id, (item) => html `
24
+ <exm-navigation-drawer-nav-item
25
+ type="button"
26
+ @click=${this.handleDrawerMenuItemClick.bind(this, item.id)}
27
+ ?has-submenu=${(item.items || []).length > 0}
28
+ ?selected=${item.id === this.path[0]}
29
+ icon=${item.icon || ''}
30
+ >
31
+ ${item.label}
32
+ </exm-navigation-drawer-nav-item>
33
+ `)}
34
+ </md-list>
35
+ </nav>
36
+ <div class="bottom"><slot name="bottom"></slot></div>`;
37
+ }
38
+ }
39
+ __decorate([
40
+ property({ type: Array })
41
+ ], ExmNavigationDrawerMenuBase.prototype, "items", void 0);
42
+ __decorate([
43
+ property({ type: Array })
44
+ ], ExmNavigationDrawerMenuBase.prototype, "path", void 0);
45
+ //# sourceMappingURL=exm-navigation-drawer-menu-base.js.map
@@ -0,0 +1,9 @@
1
+ import { ExmNavigationDrawerMenuBase } from './exm-navigation-drawer-menu-base.js';
2
+ export declare class ExmNavigationDrawerMenu extends ExmNavigationDrawerMenuBase {
3
+ static styles: import("lit").CSSResult[];
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'exm-navigation-drawer-menu': ExmNavigationDrawerMenu;
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement } from 'lit/decorators/custom-element.js';
3
+ import { ExmNavigationDrawerMenuBase } from './exm-navigation-drawer-menu-base.js';
4
+ import { style } from './styles/exm-navigation-sub-menu-css.js';
5
+ let ExmNavigationDrawerMenu = class ExmNavigationDrawerMenu extends ExmNavigationDrawerMenuBase {
6
+ };
7
+ ExmNavigationDrawerMenu.styles = [style];
8
+ ExmNavigationDrawerMenu = __decorate([
9
+ customElement('exm-navigation-drawer-menu')
10
+ ], ExmNavigationDrawerMenu);
11
+ export { ExmNavigationDrawerMenu };
12
+ //# sourceMappingURL=exm-navigation-drawer-menu.js.map
@@ -0,0 +1,14 @@
1
+ import { LitElement } from 'lit';
2
+ import '@material/web/focus/md-focus-ring.js';
3
+ import './exm-navigation-icon.js';
4
+ import '@material/web/list/list.js';
5
+ import '@material/web/list/list-item.js';
6
+ export declare class ExmNavigationDrawerNavItemBase extends LitElement {
7
+ icon: string;
8
+ itemId?: string;
9
+ selected: boolean;
10
+ hasSubmenu: boolean;
11
+ submenuIcon: string;
12
+ static styles: import("lit").CSSResult[];
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ }
@@ -0,0 +1,45 @@
1
+ import { __decorate } from "tslib";
2
+ import { LitElement, html, nothing } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { style } from './styles/exm-navigation-drawer-nav-item-css.js';
5
+ import '@material/web/focus/md-focus-ring.js';
6
+ import './exm-navigation-icon.js';
7
+ import '@material/web/list/list.js';
8
+ import '@material/web/list/list-item.js';
9
+ export class ExmNavigationDrawerNavItemBase extends LitElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.icon = '';
13
+ this.selected = false;
14
+ this.hasSubmenu = false;
15
+ this.submenuIcon = 'arrow_forward';
16
+ }
17
+ render() {
18
+ return html `<md-list-item type="button" ?selected=${this.selected}>
19
+ ${this.icon
20
+ ? html `<exm-navigation-icon slot="start" class="item-icon" icon=${this.icon}></exm-navigation-icon>`
21
+ : nothing}
22
+ <div class="label"><slot></slot></div>
23
+ ${this.hasSubmenu
24
+ ? html `<exm-navigation-icon slot="end" class="has-submenu" icon=${this.submenuIcon}></exm-navigation-icon>`
25
+ : nothing}
26
+ </md-list-item>`;
27
+ }
28
+ }
29
+ ExmNavigationDrawerNavItemBase.styles = [style];
30
+ __decorate([
31
+ property({ type: String })
32
+ ], ExmNavigationDrawerNavItemBase.prototype, "icon", void 0);
33
+ __decorate([
34
+ property({ type: String })
35
+ ], ExmNavigationDrawerNavItemBase.prototype, "itemId", void 0);
36
+ __decorate([
37
+ property({ type: Boolean, reflect: true })
38
+ ], ExmNavigationDrawerNavItemBase.prototype, "selected", void 0);
39
+ __decorate([
40
+ property({ type: Boolean, attribute: 'has-submenu' })
41
+ ], ExmNavigationDrawerNavItemBase.prototype, "hasSubmenu", void 0);
42
+ __decorate([
43
+ property({ type: String, attribute: 'submenu-icon' })
44
+ ], ExmNavigationDrawerNavItemBase.prototype, "submenuIcon", void 0);
45
+ //# sourceMappingURL=exm-navigation-drawer-nav-item-base.js.map
@@ -0,0 +1,8 @@
1
+ import { ExmNavigationDrawerNavItemBase } from './exm-navigation-drawer-nav-item-base.js';
2
+ export declare class ExmNavigationDrawerNavItem extends ExmNavigationDrawerNavItemBase {
3
+ }
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'exm-navigation-drawer-nav-item': ExmNavigationDrawerNavItem;
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement } from 'lit/decorators.js';
3
+ import { ExmNavigationDrawerNavItemBase } from './exm-navigation-drawer-nav-item-base.js';
4
+ let ExmNavigationDrawerNavItem = class ExmNavigationDrawerNavItem extends ExmNavigationDrawerNavItemBase {
5
+ };
6
+ ExmNavigationDrawerNavItem = __decorate([
7
+ customElement('exm-navigation-drawer-nav-item')
8
+ ], ExmNavigationDrawerNavItem);
9
+ export { ExmNavigationDrawerNavItem };
10
+ //# sourceMappingURL=exm-navigation-drawer-nav-item.js.map
@@ -1,6 +1,5 @@
1
1
  import { ExmNavigationDrawerBase } from './exm-navigation-drawer-base.js';
2
2
  export declare class ExmNavigationDrawer extends ExmNavigationDrawerBase {
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
3
  import { ExmNavigationDrawerBase } from './exm-navigation-drawer-base.js';
4
- import { style } from './styles/exm-navigation-drawer-css.js';
5
4
  let ExmNavigationDrawer = class ExmNavigationDrawer extends ExmNavigationDrawerBase {
6
5
  };
7
- ExmNavigationDrawer.styles = [style];
8
6
  ExmNavigationDrawer = __decorate([
9
7
  customElement('exm-navigation-drawer')
10
8
  ], ExmNavigationDrawer);
@@ -0,0 +1,7 @@
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
+ import './styles/exm-navigation-icon-css.js';
3
+ export declare class ExmNavigationIconBase extends ExmgElement {
4
+ icon: string;
5
+ static styles: import("lit").CSSResult[];
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ }
@@ -0,0 +1,20 @@
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-icon-css.js';
6
+ import './styles/exm-navigation-icon-css.js';
7
+ export class ExmNavigationIconBase extends ExmgElement {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.icon = 'menu';
11
+ }
12
+ render() {
13
+ return html `<span class="icon">${this.icon}</span>`;
14
+ }
15
+ }
16
+ ExmNavigationIconBase.styles = [style];
17
+ __decorate([
18
+ property({ type: String })
19
+ ], ExmNavigationIconBase.prototype, "icon", void 0);
20
+ //# sourceMappingURL=exm-navigation-icon-base.js.map
@@ -0,0 +1,9 @@
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
+ import './exm-navigation-icon.js';
3
+ export declare class ExmNavigationIconButtonBase extends ExmgElement {
4
+ icon: string;
5
+ label: string;
6
+ static styles: import("lit").CSSResult[];
7
+ private handleMenuButtonClick;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ }
@@ -0,0 +1,34 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, nothing } from 'lit';
3
+ import { ExmgElement } from '@exmg/lit-base/index.js';
4
+ import { property } from 'lit/decorators.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
6
+ import { style } from './styles/exm-navigation-icon-button-css.js';
7
+ import './exm-navigation-icon.js';
8
+ export class ExmNavigationIconButtonBase extends ExmgElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.icon = 'menu';
12
+ this.label = '';
13
+ }
14
+ handleMenuButtonClick(itemId) {
15
+ this.fire('navigation-icon-button-click', itemId);
16
+ }
17
+ render() {
18
+ const buttonClass = { 'has-label': !!this.label };
19
+ return html `
20
+ <button class="icon-button ${classMap(buttonClass)}" @click=${this.handleMenuButtonClick}>
21
+ <exm-navigation-icon icon=${this.icon}></exm-navigation-icon>
22
+ ${this.label ? html ` <span class="label">${this.label}</span>` : nothing}
23
+ </button>
24
+ `;
25
+ }
26
+ }
27
+ ExmNavigationIconButtonBase.styles = [style];
28
+ __decorate([
29
+ property({ type: String })
30
+ ], ExmNavigationIconButtonBase.prototype, "icon", void 0);
31
+ __decorate([
32
+ property({ type: String })
33
+ ], ExmNavigationIconButtonBase.prototype, "label", void 0);
34
+ //# sourceMappingURL=exm-navigation-icon-button-base.js.map
@@ -0,0 +1,8 @@
1
+ import { ExmNavigationIconButtonBase } from './exm-navigation-icon-button-base.js';
2
+ export declare class ExmNavigationIconButton extends ExmNavigationIconButtonBase {
3
+ }
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'exm-navigation-icon-button': ExmNavigationIconButton;
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement } from 'lit/decorators/custom-element.js';
3
+ import { ExmNavigationIconButtonBase } from './exm-navigation-icon-button-base.js';
4
+ let ExmNavigationIconButton = class ExmNavigationIconButton extends ExmNavigationIconButtonBase {
5
+ };
6
+ ExmNavigationIconButton = __decorate([
7
+ customElement('exm-navigation-icon-button')
8
+ ], ExmNavigationIconButton);
9
+ export { ExmNavigationIconButton };
10
+ //# sourceMappingURL=exm-navigation-icon-button.js.map
@@ -0,0 +1,8 @@
1
+ import { ExmNavigationIconBase } from './exm-navigation-icon-base.js';
2
+ export declare class ExmNavigationIcon extends ExmNavigationIconBase {
3
+ }
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'exm-navigation-icon': ExmNavigationIcon;
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement } from 'lit/decorators/custom-element.js';
3
+ import { ExmNavigationIconBase } from './exm-navigation-icon-base.js';
4
+ let ExmNavigationIcon = class ExmNavigationIcon extends ExmNavigationIconBase {
5
+ };
6
+ ExmNavigationIcon = __decorate([
7
+ customElement('exm-navigation-icon')
8
+ ], ExmNavigationIcon);
9
+ export { ExmNavigationIcon };
10
+ //# sourceMappingURL=exm-navigation-icon.js.map
@@ -0,0 +1,7 @@
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
+ import './exm-navigation-rail-nav-item.js';
3
+ export declare class ExmNavigationMenuButtonBase extends ExmgElement {
4
+ open: boolean;
5
+ handleMenuButtonClick(itemId: string): void;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { ExmNavigationMenuButtonBase } from './exm-navigation-menu-button-base.js';
2
+ export declare class ExmNavigationMenuButton extends ExmNavigationMenuButtonBase {
3
+ static styles: import("lit").CSSResult[];
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'exm-navigation-menu-button': ExmNavigationMenuButton;
8
+ }
9
+ }
@@ -1,4 +1,12 @@
1
1
  import { ExmgElement } from '@exmg/lit-base/index.js';
2
+ import { MenuItem } from './types.js';
3
+ import './exm-navigation-rail-nav-item.js';
2
4
  export declare class ExmNavigationRailBase extends ExmgElement {
5
+ items: MenuItem[];
6
+ selected: string[];
7
+ static styles: import("lit").CSSResult[];
8
+ private handleRailClick;
9
+ private handleRailMouseEnter;
10
+ private handleRailMouseLeave;
3
11
  render(): import("lit-html").TemplateResult<1>;
4
12
  }
@@ -1,10 +1,55 @@
1
+ import { __decorate } from "tslib";
1
2
  import { html } from 'lit';
2
3
  import { ExmgElement } from '@exmg/lit-base/index.js';
4
+ import { property } from 'lit/decorators.js';
5
+ import { repeat } from 'lit/directives/repeat.js';
6
+ import { style } from './styles/exm-navigation-rail-css.js';
7
+ import './exm-navigation-rail-nav-item.js';
3
8
  export class ExmNavigationRailBase extends ExmgElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.items = [];
12
+ this.selected = [];
13
+ }
14
+ handleRailClick(itemId) {
15
+ this.fire('rail-item-click', itemId);
16
+ }
17
+ handleRailMouseEnter(itemId) {
18
+ this.fire('rail-item-mouseenter', itemId);
19
+ }
20
+ handleRailMouseLeave(itemId) {
21
+ this.fire('rail-item-mouseleave', itemId);
22
+ }
4
23
  render() {
5
24
  return html `<div class="top"><slot name="top"></slot></div>
6
- <div class="nav"><slot></slot></div>
25
+ <nav class="nav">
26
+ <ul>
27
+ ${repeat(this.items, (item) => {
28
+ return html `
29
+ <li>
30
+ <exm-navigation-rail-nav-item
31
+ @click=${() => this.handleRailClick(item.id)}
32
+ @mouseenter=${() => this.handleRailMouseEnter(item.id)}
33
+ @mouseleave=${() => this.handleRailMouseLeave(item.id)}
34
+ label=${item.label}
35
+ icon=${item.icon || ''}
36
+ ?hasSubMenu=${(item.items || []).length > 0}
37
+ itemId=${item.id}
38
+ .selected=${this.selected[0] === item.id}
39
+ ></exm-navigation-rail-nav-item>
40
+ </li>
41
+ `;
42
+ })}
43
+ </ul>
44
+ </nav>
7
45
  <div class="bottom"><slot name="bottom"></slot></div>`;
8
46
  }
9
47
  }
48
+ ExmNavigationRailBase.styles = [style];
49
+ __decorate([
50
+ property({ type: Array })
51
+ ], ExmNavigationRailBase.prototype, "items", void 0);
52
+ __decorate([
53
+ property({ type: Array })
54
+ ], ExmNavigationRailBase.prototype, "selected", void 0);
10
55
  //# sourceMappingURL=exm-navigation-rail-base.js.map
@@ -1,14 +1,12 @@
1
1
  import { LitElement } from 'lit';
2
2
  import '@material/web/focus/md-focus-ring.js';
3
+ import './exm-navigation-icon.js';
3
4
  export declare class ExmNavigationRailNavItemBase extends LitElement {
4
5
  icon: string;
5
6
  itemId?: string;
6
7
  label?: string;
7
8
  selected: boolean;
8
9
  hasSubMenu: boolean;
9
- constructor();
10
- deselectOtherOptions(id: string): void;
11
- hoverIn(): void;
12
- hoverOut(): void;
10
+ static styles: import("lit").CSSResult[];
13
11
  render(): import("lit-html").TemplateResult<1>;
14
12
  }