@volo/ngx-lepton-x.core 2.0.0-rc.5 → 2.0.1
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/esm2020/lib/components/avatar/avatar.component.mjs +3 -3
- package/esm2020/lib/components/avatar/avatar.module.mjs +4 -4
- package/esm2020/lib/components/brand-logo/brand-logo.component.mjs +3 -3
- package/esm2020/lib/components/brand-logo/brand-logo.module.mjs +4 -4
- package/esm2020/lib/components/breadcrumb/breadcrumb-route-listener.service.mjs +3 -3
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +3 -3
- package/esm2020/lib/components/breadcrumb/breadcrumb.module.mjs +4 -4
- package/esm2020/lib/components/breadcrumb/breadcrumb.service.mjs +3 -3
- package/esm2020/lib/components/footer/footer-links.service.mjs +3 -3
- package/esm2020/lib/components/footer/footer.component.mjs +3 -3
- package/esm2020/lib/components/footer/footer.module.mjs +4 -4
- package/esm2020/lib/components/icon/icon.component.mjs +3 -3
- package/esm2020/lib/components/icon/icon.module.mjs +4 -4
- package/esm2020/lib/components/navbar/models.mjs +1 -1
- package/esm2020/lib/components/navbar/navbar-routes/navbar-routes.component.mjs +24 -14
- package/esm2020/lib/components/navbar/navbar-routes/navbar-routes.directive.mjs +3 -3
- package/esm2020/lib/components/navbar/navbar.component.mjs +9 -5
- package/esm2020/lib/components/navbar/navbar.module.mjs +10 -7
- package/esm2020/lib/components/navbar/navbar.service.mjs +44 -26
- package/esm2020/lib/components/navbar/sub-navbar/sub-navbar.component.mjs +7 -6
- package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2020/lib/directives/click-outside/click-outside.module.mjs +4 -4
- package/esm2020/lib/directives/index.mjs +2 -1
- package/esm2020/lib/directives/responsive/responsive.directive.mjs +3 -3
- package/esm2020/lib/directives/responsive/responsive.module.mjs +4 -4
- package/esm2020/lib/directives/responsive/responsive.service.mjs +3 -3
- package/esm2020/lib/directives/visible.directive.mjs +64 -0
- package/esm2020/lib/lepton-x-core.module.mjs +7 -6
- package/esm2020/lib/panels/breadcrumb-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/current-user-image-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/current-user-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/footer-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/language-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/logo-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/mobile-navbar-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/navbar-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/navitem-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/panels.module.mjs +4 -4
- package/esm2020/lib/panels/settings-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/toolbar-panel.directive.mjs +3 -3
- package/esm2020/lib/panels/top-navbar-panel.directive.mjs +3 -3
- package/esm2020/lib/pipes/to-observable/to-observable.module.mjs +4 -4
- package/esm2020/lib/pipes/to-observable/to-observable.pipe.mjs +3 -3
- package/esm2020/lib/pipes/translate/translate.module.mjs +4 -4
- package/esm2020/lib/pipes/translate/translate.pipe.mjs +3 -3
- package/esm2020/lib/services/auth/default-auth.service.mjs +3 -3
- package/esm2020/lib/services/body/body.service.mjs +3 -3
- package/esm2020/lib/services/language/language.module.mjs +4 -4
- package/esm2020/lib/services/language/language.service.mjs +3 -3
- package/esm2020/lib/services/language/models.mjs +1 -1
- package/esm2020/lib/services/layout/layout.service.mjs +3 -3
- package/esm2020/lib/services/translate/default-translate.service.mjs +3 -3
- package/esm2020/lib/services/translate/translate.service.mjs +3 -3
- package/esm2020/lib/services/user-profile/user-profile.service.mjs +3 -3
- package/esm2020/lib/style/style.service.mjs +3 -3
- package/fesm2015/volo-ngx-lepton-x.core.mjs +296 -212
- package/fesm2015/volo-ngx-lepton-x.core.mjs.map +1 -1
- package/fesm2020/volo-ngx-lepton-x.core.mjs +307 -214
- package/fesm2020/volo-ngx-lepton-x.core.mjs.map +1 -1
- package/lib/components/navbar/models.d.ts +4 -2
- package/lib/components/navbar/navbar-routes/navbar-routes.component.d.ts +5 -1
- package/lib/components/navbar/navbar.component.d.ts +3 -1
- package/lib/components/navbar/navbar.module.d.ts +2 -1
- package/lib/components/navbar/navbar.service.d.ts +7 -1
- package/lib/directives/index.d.ts +1 -0
- package/lib/directives/visible.directive.d.ts +18 -0
- package/lib/lepton-x-core.module.d.ts +2 -1
- package/lib/services/language/models.d.ts +1 -0
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { TemplateRef, Type } from '@angular/core';
|
|
2
|
+
import { TemplateRef, Type, Injector } from '@angular/core';
|
|
3
3
|
export interface LpxNavbarItem {
|
|
4
|
-
action?:
|
|
4
|
+
action?: NavBarPropPredicate<LpxNavbarItem>;
|
|
5
5
|
children?: LpxNavbarItem[];
|
|
6
6
|
containerLink?: string;
|
|
7
7
|
component?: Type<any>;
|
|
@@ -14,4 +14,6 @@ export interface LpxNavbarItem {
|
|
|
14
14
|
showOnMobileNavbar?: boolean;
|
|
15
15
|
template?: TemplateRef<any>;
|
|
16
16
|
text?: string;
|
|
17
|
+
visible?: NavBarPropPredicate<LpxNavbarItem>;
|
|
17
18
|
}
|
|
19
|
+
export declare type NavBarPropPredicate<T> = ((prop?: T, injector?: Injector) => boolean | Promise<boolean> | Observable<boolean>);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
1
|
+
import { EventEmitter, Injector } from '@angular/core';
|
|
2
2
|
import { LpxNavbarItem } from '../models';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare type NavbarItemsType = LpxNavbarItem[] | null | undefined;
|
|
5
5
|
export declare class NavbarRoutesComponent {
|
|
6
|
+
injector: Injector;
|
|
6
7
|
navbarItems: NavbarItemsType;
|
|
7
8
|
routerItem: boolean;
|
|
8
9
|
routeClick: EventEmitter<LpxNavbarItem>;
|
|
10
|
+
constructor(injector: Injector);
|
|
9
11
|
onSubnavbarExpand(menuItem: LpxNavbarItem, menuItems: NavbarItemsType): void;
|
|
10
12
|
onRouteClick(menuItem: LpxNavbarItem, menuItems: NavbarItemsType): void;
|
|
13
|
+
checkChildrenIncludesItem(item: LpxNavbarItem, menuItem: LpxNavbarItem): boolean;
|
|
14
|
+
flatChildren(menuItems: NavbarItemsType): LpxNavbarItem[];
|
|
11
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavbarRoutesComponent, never>;
|
|
12
16
|
static ɵcmp: i0.ɵɵComponentDeclaration<NavbarRoutesComponent, "lpx-navbar-routes", never, { "navbarItems": "navbarItems"; "routerItem": "routerItem"; }, { "routeClick": "routeClick"; }, never, never, false, never>;
|
|
13
17
|
}
|
|
@@ -2,17 +2,19 @@ import { Injector, TemplateRef, Type } from '@angular/core';
|
|
|
2
2
|
import { LayoutService } from '../../services/layout';
|
|
3
3
|
import { NavbarService } from './navbar.service';
|
|
4
4
|
import { NavbarRoutesDirective } from './navbar-routes/navbar-routes.directive';
|
|
5
|
+
import { LogoPanelDirective } from '../../panels/logo-panel.directive';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class NavbarComponent {
|
|
7
8
|
service: NavbarService;
|
|
8
9
|
readonly injector: Injector;
|
|
9
10
|
private layoutService;
|
|
10
11
|
routesTemplate?: TemplateRef<NavbarRoutesDirective>;
|
|
12
|
+
logoPanel?: LogoPanelDirective;
|
|
11
13
|
contentBefore: Type<any>[];
|
|
12
14
|
contentAfter: Type<any>[];
|
|
13
15
|
constructor(service: NavbarService, injector: Injector, layoutService: LayoutService);
|
|
14
16
|
toggleSidebarHover(): void;
|
|
15
17
|
private flatContents;
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavbarComponent, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NavbarComponent, "lpx-navbar", never, {}, {}, ["routesTemplate"], never, false, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavbarComponent, "lpx-navbar", never, {}, {}, ["routesTemplate", "logoPanel"], never, false, never>;
|
|
18
20
|
}
|
|
@@ -12,6 +12,7 @@ import * as i8 from "../brand-logo/brand-logo.module";
|
|
|
12
12
|
import * as i9 from "../icon/icon.module";
|
|
13
13
|
import * as i10 from "../../pipes/to-observable/to-observable.module";
|
|
14
14
|
import * as i11 from "../../pipes/translate/translate.module";
|
|
15
|
+
import * as i12 from "../../directives/visible.directive";
|
|
15
16
|
export interface LpxNavbarSettings {
|
|
16
17
|
menuItems?: LpxNavbarItem[];
|
|
17
18
|
contentAfterRoutes?: Type<any>[];
|
|
@@ -21,6 +22,6 @@ export declare class LpxNavbarModule {
|
|
|
21
22
|
static forRoot(options?: LpxNavbarSettings): ModuleWithProviders<LpxNavbarModule>;
|
|
22
23
|
static forChild(options?: Omit<LpxNavbarSettings, 'menuItems'>): ModuleWithProviders<LpxNavbarModule>;
|
|
23
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<LpxNavbarModule, never>;
|
|
24
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LpxNavbarModule, [typeof i1.NavbarComponent, typeof i2.SubNavbarComponent, typeof i3.NavbarRoutesComponent, typeof i4.NavbarRoutesDirective], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.RouterModule, typeof i8.LpxBrandLogoModule, typeof i9.LpxIconModule, typeof i10.ToObservableModule, typeof i11.LpxTranslateModule], [typeof i1.NavbarComponent, typeof i2.SubNavbarComponent, typeof i3.NavbarRoutesComponent, typeof i4.NavbarRoutesDirective]>;
|
|
25
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LpxNavbarModule, [typeof i1.NavbarComponent, typeof i2.SubNavbarComponent, typeof i3.NavbarRoutesComponent, typeof i4.NavbarRoutesDirective], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.RouterModule, typeof i8.LpxBrandLogoModule, typeof i9.LpxIconModule, typeof i10.ToObservableModule, typeof i11.LpxTranslateModule, typeof i12.LpxVisibleDirective], [typeof i1.NavbarComponent, typeof i2.SubNavbarComponent, typeof i3.NavbarRoutesComponent, typeof i4.NavbarRoutesDirective]>;
|
|
25
26
|
static ɵinj: i0.ɵɵInjectorDeclaration<LpxNavbarModule>;
|
|
26
27
|
}
|
|
@@ -16,7 +16,13 @@ export declare class NavbarService {
|
|
|
16
16
|
location: number[];
|
|
17
17
|
};
|
|
18
18
|
expandItemByLink$(): import("rxjs").Observable<import("@angular/router").Event>;
|
|
19
|
-
|
|
19
|
+
expandItems(): void;
|
|
20
|
+
getRouteItem(): {
|
|
21
|
+
item: LpxNavbarItem | undefined;
|
|
22
|
+
location: number[];
|
|
23
|
+
};
|
|
24
|
+
calculateExpandState(items: LpxNavbarItem[], indexes: Array<number>): LpxNavbarItem[];
|
|
25
|
+
collapseChildren(children: Array<LpxNavbarItem>): Array<LpxNavbarItem>;
|
|
20
26
|
private findById;
|
|
21
27
|
private findByProp;
|
|
22
28
|
private addContainerLinks;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, ViewContainerRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable, Subscription } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class LpxVisibleDirective implements OnDestroy, OnInit {
|
|
5
|
+
private viewContainerRef;
|
|
6
|
+
private templateRef;
|
|
7
|
+
conditionSubscription: Subscription | undefined;
|
|
8
|
+
isVisible: boolean | undefined;
|
|
9
|
+
set lpxVisible(value: boolean | Promise<boolean> | Observable<boolean> | undefined | null);
|
|
10
|
+
private condition$;
|
|
11
|
+
constructor(viewContainerRef: ViewContainerRef, templateRef: TemplateRef<unknown>);
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
private subscribeToCondition;
|
|
15
|
+
private updateVisibility;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LpxVisibleDirective, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LpxVisibleDirective, "[lpxVisible]", never, { "lpxVisible": "lpxVisible"; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -6,6 +6,7 @@ import { LpxNavbarSettings } from './components/navbar/navbar.module';
|
|
|
6
6
|
import { LpxTranslate } from './services';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
import * as i1 from "@angular/common";
|
|
9
|
+
import * as i2 from "./directives/visible.directive";
|
|
9
10
|
export interface LpxCoreOptions {
|
|
10
11
|
responsiveSettings?: ResponsiveBreakpoints;
|
|
11
12
|
window?: Window;
|
|
@@ -18,6 +19,6 @@ export interface LpxCoreOptions {
|
|
|
18
19
|
export declare class LpxCoreModule {
|
|
19
20
|
static forRoot(options?: LpxCoreOptions): ModuleWithProviders<LpxCoreModule>;
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<LpxCoreModule, never>;
|
|
21
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LpxCoreModule, never, [typeof i1.CommonModule], never>;
|
|
22
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LpxCoreModule, never, [typeof i1.CommonModule, typeof i2.LpxVisibleDirective], never>;
|
|
22
23
|
static ɵinj: i0.ɵɵInjectorDeclaration<LpxCoreModule>;
|
|
23
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volo/ngx-lepton-x.core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"ts-toolbelt": "^6.15.4"
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@angular/core": "15.0.
|
|
33
|
-
"@angular/common": "15.0.
|
|
34
|
-
"@angular/router": "15.0.
|
|
32
|
+
"@angular/core": "15.0.4",
|
|
33
|
+
"@angular/common": "15.0.4",
|
|
34
|
+
"@angular/router": "15.0.4",
|
|
35
35
|
"rxjs": "7.5.6",
|
|
36
|
-
"@angular/forms": "15.0.
|
|
37
|
-
"@angular/platform-browser-dynamic": "15.0.
|
|
36
|
+
"@angular/forms": "15.0.4",
|
|
37
|
+
"@angular/platform-browser-dynamic": "15.0.4"
|
|
38
38
|
}
|
|
39
39
|
}
|