@tilde-nlp/ngx-menu 7.0.2 → 8.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/fesm2022/tilde-nlp-ngx-menu.mjs +24 -26
- package/fesm2022/tilde-nlp-ngx-menu.mjs.map +1 -1
- package/index.d.ts +382 -3
- package/package.json +10 -10
- package/lib/components/menu-columns/menu-columns.component.d.ts +0 -27
- package/lib/components/menu-icon/menu-icon.component.d.ts +0 -10
- package/lib/components/menu-item-btn/menu-item-btn.component.d.ts +0 -9
- package/lib/components/menu-item-link/menu-item-link.component.d.ts +0 -25
- package/lib/components/menu-item-list/menu-item-list.component.d.ts +0 -21
- package/lib/components/menu-lang-switcher/menu-lang-switcher.component.d.ts +0 -13
- package/lib/components/menu-profile/menu-profile.component.d.ts +0 -16
- package/lib/components/nav-base/models/index.d.ts +0 -1
- package/lib/components/nav-base/models/strapi-data-location.enum.d.ts +0 -5
- package/lib/components/nav-base/nav-base.component.d.ts +0 -19
- package/lib/components/side-nav-menu/index.d.ts +0 -2
- package/lib/components/side-nav-menu/models/index.d.ts +0 -2
- package/lib/components/side-nav-menu/models/side-nav-settings.model.d.ts +0 -10
- package/lib/components/side-nav-menu/models/user-menu-option-button.model.d.ts +0 -3
- package/lib/components/side-nav-menu/models/user-menu-option-icon.model.d.ts +0 -5
- package/lib/components/side-nav-menu/models/user-menu-option-link.model.d.ts +0 -6
- package/lib/components/side-nav-menu/models/user-menu-option.model.d.ts +0 -9
- package/lib/components/side-nav-menu/side-nav-menu.component.d.ts +0 -43
- package/lib/constants/index.d.ts +0 -1
- package/lib/constants/user-menu-options.const.d.ts +0 -18
- package/lib/injection-tokens/index.d.ts +0 -1
- package/lib/injection-tokens/menu-shared-config.token.d.ts +0 -1
- package/lib/menu.module.d.ts +0 -30
- package/lib/models/active-menu-item-config.model.d.ts +0 -4
- package/lib/models/active-menu-items.model.d.ts +0 -6
- package/lib/models/custom-menu-item.model.d.ts +0 -31
- package/lib/models/index.d.ts +0 -7
- package/lib/models/menu-icon-strapi-extension.const.d.ts +0 -1
- package/lib/models/menu-item-group.model.d.ts +0 -22
- package/lib/models/menu-layout-direction.model.d.ts +0 -4
- package/lib/models/menu-shared-config.model.d.ts +0 -21
- package/lib/models/menu-title-navigation.model.d.ts +0 -5
- package/lib/services/index.d.ts +0 -2
- package/lib/services/menu-items.service.d.ts +0 -40
- package/lib/services/strapi.service.d.ts +0 -20
- package/public-api.d.ts +0 -10
package/index.d.ts
CHANGED
|
@@ -1,5 +1,384 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, EventEmitter, ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import * as i20 from '@tilde-nlp/ngx-common';
|
|
4
|
+
import { PlausibleEvent, IconService, DOMService } from '@tilde-nlp/ngx-common';
|
|
5
|
+
import { StrapiSubscriptionService, StrapiApiConfig, StrapiLinkService, PlaceholderComponentBase, StrapiVariablesService } from '@tilde-nlp/ngx-strapi';
|
|
6
|
+
import * as rxjs from 'rxjs';
|
|
7
|
+
import { Observable, Subscription } from 'rxjs';
|
|
8
|
+
import * as i11 from '@angular/router';
|
|
9
|
+
import { IsActiveMatchOptions, Router } from '@angular/router';
|
|
10
|
+
import * as _tilde_nlp_ngx_menu from '@tilde-nlp/ngx-menu';
|
|
11
|
+
import { Media } from '@tilde-nlp/strapi-models';
|
|
12
|
+
import * as i10 from '@ngbracket/ngx-layout';
|
|
13
|
+
import * as i12 from '@angular/common';
|
|
14
|
+
import * as i13 from '@angular/material/tooltip';
|
|
15
|
+
import * as i14 from '@angular/material/dialog';
|
|
16
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
17
|
+
import * as i15 from '@angular/material/icon';
|
|
18
|
+
import * as i16 from '@angular/material/button';
|
|
19
|
+
import * as i17 from '@angular/material/list';
|
|
20
|
+
import * as i18 from '@angular/material/menu';
|
|
21
|
+
import * as i19 from '@ngx-translate/core';
|
|
22
|
+
import * as i21 from '@angular/material/progress-spinner';
|
|
23
|
+
|
|
24
|
+
interface UserMenuOptionIcon {
|
|
25
|
+
name?: string;
|
|
26
|
+
isCustom?: boolean;
|
|
27
|
+
isOutlined?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface UserMenuOptionLink {
|
|
31
|
+
href: string;
|
|
32
|
+
isExternal?: boolean;
|
|
33
|
+
/** User click callback when link is clicked. For example, if you want to catch plausible event. */
|
|
34
|
+
callback?: () => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface UserMenuOptionButton {
|
|
38
|
+
callback: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface UserMenuOption {
|
|
42
|
+
label: string;
|
|
43
|
+
icon?: UserMenuOptionIcon;
|
|
44
|
+
link?: UserMenuOptionLink;
|
|
45
|
+
button?: UserMenuOptionButton;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface SideNavSettings {
|
|
49
|
+
expandedWidth?: string;
|
|
50
|
+
collapsedWidth?: string;
|
|
51
|
+
menuLogo: string;
|
|
52
|
+
menuLogoCollapsed?: string | null;
|
|
53
|
+
disableStrapi?: boolean;
|
|
54
|
+
userOptions: UserMenuOption[];
|
|
55
|
+
disableLogoNavigation?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare enum MenuLayoutDirection {
|
|
59
|
+
column = "column",
|
|
60
|
+
row = "row"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface CustomMenuItem {
|
|
64
|
+
title: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
/** Set to true if angular material icon. False if custom icon. **/
|
|
67
|
+
materialIcon?: boolean;
|
|
68
|
+
isIconOutlined?: boolean;
|
|
69
|
+
link: string;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/** For strapi menu items */
|
|
72
|
+
customId?: string;
|
|
73
|
+
routerLinkActiveOptions?: IsActiveMatchOptions;
|
|
74
|
+
externalLink?: boolean;
|
|
75
|
+
/** Plausible custom event.*/
|
|
76
|
+
plausibleEvent?: PlausibleEvent;
|
|
77
|
+
/** Recursive child elements */
|
|
78
|
+
children?: CustomMenuItem[];
|
|
79
|
+
showChildren?: boolean;
|
|
80
|
+
/** If has children, this property is responsible for child element collapsing */
|
|
81
|
+
expanded?: boolean;
|
|
82
|
+
/** Sub menu is used to show a list of options, every option has title and click action */
|
|
83
|
+
subMenu?: Array<{
|
|
84
|
+
title: string;
|
|
85
|
+
onOptionClick: (param?: unknown) => void;
|
|
86
|
+
}>;
|
|
87
|
+
/** Action to be executed on clicking an item */
|
|
88
|
+
clickAction?: (param?: unknown) => void;
|
|
89
|
+
/** Function to check if item is active. This one replace active button highlight by router*/
|
|
90
|
+
isItemActive?: (param?: unknown) => boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface MenuTitleNavigation {
|
|
94
|
+
path: string;
|
|
95
|
+
icon: string;
|
|
96
|
+
tooltip: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface MenuItemGroup extends MenuItemGroupBase {
|
|
100
|
+
items: CustomMenuItem[];
|
|
101
|
+
/** Used to show loading spinner below group */
|
|
102
|
+
isItemsLoading?: boolean;
|
|
103
|
+
/** Show empty group if there are no items */
|
|
104
|
+
showEmpty?: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface MenuItemGroupBase {
|
|
107
|
+
title?: string;
|
|
108
|
+
titleIcon?: string;
|
|
109
|
+
bottomDivider?: boolean;
|
|
110
|
+
showTitle?: boolean;
|
|
111
|
+
titleNavigation?: MenuTitleNavigation;
|
|
112
|
+
itemGroupClick?: () => void;
|
|
113
|
+
itemGroupIcon?: string;
|
|
114
|
+
/** Set to true if item group is active */
|
|
115
|
+
isItemGroupActive?: () => boolean;
|
|
116
|
+
/** Set to true if icon is registered as svg through icon service */
|
|
117
|
+
isCustomItemGroupIcon?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Necessary for menu components to determine where loaded data from strapi should be placed - either in front of pre defined items or in end. */
|
|
121
|
+
declare enum StrapiDataLocation {
|
|
122
|
+
START = 0,
|
|
123
|
+
END = 1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface MenuSharedConfig {
|
|
127
|
+
/** base url for menu items with relative url */
|
|
128
|
+
baseUrl?: string;
|
|
129
|
+
/** Custom app ID so that menu knows which element is active, if no router link is active */
|
|
130
|
+
customId?: string;
|
|
131
|
+
/** For selecting active element, active match options might dpend from project specifics */
|
|
132
|
+
activeMatchOptions?: IsActiveMatchOptions;
|
|
133
|
+
/** Disabling strapi for all menus. */
|
|
134
|
+
disableStrapi?: boolean;
|
|
135
|
+
/** Menu item groups coming from app. */
|
|
136
|
+
itemGroups?: MenuItemGroup[];
|
|
137
|
+
/** Strapi group base */
|
|
138
|
+
strapiGroupBase?: MenuItemGroup[];
|
|
139
|
+
/** Hides element if customId is the same as element customID */
|
|
140
|
+
hideSelectedCustomId?: boolean;
|
|
141
|
+
/** Where strapi data should be placed */
|
|
142
|
+
strapiDataLocation?: StrapiDataLocation;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare class StarpiMenuService {
|
|
146
|
+
private readonly strapiSubscription;
|
|
147
|
+
private readonly menuConfig;
|
|
148
|
+
private readonly iconService;
|
|
149
|
+
readonly svgIconNamePrefix = "strapi-menu-icon-";
|
|
150
|
+
imgBaseUrl: string;
|
|
151
|
+
constructor(strapiSubscription: StrapiSubscriptionService, menuConfig: MenuSharedConfig, strapiConfig: StrapiApiConfig, iconService: IconService);
|
|
152
|
+
getMenuItems(): Observable<CustomMenuItem[]>;
|
|
153
|
+
unsubscribe(): void;
|
|
154
|
+
private addBaseUrlIfNecessary;
|
|
155
|
+
private convertToCustomMenuItem;
|
|
156
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarpiMenuService, [null, { optional: true; }, { optional: true; }, null]>;
|
|
157
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StarpiMenuService>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Interface for menu items service. Root stores the value of active root element. Child stores the last active children item (if root has no children, it will be the same). */
|
|
161
|
+
interface ActiveMenuItems {
|
|
162
|
+
root?: CustomMenuItem;
|
|
163
|
+
child?: CustomMenuItem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare class MenuItemsService {
|
|
167
|
+
private readonly router;
|
|
168
|
+
protected readonly config: MenuSharedConfig;
|
|
169
|
+
private readonly strapiService;
|
|
170
|
+
private readonly _activeElements;
|
|
171
|
+
get activeElements(): rxjs.Observable<ActiveMenuItems>;
|
|
172
|
+
private strapiItems;
|
|
173
|
+
private _strapiGroup;
|
|
174
|
+
private _allRootItems;
|
|
175
|
+
get allRootItems(): CustomMenuItem[];
|
|
176
|
+
get strapiGroup(): MenuItemGroup;
|
|
177
|
+
private readonly isActiveMatchOptions;
|
|
178
|
+
menuSharedConfig: MenuSharedConfig;
|
|
179
|
+
private get customId();
|
|
180
|
+
private get hideSelectedCustomId();
|
|
181
|
+
private get strapiGroupBase();
|
|
182
|
+
private get strapiDataLocation();
|
|
183
|
+
private _mergedGroups;
|
|
184
|
+
get mergedGroups(): MenuItemGroup[];
|
|
185
|
+
private get menuItemGroups();
|
|
186
|
+
constructor(router: Router, config: MenuSharedConfig, strapiService: StarpiMenuService);
|
|
187
|
+
setMenuItems(config: MenuSharedConfig): void;
|
|
188
|
+
private subscribeToRouteChanges;
|
|
189
|
+
private updateActive;
|
|
190
|
+
/** Finds active element from whole list. RouterLink has priority over custom Id. */
|
|
191
|
+
private findActiveElement;
|
|
192
|
+
private initData;
|
|
193
|
+
private loadData;
|
|
194
|
+
private isElementCustomIdActive;
|
|
195
|
+
private isElementRouterLinkActive;
|
|
196
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemsService, [null, { optional: true; }, null]>;
|
|
197
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MenuItemsService>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare const MENU_ICON_STRAPI_EXTENSION = ".svg";
|
|
201
|
+
|
|
202
|
+
interface ActiveMenuItemConfig {
|
|
203
|
+
includeChildren?: boolean;
|
|
204
|
+
hideSelectedCustomId?: boolean;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
declare class NavBaseComponent implements OnInit, OnDestroy {
|
|
208
|
+
readonly menuItemsService: MenuItemsService;
|
|
209
|
+
direction: MenuLayoutDirection;
|
|
210
|
+
active: ActiveMenuItems;
|
|
211
|
+
protected activeItemSubscription: Subscription;
|
|
212
|
+
constructor(menuItemsService: MenuItemsService);
|
|
213
|
+
ngOnInit(): void;
|
|
214
|
+
initBase(): void;
|
|
215
|
+
ngOnDestroy(): void;
|
|
216
|
+
destroyBase(): void;
|
|
217
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavBaseComponent, never>;
|
|
218
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavBaseComponent, "nav-base", never, { "direction": { "alias": "direction"; "required": false; }; }, {}, never, never, false, never>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, OnDestroy {
|
|
222
|
+
#private;
|
|
223
|
+
strapiLinkService: StrapiLinkService;
|
|
224
|
+
readonly domService: DOMService;
|
|
225
|
+
readonly menuItems: MenuItemsService;
|
|
226
|
+
get username(): string;
|
|
227
|
+
set username(value: string);
|
|
228
|
+
menuSettings: SideNavSettings;
|
|
229
|
+
productName: string;
|
|
230
|
+
supportedLanguages: string[];
|
|
231
|
+
useDefaultLanguageSwitcher: boolean;
|
|
232
|
+
changeLanguageEvent: EventEmitter<string>;
|
|
233
|
+
userInitials: string;
|
|
234
|
+
collapsed: boolean;
|
|
235
|
+
readonly COLLAPSED_LOCAL_STORAGE_KEY = "TLD_MENU_SIDE_NAV_COLLAPSED";
|
|
236
|
+
private readonly COLLAPSE_PLAUSIBLE_EVENT_ID;
|
|
237
|
+
private readonly COLLAPSE_PLAUSIBLE_ACTION_KEY;
|
|
238
|
+
private readonly LOGOCLICK_PLAUSIBLE_ACTION_ID;
|
|
239
|
+
readonly LOGOCLICK_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
240
|
+
readonly EXPAND_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
241
|
+
readonly COLLAPSE_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
242
|
+
readonly baseUrl: string | undefined;
|
|
243
|
+
get menuLogoImage(): string;
|
|
244
|
+
get sideNavWidth(): string | undefined;
|
|
245
|
+
constructor(strapiLinkService: StrapiLinkService, domService: DOMService, menuItems: MenuItemsService);
|
|
246
|
+
ngOnInit(): void;
|
|
247
|
+
logoClick(event: MouseEvent): void;
|
|
248
|
+
toggleCollapse(): void;
|
|
249
|
+
linkCallback(link: UserMenuOptionLink): void;
|
|
250
|
+
changeLanguage(lang: string): void;
|
|
251
|
+
private getColapsedFromLocalStorage;
|
|
252
|
+
private setColapsedFromLocalStorage;
|
|
253
|
+
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>;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare const MENU_SHARED_CONFIG = "menu-shared-config";
|
|
258
|
+
|
|
259
|
+
declare class MenuItemListComponent {
|
|
260
|
+
direction: MenuLayoutDirection;
|
|
261
|
+
labelsVisible: boolean;
|
|
262
|
+
activeItem: CustomMenuItem | undefined;
|
|
263
|
+
showIcons: boolean;
|
|
264
|
+
items: CustomMenuItem[];
|
|
265
|
+
menuItemGroup: MenuItemGroupBase;
|
|
266
|
+
toggleExpand: EventEmitter<CustomMenuItem>;
|
|
267
|
+
get titleKey(): string | undefined;
|
|
268
|
+
get showTitle(): boolean | undefined;
|
|
269
|
+
get menuLayoutDirection(): string;
|
|
270
|
+
get menuItemLayout(): string;
|
|
271
|
+
toggleItemExpand(event: MouseEvent, menuItem: CustomMenuItem): void;
|
|
272
|
+
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>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare class MenuColumnsComponent implements OnInit {
|
|
277
|
+
protected readonly router: Router;
|
|
278
|
+
protected readonly menuSharedConfig: MenuSharedConfig;
|
|
279
|
+
private readonly menuItemsService;
|
|
280
|
+
direction: MenuLayoutDirection;
|
|
281
|
+
isOpen: boolean;
|
|
282
|
+
toggleCollapseEvent: EventEmitter<any>;
|
|
283
|
+
private _active;
|
|
284
|
+
get active(): ActiveMenuItems;
|
|
285
|
+
set active(value: ActiveMenuItems);
|
|
286
|
+
activeItem?: CustomMenuItem;
|
|
287
|
+
get mergedGroups(): _tilde_nlp_ngx_menu.MenuItemGroup[];
|
|
288
|
+
constructor(router: Router, menuSharedConfig: MenuSharedConfig, menuItemsService: MenuItemsService);
|
|
289
|
+
ngOnInit(): void;
|
|
290
|
+
elementExpanded(element?: CustomMenuItem): void;
|
|
291
|
+
private toggleOnMobileSelect;
|
|
292
|
+
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>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
declare class MenuIconComponent {
|
|
297
|
+
readonly svgExtension = ".svg";
|
|
298
|
+
menuItem: CustomMenuItem;
|
|
299
|
+
isIconMediaType(icon: any): icon is Media;
|
|
300
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuIconComponent, never>;
|
|
301
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuIconComponent, "tld-menu-icon", never, { "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare class MenuItemLinkComponent implements OnInit, OnDestroy, PlaceholderComponentBase {
|
|
305
|
+
private readonly strapiLinkService;
|
|
306
|
+
private readonly placeholderService;
|
|
307
|
+
direction: MenuLayoutDirection;
|
|
308
|
+
labelsVisible: boolean;
|
|
309
|
+
activeItem: CustomMenuItem | undefined;
|
|
310
|
+
showIcons: boolean;
|
|
311
|
+
menuItem: CustomMenuItem;
|
|
312
|
+
textWithPlaceholders: string;
|
|
313
|
+
href: string;
|
|
314
|
+
private placeholderServiceId;
|
|
315
|
+
get menuItemLayout(): string;
|
|
316
|
+
get menuLayoutDirection(): string;
|
|
317
|
+
constructor(strapiLinkService: StrapiLinkService, placeholderService: StrapiVariablesService);
|
|
318
|
+
ngOnInit(): void;
|
|
319
|
+
linkClick(event: MouseEvent, item: CustomMenuItem): void;
|
|
320
|
+
updateTextWithPlaceholders: (textWithReplacedPlaceholders: string) => string;
|
|
321
|
+
ngOnDestroy(): void;
|
|
322
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemLinkComponent, never>;
|
|
323
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemLinkComponent, "tld-menu-item-link", never, { "direction": { "alias": "direction"; "required": false; }; "labelsVisible": { "alias": "labelsVisible"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare class MenuItemBtnComponent {
|
|
327
|
+
direction: MenuLayoutDirection;
|
|
328
|
+
activeItem: CustomMenuItem | undefined;
|
|
329
|
+
menuItem: CustomMenuItem;
|
|
330
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemBtnComponent, never>;
|
|
331
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemBtnComponent, "lib-menu-item-btn", never, { "direction": { "alias": "direction"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
declare class MenuProfileComponent implements OnInit {
|
|
335
|
+
collapsed: i0.InputSignal<boolean | undefined>;
|
|
336
|
+
username: i0.InputSignal<string | undefined>;
|
|
337
|
+
userOptions: i0.InputSignal<UserMenuOption[] | undefined>;
|
|
338
|
+
linkCallbackEvent: i0.OutputEmitterRef<UserMenuOptionLink>;
|
|
339
|
+
userInitials: string;
|
|
340
|
+
ngOnInit(): void;
|
|
341
|
+
linkCallback(link: UserMenuOptionLink): void;
|
|
342
|
+
private setUserInitials;
|
|
343
|
+
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>;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare class MenuLangSwitcherComponent implements OnInit {
|
|
348
|
+
#private;
|
|
349
|
+
isCollapsed: boolean;
|
|
350
|
+
languages: string[];
|
|
351
|
+
changeLanguageEvent: EventEmitter<string>;
|
|
352
|
+
currentLanguageCode: string;
|
|
353
|
+
ngOnInit(): void;
|
|
354
|
+
changeLanguage(lang: string): void;
|
|
355
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuLangSwitcherComponent, never>;
|
|
356
|
+
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>;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class MenuModule {
|
|
360
|
+
static forRoot(config: MenuSharedConfig): ModuleWithProviders<MenuModule>;
|
|
361
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuModule, never>;
|
|
362
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MenuModule, [typeof SideNavMenuComponent, typeof NavBaseComponent, typeof MenuItemListComponent, typeof MenuColumnsComponent, typeof MenuIconComponent, typeof MenuItemLinkComponent, typeof MenuItemBtnComponent, typeof MenuProfileComponent, typeof MenuLangSwitcherComponent], [typeof i10.FlexLayoutModule, typeof i11.RouterModule, typeof i12.CommonModule, typeof i13.MatTooltipModule, typeof i14.MatDialogModule, typeof i15.MatIconModule, typeof i16.MatButtonModule, typeof i17.MatListModule, typeof i18.MatMenuModule, typeof i15.MatIconModule, typeof i19.TranslateModule, typeof i20.PlausibleModule, typeof i20.LanguageTranslateModule, typeof i21.MatProgressSpinnerModule], [typeof SideNavMenuComponent, typeof MenuColumnsComponent]>;
|
|
363
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MenuModule>;
|
|
364
|
+
}
|
|
365
|
+
|
|
1
366
|
/**
|
|
2
|
-
*
|
|
367
|
+
* Prefefined user menu options, so that same style of items are used across all products. Use this by passing necessary configuration.
|
|
3
368
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
369
|
+
declare const USER_MENU_OPTIONS: {
|
|
370
|
+
subscription: (href: string, callback?: () => void) => UserMenuOption;
|
|
371
|
+
termsOfUse: (href: string, callback?: () => void) => UserMenuOption;
|
|
372
|
+
privacy: (href: string, callback?: () => void) => UserMenuOption;
|
|
373
|
+
help: (href: string, icon?: {
|
|
374
|
+
name: string;
|
|
375
|
+
isCustom: boolean;
|
|
376
|
+
}, callback?: () => void) => UserMenuOption;
|
|
377
|
+
contactUs: (href: string, callback?: () => void) => UserMenuOption;
|
|
378
|
+
/** use language update callback to save in localstorage */
|
|
379
|
+
changeLanguage: (dialog: MatDialog, languages: string[], languageChangeCallback?: (language: string) => void) => UserMenuOption;
|
|
380
|
+
logout: (callback: () => void) => UserMenuOption;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
export { MENU_ICON_STRAPI_EXTENSION, MENU_SHARED_CONFIG, MenuColumnsComponent, MenuItemsService, MenuLayoutDirection, MenuModule, NavBaseComponent, SideNavMenuComponent, StarpiMenuService, StrapiDataLocation, USER_MENU_OPTIONS };
|
|
384
|
+
export type { ActiveMenuItemConfig, ActiveMenuItems, CustomMenuItem, MenuItemGroup, MenuItemGroupBase, MenuSharedConfig, SideNavSettings, UserMenuOption };
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tilde-nlp/ngx-menu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"@ngbracket/ngx-layout": "^
|
|
8
|
-
"@angular/cdk": "^
|
|
9
|
-
"@angular/router": "^
|
|
5
|
+
"@angular/common": "^20.0.0",
|
|
6
|
+
"@angular/core": "^20.0.0",
|
|
7
|
+
"@ngbracket/ngx-layout": "^20.0.0",
|
|
8
|
+
"@angular/cdk": "^20.0.0",
|
|
9
|
+
"@angular/router": "^20.0.0",
|
|
10
10
|
"@ngx-translate/core": "^17.0.0",
|
|
11
11
|
"@ngx-translate/http-loader": "^17.0.0",
|
|
12
|
-
"@tilde-nlp/ngx-common": "~
|
|
13
|
-
"@tilde-nlp/ngx-strapi": "~
|
|
12
|
+
"@tilde-nlp/ngx-common": "~8.0.0",
|
|
13
|
+
"@tilde-nlp/ngx-strapi": "~8.0.0",
|
|
14
14
|
"@tilde-nlp/strapi-models": "1.x"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"tslib": "2.
|
|
17
|
+
"tslib": "2.8.1"
|
|
18
18
|
},
|
|
19
19
|
"author": "Tilde",
|
|
20
20
|
"license": "Apache-2.0",
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"scripts": {
|
|
34
|
-
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled
|
|
34
|
+
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with partial compilation mode, before attempting to publish.\\n')\" && exit 1"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { CustomMenuItem } from '../../models/custom-menu-item.model';
|
|
4
|
-
import { MenuLayoutDirection } from '../../models/menu-layout-direction.model';
|
|
5
|
-
import { MenuSharedConfig } from '../../models/menu-shared-config.model';
|
|
6
|
-
import { MenuItemsService } from '../../services/menu-items.service';
|
|
7
|
-
import { ActiveMenuItems } from '../../models';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export declare class MenuColumnsComponent implements OnInit {
|
|
10
|
-
protected readonly router: Router;
|
|
11
|
-
protected readonly menuSharedConfig: MenuSharedConfig;
|
|
12
|
-
private readonly menuItemsService;
|
|
13
|
-
direction: MenuLayoutDirection;
|
|
14
|
-
isOpen: boolean;
|
|
15
|
-
toggleCollapseEvent: EventEmitter<any>;
|
|
16
|
-
private _active;
|
|
17
|
-
get active(): ActiveMenuItems;
|
|
18
|
-
set active(value: ActiveMenuItems);
|
|
19
|
-
activeItem?: CustomMenuItem;
|
|
20
|
-
get mergedGroups(): import("../../models").MenuItemGroup[];
|
|
21
|
-
constructor(router: Router, menuSharedConfig: MenuSharedConfig, menuItemsService: MenuItemsService);
|
|
22
|
-
ngOnInit(): void;
|
|
23
|
-
elementExpanded(element?: CustomMenuItem): void;
|
|
24
|
-
private toggleOnMobileSelect;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuColumnsComponent, [null, { optional: true; }, null]>;
|
|
26
|
-
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>;
|
|
27
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Media } from '@tilde-nlp/strapi-models';
|
|
2
|
-
import { CustomMenuItem } from '../../models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class MenuIconComponent {
|
|
5
|
-
readonly svgExtension = ".svg";
|
|
6
|
-
menuItem: CustomMenuItem;
|
|
7
|
-
isIconMediaType(icon: any): icon is Media;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuIconComponent, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuIconComponent, "tld-menu-icon", never, { "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CustomMenuItem, MenuLayoutDirection } from '../../models';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MenuItemBtnComponent {
|
|
4
|
-
direction: MenuLayoutDirection;
|
|
5
|
-
activeItem: CustomMenuItem | undefined;
|
|
6
|
-
menuItem: CustomMenuItem;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemBtnComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemBtnComponent, "lib-menu-item-btn", never, { "direction": { "alias": "direction"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
9
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { PlaceholderComponentBase, StrapiLinkService, StrapiVariablesService } from '@tilde-nlp/ngx-strapi';
|
|
3
|
-
import { CustomMenuItem, MenuLayoutDirection } from '../../models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class MenuItemLinkComponent implements OnInit, OnDestroy, PlaceholderComponentBase {
|
|
6
|
-
private readonly strapiLinkService;
|
|
7
|
-
private readonly placeholderService;
|
|
8
|
-
direction: MenuLayoutDirection;
|
|
9
|
-
labelsVisible: boolean;
|
|
10
|
-
activeItem: CustomMenuItem | undefined;
|
|
11
|
-
showIcons: boolean;
|
|
12
|
-
menuItem: CustomMenuItem;
|
|
13
|
-
textWithPlaceholders: string;
|
|
14
|
-
href: string;
|
|
15
|
-
private placeholderServiceId;
|
|
16
|
-
get menuItemLayout(): string;
|
|
17
|
-
get menuLayoutDirection(): string;
|
|
18
|
-
constructor(strapiLinkService: StrapiLinkService, placeholderService: StrapiVariablesService);
|
|
19
|
-
ngOnInit(): void;
|
|
20
|
-
linkClick(event: MouseEvent, item: CustomMenuItem): void;
|
|
21
|
-
updateTextWithPlaceholders: (textWithReplacedPlaceholders: string) => string;
|
|
22
|
-
ngOnDestroy(): void;
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemLinkComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemLinkComponent, "tld-menu-item-link", never, { "direction": { "alias": "direction"; "required": false; }; "labelsVisible": { "alias": "labelsVisible"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "menuItem": { "alias": "menuItem"; "required": false; }; }, {}, never, never, false, never>;
|
|
25
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { CustomMenuItem } from '../../models/custom-menu-item.model';
|
|
3
|
-
import { MenuItemGroupBase } from '../../models/menu-item-group.model';
|
|
4
|
-
import { MenuLayoutDirection } from '../../models/menu-layout-direction.model';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class MenuItemListComponent {
|
|
7
|
-
direction: MenuLayoutDirection;
|
|
8
|
-
labelsVisible: boolean;
|
|
9
|
-
activeItem: CustomMenuItem | undefined;
|
|
10
|
-
showIcons: boolean;
|
|
11
|
-
items: CustomMenuItem[];
|
|
12
|
-
menuItemGroup: MenuItemGroupBase;
|
|
13
|
-
toggleExpand: EventEmitter<CustomMenuItem>;
|
|
14
|
-
get titleKey(): string | undefined;
|
|
15
|
-
get showTitle(): boolean | undefined;
|
|
16
|
-
get menuLayoutDirection(): string;
|
|
17
|
-
get menuItemLayout(): string;
|
|
18
|
-
toggleItemExpand(event: MouseEvent, menuItem: CustomMenuItem): void;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemListComponent, never>;
|
|
20
|
-
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>;
|
|
21
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MenuLangSwitcherComponent implements OnInit {
|
|
4
|
-
#private;
|
|
5
|
-
isCollapsed: boolean;
|
|
6
|
-
languages: string[];
|
|
7
|
-
changeLanguageEvent: EventEmitter<string>;
|
|
8
|
-
currentLanguageCode: string;
|
|
9
|
-
ngOnInit(): void;
|
|
10
|
-
changeLanguage(lang: string): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuLangSwitcherComponent, never>;
|
|
12
|
-
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>;
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { UserMenuOption } from '../side-nav-menu';
|
|
3
|
-
import { UserMenuOptionLink } from '../side-nav-menu/models/user-menu-option-link.model';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class MenuProfileComponent implements OnInit {
|
|
6
|
-
collapsed: import("@angular/core").InputSignal<boolean | undefined>;
|
|
7
|
-
username: import("@angular/core").InputSignal<string | undefined>;
|
|
8
|
-
userOptions: import("@angular/core").InputSignal<UserMenuOption[] | undefined>;
|
|
9
|
-
linkCallbackEvent: import("@angular/core").OutputEmitterRef<UserMenuOptionLink>;
|
|
10
|
-
userInitials: string;
|
|
11
|
-
ngOnInit(): void;
|
|
12
|
-
linkCallback(link: UserMenuOptionLink): void;
|
|
13
|
-
private setUserInitials;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuProfileComponent, never>;
|
|
15
|
-
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>;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './strapi-data-location.enum';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { MenuLayoutDirection } from '../../models/menu-layout-direction.model';
|
|
3
|
-
import { MenuItemsService } from '../../services/menu-items.service';
|
|
4
|
-
import { ActiveMenuItems } from '../../models';
|
|
5
|
-
import { Subscription } from 'rxjs';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class NavBaseComponent implements OnInit, OnDestroy {
|
|
8
|
-
readonly menuItemsService: MenuItemsService;
|
|
9
|
-
direction: MenuLayoutDirection;
|
|
10
|
-
active: ActiveMenuItems;
|
|
11
|
-
protected activeItemSubscription: Subscription;
|
|
12
|
-
constructor(menuItemsService: MenuItemsService);
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
initBase(): void;
|
|
15
|
-
ngOnDestroy(): void;
|
|
16
|
-
destroyBase(): void;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NavBaseComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NavBaseComponent, "nav-base", never, { "direction": { "alias": "direction"; "required": false; }; }, {}, never, never, false, never>;
|
|
19
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { UserMenuOption } from './user-menu-option.model';
|
|
2
|
-
export interface SideNavSettings {
|
|
3
|
-
expandedWidth?: string;
|
|
4
|
-
collapsedWidth?: string;
|
|
5
|
-
menuLogo: string;
|
|
6
|
-
menuLogoCollapsed?: string | null;
|
|
7
|
-
disableStrapi?: boolean;
|
|
8
|
-
userOptions: UserMenuOption[];
|
|
9
|
-
disableLogoNavigation?: boolean;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { UserMenuOptionIcon } from './user-menu-option-icon.model';
|
|
2
|
-
import { UserMenuOptionLink } from './user-menu-option-link.model';
|
|
3
|
-
import { UserMenuOptionButton } from './user-menu-option-button.model';
|
|
4
|
-
export interface UserMenuOption {
|
|
5
|
-
label: string;
|
|
6
|
-
icon?: UserMenuOptionIcon;
|
|
7
|
-
link?: UserMenuOptionLink;
|
|
8
|
-
button?: UserMenuOptionButton;
|
|
9
|
-
}
|