@juice-js/layout 2.4.2-alpha.2 → 2.4.2-alpha.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, signal, Optional, Injectable, inject, computed, viewChild, ChangeDetectionStrategy, Component, booleanAttribute, HostListener, Input, Directive, input, ChangeDetectorRef, DestroyRef, HostBinding, effect, untracked, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, signal, Optional, Injectable, inject, computed, viewChild, ChangeDetectionStrategy, Component, booleanAttribute, HostListener, Input, Directive, input, ChangeDetectorRef, DestroyRef, HostBinding, afterNextRender, effect, untracked, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@juice-js/core';
|
|
4
4
|
import { TenantService, AsyncDialog } from '@juice-js/core';
|
|
5
5
|
import * as i2$1 from '@angular/material/dialog';
|
|
@@ -25,11 +25,11 @@ import * as i4 from '@angular/material/tooltip';
|
|
|
25
25
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
26
26
|
import * as i4$1 from '@angular/material/menu';
|
|
27
27
|
import { MatMenuModule } from '@angular/material/menu';
|
|
28
|
+
import { filter } from 'rxjs/operators';
|
|
28
29
|
import * as i7 from '@angular/material/list';
|
|
29
30
|
import { MatListModule } from '@angular/material/list';
|
|
30
31
|
import * as i3$2 from '@angular/material/expansion';
|
|
31
32
|
import { MatExpansionPanel, MatExpansionModule } from '@angular/material/expansion';
|
|
32
|
-
import { filter } from 'rxjs/operators';
|
|
33
33
|
import * as i3$3 from 'angular-oauth2-oidc';
|
|
34
34
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
35
35
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -50,6 +50,7 @@ class LayoutConfig {
|
|
|
50
50
|
this.defaultMenuOpen = false;
|
|
51
51
|
this.pageSwitcher = true;
|
|
52
52
|
this.palettes = [...LAYOUT_PALETTES];
|
|
53
|
+
this.mainLandmark = true;
|
|
53
54
|
if (options) {
|
|
54
55
|
Object.assign(this, options);
|
|
55
56
|
}
|
|
@@ -135,11 +136,26 @@ class LayoutService {
|
|
|
135
136
|
document.documentElement.removeAttribute("data-juice-palette");
|
|
136
137
|
}
|
|
137
138
|
getThemeMode() {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
const fallback = this._options.defaultThemeMode ?? ThemeMode.Auto;
|
|
140
|
+
let stored = null;
|
|
141
|
+
try {
|
|
142
|
+
stored = localStorage.getItem(LayoutService.DARK_MODE);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return fallback;
|
|
146
|
+
}
|
|
147
|
+
if (!stored)
|
|
148
|
+
return fallback;
|
|
149
|
+
const modes = Object.values(ThemeMode);
|
|
150
|
+
// A value written by something else may be the bare name (`dark`) rather than JSON (`"dark"`): never let it throw.
|
|
151
|
+
let value = stored;
|
|
152
|
+
try {
|
|
153
|
+
value = JSON.parse(stored);
|
|
141
154
|
}
|
|
142
|
-
|
|
155
|
+
catch {
|
|
156
|
+
// not JSON: try it as written
|
|
157
|
+
}
|
|
158
|
+
return typeof value === 'string' && modes.includes(value) ? value : fallback;
|
|
143
159
|
}
|
|
144
160
|
toggleDarkMode() {
|
|
145
161
|
var state = this.getThemeMode();
|
|
@@ -157,7 +173,12 @@ class LayoutService {
|
|
|
157
173
|
isMenuOpen() {
|
|
158
174
|
let isMenuOpen = localStorage.getItem(LayoutService.MENU_OPEN);
|
|
159
175
|
if (isMenuOpen) {
|
|
160
|
-
|
|
176
|
+
try {
|
|
177
|
+
return JSON.parse(isMenuOpen) === true;
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
// not JSON: the default
|
|
181
|
+
}
|
|
161
182
|
}
|
|
162
183
|
return this._options.defaultMenuOpen;
|
|
163
184
|
}
|
|
@@ -174,6 +195,10 @@ class LayoutService {
|
|
|
174
195
|
brandLogo() {
|
|
175
196
|
return this._tenant()?.logo ?? this._options.brandLogo;
|
|
176
197
|
}
|
|
198
|
+
/** Whether the shell's content area is the page's main landmark (LayoutConfig.mainLandmark, default true). */
|
|
199
|
+
mainLandmark() {
|
|
200
|
+
return this._options.mainLandmark ?? true;
|
|
201
|
+
}
|
|
177
202
|
settingUrl() {
|
|
178
203
|
return this._options.settingUrl;
|
|
179
204
|
}
|
|
@@ -623,11 +648,11 @@ class DarkModeComponent {
|
|
|
623
648
|
this.name = this.names.get(mode) ?? "";
|
|
624
649
|
}
|
|
625
650
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DarkModeComponent, deps: [{ token: LayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
626
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: DarkModeComponent, isStandalone: false, selector: "juice-dark-mode", ngImport: i0, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button
|
|
651
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: DarkModeComponent, isStandalone: false, selector: "juice-dark-mode", ngImport: i0, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"\n [attr.aria-label]=\"('Theme' | translate) + ': ' + (name | translate)\"><mat-icon aria-hidden=\"true\">{{icon}}</mat-icon></button>\n", dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
627
652
|
}
|
|
628
653
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DarkModeComponent, decorators: [{
|
|
629
654
|
type: Component,
|
|
630
|
-
args: [{ selector: 'juice-dark-mode', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button
|
|
655
|
+
args: [{ selector: 'juice-dark-mode', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"\n [attr.aria-label]=\"('Theme' | translate) + ': ' + (name | translate)\"><mat-icon aria-hidden=\"true\">{{icon}}</mat-icon></button>\n" }]
|
|
631
656
|
}], ctorParameters: () => [{ type: LayoutService }] });
|
|
632
657
|
|
|
633
658
|
/** The palette menu beside the dark mode switch: every page follows the palette picked here. Hidden with one palette. */
|
|
@@ -776,6 +801,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
776
801
|
args: ['mouseleave']
|
|
777
802
|
}] } });
|
|
778
803
|
|
|
804
|
+
/** A page and the pages under it (`/alerts` and `/alerts/42`), whatever the query string, fragment or matrix params. */
|
|
805
|
+
const SectionMatch = { paths: 'subset', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
|
|
806
|
+
/** Only the page itself, whatever the query string. */
|
|
807
|
+
const ExactMatch = { paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
|
|
808
|
+
/** A link as written that names the home page or the tenant's root: `''`, `/`, `:tenant`. */
|
|
809
|
+
function isRoot(rawLink) {
|
|
810
|
+
const path = (rawLink ?? '').replace(/[?#].*$/, '').replace(/^\/+|\/+$/g, '');
|
|
811
|
+
return path === '' || path === ':tenant';
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* How a menu link matches the URL on display: with the pages under it (`/alerts` is on display at `/alerts/42?x=1`),
|
|
815
|
+
* unless the link is the home page or the tenant's root, or other links of the menu sit under it: those would make it
|
|
816
|
+
* match every page.
|
|
817
|
+
*
|
|
818
|
+
* @param link the link, as the router gets it
|
|
819
|
+
* @param others the links of the other entries beside it
|
|
820
|
+
* @param rawLink the link as written (`:tenant` not yet replaced), when it is known
|
|
821
|
+
*/
|
|
822
|
+
function linkMatch(link, others = [], rawLink) {
|
|
823
|
+
const path = (link ?? '').replace(/[?#].*$/, '').replace(/\/+$/, '');
|
|
824
|
+
if (!path || (rawLink !== undefined && isRoot(rawLink)))
|
|
825
|
+
return ExactMatch;
|
|
826
|
+
return others.some(o => !!o && o !== link && o.replace(/[?#].*$/, '').startsWith(path + '/')) ? ExactMatch : SectionMatch;
|
|
827
|
+
}
|
|
828
|
+
/** The path of a URL, without query string, fragment or matrix params: `/tenants/x/alerts`. */
|
|
829
|
+
function pathOf(url) {
|
|
830
|
+
const segments = url.root.children['primary']?.segments ?? [];
|
|
831
|
+
return '/' + segments.map(s => s.path).join('/');
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* The path of the entry on display: of all the entries (a page and the pages under it count), the one whose path is the
|
|
835
|
+
* longest prefix of the URL. A page under another one (`/alerts/rules` beside `/alerts`) takes the mark from it; the
|
|
836
|
+
* home page and the tenant's root only match themselves. Null when no entry matches.
|
|
837
|
+
*/
|
|
838
|
+
function mostSpecificLink(router, entries) {
|
|
839
|
+
const current = pathOf(router.parseUrl(router.url));
|
|
840
|
+
let best = null;
|
|
841
|
+
for (const entry of entries) {
|
|
842
|
+
if (!entry.link)
|
|
843
|
+
continue;
|
|
844
|
+
const path = pathOf(router.parseUrl(entry.link));
|
|
845
|
+
const exactOnly = path === '/' || isRoot(entry.rawLink);
|
|
846
|
+
const matches = current === path || (!exactOnly && current.startsWith(path + '/'));
|
|
847
|
+
if (matches && (best === null || path.length > best.length))
|
|
848
|
+
best = path;
|
|
849
|
+
}
|
|
850
|
+
return best;
|
|
851
|
+
}
|
|
852
|
+
|
|
779
853
|
/**
|
|
780
854
|
* The counts on the side menu's entries, by menu id ({@link Menu.id}). The menu draws them itself: beside the label, or
|
|
781
855
|
* on the icon's corner while the menu is folded to icons. A group shows its pages' counts on its header while it is
|
|
@@ -866,9 +940,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
866
940
|
}, styles: [":host{display:inline-block;min-width:1.25rem;margin-left:.5rem;padding:0 .375rem;box-sizing:border-box;border-radius:999px;font-size:.75rem;font-weight:600;line-height:1.25rem;text-align:center;vertical-align:middle;background:var(--mat-sys-error, #b3261e);color:var(--mat-sys-on-error, #fff)}:host([hidden]){display:none}:host(.folded){position:absolute;left:30px;top:calc(50% - 18px);margin:0;transform:scale(.75);transform-origin:top left;pointer-events:none}\n"] }]
|
|
867
941
|
}], propDecorators: { badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], folded: [{ type: i0.Input, args: [{ isSignal: true, alias: "folded", required: false }] }], menuId: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuId", required: false }] }] } });
|
|
868
942
|
|
|
869
|
-
/** A page and the pages under it (`/alerts` and `/alerts/42`), whatever the query string. */
|
|
870
|
-
const Section = { paths: 'subset', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
|
|
871
|
-
const Exact = { paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
|
|
872
943
|
/**
|
|
873
944
|
* A menu item with children: a header that opens and closes them. The group opens itself whenever a navigation lands
|
|
874
945
|
* on one of its pages (also one kept out of the menu, `inMenu: false`), even if it was closed by hand. A header with a
|
|
@@ -927,10 +998,10 @@ class ExpandableMenuComponent {
|
|
|
927
998
|
const all = item?.children ?? [];
|
|
928
999
|
const links = all.map(c => c.routerLink).filter(l => !!l);
|
|
929
1000
|
this.headerLink = item?.hasOwnPage?.() ? item.routerLink : null;
|
|
930
|
-
this.headerActive = this.isActive(this.headerLink,
|
|
1001
|
+
this.headerActive = this.isActive(this.headerLink, ExactMatch);
|
|
931
1002
|
// The header's own page opens the group with the pages under it, unless it is the home page or the tenant's root.
|
|
932
1003
|
const headerSection = !!this.headerLink && !isRoot(item.rawRouterLink);
|
|
933
|
-
this.open = this.headerActive || (headerSection && this.isActive(this.headerLink,
|
|
1004
|
+
this.open = this.headerActive || (headerSection && this.isActive(this.headerLink, SectionMatch))
|
|
934
1005
|
|| all.some(c => this.isActive(c.routerLink, this.matching(c.routerLink, links)));
|
|
935
1006
|
}
|
|
936
1007
|
/** The URL's path, without query string or fragment. */
|
|
@@ -941,31 +1012,34 @@ class ExpandableMenuComponent {
|
|
|
941
1012
|
* How a child's link matches: with the pages under it, unless other pages of the group sit under it too (a link to
|
|
942
1013
|
* `/` or to the tenant's root), which would make it match every page.
|
|
943
1014
|
*/
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
if (
|
|
947
|
-
return
|
|
948
|
-
return
|
|
1015
|
+
/** Whether a page of the group is the page on display. */
|
|
1016
|
+
isChildActive(child) {
|
|
1017
|
+
if (this.activeLink === undefined)
|
|
1018
|
+
return this.isActive(child.routerLink, this.matching(child.routerLink));
|
|
1019
|
+
return this.activeLink !== null && !!child.routerLink && pathOf(this.router.parseUrl(child.routerLink)) === this.activeLink;
|
|
1020
|
+
}
|
|
1021
|
+
matching(link, links = this.childLinks) {
|
|
1022
|
+
return linkMatch(link, links);
|
|
1023
|
+
}
|
|
1024
|
+
get childLinks() {
|
|
1025
|
+
return (this._item?.children ?? []).map(c => c.routerLink).filter(l => !!l);
|
|
949
1026
|
}
|
|
950
1027
|
isActive(link, options) {
|
|
951
1028
|
return !!link && this.router.isActive(this.router.parseUrl(link), options);
|
|
952
1029
|
}
|
|
953
1030
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
954
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ExpandableMenuComponent, isStandalone: false, selector: "juice-expandable-menu", inputs: { isExpanded: "isExpanded", item: "item" }, host: { properties: { "class.menu-expanded": "isExpanded" } }, viewQueries: [{ propertyName: "panel", first: true, predicate: MatExpansionPanel, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-expansion-panel #panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <!-- Closed, the header carries its pages' counts: they are hidden with them. Open, they show beside their pages. -->\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}<juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [menuId]=\"item.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [
|
|
1031
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ExpandableMenuComponent, isStandalone: false, selector: "juice-expandable-menu", inputs: { isExpanded: "isExpanded", activeLink: "activeLink", item: "item" }, host: { properties: { "class.menu-expanded": "isExpanded" } }, viewQueries: [{ propertyName: "panel", first: true, predicate: MatExpansionPanel, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-expansion-panel #panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <!-- Closed, the header carries its pages' counts: they are hidden with them. Open, they show beside their pages. -->\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}<juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [menuId]=\"item.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [class.active]=\"isChildActive(subitem)\"\n [attr.aria-current]=\"isChildActive(subitem) ? 'page' : null\">\n <mat-icon matListItemIcon color=\"accent\">{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}<juice-menu-badge [badge]=\"badges.get(subitem.id)\" [menuId]=\"subitem.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"badges.get(subitem.id)\" [folded]=\"true\" [menuId]=\"subitem.id\"></juice-menu-badge>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel,:host ::ng-deep .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none;background:transparent;border-radius:0;color:inherit}:host ::ng-deep .mat-expansion-panel.mat-expanded,:host ::ng-deep .mat-expansion-panel-spacing{margin:0}:host ::ng-deep .mat-expansion-panel-header{padding:0;background:transparent}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}:host ::ng-deep .mat-mdc-list-item{position:relative}:host.menu-expanded ::ng-deep .mat-expansion-panel-body .mat-mdc-list-item{padding-left:32px}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3$2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "component", type: MenuBadgeComponent, selector: "juice-menu-badge", inputs: ["badge", "folded", "menuId"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
955
1032
|
}
|
|
956
1033
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, decorators: [{
|
|
957
1034
|
type: Component,
|
|
958
|
-
args: [{ selector: 'juice-expandable-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, host: { '[class.menu-expanded]': 'isExpanded' }, template: "<mat-expansion-panel #panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <!-- Closed, the header carries its pages' counts: they are hidden with them. Open, they show beside their pages. -->\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}<juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [menuId]=\"item.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [
|
|
1035
|
+
args: [{ selector: 'juice-expandable-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, host: { '[class.menu-expanded]': 'isExpanded' }, template: "<mat-expansion-panel #panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <!-- Closed, the header carries its pages' counts: they are hidden with them. Open, they show beside their pages. -->\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}<juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [menuId]=\"item.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"panel.expanded ? ownBadge() : closedBadge()\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [class.active]=\"isChildActive(subitem)\"\n [attr.aria-current]=\"isChildActive(subitem) ? 'page' : null\">\n <mat-icon matListItemIcon color=\"accent\">{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}<juice-menu-badge [badge]=\"badges.get(subitem.id)\" [menuId]=\"subitem.id\"></juice-menu-badge></span>\n } @else {\n <juice-menu-badge [badge]=\"badges.get(subitem.id)\" [folded]=\"true\" [menuId]=\"subitem.id\"></juice-menu-badge>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel,:host ::ng-deep .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none;background:transparent;border-radius:0;color:inherit}:host ::ng-deep .mat-expansion-panel.mat-expanded,:host ::ng-deep .mat-expansion-panel-spacing{margin:0}:host ::ng-deep .mat-expansion-panel-header{padding:0;background:transparent}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}:host ::ng-deep .mat-mdc-list-item{position:relative}:host.menu-expanded ::ng-deep .mat-expansion-panel-body .mat-mdc-list-item{padding-left:32px}\n"] }]
|
|
959
1036
|
}], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatExpansionPanel), { isSignal: true }] }], isExpanded: [{
|
|
960
1037
|
type: Input
|
|
1038
|
+
}], activeLink: [{
|
|
1039
|
+
type: Input
|
|
961
1040
|
}], item: [{
|
|
962
1041
|
type: Input
|
|
963
1042
|
}] } });
|
|
964
|
-
/** A link as written that names the home page or the tenant's root: `''`, `/`, `:tenant`. */
|
|
965
|
-
function isRoot(rawLink) {
|
|
966
|
-
const path = (rawLink ?? '').replace(/[?#].*$/, '').replace(/^\/+|\/+$/g, '');
|
|
967
|
-
return path === '' || path === ':tenant';
|
|
968
|
-
}
|
|
969
1043
|
|
|
970
1044
|
class NavMenuComponent {
|
|
971
1045
|
constructor(service, layout, tenantService, route, breakpointObserver, cdr, switcher) {
|
|
@@ -986,6 +1060,12 @@ class NavMenuComponent {
|
|
|
986
1060
|
this.badges = inject(MenuBadgeService);
|
|
987
1061
|
/** The items that show as a group: they have pages the side menu shows. */
|
|
988
1062
|
this.groups = new Set();
|
|
1063
|
+
this.router = inject(Router);
|
|
1064
|
+
/**
|
|
1065
|
+
* The path of the entry on display, across all the menu's entries (also the pages in groups): the most specific one,
|
|
1066
|
+
* so `/alerts/rules` is marked on `/alerts/rules` and `/alerts` is not.
|
|
1067
|
+
*/
|
|
1068
|
+
this.activeLink = null;
|
|
989
1069
|
if (route.snapshot.data['settingUrl']) {
|
|
990
1070
|
this.settingUrl = route.snapshot.data['settingUrl'];
|
|
991
1071
|
}
|
|
@@ -1013,8 +1093,32 @@ class NavMenuComponent {
|
|
|
1013
1093
|
this.menuItems = items.filter(i => i.inMenu !== false && (this.groups.has(i) || i.hasOwnPage()));
|
|
1014
1094
|
// The switcher offers the same items: one load, renewed whenever the shell (and this menu) is built again.
|
|
1015
1095
|
this.switcher.setItems(items);
|
|
1096
|
+
this.refreshActive();
|
|
1016
1097
|
this.cdr.markForCheck();
|
|
1017
1098
|
});
|
|
1099
|
+
const navigations = this.router.events.pipe(filter(e => e instanceof NavigationEnd)).subscribe(() => {
|
|
1100
|
+
this.refreshActive();
|
|
1101
|
+
this.cdr.markForCheck();
|
|
1102
|
+
});
|
|
1103
|
+
inject(DestroyRef).onDestroy(() => navigations.unsubscribe());
|
|
1104
|
+
}
|
|
1105
|
+
refreshActive() {
|
|
1106
|
+
const entries = [];
|
|
1107
|
+
for (const item of this.menuItems) {
|
|
1108
|
+
if (!this.groups.has(item))
|
|
1109
|
+
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink });
|
|
1110
|
+
else {
|
|
1111
|
+
if (item.hasOwnPage())
|
|
1112
|
+
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink });
|
|
1113
|
+
for (const child of item.menuChildren())
|
|
1114
|
+
entries.push({ link: child.routerLink, rawLink: child.rawRouterLink });
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
this.activeLink = mostSpecificLink(this.router, entries);
|
|
1118
|
+
}
|
|
1119
|
+
/** Whether the entry is the page on display (or the page the one on display is under). */
|
|
1120
|
+
isCurrent(item) {
|
|
1121
|
+
return this.activeLink !== null && !!item.routerLink && pathOf(this.router.parseUrl(item.routerLink)) === this.activeLink;
|
|
1018
1122
|
}
|
|
1019
1123
|
toggle() {
|
|
1020
1124
|
this.layout.toggleMenu();
|
|
@@ -1031,11 +1135,11 @@ class NavMenuComponent {
|
|
|
1031
1135
|
}
|
|
1032
1136
|
}
|
|
1033
1137
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1.MenuService }, { token: LayoutService }, { token: i1.TenantService }, { token: i3$1.ActivatedRoute }, { token: i4$2.BreakpointObserver }, { token: i0.ChangeDetectorRef }, { token: PageSwitcherService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1034
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NavMenuComponent, isStandalone: false, selector: "juice-nav-menu", ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [
|
|
1138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NavMenuComponent, isStandalone: false, selector: "juice-nav-menu", ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [class.active]=\"isCurrent(item)\"\n [attr.aria-current]=\"isCurrent(item) ? 'page' : null\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}@if (isExpanded) {<juice-menu-badge [badge]=\"badges.get(item.id)\" [menuId]=\"item.id\"></juice-menu-badge>}</span>\n @if (!isExpanded) {\n <juice-menu-badge [badge]=\"badges.get(item.id)\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n } @else {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\" [activeLink]=\"activeLink\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\" [attr.aria-label]=\"'Settings' | translate\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\" [attr.aria-label]=\"(layout.isMenuOpen() ? 'Collapse menu' : 'Expand menu') | translate\"\n [attr.aria-expanded]=\"layout.isMenuOpen()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mat-mdc-list-item{position:relative}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ExpandableMenuComponent, selector: "juice-expandable-menu", inputs: ["isExpanded", "activeLink", "item"] }, { kind: "component", type: MenuBadgeComponent, selector: "juice-menu-badge", inputs: ["badge", "folded", "menuId"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
1035
1139
|
}
|
|
1036
1140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, decorators: [{
|
|
1037
1141
|
type: Component,
|
|
1038
|
-
args: [{ selector: 'juice-nav-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [
|
|
1142
|
+
args: [{ selector: 'juice-nav-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [class.active]=\"isCurrent(item)\"\n [attr.aria-current]=\"isCurrent(item) ? 'page' : null\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}@if (isExpanded) {<juice-menu-badge [badge]=\"badges.get(item.id)\" [menuId]=\"item.id\"></juice-menu-badge>}</span>\n @if (!isExpanded) {\n <juice-menu-badge [badge]=\"badges.get(item.id)\" [folded]=\"true\" [menuId]=\"item.id\"></juice-menu-badge>\n }\n </mat-list-item>\n } @else {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\" [activeLink]=\"activeLink\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\" [attr.aria-label]=\"'Settings' | translate\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\" [attr.aria-label]=\"(layout.isMenuOpen() ? 'Collapse menu' : 'Expand menu') | translate\"\n [attr.aria-expanded]=\"layout.isMenuOpen()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mat-mdc-list-item{position:relative}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"] }]
|
|
1039
1143
|
}], ctorParameters: () => [{ type: i1.MenuService }, { type: LayoutService }, { type: i1.TenantService }, { type: i3$1.ActivatedRoute }, { type: i4$2.BreakpointObserver }, { type: i0.ChangeDetectorRef }, { type: PageSwitcherService }] });
|
|
1040
1144
|
|
|
1041
1145
|
/**
|
|
@@ -1234,6 +1338,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1234
1338
|
args: ['class.anonymous']
|
|
1235
1339
|
}] } });
|
|
1236
1340
|
|
|
1341
|
+
/** How long after the first render the shell stays without animations: the menu and the first page arrive in it. */
|
|
1342
|
+
const SettleMs = 600;
|
|
1237
1343
|
class PageComponent {
|
|
1238
1344
|
constructor(service, search,
|
|
1239
1345
|
/** The page switcher: its keys are live while the shell is, and the shell shows it (see the constructor). */
|
|
@@ -1246,6 +1352,11 @@ class PageComponent {
|
|
|
1246
1352
|
this.toolbarItems = inject(LAYOUT_TOOLBAR_ITEMS, { optional: true }) ?? [];
|
|
1247
1353
|
this.isMobile = false;
|
|
1248
1354
|
this.isSnavOpenned = false;
|
|
1355
|
+
/**
|
|
1356
|
+
* True while the shell is first drawn: the sidenav's width, its mode and the menu's open groups settle with no
|
|
1357
|
+
* animation (an animated settle on load shifts the page under the reader).
|
|
1358
|
+
*/
|
|
1359
|
+
this.settling = true;
|
|
1249
1360
|
breakpointObserver.observe([
|
|
1250
1361
|
Breakpoints.HandsetLandscape,
|
|
1251
1362
|
Breakpoints.HandsetPortrait
|
|
@@ -1255,6 +1366,21 @@ class PageComponent {
|
|
|
1255
1366
|
cdr.markForCheck();
|
|
1256
1367
|
});
|
|
1257
1368
|
this.hostPageSwitcher();
|
|
1369
|
+
let settleTimer;
|
|
1370
|
+
afterNextRender(() => {
|
|
1371
|
+
settleTimer = setTimeout(() => {
|
|
1372
|
+
this.settling = false;
|
|
1373
|
+
cdr.markForCheck();
|
|
1374
|
+
}, SettleMs);
|
|
1375
|
+
});
|
|
1376
|
+
inject(DestroyRef).onDestroy(() => clearTimeout(settleTimer));
|
|
1377
|
+
}
|
|
1378
|
+
/** The skip link: moves the focus to the page, without touching the URL (the router owns it). */
|
|
1379
|
+
skipToContent(event) {
|
|
1380
|
+
event.preventDefault();
|
|
1381
|
+
const main = document.getElementById('main-content');
|
|
1382
|
+
main?.focus();
|
|
1383
|
+
main?.scrollIntoView?.();
|
|
1258
1384
|
}
|
|
1259
1385
|
/**
|
|
1260
1386
|
* Shows the page switcher in a dialog while it is open (the dialog brings the focus trap, Escape, the backdrop and
|
|
@@ -1327,7 +1453,7 @@ class PageComponent {
|
|
|
1327
1453
|
this.search.unbindPage();
|
|
1328
1454
|
}
|
|
1329
1455
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageComponent, deps: [{ token: LayoutService }, { token: SearchService }, { token: PageSwitcherService }, { token: i4$2.BreakpointObserver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1330
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageComponent, isStandalone: false, selector: "app-page", ngImport: i0, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"
|
|
1456
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageComponent, isStandalone: false, selector: "app-page", ngImport: i0, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\" [class.settling]=\"settling\">\n <a class=\"skip-link\" href=\"#main-content\" (click)=\"skipToContent($event)\">{{ 'Skip to content' | translate }}</a>\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\" [attr.aria-label]=\"'Menu' | translate\"\n [attr.aria-expanded]=\"isSnavOpenned\">\n <mat-icon aria-hidden=\"true\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\" [attr.aria-label]=\"service.brandName() || ('Home' | translate)\">\n <img height=\"40\" alt=\"\" [src]=\"service.brandLogo()\" class=\"p-r\" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @if (switcher.isEnabled) {\n <button mat-icon-button (click)=\"switcher.open()\" data-testid=\"page-switcher-open\"\n matTooltip=\"{{ 'Go to page' | translate }} (Ctrl+K)\" [attr.aria-label]=\"'Go to page' | translate\">\n <mat-icon>manage_search</mat-icon>\n </button>\n }\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-palette-switch></juice-palette-switch>\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [@.disabled]=\"settling\" [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content id=\"main-content\" [attr.role]=\"service.mainLandmark() ? 'main' : null\" tabindex=\"-1\" style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .skip-link{position:absolute;left:8px;top:-100px;z-index:1000;padding:8px 16px;border-radius:4px;background:var(--mat-sys-primary, #005cbb);color:var(--mat-sys-on-primary, #fff)}:host .skip-link:focus{top:8px}:host #main-content:focus{outline:none}:host .container.settling .mat-sidenav,:host .container.settling .mat-sidenav-content,:host .container.settling .mat-sidenav-container,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel-content,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-indicator,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-indicator:after,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel-header,:host .container.settling .mat-sidenav ::ng-deep .mat-mdc-list-item{transition:none!important}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i9.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i9.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i9.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: DarkModeComponent, selector: "juice-dark-mode" }, { kind: "component", type: PaletteSwitchComponent, selector: "juice-palette-switch" }, { kind: "component", type: NavMenuComponent, selector: "juice-nav-menu" }, { kind: "component", type: SearchBarComponent, selector: "juice-search-bar" }, { kind: "component", type: UserProfileComponent, selector: "juice-user-profile" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], animations: [
|
|
1331
1457
|
trigger('menuTransition', [
|
|
1332
1458
|
state('expand', style({
|
|
1333
1459
|
width: '220px'
|
|
@@ -1395,7 +1521,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1395
1521
|
animate('0.15s')
|
|
1396
1522
|
])
|
|
1397
1523
|
])
|
|
1398
|
-
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"
|
|
1524
|
+
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\" [class.settling]=\"settling\">\n <a class=\"skip-link\" href=\"#main-content\" (click)=\"skipToContent($event)\">{{ 'Skip to content' | translate }}</a>\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\" [attr.aria-label]=\"'Menu' | translate\"\n [attr.aria-expanded]=\"isSnavOpenned\">\n <mat-icon aria-hidden=\"true\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\" [attr.aria-label]=\"service.brandName() || ('Home' | translate)\">\n <img height=\"40\" alt=\"\" [src]=\"service.brandLogo()\" class=\"p-r\" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @if (switcher.isEnabled) {\n <button mat-icon-button (click)=\"switcher.open()\" data-testid=\"page-switcher-open\"\n matTooltip=\"{{ 'Go to page' | translate }} (Ctrl+K)\" [attr.aria-label]=\"'Go to page' | translate\">\n <mat-icon>manage_search</mat-icon>\n </button>\n }\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-palette-switch></juice-palette-switch>\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [@.disabled]=\"settling\" [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content id=\"main-content\" [attr.role]=\"service.mainLandmark() ? 'main' : null\" tabindex=\"-1\" style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .skip-link{position:absolute;left:8px;top:-100px;z-index:1000;padding:8px 16px;border-radius:4px;background:var(--mat-sys-primary, #005cbb);color:var(--mat-sys-on-primary, #fff)}:host .skip-link:focus{top:8px}:host #main-content:focus{outline:none}:host .container.settling .mat-sidenav,:host .container.settling .mat-sidenav-content,:host .container.settling .mat-sidenav-container,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel-content,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-indicator,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-indicator:after,:host .container.settling .mat-sidenav ::ng-deep .mat-expansion-panel-header,:host .container.settling .mat-sidenav ::ng-deep .mat-mdc-list-item{transition:none!important}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"] }]
|
|
1399
1525
|
}], ctorParameters: () => [{ type: LayoutService }, { type: SearchService }, { type: PageSwitcherService }, { type: i4$2.BreakpointObserver }, { type: i0.ChangeDetectorRef }] });
|
|
1400
1526
|
|
|
1401
1527
|
class PageNotfoundComponent {
|