@tilde-nlp/ngx-menu 8.1.56 → 8.1.58
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 +233 -141
- package/fesm2022/tilde-nlp-ngx-menu.mjs.map +1 -1
- package/index.d.ts +27 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tilde_nlp_strapi_models from '@tilde-nlp/strapi-models';
|
|
2
|
-
import {
|
|
2
|
+
import { Menu, Media } from '@tilde-nlp/strapi-models';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { OnInit, OnDestroy, EventEmitter, ModuleWithProviders } from '@angular/core';
|
|
5
5
|
import * as i21 from '@tilde-nlp/ngx-common';
|
|
@@ -26,6 +26,17 @@ declare enum MENU_VERSION {
|
|
|
26
26
|
COMPACT = "compact-menu"
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Interface for custom icons for sidebar top icon button action.
|
|
31
|
+
* Support only material icons
|
|
32
|
+
*/
|
|
33
|
+
interface CustomIcons {
|
|
34
|
+
customOpenIcon?: string;
|
|
35
|
+
customCloseIcon?: string;
|
|
36
|
+
customMobileCloseIcon?: string;
|
|
37
|
+
customMobileOpenIcon?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
interface UserMenuOptionIcon {
|
|
30
41
|
name?: string;
|
|
31
42
|
isCustom?: boolean;
|
|
@@ -45,6 +56,7 @@ interface UserMenuOptionButton {
|
|
|
45
56
|
|
|
46
57
|
interface UserMenuOption {
|
|
47
58
|
label: string;
|
|
59
|
+
permission?: string;
|
|
48
60
|
icon?: UserMenuOptionIcon;
|
|
49
61
|
link?: UserMenuOptionLink;
|
|
50
62
|
button?: UserMenuOptionButton;
|
|
@@ -63,6 +75,7 @@ interface SideNavSettings {
|
|
|
63
75
|
openExternalLinksInSameTab?: boolean;
|
|
64
76
|
showAccessibility?: boolean;
|
|
65
77
|
menuVersion?: MENU_VERSION;
|
|
78
|
+
customIcons?: CustomIcons;
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
declare enum MenuLayoutDirection {
|
|
@@ -128,6 +141,8 @@ interface MenuItemGroupBase {
|
|
|
128
141
|
isItemGroupActive?: () => boolean;
|
|
129
142
|
/** Set to true if icon is registered as svg through icon service */
|
|
130
143
|
isCustomItemGroupIcon?: boolean;
|
|
144
|
+
/** Provide if menu should display description block. Description block uses title and description params. */
|
|
145
|
+
description?: string;
|
|
131
146
|
}
|
|
132
147
|
|
|
133
148
|
/** Necessary for menu components to determine where loaded data from strapi should be placed - either in front of pre defined items or in end. */
|
|
@@ -163,12 +178,13 @@ declare class StarpiMenuService {
|
|
|
163
178
|
private readonly menuConfig;
|
|
164
179
|
private readonly iconService;
|
|
165
180
|
readonly svgIconNamePrefix = "strapi-menu-icon-";
|
|
166
|
-
|
|
181
|
+
apiUrl: string;
|
|
167
182
|
appId: string;
|
|
168
|
-
|
|
183
|
+
strapiMenu: i0.WritableSignal<Menu | null>;
|
|
169
184
|
constructor(strapiSubscription: StrapiSubscriptionService, menuConfig: MenuSharedConfig, strapiConfig: StrapiApiConfig, iconService: IconService);
|
|
170
185
|
getMenuItems(): Observable<CustomMenuItem[]>;
|
|
171
186
|
unsubscribe(): void;
|
|
187
|
+
private registerSvgIcon;
|
|
172
188
|
private filterMenuItems;
|
|
173
189
|
private addBaseUrlIfNecessary;
|
|
174
190
|
private convertToCustomMenuItem;
|
|
@@ -202,7 +218,8 @@ declare class MenuItemsService {
|
|
|
202
218
|
private _mergedGroups;
|
|
203
219
|
get mergedGroups(): MenuItemGroup[];
|
|
204
220
|
private get menuItemGroups();
|
|
205
|
-
get
|
|
221
|
+
get strapiMenu(): i0.WritableSignal<_tilde_nlp_strapi_models.Menu | null>;
|
|
222
|
+
get strapiApiUrl(): string;
|
|
206
223
|
constructor(router: Router, config: MenuSharedConfig, strapiService: StarpiMenuService);
|
|
207
224
|
setMenuItems(config: MenuSharedConfig): void;
|
|
208
225
|
/** Finds active element from whole list. RouterLink has priority over custom Id. */
|
|
@@ -254,6 +271,7 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
254
271
|
loginEvent: EventEmitter<any>;
|
|
255
272
|
userInitials: string;
|
|
256
273
|
collapsed: boolean;
|
|
274
|
+
customIcons: CustomIcons;
|
|
257
275
|
readonly COLLAPSED_LOCAL_STORAGE_KEY = "TLD_MENU_SIDE_NAV_COLLAPSED";
|
|
258
276
|
private readonly COLLAPSE_PLAUSIBLE_EVENT_ID;
|
|
259
277
|
private readonly COLLAPSE_PLAUSIBLE_ACTION_KEY;
|
|
@@ -262,9 +280,11 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
262
280
|
readonly EXPAND_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
263
281
|
readonly COLLAPSE_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
264
282
|
readonly baseUrl: string | undefined;
|
|
283
|
+
userOptions: i0.Signal<UserMenuOption[]>;
|
|
265
284
|
logoImageSource: i0.Signal<string>;
|
|
285
|
+
strapiMenuTitle: i0.Signal<string | undefined>;
|
|
266
286
|
get sideNavWidth(): string | undefined;
|
|
267
|
-
get footerItems(): _tilde_nlp_strapi_models.MenuItem[];
|
|
287
|
+
get footerItems(): _tilde_nlp_strapi_models.MenuItem[] | undefined;
|
|
268
288
|
isMobileRes: boolean;
|
|
269
289
|
isViewIncreased: i0.Signal<boolean>;
|
|
270
290
|
constructor(strapiLinkService: StrapiLinkService, domService: DOMService, menuItems: MenuItemsService, accessibility: AccessibilityService);
|
|
@@ -276,6 +296,8 @@ declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, O
|
|
|
276
296
|
changeLanguage(lang: string): void;
|
|
277
297
|
private getColapsedFromLocalStorage;
|
|
278
298
|
private setColapsedFromLocalStorage;
|
|
299
|
+
private setIcons;
|
|
300
|
+
private hasPermission;
|
|
279
301
|
static ɵfac: i0.ɵɵFactoryDeclaration<SideNavMenuComponent, never>;
|
|
280
302
|
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>;
|
|
281
303
|
}
|