@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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { DOMService, PlausibleEvent } from '@tilde-nlp/ngx-common';
|
|
3
|
-
import { StrapiLinkService } from '@tilde-nlp/ngx-strapi';
|
|
4
|
-
import { NavBaseComponent } from '../nav-base/nav-base.component';
|
|
5
|
-
import { SideNavSettings } from './models/side-nav-settings.model';
|
|
6
|
-
import { MenuItemsService } from '../../services/menu-items.service';
|
|
7
|
-
import { UserMenuOptionLink } from './models/user-menu-option-link.model';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export declare class SideNavMenuComponent extends NavBaseComponent implements OnInit, OnDestroy {
|
|
10
|
-
#private;
|
|
11
|
-
strapiLinkService: StrapiLinkService;
|
|
12
|
-
readonly domService: DOMService;
|
|
13
|
-
readonly menuItems: MenuItemsService;
|
|
14
|
-
get username(): string;
|
|
15
|
-
set username(value: string);
|
|
16
|
-
menuSettings: SideNavSettings;
|
|
17
|
-
productName: string;
|
|
18
|
-
supportedLanguages: string[];
|
|
19
|
-
useDefaultLanguageSwitcher: boolean;
|
|
20
|
-
changeLanguageEvent: EventEmitter<string>;
|
|
21
|
-
userInitials: string;
|
|
22
|
-
collapsed: boolean;
|
|
23
|
-
readonly COLLAPSED_LOCAL_STORAGE_KEY = "TLD_MENU_SIDE_NAV_COLLAPSED";
|
|
24
|
-
private readonly COLLAPSE_PLAUSIBLE_EVENT_ID;
|
|
25
|
-
private readonly COLLAPSE_PLAUSIBLE_ACTION_KEY;
|
|
26
|
-
private readonly LOGOCLICK_PLAUSIBLE_ACTION_ID;
|
|
27
|
-
readonly LOGOCLICK_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
28
|
-
readonly EXPAND_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
29
|
-
readonly COLLAPSE_PLAUSIBLE_EVENT: PlausibleEvent;
|
|
30
|
-
readonly baseUrl: string | undefined;
|
|
31
|
-
get menuLogoImage(): string;
|
|
32
|
-
get sideNavWidth(): string | undefined;
|
|
33
|
-
constructor(strapiLinkService: StrapiLinkService, domService: DOMService, menuItems: MenuItemsService);
|
|
34
|
-
ngOnInit(): void;
|
|
35
|
-
logoClick(event: MouseEvent): void;
|
|
36
|
-
toggleCollapse(): void;
|
|
37
|
-
linkCallback(link: UserMenuOptionLink): void;
|
|
38
|
-
changeLanguage(lang: string): void;
|
|
39
|
-
private getColapsedFromLocalStorage;
|
|
40
|
-
private setColapsedFromLocalStorage;
|
|
41
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SideNavMenuComponent, never>;
|
|
42
|
-
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>;
|
|
43
|
-
}
|
package/lib/constants/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './user-menu-options.const';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { UserMenuOption } from '../components/side-nav-menu/models/user-menu-option.model';
|
|
2
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
3
|
-
/**
|
|
4
|
-
* Prefefined user menu options, so that same style of items are used across all products. Use this by passing necessary configuration.
|
|
5
|
-
*/
|
|
6
|
-
export declare const USER_MENU_OPTIONS: {
|
|
7
|
-
subscription: (href: string, callback?: () => void) => UserMenuOption;
|
|
8
|
-
termsOfUse: (href: string, callback?: () => void) => UserMenuOption;
|
|
9
|
-
privacy: (href: string, callback?: () => void) => UserMenuOption;
|
|
10
|
-
help: (href: string, icon?: {
|
|
11
|
-
name: string;
|
|
12
|
-
isCustom: boolean;
|
|
13
|
-
}, callback?: () => void) => UserMenuOption;
|
|
14
|
-
contactUs: (href: string, callback?: () => void) => UserMenuOption;
|
|
15
|
-
/** use language update callback to save in localstorage */
|
|
16
|
-
changeLanguage: (dialog: MatDialog, languages: string[], languageChangeCallback?: (language: string) => void) => UserMenuOption;
|
|
17
|
-
logout: (callback: () => void) => UserMenuOption;
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./menu-shared-config.token";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MENU_SHARED_CONFIG = "menu-shared-config";
|
package/lib/menu.module.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { MenuSharedConfig } from './models/menu-shared-config.model';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./components/side-nav-menu/side-nav-menu.component";
|
|
5
|
-
import * as i2 from "./components/nav-base/nav-base.component";
|
|
6
|
-
import * as i3 from "./components/menu-item-list/menu-item-list.component";
|
|
7
|
-
import * as i4 from "./components/menu-columns/menu-columns.component";
|
|
8
|
-
import * as i5 from "./components/menu-icon/menu-icon.component";
|
|
9
|
-
import * as i6 from "./components/menu-item-link/menu-item-link.component";
|
|
10
|
-
import * as i7 from "./components/menu-item-btn/menu-item-btn.component";
|
|
11
|
-
import * as i8 from "./components/menu-profile/menu-profile.component";
|
|
12
|
-
import * as i9 from "./components/menu-lang-switcher/menu-lang-switcher.component";
|
|
13
|
-
import * as i10 from "@ngbracket/ngx-layout";
|
|
14
|
-
import * as i11 from "@angular/router";
|
|
15
|
-
import * as i12 from "@angular/common";
|
|
16
|
-
import * as i13 from "@angular/material/tooltip";
|
|
17
|
-
import * as i14 from "@angular/material/dialog";
|
|
18
|
-
import * as i15 from "@angular/material/icon";
|
|
19
|
-
import * as i16 from "@angular/material/button";
|
|
20
|
-
import * as i17 from "@angular/material/list";
|
|
21
|
-
import * as i18 from "@angular/material/menu";
|
|
22
|
-
import * as i19 from "@ngx-translate/core";
|
|
23
|
-
import * as i20 from "@tilde-nlp/ngx-common";
|
|
24
|
-
import * as i21 from "@angular/material/progress-spinner";
|
|
25
|
-
export declare class MenuModule {
|
|
26
|
-
static forRoot(config: MenuSharedConfig): ModuleWithProviders<MenuModule>;
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuModule, never>;
|
|
28
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MenuModule, [typeof i1.SideNavMenuComponent, typeof i2.NavBaseComponent, typeof i3.MenuItemListComponent, typeof i4.MenuColumnsComponent, typeof i5.MenuIconComponent, typeof i6.MenuItemLinkComponent, typeof i7.MenuItemBtnComponent, typeof i8.MenuProfileComponent, typeof i9.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 i1.SideNavMenuComponent, typeof i4.MenuColumnsComponent]>;
|
|
29
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<MenuModule>;
|
|
30
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CustomMenuItem } from "./custom-menu-item.model";
|
|
2
|
-
/** 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). */
|
|
3
|
-
export interface ActiveMenuItems {
|
|
4
|
-
root?: CustomMenuItem;
|
|
5
|
-
child?: CustomMenuItem;
|
|
6
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IsActiveMatchOptions } from "@angular/router";
|
|
2
|
-
import { PlausibleEvent } from "@tilde-nlp/ngx-common";
|
|
3
|
-
export interface CustomMenuItem {
|
|
4
|
-
title: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
/** Set to true if angular material icon. False if custom icon. **/
|
|
7
|
-
materialIcon?: boolean;
|
|
8
|
-
isIconOutlined?: boolean;
|
|
9
|
-
link: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
/** For strapi menu items */
|
|
12
|
-
customId?: string;
|
|
13
|
-
routerLinkActiveOptions?: IsActiveMatchOptions;
|
|
14
|
-
externalLink?: boolean;
|
|
15
|
-
/** Plausible custom event.*/
|
|
16
|
-
plausibleEvent?: PlausibleEvent;
|
|
17
|
-
/** Recursive child elements */
|
|
18
|
-
children?: CustomMenuItem[];
|
|
19
|
-
showChildren?: boolean;
|
|
20
|
-
/** If has children, this property is responsible for child element collapsing */
|
|
21
|
-
expanded?: boolean;
|
|
22
|
-
/** Sub menu is used to show a list of options, every option has title and click action */
|
|
23
|
-
subMenu?: Array<{
|
|
24
|
-
title: string;
|
|
25
|
-
onOptionClick: (param?: unknown) => void;
|
|
26
|
-
}>;
|
|
27
|
-
/** Action to be executed on clicking an item */
|
|
28
|
-
clickAction?: (param?: unknown) => void;
|
|
29
|
-
/** Function to check if item is active. This one replace active button highlight by router*/
|
|
30
|
-
isItemActive?: (param?: unknown) => boolean;
|
|
31
|
-
}
|
package/lib/models/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./menu-shared-config.model";
|
|
2
|
-
export * from "./custom-menu-item.model";
|
|
3
|
-
export * from "./menu-icon-strapi-extension.const";
|
|
4
|
-
export * from "./menu-item-group.model";
|
|
5
|
-
export * from "./menu-layout-direction.model";
|
|
6
|
-
export * from "./active-menu-item-config.model";
|
|
7
|
-
export * from "./active-menu-items.model";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MENU_ICON_STRAPI_EXTENSION = ".svg";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CustomMenuItem } from "./custom-menu-item.model";
|
|
2
|
-
import { MenuTitleNavigation } from "./menu-title-navigation.model";
|
|
3
|
-
export interface MenuItemGroup extends MenuItemGroupBase {
|
|
4
|
-
items: CustomMenuItem[];
|
|
5
|
-
/** Used to show loading spinner below group */
|
|
6
|
-
isItemsLoading?: boolean;
|
|
7
|
-
/** Show empty group if there are no items */
|
|
8
|
-
showEmpty?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface MenuItemGroupBase {
|
|
11
|
-
title?: string;
|
|
12
|
-
titleIcon?: string;
|
|
13
|
-
bottomDivider?: boolean;
|
|
14
|
-
showTitle?: boolean;
|
|
15
|
-
titleNavigation?: MenuTitleNavigation;
|
|
16
|
-
itemGroupClick?: () => void;
|
|
17
|
-
itemGroupIcon?: string;
|
|
18
|
-
/** Set to true if item group is active */
|
|
19
|
-
isItemGroupActive?: () => boolean;
|
|
20
|
-
/** Set to true if icon is registered as svg through icon service */
|
|
21
|
-
isCustomItemGroupIcon?: boolean;
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IsActiveMatchOptions } from "@angular/router";
|
|
2
|
-
import { MenuItemGroup } from "./menu-item-group.model";
|
|
3
|
-
import { StrapiDataLocation } from "../components/nav-base/models";
|
|
4
|
-
export interface MenuSharedConfig {
|
|
5
|
-
/** base url for menu items with relative url */
|
|
6
|
-
baseUrl?: string;
|
|
7
|
-
/** Custom app ID so that menu knows which element is active, if no router link is active */
|
|
8
|
-
customId?: string;
|
|
9
|
-
/** For selecting active element, active match options might dpend from project specifics */
|
|
10
|
-
activeMatchOptions?: IsActiveMatchOptions;
|
|
11
|
-
/** Disabling strapi for all menus. */
|
|
12
|
-
disableStrapi?: boolean;
|
|
13
|
-
/** Menu item groups coming from app. */
|
|
14
|
-
itemGroups?: MenuItemGroup[];
|
|
15
|
-
/** Strapi group base */
|
|
16
|
-
strapiGroupBase?: MenuItemGroup[];
|
|
17
|
-
/** Hides element if customId is the same as element customID */
|
|
18
|
-
hideSelectedCustomId?: boolean;
|
|
19
|
-
/** Where strapi data should be placed */
|
|
20
|
-
strapiDataLocation?: StrapiDataLocation;
|
|
21
|
-
}
|
package/lib/services/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Router } from '@angular/router';
|
|
2
|
-
import { StarpiMenuService } from './strapi.service';
|
|
3
|
-
import { ActiveMenuItems } from '../models/active-menu-items.model';
|
|
4
|
-
import { CustomMenuItem } from '../models/custom-menu-item.model';
|
|
5
|
-
import { MenuSharedConfig } from '../models/menu-shared-config.model';
|
|
6
|
-
import { MenuItemGroup } from '../models/menu-item-group.model';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class MenuItemsService {
|
|
9
|
-
private readonly router;
|
|
10
|
-
protected readonly config: MenuSharedConfig;
|
|
11
|
-
private readonly strapiService;
|
|
12
|
-
private readonly _activeElements;
|
|
13
|
-
get activeElements(): import("rxjs").Observable<ActiveMenuItems>;
|
|
14
|
-
private strapiItems;
|
|
15
|
-
private _strapiGroup;
|
|
16
|
-
private _allRootItems;
|
|
17
|
-
get allRootItems(): CustomMenuItem[];
|
|
18
|
-
get strapiGroup(): MenuItemGroup;
|
|
19
|
-
private readonly isActiveMatchOptions;
|
|
20
|
-
menuSharedConfig: MenuSharedConfig;
|
|
21
|
-
private get customId();
|
|
22
|
-
private get hideSelectedCustomId();
|
|
23
|
-
private get strapiGroupBase();
|
|
24
|
-
private get strapiDataLocation();
|
|
25
|
-
private _mergedGroups;
|
|
26
|
-
get mergedGroups(): MenuItemGroup[];
|
|
27
|
-
private get menuItemGroups();
|
|
28
|
-
constructor(router: Router, config: MenuSharedConfig, strapiService: StarpiMenuService);
|
|
29
|
-
setMenuItems(config: MenuSharedConfig): void;
|
|
30
|
-
private subscribeToRouteChanges;
|
|
31
|
-
private updateActive;
|
|
32
|
-
/** Finds active element from whole list. RouterLink has priority over custom Id. */
|
|
33
|
-
private findActiveElement;
|
|
34
|
-
private initData;
|
|
35
|
-
private loadData;
|
|
36
|
-
private isElementCustomIdActive;
|
|
37
|
-
private isElementRouterLinkActive;
|
|
38
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemsService, [null, { optional: true; }, null]>;
|
|
39
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MenuItemsService>;
|
|
40
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IconService } from "@tilde-nlp/ngx-common";
|
|
2
|
-
import { StrapiApiConfig, StrapiSubscriptionService } from "@tilde-nlp/ngx-strapi";
|
|
3
|
-
import { Observable } from "rxjs";
|
|
4
|
-
import { CustomMenuItem } from "../models/custom-menu-item.model";
|
|
5
|
-
import { MenuSharedConfig } from "../models/menu-shared-config.model";
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class StarpiMenuService {
|
|
8
|
-
private readonly strapiSubscription;
|
|
9
|
-
private readonly menuConfig;
|
|
10
|
-
private readonly iconService;
|
|
11
|
-
readonly svgIconNamePrefix = "strapi-menu-icon-";
|
|
12
|
-
imgBaseUrl: string;
|
|
13
|
-
constructor(strapiSubscription: StrapiSubscriptionService, menuConfig: MenuSharedConfig, strapiConfig: StrapiApiConfig, iconService: IconService);
|
|
14
|
-
getMenuItems(): Observable<CustomMenuItem[]>;
|
|
15
|
-
unsubscribe(): void;
|
|
16
|
-
private addBaseUrlIfNecessary;
|
|
17
|
-
private convertToCustomMenuItem;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StarpiMenuService, [null, { optional: true; }, { optional: true; }, null]>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<StarpiMenuService>;
|
|
20
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './lib/components/side-nav-menu';
|
|
2
|
-
export * from './lib/injection-tokens';
|
|
3
|
-
export * from './lib/models';
|
|
4
|
-
export * from './lib/menu.module';
|
|
5
|
-
export * from './lib/components/side-nav-menu/side-nav-menu.component';
|
|
6
|
-
export * from './lib/components/menu-columns/menu-columns.component';
|
|
7
|
-
export * from './lib/components/nav-base/nav-base.component';
|
|
8
|
-
export * from './lib/components/nav-base/models';
|
|
9
|
-
export * from "./lib/services";
|
|
10
|
-
export * from "./lib/constants";
|