@delon/theme 20.1.1 → 21.0.0-next.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/compact.css +853 -632
- package/compact.min.css +1 -1
- package/dark.css +850 -629
- package/dark.min.css +1 -1
- package/default.css +850 -629
- package/default.min.css +1 -1
- package/fesm2022/layout-default.mjs +499 -400
- package/fesm2022/layout-default.mjs.map +1 -1
- package/fesm2022/setting-drawer.mjs +86 -13
- package/fesm2022/setting-drawer.mjs.map +1 -1
- package/fesm2022/theme-btn.mjs +96 -32
- package/fesm2022/theme-btn.mjs.map +1 -1
- package/fesm2022/theme.mjs +492 -134
- package/fesm2022/theme.mjs.map +1 -1
- package/layout-default/style/_layout.less +2 -1
- package/package.json +12 -12
- package/system/theme-default.less +1 -1
- package/types/layout-default.d.ts +210 -0
- package/types/theme-btn.d.ts +42 -0
- package/{index.d.ts → types/theme.d.ts} +29 -7
- package/variable.css +850 -629
- package/variable.min.css +1 -1
- package/layout-default/index.d.ts +0 -245
- package/theme-btn/index.d.ts +0 -42
- /package/{layout-blank/index.d.ts → types/layout-blank.d.ts} +0 -0
- /package/{setting-drawer/index.d.ts → types/setting-drawer.d.ts} +0 -0
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
1
|
+
import { NgTemplateOutlet, DOCUMENT, CommonModule } from '@angular/common';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
3
|
+
import { viewChild, input, Component, inject, signal, Injectable, computed, ChangeDetectionStrategy, Renderer2, booleanAttribute, numberAttribute, output, effect, afterNextRender, ViewEncapsulation, contentChildren, Directive, NgModule } from '@angular/core';
|
|
5
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { BehaviorSubject, filter } from 'rxjs';
|
|
5
|
+
import { RouterLink, Router, NavigationEnd, RouteConfigLoadStart, NavigationError, NavigationCancel, RouteConfigLoadEnd, RouterModule } from '@angular/router';
|
|
6
|
+
import { filter, map } from 'rxjs';
|
|
9
7
|
import { SettingsService, MenuService } from '@delon/theme';
|
|
10
|
-
import {
|
|
8
|
+
import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
|
|
11
9
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
12
10
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
13
|
-
import * as i3 from 'ng-zorro-antd/icon';
|
|
14
|
-
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
15
|
-
import { __decorate } from 'tslib';
|
|
16
11
|
import { Directionality } from '@angular/cdk/bidi';
|
|
17
12
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
18
|
-
import { ZoneOutside } from '@delon/util/decorator';
|
|
19
13
|
import { WINDOW } from '@delon/util/token';
|
|
20
|
-
import
|
|
21
|
-
import { NzTooltipModule } from 'ng-zorro-antd/tooltip';
|
|
22
|
-
import * as i4 from 'ng-zorro-antd/badge';
|
|
23
|
-
import { NzBadgeModule } from 'ng-zorro-antd/badge';
|
|
14
|
+
import { NzBadgeComponent, NzBadgeModule } from 'ng-zorro-antd/badge';
|
|
15
|
+
import { NzTooltipDirective, NzTooltipModule } from 'ng-zorro-antd/tooltip';
|
|
24
16
|
import { NzAvatarModule } from 'ng-zorro-antd/avatar';
|
|
25
|
-
import {
|
|
17
|
+
import { NzDropdownModule } from 'ng-zorro-antd/dropdown';
|
|
26
18
|
|
|
27
19
|
class LayoutDefaultHeaderItemComponent {
|
|
28
|
-
host;
|
|
29
|
-
hidden = 'none';
|
|
30
|
-
direction = 'right';
|
|
31
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
20
|
+
host = viewChild('host', ...(ngDevMode ? [{ debugName: "host" }] : []));
|
|
21
|
+
hidden = input('none', ...(ngDevMode ? [{ debugName: "hidden" }] : []));
|
|
22
|
+
direction = input('right', ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: LayoutDefaultHeaderItemComponent, isStandalone: true, selector: "layout-default-header-item", inputs: { hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
33
25
|
<ng-template #host>
|
|
34
26
|
<ng-content />
|
|
35
27
|
</ng-template>
|
|
36
28
|
`, isInline: true });
|
|
37
29
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderItemComponent, decorators: [{
|
|
39
31
|
type: Component,
|
|
40
32
|
args: [{
|
|
41
33
|
selector: 'layout-default-header-item',
|
|
@@ -43,18 +35,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
43
35
|
<ng-template #host>
|
|
44
36
|
<ng-content />
|
|
45
37
|
</ng-template>
|
|
46
|
-
|
|
47
|
-
// eslint-disable-next-line @angular-eslint/prefer-standalone
|
|
48
|
-
standalone: false
|
|
38
|
+
`
|
|
49
39
|
}]
|
|
50
|
-
}], propDecorators: { host: [{
|
|
51
|
-
type: ViewChild,
|
|
52
|
-
args: ['host', { static: true }]
|
|
53
|
-
}], hidden: [{
|
|
54
|
-
type: Input
|
|
55
|
-
}], direction: [{
|
|
56
|
-
type: Input
|
|
57
|
-
}] } });
|
|
40
|
+
}], propDecorators: { host: [{ type: i0.ViewChild, args: ['host', { isSignal: true }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }] } });
|
|
58
41
|
|
|
59
42
|
const DEFAULT = {
|
|
60
43
|
logoExpanded: `./assets/logo-full.svg`,
|
|
@@ -68,22 +51,8 @@ const DEFAULT = {
|
|
|
68
51
|
class LayoutDefaultService {
|
|
69
52
|
settings = inject(SettingsService);
|
|
70
53
|
bm = inject(BreakpointObserver);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
get options() {
|
|
74
|
-
return this._options;
|
|
75
|
-
}
|
|
76
|
-
get options$() {
|
|
77
|
-
return this._options$.asObservable();
|
|
78
|
-
}
|
|
79
|
-
get collapsedIcon() {
|
|
80
|
-
const collapsed = this.settings.layout.collapsed;
|
|
81
|
-
let type = collapsed ? 'unfold' : 'fold';
|
|
82
|
-
if (this.settings.layout.direction === 'rtl') {
|
|
83
|
-
type = collapsed ? 'fold' : 'unfold';
|
|
84
|
-
}
|
|
85
|
-
return `menu-${type}`;
|
|
86
|
-
}
|
|
54
|
+
options = signal(DEFAULT, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
55
|
+
collapsedIcon = signal('', ...(ngDevMode ? [{ debugName: "collapsedIcon" }] : []));
|
|
87
56
|
constructor() {
|
|
88
57
|
const mobileMedia = 'only screen and (max-width: 767.99px)';
|
|
89
58
|
this.bm
|
|
@@ -91,24 +60,28 @@ class LayoutDefaultService {
|
|
|
91
60
|
.pipe(takeUntilDestroyed())
|
|
92
61
|
.subscribe(state => this.checkMedia(state.matches));
|
|
93
62
|
this.checkMedia(this.bm.isMatched(mobileMedia));
|
|
63
|
+
const settings = this.settings;
|
|
64
|
+
settings.notify
|
|
65
|
+
.pipe(filter(w => w.type === 'layout'), map(() => {
|
|
66
|
+
const collapsed = settings.layout.collapsed;
|
|
67
|
+
const ret = settings.layout.direction === 'rtl' ? (collapsed ? 'fold' : 'unfold') : collapsed ? 'unfold' : 'fold';
|
|
68
|
+
return ret;
|
|
69
|
+
}), takeUntilDestroyed())
|
|
70
|
+
.subscribe(type => this.collapsedIcon.set(`menu-${type}`));
|
|
94
71
|
}
|
|
95
72
|
checkMedia(value) {
|
|
96
73
|
this.settings.setLayout('collapsed', value);
|
|
97
74
|
}
|
|
98
|
-
notify() {
|
|
99
|
-
this._options$.next(this._options);
|
|
100
|
-
}
|
|
101
75
|
/**
|
|
102
76
|
* Set layout configuration
|
|
103
77
|
*
|
|
104
78
|
* 设置布局配置
|
|
105
79
|
*/
|
|
106
80
|
setOptions(options) {
|
|
107
|
-
this.
|
|
81
|
+
this.options.set({
|
|
108
82
|
...DEFAULT,
|
|
109
83
|
...options
|
|
110
|
-
};
|
|
111
|
-
this.notify();
|
|
84
|
+
});
|
|
112
85
|
}
|
|
113
86
|
/**
|
|
114
87
|
* Toggle the collapsed state of the sidebar menu bar
|
|
@@ -117,16 +90,115 @@ class LayoutDefaultService {
|
|
|
117
90
|
*/
|
|
118
91
|
toggleCollapsed(status) {
|
|
119
92
|
this.settings.setLayout('collapsed', status != null ? status : !this.settings.layout.collapsed);
|
|
120
|
-
this.notify();
|
|
121
93
|
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
123
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
95
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultService, providedIn: 'root' });
|
|
124
96
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultService, decorators: [{
|
|
126
98
|
type: Injectable,
|
|
127
99
|
args: [{ providedIn: 'root' }]
|
|
128
100
|
}], ctorParameters: () => [] });
|
|
129
101
|
|
|
102
|
+
class LayoutDefaultHeaderComponent {
|
|
103
|
+
app = inject(SettingsService).app;
|
|
104
|
+
srv = inject(LayoutDefaultService);
|
|
105
|
+
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
106
|
+
left = computed(() => this.items().filter(i => i.direction() === 'left'), ...(ngDevMode ? [{ debugName: "left" }] : []));
|
|
107
|
+
middle = computed(() => this.items().filter(i => i.direction() === 'middle'), ...(ngDevMode ? [{ debugName: "middle" }] : []));
|
|
108
|
+
right = computed(() => this.items().filter(i => i.direction() === 'right'), ...(ngDevMode ? [{ debugName: "right" }] : []));
|
|
109
|
+
opt = this.srv.options;
|
|
110
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
111
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: LayoutDefaultHeaderComponent, isStandalone: true, selector: "layout-default-header", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "alain-default__header" }, ngImport: i0, template: `
|
|
112
|
+
<ng-template #render let-ls>
|
|
113
|
+
@for (i of ls; track $index) {
|
|
114
|
+
<li [class.hidden-mobile]="i.hidden() === 'mobile'" [class.hidden-pc]="i.hidden() === 'pc'">
|
|
115
|
+
<ng-container *ngTemplateOutlet="i.host()" />
|
|
116
|
+
</li>
|
|
117
|
+
}
|
|
118
|
+
</ng-template>
|
|
119
|
+
@let _opt = opt();
|
|
120
|
+
<div class="alain-default__header-logo" [style.width.px]="_opt.logoFixWidth">
|
|
121
|
+
@if (_opt.logo) {
|
|
122
|
+
<ng-container *ngTemplateOutlet="_opt.logo" />
|
|
123
|
+
} @else {
|
|
124
|
+
<a [routerLink]="_opt.logoLink" class="alain-default__header-logo-link">
|
|
125
|
+
<img class="alain-default__header-logo-expanded" [attr.src]="_opt.logoExpanded" [attr.alt]="app.name" />
|
|
126
|
+
<img class="alain-default__header-logo-collapsed" [attr.src]="_opt.logoCollapsed" [attr.alt]="app.name" />
|
|
127
|
+
</a>
|
|
128
|
+
}
|
|
129
|
+
</div>
|
|
130
|
+
<div class="alain-default__nav-wrap">
|
|
131
|
+
<ul class="alain-default__nav">
|
|
132
|
+
@if (!_opt.hideAside && _opt.showHeaderCollapse) {
|
|
133
|
+
<li>
|
|
134
|
+
<div class="alain-default__nav-item alain-default__nav-item--collapse" (click)="srv.toggleCollapsed()">
|
|
135
|
+
<nz-icon [nzType]="srv.collapsedIcon()" />
|
|
136
|
+
</div>
|
|
137
|
+
</li>
|
|
138
|
+
}
|
|
139
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: left() }" />
|
|
140
|
+
</ul>
|
|
141
|
+
@if (middle().length > 0) {
|
|
142
|
+
<div class="alain-default__nav alain-default__nav-middle">
|
|
143
|
+
<ng-container *ngTemplateOutlet="middle()[0].host()" />
|
|
144
|
+
</div>
|
|
145
|
+
}
|
|
146
|
+
<ul class="alain-default__nav">
|
|
147
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: right() }" />
|
|
148
|
+
</ul>
|
|
149
|
+
</div>
|
|
150
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderComponent, decorators: [{
|
|
153
|
+
type: Component,
|
|
154
|
+
args: [{
|
|
155
|
+
selector: 'layout-default-header',
|
|
156
|
+
template: `
|
|
157
|
+
<ng-template #render let-ls>
|
|
158
|
+
@for (i of ls; track $index) {
|
|
159
|
+
<li [class.hidden-mobile]="i.hidden() === 'mobile'" [class.hidden-pc]="i.hidden() === 'pc'">
|
|
160
|
+
<ng-container *ngTemplateOutlet="i.host()" />
|
|
161
|
+
</li>
|
|
162
|
+
}
|
|
163
|
+
</ng-template>
|
|
164
|
+
@let _opt = opt();
|
|
165
|
+
<div class="alain-default__header-logo" [style.width.px]="_opt.logoFixWidth">
|
|
166
|
+
@if (_opt.logo) {
|
|
167
|
+
<ng-container *ngTemplateOutlet="_opt.logo" />
|
|
168
|
+
} @else {
|
|
169
|
+
<a [routerLink]="_opt.logoLink" class="alain-default__header-logo-link">
|
|
170
|
+
<img class="alain-default__header-logo-expanded" [attr.src]="_opt.logoExpanded" [attr.alt]="app.name" />
|
|
171
|
+
<img class="alain-default__header-logo-collapsed" [attr.src]="_opt.logoCollapsed" [attr.alt]="app.name" />
|
|
172
|
+
</a>
|
|
173
|
+
}
|
|
174
|
+
</div>
|
|
175
|
+
<div class="alain-default__nav-wrap">
|
|
176
|
+
<ul class="alain-default__nav">
|
|
177
|
+
@if (!_opt.hideAside && _opt.showHeaderCollapse) {
|
|
178
|
+
<li>
|
|
179
|
+
<div class="alain-default__nav-item alain-default__nav-item--collapse" (click)="srv.toggleCollapsed()">
|
|
180
|
+
<nz-icon [nzType]="srv.collapsedIcon()" />
|
|
181
|
+
</div>
|
|
182
|
+
</li>
|
|
183
|
+
}
|
|
184
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: left() }" />
|
|
185
|
+
</ul>
|
|
186
|
+
@if (middle().length > 0) {
|
|
187
|
+
<div class="alain-default__nav alain-default__nav-middle">
|
|
188
|
+
<ng-container *ngTemplateOutlet="middle()[0].host()" />
|
|
189
|
+
</div>
|
|
190
|
+
}
|
|
191
|
+
<ul class="alain-default__nav">
|
|
192
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: right() }" />
|
|
193
|
+
</ul>
|
|
194
|
+
</div>
|
|
195
|
+
`,
|
|
196
|
+
host: { class: 'alain-default__header' },
|
|
197
|
+
imports: [NgTemplateOutlet, RouterLink, NzIconDirective],
|
|
198
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
199
|
+
}]
|
|
200
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }] } });
|
|
201
|
+
|
|
130
202
|
const SHOWCLS = 'sidebar-nav__floating-show';
|
|
131
203
|
const FLOATINGCLS = 'sidebar-nav__floating';
|
|
132
204
|
class LayoutDefaultNavComponent {
|
|
@@ -136,26 +208,64 @@ class LayoutDefaultNavComponent {
|
|
|
136
208
|
render = inject(Renderer2);
|
|
137
209
|
menuSrv = inject(MenuService);
|
|
138
210
|
settings = inject(SettingsService);
|
|
139
|
-
cdr = inject(ChangeDetectorRef);
|
|
140
|
-
ngZone = inject(NgZone);
|
|
141
211
|
sanitizer = inject(DomSanitizer);
|
|
142
|
-
bodyEl;
|
|
143
|
-
destroy$ = inject(DestroyRef);
|
|
212
|
+
bodyEl = this.doc.querySelector('body');
|
|
144
213
|
floatingEl;
|
|
145
214
|
dir = inject(Directionality).valueSignal;
|
|
146
|
-
list = [];
|
|
147
|
-
disabledAcl = false;
|
|
148
|
-
autoCloseUnderPad = true;
|
|
149
|
-
recursivePath = true;
|
|
150
|
-
hideEmptyChildren = true;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
maxLevelIcon = 3;
|
|
155
|
-
select = new EventEmitter();
|
|
215
|
+
list = signal([], ...(ngDevMode ? [{ debugName: "list" }] : []));
|
|
216
|
+
disabledAcl = input(false, { ...(ngDevMode ? { debugName: "disabledAcl" } : {}), transform: booleanAttribute });
|
|
217
|
+
autoCloseUnderPad = input(true, { ...(ngDevMode ? { debugName: "autoCloseUnderPad" } : {}), transform: booleanAttribute });
|
|
218
|
+
recursivePath = input(true, { ...(ngDevMode ? { debugName: "recursivePath" } : {}), transform: booleanAttribute });
|
|
219
|
+
hideEmptyChildren = input(true, { ...(ngDevMode ? { debugName: "hideEmptyChildren" } : {}), transform: booleanAttribute });
|
|
220
|
+
openStrictly = input(...(ngDevMode ? [undefined, { debugName: "openStrictly" }] : []));
|
|
221
|
+
maxLevelIcon = input(3, { ...(ngDevMode ? { debugName: "maxLevelIcon" } : {}), transform: numberAttribute });
|
|
222
|
+
select = output();
|
|
156
223
|
get collapsed() {
|
|
157
224
|
return this.settings.layout.collapsed;
|
|
158
225
|
}
|
|
226
|
+
constructor() {
|
|
227
|
+
effect(() => {
|
|
228
|
+
const openStrictly = this.openStrictly();
|
|
229
|
+
if (openStrictly != null) {
|
|
230
|
+
this.menuSrv.openStrictly = openStrictly;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
this.menuSrv.change.pipe(takeUntilDestroyed()).subscribe(data => {
|
|
234
|
+
this.menuSrv.visit(data, (i, _p, depth) => {
|
|
235
|
+
i._text = this.sanitizer.bypassSecurityTrustHtml(i.text);
|
|
236
|
+
i._needIcon = depth <= this.maxLevelIcon() && !!i.icon;
|
|
237
|
+
if (!i._aclResult) {
|
|
238
|
+
if (this.disabledAcl()) {
|
|
239
|
+
i.disabled = true;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
i._hidden = true;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const icon = i.icon;
|
|
246
|
+
if (icon && icon.type === 'svg' && typeof icon.value === 'string') {
|
|
247
|
+
icon.value = this.sanitizer.bypassSecurityTrustHtml(icon.value);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
if (this.hideEmptyChildren())
|
|
251
|
+
this.fixHide(data);
|
|
252
|
+
this.list.set(data.filter((w) => w._hidden !== true));
|
|
253
|
+
});
|
|
254
|
+
this.router.events.pipe(takeUntilDestroyed()).subscribe(e => {
|
|
255
|
+
if (e instanceof NavigationEnd) {
|
|
256
|
+
this.openByUrl(e.urlAfterRedirects);
|
|
257
|
+
this.underPad();
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
this.settings.notify
|
|
261
|
+
.pipe(takeUntilDestroyed(), filter(t => t.type === 'layout' && t.name === 'collapsed'))
|
|
262
|
+
.subscribe(() => this.clearFloating());
|
|
263
|
+
afterNextRender(() => {
|
|
264
|
+
this.underPad();
|
|
265
|
+
this.openByUrl(this.router.url);
|
|
266
|
+
this.genFloating();
|
|
267
|
+
});
|
|
268
|
+
}
|
|
159
269
|
getLinkNode(node) {
|
|
160
270
|
node = node.nodeName === 'A' ? node : node.parentNode;
|
|
161
271
|
return node.nodeName !== 'A' ? null : node;
|
|
@@ -172,7 +282,7 @@ class LayoutDefaultNavComponent {
|
|
|
172
282
|
return false;
|
|
173
283
|
}
|
|
174
284
|
let item;
|
|
175
|
-
this.menuSrv.visit(this.list, (i) => {
|
|
285
|
+
this.menuSrv.visit(this.list(), (i) => {
|
|
176
286
|
if (!item && i._id === id) {
|
|
177
287
|
item = i;
|
|
178
288
|
}
|
|
@@ -255,7 +365,7 @@ class LayoutDefaultNavComponent {
|
|
|
255
365
|
}
|
|
256
366
|
return;
|
|
257
367
|
}
|
|
258
|
-
this.
|
|
368
|
+
this.router.navigateByUrl(item.link);
|
|
259
369
|
}
|
|
260
370
|
toggleOpen(item) {
|
|
261
371
|
this.menuSrv.toggleOpen(item);
|
|
@@ -273,46 +383,7 @@ class LayoutDefaultNavComponent {
|
|
|
273
383
|
}
|
|
274
384
|
openByUrl(url) {
|
|
275
385
|
const { menuSrv, recursivePath } = this;
|
|
276
|
-
this.menuSrv.open(menuSrv.find({ url, recursive: recursivePath }));
|
|
277
|
-
}
|
|
278
|
-
ngOnInit() {
|
|
279
|
-
const { doc, router, menuSrv, settings, cdr } = this;
|
|
280
|
-
this.bodyEl = doc.querySelector('body');
|
|
281
|
-
menuSrv.change.pipe(takeUntilDestroyed(this.destroy$)).subscribe(data => {
|
|
282
|
-
menuSrv.visit(data, (i, _p, depth) => {
|
|
283
|
-
i._text = this.sanitizer.bypassSecurityTrustHtml(i.text);
|
|
284
|
-
i._needIcon = depth <= this.maxLevelIcon && !!i.icon;
|
|
285
|
-
if (!i._aclResult) {
|
|
286
|
-
if (this.disabledAcl) {
|
|
287
|
-
i.disabled = true;
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
i._hidden = true;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
const icon = i.icon;
|
|
294
|
-
if (icon && icon.type === 'svg' && typeof icon.value === 'string') {
|
|
295
|
-
icon.value = this.sanitizer.bypassSecurityTrustHtml(icon.value);
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
if (this.hideEmptyChildren)
|
|
299
|
-
this.fixHide(data);
|
|
300
|
-
this.list = data.filter((w) => w._hidden !== true);
|
|
301
|
-
cdr.detectChanges();
|
|
302
|
-
});
|
|
303
|
-
router.events.pipe(takeUntilDestroyed(this.destroy$)).subscribe(e => {
|
|
304
|
-
if (e instanceof NavigationEnd) {
|
|
305
|
-
this.openByUrl(e.urlAfterRedirects);
|
|
306
|
-
this.underPad();
|
|
307
|
-
this.cdr.detectChanges();
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
settings.notify
|
|
311
|
-
.pipe(takeUntilDestroyed(this.destroy$), filter(t => t.type === 'layout' && t.name === 'collapsed'))
|
|
312
|
-
.subscribe(() => this.clearFloating());
|
|
313
|
-
this.underPad();
|
|
314
|
-
this.openByUrl(router.url);
|
|
315
|
-
this.ngZone.runOutsideAngular(() => this.genFloating());
|
|
386
|
+
this.menuSrv.open(menuSrv.find({ url, recursive: recursivePath() }));
|
|
316
387
|
}
|
|
317
388
|
fixHide(ls) {
|
|
318
389
|
const inFn = (list) => {
|
|
@@ -327,238 +398,282 @@ class LayoutDefaultNavComponent {
|
|
|
327
398
|
};
|
|
328
399
|
inFn(ls);
|
|
329
400
|
}
|
|
330
|
-
ngOnDestroy() {
|
|
331
|
-
this.clearFloating();
|
|
332
|
-
}
|
|
333
401
|
// #region Under pad
|
|
334
402
|
get isPad() {
|
|
335
403
|
return this.doc.defaultView.innerWidth < 768;
|
|
336
404
|
}
|
|
337
405
|
underPad() {
|
|
338
|
-
if (this.autoCloseUnderPad && this.isPad && !this.collapsed) {
|
|
406
|
+
if (this.autoCloseUnderPad() && this.isPad && !this.collapsed) {
|
|
339
407
|
setTimeout(() => this.openAside(true));
|
|
340
408
|
}
|
|
341
409
|
}
|
|
342
410
|
openAside(status) {
|
|
343
411
|
this.settings.setLayout('collapsed', status);
|
|
344
412
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
__decorate([
|
|
349
|
-
ZoneOutside()
|
|
350
|
-
], LayoutDefaultNavComponent.prototype, "showSubMenu", null);
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: LayoutDefaultNavComponent, decorators: [{
|
|
352
|
-
type: Component,
|
|
353
|
-
args: [{ selector: 'layout-default-nav', host: {
|
|
354
|
-
'(click)': '_click()',
|
|
355
|
-
'(document:click)': 'closeSubMenu()',
|
|
356
|
-
'[class.d-block]': `true`
|
|
357
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-template #icon let-i>\n @if (i) {\n @switch (i.type) {\n @case ('icon') {\n <nz-icon\n class=\"sidebar-nav__item-icon\"\n [nzType]=\"i.value\"\n [nzTheme]=\"i.theme\"\n [nzSpin]=\"i.spin\"\n [nzTwotoneColor]=\"i.twoToneColor\"\n [nzIconfont]=\"i.iconfont\"\n [nzRotate]=\"i.rotate\"\n />\n }\n @case ('iconfont') {\n <nz-icon class=\"sidebar-nav__item-icon\" [nzIconfont]=\"i.iconfont\" />\n }\n @case ('img') {\n <img [src]=\"i.value\" class=\"sidebar-nav__item-icon sidebar-nav__item-img\" />\n }\n @case ('svg') {\n <span class=\"sidebar-nav__item-icon sidebar-nav__item-svg\" [innerHTML]=\"i.value\"></span>\n }\n @default {\n <i class=\"sidebar-nav__item-icon {{ i.value }}\"></i>\n }\n }\n }\n</ng-template>\n<ng-template #tree let-ls>\n @for (i of ls; track $index) {\n @if (i._hidden !== true) {\n @if (i.render_type === 'divider') {\n <li class=\"sidebar-nav__divider\"></li>\n }@else {\n <li class=\"sidebar-nav__item\" [class.sidebar-nav__selected]=\"i._selected\" [class.sidebar-nav__open]=\"i.open\">\n <!-- link -->\n @if (i.children.length === 0) {\n <a\n (click)=\"to(i)\"\n [attr.data-id]=\"i._id\"\n class=\"sidebar-nav__item-link\"\n [class.sidebar-nav__item-disabled]=\"i.disabled\"\n (mouseenter)=\"closeSubMenu()\"\n >\n @if (i._needIcon) {\n @if (collapsed) {\n <span nz-tooltip nzTooltipPlacement=\"right\" [nzTooltipTitle]=\"i.text\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\" />\n </span>\n } @else {\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\" />\n }\n }\n <span class=\"sidebar-nav__item-text\" [innerHTML]=\"i._text\" [attr.title]=\"i.text\"></span>\n </a>\n }\n <!-- has children link -->\n @if (i.children.length > 0) {\n <a (click)=\"toggleOpen(i)\" (mouseenter)=\"showSubMenu($event, i)\" class=\"sidebar-nav__item-link\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\" />\n <span class=\"sidebar-nav__item-text\" [innerHTML]=\"i._text\" [attr.title]=\"i.text\"></span>\n <i class=\"sidebar-nav__sub-arrow\"></i>\n </a>\n }\n <!-- badge -->\n @if (i.badge) {\n <nz-badge\n [nzCount]=\"i.badge\"\n [nzDot]=\"i.badgeDot\"\n nzStandalone\n [nzOverflowCount]=\"i.badgeOverflowCount ? i.badgeOverflowCount : 9\"\n />\n }\n @if (i.children.length > 0) {\n <ul class=\"sidebar-nav sidebar-nav__sub sidebar-nav__depth{{ i._depth }}\">\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: i.children }\" />\n </ul>\n }\n </li>\n }\n }\n }\n</ng-template>\n<ul class=\"sidebar-nav\">\n @for (group of list; track $index) {\n @if (group.group) {\n <li class=\"sidebar-nav__item sidebar-nav__group-title\">\n <span [innerHTML]=\"group._text\"></span>\n </li>\n }\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: group.children }\" />\n }\n</ul>\n" }]
|
|
358
|
-
}], propDecorators: { disabledAcl: [{
|
|
359
|
-
type: Input,
|
|
360
|
-
args: [{ transform: booleanAttribute }]
|
|
361
|
-
}], autoCloseUnderPad: [{
|
|
362
|
-
type: Input,
|
|
363
|
-
args: [{ transform: booleanAttribute }]
|
|
364
|
-
}], recursivePath: [{
|
|
365
|
-
type: Input,
|
|
366
|
-
args: [{ transform: booleanAttribute }]
|
|
367
|
-
}], hideEmptyChildren: [{
|
|
368
|
-
type: Input,
|
|
369
|
-
args: [{ transform: booleanAttribute }]
|
|
370
|
-
}], openStrictly: [{
|
|
371
|
-
type: Input,
|
|
372
|
-
args: [{ transform: booleanAttribute }]
|
|
373
|
-
}], maxLevelIcon: [{
|
|
374
|
-
type: Input,
|
|
375
|
-
args: [{ transform: numberAttribute }]
|
|
376
|
-
}], select: [{
|
|
377
|
-
type: Output
|
|
378
|
-
}], showSubMenu: [] } });
|
|
379
|
-
|
|
380
|
-
class LayoutDefaultHeaderComponent {
|
|
381
|
-
settings = inject(SettingsService);
|
|
382
|
-
srv = inject(LayoutDefaultService);
|
|
383
|
-
cdr = inject(ChangeDetectorRef);
|
|
384
|
-
destroy$ = inject(DestroyRef);
|
|
385
|
-
items;
|
|
386
|
-
left = [];
|
|
387
|
-
middle = [];
|
|
388
|
-
right = [];
|
|
389
|
-
get opt() {
|
|
390
|
-
return this.srv.options;
|
|
391
|
-
}
|
|
392
|
-
get app() {
|
|
393
|
-
return this.settings.app;
|
|
394
|
-
}
|
|
395
|
-
get collapsed() {
|
|
396
|
-
return this.settings.layout.collapsed;
|
|
397
|
-
}
|
|
398
|
-
get collapsedIcon() {
|
|
399
|
-
return this.srv.collapsedIcon;
|
|
400
|
-
}
|
|
401
|
-
refresh() {
|
|
402
|
-
const arr = this.items.toArray();
|
|
403
|
-
this.left = arr.filter(i => i.direction === 'left');
|
|
404
|
-
this.middle = arr.filter(i => i.direction === 'middle');
|
|
405
|
-
this.right = arr.filter(i => i.direction === 'right');
|
|
406
|
-
this.cdr.detectChanges();
|
|
407
|
-
}
|
|
408
|
-
ngAfterViewInit() {
|
|
409
|
-
this.items.changes.pipe(takeUntilDestroyed(this.destroy$)).subscribe(() => this.refresh());
|
|
410
|
-
this.srv.options$.pipe(takeUntilDestroyed(this.destroy$)).subscribe(() => this.cdr.detectChanges());
|
|
411
|
-
this.refresh();
|
|
412
|
-
}
|
|
413
|
-
toggleCollapsed() {
|
|
414
|
-
this.srv.toggleCollapsed();
|
|
413
|
+
// #endregion
|
|
414
|
+
ngOnDestroy() {
|
|
415
|
+
this.clearFloating();
|
|
415
416
|
}
|
|
416
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
417
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
418
|
-
<ng-template #
|
|
419
|
-
@
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
417
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: LayoutDefaultNavComponent, isStandalone: true, selector: "layout-default-nav", inputs: { disabledAcl: { classPropertyName: "disabledAcl", publicName: "disabledAcl", isSignal: true, isRequired: false, transformFunction: null }, autoCloseUnderPad: { classPropertyName: "autoCloseUnderPad", publicName: "autoCloseUnderPad", isSignal: true, isRequired: false, transformFunction: null }, recursivePath: { classPropertyName: "recursivePath", publicName: "recursivePath", isSignal: true, isRequired: false, transformFunction: null }, hideEmptyChildren: { classPropertyName: "hideEmptyChildren", publicName: "hideEmptyChildren", isSignal: true, isRequired: false, transformFunction: null }, openStrictly: { classPropertyName: "openStrictly", publicName: "openStrictly", isSignal: true, isRequired: false, transformFunction: null }, maxLevelIcon: { classPropertyName: "maxLevelIcon", publicName: "maxLevelIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select" }, host: { listeners: { "click": "_click()", "document:click": "closeSubMenu()" }, classAttribute: "d-block" }, ngImport: i0, template: `
|
|
419
|
+
<ng-template #icon let-i>
|
|
420
|
+
@if (i) {
|
|
421
|
+
@switch (i.type) {
|
|
422
|
+
@case ('icon') {
|
|
423
|
+
<nz-icon
|
|
424
|
+
class="sidebar-nav__item-icon"
|
|
425
|
+
[nzType]="i.value"
|
|
426
|
+
[nzTheme]="i.theme"
|
|
427
|
+
[nzSpin]="i.spin"
|
|
428
|
+
[nzTwotoneColor]="i.twoToneColor"
|
|
429
|
+
[nzIconfont]="i.iconfont"
|
|
430
|
+
[nzRotate]="i.rotate"
|
|
431
|
+
/>
|
|
432
|
+
}
|
|
433
|
+
@case ('iconfont') {
|
|
434
|
+
<nz-icon class="sidebar-nav__item-icon" [nzIconfont]="i.iconfont" />
|
|
435
|
+
}
|
|
436
|
+
@case ('img') {
|
|
437
|
+
<img [src]="i.value" class="sidebar-nav__item-icon sidebar-nav__item-img" />
|
|
438
|
+
}
|
|
439
|
+
@case ('svg') {
|
|
440
|
+
<span class="sidebar-nav__item-icon sidebar-nav__item-svg" [innerHTML]="i.value"></span>
|
|
441
|
+
}
|
|
442
|
+
@default {
|
|
443
|
+
<i class="sidebar-nav__item-icon {{ i.value }}"></i>
|
|
444
|
+
}
|
|
445
|
+
}
|
|
423
446
|
}
|
|
424
447
|
</ng-template>
|
|
425
|
-
<
|
|
426
|
-
@
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
448
|
+
<ng-template #tree let-ls>
|
|
449
|
+
@for (i of ls; track $index) {
|
|
450
|
+
@if (i._hidden !== true) {
|
|
451
|
+
@if (i.render_type === 'divider') {
|
|
452
|
+
<li class="sidebar-nav__divider"></li>
|
|
453
|
+
} @else {
|
|
454
|
+
<li
|
|
455
|
+
class="sidebar-nav__item"
|
|
456
|
+
[class.sidebar-nav__selected]="i._selected"
|
|
457
|
+
[class.sidebar-nav__open]="i.open"
|
|
458
|
+
>
|
|
459
|
+
<!-- link -->
|
|
460
|
+
@if (i.children.length === 0) {
|
|
461
|
+
<a
|
|
462
|
+
(click)="to(i)"
|
|
463
|
+
[attr.data-id]="i._id"
|
|
464
|
+
class="sidebar-nav__item-link"
|
|
465
|
+
[class.sidebar-nav__item-disabled]="i.disabled"
|
|
466
|
+
(mouseenter)="closeSubMenu()"
|
|
467
|
+
>
|
|
468
|
+
@if (i._needIcon) {
|
|
469
|
+
@if (collapsed) {
|
|
470
|
+
<span nz-tooltip nzTooltipPlacement="right" [nzTooltipTitle]="i.text">
|
|
471
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
472
|
+
</span>
|
|
473
|
+
} @else {
|
|
474
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
<span class="sidebar-nav__item-text" [innerHTML]="i._text" [attr.title]="i.text"></span>
|
|
478
|
+
</a>
|
|
479
|
+
}
|
|
480
|
+
<!-- has children link -->
|
|
481
|
+
@if (i.children.length > 0) {
|
|
482
|
+
<a (click)="toggleOpen(i)" (mouseenter)="showSubMenu($event, i)" class="sidebar-nav__item-link">
|
|
483
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
484
|
+
<span class="sidebar-nav__item-text" [innerHTML]="i._text" [attr.title]="i.text"></span>
|
|
485
|
+
<i class="sidebar-nav__sub-arrow"></i>
|
|
486
|
+
</a>
|
|
487
|
+
}
|
|
488
|
+
<!-- badge -->
|
|
489
|
+
@if (i.badge) {
|
|
490
|
+
<nz-badge
|
|
491
|
+
[nzCount]="i.badge"
|
|
492
|
+
[nzDot]="i.badgeDot"
|
|
493
|
+
nzStandalone
|
|
494
|
+
[nzOverflowCount]="i.badgeOverflowCount ? i.badgeOverflowCount : 9"
|
|
495
|
+
/>
|
|
496
|
+
}
|
|
497
|
+
@if (i.children.length > 0) {
|
|
498
|
+
<ul class="sidebar-nav sidebar-nav__sub sidebar-nav__depth{{ i._depth }}">
|
|
499
|
+
<ng-template [ngTemplateOutlet]="tree" [ngTemplateOutletContext]="{ $implicit: i.children }" />
|
|
500
|
+
</ul>
|
|
501
|
+
}
|
|
502
|
+
</li>
|
|
503
|
+
}
|
|
504
|
+
}
|
|
433
505
|
}
|
|
434
|
-
</
|
|
435
|
-
<
|
|
436
|
-
|
|
437
|
-
@if (
|
|
438
|
-
<li>
|
|
439
|
-
<
|
|
440
|
-
<nz-icon [nzType]="collapsedIcon" />
|
|
441
|
-
</div>
|
|
506
|
+
</ng-template>
|
|
507
|
+
<ul class="sidebar-nav">
|
|
508
|
+
@for (group of list(); track $index) {
|
|
509
|
+
@if (group.group) {
|
|
510
|
+
<li class="sidebar-nav__item sidebar-nav__group-title">
|
|
511
|
+
<span [innerHTML]="group._text"></span>
|
|
442
512
|
</li>
|
|
443
513
|
}
|
|
444
|
-
<ng-template [ngTemplateOutlet]="
|
|
445
|
-
</ul>
|
|
446
|
-
@if (middle.length > 0) {
|
|
447
|
-
<div class="alain-default__nav alain-default__nav-middle">
|
|
448
|
-
<ng-container *ngTemplateOutlet="middle[0].host" />
|
|
449
|
-
</div>
|
|
514
|
+
<ng-template [ngTemplateOutlet]="tree" [ngTemplateOutletContext]="{ $implicit: group.children }" />
|
|
450
515
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
</ul>
|
|
454
|
-
</div>
|
|
455
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
516
|
+
</ul>
|
|
517
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "component", type: NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
456
518
|
}
|
|
457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultNavComponent, decorators: [{
|
|
458
520
|
type: Component,
|
|
459
521
|
args: [{
|
|
460
|
-
selector: 'layout-default-
|
|
522
|
+
selector: 'layout-default-nav',
|
|
461
523
|
template: `
|
|
462
|
-
<ng-template #
|
|
463
|
-
@
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
524
|
+
<ng-template #icon let-i>
|
|
525
|
+
@if (i) {
|
|
526
|
+
@switch (i.type) {
|
|
527
|
+
@case ('icon') {
|
|
528
|
+
<nz-icon
|
|
529
|
+
class="sidebar-nav__item-icon"
|
|
530
|
+
[nzType]="i.value"
|
|
531
|
+
[nzTheme]="i.theme"
|
|
532
|
+
[nzSpin]="i.spin"
|
|
533
|
+
[nzTwotoneColor]="i.twoToneColor"
|
|
534
|
+
[nzIconfont]="i.iconfont"
|
|
535
|
+
[nzRotate]="i.rotate"
|
|
536
|
+
/>
|
|
537
|
+
}
|
|
538
|
+
@case ('iconfont') {
|
|
539
|
+
<nz-icon class="sidebar-nav__item-icon" [nzIconfont]="i.iconfont" />
|
|
540
|
+
}
|
|
541
|
+
@case ('img') {
|
|
542
|
+
<img [src]="i.value" class="sidebar-nav__item-icon sidebar-nav__item-img" />
|
|
543
|
+
}
|
|
544
|
+
@case ('svg') {
|
|
545
|
+
<span class="sidebar-nav__item-icon sidebar-nav__item-svg" [innerHTML]="i.value"></span>
|
|
546
|
+
}
|
|
547
|
+
@default {
|
|
548
|
+
<i class="sidebar-nav__item-icon {{ i.value }}"></i>
|
|
549
|
+
}
|
|
550
|
+
}
|
|
467
551
|
}
|
|
468
552
|
</ng-template>
|
|
469
|
-
<
|
|
470
|
-
@
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
553
|
+
<ng-template #tree let-ls>
|
|
554
|
+
@for (i of ls; track $index) {
|
|
555
|
+
@if (i._hidden !== true) {
|
|
556
|
+
@if (i.render_type === 'divider') {
|
|
557
|
+
<li class="sidebar-nav__divider"></li>
|
|
558
|
+
} @else {
|
|
559
|
+
<li
|
|
560
|
+
class="sidebar-nav__item"
|
|
561
|
+
[class.sidebar-nav__selected]="i._selected"
|
|
562
|
+
[class.sidebar-nav__open]="i.open"
|
|
563
|
+
>
|
|
564
|
+
<!-- link -->
|
|
565
|
+
@if (i.children.length === 0) {
|
|
566
|
+
<a
|
|
567
|
+
(click)="to(i)"
|
|
568
|
+
[attr.data-id]="i._id"
|
|
569
|
+
class="sidebar-nav__item-link"
|
|
570
|
+
[class.sidebar-nav__item-disabled]="i.disabled"
|
|
571
|
+
(mouseenter)="closeSubMenu()"
|
|
572
|
+
>
|
|
573
|
+
@if (i._needIcon) {
|
|
574
|
+
@if (collapsed) {
|
|
575
|
+
<span nz-tooltip nzTooltipPlacement="right" [nzTooltipTitle]="i.text">
|
|
576
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
577
|
+
</span>
|
|
578
|
+
} @else {
|
|
579
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
<span class="sidebar-nav__item-text" [innerHTML]="i._text" [attr.title]="i.text"></span>
|
|
583
|
+
</a>
|
|
584
|
+
}
|
|
585
|
+
<!-- has children link -->
|
|
586
|
+
@if (i.children.length > 0) {
|
|
587
|
+
<a (click)="toggleOpen(i)" (mouseenter)="showSubMenu($event, i)" class="sidebar-nav__item-link">
|
|
588
|
+
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.icon }" />
|
|
589
|
+
<span class="sidebar-nav__item-text" [innerHTML]="i._text" [attr.title]="i.text"></span>
|
|
590
|
+
<i class="sidebar-nav__sub-arrow"></i>
|
|
591
|
+
</a>
|
|
592
|
+
}
|
|
593
|
+
<!-- badge -->
|
|
594
|
+
@if (i.badge) {
|
|
595
|
+
<nz-badge
|
|
596
|
+
[nzCount]="i.badge"
|
|
597
|
+
[nzDot]="i.badgeDot"
|
|
598
|
+
nzStandalone
|
|
599
|
+
[nzOverflowCount]="i.badgeOverflowCount ? i.badgeOverflowCount : 9"
|
|
600
|
+
/>
|
|
601
|
+
}
|
|
602
|
+
@if (i.children.length > 0) {
|
|
603
|
+
<ul class="sidebar-nav sidebar-nav__sub sidebar-nav__depth{{ i._depth }}">
|
|
604
|
+
<ng-template [ngTemplateOutlet]="tree" [ngTemplateOutletContext]="{ $implicit: i.children }" />
|
|
605
|
+
</ul>
|
|
606
|
+
}
|
|
607
|
+
</li>
|
|
608
|
+
}
|
|
609
|
+
}
|
|
477
610
|
}
|
|
478
|
-
</
|
|
479
|
-
<
|
|
480
|
-
|
|
481
|
-
@if (
|
|
482
|
-
<li>
|
|
483
|
-
<
|
|
484
|
-
<nz-icon [nzType]="collapsedIcon" />
|
|
485
|
-
</div>
|
|
611
|
+
</ng-template>
|
|
612
|
+
<ul class="sidebar-nav">
|
|
613
|
+
@for (group of list(); track $index) {
|
|
614
|
+
@if (group.group) {
|
|
615
|
+
<li class="sidebar-nav__item sidebar-nav__group-title">
|
|
616
|
+
<span [innerHTML]="group._text"></span>
|
|
486
617
|
</li>
|
|
487
618
|
}
|
|
488
|
-
<ng-template [ngTemplateOutlet]="
|
|
489
|
-
</ul>
|
|
490
|
-
@if (middle.length > 0) {
|
|
491
|
-
<div class="alain-default__nav alain-default__nav-middle">
|
|
492
|
-
<ng-container *ngTemplateOutlet="middle[0].host" />
|
|
493
|
-
</div>
|
|
619
|
+
<ng-template [ngTemplateOutlet]="tree" [ngTemplateOutletContext]="{ $implicit: group.children }" />
|
|
494
620
|
}
|
|
495
|
-
|
|
496
|
-
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: right }" />
|
|
497
|
-
</ul>
|
|
498
|
-
</div>
|
|
621
|
+
</ul>
|
|
499
622
|
`,
|
|
500
623
|
host: {
|
|
501
|
-
'
|
|
624
|
+
class: 'd-block',
|
|
625
|
+
'(click)': '_click()',
|
|
626
|
+
'(document:click)': 'closeSubMenu()'
|
|
502
627
|
},
|
|
628
|
+
imports: [NgTemplateOutlet, NzIconDirective, NzTooltipDirective, NzBadgeComponent],
|
|
503
629
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
504
|
-
|
|
505
|
-
standalone: false
|
|
630
|
+
encapsulation: ViewEncapsulation.None
|
|
506
631
|
}]
|
|
507
|
-
}], propDecorators: {
|
|
508
|
-
type: Input
|
|
509
|
-
}] } });
|
|
632
|
+
}], ctorParameters: () => [], propDecorators: { disabledAcl: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledAcl", required: false }] }], autoCloseUnderPad: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseUnderPad", required: false }] }], recursivePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "recursivePath", required: false }] }], hideEmptyChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideEmptyChildren", required: false }] }], openStrictly: [{ type: i0.Input, args: [{ isSignal: true, alias: "openStrictly", required: false }] }], maxLevelIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLevelIcon", required: false }] }], select: [{ type: i0.Output, args: ["select"] }] } });
|
|
510
633
|
|
|
511
634
|
class LayoutDefaultComponent {
|
|
512
|
-
headerItems;
|
|
513
|
-
get opt() {
|
|
514
|
-
return this.srv.options;
|
|
515
|
-
}
|
|
516
|
-
set options(value) {
|
|
517
|
-
this.srv.setOptions(value);
|
|
518
|
-
}
|
|
519
|
-
asideUser = null;
|
|
520
|
-
asideBottom = null;
|
|
521
|
-
nav = null;
|
|
522
|
-
content = null;
|
|
523
|
-
customError;
|
|
524
|
-
fetchingStrictly = false;
|
|
525
|
-
fetching = false;
|
|
526
|
-
isFetching = false;
|
|
527
|
-
get showFetching() {
|
|
528
|
-
if (this.fetchingStrictly)
|
|
529
|
-
return this.fetching;
|
|
530
|
-
return this.isFetching;
|
|
531
|
-
}
|
|
532
|
-
get collapsed() {
|
|
533
|
-
return this.settings.layout.collapsed;
|
|
534
|
-
}
|
|
535
|
-
get collapsedIcon() {
|
|
536
|
-
return this.srv.collapsedIcon;
|
|
537
|
-
}
|
|
538
|
-
toggleCollapsed() {
|
|
539
|
-
this.srv.toggleCollapsed();
|
|
540
|
-
}
|
|
541
635
|
router = inject(Router);
|
|
542
636
|
msgSrv = inject(NzMessageService);
|
|
543
637
|
settings = inject(SettingsService);
|
|
544
|
-
el = inject(ElementRef);
|
|
545
|
-
renderer = inject(Renderer2);
|
|
546
638
|
doc = inject(DOCUMENT);
|
|
547
639
|
srv = inject(LayoutDefaultService);
|
|
640
|
+
headerItems = contentChildren(LayoutDefaultHeaderItemComponent, { ...(ngDevMode ? { debugName: "headerItems" } : {}), descendants: false });
|
|
641
|
+
opt = this.srv.options;
|
|
642
|
+
layout = this.settings.layoutSignal;
|
|
643
|
+
options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : []));
|
|
644
|
+
asideUser = input(...(ngDevMode ? [undefined, { debugName: "asideUser" }] : []));
|
|
645
|
+
asideBottom = input(...(ngDevMode ? [undefined, { debugName: "asideBottom" }] : []));
|
|
646
|
+
nav = input(...(ngDevMode ? [undefined, { debugName: "nav" }] : []));
|
|
647
|
+
content = input(...(ngDevMode ? [undefined, { debugName: "content" }] : []));
|
|
648
|
+
customError = input(...(ngDevMode ? [undefined, { debugName: "customError" }] : []));
|
|
649
|
+
fetchingStrictly = input(false, { ...(ngDevMode ? { debugName: "fetchingStrictly" } : {}), transform: booleanAttribute });
|
|
650
|
+
fetching = input(false, { ...(ngDevMode ? { debugName: "fetching" } : {}), transform: booleanAttribute });
|
|
651
|
+
isFetching = signal(false, ...(ngDevMode ? [{ debugName: "isFetching" }] : []));
|
|
652
|
+
showFetching = computed(() => {
|
|
653
|
+
if (this.fetchingStrictly())
|
|
654
|
+
return this.fetching();
|
|
655
|
+
return this.isFetching();
|
|
656
|
+
}, ...(ngDevMode ? [{ debugName: "showFetching" }] : []));
|
|
548
657
|
constructor() {
|
|
549
658
|
this.router.events
|
|
550
|
-
.pipe(takeUntilDestroyed(), filter(() => !this.fetchingStrictly))
|
|
659
|
+
.pipe(takeUntilDestroyed(), filter(() => !this.fetchingStrictly()))
|
|
551
660
|
.subscribe(ev => this.processEv(ev));
|
|
552
|
-
|
|
553
|
-
|
|
661
|
+
effect(() => {
|
|
662
|
+
const opt = this.options();
|
|
663
|
+
this.srv.setOptions(opt);
|
|
664
|
+
});
|
|
665
|
+
effect(() => {
|
|
666
|
+
this.doc.body.classList[this.layout().colorWeak ? 'add' : 'remove']('color-weak');
|
|
667
|
+
});
|
|
554
668
|
}
|
|
555
669
|
processEv(ev) {
|
|
556
|
-
if (!this.isFetching && ev instanceof RouteConfigLoadStart) {
|
|
557
|
-
this.isFetching
|
|
670
|
+
if (!this.isFetching() && ev instanceof RouteConfigLoadStart) {
|
|
671
|
+
this.isFetching.set(true);
|
|
558
672
|
}
|
|
559
673
|
if (ev instanceof NavigationError || ev instanceof NavigationCancel) {
|
|
560
|
-
this.isFetching
|
|
561
|
-
const
|
|
674
|
+
this.isFetching.set(false);
|
|
675
|
+
const customError = this.customError();
|
|
676
|
+
const err = customError === null ? null : (customError ?? `Could not load ${ev.url} route`);
|
|
562
677
|
if (err && ev instanceof NavigationError) {
|
|
563
678
|
this.msgSrv.error(err, { nzDuration: 1000 * 3 });
|
|
564
679
|
}
|
|
@@ -567,49 +682,38 @@ class LayoutDefaultComponent {
|
|
|
567
682
|
if (!(ev instanceof NavigationEnd || ev instanceof RouteConfigLoadEnd)) {
|
|
568
683
|
return;
|
|
569
684
|
}
|
|
570
|
-
if (this.isFetching) {
|
|
685
|
+
if (this.isFetching()) {
|
|
571
686
|
setTimeout(() => {
|
|
572
|
-
this.isFetching
|
|
687
|
+
this.isFetching.set(false);
|
|
573
688
|
}, 100);
|
|
574
689
|
}
|
|
575
690
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
['alain-default']: true,
|
|
581
|
-
[`alain-default__fixed`]: layout.fixed,
|
|
582
|
-
[`alain-default__collapsed`]: layout.collapsed,
|
|
583
|
-
[`alain-default__hide-aside`]: this.opt.hideAside,
|
|
584
|
-
[`alain-default__hide-header`]: this.opt.hideHeader
|
|
585
|
-
});
|
|
586
|
-
doc.body.classList[layout.colorWeak ? 'add' : 'remove']('color-weak');
|
|
587
|
-
}
|
|
588
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: LayoutDefaultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
589
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: LayoutDefaultComponent, isStandalone: false, selector: "layout-default", inputs: { options: "options", asideUser: "asideUser", asideBottom: "asideBottom", nav: "nav", content: "content", customError: "customError", fetchingStrictly: ["fetchingStrictly", "fetchingStrictly", booleanAttribute], fetching: ["fetching", "fetching", booleanAttribute] }, queries: [{ propertyName: "headerItems", predicate: LayoutDefaultHeaderItemComponent }], exportAs: ["layoutDefault"], ngImport: i0, template: `
|
|
590
|
-
@if (showFetching) {
|
|
691
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
692
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: LayoutDefaultComponent, isStandalone: true, selector: "layout-default", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, asideUser: { classPropertyName: "asideUser", publicName: "asideUser", isSignal: true, isRequired: false, transformFunction: null }, asideBottom: { classPropertyName: "asideBottom", publicName: "asideBottom", isSignal: true, isRequired: false, transformFunction: null }, nav: { classPropertyName: "nav", publicName: "nav", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, customError: { classPropertyName: "customError", publicName: "customError", isSignal: true, isRequired: false, transformFunction: null }, fetchingStrictly: { classPropertyName: "fetchingStrictly", publicName: "fetchingStrictly", isSignal: true, isRequired: false, transformFunction: null }, fetching: { classPropertyName: "fetching", publicName: "fetching", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.alain-default__fixed": "layout().fixed", "class.alain-default__collapsed": "layout().collapsed", "class.alain-default__hide-aside": "opt().hideAside", "class.alain-default__hide-header": "opt().hideHeader" }, classAttribute: "alain-default" }, queries: [{ propertyName: "headerItems", predicate: LayoutDefaultHeaderItemComponent, isSignal: true }], exportAs: ["layoutDefault"], ngImport: i0, template: `
|
|
693
|
+
@let _opt = opt();
|
|
694
|
+
@if (showFetching()) {
|
|
591
695
|
<div class="alain-default__progress-bar"></div>
|
|
592
696
|
}
|
|
593
|
-
@if (!
|
|
594
|
-
<layout-default-header [items]="headerItems" />
|
|
697
|
+
@if (!_opt.hideHeader) {
|
|
698
|
+
<layout-default-header [items]="headerItems()" />
|
|
595
699
|
}
|
|
596
|
-
@if (!
|
|
700
|
+
@if (!_opt.hideAside) {
|
|
597
701
|
<div class="alain-default__aside">
|
|
598
702
|
<div class="alain-default__aside-wrap">
|
|
599
703
|
<div class="alain-default__aside-inner">
|
|
600
|
-
<ng-container *ngTemplateOutlet="asideUser" />
|
|
601
|
-
<ng-container *ngTemplateOutlet="nav" />
|
|
602
|
-
@if (!nav) {
|
|
704
|
+
<ng-container *ngTemplateOutlet="asideUser()" />
|
|
705
|
+
<ng-container *ngTemplateOutlet="nav()" />
|
|
706
|
+
@if (!nav()) {
|
|
603
707
|
<layout-default-nav />
|
|
604
708
|
}
|
|
605
709
|
</div>
|
|
606
|
-
@if (
|
|
710
|
+
@if (_opt.showSiderCollapse) {
|
|
607
711
|
<div class="alain-default__aside-link">
|
|
608
|
-
@if (asideBottom) {
|
|
609
|
-
<ng-container *ngTemplateOutlet="asideBottom" />
|
|
712
|
+
@if (asideBottom()) {
|
|
713
|
+
<ng-container *ngTemplateOutlet="asideBottom()" />
|
|
610
714
|
} @else {
|
|
611
|
-
<div class="alain-default__aside-link-collapsed" (click)="toggleCollapsed()">
|
|
612
|
-
<nz-icon [nzType]="collapsedIcon" />
|
|
715
|
+
<div class="alain-default__aside-link-collapsed" (click)="srv.toggleCollapsed()">
|
|
716
|
+
<nz-icon [nzType]="srv.collapsedIcon()" />
|
|
613
717
|
</div>
|
|
614
718
|
}
|
|
615
719
|
</div>
|
|
@@ -618,40 +722,41 @@ class LayoutDefaultComponent {
|
|
|
618
722
|
</div>
|
|
619
723
|
}
|
|
620
724
|
<section class="alain-default__content">
|
|
621
|
-
<ng-container *ngTemplateOutlet="content" />
|
|
725
|
+
<ng-container *ngTemplateOutlet="content()" />
|
|
622
726
|
<ng-content />
|
|
623
727
|
</section>
|
|
624
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
728
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LayoutDefaultHeaderComponent, selector: "layout-default-header", inputs: ["items"] }, { kind: "component", type: LayoutDefaultNavComponent, selector: "layout-default-nav", inputs: ["disabledAcl", "autoCloseUnderPad", "recursivePath", "hideEmptyChildren", "openStrictly", "maxLevelIcon"], outputs: ["select"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }] });
|
|
625
729
|
}
|
|
626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultComponent, decorators: [{
|
|
627
731
|
type: Component,
|
|
628
732
|
args: [{
|
|
629
733
|
selector: 'layout-default',
|
|
630
734
|
exportAs: 'layoutDefault',
|
|
631
735
|
template: `
|
|
632
|
-
@
|
|
736
|
+
@let _opt = opt();
|
|
737
|
+
@if (showFetching()) {
|
|
633
738
|
<div class="alain-default__progress-bar"></div>
|
|
634
739
|
}
|
|
635
|
-
@if (!
|
|
636
|
-
<layout-default-header [items]="headerItems" />
|
|
740
|
+
@if (!_opt.hideHeader) {
|
|
741
|
+
<layout-default-header [items]="headerItems()" />
|
|
637
742
|
}
|
|
638
|
-
@if (!
|
|
743
|
+
@if (!_opt.hideAside) {
|
|
639
744
|
<div class="alain-default__aside">
|
|
640
745
|
<div class="alain-default__aside-wrap">
|
|
641
746
|
<div class="alain-default__aside-inner">
|
|
642
|
-
<ng-container *ngTemplateOutlet="asideUser" />
|
|
643
|
-
<ng-container *ngTemplateOutlet="nav" />
|
|
644
|
-
@if (!nav) {
|
|
747
|
+
<ng-container *ngTemplateOutlet="asideUser()" />
|
|
748
|
+
<ng-container *ngTemplateOutlet="nav()" />
|
|
749
|
+
@if (!nav()) {
|
|
645
750
|
<layout-default-nav />
|
|
646
751
|
}
|
|
647
752
|
</div>
|
|
648
|
-
@if (
|
|
753
|
+
@if (_opt.showSiderCollapse) {
|
|
649
754
|
<div class="alain-default__aside-link">
|
|
650
|
-
@if (asideBottom) {
|
|
651
|
-
<ng-container *ngTemplateOutlet="asideBottom" />
|
|
755
|
+
@if (asideBottom()) {
|
|
756
|
+
<ng-container *ngTemplateOutlet="asideBottom()" />
|
|
652
757
|
} @else {
|
|
653
|
-
<div class="alain-default__aside-link-collapsed" (click)="toggleCollapsed()">
|
|
654
|
-
<nz-icon [nzType]="collapsedIcon" />
|
|
758
|
+
<div class="alain-default__aside-link-collapsed" (click)="srv.toggleCollapsed()">
|
|
759
|
+
<nz-icon [nzType]="srv.collapsedIcon()" />
|
|
655
760
|
</div>
|
|
656
761
|
}
|
|
657
762
|
</div>
|
|
@@ -660,59 +765,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
660
765
|
</div>
|
|
661
766
|
}
|
|
662
767
|
<section class="alain-default__content">
|
|
663
|
-
<ng-container *ngTemplateOutlet="content" />
|
|
768
|
+
<ng-container *ngTemplateOutlet="content()" />
|
|
664
769
|
<ng-content />
|
|
665
770
|
</section>
|
|
666
771
|
`,
|
|
667
|
-
|
|
668
|
-
|
|
772
|
+
host: {
|
|
773
|
+
class: 'alain-default',
|
|
774
|
+
'[class.alain-default__fixed]': 'layout().fixed',
|
|
775
|
+
'[class.alain-default__collapsed]': 'layout().collapsed',
|
|
776
|
+
'[class.alain-default__hide-aside]': 'opt().hideAside',
|
|
777
|
+
'[class.alain-default__hide-header]': 'opt().hideHeader'
|
|
778
|
+
},
|
|
779
|
+
imports: [NgTemplateOutlet, LayoutDefaultHeaderComponent, LayoutDefaultNavComponent, NzIconDirective]
|
|
669
780
|
}]
|
|
670
|
-
}], ctorParameters: () => [], propDecorators: { headerItems: [{
|
|
671
|
-
type: ContentChildren,
|
|
672
|
-
args: [LayoutDefaultHeaderItemComponent, { descendants: false }]
|
|
673
|
-
}], options: [{
|
|
674
|
-
type: Input
|
|
675
|
-
}], asideUser: [{
|
|
676
|
-
type: Input
|
|
677
|
-
}], asideBottom: [{
|
|
678
|
-
type: Input
|
|
679
|
-
}], nav: [{
|
|
680
|
-
type: Input
|
|
681
|
-
}], content: [{
|
|
682
|
-
type: Input
|
|
683
|
-
}], customError: [{
|
|
684
|
-
type: Input
|
|
685
|
-
}], fetchingStrictly: [{
|
|
686
|
-
type: Input,
|
|
687
|
-
args: [{ transform: booleanAttribute }]
|
|
688
|
-
}], fetching: [{
|
|
689
|
-
type: Input,
|
|
690
|
-
args: [{ transform: booleanAttribute }]
|
|
691
|
-
}] } });
|
|
781
|
+
}], ctorParameters: () => [], propDecorators: { headerItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => LayoutDefaultHeaderItemComponent), { ...{ descendants: false }, isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], asideUser: [{ type: i0.Input, args: [{ isSignal: true, alias: "asideUser", required: false }] }], asideBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "asideBottom", required: false }] }], nav: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], customError: [{ type: i0.Input, args: [{ isSignal: true, alias: "customError", required: false }] }], fetchingStrictly: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetchingStrictly", required: false }] }], fetching: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetching", required: false }] }] } });
|
|
692
782
|
|
|
693
783
|
class LayoutDefaultHeaderItemTriggerDirective {
|
|
694
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
695
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
784
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderItemTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
785
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: LayoutDefaultHeaderItemTriggerDirective, isStandalone: true, selector: "[layout-default-header-item-trigger]", host: { classAttribute: "alain-default__nav-item" }, ngImport: i0 });
|
|
696
786
|
}
|
|
697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultHeaderItemTriggerDirective, decorators: [{
|
|
698
788
|
type: Directive,
|
|
699
789
|
args: [{
|
|
700
790
|
selector: '[layout-default-header-item-trigger]',
|
|
701
|
-
host: {
|
|
702
|
-
'[class.alain-default__nav-item]': `true`
|
|
703
|
-
},
|
|
704
|
-
// eslint-disable-next-line @angular-eslint/prefer-standalone
|
|
705
|
-
standalone: false
|
|
791
|
+
host: { class: 'alain-default__nav-item' }
|
|
706
792
|
}]
|
|
707
793
|
}] });
|
|
708
794
|
|
|
709
795
|
class LayoutDefaultTopMenuItemComponent {
|
|
710
|
-
selected = false;
|
|
711
|
-
disabled = false;
|
|
712
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
713
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
796
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : {}), transform: booleanAttribute });
|
|
797
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
798
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultTopMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
799
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: LayoutDefaultTopMenuItemComponent, isStandalone: true, selector: "layout-default-top-menu-item", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.alain-default__nav-item": "true", "class.alain-default__top-menu-item": "true", "class.alain-default__top-menu-item-selected": "selected()", "class.alain-default__top-menu-item-disabled": "disabled()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
714
800
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultTopMenuItemComponent, decorators: [{
|
|
716
802
|
type: Component,
|
|
717
803
|
args: [{
|
|
718
804
|
selector: 'layout-default-top-menu-item',
|
|
@@ -720,21 +806,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
720
806
|
host: {
|
|
721
807
|
'[class.alain-default__nav-item]': `true`,
|
|
722
808
|
'[class.alain-default__top-menu-item]': `true`,
|
|
723
|
-
'[class.alain-default__top-menu-item-selected]': `selected`,
|
|
724
|
-
'[class.alain-default__top-menu-item-disabled]': `disabled`
|
|
809
|
+
'[class.alain-default__top-menu-item-selected]': `selected()`,
|
|
810
|
+
'[class.alain-default__top-menu-item-disabled]': `disabled()`
|
|
725
811
|
},
|
|
726
812
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
727
|
-
encapsulation: ViewEncapsulation.None
|
|
728
|
-
// eslint-disable-next-line @angular-eslint/prefer-standalone
|
|
729
|
-
standalone: false
|
|
813
|
+
encapsulation: ViewEncapsulation.None
|
|
730
814
|
}]
|
|
731
|
-
}], propDecorators: { selected: [{
|
|
732
|
-
type: Input,
|
|
733
|
-
args: [{ transform: booleanAttribute }]
|
|
734
|
-
}], disabled: [{
|
|
735
|
-
type: Input,
|
|
736
|
-
args: [{ transform: booleanAttribute }]
|
|
737
|
-
}] } });
|
|
815
|
+
}], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
738
816
|
|
|
739
817
|
const COMPONENTS = [
|
|
740
818
|
LayoutDefaultComponent,
|
|
@@ -745,25 +823,46 @@ const COMPONENTS = [
|
|
|
745
823
|
LayoutDefaultTopMenuItemComponent
|
|
746
824
|
];
|
|
747
825
|
class LayoutDefaultModule {
|
|
748
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
749
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
826
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
827
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultModule, imports: [CommonModule,
|
|
828
|
+
RouterModule,
|
|
829
|
+
NzTooltipModule,
|
|
830
|
+
NzIconModule,
|
|
831
|
+
NzAvatarModule,
|
|
832
|
+
NzDropdownModule,
|
|
833
|
+
NzBadgeModule, LayoutDefaultComponent,
|
|
750
834
|
LayoutDefaultNavComponent,
|
|
751
835
|
LayoutDefaultHeaderComponent,
|
|
752
836
|
LayoutDefaultHeaderItemComponent,
|
|
753
837
|
LayoutDefaultHeaderItemTriggerDirective,
|
|
754
|
-
LayoutDefaultTopMenuItemComponent],
|
|
838
|
+
LayoutDefaultTopMenuItemComponent], exports: [LayoutDefaultComponent,
|
|
755
839
|
LayoutDefaultNavComponent,
|
|
756
840
|
LayoutDefaultHeaderComponent,
|
|
757
841
|
LayoutDefaultHeaderItemComponent,
|
|
758
842
|
LayoutDefaultHeaderItemTriggerDirective,
|
|
759
843
|
LayoutDefaultTopMenuItemComponent] });
|
|
760
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
844
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultModule, imports: [CommonModule,
|
|
845
|
+
RouterModule,
|
|
846
|
+
NzTooltipModule,
|
|
847
|
+
NzIconModule,
|
|
848
|
+
NzAvatarModule,
|
|
849
|
+
NzDropdownModule,
|
|
850
|
+
NzBadgeModule, LayoutDefaultComponent,
|
|
851
|
+
LayoutDefaultNavComponent] });
|
|
761
852
|
}
|
|
762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LayoutDefaultModule, decorators: [{
|
|
763
854
|
type: NgModule,
|
|
764
855
|
args: [{
|
|
765
|
-
imports: [
|
|
766
|
-
|
|
856
|
+
imports: [
|
|
857
|
+
CommonModule,
|
|
858
|
+
RouterModule,
|
|
859
|
+
NzTooltipModule,
|
|
860
|
+
NzIconModule,
|
|
861
|
+
NzAvatarModule,
|
|
862
|
+
NzDropdownModule,
|
|
863
|
+
NzBadgeModule,
|
|
864
|
+
...COMPONENTS
|
|
865
|
+
],
|
|
767
866
|
exports: COMPONENTS
|
|
768
867
|
}]
|
|
769
868
|
}] });
|