@tilde-nlp/ngx-menu 4.1.10 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/assets/menu-logo.svg.mjs +1 -1
- package/esm2022/lib/components/menu-columns/menu-columns.component.mjs +103 -72
- package/esm2022/lib/components/menu-icon/menu-icon.component.mjs +53 -23
- package/esm2022/lib/components/menu-item-icon/menu-item-icon.component.mjs +115 -71
- package/esm2022/lib/components/menu-item-icon/menu.model.mjs +3 -3
- package/esm2022/lib/components/menu-item-icon/models/menu-dialog-settings.model.mjs +1 -1
- package/esm2022/lib/components/menu-item-icon/models/menu-item-settings.model.mjs +1 -1
- package/esm2022/lib/components/menu-item-icon/models/menu-title-placement.model.mjs +6 -6
- package/esm2022/lib/components/menu-item-link/menu-item-link.component.mjs +91 -53
- package/esm2022/lib/components/menu-item-list/menu-item-list.component.mjs +178 -61
- package/esm2022/lib/components/modal-nav-menu/modal-nav-menu.component.mjs +82 -36
- package/esm2022/lib/components/nav-base/models/index.mjs +1 -1
- package/esm2022/lib/components/nav-base/models/strapi-data-location.enum.mjs +6 -6
- package/esm2022/lib/components/nav-base/nav-base.component.mjs +37 -32
- package/esm2022/lib/components/side-nav-menu/index.mjs +2 -2
- package/esm2022/lib/components/side-nav-menu/models/index.mjs +1 -1
- package/esm2022/lib/components/side-nav-menu/models/side-nav-settings.model.mjs +1 -1
- package/esm2022/lib/components/side-nav-menu/side-nav-menu.component.mjs +130 -93
- package/esm2022/lib/injection-tokens/index.mjs +1 -1
- package/esm2022/lib/injection-tokens/menu-shared-config.token.mjs +1 -1
- package/esm2022/lib/menu.module.mjs +114 -113
- package/esm2022/lib/models/active-menu-item-config.model.mjs +1 -1
- package/esm2022/lib/models/active-menu-items.model.mjs +1 -1
- package/esm2022/lib/models/custom-menu-item.mjs +1 -1
- package/esm2022/lib/models/index.mjs +7 -7
- package/esm2022/lib/models/menu-icon-strapi-extension.const.mjs +1 -1
- package/esm2022/lib/models/menu-item-group.model.mjs +1 -1
- package/esm2022/lib/models/menu-layout-direction.model.mjs +5 -5
- package/esm2022/lib/models/menu-shared-config.model.mjs +1 -1
- package/esm2022/lib/services/index.mjs +2 -2
- package/esm2022/lib/services/menu-items.service.mjs +125 -125
- package/esm2022/lib/services/strapi.service.mjs +93 -93
- package/esm2022/public-api.mjs +15 -15
- package/esm2022/tilde-nlp-ngx-menu.mjs +4 -4
- package/fesm2022/tilde-nlp-ngx-menu.mjs +1016 -667
- package/fesm2022/tilde-nlp-ngx-menu.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/assets/menu-logo.svg.d.ts +1 -1
- package/lib/components/menu-columns/menu-columns.component.d.ts +28 -28
- package/lib/components/menu-icon/menu-icon.component.d.ts +10 -10
- package/lib/components/menu-item-icon/menu-item-icon.component.d.ts +28 -28
- package/lib/components/menu-item-icon/menu.model.d.ts +3 -3
- package/lib/components/menu-item-icon/models/menu-dialog-settings.model.d.ts +8 -8
- package/lib/components/menu-item-icon/models/menu-item-settings.model.d.ts +6 -6
- package/lib/components/menu-item-icon/models/menu-title-placement.model.d.ts +5 -5
- package/lib/components/menu-item-link/menu-item-link.component.d.ts +25 -25
- package/lib/components/menu-item-list/menu-item-list.component.d.ts +21 -21
- package/lib/components/modal-nav-menu/modal-nav-menu.component.d.ts +14 -14
- package/lib/components/nav-base/models/index.d.ts +1 -1
- package/lib/components/nav-base/models/strapi-data-location.enum.d.ts +5 -5
- package/lib/components/nav-base/nav-base.component.d.ts +19 -19
- package/lib/components/side-nav-menu/index.d.ts +2 -2
- package/lib/components/side-nav-menu/models/index.d.ts +1 -1
- package/lib/components/side-nav-menu/models/side-nav-settings.model.d.ts +7 -7
- package/lib/components/side-nav-menu/side-nav-menu.component.d.ts +33 -33
- package/lib/injection-tokens/index.d.ts +1 -1
- package/lib/injection-tokens/menu-shared-config.token.d.ts +1 -1
- package/lib/menu.module.d.ts +29 -29
- package/lib/models/active-menu-item-config.model.d.ts +4 -4
- package/lib/models/active-menu-items.model.d.ts +6 -6
- package/lib/models/custom-menu-item.d.ts +21 -21
- package/lib/models/index.d.ts +7 -7
- package/lib/models/menu-icon-strapi-extension.const.d.ts +1 -1
- package/lib/models/menu-item-group.model.d.ts +9 -9
- package/lib/models/menu-layout-direction.model.d.ts +4 -4
- package/lib/models/menu-shared-config.model.d.ts +21 -21
- package/lib/services/index.d.ts +2 -2
- package/lib/services/menu-items.service.d.ts +38 -38
- package/lib/services/strapi.service.d.ts +20 -20
- package/package.json +12 -9
- package/public-api.d.ts +12 -12
|
@@ -8,7 +8,7 @@ import { STRAPI_API_CONFIG_TOKEN } from '@tilde-nlp/ngx-strapi';
|
|
|
8
8
|
import { CollectionTypes } from '@tilde-nlp/strapi-models';
|
|
9
9
|
import * as i2 from '@tilde-nlp/ngx-common';
|
|
10
10
|
import { PlausibleModule } from '@tilde-nlp/ngx-common';
|
|
11
|
-
import * as i2$2 from '@
|
|
11
|
+
import * as i2$2 from '@ngbracket/ngx-layout/flex';
|
|
12
12
|
import * as i3 from '@angular/common';
|
|
13
13
|
import { CommonModule } from '@angular/common';
|
|
14
14
|
import * as i2$1 from '@angular/material/icon';
|
|
@@ -16,12 +16,12 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
16
16
|
import * as i7 from '@angular/material/button';
|
|
17
17
|
import { MatButtonModule } from '@angular/material/button';
|
|
18
18
|
import * as i4 from '@angular/material/divider';
|
|
19
|
-
import * as i3$1 from '@
|
|
19
|
+
import * as i3$1 from '@ngbracket/ngx-layout/extended';
|
|
20
20
|
import * as i5 from '@angular/material/tooltip';
|
|
21
21
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
22
22
|
import * as i9 from '@ngx-translate/core';
|
|
23
23
|
import { TranslateModule } from '@ngx-translate/core';
|
|
24
|
-
import { FlexLayoutModule } from '@
|
|
24
|
+
import { FlexLayoutModule } from '@ngbracket/ngx-layout';
|
|
25
25
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
26
26
|
import { MatListModule } from '@angular/material/list';
|
|
27
27
|
import * as i7$1 from '@angular/material/menu';
|
|
@@ -30,531 +30,835 @@ import { HttpClientModule } from '@angular/common/http';
|
|
|
30
30
|
|
|
31
31
|
const MENU_SHARED_CONFIG = "menu-shared-config";
|
|
32
32
|
|
|
33
|
-
/** Necessary for menu components to determine where loaded data from strapi should be placed - either in front of pre defined items or in end. */
|
|
34
|
-
var StrapiDataLocation;
|
|
35
|
-
(function (StrapiDataLocation) {
|
|
36
|
-
StrapiDataLocation[StrapiDataLocation["START"] = 0] = "START";
|
|
37
|
-
StrapiDataLocation[StrapiDataLocation["END"] = 1] = "END";
|
|
33
|
+
/** Necessary for menu components to determine where loaded data from strapi should be placed - either in front of pre defined items or in end. */
|
|
34
|
+
var StrapiDataLocation;
|
|
35
|
+
(function (StrapiDataLocation) {
|
|
36
|
+
StrapiDataLocation[StrapiDataLocation["START"] = 0] = "START";
|
|
37
|
+
StrapiDataLocation[StrapiDataLocation["END"] = 1] = "END";
|
|
38
38
|
})(StrapiDataLocation || (StrapiDataLocation = {}));
|
|
39
39
|
|
|
40
40
|
const MENU_ICON_STRAPI_EXTENSION = ".svg";
|
|
41
41
|
|
|
42
|
-
class StarpiMenuService {
|
|
43
|
-
constructor(strapiSubscription, menuConfig, strapiConfig, iconService) {
|
|
44
|
-
this.strapiSubscription = strapiSubscription;
|
|
45
|
-
this.menuConfig = menuConfig;
|
|
46
|
-
this.iconService = iconService;
|
|
47
|
-
this.svgIconNamePrefix = "strapi-menu-icon-";
|
|
48
|
-
this.imgBaseUrl = '';
|
|
49
|
-
this.imgBaseUrl = strapiConfig.apiUrl;
|
|
50
|
-
}
|
|
51
|
-
getMenuItems() {
|
|
52
|
-
const responseObs = this.strapiSubscription.subscribeCollectionType(CollectionTypes.MENU_ITEMS)
|
|
53
|
-
.pipe(map((items) => {
|
|
54
|
-
// Remove disabled items so they are not processed later.
|
|
55
|
-
const convertedItems = [];
|
|
56
|
-
if (!items || items.length === 0) {
|
|
57
|
-
return convertedItems;
|
|
58
|
-
}
|
|
59
|
-
items = items.filter(item => !item.disabled);
|
|
60
|
-
items.forEach((menu) => {
|
|
61
|
-
menu.link = this.addBaseUrlIfNecessary(menu.link);
|
|
62
|
-
const originalMenuIcon = menu.icon.data.attributes;
|
|
63
|
-
if (originalMenuIcon.url.startsWith('/')) {
|
|
64
|
-
originalMenuIcon.url = this.imgBaseUrl + originalMenuIcon.url;
|
|
65
|
-
}
|
|
66
|
-
if (originalMenuIcon.ext === MENU_ICON_STRAPI_EXTENSION) {
|
|
67
|
-
// add custom prefix so that it is not easy to mix with other icons in registry
|
|
68
|
-
menu.icon.data.attributes.name = this.svgIconNamePrefix + originalMenuIcon.name;
|
|
69
|
-
this.iconService.registerIconFromUrl(originalMenuIcon.name, originalMenuIcon.url);
|
|
70
|
-
}
|
|
71
|
-
convertedItems.push(this.convertToCustomMenuItem(menu));
|
|
72
|
-
});
|
|
73
|
-
return convertedItems;
|
|
74
|
-
}));
|
|
75
|
-
return responseObs;
|
|
76
|
-
}
|
|
77
|
-
unsubscribe() {
|
|
78
|
-
this.strapiSubscription.unsubscribe(CollectionTypes.MENU_ITEMS);
|
|
79
|
-
}
|
|
80
|
-
addBaseUrlIfNecessary(link) {
|
|
81
|
-
if (!this.menuConfig?.baseUrl) {
|
|
82
|
-
return link;
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
new URL(link);
|
|
86
|
-
// eslint-disable-next-line no-empty
|
|
87
|
-
}
|
|
88
|
-
catch { }
|
|
89
|
-
try {
|
|
90
|
-
return new URL(link, this.menuConfig.baseUrl).href;
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
return link;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
convertToCustomMenuItem(item) {
|
|
97
|
-
return {
|
|
98
|
-
icon: item.icon.data.attributes.name,
|
|
99
|
-
link: item.link,
|
|
100
|
-
title: item.title,
|
|
101
|
-
externalLink: item.externalLink,
|
|
102
|
-
// Material icons should not come from strapi
|
|
103
|
-
materialIcon: false,
|
|
104
|
-
plausibleEvent: item.plausibleEvent,
|
|
105
|
-
customId: item.customId
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
static { this.ɵfac =
|
|
109
|
-
static { this.ɵprov = i0.ɵɵ
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
42
|
+
class StarpiMenuService {
|
|
43
|
+
constructor(strapiSubscription, menuConfig, strapiConfig, iconService) {
|
|
44
|
+
this.strapiSubscription = strapiSubscription;
|
|
45
|
+
this.menuConfig = menuConfig;
|
|
46
|
+
this.iconService = iconService;
|
|
47
|
+
this.svgIconNamePrefix = "strapi-menu-icon-";
|
|
48
|
+
this.imgBaseUrl = '';
|
|
49
|
+
this.imgBaseUrl = strapiConfig.apiUrl;
|
|
50
|
+
}
|
|
51
|
+
getMenuItems() {
|
|
52
|
+
const responseObs = this.strapiSubscription.subscribeCollectionType(CollectionTypes.MENU_ITEMS)
|
|
53
|
+
.pipe(map((items) => {
|
|
54
|
+
// Remove disabled items so they are not processed later.
|
|
55
|
+
const convertedItems = [];
|
|
56
|
+
if (!items || items.length === 0) {
|
|
57
|
+
return convertedItems;
|
|
58
|
+
}
|
|
59
|
+
items = items.filter(item => !item.disabled);
|
|
60
|
+
items.forEach((menu) => {
|
|
61
|
+
menu.link = this.addBaseUrlIfNecessary(menu.link);
|
|
62
|
+
const originalMenuIcon = menu.icon.data.attributes;
|
|
63
|
+
if (originalMenuIcon.url.startsWith('/')) {
|
|
64
|
+
originalMenuIcon.url = this.imgBaseUrl + originalMenuIcon.url;
|
|
65
|
+
}
|
|
66
|
+
if (originalMenuIcon.ext === MENU_ICON_STRAPI_EXTENSION) {
|
|
67
|
+
// add custom prefix so that it is not easy to mix with other icons in registry
|
|
68
|
+
menu.icon.data.attributes.name = this.svgIconNamePrefix + originalMenuIcon.name;
|
|
69
|
+
this.iconService.registerIconFromUrl(originalMenuIcon.name, originalMenuIcon.url);
|
|
70
|
+
}
|
|
71
|
+
convertedItems.push(this.convertToCustomMenuItem(menu));
|
|
72
|
+
});
|
|
73
|
+
return convertedItems;
|
|
74
|
+
}));
|
|
75
|
+
return responseObs;
|
|
76
|
+
}
|
|
77
|
+
unsubscribe() {
|
|
78
|
+
this.strapiSubscription.unsubscribe(CollectionTypes.MENU_ITEMS);
|
|
79
|
+
}
|
|
80
|
+
addBaseUrlIfNecessary(link) {
|
|
81
|
+
if (!this.menuConfig?.baseUrl) {
|
|
82
|
+
return link;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
new URL(link);
|
|
86
|
+
// eslint-disable-next-line no-empty
|
|
87
|
+
}
|
|
88
|
+
catch { }
|
|
89
|
+
try {
|
|
90
|
+
return new URL(link, this.menuConfig.baseUrl).href;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return link;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
convertToCustomMenuItem(item) {
|
|
97
|
+
return {
|
|
98
|
+
icon: item.icon.data.attributes.name,
|
|
99
|
+
link: item.link,
|
|
100
|
+
title: item.title,
|
|
101
|
+
externalLink: item.externalLink,
|
|
102
|
+
// Material icons should not come from strapi
|
|
103
|
+
materialIcon: false,
|
|
104
|
+
plausibleEvent: item.plausibleEvent,
|
|
105
|
+
customId: item.customId
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
static { this.ɵfac = function StarpiMenuService_Factory(t) { return new (t || StarpiMenuService)(i0.ɵɵinject(i1.StrapiSubscriptionService), i0.ɵɵinject(MENU_SHARED_CONFIG, 8), i0.ɵɵinject(STRAPI_API_CONFIG_TOKEN), i0.ɵɵinject(i2.IconService)); }; }
|
|
109
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StarpiMenuService, factory: StarpiMenuService.ɵfac, providedIn: 'root' }); }
|
|
110
|
+
}
|
|
111
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StarpiMenuService, [{
|
|
112
|
+
type: Injectable,
|
|
113
|
+
args: [{
|
|
114
|
+
providedIn: 'root'
|
|
115
|
+
}]
|
|
116
|
+
}], () => [{ type: i1.StrapiSubscriptionService }, { type: undefined, decorators: [{
|
|
117
|
+
type: Optional
|
|
118
|
+
}, {
|
|
119
|
+
type: Inject,
|
|
120
|
+
args: [MENU_SHARED_CONFIG]
|
|
121
|
+
}] }, { type: undefined, decorators: [{
|
|
122
|
+
type: Inject,
|
|
123
|
+
args: [STRAPI_API_CONFIG_TOKEN]
|
|
124
|
+
}] }, { type: i2.IconService }], null); })();
|
|
125
125
|
|
|
126
|
-
class MenuItemsService {
|
|
127
|
-
get activeElements() { return this._activeElements.asObservable(); }
|
|
128
|
-
get allRootItems() { return this._allRootItems; }
|
|
129
|
-
get strapiGroup() { return this._strapiGroup; }
|
|
130
|
-
get customId() { return this.menuSharedConfig?.customId; }
|
|
131
|
-
get hideSelectedCustomId() { return this.menuSharedConfig?.hideSelectedCustomId; }
|
|
132
|
-
get strapiGroupBase() { return this.menuSharedConfig?.strapiGroupBase; }
|
|
133
|
-
get strapiDataLocation() { return this.menuSharedConfig?.strapiDataLocation ?? StrapiDataLocation.END; }
|
|
134
|
-
get mergedGroups() { return this._mergedGroups; }
|
|
135
|
-
get menuItemGroups() { return this.menuSharedConfig.itemGroups; }
|
|
136
|
-
constructor(router, menuSharedConfig, strapiService) {
|
|
137
|
-
this.router = router;
|
|
138
|
-
this.menuSharedConfig = menuSharedConfig;
|
|
139
|
-
this.strapiService = strapiService;
|
|
140
|
-
this._activeElements = new BehaviorSubject({});
|
|
141
|
-
this.strapiItems = [];
|
|
142
|
-
this.isActiveMatchOptions = {
|
|
143
|
-
matrixParams: 'exact',
|
|
144
|
-
queryParams: 'exact',
|
|
145
|
-
paths: 'exact',
|
|
146
|
-
fragment: 'exact'
|
|
147
|
-
};
|
|
148
|
-
this._mergedGroups = [];
|
|
149
|
-
this.getStrapiData();
|
|
150
|
-
this.subscribeToRouteChanges();
|
|
151
|
-
}
|
|
152
|
-
subscribeToRouteChanges() {
|
|
153
|
-
this.router.events
|
|
154
|
-
.pipe(filter(e => e instanceof NavigationEnd))
|
|
155
|
-
.subscribe(() => { this.updateActive(); });
|
|
156
|
-
}
|
|
157
|
-
updateActive() {
|
|
158
|
-
const items = this.allRootItems;
|
|
159
|
-
const root = this.findActiveElement(items, false);
|
|
160
|
-
const child = this.findActiveElement(items, true);
|
|
161
|
-
this._activeElements.next({ root, child });
|
|
162
|
-
}
|
|
163
|
-
/** Finds active element from whole list. RouterLink has priority over custom Id. */
|
|
164
|
-
// at this version, child elements should not have customId, since that property comes from strapi and strapi provides only one level structure
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
166
|
-
findActiveElement(items, includeChildren) {
|
|
167
|
-
if (!items?.length) {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
let customIdElement;
|
|
171
|
-
for (const item of items) {
|
|
172
|
-
// Child element has priority over parent, so need to check if any child is active
|
|
173
|
-
if (this.isElementRouterLinkActive(item)) {
|
|
174
|
-
// If has children and they are visible, return active child or current item
|
|
175
|
-
return includeChildren ? this.findActiveElement(item.children, includeChildren) ?? item : item;
|
|
176
|
-
}
|
|
177
|
-
// if selected custom id element is hidden, no need to look for it and set it to active;
|
|
178
|
-
else if (!this.hideSelectedCustomId && this.isElementCustomIdActive(item)) {
|
|
179
|
-
customIdElement = item;
|
|
180
|
-
}
|
|
181
|
-
else if (includeChildren && item.children?.length) {
|
|
182
|
-
const activeChild = this.findActiveElement(item.children, includeChildren);
|
|
183
|
-
if (activeChild) {
|
|
184
|
-
return activeChild;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return customIdElement;
|
|
189
|
-
}
|
|
190
|
-
getStrapiData() {
|
|
191
|
-
if (!this.menuSharedConfig?.disableStrapi) {
|
|
192
|
-
this.strapiService.getMenuItems().subscribe(this.loadData.bind(this));
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
this.loadData([]);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
loadData(data) {
|
|
199
|
-
// hide custom id based on input param
|
|
200
|
-
this.strapiItems = (this.hideSelectedCustomId && this.customId) ? data.filter(item => item.customId !== this.customId) : data;
|
|
201
|
-
this._strapiGroup = {
|
|
202
|
-
...this.strapiGroupBase,
|
|
203
|
-
items: this.strapiItems
|
|
204
|
-
};
|
|
205
|
-
if (this.strapiDataLocation === StrapiDataLocation.START) {
|
|
206
|
-
this._mergedGroups = [this.strapiGroup, ...this.menuItemGroups ?? []];
|
|
207
|
-
}
|
|
208
|
-
else if (this.strapiDataLocation === StrapiDataLocation.END) {
|
|
209
|
-
this._mergedGroups = [...this.menuItemGroups ?? [], this.strapiGroup];
|
|
210
|
-
}
|
|
211
|
-
const allItems = this.mergedGroups.map(map => map.items);
|
|
212
|
-
let newArray = [];
|
|
213
|
-
allItems.forEach((array) => { newArray = newArray.concat(array); });
|
|
214
|
-
this._allRootItems = newArray;
|
|
215
|
-
this.updateActive();
|
|
216
|
-
}
|
|
217
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
-
// private isMenuItem(item: any): item is MenuItems {
|
|
219
|
-
// return item.customId;
|
|
220
|
-
// }
|
|
221
|
-
isElementCustomIdActive(element) {
|
|
222
|
-
return this.customId && element.customId === this.customId;
|
|
223
|
-
}
|
|
224
|
-
isElementRouterLinkActive(element) {
|
|
225
|
-
const routerLinkActiveOptions = element.routerLinkActiveOptions ?? this.menuSharedConfig.activeMatchOptions ?? this.isActiveMatchOptions;
|
|
226
|
-
return this.router.isActive(element.link, routerLinkActiveOptions);
|
|
227
|
-
}
|
|
228
|
-
static { this.ɵfac =
|
|
229
|
-
static { this.ɵprov = i0.ɵɵ
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
126
|
+
class MenuItemsService {
|
|
127
|
+
get activeElements() { return this._activeElements.asObservable(); }
|
|
128
|
+
get allRootItems() { return this._allRootItems; }
|
|
129
|
+
get strapiGroup() { return this._strapiGroup; }
|
|
130
|
+
get customId() { return this.menuSharedConfig?.customId; }
|
|
131
|
+
get hideSelectedCustomId() { return this.menuSharedConfig?.hideSelectedCustomId; }
|
|
132
|
+
get strapiGroupBase() { return this.menuSharedConfig?.strapiGroupBase; }
|
|
133
|
+
get strapiDataLocation() { return this.menuSharedConfig?.strapiDataLocation ?? StrapiDataLocation.END; }
|
|
134
|
+
get mergedGroups() { return this._mergedGroups; }
|
|
135
|
+
get menuItemGroups() { return this.menuSharedConfig.itemGroups; }
|
|
136
|
+
constructor(router, menuSharedConfig, strapiService) {
|
|
137
|
+
this.router = router;
|
|
138
|
+
this.menuSharedConfig = menuSharedConfig;
|
|
139
|
+
this.strapiService = strapiService;
|
|
140
|
+
this._activeElements = new BehaviorSubject({});
|
|
141
|
+
this.strapiItems = [];
|
|
142
|
+
this.isActiveMatchOptions = {
|
|
143
|
+
matrixParams: 'exact',
|
|
144
|
+
queryParams: 'exact',
|
|
145
|
+
paths: 'exact',
|
|
146
|
+
fragment: 'exact'
|
|
147
|
+
};
|
|
148
|
+
this._mergedGroups = [];
|
|
149
|
+
this.getStrapiData();
|
|
150
|
+
this.subscribeToRouteChanges();
|
|
151
|
+
}
|
|
152
|
+
subscribeToRouteChanges() {
|
|
153
|
+
this.router.events
|
|
154
|
+
.pipe(filter(e => e instanceof NavigationEnd))
|
|
155
|
+
.subscribe(() => { this.updateActive(); });
|
|
156
|
+
}
|
|
157
|
+
updateActive() {
|
|
158
|
+
const items = this.allRootItems;
|
|
159
|
+
const root = this.findActiveElement(items, false);
|
|
160
|
+
const child = this.findActiveElement(items, true);
|
|
161
|
+
this._activeElements.next({ root, child });
|
|
162
|
+
}
|
|
163
|
+
/** Finds active element from whole list. RouterLink has priority over custom Id. */
|
|
164
|
+
// at this version, child elements should not have customId, since that property comes from strapi and strapi provides only one level structure
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
166
|
+
findActiveElement(items, includeChildren) {
|
|
167
|
+
if (!items?.length) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
let customIdElement;
|
|
171
|
+
for (const item of items) {
|
|
172
|
+
// Child element has priority over parent, so need to check if any child is active
|
|
173
|
+
if (this.isElementRouterLinkActive(item)) {
|
|
174
|
+
// If has children and they are visible, return active child or current item
|
|
175
|
+
return includeChildren ? this.findActiveElement(item.children, includeChildren) ?? item : item;
|
|
176
|
+
}
|
|
177
|
+
// if selected custom id element is hidden, no need to look for it and set it to active;
|
|
178
|
+
else if (!this.hideSelectedCustomId && this.isElementCustomIdActive(item)) {
|
|
179
|
+
customIdElement = item;
|
|
180
|
+
}
|
|
181
|
+
else if (includeChildren && item.children?.length) {
|
|
182
|
+
const activeChild = this.findActiveElement(item.children, includeChildren);
|
|
183
|
+
if (activeChild) {
|
|
184
|
+
return activeChild;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return customIdElement;
|
|
189
|
+
}
|
|
190
|
+
getStrapiData() {
|
|
191
|
+
if (!this.menuSharedConfig?.disableStrapi) {
|
|
192
|
+
this.strapiService.getMenuItems().subscribe(this.loadData.bind(this));
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.loadData([]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
loadData(data) {
|
|
199
|
+
// hide custom id based on input param
|
|
200
|
+
this.strapiItems = (this.hideSelectedCustomId && this.customId) ? data.filter(item => item.customId !== this.customId) : data;
|
|
201
|
+
this._strapiGroup = {
|
|
202
|
+
...this.strapiGroupBase,
|
|
203
|
+
items: this.strapiItems
|
|
204
|
+
};
|
|
205
|
+
if (this.strapiDataLocation === StrapiDataLocation.START) {
|
|
206
|
+
this._mergedGroups = [this.strapiGroup, ...this.menuItemGroups ?? []];
|
|
207
|
+
}
|
|
208
|
+
else if (this.strapiDataLocation === StrapiDataLocation.END) {
|
|
209
|
+
this._mergedGroups = [...this.menuItemGroups ?? [], this.strapiGroup];
|
|
210
|
+
}
|
|
211
|
+
const allItems = this.mergedGroups.map(map => map.items);
|
|
212
|
+
let newArray = [];
|
|
213
|
+
allItems.forEach((array) => { newArray = newArray.concat(array); });
|
|
214
|
+
this._allRootItems = newArray;
|
|
215
|
+
this.updateActive();
|
|
216
|
+
}
|
|
217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
+
// private isMenuItem(item: any): item is MenuItems {
|
|
219
|
+
// return item.customId;
|
|
220
|
+
// }
|
|
221
|
+
isElementCustomIdActive(element) {
|
|
222
|
+
return this.customId && element.customId === this.customId;
|
|
223
|
+
}
|
|
224
|
+
isElementRouterLinkActive(element) {
|
|
225
|
+
const routerLinkActiveOptions = element.routerLinkActiveOptions ?? this.menuSharedConfig.activeMatchOptions ?? this.isActiveMatchOptions;
|
|
226
|
+
return this.router.isActive(element.link, routerLinkActiveOptions);
|
|
227
|
+
}
|
|
228
|
+
static { this.ɵfac = function MenuItemsService_Factory(t) { return new (t || MenuItemsService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(MENU_SHARED_CONFIG, 8), i0.ɵɵinject(StarpiMenuService)); }; }
|
|
229
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MenuItemsService, factory: MenuItemsService.ɵfac, providedIn: 'root' }); }
|
|
230
|
+
}
|
|
231
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemsService, [{
|
|
232
|
+
type: Injectable,
|
|
233
|
+
args: [{
|
|
234
|
+
providedIn: 'root'
|
|
235
|
+
}]
|
|
236
|
+
}], () => [{ type: i1$1.Router }, { type: undefined, decorators: [{
|
|
237
|
+
type: Optional
|
|
238
|
+
}, {
|
|
239
|
+
type: Inject,
|
|
240
|
+
args: [MENU_SHARED_CONFIG]
|
|
241
|
+
}] }, { type: StarpiMenuService }], null); })();
|
|
242
242
|
|
|
243
|
-
/** This component is created to help nest some common input params through nav components. */
|
|
244
|
-
class NavBaseComponent {
|
|
245
|
-
constructor(menuItemsService) {
|
|
246
|
-
this.menuItemsService = menuItemsService;
|
|
247
|
-
}
|
|
248
|
-
ngOnInit() {
|
|
249
|
-
this.initBase();
|
|
250
|
-
}
|
|
251
|
-
initBase() {
|
|
252
|
-
this.activeItemSubscription = this.menuItemsService.activeElements.subscribe((active) => {
|
|
253
|
-
this.active = active;
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
ngOnDestroy() {
|
|
257
|
-
this.destroyBase();
|
|
258
|
-
}
|
|
259
|
-
destroyBase() {
|
|
260
|
-
this.activeItemSubscription?.unsubscribe();
|
|
261
|
-
}
|
|
262
|
-
static { this.ɵfac =
|
|
263
|
-
static { this.ɵcmp = i0.ɵɵ
|
|
264
|
-
|
|
265
|
-
i0.ɵɵ
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
243
|
+
/** This component is created to help nest some common input params through nav components. */
|
|
244
|
+
class NavBaseComponent {
|
|
245
|
+
constructor(menuItemsService) {
|
|
246
|
+
this.menuItemsService = menuItemsService;
|
|
247
|
+
}
|
|
248
|
+
ngOnInit() {
|
|
249
|
+
this.initBase();
|
|
250
|
+
}
|
|
251
|
+
initBase() {
|
|
252
|
+
this.activeItemSubscription = this.menuItemsService.activeElements.subscribe((active) => {
|
|
253
|
+
this.active = active;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
ngOnDestroy() {
|
|
257
|
+
this.destroyBase();
|
|
258
|
+
}
|
|
259
|
+
destroyBase() {
|
|
260
|
+
this.activeItemSubscription?.unsubscribe();
|
|
261
|
+
}
|
|
262
|
+
static { this.ɵfac = function NavBaseComponent_Factory(t) { return new (t || NavBaseComponent)(i0.ɵɵdirectiveInject(MenuItemsService)); }; }
|
|
263
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavBaseComponent, selectors: [["nav-base"]], inputs: { direction: "direction" }, decls: 2, vars: 0, template: function NavBaseComponent_Template(rf, ctx) { if (rf & 1) {
|
|
264
|
+
i0.ɵɵelementStart(0, "p");
|
|
265
|
+
i0.ɵɵtext(1, "nav-base works!");
|
|
266
|
+
i0.ɵɵelementEnd();
|
|
267
|
+
} } }); }
|
|
268
|
+
}
|
|
269
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NavBaseComponent, [{
|
|
270
|
+
type: Component,
|
|
271
|
+
args: [{ selector: 'nav-base', template: "<p>nav-base works!</p>\r\n" }]
|
|
272
|
+
}], () => [{ type: MenuItemsService }], { direction: [{
|
|
273
|
+
type: Input
|
|
274
|
+
}] }); })();
|
|
275
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NavBaseComponent, { className: "NavBaseComponent", filePath: "lib\\components\\nav-base\\nav-base.component.ts", lineNumber: 13 }); })();
|
|
271
276
|
|
|
272
|
-
var MenuLayoutDirection;
|
|
273
|
-
(function (MenuLayoutDirection) {
|
|
274
|
-
MenuLayoutDirection["column"] = "column";
|
|
275
|
-
MenuLayoutDirection["row"] = "row";
|
|
277
|
+
var MenuLayoutDirection;
|
|
278
|
+
(function (MenuLayoutDirection) {
|
|
279
|
+
MenuLayoutDirection["column"] = "column";
|
|
280
|
+
MenuLayoutDirection["row"] = "row";
|
|
276
281
|
})(MenuLayoutDirection || (MenuLayoutDirection = {}));
|
|
277
282
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
i0.ɵɵ
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
283
|
+
function MenuIconComponent_ng_container_0_mat_icon_1_Template(rf, ctx) { if (rf & 1) {
|
|
284
|
+
i0.ɵɵelement(0, "mat-icon", 3);
|
|
285
|
+
} if (rf & 2) {
|
|
286
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
287
|
+
i0.ɵɵproperty("svgIcon", ctx_r0.menuItem.icon);
|
|
288
|
+
} }
|
|
289
|
+
function MenuIconComponent_ng_container_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
290
|
+
i0.ɵɵelementStart(0, "mat-icon", 4);
|
|
291
|
+
i0.ɵɵtext(1);
|
|
292
|
+
i0.ɵɵelementEnd();
|
|
293
|
+
} if (rf & 2) {
|
|
294
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
295
|
+
i0.ɵɵadvance();
|
|
296
|
+
i0.ɵɵtextInterpolate(ctx_r0.menuItem.icon);
|
|
297
|
+
} }
|
|
298
|
+
function MenuIconComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
299
|
+
i0.ɵɵelementContainerStart(0);
|
|
300
|
+
i0.ɵɵtemplate(1, MenuIconComponent_ng_container_0_mat_icon_1_Template, 1, 1, "mat-icon", 2)(2, MenuIconComponent_ng_container_0_ng_template_2_Template, 2, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
301
|
+
i0.ɵɵelementContainerEnd();
|
|
302
|
+
} if (rf & 2) {
|
|
303
|
+
const materialIcon_r2 = i0.ɵɵreference(3);
|
|
304
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
305
|
+
i0.ɵɵadvance();
|
|
306
|
+
i0.ɵɵproperty("ngIf", !ctx_r0.menuItem.materialIcon)("ngIfElse", materialIcon_r2);
|
|
307
|
+
} }
|
|
308
|
+
class MenuIconComponent {
|
|
309
|
+
constructor() {
|
|
310
|
+
this.svgExtension = MENU_ICON_STRAPI_EXTENSION;
|
|
311
|
+
}
|
|
312
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
313
|
+
isIconMediaType(icon) {
|
|
314
|
+
return typeof icon !== "string";
|
|
315
|
+
}
|
|
316
|
+
static { this.ɵfac = function MenuIconComponent_Factory(t) { return new (t || MenuIconComponent)(); }; }
|
|
317
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuIconComponent, selectors: [["tld-menu-icon"]], inputs: { menuItem: "menuItem" }, decls: 1, vars: 1, consts: [["materialIcon", ""], [4, "ngIf"], ["class", "menu-icon", 3, "svgIcon", 4, "ngIf", "ngIfElse"], [1, "menu-icon", 3, "svgIcon"], [1, "menu-icon"]], template: function MenuIconComponent_Template(rf, ctx) { if (rf & 1) {
|
|
318
|
+
i0.ɵɵtemplate(0, MenuIconComponent_ng_container_0_Template, 4, 2, "ng-container", 1);
|
|
319
|
+
} if (rf & 2) {
|
|
320
|
+
i0.ɵɵproperty("ngIf", ctx.menuItem.icon);
|
|
321
|
+
} }, dependencies: [i3.NgIf, i2$1.MatIcon], styles: [".menu-icon[_ngcontent-%COMP%]{color:var(--base-40);margin:auto;min-width:24px;min-height:24px;max-width:24px;max-height:24px;vertical-align:middle}"] }); }
|
|
322
|
+
}
|
|
323
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuIconComponent, [{
|
|
324
|
+
type: Component,
|
|
325
|
+
args: [{ selector: 'tld-menu-icon', template: "<ng-container *ngIf=\"menuItem.icon\">\r\n <mat-icon class=\"menu-icon\" [svgIcon]=\"menuItem.icon\" *ngIf=\"!menuItem.materialIcon; else materialIcon;\"></mat-icon>\r\n <ng-template #materialIcon>\r\n <mat-icon class=\"menu-icon\">{{menuItem.icon}}</mat-icon>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".menu-icon{color:var(--base-40);margin:auto;min-width:24px;min-height:24px;max-width:24px;max-height:24px;vertical-align:middle}\n"] }]
|
|
326
|
+
}], null, { menuItem: [{
|
|
327
|
+
type: Input
|
|
328
|
+
}] }); })();
|
|
329
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuIconComponent, { className: "MenuIconComponent", filePath: "lib\\components\\menu-icon\\menu-icon.component.ts", lineNumber: 10 }); })();
|
|
295
330
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
331
|
+
function MenuItemLinkComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
332
|
+
i0.ɵɵelementContainerStart(0);
|
|
333
|
+
i0.ɵɵelement(1, "tld-menu-icon", 3);
|
|
334
|
+
i0.ɵɵelementContainerEnd();
|
|
335
|
+
} if (rf & 2) {
|
|
336
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
337
|
+
i0.ɵɵadvance();
|
|
338
|
+
i0.ɵɵproperty("menuItem", ctx_r0.menuItem);
|
|
339
|
+
} }
|
|
340
|
+
function MenuItemLinkComponent_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
341
|
+
i0.ɵɵelementStart(0, "span", 4)(1, "span", 5);
|
|
342
|
+
i0.ɵɵpipe(2, "translate");
|
|
343
|
+
i0.ɵɵtext(3);
|
|
344
|
+
i0.ɵɵpipe(4, "translate");
|
|
345
|
+
i0.ɵɵelementEnd()();
|
|
346
|
+
} if (rf & 2) {
|
|
347
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
348
|
+
i0.ɵɵadvance();
|
|
349
|
+
i0.ɵɵattribute("content", i0.ɵɵpipeBind1(2, 2, ctx_r0.menuItem.title));
|
|
350
|
+
i0.ɵɵadvance(2);
|
|
351
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 4, ctx_r0.menuItem.title), " ");
|
|
352
|
+
} }
|
|
353
|
+
class MenuItemLinkComponent {
|
|
354
|
+
get menuItemLayout() {
|
|
355
|
+
return this.direction === MenuLayoutDirection.column ? 'column' : 'row';
|
|
356
|
+
}
|
|
357
|
+
get menuLayoutDirection() {
|
|
358
|
+
return (this.direction === MenuLayoutDirection.column || !this.labelsVisible)
|
|
359
|
+
? 'start center' : 'start start';
|
|
360
|
+
}
|
|
361
|
+
constructor(strapiLinkService, placeholderService) {
|
|
362
|
+
this.strapiLinkService = strapiLinkService;
|
|
363
|
+
this.placeholderService = placeholderService;
|
|
364
|
+
this.showIcons = true;
|
|
365
|
+
this.updateTextWithPlaceholders = (textWithReplacedPlaceholders) => this.href = textWithReplacedPlaceholders;
|
|
366
|
+
}
|
|
367
|
+
ngOnInit() {
|
|
368
|
+
this.textWithPlaceholders = this.menuItem.link;
|
|
369
|
+
this.placeholderServiceId = this.placeholderService.register(this);
|
|
370
|
+
}
|
|
371
|
+
linkClick(event, item) {
|
|
372
|
+
this.strapiLinkService.strapiLinkClick(event, item.externalLink);
|
|
373
|
+
}
|
|
374
|
+
ngOnDestroy() {
|
|
375
|
+
this.placeholderService.unregister(this.placeholderServiceId);
|
|
376
|
+
}
|
|
377
|
+
static { this.ɵfac = function MenuItemLinkComponent_Factory(t) { return new (t || MenuItemLinkComponent)(i0.ɵɵdirectiveInject(i1.StrapiLinkService), i0.ɵɵdirectiveInject(i1.StrapiVariablesService)); }; }
|
|
378
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuItemLinkComponent, selectors: [["tld-menu-item-link"]], inputs: { direction: "direction", labelsVisible: "labelsVisible", activeItem: "activeItem", showIcons: "showIcons", menuItem: "menuItem" }, decls: 5, vars: 17, consts: [["matTooltipPosition", "after", "matTooltipClass", "menu-tooltip", "fxLayoutGap", "0.375rem", 1, "text-m", "menu-item", 3, "click", "libPlausibleEvent", "fxLayout", "ngClass.lt-md", "matTooltip", "fxLayoutAlign", "href"], [4, "ngIf"], ["class", "menu-item-title", 4, "ngIf"], [3, "menuItem"], [1, "menu-item-title"], [1, "title-content"]], template: function MenuItemLinkComponent_Template(rf, ctx) { if (rf & 1) {
|
|
379
|
+
i0.ɵɵelementStart(0, "a", 0);
|
|
380
|
+
i0.ɵɵpipe(1, "translate");
|
|
381
|
+
i0.ɵɵpipe(2, "translate");
|
|
382
|
+
i0.ɵɵlistener("click", function MenuItemLinkComponent_Template_a_click_0_listener($event) { return ctx.linkClick($event, ctx.menuItem); });
|
|
383
|
+
i0.ɵɵtemplate(3, MenuItemLinkComponent_ng_container_3_Template, 2, 1, "ng-container", 1)(4, MenuItemLinkComponent_span_4_Template, 5, 6, "span", 2);
|
|
384
|
+
i0.ɵɵelementEnd();
|
|
385
|
+
} if (rf & 2) {
|
|
386
|
+
i0.ɵɵclassProp("text-center", ctx.menuItemLayout === "column")("active-menu-item", ctx.menuItem === ctx.activeItem);
|
|
387
|
+
i0.ɵɵproperty("libPlausibleEvent", ctx.menuItem.plausibleEvent)("fxLayout", ctx.menuItemLayout)("ngClass.lt-md", "mobile")("matTooltip", !ctx.labelsVisible ? i0.ɵɵpipeBind1(1, 13, ctx.menuItem.title) : "")("fxLayoutAlign", ctx.menuLayoutDirection)("href", i0.ɵɵpipeBind1(2, 15, ctx.href), i0.ɵɵsanitizeUrl);
|
|
388
|
+
i0.ɵɵattribute("target", ctx.menuItem.externalLink ? "_blank" : "_self");
|
|
389
|
+
i0.ɵɵadvance(3);
|
|
390
|
+
i0.ɵɵproperty("ngIf", ctx.showIcons && ctx.menuItem.icon);
|
|
391
|
+
i0.ɵɵadvance();
|
|
392
|
+
i0.ɵɵproperty("ngIf", ctx.labelsVisible);
|
|
393
|
+
} }, dependencies: [i2$2.DefaultLayoutDirective, i2$2.DefaultLayoutGapDirective, i2$2.DefaultLayoutAlignDirective, i3$1.DefaultClassDirective, i3.NgIf, i5.MatTooltip, i2.PlausibleEventDirective, MenuIconComponent, i9.TranslatePipe] }); }
|
|
394
|
+
}
|
|
395
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemLinkComponent, [{
|
|
396
|
+
type: Component,
|
|
397
|
+
args: [{ selector: 'tld-menu-item-link', template: "<a [libPlausibleEvent]=\"menuItem.plausibleEvent\" [fxLayout]=\"menuItemLayout\"\r\n [ngClass.lt-md]=\"'mobile'\" [class.text-center]=\"menuItemLayout === 'column'\" class=\"text-m menu-item\"\r\n [matTooltip]=\"!labelsVisible ? (menuItem.title | translate) : ''\" matTooltipPosition=\"after\"\r\n [fxLayoutAlign]=\"menuLayoutDirection\" matTooltipClass=\"menu-tooltip\" (click)=\"linkClick($event, menuItem)\"\r\n [href]=\"href | translate\" [attr.target]=\"menuItem.externalLink?'_blank': '_self'\" fxLayoutGap=\"0.375rem\"\r\n [class.active-menu-item]=\"menuItem === activeItem\">\r\n <ng-container *ngIf=\"showIcons && menuItem.icon\">\r\n <tld-menu-icon [menuItem]=\"menuItem\"></tld-menu-icon>\r\n </ng-container>\r\n <span *ngIf=\"labelsVisible\" class=\"menu-item-title\">\r\n <span class=\"title-content\" [attr.content]=\"menuItem.title | translate\">\r\n {{ menuItem.title | translate}}\r\n </span>\r\n </span>\r\n</a>\r\n" }]
|
|
398
|
+
}], () => [{ type: i1.StrapiLinkService }, { type: i1.StrapiVariablesService }], { direction: [{
|
|
399
|
+
type: Input
|
|
400
|
+
}], labelsVisible: [{
|
|
401
|
+
type: Input
|
|
402
|
+
}], activeItem: [{
|
|
403
|
+
type: Input
|
|
404
|
+
}], showIcons: [{
|
|
405
|
+
type: Input
|
|
406
|
+
}], menuItem: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}] }); })();
|
|
409
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuItemLinkComponent, { className: "MenuItemLinkComponent", filePath: "lib\\components\\menu-item-link\\menu-item-link.component.ts", lineNumber: 10 }); })();
|
|
337
410
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
i0.ɵɵ
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
411
|
+
const _c0$2 = a0 => ({ menuItem: a0 });
|
|
412
|
+
function MenuItemListComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
413
|
+
i0.ɵɵelementStart(0, "div", 6);
|
|
414
|
+
i0.ɵɵtext(1);
|
|
415
|
+
i0.ɵɵpipe(2, "translate");
|
|
416
|
+
i0.ɵɵelementEnd();
|
|
417
|
+
} if (rf & 2) {
|
|
418
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
419
|
+
i0.ɵɵadvance();
|
|
420
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.titleKey), " ");
|
|
421
|
+
} }
|
|
422
|
+
function MenuItemListComponent_ng_container_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
423
|
+
i0.ɵɵelementContainer(0);
|
|
424
|
+
} }
|
|
425
|
+
function MenuItemListComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
426
|
+
i0.ɵɵelementContainerStart(0);
|
|
427
|
+
i0.ɵɵtemplate(1, MenuItemListComponent_ng_container_3_ng_container_1_Template, 1, 0, "ng-container", 7);
|
|
428
|
+
i0.ɵɵelementContainerEnd();
|
|
429
|
+
} if (rf & 2) {
|
|
430
|
+
const menuItem_r2 = ctx.$implicit;
|
|
431
|
+
i0.ɵɵnextContext();
|
|
432
|
+
const itemWithChildren_r3 = i0.ɵɵreference(5);
|
|
433
|
+
const menuItemLink_r4 = i0.ɵɵreference(7);
|
|
434
|
+
i0.ɵɵadvance();
|
|
435
|
+
i0.ɵɵproperty("ngTemplateOutlet", !menuItem_r2.showChildren || !menuItem_r2.children || (menuItem_r2 == null ? null : menuItem_r2.children == null ? null : menuItem_r2.children.length) === 0 ? menuItemLink_r4 : itemWithChildren_r3)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c0$2, menuItem_r2));
|
|
436
|
+
} }
|
|
437
|
+
function MenuItemListComponent_ng_template_4_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
438
|
+
i0.ɵɵelementContainerStart(0);
|
|
439
|
+
i0.ɵɵelement(1, "tld-menu-icon", 10);
|
|
440
|
+
i0.ɵɵelementContainerEnd();
|
|
441
|
+
} if (rf & 2) {
|
|
442
|
+
const menuItem_r6 = i0.ɵɵnextContext().menuItem;
|
|
443
|
+
i0.ɵɵadvance();
|
|
444
|
+
i0.ɵɵproperty("menuItem", menuItem_r6);
|
|
445
|
+
} }
|
|
446
|
+
function MenuItemListComponent_ng_template_4_ng_container_3_span_5_Template(rf, ctx) { if (rf & 1) {
|
|
447
|
+
i0.ɵɵelementStart(0, "span", 14);
|
|
448
|
+
i0.ɵɵtext(1);
|
|
449
|
+
i0.ɵɵelementEnd();
|
|
450
|
+
} if (rf & 2) {
|
|
451
|
+
const menuItem_r6 = i0.ɵɵnextContext(2).menuItem;
|
|
452
|
+
i0.ɵɵadvance();
|
|
453
|
+
i0.ɵɵtextInterpolate1(" ", menuItem_r6.expanded ? "arrow_drop_up" : "arrow_drop_down", " ");
|
|
454
|
+
} }
|
|
455
|
+
function MenuItemListComponent_ng_template_4_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
456
|
+
i0.ɵɵelementContainerStart(0);
|
|
457
|
+
i0.ɵɵelementStart(1, "span", 11)(2, "span", 12);
|
|
458
|
+
i0.ɵɵtext(3);
|
|
459
|
+
i0.ɵɵpipe(4, "translate");
|
|
460
|
+
i0.ɵɵelementEnd()();
|
|
461
|
+
i0.ɵɵtemplate(5, MenuItemListComponent_ng_template_4_ng_container_3_span_5_Template, 2, 1, "span", 13);
|
|
462
|
+
i0.ɵɵelementContainerEnd();
|
|
463
|
+
} if (rf & 2) {
|
|
464
|
+
const menuItem_r6 = i0.ɵɵnextContext().menuItem;
|
|
465
|
+
i0.ɵɵadvance(3);
|
|
466
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 2, menuItem_r6.title));
|
|
467
|
+
i0.ɵɵadvance(2);
|
|
468
|
+
i0.ɵɵproperty("ngIf", menuItem_r6.showChildren && menuItem_r6.children);
|
|
469
|
+
} }
|
|
470
|
+
function MenuItemListComponent_ng_template_4_ng_container_4_menu_item_list_1_Template(rf, ctx) { if (rf & 1) {
|
|
471
|
+
i0.ɵɵelement(0, "menu-item-list", 16);
|
|
472
|
+
} if (rf & 2) {
|
|
473
|
+
const menuItem_r6 = i0.ɵɵnextContext(2).menuItem;
|
|
474
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
475
|
+
i0.ɵɵproperty("items", menuItem_r6.children)("direction", ctx_r0.direction)("labelsVisible", ctx_r0.labelsVisible)("activeItem", ctx_r0.activeItem);
|
|
476
|
+
} }
|
|
477
|
+
function MenuItemListComponent_ng_template_4_ng_container_4_Template(rf, ctx) { if (rf & 1) {
|
|
478
|
+
i0.ɵɵelementContainerStart(0);
|
|
479
|
+
i0.ɵɵtemplate(1, MenuItemListComponent_ng_template_4_ng_container_4_menu_item_list_1_Template, 1, 4, "menu-item-list", 15);
|
|
480
|
+
i0.ɵɵelementContainerEnd();
|
|
481
|
+
} if (rf & 2) {
|
|
482
|
+
const menuItem_r6 = i0.ɵɵnextContext().menuItem;
|
|
483
|
+
i0.ɵɵadvance();
|
|
484
|
+
i0.ɵɵproperty("ngIf", menuItem_r6.children && menuItem_r6.children.length);
|
|
485
|
+
} }
|
|
486
|
+
function MenuItemListComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
|
|
487
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
488
|
+
i0.ɵɵelementStart(0, "button", 8);
|
|
489
|
+
i0.ɵɵpipe(1, "translate");
|
|
490
|
+
i0.ɵɵlistener("click", function MenuItemListComponent_ng_template_4_Template_button_click_0_listener($event) { const menuItem_r6 = i0.ɵɵrestoreView(_r5).menuItem; const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.toggleItemExpand($event, menuItem_r6)); });
|
|
491
|
+
i0.ɵɵtemplate(2, MenuItemListComponent_ng_template_4_ng_container_2_Template, 2, 1, "ng-container", 9)(3, MenuItemListComponent_ng_template_4_ng_container_3_Template, 6, 4, "ng-container", 9);
|
|
492
|
+
i0.ɵɵelementEnd();
|
|
493
|
+
i0.ɵɵtemplate(4, MenuItemListComponent_ng_template_4_ng_container_4_Template, 2, 1, "ng-container", 9);
|
|
494
|
+
} if (rf & 2) {
|
|
495
|
+
const menuItem_r6 = ctx.menuItem;
|
|
496
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
497
|
+
i0.ɵɵclassProp("text-center", ctx_r0.menuItemLayout === "column")("menu-labels-visible", ctx_r0.labelsVisible)("active-menu-item", (ctx_r0.activeItem == null ? null : ctx_r0.activeItem.link) && menuItem_r6 === ctx_r0.activeItem);
|
|
498
|
+
i0.ɵɵproperty("fxLayout", ctx_r0.menuItemLayout)("matTooltip", !ctx_r0.labelsVisible ? i0.ɵɵpipeBind1(1, 12, menuItem_r6.title) : "")("fxLayoutAlign", ctx_r0.menuLayoutDirection);
|
|
499
|
+
i0.ɵɵadvance(2);
|
|
500
|
+
i0.ɵɵproperty("ngIf", ctx_r0.showIcons && menuItem_r6.icon);
|
|
501
|
+
i0.ɵɵadvance();
|
|
502
|
+
i0.ɵɵproperty("ngIf", ctx_r0.labelsVisible);
|
|
503
|
+
i0.ɵɵadvance();
|
|
504
|
+
i0.ɵɵproperty("ngIf", menuItem_r6.showChildren && menuItem_r6.expanded && ctx_r0.labelsVisible);
|
|
505
|
+
} }
|
|
506
|
+
function MenuItemListComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
507
|
+
i0.ɵɵelement(0, "tld-menu-item-link", 17);
|
|
508
|
+
} if (rf & 2) {
|
|
509
|
+
const menuItem_r7 = ctx.menuItem;
|
|
510
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
511
|
+
i0.ɵɵproperty("ngClass.lt-md", "mob-menu-item")("menuItem", menuItem_r7)("direction", ctx_r0.direction)("labelsVisible", ctx_r0.labelsVisible)("activeItem", ctx_r0.activeItem)("showIcons", ctx_r0.showIcons);
|
|
512
|
+
} }
|
|
513
|
+
class MenuItemListComponent {
|
|
514
|
+
constructor() {
|
|
515
|
+
this.direction = MenuLayoutDirection.column;
|
|
516
|
+
this.labelsVisible = true;
|
|
517
|
+
this.showIcons = true;
|
|
518
|
+
this.items = [];
|
|
519
|
+
this.toggleExpand = new EventEmitter();
|
|
520
|
+
}
|
|
521
|
+
get titleKey() {
|
|
522
|
+
return this.menuItemGroup?.title;
|
|
523
|
+
}
|
|
524
|
+
get showTitle() {
|
|
525
|
+
return this.menuItemGroup?.showTitle;
|
|
526
|
+
}
|
|
527
|
+
get menuLayoutDirection() {
|
|
528
|
+
return (this.direction === MenuLayoutDirection.column || !this.labelsVisible)
|
|
529
|
+
? 'start center' : 'start start';
|
|
530
|
+
}
|
|
531
|
+
get menuItemLayout() {
|
|
532
|
+
return this.direction === MenuLayoutDirection.column ? 'column' : 'row';
|
|
533
|
+
}
|
|
534
|
+
toggleItemExpand(event, menuItem) {
|
|
535
|
+
// so menu doesnt get closed.
|
|
536
|
+
event.stopPropagation();
|
|
537
|
+
if (this.labelsVisible || !menuItem.expanded) {
|
|
538
|
+
menuItem.expanded = !menuItem.expanded;
|
|
539
|
+
}
|
|
540
|
+
this.toggleExpand.next(menuItem);
|
|
541
|
+
}
|
|
542
|
+
static { this.ɵfac = function MenuItemListComponent_Factory(t) { return new (t || MenuItemListComponent)(); }; }
|
|
543
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuItemListComponent, selectors: [["menu-item-list"]], inputs: { direction: "direction", labelsVisible: "labelsVisible", activeItem: "activeItem", showIcons: "showIcons", items: "items", menuItemGroup: "menuItemGroup" }, outputs: { toggleExpand: "toggleExpand" }, decls: 8, vars: 3, consts: [["itemWithChildren", ""], ["menuItemLink", ""], [1, "menu-list-wrapper"], ["fxLayoutAlign", "start center", "class", "menu-item-list-title", 4, "ngIf"], ["fxLayout", "column", 1, "menu-item-list", 3, "fxLayoutAlign"], [4, "ngFor", "ngForOf"], ["fxLayoutAlign", "start center", 1, "menu-item-list-title"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], ["matTooltipPosition", "after", "matTooltipClass", "menu-tooltip", "fxLayoutGap", "0.375rem", 1, "text-m", "menu-item", 3, "click", "fxLayout", "matTooltip", "fxLayoutAlign"], [4, "ngIf"], [3, "menuItem"], [1, "menu-item-title"], [1, "title-content"], ["class", "material-icons", 4, "ngIf"], [1, "material-icons"], ["class", "child-list", 3, "items", "direction", "labelsVisible", "activeItem", 4, "ngIf"], [1, "child-list", 3, "items", "direction", "labelsVisible", "activeItem"], [3, "ngClass.lt-md", "menuItem", "direction", "labelsVisible", "activeItem", "showIcons"]], template: function MenuItemListComponent_Template(rf, ctx) { if (rf & 1) {
|
|
544
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
545
|
+
i0.ɵɵtemplate(1, MenuItemListComponent_div_1_Template, 3, 3, "div", 3);
|
|
546
|
+
i0.ɵɵelementStart(2, "div", 4);
|
|
547
|
+
i0.ɵɵtemplate(3, MenuItemListComponent_ng_container_3_Template, 2, 4, "ng-container", 5);
|
|
548
|
+
i0.ɵɵelementEnd()();
|
|
549
|
+
i0.ɵɵtemplate(4, MenuItemListComponent_ng_template_4_Template, 5, 14, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(6, MenuItemListComponent_ng_template_6_Template, 1, 6, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
|
|
550
|
+
} if (rf & 2) {
|
|
551
|
+
i0.ɵɵadvance();
|
|
552
|
+
i0.ɵɵproperty("ngIf", ctx.titleKey && ctx.showTitle && ctx.labelsVisible);
|
|
553
|
+
i0.ɵɵadvance();
|
|
554
|
+
i0.ɵɵproperty("fxLayoutAlign", ctx.menuLayoutDirection);
|
|
555
|
+
i0.ɵɵadvance();
|
|
556
|
+
i0.ɵɵproperty("ngForOf", ctx.items);
|
|
557
|
+
} }, dependencies: [i2$2.DefaultLayoutDirective, i2$2.DefaultLayoutGapDirective, i2$2.DefaultLayoutAlignDirective, i3$1.DefaultClassDirective, i3.NgForOf, i3.NgIf, i3.NgTemplateOutlet, i5.MatTooltip, MenuItemListComponent, MenuIconComponent, MenuItemLinkComponent, i9.TranslatePipe], styles: ["[_nghost-%COMP%]{margin:1em 0;display:inline-block}[_nghost-%COMP%] .menu-list-wrapper .menu-item-list-title{margin-bottom:1em;font-size:1rem;font-weight:500;line-height:1.5rem}[_nghost-%COMP%] .menu-list-wrapper .text-center{text-align:center}[_nghost-%COMP%] .menu-list-wrapper tld-menu-item-link+tld-menu-item-link, [_nghost-%COMP%] .menu-list-wrapper tld-menu-item-link+.menu-item, [_nghost-%COMP%] .menu-list-wrapper .menu-item+tld-menu-item-link, [_nghost-%COMP%] .menu-list-wrapper .menu-item+.menu-item{margin-top:1.5625em}[_nghost-%COMP%] .menu-list-wrapper .child-list tld-menu-item-link{margin-top:1em}[_nghost-%COMP%] .menu-list-wrapper .menu-labels-visible{width:100%}[_nghost-%COMP%] .menu-list-wrapper .menu-item{cursor:pointer;font-style:normal;color:var(--base-30);text-decoration:none;align-items:center!important;font-weight:400;background:none;border:none}[_nghost-%COMP%] .menu-list-wrapper .menu-item:focus-visible{outline:black solid 2px}[_nghost-%COMP%] .menu-list-wrapper .menu-item:not(button):hover{font-weight:600}[_nghost-%COMP%] .menu-list-wrapper .menu-item.active-menu-item, [_nghost-%COMP%] .menu-list-wrapper .menu-item.active-menu-item mat-icon, [_nghost-%COMP%] .menu-list-wrapper .menu-item.active-menu-item:hover{color:var(--primary-accent)!important;font-weight:600}[_nghost-%COMP%] .menu-list-wrapper .menu-item span{display:inline-block}[_nghost-%COMP%] .menu-list-wrapper .menu-item .menu-item-title{display:flex;flex-direction:row;align-items:start;width:100%}[_nghost-%COMP%] .menu-list-wrapper .menu-item .menu-item-title .title-content{display:block}[_nghost-%COMP%] .menu-list-wrapper .menu-item .menu-item-title .title-content:before{display:block;content:attr(content);font-weight:600;height:0;overflow:hidden;visibility:hidden}.child-list[_nghost-%COMP%]{margin-bottom:1rem}.child-list[_nghost-%COMP%] .menu-item[_ngcontent-%COMP%] + .menu-item[_ngcontent-%COMP%]{margin-top:.5rem} .menu-tooltip{left:.625rem;font-family:Roboto;font-style:normal;font-weight:400;font-size:.75rem;line-height:1.25rem;color:var(--base-70);border-radius:.25rem;position:relative} .menu-tooltip:after{width:0;height:0;content:\"\";position:absolute;border-left:.5rem solid transparent;border-right:.5rem solid transparent;border-bottom:.5rem solid var(--menu-border-dark-color);left:-.75rem;top:calc(50% - .25rem);transform:rotate(270deg);overflow:initial}menu-item-list[_ngcontent-%COMP%]{padding-left:30px;margin:0}.mob-menu-item[_ngcontent-%COMP%]{width:100%}"] }); }
|
|
558
|
+
}
|
|
559
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemListComponent, [{
|
|
560
|
+
type: Component,
|
|
561
|
+
args: [{ selector: 'menu-item-list', template: "<div class=\"menu-list-wrapper\">\r\n <div *ngIf=\"titleKey && showTitle && labelsVisible\" fxLayoutAlign=\"start center\" class=\"menu-item-list-title\">\r\n {{ titleKey | translate }}\r\n </div>\r\n <div fxLayout=\"column\" [fxLayoutAlign]=\"menuLayoutDirection\" class=\"menu-item-list\">\r\n <ng-container *ngFor=\"let menuItem of items\">\r\n <ng-container\r\n *ngTemplateOutlet=\"!menuItem.showChildren || !menuItem.children || menuItem?.children?.length === 0 ? menuItemLink : itemWithChildren; context: {menuItem: menuItem}\">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n\r\n<ng-template #itemWithChildren let-menuItem=\"menuItem\">\r\n <button [fxLayout]=\"menuItemLayout\" [class.text-center]=\"menuItemLayout === 'column'\" class=\"text-m menu-item\"\r\n [matTooltip]=\"!labelsVisible ? (menuItem.title | translate) : ''\" matTooltipPosition=\"after\" [class.menu-labels-visible]=\"labelsVisible\"\r\n [fxLayoutAlign]=\"menuLayoutDirection\" matTooltipClass=\"menu-tooltip\" fxLayoutGap=\"0.375rem\"\r\n [class.active-menu-item]=\"activeItem?.link && menuItem === activeItem\" (click)=\"toggleItemExpand($event,menuItem)\">\r\n <ng-container *ngIf=\"showIcons && menuItem.icon\">\r\n <tld-menu-icon [menuItem]=\"menuItem\"></tld-menu-icon>\r\n </ng-container>\r\n <ng-container *ngIf=\"labelsVisible\">\r\n <span class=\"menu-item-title\">\r\n <span class=\"title-content\">{{ menuItem.title | translate }}</span></span>\r\n <span class=\"material-icons\" *ngIf=\"menuItem.showChildren && menuItem.children\">\r\n {{ menuItem.expanded ? 'arrow_drop_up' : 'arrow_drop_down' }}\r\n </span>\r\n </ng-container>\r\n </button>\r\n <ng-container *ngIf=\"menuItem.showChildren && menuItem.expanded && labelsVisible\">\r\n <menu-item-list class=\"child-list\" *ngIf=\"menuItem.children && menuItem.children.length\" [items]=\"menuItem.children\"\r\n [direction]=\"direction\" [labelsVisible]=\"labelsVisible\" [activeItem]=\"activeItem\">\r\n </menu-item-list>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #menuItemLink let-menuItem=\"menuItem\">\r\n <tld-menu-item-link [ngClass.lt-md]=\"'mob-menu-item'\" [menuItem]=\"menuItem\" [direction]=\"direction\" [labelsVisible]=\"labelsVisible\"\r\n [activeItem]=\"activeItem\" [showIcons]=\"showIcons\"></tld-menu-item-link>\r\n</ng-template>", styles: [":host{margin:1em 0;display:inline-block}:host::ng-deep .menu-list-wrapper .menu-item-list-title{margin-bottom:1em;font-size:1rem;font-weight:500;line-height:1.5rem}:host::ng-deep .menu-list-wrapper .text-center{text-align:center}:host::ng-deep .menu-list-wrapper tld-menu-item-link+tld-menu-item-link,:host::ng-deep .menu-list-wrapper tld-menu-item-link+.menu-item,:host::ng-deep .menu-list-wrapper .menu-item+tld-menu-item-link,:host::ng-deep .menu-list-wrapper .menu-item+.menu-item{margin-top:1.5625em}:host::ng-deep .menu-list-wrapper .child-list tld-menu-item-link{margin-top:1em}:host::ng-deep .menu-list-wrapper .menu-labels-visible{width:100%}:host::ng-deep .menu-list-wrapper .menu-item{cursor:pointer;font-style:normal;color:var(--base-30);text-decoration:none;align-items:center!important;font-weight:400;background:none;border:none}:host::ng-deep .menu-list-wrapper .menu-item:focus-visible{outline:black solid 2px}:host::ng-deep .menu-list-wrapper .menu-item:not(button):hover{font-weight:600}:host::ng-deep .menu-list-wrapper .menu-item.active-menu-item,:host::ng-deep .menu-list-wrapper .menu-item.active-menu-item mat-icon,:host::ng-deep .menu-list-wrapper .menu-item.active-menu-item:hover{color:var(--primary-accent)!important;font-weight:600}:host::ng-deep .menu-list-wrapper .menu-item span{display:inline-block}:host::ng-deep .menu-list-wrapper .menu-item .menu-item-title{display:flex;flex-direction:row;align-items:start;width:100%}:host::ng-deep .menu-list-wrapper .menu-item .menu-item-title .title-content{display:block}:host::ng-deep .menu-list-wrapper .menu-item .menu-item-title .title-content:before{display:block;content:attr(content);font-weight:600;height:0;overflow:hidden;visibility:hidden}:host.child-list{margin-bottom:1rem}:host.child-list .menu-item+.menu-item{margin-top:.5rem}::ng-deep .menu-tooltip{left:.625rem;font-family:Roboto;font-style:normal;font-weight:400;font-size:.75rem;line-height:1.25rem;color:var(--base-70);border-radius:.25rem;position:relative}::ng-deep .menu-tooltip:after{width:0;height:0;content:\"\";position:absolute;border-left:.5rem solid transparent;border-right:.5rem solid transparent;border-bottom:.5rem solid var(--menu-border-dark-color);left:-.75rem;top:calc(50% - .25rem);transform:rotate(270deg);overflow:initial}menu-item-list{padding-left:30px;margin:0}.mob-menu-item{width:100%}\n"] }]
|
|
562
|
+
}], null, { direction: [{
|
|
563
|
+
type: Input
|
|
564
|
+
}], labelsVisible: [{
|
|
565
|
+
type: Input
|
|
566
|
+
}], activeItem: [{
|
|
567
|
+
type: Input
|
|
568
|
+
}], showIcons: [{
|
|
569
|
+
type: Input
|
|
570
|
+
}], items: [{
|
|
571
|
+
type: Input
|
|
572
|
+
}], menuItemGroup: [{
|
|
573
|
+
type: Input
|
|
574
|
+
}], toggleExpand: [{
|
|
575
|
+
type: Output
|
|
576
|
+
}] }); })();
|
|
577
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuItemListComponent, { className: "MenuItemListComponent", filePath: "lib\\components\\menu-item-list\\menu-item-list.component.ts", lineNumber: 11 }); })();
|
|
388
578
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
579
|
+
function MenuColumnsComponent_ng_container_0_menu_item_list_1_Template(rf, ctx) { if (rf & 1) {
|
|
580
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
581
|
+
i0.ɵɵelementStart(0, "menu-item-list", 3);
|
|
582
|
+
i0.ɵɵlistener("toggleExpand", function MenuColumnsComponent_ng_container_0_menu_item_list_1_Template_menu_item_list_toggleExpand_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.elementExpanded($event)); });
|
|
583
|
+
i0.ɵɵelementEnd();
|
|
584
|
+
} if (rf & 2) {
|
|
585
|
+
const group_r3 = i0.ɵɵnextContext().$implicit;
|
|
586
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
587
|
+
i0.ɵɵproperty("activeItem", ctx_r1.activeItem)("direction", ctx_r1.direction)("labelsVisible", ctx_r1.labelsVisible)("menuItemGroup", group_r3)("items", group_r3.items);
|
|
588
|
+
} }
|
|
589
|
+
function MenuColumnsComponent_ng_container_0_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
590
|
+
i0.ɵɵelementStart(0, "div", 4);
|
|
591
|
+
i0.ɵɵelement(1, "mat-divider");
|
|
592
|
+
i0.ɵɵelementEnd();
|
|
593
|
+
} }
|
|
594
|
+
function MenuColumnsComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
595
|
+
i0.ɵɵelementContainerStart(0);
|
|
596
|
+
i0.ɵɵtemplate(1, MenuColumnsComponent_ng_container_0_menu_item_list_1_Template, 1, 5, "menu-item-list", 1)(2, MenuColumnsComponent_ng_container_0_div_2_Template, 2, 0, "div", 2);
|
|
597
|
+
i0.ɵɵelementContainerEnd();
|
|
598
|
+
} if (rf & 2) {
|
|
599
|
+
const group_r3 = ctx.$implicit;
|
|
600
|
+
i0.ɵɵadvance();
|
|
601
|
+
i0.ɵɵproperty("ngIf", group_r3.items.length);
|
|
602
|
+
i0.ɵɵadvance();
|
|
603
|
+
i0.ɵɵproperty("ngIf", group_r3.bottomDivider && group_r3.items.length);
|
|
604
|
+
} }
|
|
605
|
+
class MenuColumnsComponent {
|
|
606
|
+
get active() { return this._active; }
|
|
607
|
+
set active(value) {
|
|
608
|
+
this._active = value;
|
|
609
|
+
if (!value) {
|
|
610
|
+
this.activeItem = undefined;
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
this.elementExpanded(this.active?.root);
|
|
614
|
+
}
|
|
615
|
+
get mergedGroups() { return this.menuItemsService.mergedGroups; }
|
|
616
|
+
constructor(router, menuSharedConfig, menuItemsService) {
|
|
617
|
+
this.router = router;
|
|
618
|
+
this.menuSharedConfig = menuSharedConfig;
|
|
619
|
+
this.menuItemsService = menuItemsService;
|
|
620
|
+
this.direction = MenuLayoutDirection.column;
|
|
621
|
+
this.labelsVisible = true;
|
|
622
|
+
this.toggleCollapseEvent = new EventEmitter();
|
|
623
|
+
this.subscriptions = [];
|
|
624
|
+
}
|
|
625
|
+
ngOnInit() {
|
|
626
|
+
this.activeItem = this.active.root;
|
|
627
|
+
}
|
|
628
|
+
ngOnDestroy() {
|
|
629
|
+
this.subscriptions.forEach(sub => sub.unsubscribe());
|
|
630
|
+
}
|
|
631
|
+
elementExpanded(element) {
|
|
632
|
+
if (!this.active || !element) {
|
|
633
|
+
this.activeItem = undefined;
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
// if menu is collapsed and chilren are expandable, we should open menu
|
|
637
|
+
if (element.showChildren && !this.labelsVisible) {
|
|
638
|
+
this.toggleCollapseEvent.emit();
|
|
639
|
+
}
|
|
640
|
+
if (element.showChildren && element.expanded && element === this.active.root) {
|
|
641
|
+
this.activeItem = this.active.child;
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
this.activeItem = this.active.root;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
static { this.ɵfac = function MenuColumnsComponent_Factory(t) { return new (t || MenuColumnsComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(MENU_SHARED_CONFIG, 8), i0.ɵɵdirectiveInject(MenuItemsService)); }; }
|
|
648
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuColumnsComponent, selectors: [["menu-columns"]], inputs: { direction: "direction", labelsVisible: "labelsVisible", active: "active" }, outputs: { toggleCollapseEvent: "toggleCollapseEvent" }, decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"], [3, "activeItem", "direction", "labelsVisible", "menuItemGroup", "items", "toggleExpand", 4, "ngIf"], ["class", "divider", 4, "ngIf"], [3, "toggleExpand", "activeItem", "direction", "labelsVisible", "menuItemGroup", "items"], [1, "divider"]], template: function MenuColumnsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
649
|
+
i0.ɵɵtemplate(0, MenuColumnsComponent_ng_container_0_Template, 3, 2, "ng-container", 0);
|
|
650
|
+
} if (rf & 2) {
|
|
651
|
+
i0.ɵɵproperty("ngForOf", ctx.mergedGroups);
|
|
652
|
+
} }, dependencies: [i3.NgForOf, i3.NgIf, i4.MatDivider, MenuItemListComponent], styles: ["[_nghost-%COMP%]{display:inline-block}[_nghost-%COMP%] menu-item-list[_ngcontent-%COMP%]{display:block}"] }); }
|
|
653
|
+
}
|
|
654
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuColumnsComponent, [{
|
|
655
|
+
type: Component,
|
|
656
|
+
args: [{ selector: 'menu-columns', template: "<ng-container *ngFor=\"let group of mergedGroups\">\r\n <menu-item-list *ngIf=\"group.items.length\" [activeItem]=\"activeItem\" [direction]=\"direction\"\r\n (toggleExpand)=\"elementExpanded($event)\" [labelsVisible]=\"labelsVisible\" [menuItemGroup]=\"group\"\r\n [items]=\"group.items\">\r\n </menu-item-list>\r\n <div class=\"divider\" *ngIf=\"group.bottomDivider && group.items.length\">\r\n <mat-divider></mat-divider>\r\n </div>\r\n</ng-container>", styles: [":host{display:inline-block}:host menu-item-list{display:block}\n"] }]
|
|
657
|
+
}], () => [{ type: i1$1.Router }, { type: undefined, decorators: [{
|
|
658
|
+
type: Optional
|
|
659
|
+
}, {
|
|
660
|
+
type: Inject,
|
|
661
|
+
args: [MENU_SHARED_CONFIG]
|
|
662
|
+
}] }, { type: MenuItemsService }], { direction: [{
|
|
663
|
+
type: Input
|
|
664
|
+
}], labelsVisible: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}], toggleCollapseEvent: [{
|
|
667
|
+
type: Output
|
|
668
|
+
}], active: [{
|
|
669
|
+
type: Input
|
|
670
|
+
}] }); })();
|
|
671
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuColumnsComponent, { className: "MenuColumnsComponent", filePath: "lib\\components\\menu-columns\\menu-columns.component.ts", lineNumber: 16 }); })();
|
|
451
672
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
this.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
673
|
+
function SideNavMenuComponent_a_3_Template(rf, ctx) { if (rf & 1) {
|
|
674
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
675
|
+
i0.ɵɵelementStart(0, "a", 7);
|
|
676
|
+
i0.ɵɵpipe(1, "translate");
|
|
677
|
+
i0.ɵɵlistener("click", function SideNavMenuComponent_a_3_Template_a_click_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.logoClick($event)); });
|
|
678
|
+
i0.ɵɵelement(2, "img", 8);
|
|
679
|
+
i0.ɵɵelementEnd();
|
|
680
|
+
} if (rf & 2) {
|
|
681
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
682
|
+
i0.ɵɵproperty("libPlausibleEvent", ctx_r1.LOGOCLICK_PLAUSIBLE_EVENT)("href", ctx_r1.baseUrl, i0.ɵɵsanitizeUrl);
|
|
683
|
+
i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(1, 4, "MENU.ARIA_LABELS.LOGO"));
|
|
684
|
+
i0.ɵɵadvance(2);
|
|
685
|
+
i0.ɵɵproperty("src", ctx_r1.menuLogoImage, i0.ɵɵsanitizeUrl);
|
|
686
|
+
} }
|
|
687
|
+
class SideNavMenuComponent extends NavBaseComponent {
|
|
688
|
+
get menuLogoImage() {
|
|
689
|
+
return this.collapsed
|
|
690
|
+
? this.menuSettings.menuLogoCollapsed ?? this.menuSettings.menuLogo
|
|
691
|
+
: this.menuSettings.menuLogo;
|
|
692
|
+
}
|
|
693
|
+
get sideNavWidth() {
|
|
694
|
+
return this.collapsed ? this.menuSettings.collapsedWidth : this.menuSettings.expandedWidth;
|
|
695
|
+
}
|
|
696
|
+
constructor(strapiLinkService, domService, menuItems, menuSharedConfig) {
|
|
697
|
+
super(menuItems);
|
|
698
|
+
this.strapiLinkService = strapiLinkService;
|
|
699
|
+
this.domService = domService;
|
|
700
|
+
this.menuItems = menuItems;
|
|
701
|
+
this.COLLAPSED_LOCAL_STORAGE_KEY = "TLD_MENU_SIDE_NAV_COLLAPSED";
|
|
702
|
+
//#region Plausible event variables for collapse button
|
|
703
|
+
this.COLLAPSE_PLAUSIBLE_EVENT_ID = "collapseMenu";
|
|
704
|
+
this.COLLAPSE_PLAUSIBLE_ACTION_KEY = "action";
|
|
705
|
+
this.LOGOCLICK_PLAUSIBLE_ACTION_ID = "tilde_logo_click";
|
|
706
|
+
this.LOGOCLICK_PLAUSIBLE_EVENT = {
|
|
707
|
+
eventId: this.LOGOCLICK_PLAUSIBLE_ACTION_ID,
|
|
708
|
+
properties: []
|
|
709
|
+
};
|
|
710
|
+
this.EXPAND_PLAUSIBLE_EVENT = {
|
|
711
|
+
eventId: this.COLLAPSE_PLAUSIBLE_EVENT_ID,
|
|
712
|
+
properties: [{ key: this.COLLAPSE_PLAUSIBLE_ACTION_KEY, value: "expand" }]
|
|
713
|
+
};
|
|
714
|
+
this.COLLAPSE_PLAUSIBLE_EVENT = {
|
|
715
|
+
eventId: this.COLLAPSE_PLAUSIBLE_EVENT_ID,
|
|
716
|
+
properties: [{ key: this.COLLAPSE_PLAUSIBLE_ACTION_KEY, value: "collapse" }]
|
|
717
|
+
};
|
|
718
|
+
//#endregion
|
|
719
|
+
this.menuSettings = {
|
|
720
|
+
expandedWidth: '9.375em',
|
|
721
|
+
collapsedWidth: '5em',
|
|
722
|
+
menuLogo: '',
|
|
723
|
+
menuLogoCollapsed: '',
|
|
724
|
+
disableStrapi: false
|
|
725
|
+
};
|
|
726
|
+
this.collapsed = false;
|
|
727
|
+
this.baseUrl = menuSharedConfig.baseUrl || '';
|
|
728
|
+
}
|
|
729
|
+
ngOnInit() {
|
|
730
|
+
super.ngOnInit();
|
|
731
|
+
this.getColapsedFromLocalStorage();
|
|
732
|
+
}
|
|
733
|
+
logoClick(event) {
|
|
734
|
+
this.strapiLinkService.strapiLinkClick(event);
|
|
735
|
+
}
|
|
736
|
+
toggleCollapse() {
|
|
737
|
+
this.collapsed = !this.collapsed;
|
|
738
|
+
this.setColapsedFromLocalStorage();
|
|
739
|
+
}
|
|
740
|
+
getColapsedFromLocalStorage() {
|
|
741
|
+
if (!this.domService.localStorage) {
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
this.collapsed = this.domService.localStorage.getItem(this.COLLAPSED_LOCAL_STORAGE_KEY) == 'true' ? true : false;
|
|
745
|
+
}
|
|
746
|
+
setColapsedFromLocalStorage() {
|
|
747
|
+
if (!this.domService.localStorage) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
this.domService.localStorage.setItem(this.COLLAPSED_LOCAL_STORAGE_KEY, this.collapsed.toString());
|
|
751
|
+
}
|
|
752
|
+
static { this.ɵfac = function SideNavMenuComponent_Factory(t) { return new (t || SideNavMenuComponent)(i0.ɵɵdirectiveInject(i1.StrapiLinkService), i0.ɵɵdirectiveInject(i2.DOMService), i0.ɵɵdirectiveInject(MenuItemsService), i0.ɵɵdirectiveInject(MENU_SHARED_CONFIG, 8)); }; }
|
|
753
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SideNavMenuComponent, selectors: [["lib-side-nav-menu"]], inputs: { menuSettings: "menuSettings" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 10, consts: [["fxLayout", "column", 1, "menu-container"], ["fxLayout", "column", "fxFlexFill", "", 1, "content"], ["fxLayout", "row", "fxLayoutAlign", "space-between center", 1, "menu-container-header"], ["fxFlex", "3.125em", "fxLayoutAlign", "start center", 3, "libPlausibleEvent", "href", "click", 4, "ngIf"], ["mat-icon-button", "", 1, "toggler", 3, "click", "libPlausibleEvent"], ["fxLayout", "column", "fxFlex", "", 1, "menu-wrapper"], ["role", "navigation", "fxFlex", "", 3, "toggleCollapseEvent", "direction", "labelsVisible", "active"], ["fxFlex", "3.125em", "fxLayoutAlign", "start center", 3, "click", "libPlausibleEvent", "href"], ["alt", "", 1, "menu-logo", 3, "src"]], template: function SideNavMenuComponent_Template(rf, ctx) { if (rf & 1) {
|
|
754
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
|
|
755
|
+
i0.ɵɵtemplate(3, SideNavMenuComponent_a_3_Template, 3, 6, "a", 3);
|
|
756
|
+
i0.ɵɵelementStart(4, "button", 4);
|
|
757
|
+
i0.ɵɵlistener("click", function SideNavMenuComponent_Template_button_click_4_listener() { return ctx.toggleCollapse(); });
|
|
758
|
+
i0.ɵɵelementStart(5, "mat-icon");
|
|
759
|
+
i0.ɵɵtext(6);
|
|
760
|
+
i0.ɵɵelementEnd()()();
|
|
761
|
+
i0.ɵɵelementStart(7, "div", 5)(8, "menu-columns", 6);
|
|
762
|
+
i0.ɵɵlistener("toggleCollapseEvent", function SideNavMenuComponent_Template_menu_columns_toggleCollapseEvent_8_listener() { return ctx.toggleCollapse(); });
|
|
763
|
+
i0.ɵɵelementEnd()()()();
|
|
764
|
+
} if (rf & 2) {
|
|
765
|
+
i0.ɵɵstyleProp("width", ctx.sideNavWidth);
|
|
766
|
+
i0.ɵɵclassProp("collapsed", ctx.collapsed);
|
|
767
|
+
i0.ɵɵadvance(3);
|
|
768
|
+
i0.ɵɵproperty("ngIf", !ctx.collapsed);
|
|
769
|
+
i0.ɵɵadvance();
|
|
770
|
+
i0.ɵɵproperty("libPlausibleEvent", ctx.collapsed ? ctx.EXPAND_PLAUSIBLE_EVENT : ctx.COLLAPSE_PLAUSIBLE_EVENT);
|
|
771
|
+
i0.ɵɵadvance(2);
|
|
772
|
+
i0.ɵɵtextInterpolate(ctx.collapsed ? "keyboard_double_arrow_right" : "keyboard_double_arrow_left");
|
|
773
|
+
i0.ɵɵadvance(2);
|
|
774
|
+
i0.ɵɵproperty("direction", ctx.direction)("labelsVisible", !ctx.collapsed)("active", ctx.active);
|
|
775
|
+
} }, dependencies: [i2$2.DefaultLayoutDirective, i2$2.DefaultLayoutAlignDirective, i2$2.FlexFillDirective, i2$2.DefaultFlexDirective, i3.NgIf, i2$1.MatIcon, i7.MatIconButton, i2.PlausibleEventDirective, MenuColumnsComponent, i9.TranslatePipe], styles: [".menu-container[_ngcontent-%COMP%]{height:100%;overflow:auto;background:var(--base-100);border-right:1px solid var(--base-70)}.menu-container[_ngcontent-%COMP%] .menu-container-header[_ngcontent-%COMP%]{margin:24px 0}.menu-container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:0 .8em}.menu-container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .toggler[_ngcontent-%COMP%]{margin-right:-10px}.menu-container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .menu-logo[_ngcontent-%COMP%]{max-width:100%}.menu-container[_ngcontent-%COMP%] .divider[_ngcontent-%COMP%]{width:100%;margin:0}[_nghost-%COMP%] .collapsed .menu-item{padding:calc(.125em + 1px)}[_nghost-%COMP%] .collapsed .menu-item.active-menu-item{padding:.125em;border:1px solid var(--primary-accent);border-radius:var(--default-border-radius)}[_nghost-%COMP%] button.collapse-btn .mat-mdc-button-persistent-ripple, [_nghost-%COMP%] button.toggler .mat-mdc-button-persistent-ripple{display:none}"] }); }
|
|
776
|
+
}
|
|
777
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SideNavMenuComponent, [{
|
|
778
|
+
type: Component,
|
|
779
|
+
args: [{ selector: 'lib-side-nav-menu', template: "<div class=\"menu-container\" [style.width]=\"sideNavWidth\" fxLayout=\"column\" [class.collapsed]=\"collapsed\">\r\n <div class=\"content\" fxLayout=\"column\" fxFlexFill>\r\n <div class=\"menu-container-header\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\">\r\n <a *ngIf=\"!collapsed\" [libPlausibleEvent]=\"LOGOCLICK_PLAUSIBLE_EVENT\" fxFlex=\"3.125em\" [href]=\"baseUrl\"\r\n [attr.aria-label]=\"'MENU.ARIA_LABELS.LOGO' | translate\" (click)=\"logoClick($event)\" fxLayoutAlign=\"start center\"\r\n >\r\n <img class=\"menu-logo\" [src]=\"menuLogoImage\" alt=\"\" />\r\n </a>\r\n\r\n <button\r\n mat-icon-button\r\n class=\"toggler\"\r\n [libPlausibleEvent]=\"collapsed ? EXPAND_PLAUSIBLE_EVENT : COLLAPSE_PLAUSIBLE_EVENT\"\r\n (click)=\"toggleCollapse()\"\r\n >\r\n <mat-icon>{{ collapsed ? 'keyboard_double_arrow_right' : 'keyboard_double_arrow_left' }}</mat-icon>\r\n </button>\r\n </div>\r\n \r\n <div class=\"menu-wrapper\" fxLayout=\"column\" fxFlex>\r\n <menu-columns (toggleCollapseEvent)=\"toggleCollapse()\" [direction]=\"direction\" role=\"navigation\" fxFlex [labelsVisible]=\"!collapsed\"\r\n [active]=\"active\"></menu-columns>\r\n </div>\r\n </div>", styles: [".menu-container{height:100%;overflow:auto;background:var(--base-100);border-right:1px solid var(--base-70)}.menu-container .menu-container-header{margin:24px 0}.menu-container .content{padding:0 .8em}.menu-container .content .toggler{margin-right:-10px}.menu-container .content .menu-logo{max-width:100%}.menu-container .divider{width:100%;margin:0}:host ::ng-deep .collapsed .menu-item{padding:calc(.125em + 1px)}:host ::ng-deep .collapsed .menu-item.active-menu-item{padding:.125em;border:1px solid var(--primary-accent);border-radius:var(--default-border-radius)}:host::ng-deep button.collapse-btn .mat-mdc-button-persistent-ripple,:host::ng-deep button.toggler .mat-mdc-button-persistent-ripple{display:none}\n"] }]
|
|
780
|
+
}], () => [{ type: i1.StrapiLinkService }, { type: i2.DOMService }, { type: MenuItemsService }, { type: undefined, decorators: [{
|
|
781
|
+
type: Optional
|
|
782
|
+
}, {
|
|
783
|
+
type: Inject,
|
|
784
|
+
args: [MENU_SHARED_CONFIG]
|
|
785
|
+
}] }], { menuSettings: [{
|
|
786
|
+
type: Input
|
|
787
|
+
}] }); })();
|
|
788
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SideNavMenuComponent, { className: "SideNavMenuComponent", filePath: "lib\\components\\side-nav-menu\\side-nav-menu.component.ts", lineNumber: 16 }); })();
|
|
531
789
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
790
|
+
const _c0$1 = [[["", "top", ""]], [["", "bottom", ""]]];
|
|
791
|
+
const _c1$1 = ["[top]", "[bottom]"];
|
|
792
|
+
function ModalNavMenuComponent_img_3_Template(rf, ctx) { if (rf & 1) {
|
|
793
|
+
i0.ɵɵelement(0, "img", 7);
|
|
794
|
+
} if (rf & 2) {
|
|
795
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
796
|
+
i0.ɵɵproperty("src", ctx_r0.menuDialogSettings.logo, i0.ɵɵsanitizeUrl);
|
|
797
|
+
} }
|
|
798
|
+
function ModalNavMenuComponent_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
799
|
+
i0.ɵɵelementStart(0, "span", 8);
|
|
800
|
+
i0.ɵɵtext(1);
|
|
801
|
+
i0.ɵɵpipe(2, "translate");
|
|
802
|
+
i0.ɵɵelementEnd();
|
|
803
|
+
} if (rf & 2) {
|
|
804
|
+
i0.ɵɵadvance();
|
|
805
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "MENU.MENU"));
|
|
806
|
+
} }
|
|
807
|
+
function ModalNavMenuComponent_span_5_Template(rf, ctx) { if (rf & 1) {
|
|
808
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
809
|
+
i0.ɵɵelementStart(0, "span", 9);
|
|
810
|
+
i0.ɵɵlistener("click", function ModalNavMenuComponent_span_5_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.close()); });
|
|
811
|
+
i0.ɵɵelementStart(1, "mat-icon");
|
|
812
|
+
i0.ɵɵtext(2, "close");
|
|
813
|
+
i0.ɵɵelementEnd()();
|
|
814
|
+
} }
|
|
815
|
+
class ModalNavMenuComponent extends NavBaseComponent {
|
|
816
|
+
constructor(menuItems) {
|
|
817
|
+
super(menuItems);
|
|
818
|
+
this.menuItems = menuItems;
|
|
819
|
+
this.menuDialogSettings = {
|
|
820
|
+
showMenuTitle: false,
|
|
821
|
+
fullScreen: true
|
|
822
|
+
};
|
|
823
|
+
// any type because emitter doesn't really need a value
|
|
824
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
825
|
+
this.closeButtonClick = new EventEmitter();
|
|
826
|
+
}
|
|
827
|
+
close() {
|
|
828
|
+
this.closeButtonClick.emit(null);
|
|
829
|
+
}
|
|
830
|
+
static { this.ɵfac = function ModalNavMenuComponent_Factory(t) { return new (t || ModalNavMenuComponent)(i0.ɵɵdirectiveInject(MenuItemsService)); }; }
|
|
831
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModalNavMenuComponent, selectors: [["lib-modal-nav-menu"]], inputs: { menuDialogSettings: "menuDialogSettings" }, outputs: { closeButtonClick: "closeButtonClick" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1$1, decls: 9, vars: 7, consts: [["fxLayout", "row", "fxFlexFill", "", 1, "content", "menu-modal"], ["fxLayout", "column"], ["fxLayout", "row", 1, "menu-header"], ["width", "75", "alt", "", 3, "src", 4, "ngIf"], ["fxLayoutAlign", "start center", "fxFlex", "", 4, "ngIf"], ["class", "close-icon", "fxFlex", "", "fxLayoutAlign", "end center", 3, "click", 4, "ngIf"], [3, "direction", "active"], ["width", "75", "alt", "", 3, "src"], ["fxLayoutAlign", "start center", "fxFlex", ""], ["fxFlex", "", "fxLayoutAlign", "end center", 1, "close-icon", 3, "click"]], template: function ModalNavMenuComponent_Template(rf, ctx) { if (rf & 1) {
|
|
832
|
+
i0.ɵɵprojectionDef(_c0$1);
|
|
833
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
|
|
834
|
+
i0.ɵɵtemplate(3, ModalNavMenuComponent_img_3_Template, 1, 1, "img", 3)(4, ModalNavMenuComponent_span_4_Template, 3, 3, "span", 4)(5, ModalNavMenuComponent_span_5_Template, 3, 0, "span", 5);
|
|
835
|
+
i0.ɵɵelementEnd();
|
|
836
|
+
i0.ɵɵprojection(6);
|
|
837
|
+
i0.ɵɵelement(7, "menu-columns", 6);
|
|
838
|
+
i0.ɵɵprojection(8, 1);
|
|
839
|
+
i0.ɵɵelementEnd()();
|
|
840
|
+
} if (rf & 2) {
|
|
841
|
+
i0.ɵɵadvance();
|
|
842
|
+
i0.ɵɵclassProp("full-screen", ctx.menuDialogSettings.fullScreen);
|
|
843
|
+
i0.ɵɵadvance(2);
|
|
844
|
+
i0.ɵɵproperty("ngIf", ctx.menuDialogSettings.logo);
|
|
845
|
+
i0.ɵɵadvance();
|
|
846
|
+
i0.ɵɵproperty("ngIf", ctx.menuDialogSettings.showMenuTitle);
|
|
847
|
+
i0.ɵɵadvance();
|
|
848
|
+
i0.ɵɵproperty("ngIf", ctx.menuDialogSettings.showCloseMenuButton);
|
|
849
|
+
i0.ɵɵadvance(2);
|
|
850
|
+
i0.ɵɵproperty("direction", ctx.direction)("active", ctx.active);
|
|
851
|
+
} }, dependencies: [i2$2.DefaultLayoutDirective, i2$2.DefaultLayoutAlignDirective, i2$2.FlexFillDirective, i2$2.DefaultFlexDirective, i3.NgIf, i2$1.MatIcon, MenuColumnsComponent, i9.TranslatePipe], styles: [".menu-modal[_ngcontent-%COMP%]{background-color:var(--base-100);padding:1.375rem 1.5rem}.close-icon[_ngcontent-%COMP%]{cursor:pointer}.menu-header[_ngcontent-%COMP%]{font-style:normal;font-weight:500;font-size:1.3125rem;line-height:1.75rem;text-align:center;margin:1em 0;color:var(--menu-dark-color)}.close-icon[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{transform:scale(1.5)}"] }); }
|
|
852
|
+
}
|
|
853
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModalNavMenuComponent, [{
|
|
854
|
+
type: Component,
|
|
855
|
+
args: [{ selector: 'lib-modal-nav-menu', template: "<div class=\"content menu-modal\" fxLayout=\"row\" fxFlexFill>\r\n <div fxLayout=\"column\" [class.full-screen]=\"menuDialogSettings.fullScreen\">\r\n <div fxLayout=\"row\" class=\"menu-header\">\r\n <img [src]=\"menuDialogSettings.logo\" *ngIf=\"menuDialogSettings.logo\" width=\"75\" alt=\"\">\r\n <span *ngIf=\"menuDialogSettings.showMenuTitle\" fxLayoutAlign=\"start center\" fxFlex>{{\r\n \"MENU.MENU\" | translate\r\n }}</span>\r\n <span *ngIf=\"menuDialogSettings.showCloseMenuButton\" (click)=\"close()\" class=\"close-icon\" fxFlex\r\n fxLayoutAlign=\"end center\">\r\n <mat-icon>close</mat-icon>\r\n </span>\r\n </div>\r\n <ng-content select=\"[top]\"></ng-content>\r\n <menu-columns [direction]=\"direction\" [active]=\"active\">\r\n </menu-columns>\r\n <ng-content select=\"[bottom]\"></ng-content>\r\n </div>\r\n</div>", styles: [".menu-modal{background-color:var(--base-100);padding:1.375rem 1.5rem}.close-icon{cursor:pointer}.menu-header{font-style:normal;font-weight:500;font-size:1.3125rem;line-height:1.75rem;text-align:center;margin:1em 0;color:var(--menu-dark-color)}.close-icon>mat-icon{transform:scale(1.5)}\n"] }]
|
|
856
|
+
}], () => [{ type: MenuItemsService }], { menuDialogSettings: [{
|
|
857
|
+
type: Input
|
|
858
|
+
}], closeButtonClick: [{
|
|
859
|
+
type: Output
|
|
860
|
+
}] }); })();
|
|
861
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModalNavMenuComponent, { className: "ModalNavMenuComponent", filePath: "lib\\components\\modal-nav-menu\\modal-nav-menu.component.ts", lineNumber: 11 }); })();
|
|
558
862
|
|
|
559
863
|
const menuLogo = `
|
|
560
864
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -563,165 +867,210 @@ const menuLogo = `
|
|
|
563
867
|
|
|
564
868
|
`;
|
|
565
869
|
|
|
566
|
-
var TitlePlacement;
|
|
567
|
-
(function (TitlePlacement) {
|
|
568
|
-
TitlePlacement["none"] = "none";
|
|
569
|
-
TitlePlacement["left"] = "left";
|
|
570
|
-
TitlePlacement["right"] = "right";
|
|
870
|
+
var TitlePlacement;
|
|
871
|
+
(function (TitlePlacement) {
|
|
872
|
+
TitlePlacement["none"] = "none";
|
|
873
|
+
TitlePlacement["left"] = "left";
|
|
874
|
+
TitlePlacement["right"] = "right";
|
|
571
875
|
})(TitlePlacement || (TitlePlacement = {}));
|
|
572
876
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
this.
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
this.
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
877
|
+
const _c0 = ["menuTrigger"];
|
|
878
|
+
const _c1 = [[["", "top", ""]], [["", "bottom", ""]]];
|
|
879
|
+
const _c2 = ["[top]", "[bottom]"];
|
|
880
|
+
function MenuItemIconComponent_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
881
|
+
i0.ɵɵelementStart(0, "span", 8);
|
|
882
|
+
i0.ɵɵtext(1);
|
|
883
|
+
i0.ɵɵpipe(2, "translate");
|
|
884
|
+
i0.ɵɵelementEnd();
|
|
885
|
+
} if (rf & 2) {
|
|
886
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
887
|
+
i0.ɵɵproperty("fxFlexOrder", ctx_r1.menuSettings.titlePlacement === ctx_r1.TITLE_PLACEMENT_LEFT ? 1 : 2);
|
|
888
|
+
i0.ɵɵadvance();
|
|
889
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 2, "MENU.MENU"));
|
|
890
|
+
} }
|
|
891
|
+
class MenuItemIconComponent {
|
|
892
|
+
constructor(iconService, router) {
|
|
893
|
+
this.iconService = iconService;
|
|
894
|
+
this.router = router;
|
|
895
|
+
this.menuSettings = {
|
|
896
|
+
titlePlacement: TitlePlacement.left
|
|
897
|
+
};
|
|
898
|
+
this.menuDialogSettings = {
|
|
899
|
+
showMenuTitle: true,
|
|
900
|
+
disableStrapi: true,
|
|
901
|
+
fullScreen: true
|
|
902
|
+
};
|
|
903
|
+
this.direction = MenuLayoutDirection.row;
|
|
904
|
+
this.subscription = [];
|
|
905
|
+
this.iconName = 'tld-menu-icon';
|
|
906
|
+
this.TITLE_PLACEMENT_NONE = TitlePlacement.none;
|
|
907
|
+
this.TITLE_PLACEMENT_LEFT = TitlePlacement.left;
|
|
908
|
+
this.PLAUSIBLE_EVENT = {
|
|
909
|
+
eventId: "burger_click"
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
ngOnInit() {
|
|
913
|
+
const routeChangeSub = this.router.events.subscribe(() => this.closeMenu());
|
|
914
|
+
this.subscription.push(routeChangeSub);
|
|
915
|
+
this.registerIcon();
|
|
916
|
+
}
|
|
917
|
+
closeMenu() {
|
|
918
|
+
this.menuTrigger?.closeMenu();
|
|
919
|
+
}
|
|
920
|
+
ngOnDestroy() {
|
|
921
|
+
this.subscription.forEach(e => e.unsubscribe());
|
|
922
|
+
}
|
|
923
|
+
registerIcon() {
|
|
924
|
+
if (this.menuSettings.iconPath) {
|
|
925
|
+
this.iconService.registerIconFromUrl(this.iconName, this.menuSettings.iconPath);
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
this.iconService.registerIcons({ [this.iconName]: menuLogo });
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
static { this.ɵfac = function MenuItemIconComponent_Factory(t) { return new (t || MenuItemIconComponent)(i0.ɵɵdirectiveInject(i2.IconService), i0.ɵɵdirectiveInject(i1$1.Router)); }; }
|
|
932
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuItemIconComponent, selectors: [["lib-menu-item-icon"]], viewQuery: function MenuItemIconComponent_Query(rf, ctx) { if (rf & 1) {
|
|
933
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
934
|
+
} if (rf & 2) {
|
|
935
|
+
let _t;
|
|
936
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.menuTrigger = _t.first);
|
|
937
|
+
} }, inputs: { menuSettings: "menuSettings", menuDialogSettings: "menuDialogSettings", direction: "direction" }, ngContentSelectors: _c2, decls: 10, vars: 12, consts: [["menuTrigger", "matMenuTrigger"], ["menu", ""], ["mat-button", "", 1, "content", "text-l", 3, "disableRipple", "matMenuTriggerFor", "libPlausibleEvent"], ["fxLayout", "row", "fxLayoutGap", "1.5em", "fxLayoutAlign", "center center"], ["class", "menu-label", 3, "fxFlexOrder", 4, "ngIf"], [3, "fxFlexOrder", "svgIcon"], [3, "hasBackdrop"], [3, "click", "closeButtonClick", "menuDialogSettings", "direction"], [1, "menu-label", 3, "fxFlexOrder"]], template: function MenuItemIconComponent_Template(rf, ctx) { if (rf & 1) {
|
|
938
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
939
|
+
i0.ɵɵprojectionDef(_c1);
|
|
940
|
+
i0.ɵɵelementStart(0, "button", 2, 0)(2, "span", 3);
|
|
941
|
+
i0.ɵɵtemplate(3, MenuItemIconComponent_span_3_Template, 3, 4, "span", 4);
|
|
942
|
+
i0.ɵɵelement(4, "mat-icon", 5);
|
|
943
|
+
i0.ɵɵelementEnd()();
|
|
944
|
+
i0.ɵɵelementStart(5, "mat-menu", 6, 1)(7, "lib-modal-nav-menu", 7);
|
|
945
|
+
i0.ɵɵlistener("click", function MenuItemIconComponent_Template_lib_modal_nav_menu_click_7_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView($event.stopPropagation()); })("closeButtonClick", function MenuItemIconComponent_Template_lib_modal_nav_menu_closeButtonClick_7_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeMenu()); });
|
|
946
|
+
i0.ɵɵprojection(8, 0, ["top", ""]);
|
|
947
|
+
i0.ɵɵprojection(9, 1, ["bottom", ""]);
|
|
948
|
+
i0.ɵɵelementEnd()();
|
|
949
|
+
} if (rf & 2) {
|
|
950
|
+
const menu_r3 = i0.ɵɵreference(6);
|
|
951
|
+
i0.ɵɵproperty("disableRipple", true)("matMenuTriggerFor", menu_r3)("libPlausibleEvent", ctx.PLAUSIBLE_EVENT);
|
|
952
|
+
i0.ɵɵadvance(3);
|
|
953
|
+
i0.ɵɵproperty("ngIf", ctx.menuSettings.titlePlacement !== ctx.TITLE_PLACEMENT_NONE);
|
|
954
|
+
i0.ɵɵadvance();
|
|
955
|
+
i0.ɵɵproperty("fxFlexOrder", ctx.menuSettings.titlePlacement === ctx.TITLE_PLACEMENT_LEFT ? 2 : 1)("svgIcon", ctx.iconName);
|
|
956
|
+
i0.ɵɵadvance();
|
|
957
|
+
i0.ɵɵclassMapInterpolate1("mobile-menu-dialog ", ctx.menuDialogSettings.fullScreen ? "full-screen" : "minimized-screen", "");
|
|
958
|
+
i0.ɵɵproperty("hasBackdrop", true);
|
|
959
|
+
i0.ɵɵadvance(2);
|
|
960
|
+
i0.ɵɵproperty("menuDialogSettings", ctx.menuDialogSettings)("direction", ctx.direction);
|
|
961
|
+
} }, dependencies: [i2$2.DefaultLayoutDirective, i2$2.DefaultLayoutGapDirective, i2$2.DefaultLayoutAlignDirective, i2$2.DefaultFlexOrderDirective, i3.NgIf, i2$1.MatIcon, i7.MatButton, i7$1.MatMenu, i7$1.MatMenuTrigger, i2.PlausibleEventDirective, ModalNavMenuComponent, i9.TranslatePipe], styles: [".content[_ngcontent-%COMP%]{gap:1.5em;cursor:pointer}button.mat-mdc-icon-button[_ngcontent-%COMP%]{width:inherit}[_nghost-%COMP%] button span.mat-button-focus-overlay{opacity:0!important} lib-modal-nav-menu>.content.menu-modal>div.full-screen{width:100%} lib-modal-nav-menu>.content.menu-modal>div.full-screen .menu-list-wrapper .menu-item{width:100%} div:has(.mat-mdc-menu-panel.mobile-menu-dialog.full-screen){width:100%;max-width:100%} .mat-mdc-menu-panel.mobile-menu-dialog.full-screen{width:100vw;margin-top:-2.5em;max-width:none}"] }); }
|
|
962
|
+
}
|
|
963
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemIconComponent, [{
|
|
964
|
+
type: Component,
|
|
965
|
+
args: [{ selector: 'lib-menu-item-icon', template: "<button class=\"content text-l\" mat-button [disableRipple]=\"true\" #menuTrigger=\"matMenuTrigger\"\r\n [matMenuTriggerFor]=\"menu\" [libPlausibleEvent]=\"PLAUSIBLE_EVENT\">\r\n <span fxLayout=\"row\" fxLayoutGap=\"1.5em\" fxLayoutAlign=\"center center\">\r\n <span *ngIf=\"menuSettings.titlePlacement !== TITLE_PLACEMENT_NONE\" [fxFlexOrder]=\"\r\n menuSettings.titlePlacement === TITLE_PLACEMENT_LEFT ? 1 : 2\r\n \" class=\"menu-label\">{{ \"MENU.MENU\" | translate }}</span>\r\n <mat-icon [fxFlexOrder]=\"\r\n menuSettings.titlePlacement === TITLE_PLACEMENT_LEFT ? 2 : 1\r\n \" [svgIcon]=\"iconName\">\r\n </mat-icon>\r\n </span>\r\n</button>\r\n\r\n<mat-menu [hasBackdrop]=\"true\" #menu class=\"mobile-menu-dialog {{\r\n menuDialogSettings.fullScreen ? 'full-screen' : 'minimized-screen'\r\n }}\">\r\n <!-- Click method so that menu does not get closed when clicking outside of items-->\r\n <lib-modal-nav-menu (click)=\"$event.stopPropagation()\" (closeButtonClick)=\"closeMenu()\"\r\n [menuDialogSettings]=\"menuDialogSettings\" [direction]=\"direction\">\r\n <ng-content top select=\"[top]\"></ng-content>\r\n <ng-content bottom select=\"[bottom]\"></ng-content>\r\n </lib-modal-nav-menu>\r\n</mat-menu>", styles: [".content{gap:1.5em;cursor:pointer}button.mat-mdc-icon-button{width:inherit}:host::ng-deep button span.mat-button-focus-overlay{opacity:0!important}::ng-deep lib-modal-nav-menu>.content.menu-modal>div.full-screen{width:100%}::ng-deep lib-modal-nav-menu>.content.menu-modal>div.full-screen .menu-list-wrapper .menu-item{width:100%}::ng-deep div:has(.mat-mdc-menu-panel.mobile-menu-dialog.full-screen){width:100%;max-width:100%}::ng-deep .mat-mdc-menu-panel.mobile-menu-dialog.full-screen{width:100vw;margin-top:-2.5em;max-width:none}\n"] }]
|
|
966
|
+
}], () => [{ type: i2.IconService }, { type: i1$1.Router }], { menuTrigger: [{
|
|
967
|
+
type: ViewChild,
|
|
968
|
+
args: ['menuTrigger']
|
|
969
|
+
}], menuSettings: [{
|
|
970
|
+
type: Input
|
|
971
|
+
}], menuDialogSettings: [{
|
|
972
|
+
type: Input
|
|
973
|
+
}], direction: [{
|
|
974
|
+
type: Input
|
|
975
|
+
}] }); })();
|
|
976
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuItemIconComponent, { className: "MenuItemIconComponent", filePath: "lib\\components\\menu-item-icon\\menu-item-icon.component.ts", lineNumber: 14 }); })();
|
|
629
977
|
|
|
630
|
-
class MenuModule {
|
|
631
|
-
static forRoot(config) {
|
|
632
|
-
return {
|
|
633
|
-
ngModule: MenuModule,
|
|
634
|
-
providers: [
|
|
635
|
-
{ provide: MENU_SHARED_CONFIG, useValue: config }
|
|
636
|
-
]
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
static { this.ɵfac =
|
|
640
|
-
static { this.ɵmod = i0.ɵɵ
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
MatIconModule,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
978
|
+
class MenuModule {
|
|
979
|
+
static forRoot(config) {
|
|
980
|
+
return {
|
|
981
|
+
ngModule: MenuModule,
|
|
982
|
+
providers: [
|
|
983
|
+
{ provide: MENU_SHARED_CONFIG, useValue: config }
|
|
984
|
+
]
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
static { this.ɵfac = function MenuModule_Factory(t) { return new (t || MenuModule)(); }; }
|
|
988
|
+
static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: MenuModule }); }
|
|
989
|
+
static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
990
|
+
StarpiMenuService
|
|
991
|
+
], imports: [HttpClientModule,
|
|
992
|
+
FlexLayoutModule,
|
|
993
|
+
RouterModule,
|
|
994
|
+
CommonModule,
|
|
995
|
+
MatTooltipModule,
|
|
996
|
+
MatDialogModule,
|
|
997
|
+
MatIconModule,
|
|
998
|
+
MatButtonModule,
|
|
999
|
+
MatListModule,
|
|
1000
|
+
MatMenuModule,
|
|
1001
|
+
MatIconModule,
|
|
1002
|
+
TranslateModule,
|
|
1003
|
+
PlausibleModule] }); }
|
|
1004
|
+
}
|
|
1005
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuModule, [{
|
|
1006
|
+
type: NgModule,
|
|
1007
|
+
args: [{
|
|
1008
|
+
declarations: [
|
|
1009
|
+
SideNavMenuComponent,
|
|
1010
|
+
ModalNavMenuComponent,
|
|
1011
|
+
MenuItemIconComponent,
|
|
1012
|
+
NavBaseComponent,
|
|
1013
|
+
MenuItemListComponent,
|
|
1014
|
+
MenuColumnsComponent,
|
|
1015
|
+
MenuIconComponent,
|
|
1016
|
+
MenuItemLinkComponent
|
|
1017
|
+
],
|
|
1018
|
+
providers: [
|
|
1019
|
+
StarpiMenuService
|
|
1020
|
+
],
|
|
1021
|
+
imports: [
|
|
1022
|
+
HttpClientModule,
|
|
1023
|
+
FlexLayoutModule,
|
|
1024
|
+
RouterModule,
|
|
1025
|
+
CommonModule,
|
|
1026
|
+
MatTooltipModule,
|
|
1027
|
+
MatDialogModule,
|
|
1028
|
+
MatIconModule,
|
|
1029
|
+
MatButtonModule,
|
|
1030
|
+
MatListModule,
|
|
1031
|
+
MatMenuModule,
|
|
1032
|
+
MatIconModule,
|
|
1033
|
+
TranslateModule,
|
|
1034
|
+
PlausibleModule
|
|
1035
|
+
],
|
|
1036
|
+
exports: [
|
|
1037
|
+
SideNavMenuComponent,
|
|
1038
|
+
ModalNavMenuComponent,
|
|
1039
|
+
MenuItemIconComponent,
|
|
1040
|
+
MenuColumnsComponent,
|
|
1041
|
+
]
|
|
1042
|
+
}]
|
|
1043
|
+
}], null, null); })();
|
|
1044
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MenuModule, { declarations: [SideNavMenuComponent,
|
|
1045
|
+
ModalNavMenuComponent,
|
|
1046
|
+
MenuItemIconComponent,
|
|
1047
|
+
NavBaseComponent,
|
|
1048
|
+
MenuItemListComponent,
|
|
1049
|
+
MenuColumnsComponent,
|
|
1050
|
+
MenuIconComponent,
|
|
1051
|
+
MenuItemLinkComponent], imports: [HttpClientModule,
|
|
1052
|
+
FlexLayoutModule,
|
|
1053
|
+
RouterModule,
|
|
1054
|
+
CommonModule,
|
|
1055
|
+
MatTooltipModule,
|
|
1056
|
+
MatDialogModule,
|
|
1057
|
+
MatIconModule,
|
|
1058
|
+
MatButtonModule,
|
|
1059
|
+
MatListModule,
|
|
1060
|
+
MatMenuModule,
|
|
1061
|
+
MatIconModule,
|
|
1062
|
+
TranslateModule,
|
|
1063
|
+
PlausibleModule], exports: [SideNavMenuComponent,
|
|
1064
|
+
ModalNavMenuComponent,
|
|
1065
|
+
MenuItemIconComponent,
|
|
1066
|
+
MenuColumnsComponent] }); })();
|
|
718
1067
|
|
|
719
|
-
/*
|
|
720
|
-
* Public API Surface of ngx-menu
|
|
1068
|
+
/*
|
|
1069
|
+
* Public API Surface of ngx-menu
|
|
721
1070
|
*/
|
|
722
1071
|
|
|
723
|
-
/**
|
|
724
|
-
* Generated bundle index. Do not edit.
|
|
1072
|
+
/**
|
|
1073
|
+
* Generated bundle index. Do not edit.
|
|
725
1074
|
*/
|
|
726
1075
|
|
|
727
1076
|
export { MENU_ICON_STRAPI_EXTENSION, MENU_SHARED_CONFIG, MenuColumnsComponent, MenuItemIconComponent, MenuItemsService, MenuLayoutDirection, MenuModule, ModalNavMenuComponent, NavBaseComponent, SideNavMenuComponent, StarpiMenuService, StrapiDataLocation, TitlePlacement };
|