@rxap/layout 12.2.0 → 12.2.3
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/bundles/rxap-layout.umd.js +33 -8
- package/bundles/rxap-layout.umd.js.map +1 -1
- package/esm2015/lib/navigation/navigation-item.js.map +1 -1
- package/esm2015/lib/navigation/navigation.component.module.js +9 -6
- package/esm2015/lib/navigation/navigation.component.module.js.map +1 -1
- package/esm2015/lib/navigation/navigation.service.js +10 -6
- package/esm2015/lib/navigation/navigation.service.js.map +1 -1
- package/esm2015/lib/navigation/replace-router-paths.pipe.js +14 -1
- package/esm2015/lib/navigation/replace-router-paths.pipe.js.map +1 -1
- package/fesm2015/rxap-layout.js +29 -9
- package/fesm2015/rxap-layout.js.map +1 -1
- package/lib/navigation/navigation-item.d.ts +2 -2
- package/lib/navigation/navigation.component.module.d.ts +13 -13
- package/lib/navigation/replace-router-paths.pipe.d.ts +5 -0
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-item.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-item.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation-item.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,uBAAuB,CACrC,IAAS;IAET,OAAO,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;AAChE,CAAC;AAMD,MAAM,UAAU,sBAAsB,CACpC,IAAS;IAET,OAAO,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAoBD,MAAM,UAAU,gBAAgB,CAAC,IAAS;IACxC,OAAO,CACL,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["import { IconConfig } from '@rxap/utilities';\nimport {\n InjectionToken,\n Type,\n AbstractType\n} from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport type Navigation = Array<NavigationItem | NavigationDividerItem>;\n\nexport type NavigationWithInserts = Array<\n | NavigationItem<NavigationWithInserts>\n | NavigationDividerItem\n | NavigationInsertItem\n>;\n\nexport interface NavigationDividerItem {\n divider: boolean;\n title?: string;\n}\n\nexport function IsNavigationDividerItem(\n item: any\n): item is NavigationDividerItem {\n return item && item.hasOwnProperty('divider') && item.divider;\n}\n\nexport interface NavigationInsertItem {\n insert: string;\n}\n\nexport function IsNavigationInsertItem(\n item: any\n): item is NavigationInsertItem {\n return item && item.hasOwnProperty('insert');\n}\n\nexport interface NavigationStatus {\n isVisible(\n navigationItem: NavigationItem,\n ): Observable<boolean> | Promise<boolean> | boolean;\n}\n\nexport interface NavigationItem<Children = Navigation> extends Record<string, unknown> {\n routerLink: string[];\n label: string;\n children?: Children;\n icon?: IconConfig;\n status?: Array<\n | Type<NavigationStatus>\n | InjectionToken<NavigationStatus>\n | AbstractType<NavigationStatus>\n >;\n}\n\nexport function IsNavigationItem(item: any): item is NavigationItem {\n return (\n item && item.hasOwnProperty('routerLink') && item.hasOwnProperty('label')\n );\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
6
6
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
-
import {
|
|
9
|
+
import { ReplaceRouterPathsPipeModule } from './replace-router-paths.pipe';
|
|
10
10
|
import { IconDirectiveModule } from '@rxap/material-directives/icon';
|
|
11
11
|
import { ButtonComponentModule } from '@rxap/components';
|
|
12
12
|
import { MatRippleModule } from '@angular/material/core';
|
|
@@ -36,12 +36,13 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
36
36
|
MatRippleModule,
|
|
37
37
|
MatDividerModule,
|
|
38
38
|
StopPropagationDirectiveModule,
|
|
39
|
-
MatTooltipModule
|
|
39
|
+
MatTooltipModule,
|
|
40
|
+
ReplaceRouterPathsPipeModule
|
|
40
41
|
]] });
|
|
41
42
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NavigationComponentModule, [{
|
|
42
43
|
type: NgModule,
|
|
43
44
|
args: [{
|
|
44
|
-
declarations: [NavigationComponent, NavigationItemComponent
|
|
45
|
+
declarations: [NavigationComponent, NavigationItemComponent],
|
|
45
46
|
imports: [
|
|
46
47
|
MatIconModule,
|
|
47
48
|
MatButtonModule,
|
|
@@ -53,12 +54,13 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
53
54
|
MatRippleModule,
|
|
54
55
|
MatDividerModule,
|
|
55
56
|
StopPropagationDirectiveModule,
|
|
56
|
-
MatTooltipModule
|
|
57
|
+
MatTooltipModule,
|
|
58
|
+
ReplaceRouterPathsPipeModule
|
|
57
59
|
],
|
|
58
60
|
exports: [NavigationComponent]
|
|
59
61
|
}]
|
|
60
62
|
}], null, null); })();
|
|
61
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NavigationComponentModule, { declarations: [NavigationComponent, NavigationItemComponent
|
|
63
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NavigationComponentModule, { declarations: [NavigationComponent, NavigationItemComponent], imports: [MatIconModule,
|
|
62
64
|
MatButtonModule,
|
|
63
65
|
FlexLayoutModule,
|
|
64
66
|
RouterModule,
|
|
@@ -68,6 +70,7 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
68
70
|
MatRippleModule,
|
|
69
71
|
MatDividerModule,
|
|
70
72
|
StopPropagationDirectiveModule,
|
|
71
|
-
MatTooltipModule
|
|
73
|
+
MatTooltipModule,
|
|
74
|
+
ReplaceRouterPathsPipeModule], exports: [NavigationComponent] }); })();
|
|
72
75
|
i0.ɵɵsetComponentScope(NavigationItemComponent, [i1.RouterLinkWithHref, i1.RouterLinkActive, i2.MatRipple, i3.MatTooltip, i4.NgIf, i5.MatIcon, i6.IconDirective, NavigationComponent, i7.DefaultFlexDirective, i4.NgForOf], [i4.AsyncPipe]);
|
|
73
76
|
//# sourceMappingURL=navigation.component.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.component.module.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation.component.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"navigation.component.module.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation.component.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAA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,YAAY;QACZ,mBAAmB;QACnB,qBAAqB;QACrB,eAAe;QACf,gBAAgB;QAChB,8BAA8B;QAC9B,gBAAgB;QAChB,4BAA4B,aAEd,mBAAmB;uBAfE,uBAAuB,mHAA5C,mBAAmB","sourcesContent":["import { NgModule } from '@angular/core';\nimport { NavigationComponent } from './navigation.component';\nimport { NavigationItemComponent } from './navigation-item/navigation-item.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { RouterModule } from '@angular/router';\nimport { CommonModule } from '@angular/common';\nimport { ReplaceRouterPathsPipeModule } from './replace-router-paths.pipe';\nimport { IconDirectiveModule } from '@rxap/material-directives/icon';\nimport { ButtonComponentModule } from '@rxap/components';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { StopPropagationDirectiveModule } from '@rxap/directives';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n\n@NgModule({\n declarations: [ NavigationComponent, NavigationItemComponent ],\n imports: [\n MatIconModule,\n MatButtonModule,\n FlexLayoutModule,\n RouterModule,\n CommonModule,\n IconDirectiveModule,\n ButtonComponentModule,\n MatRippleModule,\n MatDividerModule,\n StopPropagationDirectiveModule,\n MatTooltipModule,\n ReplaceRouterPathsPipeModule\n ],\n exports: [ NavigationComponent ]\n})\nexport class NavigationComponentModule {}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Injectable, Inject, Optional, INJECTOR } from '@angular/core';
|
|
2
2
|
import { ReplaySubject, of, combineLatest, from } from 'rxjs';
|
|
3
|
-
import { IsNavigationInsertItem, IsNavigationItem, IsNavigationDividerItem
|
|
4
|
-
import { RXAP_NAVIGATION_CONFIG, RXAP_NAVIGATION_CONFIG_INSERTS
|
|
5
|
-
import { switchMap, map } from 'rxjs/operators';
|
|
3
|
+
import { IsNavigationInsertItem, IsNavigationItem, IsNavigationDividerItem } from './navigation-item';
|
|
4
|
+
import { RXAP_NAVIGATION_CONFIG, RXAP_NAVIGATION_CONFIG_INSERTS } from '../tokens';
|
|
5
|
+
import { switchMap, map, catchError } from 'rxjs/operators';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export class NavigationService {
|
|
8
8
|
constructor(navigation, injector, inserts = null) {
|
|
@@ -62,18 +62,22 @@ export class NavigationService {
|
|
|
62
62
|
const isVisibleArray$ = navigationItem.status
|
|
63
63
|
.map((statusToken) => this.injector.get(statusToken))
|
|
64
64
|
.map((status) => {
|
|
65
|
-
const isVisible = status.isVisible(navigationItem
|
|
65
|
+
const isVisible = status.isVisible(navigationItem);
|
|
66
66
|
if (typeof isVisible === 'boolean') {
|
|
67
67
|
return of(isVisible);
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
70
|
return from(isVisible);
|
|
71
71
|
}
|
|
72
|
-
})
|
|
72
|
+
}).map(isVisible$ => isVisible$.pipe(catchError(e => {
|
|
73
|
+
console.error('isVisible method failed: ' + e.message);
|
|
74
|
+
return of(false);
|
|
75
|
+
})));
|
|
73
76
|
// TODO : dont wait for all status services to complete, but cancel waiting if one returns false
|
|
74
77
|
return combineLatest(isVisibleArray$).pipe(map((isVisibleArray) => isVisibleArray.reduce((acc, isVisible) => acc && isVisible, true)), map((isVisible) => (isVisible ? navigationItem : null)), switchMap((navigationItemOrNull) => {
|
|
78
|
+
var _a;
|
|
75
79
|
if (navigationItemOrNull) {
|
|
76
|
-
if (navigationItemOrNull.children) {
|
|
80
|
+
if ((_a = navigationItemOrNull.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
77
81
|
return this.checkNavigationStatusProviders(navigationItemOrNull.children).pipe(map((children) => (Object.assign(Object.assign({}, navigationItemOrNull), { children }))));
|
|
78
82
|
}
|
|
79
83
|
return of(navigationItemOrNull);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.service.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation.service.ts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["import type { Injector } from '@angular/core';\nimport { Injectable, Inject, Optional, INJECTOR } from '@angular/core';\nimport { Observable, ReplaySubject, of, combineLatest, from } from 'rxjs';\nimport {\n Navigation,\n NavigationWithInserts,\n IsNavigationInsertItem,\n IsNavigationItem,\n IsNavigationDividerItem,\n NavigationItem,\n NavigationDividerItem,\n} from './navigation-item';\nimport {\n RXAP_NAVIGATION_CONFIG,\n RXAP_NAVIGATION_CONFIG_INSERTS,\n} from '../tokens';\nimport { switchMap, map } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class NavigationService {\n public readonly config$: Observable<Navigation>;\n\n private inserts = new Map<string, NavigationWithInserts>();\n\n private readonly navigation: NavigationWithInserts;\n\n private readonly navigation$ = new ReplaySubject<Navigation>(1);\n\n constructor(\n @Inject(RXAP_NAVIGATION_CONFIG)\n navigation: any,\n @Inject(INJECTOR)\n private readonly injector: Injector,\n @Optional()\n @Inject(RXAP_NAVIGATION_CONFIG_INSERTS)\n inserts: any | null = null\n ) {\n if (typeof navigation === 'function') {\n this.navigation = navigation();\n } else {\n this.navigation = navigation;\n }\n if (inserts) {\n Object.entries(inserts).forEach(([id, insert]: [string, any]) =>\n this.insert(id, insert, false)\n );\n }\n this.updateNavigation();\n this.config$ = this.navigation$.pipe(\n switchMap((navigationWithoutStatusCheck) =>\n this.checkNavigationStatusProviders(navigationWithoutStatusCheck)\n )\n );\n }\n\n /**\n * @deprecated use add instead\n * @param id\n * @param value\n * @param update\n */\n public insert(\n id: string,\n value: NavigationWithInserts,\n update: boolean = true\n ): void {\n this.add(id, value, update);\n }\n\n public add(\n id: string,\n value: NavigationWithInserts,\n update: boolean = true\n ): void {\n this.inserts.set(id, value);\n if (update) {\n this.updateNavigation();\n }\n }\n\n public has(id: string): boolean {\n return this.inserts.has(id);\n }\n\n public get(id: string): NavigationWithInserts | undefined {\n return this.inserts.get(id);\n }\n\n public remove(id: string, update: boolean = true): void {\n this.inserts.delete(id);\n if (update) {\n this.updateNavigation();\n }\n }\n\n public updateNavigation(): void {\n this.navigation$.next(this.replaceInserts(this.navigation));\n }\n\n /**\n * @internal\n * @param navigationItem\n */\n public checkNavigationItemStatusProviders(\n navigationItem: NavigationItem | NavigationDividerItem\n ): Observable<NavigationItem | NavigationDividerItem | null> {\n if (IsNavigationDividerItem(navigationItem) || !navigationItem.status) {\n return of(navigationItem);\n }\n const isVisibleArray$: Array<Observable<boolean>> = navigationItem.status\n .map((statusToken) => this.injector.get(statusToken))\n .map((status) => {\n const isVisible = status.isVisible(navigationItem.routerLink);\n if (typeof isVisible === 'boolean') {\n return of(isVisible);\n } else {\n return from(isVisible);\n }\n });\n // TODO : dont wait for all status services to complete, but cancel waiting if one returns false\n return combineLatest(isVisibleArray$).pipe(\n map((isVisibleArray) =>\n isVisibleArray.reduce((acc, isVisible) => acc && isVisible, true)\n ),\n map((isVisible) => (isVisible ? navigationItem : null)),\n switchMap((navigationItemOrNull) => {\n if (navigationItemOrNull) {\n if (navigationItemOrNull.children) {\n return this.checkNavigationStatusProviders(\n navigationItemOrNull.children\n ).pipe(\n map((children) => ({\n ...navigationItemOrNull,\n children,\n }))\n );\n }\n return of(navigationItemOrNull);\n }\n return of(null);\n })\n );\n }\n\n /**\n * @internal\n * @param navigationItem\n */\n public checkNavigationStatusProviders(\n navigation: Navigation\n ): Observable<Navigation> {\n return combineLatest(\n navigation.map((navigationItem) =>\n this.checkNavigationItemStatusProviders(navigationItem)\n )\n ).pipe(\n map((navigationWithNullItems) => {\n const cleanNavigation: Navigation = [];\n\n for (const navigationItem of navigationWithNullItems) {\n if (navigationItem !== null) {\n cleanNavigation.push(navigationItem);\n }\n }\n\n return cleanNavigation;\n })\n );\n }\n\n private replaceInserts(\n navigationWithInserts: NavigationWithInserts\n ): Navigation {\n const navigation: Navigation = [];\n\n for (const navigationItem of navigationWithInserts) {\n if (IsNavigationInsertItem(navigationItem)) {\n if (this.inserts.has(navigationItem.insert)) {\n navigation.push(\n ...this.replaceInserts(this.inserts.get(navigationItem.insert)!)\n );\n }\n } else if (IsNavigationItem(navigationItem)) {\n navigation.push({\n ...navigationItem,\n children: this.replaceInserts(navigationItem.children ?? []),\n });\n } else if (IsNavigationDividerItem(navigationItem)) {\n navigation.push(navigationItem);\n }\n }\n\n return navigation;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"navigation.service.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/navigation.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,aAAa,EACb,EAAE,EACF,aAAa,EACb,IAAI,EACL,MAAM,MAAM,CAAC;AACd,OAAO,EAGL,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EAGxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,GAAG,EACH,UAAU,EACX,MAAM,gBAAgB,CAAC;;AAGxB,MAAM,OAAO,iBAAiB;IAS5B,YAEE,UAAe,EAEE,QAAkB,EAGnC,UAAsB,IAAI;QAHT,aAAQ,GAAR,QAAQ,CAAU;QAV7B,YAAO,GAAG,IAAI,GAAG,EAAiC,CAAC;QAI1C,gBAAW,GAAG,IAAI,aAAa,CAAa,CAAC,CAAC,CAAC;QAW9D,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;YACpC,IAAI,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC;SAChC;aAAM;YACL,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;SAC9B;QACD,IAAI,OAAO,EAAE;YACX,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAgB,EAAE,EAAE,CAC9D,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAC/B,CAAC;S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cAAc,CAAC,MAAA,cAAc,CAAC,QAAQ,mCAAI,EAAE,CAAC,IAC5D,CAAC;aACJ;iBAAM,IAAI,uBAAuB,CAAC,cAAc,CAAC,EAAE;gBAClD,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACjC;SACF;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;;kFAjLU,iBAAiB,cAUlB,sBAAsB,eAEtB,QAAQ,eAGR,8BAA8B;uEAf7B,iBAAiB,WAAjB,iBAAiB,mBADJ,MAAM;uFACnB,iBAAiB;cAD7B,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;sBAW7B,MAAM;uBAAC,sBAAsB;;sBAE7B,MAAM;uBAAC,QAAQ;;sBAEf,QAAQ;;sBACR,MAAM;uBAAC,8BAA8B","sourcesContent":["import type { Injector } from '@angular/core';\nimport {\n Injectable,\n Inject,\n Optional,\n INJECTOR\n} from '@angular/core';\nimport {\n Observable,\n ReplaySubject,\n of,\n combineLatest,\n from\n} from 'rxjs';\nimport {\n Navigation,\n NavigationWithInserts,\n IsNavigationInsertItem,\n IsNavigationItem,\n IsNavigationDividerItem,\n NavigationItem,\n NavigationDividerItem\n} from './navigation-item';\nimport {\n RXAP_NAVIGATION_CONFIG,\n RXAP_NAVIGATION_CONFIG_INSERTS\n} from '../tokens';\nimport {\n switchMap,\n map,\n catchError\n} from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class NavigationService {\n public readonly config$: Observable<Navigation>;\n\n private inserts = new Map<string, NavigationWithInserts>();\n\n private readonly navigation: NavigationWithInserts;\n\n private readonly navigation$ = new ReplaySubject<Navigation>(1);\n\n constructor(\n @Inject(RXAP_NAVIGATION_CONFIG)\n navigation: any,\n @Inject(INJECTOR)\n private readonly injector: Injector,\n @Optional()\n @Inject(RXAP_NAVIGATION_CONFIG_INSERTS)\n inserts: any | null = null\n ) {\n if (typeof navigation === 'function') {\n this.navigation = navigation();\n } else {\n this.navigation = navigation;\n }\n if (inserts) {\n Object.entries(inserts).forEach(([id, insert]: [string, any]) =>\n this.insert(id, insert, false)\n );\n }\n this.updateNavigation();\n this.config$ = this.navigation$.pipe(\n switchMap((navigationWithoutStatusCheck) =>\n this.checkNavigationStatusProviders(navigationWithoutStatusCheck)\n )\n );\n }\n\n /**\n * @deprecated use add instead\n * @param id\n * @param value\n * @param update\n */\n public insert(\n id: string,\n value: NavigationWithInserts,\n update: boolean = true\n ): void {\n this.add(id, value, update);\n }\n\n public add(\n id: string,\n value: NavigationWithInserts,\n update: boolean = true\n ): void {\n this.inserts.set(id, value);\n if (update) {\n this.updateNavigation();\n }\n }\n\n public has(id: string): boolean {\n return this.inserts.has(id);\n }\n\n public get(id: string): NavigationWithInserts | undefined {\n return this.inserts.get(id);\n }\n\n public remove(id: string, update: boolean = true): void {\n this.inserts.delete(id);\n if (update) {\n this.updateNavigation();\n }\n }\n\n public updateNavigation(): void {\n this.navigation$.next(this.replaceInserts(this.navigation));\n }\n\n /**\n * @internal\n * @param navigationItem\n */\n public checkNavigationItemStatusProviders(\n navigationItem: NavigationItem | NavigationDividerItem\n ): Observable<NavigationItem | NavigationDividerItem | null> {\n if (IsNavigationDividerItem(navigationItem) || !navigationItem.status) {\n return of(navigationItem);\n }\n const isVisibleArray$: Array<Observable<boolean>> = navigationItem.status\n .map((statusToken) => this.injector.get(statusToken))\n .map((status) => {\n const isVisible = status.isVisible(navigationItem);\n if (typeof isVisible === 'boolean') {\n return of(isVisible);\n } else {\n return from(isVisible);\n }\n }).map(isVisible$ => isVisible$.pipe(catchError(e => {\n console.error('isVisible method failed: ' + e.message);\n return of(false);\n })));\n // TODO : dont wait for all status services to complete, but cancel waiting if one returns false\n return combineLatest(isVisibleArray$).pipe(\n map((isVisibleArray) =>\n isVisibleArray.reduce((acc, isVisible) => acc && isVisible, true)\n ),\n map((isVisible) => (isVisible ? navigationItem : null)),\n switchMap((navigationItemOrNull) => {\n if (navigationItemOrNull) {\n if (navigationItemOrNull.children?.length) {\n return this.checkNavigationStatusProviders(\n navigationItemOrNull.children\n ).pipe(\n map((children) => ({\n ...navigationItemOrNull,\n children,\n }))\n );\n }\n return of(navigationItemOrNull);\n }\n return of(null);\n })\n );\n }\n\n /**\n * @internal\n * @param navigationItem\n */\n public checkNavigationStatusProviders(\n navigation: Navigation\n ): Observable<Navigation> {\n return combineLatest(\n navigation.map((navigationItem) =>\n this.checkNavigationItemStatusProviders(navigationItem)\n )\n ).pipe(\n map((navigationWithNullItems) => {\n const cleanNavigation: Navigation = [];\n\n for (const navigationItem of navigationWithNullItems) {\n if (navigationItem !== null) {\n cleanNavigation.push(navigationItem);\n }\n }\n\n return cleanNavigation;\n })\n );\n }\n\n private replaceInserts(\n navigationWithInserts: NavigationWithInserts\n ): Navigation {\n const navigation: Navigation = [];\n\n for (const navigationItem of navigationWithInserts) {\n if (IsNavigationInsertItem(navigationItem)) {\n if (this.inserts.has(navigationItem.insert)) {\n navigation.push(\n ...this.replaceInserts(this.inserts.get(navigationItem.insert)!)\n );\n }\n } else if (IsNavigationItem(navigationItem)) {\n navigation.push({\n ...navigationItem,\n children: this.replaceInserts(navigationItem.children ?? []),\n });\n } else if (IsNavigationDividerItem(navigationItem)) {\n navigation.push(navigationItem);\n }\n }\n\n return navigation;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
1
|
+
import { NgModule, Pipe } from '@angular/core';
|
|
2
2
|
import { ReplaceRouterPathsService } from './replace-router-paths.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "./replace-router-paths.service";
|
|
@@ -18,4 +18,17 @@ ReplaceRouterPathsPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "replace
|
|
|
18
18
|
name: 'replaceRouterPaths'
|
|
19
19
|
}]
|
|
20
20
|
}], function () { return [{ type: i1.ReplaceRouterPathsService }]; }, null); })();
|
|
21
|
+
export class ReplaceRouterPathsPipeModule {
|
|
22
|
+
}
|
|
23
|
+
ReplaceRouterPathsPipeModule.ɵfac = function ReplaceRouterPathsPipeModule_Factory(t) { return new (t || ReplaceRouterPathsPipeModule)(); };
|
|
24
|
+
ReplaceRouterPathsPipeModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ReplaceRouterPathsPipeModule });
|
|
25
|
+
ReplaceRouterPathsPipeModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
26
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReplaceRouterPathsPipeModule, [{
|
|
27
|
+
type: NgModule,
|
|
28
|
+
args: [{
|
|
29
|
+
declarations: [ReplaceRouterPathsPipe],
|
|
30
|
+
exports: [ReplaceRouterPathsPipe]
|
|
31
|
+
}]
|
|
32
|
+
}], null, null); })();
|
|
33
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ReplaceRouterPathsPipeModule, { declarations: [ReplaceRouterPathsPipe], exports: [ReplaceRouterPathsPipe] }); })();
|
|
21
34
|
//# sourceMappingURL=replace-router-paths.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-router-paths.pipe.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/replace-router-paths.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;;;AAK3E,MAAM,OAAO,sBAAsB;IACjC,YACS,GAA8B;QAA9B,QAAG,GAAH,GAAG,CAA2B;IACpC,CAAC;IAEJ,SAAS,CAAC,UAAoB;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;;4FAPU,sBAAsB;iGAAtB,sBAAsB;uFAAtB,sBAAsB;cAHlC,IAAI;eAAC;gBACJ,IAAI,EAAE,oBAAoB;aAC3B","sourcesContent":["import {\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ReplaceRouterPathsService } from './replace-router-paths.service';\n\n@Pipe({\n name: 'replaceRouterPaths'\n})\nexport class ReplaceRouterPathsPipe implements PipeTransform {\n constructor(\n public rrp: ReplaceRouterPathsService\n ) {}\n\n transform(routerLink: string[]): Observable<string[]> {\n return this.rrp.transform(routerLink);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"replace-router-paths.pipe.js","sourceRoot":"","sources":["../../../../../../libs/layout/src/lib/navigation/replace-router-paths.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,IAAI,EAEL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;;;AAK3E,MAAM,OAAO,sBAAsB;IACjC,YACS,GAA8B;QAA9B,QAAG,GAAH,GAAG,CAA2B;IACpC,CAAC;IAEJ,SAAS,CAAC,UAAoB;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;;4FAPU,sBAAsB;iGAAtB,sBAAsB;uFAAtB,sBAAsB;cAHlC,IAAI;eAAC;gBACJ,IAAI,EAAE,oBAAoB;aAC3B;;AAeD,MAAM,OAAO,4BAA4B;;wGAA5B,4BAA4B;8EAA5B,4BAA4B;;uFAA5B,4BAA4B;cAJxC,QAAQ;eAAC;gBACR,YAAY,EAAE,CAAE,sBAAsB,CAAE;gBACxC,OAAO,EAAO,CAAE,sBAAsB,CAAE;aACzC;;wFACY,4BAA4B,mBAd5B,sBAAsB,aAAtB,sBAAsB","sourcesContent":["import {\n NgModule,\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ReplaceRouterPathsService } from './replace-router-paths.service';\n\n@Pipe({\n name: 'replaceRouterPaths'\n})\nexport class ReplaceRouterPathsPipe implements PipeTransform {\n constructor(\n public rrp: ReplaceRouterPathsService\n ) {}\n\n transform(routerLink: string[]): Observable<string[]> {\n return this.rrp.transform(routerLink);\n }\n}\n\n@NgModule({\n declarations: [ ReplaceRouterPathsPipe ],\n exports: [ ReplaceRouterPathsPipe ]\n})\nexport class ReplaceRouterPathsPipeModule {}\n"]}
|
package/fesm2015/rxap-layout.js
CHANGED
|
@@ -9,7 +9,7 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
|
|
9
9
|
import * as i4 from '@angular/cdk/portal';
|
|
10
10
|
import { PortalModule, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
11
11
|
import { Subscription, BehaviorSubject, ReplaySubject, of, from, combineLatest } from 'rxjs';
|
|
12
|
-
import { filter, map, tap, switchMap, startWith, delay, skip, distinctUntilChanged } from 'rxjs/operators';
|
|
12
|
+
import { filter, map, tap, switchMap, catchError, startWith, delay, skip, distinctUntilChanged } from 'rxjs/operators';
|
|
13
13
|
import * as i3$5 from '@angular/material/sidenav';
|
|
14
14
|
import { MatSidenav, MatSidenavModule } from '@angular/material/sidenav';
|
|
15
15
|
import * as i2$2 from '@rxap/authentication';
|
|
@@ -1114,18 +1114,22 @@ class NavigationService {
|
|
|
1114
1114
|
const isVisibleArray$ = navigationItem.status
|
|
1115
1115
|
.map((statusToken) => this.injector.get(statusToken))
|
|
1116
1116
|
.map((status) => {
|
|
1117
|
-
const isVisible = status.isVisible(navigationItem
|
|
1117
|
+
const isVisible = status.isVisible(navigationItem);
|
|
1118
1118
|
if (typeof isVisible === 'boolean') {
|
|
1119
1119
|
return of(isVisible);
|
|
1120
1120
|
}
|
|
1121
1121
|
else {
|
|
1122
1122
|
return from(isVisible);
|
|
1123
1123
|
}
|
|
1124
|
-
})
|
|
1124
|
+
}).map(isVisible$ => isVisible$.pipe(catchError(e => {
|
|
1125
|
+
console.error('isVisible method failed: ' + e.message);
|
|
1126
|
+
return of(false);
|
|
1127
|
+
})));
|
|
1125
1128
|
// TODO : dont wait for all status services to complete, but cancel waiting if one returns false
|
|
1126
1129
|
return combineLatest(isVisibleArray$).pipe(map((isVisibleArray) => isVisibleArray.reduce((acc, isVisible) => acc && isVisible, true)), map((isVisible) => (isVisible ? navigationItem : null)), switchMap((navigationItemOrNull) => {
|
|
1130
|
+
var _a;
|
|
1127
1131
|
if (navigationItemOrNull) {
|
|
1128
|
-
if (navigationItemOrNull.children) {
|
|
1132
|
+
if ((_a = navigationItemOrNull.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1129
1133
|
return this.checkNavigationStatusProviders(navigationItemOrNull.children).pipe(map((children) => (Object.assign(Object.assign({}, navigationItemOrNull), { children }))));
|
|
1130
1134
|
}
|
|
1131
1135
|
return of(navigationItemOrNull);
|
|
@@ -2004,6 +2008,19 @@ ReplaceRouterPathsPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "replace
|
|
|
2004
2008
|
name: 'replaceRouterPaths'
|
|
2005
2009
|
}]
|
|
2006
2010
|
}], function () { return [{ type: ReplaceRouterPathsService }]; }, null); })();
|
|
2011
|
+
class ReplaceRouterPathsPipeModule {
|
|
2012
|
+
}
|
|
2013
|
+
ReplaceRouterPathsPipeModule.ɵfac = function ReplaceRouterPathsPipeModule_Factory(t) { return new (t || ReplaceRouterPathsPipeModule)(); };
|
|
2014
|
+
ReplaceRouterPathsPipeModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ReplaceRouterPathsPipeModule });
|
|
2015
|
+
ReplaceRouterPathsPipeModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
2016
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReplaceRouterPathsPipeModule, [{
|
|
2017
|
+
type: NgModule,
|
|
2018
|
+
args: [{
|
|
2019
|
+
declarations: [ReplaceRouterPathsPipe],
|
|
2020
|
+
exports: [ReplaceRouterPathsPipe]
|
|
2021
|
+
}]
|
|
2022
|
+
}], null, null); })();
|
|
2023
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ReplaceRouterPathsPipeModule, { declarations: [ReplaceRouterPathsPipe], exports: [ReplaceRouterPathsPipe] }); })();
|
|
2007
2024
|
|
|
2008
2025
|
class NavigationComponentModule {
|
|
2009
2026
|
}
|
|
@@ -2020,12 +2037,13 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
2020
2037
|
MatRippleModule,
|
|
2021
2038
|
MatDividerModule,
|
|
2022
2039
|
StopPropagationDirectiveModule,
|
|
2023
|
-
MatTooltipModule
|
|
2040
|
+
MatTooltipModule,
|
|
2041
|
+
ReplaceRouterPathsPipeModule
|
|
2024
2042
|
]] });
|
|
2025
2043
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NavigationComponentModule, [{
|
|
2026
2044
|
type: NgModule,
|
|
2027
2045
|
args: [{
|
|
2028
|
-
declarations: [NavigationComponent, NavigationItemComponent
|
|
2046
|
+
declarations: [NavigationComponent, NavigationItemComponent],
|
|
2029
2047
|
imports: [
|
|
2030
2048
|
MatIconModule,
|
|
2031
2049
|
MatButtonModule,
|
|
@@ -2037,12 +2055,13 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
2037
2055
|
MatRippleModule,
|
|
2038
2056
|
MatDividerModule,
|
|
2039
2057
|
StopPropagationDirectiveModule,
|
|
2040
|
-
MatTooltipModule
|
|
2058
|
+
MatTooltipModule,
|
|
2059
|
+
ReplaceRouterPathsPipeModule
|
|
2041
2060
|
],
|
|
2042
2061
|
exports: [NavigationComponent]
|
|
2043
2062
|
}]
|
|
2044
2063
|
}], null, null); })();
|
|
2045
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NavigationComponentModule, { declarations: [NavigationComponent, NavigationItemComponent
|
|
2064
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(NavigationComponentModule, { declarations: [NavigationComponent, NavigationItemComponent], imports: [MatIconModule,
|
|
2046
2065
|
MatButtonModule,
|
|
2047
2066
|
FlexLayoutModule,
|
|
2048
2067
|
RouterModule,
|
|
@@ -2052,7 +2071,8 @@ NavigationComponentModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports:
|
|
|
2052
2071
|
MatRippleModule,
|
|
2053
2072
|
MatDividerModule,
|
|
2054
2073
|
StopPropagationDirectiveModule,
|
|
2055
|
-
MatTooltipModule
|
|
2074
|
+
MatTooltipModule,
|
|
2075
|
+
ReplaceRouterPathsPipeModule], exports: [NavigationComponent] }); })();
|
|
2056
2076
|
i0.ɵɵsetComponentScope(NavigationItemComponent, [i1$4.RouterLinkWithHref, i1$4.RouterLinkActive, i6.MatRipple, i3$6.MatTooltip, i2.NgIf, i3$3.MatIcon, i6$1.IconDirective, NavigationComponent, i1$3.DefaultFlexDirective, i2.NgForOf], [i2.AsyncPipe]);
|
|
2057
2077
|
|
|
2058
2078
|
class SidenavModule {
|