@juice-js/layout 2.4.2 → 2.5.0-alpha.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/README.md +20 -0
- package/fesm2022/juice-js-layout.mjs +136 -27
- package/fesm2022/juice-js-layout.mjs.map +1 -1
- package/package.json +7 -4
- package/styles/_page-header.scss +9 -0
- package/styles/_theming.scss +25 -0
- package/types/juice-js-layout.d.ts +41 -6
package/README.md
CHANGED
|
@@ -20,6 +20,9 @@ show the same palette, light and dark. With Material 3, include the theme once i
|
|
|
20
20
|
- **The layout's components:** toolbar, sidenav, menus and scrollbars, from Material's system colours.
|
|
21
21
|
- **Shared tokens** for the page packages, on the same elements: `--juice-bg`, `--juice-surface`, `--juice-border`, `--juice-text`, `--juice-muted`, `--juice-accent`, `--juice-on-accent`, `--juice-select`, and the tones `--juice-ok`, `--juice-warn`, `--juice-bad`, `--juice-info`, `--juice-none`, each with a `-bg` tint. A package reads them with its own fallback: `var(--juice-accent, …)`.
|
|
22
22
|
|
|
23
|
+
- **The type and radius scale** of the Juice Consoles (since 2.4.3), under a zero-specificity `:where(:root)`: `--jc-font-xs` 11px, `-sm` 12, `-md` 13, `-lg` 14, `-xl` 16, `-2xl` 20, `-fig` 24; `--jc-radius-sm` 4px, `--jc-radius` 8, `--jc-radius-pill` 999. An app's own values win.
|
|
24
|
+
- **A keyboard focus ring** on the shell's toolbar, menu and skip link: 2px of `--juice-focus` (the primary colour) on `:focus-visible`.
|
|
25
|
+
|
|
23
26
|
Options: `default` (the palette before the viewer picks one), `palettes` (name → `(primary: …, tertiary: …)` M3 palettes, as `ng generate @angular/material:theme-color` writes them; a built-in name replaces that palette), `typography` (Roboto) and `density` (0).
|
|
24
27
|
|
|
25
28
|
At runtime the viewer picks a palette with the palette button beside the dark mode switch. `LayoutService.setPalette(id)` sets `data-juice-palette` on `<html>` and remembers it in the browser; `palette()` is the current one. Configure what the button offers in `LayoutModule.forRoot`:
|
|
@@ -34,6 +37,23 @@ LayoutModule.forRoot(production, {
|
|
|
34
37
|
|
|
35
38
|
With one palette there is no button. The Material 2 mixins of 1.x (`layout-component-themes`, `layout-component-colors`) still work for apps not on Material 3 yet; they get no palettes and no `--juice-*` tokens.
|
|
36
39
|
|
|
40
|
+
## Page header: `jc-page-header`
|
|
41
|
+
|
|
42
|
+
The header the Juice Consoles share, for a page that isn't about one environment or time range: the way back, the title as the
|
|
43
|
+
page's `h1`, a line under it, and the page's actions (and filters) projected in on the right.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { PageHeader } from '@juice-js/layout';
|
|
47
|
+
// <jc-page-header title="Routes" subtitle="Who gets what" [crumbs]="[{ label: 'Alerts', link: ['/alerts'] }, { label: 'Notifications' }]">
|
|
48
|
+
// <button mat-flat-button>New route</button>
|
|
49
|
+
// </jc-page-header>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Its styles are plain CSS, with or without `theme()`: `@use '@juice-js/layout/page-header';` once in the global styles. Classes:
|
|
53
|
+
`.jc-page-header`, `.jc-page-title`, `.jc-page-subtitle`, `.jc-crumb`, `.jc-crumb-sep`, `.jc-spacer`, and `.jc-sr-only` (visually
|
|
54
|
+
hidden, for a screen reader only). It reads `--jc-border` and `--jc-muted` (else `--juice-border` and `--juice-muted`), and the scale's
|
|
55
|
+
`--jc-font-2xl` and `--jc-font-md`, each with a fallback.
|
|
56
|
+
|
|
37
57
|
## Toolbar search: `SearchablePage`
|
|
38
58
|
|
|
39
59
|
The shell's toolbar hosts one search box, shared by every page. It appears only while the
|
|
@@ -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, afterNextRender, effect, untracked, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, signal, Optional, Injectable, inject, computed, viewChild, ChangeDetectionStrategy, Component, booleanAttribute, HostListener, Input, Directive, input, ChangeDetectorRef, DestroyRef, forwardRef, 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';
|
|
@@ -9,7 +9,7 @@ import { Breakpoints } from '@angular/cdk/layout';
|
|
|
9
9
|
import * as i1$1 from '@angular/common';
|
|
10
10
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
11
11
|
import * as i3$1 from '@angular/router';
|
|
12
|
-
import { Router, NavigationEnd, RouterModule } from '@angular/router';
|
|
12
|
+
import { Router, NavigationEnd, RouterModule, RouterLink } from '@angular/router';
|
|
13
13
|
import * as i2 from '@angular/material/icon';
|
|
14
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
15
15
|
import * as i5 from '@ngx-translate/core';
|
|
@@ -838,17 +838,43 @@ function pathOf(url) {
|
|
|
838
838
|
function mostSpecificLink(router, entries) {
|
|
839
839
|
const current = pathOf(router.parseUrl(router.url));
|
|
840
840
|
let best = null;
|
|
841
|
+
let bestScore = -1;
|
|
841
842
|
for (const entry of entries) {
|
|
842
843
|
if (!entry.link)
|
|
843
844
|
continue;
|
|
844
845
|
const path = pathOf(router.parseUrl(entry.link));
|
|
845
846
|
const exactOnly = path === '/' || isRoot(entry.rawLink);
|
|
846
|
-
const matches = current === path || (!exactOnly && current.startsWith(path + '/'));
|
|
847
|
-
|
|
847
|
+
const matches = !entry.pathsOnly && (current === path || (!exactOnly && current.startsWith(path + '/')));
|
|
848
|
+
// An entry's other paths (MenuItem.activePaths) mark it as its own link does; the longest match wins either way, both
|
|
849
|
+
// measured on the URL (a '*' counts as the segment it stands for).
|
|
850
|
+
const score = Math.max(matches ? path.length : -1, ...(entry.activePaths ?? []).map(p => patternMatch(current, p)));
|
|
851
|
+
if (score > bestScore) {
|
|
848
852
|
best = path;
|
|
853
|
+
bestScore = score;
|
|
854
|
+
}
|
|
849
855
|
}
|
|
850
856
|
return best;
|
|
851
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* How specific a match of `pattern` (an absolute path, `*` being any one segment) is on the path `current`: the length of the part of
|
|
860
|
+
* `current` it matched (as a link's match is measured), when `current` is the pattern or a page under it; -1 otherwise. A pattern of no
|
|
861
|
+
* segment (`/`, ``) matches nothing.
|
|
862
|
+
*/
|
|
863
|
+
function patternMatch(current, pattern) {
|
|
864
|
+
const want = pattern.replace(/[?#].*$/, '').split('/').filter(s => !!s);
|
|
865
|
+
if (want.length === 0)
|
|
866
|
+
return -1;
|
|
867
|
+
const have = current.split('/').filter(s => !!s);
|
|
868
|
+
if (have.length < want.length)
|
|
869
|
+
return -1;
|
|
870
|
+
return want.every((s, i) => s === '*' || s === have[i]) ? have.slice(0, want.length).join('/').length + 1 : -1;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* The side menu's entry on display ({@link mostSpecificLink}), provided by the menu to its groups: up to date as soon as a navigation
|
|
874
|
+
* ends, while their `activeLink` input waits for the next change detection.
|
|
875
|
+
*/
|
|
876
|
+
class MenuActiveLink {
|
|
877
|
+
}
|
|
852
878
|
|
|
853
879
|
/**
|
|
854
880
|
* The counts on the side menu's entries, by menu id ({@link Menu.id}). The menu draws them itself: beside the label, or
|
|
@@ -946,6 +972,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
946
972
|
* page of its own opens that page too; one without (`routerLink: ''`) only opens and closes.
|
|
947
973
|
*/
|
|
948
974
|
class ExpandableMenuComponent {
|
|
975
|
+
/**
|
|
976
|
+
* The path of the entry on display across the whole menu (the most specific one, see `mostSpecificLink`), given by
|
|
977
|
+
* the menu. Left out (undefined), the group goes by its own pages alone.
|
|
978
|
+
*/
|
|
979
|
+
set activeLink(value) {
|
|
980
|
+
const before = this._activeLink;
|
|
981
|
+
this._activeLink = value;
|
|
982
|
+
this.update();
|
|
983
|
+
// Outside a side menu (no MenuActiveLink), the group opens when the mark arrives on it; in one, the navigation does it.
|
|
984
|
+
if (!this.menu && value !== before && this.open)
|
|
985
|
+
this.panel()?.open();
|
|
986
|
+
}
|
|
987
|
+
get activeLink() { return this._activeLink; }
|
|
988
|
+
/** The entry on display: the menu's, current as soon as a navigation ends; else the input's. */
|
|
989
|
+
get current() {
|
|
990
|
+
return this.menu ? this.menu.activeLink : this._activeLink;
|
|
991
|
+
}
|
|
949
992
|
set item(value) {
|
|
950
993
|
this._item = value;
|
|
951
994
|
this.children = value?.menuChildren?.() ?? [];
|
|
@@ -956,6 +999,8 @@ class ExpandableMenuComponent {
|
|
|
956
999
|
get item() { return this._item; }
|
|
957
1000
|
constructor() {
|
|
958
1001
|
this.router = inject(Router);
|
|
1002
|
+
/** The side menu it is in, which knows the entry on display as soon as a navigation ends. */
|
|
1003
|
+
this.menu = inject(MenuActiveLink, { optional: true });
|
|
959
1004
|
this.cdr = inject(ChangeDetectorRef);
|
|
960
1005
|
this.panel = viewChild(MatExpansionPanel, /* @ts-ignore */
|
|
961
1006
|
...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
|
|
@@ -998,26 +1043,34 @@ class ExpandableMenuComponent {
|
|
|
998
1043
|
const all = item?.children ?? [];
|
|
999
1044
|
const links = all.map(c => c.routerLink).filter(l => !!l);
|
|
1000
1045
|
this.headerLink = item?.hasOwnPage?.() ? item.routerLink : null;
|
|
1001
|
-
|
|
1046
|
+
// Given the menu's entry on display, the header is marked as the menu's other entries are (also on the pages under it,
|
|
1047
|
+
// and by its activePaths); alone, on its own page only.
|
|
1048
|
+
this.headerActive = this.current !== undefined ? this.isMenuActive(this.headerLink) : this.isActive(this.headerLink, ExactMatch);
|
|
1002
1049
|
// The header's own page opens the group with the pages under it, unless it is the home page or the tenant's root.
|
|
1003
1050
|
const headerSection = !!this.headerLink && !isRoot(item.rawRouterLink);
|
|
1004
1051
|
this.open = this.headerActive || (headerSection && this.isActive(this.headerLink, SectionMatch))
|
|
1005
|
-
|| all.some(c => this.isActive(c.routerLink, this.matching(c.routerLink, links)))
|
|
1052
|
+
|| all.some(c => this.isActive(c.routerLink, this.matching(c.routerLink, links)))
|
|
1053
|
+
|| all.some(c => this.isMenuActive(c.routerLink)); // by the menu's mark: also by activePaths, also a page kept out of the menu
|
|
1006
1054
|
}
|
|
1007
1055
|
/** The URL's path, without query string or fragment. */
|
|
1008
1056
|
path() {
|
|
1009
1057
|
return this.router.url.replace(/[?#].*$/, '');
|
|
1010
1058
|
}
|
|
1011
|
-
/**
|
|
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
|
|
1013
|
-
* `/` or to the tenant's root), which would make it match every page.
|
|
1014
|
-
*/
|
|
1015
1059
|
/** Whether a page of the group is the page on display. */
|
|
1016
1060
|
isChildActive(child) {
|
|
1017
|
-
if (this.
|
|
1061
|
+
if (this.current === undefined)
|
|
1018
1062
|
return this.isActive(child.routerLink, this.matching(child.routerLink));
|
|
1019
|
-
return this.
|
|
1063
|
+
return this.isMenuActive(child.routerLink);
|
|
1064
|
+
}
|
|
1065
|
+
/** Whether the menu's entry on display (activeLink) is this link. */
|
|
1066
|
+
isMenuActive(link) {
|
|
1067
|
+
const current = this.current;
|
|
1068
|
+
return current != null && !!link && pathOf(this.router.parseUrl(link)) === current;
|
|
1020
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* How a child's link matches: with the pages under it, unless other pages of the group sit under it too (a link to
|
|
1072
|
+
* `/` or to the tenant's root), which would make it match every page.
|
|
1073
|
+
*/
|
|
1021
1074
|
matching(link, links = this.childLinks) {
|
|
1022
1075
|
return linkMatch(link, links);
|
|
1023
1076
|
}
|
|
@@ -1028,11 +1081,11 @@ class ExpandableMenuComponent {
|
|
|
1028
1081
|
return !!link && this.router.isActive(this.router.parseUrl(link), options);
|
|
1029
1082
|
}
|
|
1030
1083
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
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 }); }
|
|
1084
|
+
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 <!-- The header is the button that opens the group (and its page): Material's list item sets its own aria-current, null outside a nav list. -->\n <mat-expansion-panel-header [attr.aria-current]=\"headerActive ? 'page' : null\">\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 <!-- A navigation landmark of its own, inside the menu's: named after the group, so no two landmarks read the same (axe landmark-unique). -->\n <mat-nav-list [attr.aria-label]=\"item.label\">\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 }); }
|
|
1032
1085
|
}
|
|
1033
1086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, decorators: [{
|
|
1034
1087
|
type: Component,
|
|
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"] }]
|
|
1088
|
+
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 <!-- The header is the button that opens the group (and its page): Material's list item sets its own aria-current, null outside a nav list. -->\n <mat-expansion-panel-header [attr.aria-current]=\"headerActive ? 'page' : null\">\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 <!-- A navigation landmark of its own, inside the menu's: named after the group, so no two landmarks read the same (axe landmark-unique). -->\n <mat-nav-list [attr.aria-label]=\"item.label\">\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"] }]
|
|
1036
1089
|
}], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatExpansionPanel), { isSignal: true }] }], isExpanded: [{
|
|
1037
1090
|
type: Input
|
|
1038
1091
|
}], activeLink: [{
|
|
@@ -1106,12 +1159,18 @@ class NavMenuComponent {
|
|
|
1106
1159
|
const entries = [];
|
|
1107
1160
|
for (const item of this.menuItems) {
|
|
1108
1161
|
if (!this.groups.has(item))
|
|
1109
|
-
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink });
|
|
1162
|
+
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink, activePaths: item.activePaths });
|
|
1110
1163
|
else {
|
|
1111
1164
|
if (item.hasOwnPage())
|
|
1112
|
-
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink });
|
|
1113
|
-
for (const child of item.
|
|
1114
|
-
|
|
1165
|
+
entries.push({ link: item.routerLink, rawLink: item.rawRouterLink, activePaths: item.activePaths });
|
|
1166
|
+
for (const child of item.children ?? []) {
|
|
1167
|
+
// A page kept out of the menu counts by its other paths only (its group opens on them); by its link, as before, it
|
|
1168
|
+
// leaves the mark to the entry it is under.
|
|
1169
|
+
const hidden = child.inMenu === false;
|
|
1170
|
+
if (hidden && !child.activePaths?.length)
|
|
1171
|
+
continue;
|
|
1172
|
+
entries.push({ link: child.routerLink, rawLink: child.rawRouterLink, activePaths: child.activePaths, pathsOnly: hidden });
|
|
1173
|
+
}
|
|
1115
1174
|
}
|
|
1116
1175
|
}
|
|
1117
1176
|
this.activeLink = mostSpecificLink(this.router, entries);
|
|
@@ -1135,11 +1194,11 @@ class NavMenuComponent {
|
|
|
1135
1194
|
}
|
|
1136
1195
|
}
|
|
1137
1196
|
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 }); }
|
|
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 }); }
|
|
1197
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NavMenuComponent, isStandalone: false, selector: "juice-nav-menu", providers: [{ provide: MenuActiveLink, useExisting: forwardRef(() => NavMenuComponent) }], ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" [attr.aria-label]=\"'Menu' | translate\" (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 }); }
|
|
1139
1198
|
}
|
|
1140
1199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, decorators: [{
|
|
1141
1200
|
type: Component,
|
|
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"] }]
|
|
1201
|
+
args: [{ selector: 'juice-nav-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, providers: [{ provide: MenuActiveLink, useExisting: forwardRef(() => NavMenuComponent) }], template: "<mat-nav-list class=\"menu-scroll\" [attr.aria-label]=\"'Menu' | translate\" (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"] }]
|
|
1143
1202
|
}], ctorParameters: () => [{ type: i1.MenuService }, { type: LayoutService }, { type: i1.TenantService }, { type: i3$1.ActivatedRoute }, { type: i4$2.BreakpointObserver }, { type: i0.ChangeDetectorRef }, { type: PageSwitcherService }] });
|
|
1144
1203
|
|
|
1145
1204
|
/**
|
|
@@ -1160,7 +1219,7 @@ class SearchBarComponent {
|
|
|
1160
1219
|
this.service.submit('', event);
|
|
1161
1220
|
}
|
|
1162
1221
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SearchBarComponent, deps: [{ token: SearchService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1163
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SearchBarComponent, isStandalone: false, selector: "juice-search-bar", ngImport: i0, template: "@if (service.isEnabled()) {\n <div @enableTrigger class=\"search-container\">\n <input type=\"search\" [value]=\"service.query()\"\n (input)=\"onSearchTextChange($event)\" placeholder=\"Search\">\n @if (service.query()) {\n <mat-icon (click)=\"clear($event)\" color=\"primary\">\n close</mat-icon>\n }\n </div>\n}\n", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width:600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], animations: [
|
|
1222
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SearchBarComponent, isStandalone: false, selector: "juice-search-bar", ngImport: i0, template: "@if (service.isEnabled()) {\n <div @enableTrigger class=\"search-container\">\n <input type=\"search\" [value]=\"service.query()\"\n (input)=\"onSearchTextChange($event)\" placeholder=\"Search\" aria-label=\"Search\">\n @if (service.query()) {\n <mat-icon (click)=\"clear($event)\" color=\"primary\">\n close</mat-icon>\n }\n </div>\n}\n", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input:focus-visible{outline:2px solid var(--juice-focus, currentcolor);outline-offset:2px}@media(max-width:599.98px){.search-container input{min-height:40px}}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width:600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], animations: [
|
|
1164
1223
|
trigger('enableTrigger', [
|
|
1165
1224
|
transition(':enter', [
|
|
1166
1225
|
style({ opacity: 0 }),
|
|
@@ -1184,7 +1243,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1184
1243
|
animate('100ms', style({ opacity: 0 }))
|
|
1185
1244
|
])
|
|
1186
1245
|
]),
|
|
1187
|
-
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "@if (service.isEnabled()) {\n <div @enableTrigger class=\"search-container\">\n <input type=\"search\" [value]=\"service.query()\"\n (input)=\"onSearchTextChange($event)\" placeholder=\"Search\">\n @if (service.query()) {\n <mat-icon (click)=\"clear($event)\" color=\"primary\">\n close</mat-icon>\n }\n </div>\n}\n", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width:600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"] }]
|
|
1246
|
+
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "@if (service.isEnabled()) {\n <div @enableTrigger class=\"search-container\">\n <input type=\"search\" [value]=\"service.query()\"\n (input)=\"onSearchTextChange($event)\" placeholder=\"Search\" aria-label=\"Search\">\n @if (service.query()) {\n <mat-icon (click)=\"clear($event)\" color=\"primary\">\n close</mat-icon>\n }\n </div>\n}\n", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input:focus-visible{outline:2px solid var(--juice-focus, currentcolor);outline-offset:2px}@media(max-width:599.98px){.search-container input{min-height:40px}}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width:600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"] }]
|
|
1188
1247
|
}], ctorParameters: () => [{ type: SearchService }] });
|
|
1189
1248
|
|
|
1190
1249
|
class ProfileDialogService extends AsyncDialog {
|
|
@@ -1357,10 +1416,12 @@ class PageComponent {
|
|
|
1357
1416
|
* animation (an animated settle on load shifts the page under the reader).
|
|
1358
1417
|
*/
|
|
1359
1418
|
this.settling = true;
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1419
|
+
const handset = [Breakpoints.HandsetLandscape, Breakpoints.HandsetPortrait];
|
|
1420
|
+
// The mode before the first render, from the media queries as they are now: drawn as desktop and then switched to a
|
|
1421
|
+
// phone's (the observer's answer arriving after first paint) shifted the whole page on a cold load at 390px.
|
|
1422
|
+
this.isMobile = breakpointObserver.isMatched(handset);
|
|
1423
|
+
this.isSnavOpenned = !this.isMobile;
|
|
1424
|
+
breakpointObserver.observe(handset).subscribe(result => {
|
|
1364
1425
|
this.isMobile = result.matches;
|
|
1365
1426
|
this.isSnavOpenned = !this.isMobile;
|
|
1366
1427
|
cdr.markForCheck();
|
|
@@ -1780,6 +1841,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1780
1841
|
}]
|
|
1781
1842
|
}] });
|
|
1782
1843
|
|
|
1844
|
+
/**
|
|
1845
|
+
* The header of a page that isn't about one environment or time range (a module's page, the notification pages): the way back, the title as
|
|
1846
|
+
* the page's h1, a line under it, and the page's actions on the right (project them in, filters too). Shared by the Juice Consoles; its
|
|
1847
|
+
* styles are `@use '@juice-js/layout/page-header'` (classes .jc-page-header, .jc-page-title, .jc-page-subtitle, .jc-crumb, .jc-crumb-sep,
|
|
1848
|
+
* .jc-spacer, .jc-sr-only), which read only CSS variables, each with a fallback.
|
|
1849
|
+
*/
|
|
1850
|
+
class PageHeader {
|
|
1851
|
+
constructor() {
|
|
1852
|
+
this.title = input.required(/* @ts-ignore */
|
|
1853
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1854
|
+
this.subtitle = input(null, /* @ts-ignore */
|
|
1855
|
+
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
1856
|
+
this.crumbs = input([], /* @ts-ignore */
|
|
1857
|
+
...(ngDevMode ? [{ debugName: "crumbs" }] : /* istanbul ignore next */ []));
|
|
1858
|
+
}
|
|
1859
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1860
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageHeader, isStandalone: true, selector: "jc-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, crumbs: { classPropertyName: "crumbs", publicName: "crumbs", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, ngImport: i0, template: `<header class="jc-page-header">
|
|
1861
|
+
@for (c of crumbs(); track $index) {
|
|
1862
|
+
@if (c.link) { <a class="jc-crumb" [routerLink]="$any(c.link)">{{ c.label }}</a> } @else { <span class="jc-crumb">{{ c.label }}</span> }
|
|
1863
|
+
<span class="jc-crumb-sep" aria-hidden="true">›</span>
|
|
1864
|
+
}
|
|
1865
|
+
<h1 class="jc-page-title">{{ title() }}</h1>
|
|
1866
|
+
@if (subtitle()) { <span class="jc-muted jc-page-subtitle">{{ subtitle() }}</span> }
|
|
1867
|
+
<span class="jc-spacer"></span>
|
|
1868
|
+
<ng-content />
|
|
1869
|
+
</header>`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1870
|
+
}
|
|
1871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageHeader, decorators: [{
|
|
1872
|
+
type: Component,
|
|
1873
|
+
args: [{
|
|
1874
|
+
selector: 'jc-page-header',
|
|
1875
|
+
standalone: true,
|
|
1876
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1877
|
+
imports: [RouterLink],
|
|
1878
|
+
host: { '[attr.title]': 'null' }, // the input is named like the HTML attribute: a static title="…" must not stay on the host as a native tooltip
|
|
1879
|
+
template: `<header class="jc-page-header">
|
|
1880
|
+
@for (c of crumbs(); track $index) {
|
|
1881
|
+
@if (c.link) { <a class="jc-crumb" [routerLink]="$any(c.link)">{{ c.label }}</a> } @else { <span class="jc-crumb">{{ c.label }}</span> }
|
|
1882
|
+
<span class="jc-crumb-sep" aria-hidden="true">›</span>
|
|
1883
|
+
}
|
|
1884
|
+
<h1 class="jc-page-title">{{ title() }}</h1>
|
|
1885
|
+
@if (subtitle()) { <span class="jc-muted jc-page-subtitle">{{ subtitle() }}</span> }
|
|
1886
|
+
<span class="jc-spacer"></span>
|
|
1887
|
+
<ng-content />
|
|
1888
|
+
</header>`,
|
|
1889
|
+
}]
|
|
1890
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], crumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "crumbs", required: false }] }] } });
|
|
1891
|
+
|
|
1783
1892
|
/*
|
|
1784
1893
|
* Public API Surface of layout
|
|
1785
1894
|
*/
|
|
@@ -1788,5 +1897,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1788
1897
|
* Generated bundle index. Do not edit.
|
|
1789
1898
|
*/
|
|
1790
1899
|
|
|
1791
|
-
export { DevGuard, ExpandableMenuComponent, LAYOUT_PALETTES, LAYOUT_TOOLBAR_ITEMS, LayoutModule, LayoutService, MenuBadgeComponent, MenuBadgeService, NavMenuComponent, PageComponent, PageNotfoundComponent, PageSwitcherComponent, PageSwitcherService, ProfileDialogService, SearchService, TooltipDirective, TooltipModule, TooltipPosition, UserProfileDialogModule, flatten, isSearchablePage };
|
|
1900
|
+
export { DevGuard, ExpandableMenuComponent, LAYOUT_PALETTES, LAYOUT_TOOLBAR_ITEMS, LayoutModule, LayoutService, MenuBadgeComponent, MenuBadgeService, NavMenuComponent, PageComponent, PageHeader, PageNotfoundComponent, PageSwitcherComponent, PageSwitcherService, ProfileDialogService, SearchService, TooltipDirective, TooltipModule, TooltipPosition, UserProfileDialogModule, flatten, isSearchablePage };
|
|
1792
1901
|
//# sourceMappingURL=juice-js-layout.mjs.map
|