@exmg/exm-navigation 1.1.2 → 1.1.4
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/package.json +3 -2
- package/src/exm-navigation-base.d.ts +32 -10
- package/src/exm-navigation-base.js +127 -87
- package/src/exm-navigation-sub-menu-base.d.ts +5 -0
- package/src/exm-navigation-sub-menu-base.js +58 -10
- package/src/exm-navigation-topbar-base.js +3 -4
- package/src/mixins/media-queries.d.ts +1 -0
- package/src/mixins/media-queries.js +14 -1
- package/src/styles/exm-navigation-css.js +5 -1
- package/src/styles/exm-navigation-drawer-nav-item-css.js +17 -2
- package/src/styles/exm-navigation-sub-menu-css.js +11 -4
- package/src/styles/exm-navigation-topbar-css.js +1 -1
- 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-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-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-toolbar-css.d.ts +0 -2
- package/src/styles/exm-navigation-toolbar-css.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-navigation",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@exmg/lit-base": "^3.0.0",
|
|
22
|
+
"@lit-labs/motion": "^1.0.7",
|
|
22
23
|
"@material/mwc-drawer": "^0.27.0",
|
|
23
24
|
"@material/mwc-top-app-bar-fixed": "^0.27.0",
|
|
24
25
|
"@material/web": "^2.2.0",
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b7a2332237126f8df4b270b2685a45265c684cc0"
|
|
55
56
|
}
|
|
@@ -10,6 +10,7 @@ import './exm-navigation-drawer-menu.js';
|
|
|
10
10
|
import './exm-navigation-drawer.js';
|
|
11
11
|
declare const ExmNavigationBase_base: (new (...args: any[]) => {
|
|
12
12
|
media: "mobile" | "tablet" | "desktop";
|
|
13
|
+
touch: boolean;
|
|
13
14
|
}) & typeof ExmgElement;
|
|
14
15
|
export declare class ExmNavigationBase extends ExmNavigationBase_base {
|
|
15
16
|
items: MenuItem[];
|
|
@@ -18,32 +19,46 @@ export declare class ExmNavigationBase extends ExmNavigationBase_base {
|
|
|
18
19
|
disableNavigate: boolean;
|
|
19
20
|
drawer?: ExmNavigationDrawer;
|
|
20
21
|
navContent?: HTMLDivElement;
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The menu item triggered by hovering and entering submenu's
|
|
24
|
+
* Once an item with endpoint is clicked, this value should be written to activeItem
|
|
25
|
+
*/
|
|
22
26
|
selectedItem: string[];
|
|
27
|
+
/**
|
|
28
|
+
* The currently active menu item
|
|
29
|
+
*/
|
|
23
30
|
activeItem: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Wether or not the rail should be visible yes or no
|
|
33
|
+
*/
|
|
24
34
|
railOpen: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Wether or not the drawer should be visible yes or no
|
|
37
|
+
*/
|
|
25
38
|
drawerOpen: boolean;
|
|
26
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Object with menuitem and a bool for having that path sub items yes or no
|
|
41
|
+
*/
|
|
27
42
|
navigationHasSubmenu: Record<string, boolean>;
|
|
28
43
|
static styles: import("lit").CSSResult[];
|
|
29
|
-
menu: MenuItem[];
|
|
30
|
-
expandedItems: {
|
|
31
|
-
[k: string]: boolean;
|
|
32
|
-
};
|
|
33
|
-
unSubscribeSelected: () => void;
|
|
34
44
|
protected updated(changedProperties: PropertyValues): void;
|
|
35
45
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
36
46
|
connectedCallback(): void;
|
|
37
47
|
/**
|
|
38
48
|
* Set the correct values when the media changes.
|
|
39
49
|
*/
|
|
40
|
-
handleMediaTypeChange
|
|
50
|
+
private handleMediaTypeChange;
|
|
41
51
|
private getPathEndpoint;
|
|
42
|
-
loadPage
|
|
52
|
+
private loadPage;
|
|
53
|
+
/**
|
|
54
|
+
* Handles the drawer state. If it should be open yes or no.
|
|
55
|
+
* @param param0
|
|
56
|
+
*/
|
|
57
|
+
handleDrawerOpen({ mobileForce, tabletForce }?: Record<string, boolean>): void;
|
|
43
58
|
/**
|
|
44
59
|
* Handle Rail item click or Drawer sub menu click.
|
|
45
60
|
* If the selected menu item has children, we add the first item to the list (as per Google implementation).
|
|
46
|
-
* In this case we also do not close the drawer in non
|
|
61
|
+
* In this case we also do not close the drawer in non desktop mode, so the user is able to select a next level in the menu
|
|
47
62
|
*/
|
|
48
63
|
private handleRailItemClick;
|
|
49
64
|
/**
|
|
@@ -102,6 +117,13 @@ export declare class ExmNavigationBase extends ExmNavigationBase_base {
|
|
|
102
117
|
* Render the topbar. This is displayed on mobile and contains the menu button and a slot for the title
|
|
103
118
|
*/
|
|
104
119
|
private renderTopbar;
|
|
120
|
+
/**
|
|
121
|
+
* If there is an active item, and that item has children, the width of the drawer should be set for desktop.
|
|
122
|
+
* This will push the content to the right.
|
|
123
|
+
*
|
|
124
|
+
* @returns the width of the drawer area
|
|
125
|
+
*/
|
|
126
|
+
private getDrawerWidth;
|
|
105
127
|
render(): import("lit-html").TemplateResult<1>;
|
|
106
128
|
}
|
|
107
129
|
export {};
|
|
@@ -20,16 +20,27 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
20
20
|
this.path = ['chat'];
|
|
21
21
|
this.drawerWidth = 319;
|
|
22
22
|
this.disableNavigate = false;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The menu item triggered by hovering and entering submenu's
|
|
25
|
+
* Once an item with endpoint is clicked, this value should be written to activeItem
|
|
26
|
+
*/
|
|
24
27
|
this.selectedItem = [];
|
|
28
|
+
/**
|
|
29
|
+
* The currently active menu item
|
|
30
|
+
*/
|
|
25
31
|
this.activeItem = [];
|
|
32
|
+
/**
|
|
33
|
+
* Wether or not the rail should be visible yes or no
|
|
34
|
+
*/
|
|
26
35
|
this.railOpen = true;
|
|
36
|
+
/**
|
|
37
|
+
* Wether or not the drawer should be visible yes or no
|
|
38
|
+
*/
|
|
27
39
|
this.drawerOpen = false;
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Object with menuitem and a bool for having that path sub items yes or no
|
|
42
|
+
*/
|
|
29
43
|
this.navigationHasSubmenu = {};
|
|
30
|
-
this.menu = [];
|
|
31
|
-
this.expandedItems = {};
|
|
32
|
-
this.unSubscribeSelected = () => { };
|
|
33
44
|
}
|
|
34
45
|
updated(changedProperties) {
|
|
35
46
|
if (changedProperties.has('media')) {
|
|
@@ -39,7 +50,7 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
39
50
|
for (const item of this.items) {
|
|
40
51
|
this.navigationHasSubmenu[item.id] = (item.items || []).length > 0;
|
|
41
52
|
}
|
|
42
|
-
if (this.navigationHasSubmenu[this.path[0]] && this.
|
|
53
|
+
if (this.navigationHasSubmenu[this.path[0]] && this.media === 'desktop') {
|
|
43
54
|
this.drawerOpen = true;
|
|
44
55
|
}
|
|
45
56
|
}
|
|
@@ -58,8 +69,7 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
58
69
|
* Set the correct values when the media changes.
|
|
59
70
|
*/
|
|
60
71
|
handleMediaTypeChange() {
|
|
61
|
-
this.
|
|
62
|
-
this.drawerOpen = this.media === 'desktop' && this.navigationHasSubmenu[this.selectedItem[0]];
|
|
72
|
+
this.drawerOpen = this.media === 'desktop' && this.navigationHasSubmenu[this.activeItem[0]];
|
|
63
73
|
this.railOpen = this.media !== 'mobile';
|
|
64
74
|
}
|
|
65
75
|
getPathEndpoint() {
|
|
@@ -68,7 +78,7 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
68
78
|
const checkItems = (path, last) => {
|
|
69
79
|
const item = items.find((item) => item.id === path);
|
|
70
80
|
if (last) {
|
|
71
|
-
return
|
|
81
|
+
return item === null || item === void 0 ? void 0 : item.path;
|
|
72
82
|
}
|
|
73
83
|
items = (item === null || item === void 0 ? void 0 : item.items) || [];
|
|
74
84
|
return;
|
|
@@ -76,24 +86,58 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
76
86
|
for (let i = 0; i < this.selectedItem.length; i++) {
|
|
77
87
|
result = checkItems(this.selectedItem[i], i === this.selectedItem.length - 1);
|
|
78
88
|
}
|
|
79
|
-
return result
|
|
89
|
+
return result;
|
|
80
90
|
}
|
|
81
91
|
loadPage(path) {
|
|
82
92
|
this.path = path;
|
|
83
|
-
this.
|
|
93
|
+
this.activeItem = path;
|
|
94
|
+
const endPoint = this.getPathEndpoint();
|
|
95
|
+
// If the route does not have a path, skip navigating
|
|
96
|
+
if (!endPoint) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
84
99
|
this.fire('navigation-change', path);
|
|
85
100
|
if (!this.disableNavigate) {
|
|
86
101
|
window.history.pushState({}, '', this.getPathEndpoint());
|
|
102
|
+
window.dispatchEvent(new PopStateEvent('popstate'));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Handles the drawer state. If it should be open yes or no.
|
|
107
|
+
* @param param0
|
|
108
|
+
*/
|
|
109
|
+
handleDrawerOpen({ mobileForce, tabletForce } = {}) {
|
|
110
|
+
if (this.media === 'mobile') {
|
|
111
|
+
// Only triggerable by button
|
|
112
|
+
if (mobileForce) {
|
|
113
|
+
this.drawerOpen = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (this.media === 'tablet') {
|
|
117
|
+
if (tabletForce) {
|
|
118
|
+
this.drawerOpen = false;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.drawerOpen = this.navigationHasSubmenu[this.selectedItem[0]];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (this.media === 'desktop') {
|
|
125
|
+
if (this.navigationHasSubmenu[this.activeItem[0]]) {
|
|
126
|
+
this.drawerOpen = true;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
this.drawerOpen = this.navigationHasSubmenu[this.selectedItem[0]];
|
|
130
|
+
}
|
|
87
131
|
}
|
|
88
132
|
}
|
|
89
133
|
/**
|
|
90
134
|
* Handle Rail item click or Drawer sub menu click.
|
|
91
135
|
* If the selected menu item has children, we add the first item to the list (as per Google implementation).
|
|
92
|
-
* In this case we also do not close the drawer in non
|
|
136
|
+
* In this case we also do not close the drawer in non desktop mode, so the user is able to select a next level in the menu
|
|
93
137
|
*/
|
|
94
138
|
handleRailItemClick({ detail }) {
|
|
95
139
|
var _a;
|
|
96
|
-
if (this.
|
|
140
|
+
if (this.activeItem[0] !== detail || this.media === 'mobile') {
|
|
97
141
|
const items = ((_a = this.items.find((item) => item.id === detail)) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
98
142
|
if (items.length) {
|
|
99
143
|
this.selectedItem = [detail, items[0].id];
|
|
@@ -101,65 +145,32 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
101
145
|
else {
|
|
102
146
|
this.selectedItem = [detail];
|
|
103
147
|
}
|
|
104
|
-
// copy the selected item to the active item
|
|
105
|
-
this.activeItem = this.selectedItem;
|
|
106
|
-
/**
|
|
107
|
-
* If persistent menu close the drawer when a item is clicked and does not has children items
|
|
108
|
-
*/
|
|
109
|
-
if (this.persistent) {
|
|
110
|
-
this.drawerOpen = items.length > 0 || this.navigationHasSubmenu[detail];
|
|
111
|
-
}
|
|
112
|
-
else if (items.length === 0) {
|
|
113
|
-
this.drawerOpen = false;
|
|
114
|
-
}
|
|
115
148
|
this.loadPage(this.selectedItem);
|
|
149
|
+
this.handleDrawerOpen();
|
|
116
150
|
}
|
|
117
151
|
}
|
|
118
152
|
/**
|
|
119
153
|
* Handle the mouse enter of the rail item.
|
|
120
154
|
*/
|
|
121
155
|
handleRailItemMouseEnter({ detail }) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (detail !== this.selectedItem[0]) {
|
|
125
|
-
this.activeItem = [detail];
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else if (this.navigationHasSubmenu[this.selectedItem[0]] && this.persistent) {
|
|
130
|
-
this.activeItem = this.selectedItem;
|
|
131
|
-
this.drawerOpen = true;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
this.activeItem = this.selectedItem;
|
|
135
|
-
this.drawerOpen = false;
|
|
136
|
-
}
|
|
137
|
-
this.activeItem = this.selectedItem;
|
|
156
|
+
this.selectedItem = [detail];
|
|
157
|
+
this.handleDrawerOpen();
|
|
138
158
|
}
|
|
139
159
|
/**
|
|
140
160
|
* Handle the mouse leave of the rail item.
|
|
141
161
|
* If the item has no submenu and the current selected item has no submenu, it is safe to close the drawer
|
|
142
162
|
*/
|
|
143
|
-
handleRailItemMouseLeave({
|
|
144
|
-
if (!this.navigationHasSubmenu[detail] && !this.navigationHasSubmenu[this.selectedItem[0]]) {
|
|
145
|
-
this.drawerOpen = false;
|
|
146
|
-
}
|
|
147
|
-
if (!this.persistent && !this.navigationHasSubmenu[detail]) {
|
|
148
|
-
this.drawerOpen = false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
163
|
+
handleRailItemMouseLeave() { }
|
|
151
164
|
/**
|
|
152
165
|
* Handle drawer mouse leave. Should close the drawer
|
|
153
166
|
*/
|
|
154
167
|
handleDrawerMouseLeave() {
|
|
155
|
-
if (!this.navigationHasSubmenu[this.selectedItem[0]] || !this.persistent) {
|
|
156
|
-
this.drawerOpen = false;
|
|
157
|
-
}
|
|
158
168
|
/**
|
|
159
169
|
* On mouse leave the drawer we want to set the active item to the selected item.
|
|
160
170
|
* If not, it will show the active item on every hover and will make navigating in the selected item impossible
|
|
161
171
|
*/
|
|
162
|
-
this.
|
|
172
|
+
this.selectedItem = this.activeItem;
|
|
173
|
+
this.handleDrawerOpen({ tabletForce: true });
|
|
163
174
|
}
|
|
164
175
|
/**
|
|
165
176
|
* Handle the click on a sub menu item
|
|
@@ -168,11 +179,13 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
168
179
|
*/
|
|
169
180
|
handleSubMenuClick({ detail }) {
|
|
170
181
|
this.selectedItem = detail;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
const endPoint = this.getPathEndpoint();
|
|
183
|
+
let mobileForce = false;
|
|
184
|
+
if (endPoint) {
|
|
185
|
+
this.loadPage(this.selectedItem);
|
|
186
|
+
mobileForce = true;
|
|
174
187
|
}
|
|
175
|
-
this.
|
|
188
|
+
this.handleDrawerOpen({ mobileForce, tabletForce: this.touch });
|
|
176
189
|
}
|
|
177
190
|
/**
|
|
178
191
|
* Handle the topbar menu click.
|
|
@@ -186,7 +199,7 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
186
199
|
* This should reset the active item, so the root-level menu gets triggered
|
|
187
200
|
*/
|
|
188
201
|
handleDrawerBackClick() {
|
|
189
|
-
this.
|
|
202
|
+
this.selectedItem = [];
|
|
190
203
|
}
|
|
191
204
|
/**
|
|
192
205
|
* Check if the passed paths last item has children yes or no
|
|
@@ -208,10 +221,9 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
208
221
|
return !this.railOpen
|
|
209
222
|
? html `
|
|
210
223
|
<section class="drawer-menu-button">
|
|
211
|
-
<
|
|
212
|
-
icon
|
|
213
|
-
|
|
214
|
-
></exm-navigation-icon-button>
|
|
224
|
+
<md-icon-button @click=${this.handleTopbarMenuClick}
|
|
225
|
+
><md-icon>${this.drawerOpen ? 'menu_open' : 'menu'}</md-icon></md-icon-button
|
|
226
|
+
>
|
|
215
227
|
</section>
|
|
216
228
|
`
|
|
217
229
|
: nothing;
|
|
@@ -221,37 +233,60 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
221
233
|
* If more levels deep, show the back button
|
|
222
234
|
*/
|
|
223
235
|
renderStartMenu() {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
236
|
+
if (this.railOpen) {
|
|
237
|
+
return nothing;
|
|
238
|
+
}
|
|
239
|
+
return this.selectedItem.length === 0 ||
|
|
240
|
+
(this.selectedItem.length === 1 && !this.currentSelectedHasChildren(this.selectedItem))
|
|
227
241
|
? html `<exm-navigation-drawer-menu
|
|
228
242
|
.items=${this.items}
|
|
229
243
|
.path=${this.activeItem}
|
|
230
244
|
@drawer-menu-item-click=${this.handleRailItemClick}
|
|
231
245
|
></exm-navigation-drawer-menu>`
|
|
232
|
-
:
|
|
233
|
-
|
|
234
|
-
<
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
`
|
|
242
|
-
: nothing;
|
|
246
|
+
: html `
|
|
247
|
+
<section class="drawer-back-button">
|
|
248
|
+
<exm-navigation-icon-button
|
|
249
|
+
icon="arrow_back"
|
|
250
|
+
label="Main menu"
|
|
251
|
+
@navigation-icon-button-click=${this.handleDrawerBackClick}
|
|
252
|
+
></exm-navigation-icon-button>
|
|
253
|
+
</section>
|
|
254
|
+
`;
|
|
243
255
|
}
|
|
244
256
|
/**
|
|
245
257
|
* return the sub menus. More then 1 level deep
|
|
246
258
|
*/
|
|
247
259
|
renderDrawerSubMenu() {
|
|
260
|
+
/**
|
|
261
|
+
* When the selected item is empty we do not display the submenu on mobile
|
|
262
|
+
*/
|
|
263
|
+
if (this.selectedItem.length === 0 && this.media === 'mobile') {
|
|
264
|
+
return nothing;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Do we have all items of the selectedItem available in the active Item
|
|
268
|
+
*/
|
|
269
|
+
const selectedInActive = this.selectedItem.reduce((_, item, index) => {
|
|
270
|
+
if (item === this.activeItem[index]) {
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
return false;
|
|
274
|
+
}, false);
|
|
275
|
+
/**
|
|
276
|
+
* Determine the data to use for the submenu. This is needed to show the correct selected items in the submenu of the drawer
|
|
277
|
+
* If all selected Items ar in the active item, show the active item
|
|
278
|
+
* If the selected item haas no children, but the drawer is open, show the active item
|
|
279
|
+
* In all the other cases we use the selected item
|
|
280
|
+
*/
|
|
281
|
+
const selected = selectedInActive || (!this.navigationHasSubmenu[this.selectedItem[0]] && this.drawerOpen)
|
|
282
|
+
? this.activeItem
|
|
283
|
+
: this.selectedItem;
|
|
248
284
|
return html `
|
|
249
285
|
<exm-navigation-sub-menu
|
|
250
286
|
.items=${this.items}
|
|
251
|
-
.path=${
|
|
287
|
+
.path=${selected}
|
|
252
288
|
?has-back-button=${!this.railOpen &&
|
|
253
|
-
(
|
|
254
|
-
(this.activeItem.length > 0 && this.currentSelectedHasChildren(this.activeItem)))}
|
|
289
|
+
(selected.length > 1 || (selected.length > 0 && this.currentSelectedHasChildren(selected)))}
|
|
255
290
|
@sub-menu-item-click=${this.handleSubMenuClick}
|
|
256
291
|
></exm-navigation-sub-menu>
|
|
257
292
|
`;
|
|
@@ -262,7 +297,7 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
262
297
|
renderRail() {
|
|
263
298
|
return html `<exm-navigation-rail
|
|
264
299
|
.items=${this.items}
|
|
265
|
-
.selected=${this.
|
|
300
|
+
.selected=${this.activeItem}
|
|
266
301
|
@rail-item-click=${this.handleRailItemClick}
|
|
267
302
|
@rail-item-mouseenter=${this.handleRailItemMouseEnter}
|
|
268
303
|
@rail-item-mouseleave=${this.handleRailItemMouseLeave}
|
|
@@ -280,10 +315,21 @@ export class ExmNavigationBase extends MediaQueries(ExmgElement) {
|
|
|
280
315
|
<slot name="topbar-actions" slot="topbar-actions"></slot>
|
|
281
316
|
</exm-navigation-topbar>`;
|
|
282
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* If there is an active item, and that item has children, the width of the drawer should be set for desktop.
|
|
320
|
+
* This will push the content to the right.
|
|
321
|
+
*
|
|
322
|
+
* @returns the width of the drawer area
|
|
323
|
+
*/
|
|
324
|
+
getDrawerWidth() {
|
|
325
|
+
if (this.media === 'desktop' && this.activeItem.length > 0 && this.navigationHasSubmenu[this.activeItem[0]]) {
|
|
326
|
+
return this.drawerWidth;
|
|
327
|
+
}
|
|
328
|
+
return 0;
|
|
329
|
+
}
|
|
283
330
|
render() {
|
|
284
|
-
var _a;
|
|
285
331
|
const containerStyle = {
|
|
286
|
-
'--exm-drawer-width': `${
|
|
332
|
+
'--exm-drawer-width': `${this.getDrawerWidth()}px`,
|
|
287
333
|
};
|
|
288
334
|
const containerClass = { 'show-topbar': !this.railOpen };
|
|
289
335
|
return html `
|
|
@@ -322,9 +368,6 @@ __decorate([
|
|
|
322
368
|
__decorate([
|
|
323
369
|
query('#navigation-container')
|
|
324
370
|
], ExmNavigationBase.prototype, "navContent", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
state()
|
|
327
|
-
], ExmNavigationBase.prototype, "persistent", void 0);
|
|
328
371
|
__decorate([
|
|
329
372
|
state()
|
|
330
373
|
], ExmNavigationBase.prototype, "selectedItem", void 0);
|
|
@@ -337,9 +380,6 @@ __decorate([
|
|
|
337
380
|
__decorate([
|
|
338
381
|
state()
|
|
339
382
|
], ExmNavigationBase.prototype, "drawerOpen", void 0);
|
|
340
|
-
__decorate([
|
|
341
|
-
state()
|
|
342
|
-
], ExmNavigationBase.prototype, "drawerHover", void 0);
|
|
343
383
|
__decorate([
|
|
344
384
|
state()
|
|
345
385
|
], ExmNavigationBase.prototype, "navigationHasSubmenu", void 0);
|
|
@@ -10,9 +10,14 @@ export declare class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
10
10
|
path: (string | null)[];
|
|
11
11
|
hasBackButton: boolean;
|
|
12
12
|
currentItem?: MenuItem['items'];
|
|
13
|
+
static itemIndex: number;
|
|
14
|
+
navigationElement?: HTMLElement;
|
|
13
15
|
static styles: import("lit").CSSResult[];
|
|
14
16
|
protected updated(changedProperties: PropertyValues): void;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
15
19
|
private handleSubMenuItemClick;
|
|
20
|
+
private getItemStyle;
|
|
16
21
|
private renderSubMenu;
|
|
17
22
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
23
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { ExmgElement } from '@exmg/lit-base/index.js';
|
|
4
|
-
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
5
5
|
import { repeat } from 'lit/directives/repeat.js';
|
|
6
6
|
import { style } from './styles/exm-navigation-sub-menu-css.js';
|
|
7
|
+
import { animate, fadeOut, fadeIn } from '@lit-labs/motion';
|
|
7
8
|
import './exm-navigation-rail-nav-item.js';
|
|
8
9
|
import './exm-navigation-drawer-nav-item.js';
|
|
9
10
|
import '@material/web/list/list.js';
|
|
10
11
|
import '@exmg/exm-collapsed/exm-collapsed.js';
|
|
11
12
|
import { classMap } from 'lit/directives/class-map.js';
|
|
13
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
14
|
export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
13
15
|
constructor() {
|
|
14
16
|
super(...arguments);
|
|
@@ -19,19 +21,43 @@ export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
19
21
|
updated(changedProperties) {
|
|
20
22
|
var _a;
|
|
21
23
|
if (changedProperties.has('path') || changedProperties.has('items')) {
|
|
22
|
-
console.log('updated', this.path);
|
|
23
24
|
this.currentItem = ((_a = this.items.find((item) => item.id === this.path[0])) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
console.log('Conected submenu');
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
console.log('UNConected submenu');
|
|
33
|
+
if (this.navigationElement) {
|
|
34
|
+
this.navigationElement.classList.remove('show');
|
|
35
|
+
}
|
|
36
|
+
super.disconnectedCallback();
|
|
37
|
+
}
|
|
26
38
|
handleSubMenuItemClick(path) {
|
|
27
39
|
this.fire('sub-menu-item-click', path);
|
|
28
40
|
}
|
|
41
|
+
getItemStyle() {
|
|
42
|
+
return {
|
|
43
|
+
'grid-area': `${ExmNavigationSubMenuBase.itemIndex}/1/${ExmNavigationSubMenuBase.itemIndex + 1}/2`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
29
46
|
renderSubMenu(item, path) {
|
|
30
47
|
return html `
|
|
31
48
|
<exm-navigation-drawer-nav-item
|
|
49
|
+
${animate({
|
|
50
|
+
keyframeOptions: {
|
|
51
|
+
duration: 300,
|
|
52
|
+
},
|
|
53
|
+
out: fadeOut,
|
|
54
|
+
in: fadeIn,
|
|
55
|
+
properties: ['opacity'],
|
|
56
|
+
})}
|
|
57
|
+
style=${styleMap(this.getItemStyle())}
|
|
32
58
|
type="button"
|
|
33
59
|
?selected=${this.path.includes(item.id)}
|
|
34
|
-
class="has-submenu"
|
|
60
|
+
class="has-submenu ${this.path.includes(item.id) ? 'selected' : ''}"
|
|
35
61
|
@click=${this.handleSubMenuItemClick.bind(this, [...path])}
|
|
36
62
|
?has-submenu=${true}
|
|
37
63
|
submenu-icon=${this.path.includes(item.id) ? 'expand_less' : 'expand_more'}
|
|
@@ -41,9 +67,12 @@ export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
41
67
|
<div class="sub-menu">
|
|
42
68
|
<md-list>
|
|
43
69
|
<!-- Need to check for multiple items -->
|
|
44
|
-
${(item.items || []).map((subItem) =>
|
|
45
|
-
|
|
70
|
+
${(item.items || []).map((subItem) => {
|
|
71
|
+
ExmNavigationSubMenuBase.itemIndex += 1;
|
|
72
|
+
return (subItem.items || []).length === 0
|
|
73
|
+
? html `
|
|
46
74
|
<exm-navigation-drawer-nav-item
|
|
75
|
+
style=${styleMap(this.getItemStyle())}
|
|
47
76
|
class="collapsed-item"
|
|
48
77
|
?selected=${this.path.includes(subItem.id)}
|
|
49
78
|
@click=${this.handleSubMenuItemClick.bind(this, [...path, subItem.id])}
|
|
@@ -51,7 +80,8 @@ export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
51
80
|
${subItem.label}
|
|
52
81
|
</exm-navigation-drawer-nav-item>
|
|
53
82
|
`
|
|
54
|
-
|
|
83
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]);
|
|
84
|
+
})}
|
|
55
85
|
</md-list>
|
|
56
86
|
</div>
|
|
57
87
|
</exm-collapsed>
|
|
@@ -59,12 +89,25 @@ export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
59
89
|
}
|
|
60
90
|
render() {
|
|
61
91
|
const navClass = { nav: true, 'has-back-button': this.hasBackButton };
|
|
92
|
+
ExmNavigationSubMenuBase.itemIndex = 0;
|
|
62
93
|
return html `<div class="top"><slot name="top"></slot></div>
|
|
63
|
-
<nav class=${classMap(navClass)}>
|
|
94
|
+
<nav id="exm-navigation-sub-menu" class=${classMap(navClass)}>
|
|
64
95
|
<md-list>
|
|
65
|
-
${repeat(this.currentItem || [], ({ id }) => id, (item) =>
|
|
66
|
-
|
|
96
|
+
${repeat(this.currentItem || [], ({ id }) => id, (item) => {
|
|
97
|
+
ExmNavigationSubMenuBase.itemIndex += 1;
|
|
98
|
+
return (item.items || []).length === 0
|
|
99
|
+
? html `
|
|
67
100
|
<exm-navigation-drawer-nav-item
|
|
101
|
+
${animate({
|
|
102
|
+
keyframeOptions: {
|
|
103
|
+
duration: 300,
|
|
104
|
+
},
|
|
105
|
+
stabilizeOut: true,
|
|
106
|
+
out: fadeOut,
|
|
107
|
+
in: fadeIn,
|
|
108
|
+
properties: ['opacity'],
|
|
109
|
+
})}
|
|
110
|
+
style="${styleMap(this.getItemStyle())}"
|
|
68
111
|
type="button"
|
|
69
112
|
?selected=${this.path.includes(item.id)}
|
|
70
113
|
@click=${this.handleSubMenuItemClick.bind(this, [this.path[0] || '', item.id])}
|
|
@@ -72,12 +115,14 @@ export class ExmNavigationSubMenuBase extends ExmgElement {
|
|
|
72
115
|
${item.label}
|
|
73
116
|
</exm-navigation-drawer-nav-item>
|
|
74
117
|
`
|
|
75
|
-
|
|
118
|
+
: this.renderSubMenu(item, [this.path[0] || '', item.id]);
|
|
119
|
+
})}
|
|
76
120
|
</md-list>
|
|
77
121
|
</nav>
|
|
78
122
|
<div class="bottom"><slot name="bottom"></slot></div>`;
|
|
79
123
|
}
|
|
80
124
|
}
|
|
125
|
+
ExmNavigationSubMenuBase.itemIndex = 0;
|
|
81
126
|
ExmNavigationSubMenuBase.styles = [style];
|
|
82
127
|
__decorate([
|
|
83
128
|
property({ type: Array })
|
|
@@ -91,4 +136,7 @@ __decorate([
|
|
|
91
136
|
__decorate([
|
|
92
137
|
state()
|
|
93
138
|
], ExmNavigationSubMenuBase.prototype, "currentItem", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
query('nav')
|
|
141
|
+
], ExmNavigationSubMenuBase.prototype, "navigationElement", void 0);
|
|
94
142
|
//# 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
|
`;
|
|
@@ -5,9 +5,11 @@ export const MediaQueries = (superClass) => {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.media = 'desktop';
|
|
8
|
+
this.touch = false;
|
|
8
9
|
this.mobileMedia = window.matchMedia('(max-width: 960px)');
|
|
9
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
|
|
@@ -56,7 +56,11 @@ export const style = css `
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.drawer-menu-button {
|
|
59
|
-
padding: 8px
|
|
59
|
+
padding: 8px 16px;
|
|
60
|
+
height: var(--_exm-navigation-top-bar-height, 64px);
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
.drawer-back-button {
|
|
@@ -6,13 +6,22 @@ export const style = css `
|
|
|
6
6
|
var(--md-sys-color-secondary)
|
|
7
7
|
);
|
|
8
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
|
+
);
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
md-list-item {
|
|
12
20
|
margin-right: 8px;
|
|
13
21
|
margin-left: 8px;
|
|
14
|
-
border-radius:
|
|
15
|
-
--md-list-item-container-shape:
|
|
22
|
+
border-radius: 2rem;
|
|
23
|
+
--md-list-item-container-shape: 2rem;
|
|
24
|
+
--md-list-item-one-line-container-height: 48px;
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
md-list-item[selected] {
|
|
@@ -24,6 +33,12 @@ export const style = css `
|
|
|
24
33
|
--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected);
|
|
25
34
|
}
|
|
26
35
|
|
|
36
|
+
:host(.has-submenu) {
|
|
37
|
+
md-list-item[selected] {
|
|
38
|
+
background-color: var(--_exm-navigation-item-background-color-sub-selected);
|
|
39
|
+
--md-list-item-label-text-color: var(--_exm-navigation-item-color-sub-selected);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
27
42
|
md-list-item.collapsed-item[selected] {
|
|
28
43
|
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
29
44
|
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
@@ -8,22 +8,29 @@ export const style = css `
|
|
|
8
8
|
--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.nav {
|
|
12
|
+
padding-top: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
md-list {
|
|
12
16
|
padding-top: 0;
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-rows: repeat(auto-fit, auto);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
md-list-item {
|
|
16
22
|
margin-right: 8px;
|
|
17
23
|
margin-left: 8px;
|
|
18
|
-
border-radius:
|
|
19
|
-
--md-list-item-container-shape:
|
|
24
|
+
border-radius: 2rem;
|
|
25
|
+
--md-list-item-container-shape: 2rem;
|
|
26
|
+
--md-list-item-one-line-container-height: 48px;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
md-list-item[selected] {
|
|
23
30
|
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
24
31
|
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
25
|
-
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected)
|
|
26
|
-
|
|
32
|
+
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected);
|
|
33
|
+
--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected);
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
md-list-item.collapsed-item[selected] {
|
|
@@ -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
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExmNavigationRailNavBase } from './exm-navigation-rail-nav-base.js';
|
|
2
|
-
export declare class ExmNavigationRailNav extends ExmNavigationRailNavBase {
|
|
3
|
-
static styles: import("lit").CSSResult[];
|
|
4
|
-
}
|
|
5
|
-
declare global {
|
|
6
|
-
interface HTMLElementTagNameMap {
|
|
7
|
-
'exm-navigation-rail-nav': ExmNavigationRailNav;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { style } from './styles/exm-navigation-rail-nav-css.js';
|
|
4
|
-
import { ExmNavigationRailNavBase } from './exm-navigation-rail-nav-base.js';
|
|
5
|
-
let ExmNavigationRailNav = class ExmNavigationRailNav extends ExmNavigationRailNavBase {
|
|
6
|
-
};
|
|
7
|
-
ExmNavigationRailNav.styles = [style];
|
|
8
|
-
ExmNavigationRailNav = __decorate([
|
|
9
|
-
customElement('exm-navigation-rail-nav')
|
|
10
|
-
], ExmNavigationRailNav);
|
|
11
|
-
export { ExmNavigationRailNav };
|
|
12
|
-
//# sourceMappingURL=exm-navigation-rail-nav.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const navigationItemHover: import("@preact/signals-core").Signal<boolean>;
|
|
2
|
-
export declare const navigationDrawerHover: import("@preact/signals-core").Signal<boolean>;
|
|
3
|
-
export declare const navigationDrawerOpen: import("@preact/signals-core").Signal<boolean>;
|
|
4
|
-
export declare const navigationActiveHasSubmenu: import("@preact/signals-core").Signal<{
|
|
5
|
-
[k: string]: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const navigationRailSelected: import("@preact/signals-core").Signal<string | null>;
|
|
8
|
-
export declare const navigationSubSelected: import("@preact/signals-core").Signal<string | null>;
|
|
9
|
-
export declare const navigationRailActive: import("@preact/signals-core").Signal<string | null>;
|
|
10
|
-
export declare const navigationRailHidden: import("@preact/signals-core").Signal<boolean>;
|
|
11
|
-
export declare const navigationDrawerPersistent: import("@preact/signals-core").Signal<boolean>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { signal } from '@lit-labs/preact-signals';
|
|
2
|
-
export const navigationItemHover = signal(false);
|
|
3
|
-
export const navigationDrawerHover = signal(false);
|
|
4
|
-
export const navigationDrawerOpen = signal(false);
|
|
5
|
-
export const navigationActiveHasSubmenu = signal({});
|
|
6
|
-
export const navigationRailSelected = signal(null);
|
|
7
|
-
export const navigationSubSelected = signal(null);
|
|
8
|
-
export const navigationRailActive = signal(null);
|
|
9
|
-
export const navigationRailHidden = signal(false);
|
|
10
|
-
export const navigationDrawerPersistent = signal(false);
|
|
11
|
-
//# sourceMappingURL=exm-navigation-signals.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExmgElement } from '@exmg/lit-base';
|
|
2
|
-
import '@material/web/iconbutton/icon-button.js';
|
|
3
|
-
import '@material/web/icon/icon.js';
|
|
4
|
-
import '@material/mwc-top-app-bar-fixed';
|
|
5
|
-
export declare class ExmNavigationToolbarBase extends ExmgElement {
|
|
6
|
-
protected firstUpdated(): void;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ExmgElement } from '@exmg/lit-base';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import '@material/web/iconbutton/icon-button.js';
|
|
4
|
-
import '@material/web/icon/icon.js';
|
|
5
|
-
import '@material/mwc-top-app-bar-fixed';
|
|
6
|
-
export class ExmNavigationToolbarBase extends ExmgElement {
|
|
7
|
-
firstUpdated() {
|
|
8
|
-
const appToolbar = this.shadowRoot.querySelector('mwc-top-app-bar-fixed');
|
|
9
|
-
if (appToolbar) {
|
|
10
|
-
const observer = new MutationObserver((_, obs) => {
|
|
11
|
-
const shadowRoot = appToolbar.shadowRoot;
|
|
12
|
-
const header = shadowRoot ? shadowRoot.querySelector('header') : null;
|
|
13
|
-
if (header) {
|
|
14
|
-
header.style.left = '0px';
|
|
15
|
-
header.style.right = '0px';
|
|
16
|
-
obs.disconnect(); // Stop observing once we have made the changes
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
observer.observe(appToolbar.shadowRoot, {
|
|
20
|
-
childList: true,
|
|
21
|
-
subtree: true,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
return html `<mwc-top-app-bar-fixed>
|
|
27
|
-
<slot name="navigationIcon" slot="navigationIcon"></slot>
|
|
28
|
-
<slot name="title" slot="title"></slot>
|
|
29
|
-
<slot name="actionItems" slot="actionItems"></slot>
|
|
30
|
-
</mwc-top-app-bar-fixed>`;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=exm-navigation-toolbar-base.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExmNavigationToolbarBase } from './exm-navigation-toolbar-base.js';
|
|
2
|
-
export declare class ExmNavigationToolbar extends ExmNavigationToolbarBase {
|
|
3
|
-
static styles: import("lit").CSSResult[];
|
|
4
|
-
}
|
|
5
|
-
declare global {
|
|
6
|
-
interface HTMLElementTagNameMap {
|
|
7
|
-
'exm-navigation-toolbar': ExmNavigationToolbar;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { style } from './styles/exm-navigation-toolbar-css.js';
|
|
4
|
-
import { ExmNavigationToolbarBase } from './exm-navigation-toolbar-base.js';
|
|
5
|
-
let ExmNavigationToolbar = class ExmNavigationToolbar extends ExmNavigationToolbarBase {
|
|
6
|
-
};
|
|
7
|
-
ExmNavigationToolbar.styles = [style];
|
|
8
|
-
ExmNavigationToolbar = __decorate([
|
|
9
|
-
customElement('exm-navigation-toolbar')
|
|
10
|
-
], ExmNavigationToolbar);
|
|
11
|
-
export { ExmNavigationToolbar };
|
|
12
|
-
//# sourceMappingURL=exm-navigation-toolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const style: import("lit").CSSResult;
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
}
|
|
10
|
-
|
|
11
|
-
md-list-item {
|
|
12
|
-
margin-right: 8px;
|
|
13
|
-
margin-left: 8px;
|
|
14
|
-
border-radius: 1rem;
|
|
15
|
-
--md-list-item-container-shape: 1rem;
|
|
16
|
-
display: grid;
|
|
17
|
-
grid-template-columns: auto 1fr auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
md-list-item[selected] {
|
|
21
|
-
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
22
|
-
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
23
|
-
--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected)
|
|
24
|
-
--md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
md-list-item.collapsed-item[selected] {
|
|
28
|
-
--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);
|
|
29
|
-
background-color: var(--_exm-navigation-item-background-color-selected);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
md-list-item[selected] md-icon {
|
|
33
|
-
color: var(--md-sys-color-primary);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sub-menu {
|
|
37
|
-
margin-left: 1rem;
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
//# sourceMappingURL=exm-navigate-drawer-nav-item-css.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{display:flex;flex-direction:column;--_exm-navigation-rail-nav-width: var(--exm-navigation-rail-nav-width, 88px);width:var(--_exm-navigation-rail-nav-width);margin-top:20px}`;
|
|
3
|
-
export default style;
|
|
4
|
-
//# sourceMappingURL=exm-navigation-rail-nav-css.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{--_exm-navigation-item-background-color-selected: var( --exm-navigation-item-background-color-selected, var(--md-sys-color-secondary) );--_exm-navigation-item-color-selected: var(--exm-navigation-item-color-selected, var(--md-sys-color-on-secondary))}exm-navigation-drawer{--md-list-container-color: none;--md-list-item-label-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-supporting-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-trailing-supporting-text-color: var(--md-sys-color-on-surface-variant);--md-list-item-container-shape: 24px}exm-navigation-drawer md-list-item{margin-right:8px;margin-left:8px;border-radius:24px;--md-list-item-container-shape: 24px}exm-navigation-drawer md-list-item[selected]{--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);background-color:var(--_exm-navigation-item-background-color-selected);--md-list-item-leading-icon-color: var(--_exm-navigation-item-color-selected) --md-list-item-trailing-icon-color: var(--_exm-navigation-item-color-selected)}exm-navigation-drawer md-list-item.collapsed-item[selected]{--md-list-item-label-text-color: var(--_exm-navigation-item-color-selected);background-color:var(--_exm-navigation-item-background-color-selected)}exm-navigation-drawer md-list-item[selected] md-icon{color:var(--md-sys-color-primary)}.sub-menu{margin-left:.8rem}.left-margin{margin-left:2.5rem}`;
|
|
3
|
-
export default style;
|
|
4
|
-
//# sourceMappingURL=exm-navigation-styles-css.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{display:block}mwc-top-app-bar-fixed{--mdc-theme-primary: var(--exm-navigation-toolbar-primary, var(--md-sys-color-background));--mdc-theme-on-primary: var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background))}md-icon{fill:var(--exm-navigation-toolbar-on-primary, var(--md-sys-color-on-background))}@media screen and (min-width: 961px){slot[name=navigationIcon]{display:none}}`;
|
|
3
|
-
export default style;
|
|
4
|
-
//# sourceMappingURL=exm-navigation-toolbar-css.js.map
|