@tilde-nlp/ngx-menu 8.1.0 → 8.1.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/fesm2022/tilde-nlp-ngx-menu.mjs +521 -251
- package/fesm2022/tilde-nlp-ngx-menu.mjs.map +1 -1
- package/index.d.ts +60 -21
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
+
import * as _tilde_nlp_strapi_models from '@tilde-nlp/strapi-models';
|
|
2
|
+
import { MenuItem, Media } from '@tilde-nlp/strapi-models';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
4
|
import { OnInit, OnDestroy, EventEmitter, ModuleWithProviders } from '@angular/core';
|
|
3
|
-
import * as
|
|
5
|
+
import * as i21 from '@tilde-nlp/ngx-common';
|
|
4
6
|
import { PlausibleEvent, IconService, DOMService } from '@tilde-nlp/ngx-common';
|
|
5
7
|
import { StrapiSubscriptionService, StrapiApiConfig, StrapiLinkService, PlaceholderComponentBase, StrapiVariablesService } from '@tilde-nlp/ngx-strapi';
|
|
6
8
|
import * as rxjs from 'rxjs';
|
|
7
9
|
import { Observable, Subscription } from 'rxjs';
|
|
8
|
-
import * as
|
|
10
|
+
import * as i12 from '@angular/router';
|
|
9
11
|
import { IsActiveMatchOptions, Router } from '@angular/router';
|
|
10
12
|
import * as _tilde_nlp_ngx_menu from '@tilde-nlp/ngx-menu';
|
|
11
|
-
import
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as i14 from '@angular/material/dialog';
|
|
13
|
+
import * as i11 from '@ngbracket/ngx-layout';
|
|
14
|
+
import * as i13 from '@angular/common';
|
|
15
|
+
import * as i14 from '@angular/material/tooltip';
|
|
16
|
+
import * as i15 from '@angular/material/dialog';
|
|
16
17
|
import { MatDialog } from '@angular/material/dialog';
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
18
|
+
import * as i16 from '@angular/material/icon';
|
|
19
|
+
import * as i17 from '@angular/material/button';
|
|
20
|
+
import * as i18 from '@angular/material/list';
|
|
21
|
+
import * as i19 from '@angular/material/menu';
|
|
22
|
+
import * as i20 from '@ngx-translate/core';
|
|
23
|
+
import * as i22 from '@angular/material/progress-spinner';
|
|
23
24
|
|
|
24
25
|
interface UserMenuOptionIcon {
|
|
25
26
|
name?: string;
|
|
@@ -53,6 +54,9 @@ interface SideNavSettings {
|
|
|
53
54
|
disableStrapi?: boolean;
|
|
54
55
|
userOptions: UserMenuOption[];
|
|
55
56
|
disableLogoNavigation?: boolean;
|
|
57
|
+
expandableMenuChildren?: boolean;
|
|
58
|
+
useLargeLoginButton?: boolean;
|
|
59
|
+
useCompactMenuVersion?: boolean;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
declare enum MenuLayoutDirection {
|
|
@@ -80,14 +84,16 @@ interface CustomMenuItem {
|
|
|
80
84
|
/** If has children, this property is responsible for child element collapsing */
|
|
81
85
|
expanded?: boolean;
|
|
82
86
|
/** Sub menu is used to show a list of options, every option has title and click action */
|
|
83
|
-
subMenu?:
|
|
87
|
+
subMenu?: {
|
|
84
88
|
title: string;
|
|
85
89
|
onOptionClick: (param?: unknown) => void;
|
|
86
|
-
}
|
|
90
|
+
}[];
|
|
87
91
|
/** Action to be executed on clicking an item */
|
|
88
92
|
clickAction?: (param?: unknown) => void;
|
|
89
93
|
/** Function to check if item is active. This one replace active button highlight by router*/
|
|
90
94
|
isItemActive?: (param?: unknown) => boolean;
|
|
95
|
+
/** Permission name needed to display the menu item */
|
|
96
|
+
permission?: string;
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
interface MenuTitleNavigation {
|
|
@@ -140,6 +146,8 @@ interface MenuSharedConfig {
|
|
|
140
146
|
hideSelectedCustomId?: boolean;
|
|
141
147
|
/** Where strapi data should be placed */
|
|
142
148
|
strapiDataLocation?: StrapiDataLocation;
|
|
149
|
+
/** User permissions */
|
|
150
|
+
permissions?: string[];
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
declare class StarpiMenuService {
|
|
@@ -148,9 +156,11 @@ declare class StarpiMenuService {
|
|
|
148
156
|
private readonly iconService;
|
|
149
157
|
readonly svgIconNamePrefix = "strapi-menu-icon-";
|
|
150
158
|
imgBaseUrl: string;
|
|
159
|
+
footerItems: MenuItem[];
|
|
151
160
|
constructor(strapiSubscription: StrapiSubscriptionService, menuConfig: MenuSharedConfig, strapiConfig: StrapiApiConfig, iconService: IconService);
|
|
152
161
|
getMenuItems(): Observable<CustomMenuItem[]>;
|
|
153
162
|
unsubscribe(): void;
|
|
163
|
+
private filterMenuItems;
|
|
154
164
|
private addBaseUrlIfNecessary;
|
|
155
165
|
private convertToCustomMenuItem;
|
|
156
166
|
static ɵfac: i0.ɵɵFactoryDeclaration<StarpiMenuService, [null, { optional: true; }, { optional: true; }, null]>;
|
|
@@ -183,6 +193,7 @@ declare class MenuItemsService {
|
|
|
183
193
|
private _mergedGroups;
|
|
184
194
|
get mergedGroups(): MenuItemGroup[];
|
|
185
195
|
private get menuItemGroups();
|
|
196
|
+
get footerItems(): _tilde_nlp_strapi_models.MenuItem[];
|
|
186
197
|
constructor(router: Router, config: MenuSharedConfig, strapiService: StarpiMenuService);
|
|
187
198
|
setMenuItems(config: MenuSharedConfig): void;
|
|
188
199
|
private subscribeToRouteChanges;
|
|
@@ -230,6 +241,7 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
230
241
|
supportedLanguages: string[];
|
|
231
242
|
useDefaultLanguageSwitcher: boolean;
|
|
232
243
|
changeLanguageEvent: EventEmitter<string>;
|
|
244
|
+
loginEvent: EventEmitter<any>;
|
|
233
245
|
userInitials: string;
|
|
234
246
|
collapsed: boolean;
|
|
235
247
|
readonly COLLAPSED_LOCAL_STORAGE_KEY = "TLD_MENU_SIDE_NAV_COLLAPSED";
|
|
@@ -242,8 +254,10 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
242
254
|
readonly baseUrl: string | undefined;
|
|
243
255
|
get menuLogoImage(): string;
|
|
244
256
|
get sideNavWidth(): string | undefined;
|
|
257
|
+
get footerItems(): _tilde_nlp_strapi_models.MenuItem[];
|
|
245
258
|
constructor(strapiLinkService: StrapiLinkService, domService: DOMService, menuItems: MenuItemsService);
|
|
246
259
|
ngOnInit(): void;
|
|
260
|
+
login(): void;
|
|
247
261
|
logoClick(event: MouseEvent): void;
|
|
248
262
|
toggleCollapse(): void;
|
|
249
263
|
linkCallback(link: UserMenuOptionLink): void;
|
|
@@ -251,7 +265,7 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
251
265
|
private getColapsedFromLocalStorage;
|
|
252
266
|
private setColapsedFromLocalStorage;
|
|
253
267
|
static ɵfac: i0.ɵɵFactoryDeclaration<SideNavMenuComponent, never>;
|
|
254
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SideNavMenuComponent, "lib-side-nav-menu", never, { "username": { "alias": "username"; "required": false; }; "menuSettings": { "alias": "menuSettings"; "required": false; }; "productName": { "alias": "productName"; "required": false; }; "supportedLanguages": { "alias": "supportedLanguages"; "required": false; }; "useDefaultLanguageSwitcher": { "alias": "useDefaultLanguageSwitcher"; "required": false; }; }, { "changeLanguageEvent": "changeLanguageEvent"; }, never, ["*"], false, never>;
|
|
268
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SideNavMenuComponent, "lib-side-nav-menu", never, { "username": { "alias": "username"; "required": false; }; "menuSettings": { "alias": "menuSettings"; "required": false; }; "productName": { "alias": "productName"; "required": false; }; "supportedLanguages": { "alias": "supportedLanguages"; "required": false; }; "useDefaultLanguageSwitcher": { "alias": "useDefaultLanguageSwitcher"; "required": false; }; }, { "changeLanguageEvent": "changeLanguageEvent"; "loginEvent": "loginEvent"; }, never, ["*"], false, never>;
|
|
255
269
|
}
|
|
256
270
|
|
|
257
271
|
declare const MENU_SHARED_CONFIG = "menu-shared-config";
|
|
@@ -261,16 +275,19 @@ declare class MenuItemListComponent {
|
|
|
261
275
|
labelsVisible: boolean;
|
|
262
276
|
activeItem: CustomMenuItem | undefined;
|
|
263
277
|
showIcons: boolean;
|
|
278
|
+
expandableMenuChildren: boolean;
|
|
264
279
|
items: CustomMenuItem[];
|
|
265
280
|
menuItemGroup: MenuItemGroupBase;
|
|
281
|
+
openMenuTrigger: EventEmitter<void>;
|
|
266
282
|
toggleExpand: EventEmitter<CustomMenuItem>;
|
|
267
283
|
get titleKey(): string | undefined;
|
|
268
284
|
get showTitle(): boolean | undefined;
|
|
269
285
|
get menuLayoutDirection(): string;
|
|
270
286
|
get menuItemLayout(): string;
|
|
271
|
-
|
|
287
|
+
toggleExpandEvent(item: CustomMenuItem): void;
|
|
288
|
+
openMenu(): void;
|
|
272
289
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemListComponent, never>;
|
|
273
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemListComponent, "menu-item-list", never, { "direction": { "alias": "direction"; "required": false; }; "labelsVisible": { "alias": "labelsVisible"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "items": { "alias": "items"; "required": false; }; "menuItemGroup": { "alias": "menuItemGroup"; "required": false; }; }, { "toggleExpand": "toggleExpand"; }, never, never, false, never>;
|
|
290
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemListComponent, "menu-item-list", never, { "direction": { "alias": "direction"; "required": false; }; "labelsVisible": { "alias": "labelsVisible"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "expandableMenuChildren": { "alias": "expandableMenuChildren"; "required": false; }; "items": { "alias": "items"; "required": false; }; "menuItemGroup": { "alias": "menuItemGroup"; "required": false; }; }, { "openMenuTrigger": "openMenuTrigger"; "toggleExpand": "toggleExpand"; }, never, never, false, never>;
|
|
274
291
|
}
|
|
275
292
|
|
|
276
293
|
declare class MenuColumnsComponent implements OnInit {
|
|
@@ -279,6 +296,7 @@ declare class MenuColumnsComponent implements OnInit {
|
|
|
279
296
|
private readonly menuItemsService;
|
|
280
297
|
direction: MenuLayoutDirection;
|
|
281
298
|
isOpen: boolean;
|
|
299
|
+
expandableMenuChildren: boolean | undefined;
|
|
282
300
|
toggleCollapseEvent: EventEmitter<any>;
|
|
283
301
|
private _active;
|
|
284
302
|
get active(): ActiveMenuItems;
|
|
@@ -288,9 +306,10 @@ declare class MenuColumnsComponent implements OnInit {
|
|
|
288
306
|
constructor(router: Router, menuSharedConfig: MenuSharedConfig, menuItemsService: MenuItemsService);
|
|
289
307
|
ngOnInit(): void;
|
|
290
308
|
elementExpanded(element?: CustomMenuItem): void;
|
|
309
|
+
openMenu(): void;
|
|
291
310
|
private toggleOnMobileSelect;
|
|
292
311
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuColumnsComponent, [null, { optional: true; }, null]>;
|
|
293
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuColumnsComponent, "menu-columns", never, { "direction": { "alias": "direction"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "active": { "alias": "active"; "required": false; }; }, { "toggleCollapseEvent": "toggleCollapseEvent"; }, never, never, false, never>;
|
|
312
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuColumnsComponent, "menu-columns", never, { "direction": { "alias": "direction"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "expandableMenuChildren": { "alias": "expandableMenuChildren"; "required": false; }; "active": { "alias": "active"; "required": false; }; }, { "toggleCollapseEvent": "toggleCollapseEvent"; }, never, never, false, never>;
|
|
294
313
|
}
|
|
295
314
|
|
|
296
315
|
declare class MenuIconComponent {
|
|
@@ -334,14 +353,17 @@ declare class MenuItemBtnComponent {
|
|
|
334
353
|
declare class MenuProfileComponent implements OnInit {
|
|
335
354
|
collapsed: i0.InputSignal<boolean | undefined>;
|
|
336
355
|
username: i0.InputSignal<string | undefined>;
|
|
356
|
+
useLargeLoginButton: i0.InputSignal<boolean | undefined>;
|
|
337
357
|
userOptions: i0.InputSignal<UserMenuOption[] | undefined>;
|
|
338
358
|
linkCallbackEvent: i0.OutputEmitterRef<UserMenuOptionLink>;
|
|
359
|
+
loginEvent: i0.OutputEmitterRef<void>;
|
|
339
360
|
userInitials: string;
|
|
340
361
|
ngOnInit(): void;
|
|
341
362
|
linkCallback(link: UserMenuOptionLink): void;
|
|
363
|
+
login(): void;
|
|
342
364
|
private setUserInitials;
|
|
343
365
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuProfileComponent, never>;
|
|
344
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuProfileComponent, "lib-menu-profile", never, { "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "username": { "alias": "username"; "required": false; "isSignal": true; }; "userOptions": { "alias": "userOptions"; "required": false; "isSignal": true; }; }, { "linkCallbackEvent": "linkCallbackEvent"; }, never, never, false, never>;
|
|
366
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuProfileComponent, "lib-menu-profile", never, { "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "username": { "alias": "username"; "required": false; "isSignal": true; }; "useLargeLoginButton": { "alias": "useLargeLoginButton"; "required": false; "isSignal": true; }; "userOptions": { "alias": "userOptions"; "required": false; "isSignal": true; }; }, { "linkCallbackEvent": "linkCallbackEvent"; "loginEvent": "loginEvent"; }, never, never, false, never>;
|
|
345
367
|
}
|
|
346
368
|
|
|
347
369
|
declare class MenuLangSwitcherComponent implements OnInit {
|
|
@@ -359,10 +381,27 @@ declare class MenuLangSwitcherComponent implements OnInit {
|
|
|
359
381
|
static ɵcmp: i0.ɵɵComponentDeclaration<MenuLangSwitcherComponent, "lib-menu-lang-switcher", never, { "isCollapsed": { "alias": "isCollapsed"; "required": false; }; "languages": { "alias": "languages"; "required": false; }; }, { "changeLanguageEvent": "changeLanguageEvent"; }, never, never, false, never>;
|
|
360
382
|
}
|
|
361
383
|
|
|
384
|
+
declare class MenuItemWithChildrenComponent {
|
|
385
|
+
menuItem: CustomMenuItem;
|
|
386
|
+
labelsVisible: boolean;
|
|
387
|
+
showIcons: boolean;
|
|
388
|
+
menuLayoutDirection: string;
|
|
389
|
+
menuItemLayout: string;
|
|
390
|
+
activeItem: CustomMenuItem | undefined;
|
|
391
|
+
direction: MenuLayoutDirection;
|
|
392
|
+
expandableMenuChildren: boolean;
|
|
393
|
+
openMenu: EventEmitter<void>;
|
|
394
|
+
toggleExpand: EventEmitter<CustomMenuItem>;
|
|
395
|
+
toggleMenuExpand(event: MouseEvent, menuItem: CustomMenuItem): void;
|
|
396
|
+
toggleItemExpand(menuItem: CustomMenuItem): void;
|
|
397
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemWithChildrenComponent, never>;
|
|
398
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemWithChildrenComponent, "lib-menu-item-with-children", never, { "menuItem": { "alias": "menuItem"; "required": false; }; "labelsVisible": { "alias": "labelsVisible"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "menuLayoutDirection": { "alias": "menuLayoutDirection"; "required": false; }; "menuItemLayout": { "alias": "menuItemLayout"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "expandableMenuChildren": { "alias": "expandableMenuChildren"; "required": false; }; }, { "openMenu": "openMenu"; "toggleExpand": "toggleExpand"; }, never, never, false, never>;
|
|
399
|
+
}
|
|
400
|
+
|
|
362
401
|
declare class MenuModule {
|
|
363
402
|
static forRoot(config: MenuSharedConfig): ModuleWithProviders<MenuModule>;
|
|
364
403
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuModule, never>;
|
|
365
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MenuModule, [typeof SideNavMenuComponent, typeof NavBaseComponent, typeof MenuItemListComponent, typeof MenuColumnsComponent, typeof MenuIconComponent, typeof MenuItemLinkComponent, typeof MenuItemBtnComponent, typeof MenuProfileComponent, typeof MenuLangSwitcherComponent], [typeof
|
|
404
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MenuModule, [typeof SideNavMenuComponent, typeof NavBaseComponent, typeof MenuItemListComponent, typeof MenuColumnsComponent, typeof MenuIconComponent, typeof MenuItemLinkComponent, typeof MenuItemBtnComponent, typeof MenuProfileComponent, typeof MenuLangSwitcherComponent, typeof MenuItemWithChildrenComponent], [typeof i11.FlexLayoutModule, typeof i12.RouterModule, typeof i13.CommonModule, typeof i14.MatTooltipModule, typeof i15.MatDialogModule, typeof i16.MatIconModule, typeof i17.MatButtonModule, typeof i18.MatListModule, typeof i19.MatMenuModule, typeof i16.MatIconModule, typeof i20.TranslateModule, typeof i21.PlausibleModule, typeof i22.MatProgressSpinnerModule], [typeof SideNavMenuComponent, typeof MenuColumnsComponent]>;
|
|
366
405
|
static ɵinj: i0.ɵɵInjectorDeclaration<MenuModule>;
|
|
367
406
|
}
|
|
368
407
|
|