@delon/theme 12.4.2 → 13.1.0
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 +1278 -750
- package/compact.min.css +1 -1
- package/dark.css +1325 -797
- package/dark.min.css +1 -1
- package/default.css +1286 -758
- package/default.min.css +1 -1
- package/{esm2015/layout-blank/layout-blank.js → esm2020/layout-blank/layout-blank.mjs} +0 -0
- package/{esm2015/layout-blank/public_api.js → esm2020/layout-blank/public_api.mjs} +0 -0
- package/{esm2015/layout-default/layout-default.js → esm2020/layout-default/layout-default.mjs} +0 -0
- package/esm2020/layout-default/layout-header-item-trigger.directive.mjs +16 -0
- package/esm2020/layout-default/layout-header-item.component.mjs +33 -0
- package/esm2020/layout-default/layout-header.component.mjs +123 -0
- package/esm2020/layout-default/layout-nav.component.mjs +307 -0
- package/esm2020/layout-default/layout.component.mjs +132 -0
- package/esm2020/layout-default/layout.module.mjs +69 -0
- package/{esm2015/layout-default/public_api.js → esm2020/layout-default/public_api.mjs} +0 -0
- package/{esm2015/layout-default/types.js → esm2020/layout-default/types.mjs} +0 -0
- package/esm2020/public_api.mjs +25 -0
- package/{esm2015/setting-drawer/public_api.js → esm2020/setting-drawer/public_api.mjs} +0 -0
- package/esm2020/setting-drawer/setting-drawer-item.component.mjs +35 -0
- package/esm2020/setting-drawer/setting-drawer.component.mjs +192 -0
- package/{esm2015/setting-drawer/setting-drawer.js → esm2020/setting-drawer/setting-drawer.mjs} +0 -0
- package/esm2020/setting-drawer/setting-drawer.module.mjs +68 -0
- package/{esm2015/setting-drawer/setting-drawer.types.js → esm2020/setting-drawer/setting-drawer.types.mjs} +0 -0
- package/{esm2015/src/config.js → esm2020/src/config.mjs} +0 -0
- package/{esm2015/src/locale/index.js → esm2020/src/locale/index.mjs} +0 -0
- package/{esm2015/src/locale/languages/el-GR.js → esm2020/src/locale/languages/el-GR.mjs} +0 -0
- package/{esm2015/src/locale/languages/en-US.js → esm2020/src/locale/languages/en-US.mjs} +0 -0
- package/{esm2015/src/locale/languages/es-ES.js → esm2020/src/locale/languages/es-ES.mjs} +0 -0
- package/{esm2015/src/locale/languages/fr-FR.js → esm2020/src/locale/languages/fr-FR.mjs} +0 -0
- package/{esm2015/src/locale/languages/hr-HR.js → esm2020/src/locale/languages/hr-HR.mjs} +0 -0
- package/{esm2015/src/locale/languages/it-IT.js → esm2020/src/locale/languages/it-IT.mjs} +0 -0
- package/{esm2015/src/locale/languages/ja-JP.js → esm2020/src/locale/languages/ja-JP.mjs} +0 -0
- package/{esm2015/src/locale/languages/ko-KR.js → esm2020/src/locale/languages/ko-KR.mjs} +0 -0
- package/{esm2015/src/locale/languages/pl-PL.js → esm2020/src/locale/languages/pl-PL.mjs} +0 -0
- package/{esm2015/src/locale/languages/sl-SI.js → esm2020/src/locale/languages/sl-SI.mjs} +0 -0
- package/{esm2015/src/locale/languages/tr-TR.js → esm2020/src/locale/languages/tr-TR.mjs} +0 -0
- package/{esm2015/src/locale/languages/zh-CN.js → esm2020/src/locale/languages/zh-CN.mjs} +0 -0
- package/{esm2015/src/locale/languages/zh-TW.js → esm2020/src/locale/languages/zh-TW.mjs} +0 -0
- package/esm2020/src/locale/locale.module.mjs +17 -0
- package/esm2020/src/locale/locale.service.mjs +45 -0
- package/{esm2015/src/locale/locale.tokens.js → esm2020/src/locale/locale.tokens.mjs} +0 -0
- package/{esm2015/src/locale/locale.types.js → esm2020/src/locale/locale.types.mjs} +0 -0
- package/{esm2015/src/locale/public_api.js → esm2020/src/locale/public_api.mjs} +0 -0
- package/esm2020/src/pipes/date/date.pipe.mjs +24 -0
- package/esm2020/src/pipes/keys/keys.pipe.mjs +21 -0
- package/esm2020/src/pipes/safe/html.pipe.mjs +18 -0
- package/esm2020/src/pipes/safe/url.pipe.mjs +18 -0
- package/esm2020/src/pipes/yn/yn.pipe.mjs +38 -0
- package/esm2020/src/router/optional-preloader.mjs +22 -0
- package/esm2020/src/services/drawer/drawer.helper.mjs +91 -0
- package/esm2020/src/services/http/http.client.mjs +154 -0
- package/esm2020/src/services/http/http.decorator.mjs +215 -0
- package/esm2020/src/services/i18n/i18n.mjs +97 -0
- package/esm2020/src/services/i18n/i18n.pipe.mjs +21 -0
- package/{esm2015/src/services/menu/interface.js → esm2020/src/services/menu/interface.mjs} +0 -0
- package/esm2020/src/services/menu/menu.service.mjs +252 -0
- package/esm2020/src/services/modal/modal.helper.mjs +106 -0
- package/{esm2015/src/services/preloader/preloader.js → esm2020/src/services/preloader/preloader.mjs} +0 -0
- package/esm2020/src/services/responsive/responsive.mjs +46 -0
- package/esm2020/src/services/rtl/rtl.service.mjs +101 -0
- package/esm2020/src/services/settings/settings.service.mjs +100 -0
- package/{esm2015/src/services/settings/types.js → esm2020/src/services/settings/types.mjs} +0 -0
- package/esm2020/src/services/title/title.service.mjs +124 -0
- package/esm2020/src/theme.module.mjs +76 -0
- package/{esm2015/src/version.js → esm2020/src/version.mjs} +1 -1
- package/{esm2015/theme-btn/public_api.js → esm2020/theme-btn/public_api.mjs} +0 -0
- package/esm2020/theme-btn/theme-btn.component.mjs +106 -0
- package/esm2020/theme-btn/theme-btn.mjs +5 -0
- package/esm2020/theme-btn/theme-btn.module.mjs +32 -0
- package/esm2020/theme.mjs +5 -0
- package/fesm2015/{layout-blank.js → layout-blank.mjs} +1 -1
- package/fesm2015/layout-blank.mjs.map +1 -0
- package/fesm2015/layout-default.mjs +654 -0
- package/fesm2015/layout-default.mjs.map +1 -0
- package/fesm2015/setting-drawer.mjs +487 -0
- package/fesm2015/setting-drawer.mjs.map +1 -0
- package/fesm2015/theme-btn.mjs +144 -0
- package/fesm2015/theme-btn.mjs.map +1 -0
- package/fesm2015/{theme.js → theme.mjs} +226 -188
- package/fesm2015/theme.mjs.map +1 -0
- package/fesm2020/layout-blank.mjs +7 -0
- package/fesm2020/layout-blank.mjs.map +1 -0
- package/fesm2020/layout-default.mjs +654 -0
- package/fesm2020/layout-default.mjs.map +1 -0
- package/fesm2020/setting-drawer.mjs +482 -0
- package/fesm2020/setting-drawer.mjs.map +1 -0
- package/fesm2020/theme-btn.mjs +141 -0
- package/fesm2020/theme-btn.mjs.map +1 -0
- package/fesm2020/theme.mjs +2575 -0
- package/fesm2020/theme.mjs.map +1 -0
- package/layout-blank/layout-blank.d.ts +1 -0
- package/layout-blank/package.json +5 -6
- package/layout-default/layout-default.d.ts +1 -0
- package/layout-default/layout-header-item-trigger.directive.d.ts +3 -0
- package/layout-default/layout-header-item.component.d.ts +3 -0
- package/layout-default/layout-header.component.d.ts +8 -5
- package/layout-default/layout-nav.component.d.ts +4 -1
- package/layout-default/layout.component.d.ts +6 -3
- package/layout-default/layout.module.d.ts +17 -0
- package/layout-default/package.json +5 -6
- package/layout-default/style/_aside.less +7 -10
- package/layout-default/style/_fixed.less +2 -0
- package/layout-default/style/_header.less +21 -0
- package/layout-default/style/_layout.less +7 -0
- package/layout-default/style/_progress-bar.less +6 -0
- package/layout-default/style/fix/_full-content.less +4 -0
- package/layout-default/style/widgets/_app-icons.less +3 -0
- package/layout-default/style/widgets/_user.less +5 -0
- package/package.json +55 -11
- package/public_api.d.ts +1 -0
- package/setting-drawer/package.json +5 -6
- package/setting-drawer/setting-drawer-item.component.d.ts +3 -0
- package/setting-drawer/setting-drawer.component.d.ts +3 -0
- package/setting-drawer/setting-drawer.d.ts +1 -0
- package/setting-drawer/setting-drawer.module.d.ts +18 -0
- package/setting-drawer/style/index.less +9 -0
- package/setting-drawer/style/rtl.less +1 -0
- package/src/locale/locale.module.d.ts +4 -0
- package/src/locale/locale.service.d.ts +3 -0
- package/src/pipes/date/date.pipe.d.ts +3 -0
- package/src/pipes/keys/keys.pipe.d.ts +3 -0
- package/src/pipes/safe/html.pipe.d.ts +3 -0
- package/src/pipes/safe/url.pipe.d.ts +3 -0
- package/src/pipes/yn/style/index.less +3 -0
- package/src/pipes/yn/yn.pipe.d.ts +3 -0
- package/src/services/drawer/drawer.helper.d.ts +3 -0
- package/src/services/http/http.client.d.ts +3 -0
- package/src/services/http/http.decorator.d.ts +3 -0
- package/src/services/i18n/i18n.d.ts +5 -0
- package/src/services/i18n/i18n.pipe.d.ts +3 -0
- package/src/services/menu/menu.service.d.ts +5 -0
- package/src/services/modal/modal.helper.d.ts +3 -0
- package/src/services/responsive/responsive.d.ts +3 -0
- package/src/services/rtl/rtl.service.d.ts +3 -0
- package/src/services/settings/settings.service.d.ts +9 -0
- package/src/services/title/title.service.d.ts +3 -0
- package/src/theme.module.d.ts +15 -0
- package/system/_preloader.less +10 -0
- package/system/_type.less +5 -0
- package/system/antd/_modal.less +5 -0
- package/system/antd/_table.less +7 -0
- package/system/index.less +3 -3
- package/system/mixins/_freak.less +2 -2
- package/system/mixins/_text-truncate.less +2 -0
- package/system/ng/_form.less +1 -0
- package/system/theme-default.less +3 -1
- package/system/utils/_display.less +9 -0
- package/system/utils/_other.less +2 -0
- package/system/utils/_scrollbar.less +3 -0
- package/system/widgets/_abs.less +3 -0
- package/system/widgets/_half-float.less +2 -0
- package/system/widgets/_masonry-grid.less +2 -0
- package/theme-btn/package.json +6 -7
- package/theme-btn/style/index.less +1 -0
- package/theme-btn/theme-btn.component.d.ts +3 -0
- package/theme-btn/{layout-theme-btn.d.ts → theme-btn.d.ts} +1 -0
- package/theme-btn/theme-btn.module.d.ts +8 -0
- package/theme-compact.less +1 -1
- package/theme-dark.less +1 -1
- package/theme-default.less +1 -1
- package/theme.d.ts +1 -1
- package/bundles/layout-blank.umd.js +0 -19
- package/bundles/layout-blank.umd.js.map +0 -1
- package/bundles/layout-default.umd.js +0 -876
- package/bundles/layout-default.umd.js.map +0 -1
- package/bundles/layout-theme-btn.umd.js +0 -141
- package/bundles/layout-theme-btn.umd.js.map +0 -1
- package/bundles/setting-drawer.umd.js +0 -789
- package/bundles/setting-drawer.umd.js.map +0 -1
- package/bundles/theme.umd.js +0 -3075
- package/bundles/theme.umd.js.map +0 -1
- package/esm2015/layout-default/layout-header-item-trigger.directive.js +0 -12
- package/esm2015/layout-default/layout-header-item.component.js +0 -23
- package/esm2015/layout-default/layout-header.component.js +0 -94
- package/esm2015/layout-default/layout-nav.component.js +0 -306
- package/esm2015/layout-default/layout.component.js +0 -102
- package/esm2015/layout-default/layout.module.js +0 -40
- package/esm2015/public_api.js +0 -24
- package/esm2015/setting-drawer/setting-drawer-item.component.js +0 -30
- package/esm2015/setting-drawer/setting-drawer.component.js +0 -185
- package/esm2015/setting-drawer/setting-drawer.module.js +0 -39
- package/esm2015/src/locale/locale.module.js +0 -14
- package/esm2015/src/locale/locale.service.js +0 -42
- package/esm2015/src/pipes/date/date.pipe.js +0 -23
- package/esm2015/src/pipes/keys/keys.pipe.js +0 -17
- package/esm2015/src/pipes/safe/html.pipe.js +0 -17
- package/esm2015/src/pipes/safe/url.pipe.js +0 -17
- package/esm2015/src/pipes/yn/yn.pipe.js +0 -37
- package/esm2015/src/router/optional-preloader.js +0 -23
- package/esm2015/src/services/drawer/drawer.helper.js +0 -90
- package/esm2015/src/services/http/http.client.js +0 -138
- package/esm2015/src/services/http/http.decorator.js +0 -207
- package/esm2015/src/services/i18n/i18n.js +0 -96
- package/esm2015/src/services/i18n/i18n.pipe.js +0 -17
- package/esm2015/src/services/menu/menu.service.js +0 -252
- package/esm2015/src/services/modal/modal.helper.js +0 -105
- package/esm2015/src/services/responsive/responsive.js +0 -48
- package/esm2015/src/services/rtl/rtl.service.js +0 -110
- package/esm2015/src/services/settings/settings.service.js +0 -82
- package/esm2015/src/services/title/title.service.js +0 -125
- package/esm2015/src/theme.module.js +0 -67
- package/esm2015/theme-btn/layout-theme-btn.js +0 -5
- package/esm2015/theme-btn/theme-btn.component.js +0 -103
- package/esm2015/theme-btn/theme-btn.module.js +0 -22
- package/esm2015/theme.js +0 -6
- package/fesm2015/layout-blank.js.map +0 -1
- package/fesm2015/layout-default.js +0 -561
- package/fesm2015/layout-default.js.map +0 -1
- package/fesm2015/layout-theme-btn.js +0 -129
- package/fesm2015/layout-theme-btn.js.map +0 -1
- package/fesm2015/setting-drawer.js +0 -448
- package/fesm2015/setting-drawer.js.map +0 -1
- package/fesm2015/theme.js.map +0 -1
- package/layout-blank/layout-blank.metadata.json +0 -1
- package/layout-default/layout-default.metadata.json +0 -1
- package/setting-drawer/setting-drawer.metadata.json +0 -1
- package/theme-btn/layout-theme-btn.metadata.json +0 -1
- package/theme.metadata.json +0 -1
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import * as i6 from '@angular/common';
|
|
2
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Component, ViewChild, Input, ChangeDetectionStrategy, EventEmitter, ViewEncapsulation, Inject, Optional, Output, ContentChildren, Directive, NgModule } from '@angular/core';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { NavigationEnd, RouteConfigLoadStart, NavigationError, NavigationCancel, RouteConfigLoadEnd, RouterModule } from '@angular/router';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import { takeUntil, filter } from 'rxjs/operators';
|
|
9
|
+
import { updateHostClass } from '@delon/util/browser';
|
|
10
|
+
import * as i2$1 from 'ng-zorro-antd/message';
|
|
11
|
+
import { NzMessageModule } from 'ng-zorro-antd/message';
|
|
12
|
+
import * as i1 from '@delon/theme';
|
|
13
|
+
import * as i4 from 'ng-zorro-antd/icon';
|
|
14
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
15
|
+
import { __decorate } from 'tslib';
|
|
16
|
+
import { InputBoolean, InputNumber, ZoneOutside } from '@delon/util/decorator';
|
|
17
|
+
import { WINDOW } from '@delon/util/token';
|
|
18
|
+
import * as i3 from '@angular/platform-browser';
|
|
19
|
+
import * as i4$1 from '@angular/cdk/bidi';
|
|
20
|
+
import * as i5 from 'ng-zorro-antd/badge';
|
|
21
|
+
import { NzBadgeModule } from 'ng-zorro-antd/badge';
|
|
22
|
+
import * as i8 from 'ng-zorro-antd/tooltip';
|
|
23
|
+
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
24
|
+
import { NzAvatarModule } from 'ng-zorro-antd/avatar';
|
|
25
|
+
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
|
|
26
|
+
|
|
27
|
+
class LayoutDefaultHeaderItemComponent {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.hidden = 'none';
|
|
30
|
+
this.direction = 'right';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
LayoutDefaultHeaderItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
LayoutDefaultHeaderItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: LayoutDefaultHeaderItemComponent, selector: "layout-default-header-item", inputs: { hidden: "hidden", direction: "direction" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, static: true }], ngImport: i0, template: `
|
|
35
|
+
<ng-template #host>
|
|
36
|
+
<ng-content></ng-content>
|
|
37
|
+
</ng-template>
|
|
38
|
+
`, isInline: true });
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderItemComponent, decorators: [{
|
|
40
|
+
type: Component,
|
|
41
|
+
args: [{
|
|
42
|
+
selector: 'layout-default-header-item',
|
|
43
|
+
template: `
|
|
44
|
+
<ng-template #host>
|
|
45
|
+
<ng-content></ng-content>
|
|
46
|
+
</ng-template>
|
|
47
|
+
`
|
|
48
|
+
}]
|
|
49
|
+
}], propDecorators: { host: [{
|
|
50
|
+
type: ViewChild,
|
|
51
|
+
args: ['host', { static: true }]
|
|
52
|
+
}], hidden: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], direction: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}] } });
|
|
57
|
+
|
|
58
|
+
class LayoutDefaultHeaderComponent {
|
|
59
|
+
constructor(settings, cdr) {
|
|
60
|
+
this.settings = settings;
|
|
61
|
+
this.cdr = cdr;
|
|
62
|
+
this.destroy$ = new Subject();
|
|
63
|
+
this.left = [];
|
|
64
|
+
this.middle = [];
|
|
65
|
+
this.right = [];
|
|
66
|
+
}
|
|
67
|
+
get app() {
|
|
68
|
+
return this.settings.app;
|
|
69
|
+
}
|
|
70
|
+
get collapsed() {
|
|
71
|
+
return this.settings.layout.collapsed;
|
|
72
|
+
}
|
|
73
|
+
get collapsedIcon() {
|
|
74
|
+
let type = this.collapsed ? 'unfold' : 'fold';
|
|
75
|
+
if (this.settings.layout.direction === 'rtl') {
|
|
76
|
+
type = this.collapsed ? 'fold' : 'unfold';
|
|
77
|
+
}
|
|
78
|
+
return `menu-${type}`;
|
|
79
|
+
}
|
|
80
|
+
refresh() {
|
|
81
|
+
const arr = this.items.toArray();
|
|
82
|
+
this.left = arr.filter(i => i.direction === 'left');
|
|
83
|
+
this.middle = arr.filter(i => i.direction === 'middle');
|
|
84
|
+
this.right = arr.filter(i => i.direction === 'right');
|
|
85
|
+
this.cdr.detectChanges();
|
|
86
|
+
}
|
|
87
|
+
ngAfterViewInit() {
|
|
88
|
+
this.items.changes.pipe(takeUntil(this.destroy$)).subscribe(() => this.refresh());
|
|
89
|
+
this.refresh();
|
|
90
|
+
}
|
|
91
|
+
toggleCollapsed() {
|
|
92
|
+
this.settings.setLayout('collapsed', !this.settings.layout.collapsed);
|
|
93
|
+
}
|
|
94
|
+
ngOnDestroy() {
|
|
95
|
+
this.destroy$.next();
|
|
96
|
+
this.destroy$.complete();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
LayoutDefaultHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderComponent, deps: [{ token: i1.SettingsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
100
|
+
LayoutDefaultHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: LayoutDefaultHeaderComponent, selector: "layout-default-header", inputs: { items: "items", options: "options" }, host: { properties: { "class.alain-default__header": "true" } }, ngImport: i0, template: `
|
|
101
|
+
<ng-template #render let-ls>
|
|
102
|
+
<li *ngFor="let i of ls" [class.hidden-mobile]="i.hidden === 'mobile'" [class.hidden-pc]="i.hidden === 'pc'">
|
|
103
|
+
<ng-container *ngTemplateOutlet="i.host"></ng-container>
|
|
104
|
+
</li>
|
|
105
|
+
</ng-template>
|
|
106
|
+
<div class="alain-default__header-logo" [style.width.px]="options.logoFixWidth">
|
|
107
|
+
<a [routerLink]="options.logoLink" class="alain-default__header-logo-link">
|
|
108
|
+
<img class="alain-default__header-logo-expanded" [attr.src]="options.logoExpanded" [attr.alt]="app.name" />
|
|
109
|
+
<img class="alain-default__header-logo-collapsed" [attr.src]="options.logoCollapsed" [attr.alt]="app.name" />
|
|
110
|
+
</a>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="alain-default__nav-wrap">
|
|
113
|
+
<ul class="alain-default__nav">
|
|
114
|
+
<li *ngIf="!options.hideAside">
|
|
115
|
+
<div class="alain-default__nav-item alain-default__nav-item--collapse" (click)="toggleCollapsed()">
|
|
116
|
+
<i nz-icon [nzType]="collapsedIcon"></i>
|
|
117
|
+
</div>
|
|
118
|
+
</li>
|
|
119
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: left }"></ng-template>
|
|
120
|
+
</ul>
|
|
121
|
+
<div *ngIf="middle.length > 0" class="alain-default__nav alain-default__nav-middle">
|
|
122
|
+
<ng-container *ngTemplateOutlet="middle[0].host"></ng-container>
|
|
123
|
+
</div>
|
|
124
|
+
<ul class="alain-default__nav">
|
|
125
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: right }"></ng-template>
|
|
126
|
+
</ul>
|
|
127
|
+
</div>
|
|
128
|
+
`, isInline: true, directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderComponent, decorators: [{
|
|
130
|
+
type: Component,
|
|
131
|
+
args: [{
|
|
132
|
+
selector: 'layout-default-header',
|
|
133
|
+
template: `
|
|
134
|
+
<ng-template #render let-ls>
|
|
135
|
+
<li *ngFor="let i of ls" [class.hidden-mobile]="i.hidden === 'mobile'" [class.hidden-pc]="i.hidden === 'pc'">
|
|
136
|
+
<ng-container *ngTemplateOutlet="i.host"></ng-container>
|
|
137
|
+
</li>
|
|
138
|
+
</ng-template>
|
|
139
|
+
<div class="alain-default__header-logo" [style.width.px]="options.logoFixWidth">
|
|
140
|
+
<a [routerLink]="options.logoLink" class="alain-default__header-logo-link">
|
|
141
|
+
<img class="alain-default__header-logo-expanded" [attr.src]="options.logoExpanded" [attr.alt]="app.name" />
|
|
142
|
+
<img class="alain-default__header-logo-collapsed" [attr.src]="options.logoCollapsed" [attr.alt]="app.name" />
|
|
143
|
+
</a>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="alain-default__nav-wrap">
|
|
146
|
+
<ul class="alain-default__nav">
|
|
147
|
+
<li *ngIf="!options.hideAside">
|
|
148
|
+
<div class="alain-default__nav-item alain-default__nav-item--collapse" (click)="toggleCollapsed()">
|
|
149
|
+
<i nz-icon [nzType]="collapsedIcon"></i>
|
|
150
|
+
</div>
|
|
151
|
+
</li>
|
|
152
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: left }"></ng-template>
|
|
153
|
+
</ul>
|
|
154
|
+
<div *ngIf="middle.length > 0" class="alain-default__nav alain-default__nav-middle">
|
|
155
|
+
<ng-container *ngTemplateOutlet="middle[0].host"></ng-container>
|
|
156
|
+
</div>
|
|
157
|
+
<ul class="alain-default__nav">
|
|
158
|
+
<ng-template [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: right }"></ng-template>
|
|
159
|
+
</ul>
|
|
160
|
+
</div>
|
|
161
|
+
`,
|
|
162
|
+
host: {
|
|
163
|
+
'[class.alain-default__header]': `true`
|
|
164
|
+
},
|
|
165
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
166
|
+
}]
|
|
167
|
+
}], ctorParameters: function () { return [{ type: i1.SettingsService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], options: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}] } });
|
|
172
|
+
|
|
173
|
+
const SHOWCLS = 'sidebar-nav__floating-show';
|
|
174
|
+
const FLOATINGCLS = 'sidebar-nav__floating';
|
|
175
|
+
class LayoutDefaultNavComponent {
|
|
176
|
+
constructor(menuSrv, settings, router, render, cdr, ngZone, sanitizer, doc, win, directionality) {
|
|
177
|
+
this.menuSrv = menuSrv;
|
|
178
|
+
this.settings = settings;
|
|
179
|
+
this.router = router;
|
|
180
|
+
this.render = render;
|
|
181
|
+
this.cdr = cdr;
|
|
182
|
+
this.ngZone = ngZone;
|
|
183
|
+
this.sanitizer = sanitizer;
|
|
184
|
+
this.doc = doc;
|
|
185
|
+
this.win = win;
|
|
186
|
+
this.directionality = directionality;
|
|
187
|
+
this.destroy$ = new Subject();
|
|
188
|
+
this.dir = 'ltr';
|
|
189
|
+
this.list = [];
|
|
190
|
+
this.disabledAcl = false;
|
|
191
|
+
this.autoCloseUnderPad = true;
|
|
192
|
+
this.recursivePath = true;
|
|
193
|
+
this.openStrictly = false;
|
|
194
|
+
this.maxLevelIcon = 3;
|
|
195
|
+
this.select = new EventEmitter();
|
|
196
|
+
}
|
|
197
|
+
get collapsed() {
|
|
198
|
+
return this.settings.layout.collapsed;
|
|
199
|
+
}
|
|
200
|
+
getLinkNode(node) {
|
|
201
|
+
node = node.nodeName === 'A' ? node : node.parentNode;
|
|
202
|
+
return node.nodeName !== 'A' ? null : node;
|
|
203
|
+
}
|
|
204
|
+
floatingClickHandle(e) {
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
const linkNode = this.getLinkNode(e.target);
|
|
207
|
+
if (linkNode == null) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
const id = +linkNode.dataset.id;
|
|
211
|
+
// Should be ingore children title trigger event
|
|
212
|
+
if (isNaN(id)) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
let item;
|
|
216
|
+
this.menuSrv.visit(this.list, (i) => {
|
|
217
|
+
if (!item && i._id === id) {
|
|
218
|
+
item = i;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
this.to(item);
|
|
222
|
+
this.hideAll();
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
clearFloating() {
|
|
227
|
+
if (!this.floatingEl)
|
|
228
|
+
return;
|
|
229
|
+
this.floatingEl.removeEventListener('click', this.floatingClickHandle.bind(this));
|
|
230
|
+
// fix ie: https://github.com/ng-alain/delon/issues/52
|
|
231
|
+
if (this.floatingEl.hasOwnProperty('remove')) {
|
|
232
|
+
this.floatingEl.remove();
|
|
233
|
+
}
|
|
234
|
+
else if (this.floatingEl.parentNode) {
|
|
235
|
+
this.floatingEl.parentNode.removeChild(this.floatingEl);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
genFloating() {
|
|
239
|
+
this.clearFloating();
|
|
240
|
+
this.floatingEl = this.render.createElement('div');
|
|
241
|
+
this.floatingEl.classList.add(`${FLOATINGCLS}-container`);
|
|
242
|
+
this.floatingEl.addEventListener('click', this.floatingClickHandle.bind(this), false);
|
|
243
|
+
this.bodyEl.appendChild(this.floatingEl);
|
|
244
|
+
}
|
|
245
|
+
genSubNode(linkNode, item) {
|
|
246
|
+
const id = `_sidebar-nav-${item._id}`;
|
|
247
|
+
const childNode = item.badge ? linkNode.nextElementSibling.nextElementSibling : linkNode.nextElementSibling;
|
|
248
|
+
const node = childNode.cloneNode(true);
|
|
249
|
+
node.id = id;
|
|
250
|
+
node.classList.add(FLOATINGCLS);
|
|
251
|
+
node.addEventListener('mouseleave', () => {
|
|
252
|
+
node.classList.remove(SHOWCLS);
|
|
253
|
+
}, false);
|
|
254
|
+
this.floatingEl.appendChild(node);
|
|
255
|
+
return node;
|
|
256
|
+
}
|
|
257
|
+
hideAll() {
|
|
258
|
+
const allNode = this.floatingEl.querySelectorAll(`.${FLOATINGCLS}`);
|
|
259
|
+
for (let i = 0; i < allNode.length; i++) {
|
|
260
|
+
allNode[i].classList.remove(SHOWCLS);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// calculate the node position values.
|
|
264
|
+
calPos(linkNode, node) {
|
|
265
|
+
const rect = linkNode.getBoundingClientRect();
|
|
266
|
+
// bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14721015/
|
|
267
|
+
const scrollTop = Math.max(this.doc.documentElement.scrollTop, this.bodyEl.scrollTop);
|
|
268
|
+
const docHeight = Math.max(this.doc.documentElement.clientHeight, this.bodyEl.clientHeight);
|
|
269
|
+
const spacing = 5;
|
|
270
|
+
let offsetHeight = -spacing;
|
|
271
|
+
if (docHeight < rect.top + node.clientHeight) {
|
|
272
|
+
offsetHeight = rect.top + node.clientHeight - docHeight + spacing;
|
|
273
|
+
}
|
|
274
|
+
node.style.top = `${rect.top + scrollTop - offsetHeight}px`;
|
|
275
|
+
if (this.dir === 'rtl') {
|
|
276
|
+
node.style.right = `${rect.width + spacing}px`;
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
node.style.left = `${rect.right + spacing}px`;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
showSubMenu(e, item) {
|
|
283
|
+
if (this.collapsed !== true) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
e.preventDefault();
|
|
287
|
+
const linkNode = e.target;
|
|
288
|
+
this.genFloating();
|
|
289
|
+
const subNode = this.genSubNode(linkNode, item);
|
|
290
|
+
this.hideAll();
|
|
291
|
+
subNode.classList.add(SHOWCLS);
|
|
292
|
+
this.calPos(linkNode, subNode);
|
|
293
|
+
}
|
|
294
|
+
to(item) {
|
|
295
|
+
this.select.emit(item);
|
|
296
|
+
if (item.disabled)
|
|
297
|
+
return;
|
|
298
|
+
if (item.externalLink) {
|
|
299
|
+
if (item.target === '_blank') {
|
|
300
|
+
this.win.open(item.externalLink);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
this.win.location.href = item.externalLink;
|
|
304
|
+
}
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.ngZone.run(() => this.router.navigateByUrl(item.link));
|
|
308
|
+
}
|
|
309
|
+
toggleOpen(item) {
|
|
310
|
+
if (!this.openStrictly) {
|
|
311
|
+
this.menuSrv.visit(this.list, (i) => {
|
|
312
|
+
if (i !== item)
|
|
313
|
+
i._open = false;
|
|
314
|
+
});
|
|
315
|
+
let pItem = item._parent;
|
|
316
|
+
while (pItem) {
|
|
317
|
+
pItem._open = true;
|
|
318
|
+
pItem = pItem._parent;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
item._open = !item._open;
|
|
322
|
+
this.cdr.markForCheck();
|
|
323
|
+
}
|
|
324
|
+
_click() {
|
|
325
|
+
if (this.isPad && this.collapsed) {
|
|
326
|
+
this.openAside(false);
|
|
327
|
+
this.hideAll();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
closeSubMenu() {
|
|
331
|
+
if (this.collapsed) {
|
|
332
|
+
this.hideAll();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
openedByUrl(url) {
|
|
336
|
+
const { menuSrv, recursivePath, openStrictly } = this;
|
|
337
|
+
let findItem = menuSrv.getHit(this.menuSrv.menus, url, recursivePath, (i) => {
|
|
338
|
+
i._selected = false;
|
|
339
|
+
if (!openStrictly) {
|
|
340
|
+
i._open = false;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
if (findItem == null)
|
|
344
|
+
return;
|
|
345
|
+
do {
|
|
346
|
+
findItem._selected = true;
|
|
347
|
+
if (!openStrictly) {
|
|
348
|
+
findItem._open = true;
|
|
349
|
+
}
|
|
350
|
+
findItem = findItem._parent;
|
|
351
|
+
} while (findItem);
|
|
352
|
+
}
|
|
353
|
+
ngOnInit() {
|
|
354
|
+
var _a;
|
|
355
|
+
const { doc, router, destroy$, menuSrv, settings, cdr } = this;
|
|
356
|
+
this.bodyEl = doc.querySelector('body');
|
|
357
|
+
this.openedByUrl(router.url);
|
|
358
|
+
this.ngZone.runOutsideAngular(() => this.genFloating());
|
|
359
|
+
menuSrv.change.pipe(takeUntil(destroy$)).subscribe(data => {
|
|
360
|
+
menuSrv.visit(data, (i, _p, depth) => {
|
|
361
|
+
i._text = this.sanitizer.bypassSecurityTrustHtml(i.text);
|
|
362
|
+
i._needIcon = depth <= this.maxLevelIcon && !!i.icon;
|
|
363
|
+
if (!i._aclResult) {
|
|
364
|
+
if (this.disabledAcl) {
|
|
365
|
+
i.disabled = true;
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
i._hidden = true;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (this.openStrictly) {
|
|
372
|
+
i._open = i.open != null ? i.open : false;
|
|
373
|
+
}
|
|
374
|
+
const icon = i.icon;
|
|
375
|
+
if (icon && icon.type === 'svg' && typeof icon.value === 'string') {
|
|
376
|
+
icon.value = this.sanitizer.bypassSecurityTrustHtml(icon.value);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
this.list = menuSrv.menus.filter((w) => w._hidden !== true);
|
|
380
|
+
cdr.detectChanges();
|
|
381
|
+
});
|
|
382
|
+
router.events.pipe(takeUntil(destroy$)).subscribe(e => {
|
|
383
|
+
if (e instanceof NavigationEnd) {
|
|
384
|
+
this.openedByUrl(e.urlAfterRedirects);
|
|
385
|
+
this.underPad();
|
|
386
|
+
this.cdr.detectChanges();
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
settings.notify
|
|
390
|
+
.pipe(takeUntil(destroy$), filter(t => t.type === 'layout' && t.name === 'collapsed'))
|
|
391
|
+
.subscribe(() => this.clearFloating());
|
|
392
|
+
this.underPad();
|
|
393
|
+
this.dir = this.directionality.value;
|
|
394
|
+
(_a = this.directionality.change) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(destroy$)).subscribe((direction) => {
|
|
395
|
+
this.dir = direction;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
ngOnDestroy() {
|
|
399
|
+
this.destroy$.next();
|
|
400
|
+
this.destroy$.complete();
|
|
401
|
+
this.clearFloating();
|
|
402
|
+
}
|
|
403
|
+
// #region Under pad
|
|
404
|
+
get isPad() {
|
|
405
|
+
return this.doc.defaultView.innerWidth < 768;
|
|
406
|
+
}
|
|
407
|
+
underPad() {
|
|
408
|
+
if (this.autoCloseUnderPad && this.isPad && !this.collapsed) {
|
|
409
|
+
setTimeout(() => this.openAside(true));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
openAside(status) {
|
|
413
|
+
this.settings.setLayout('collapsed', status);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
LayoutDefaultNavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultNavComponent, deps: [{ token: i1.MenuService }, { token: i1.SettingsService }, { token: i2.Router }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i3.DomSanitizer }, { token: DOCUMENT }, { token: WINDOW }, { token: i4$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
417
|
+
LayoutDefaultNavComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: LayoutDefaultNavComponent, selector: "layout-default-nav", inputs: { disabledAcl: "disabledAcl", autoCloseUnderPad: "autoCloseUnderPad", recursivePath: "recursivePath", openStrictly: "openStrictly", maxLevelIcon: "maxLevelIcon" }, outputs: { select: "select" }, host: { listeners: { "click": "_click()", "document:click": "closeSubMenu()" } }, ngImport: i0, template: "<ng-template #icon let-i>\n <ng-container *ngIf=\"i\" [ngSwitch]=\"i.type\">\n <i\n *ngSwitchCase=\"'icon'\"\n class=\"sidebar-nav__item-icon\"\n nz-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 ></i>\n <i *ngSwitchCase=\"'iconfont'\" class=\"sidebar-nav__item-icon\" nz-icon [nzIconfont]=\"i.iconfont\"></i>\n <img *ngSwitchCase=\"'img'\" [src]=\"i.value\" class=\"sidebar-nav__item-icon sidebar-nav__item-img\" />\n <span *ngSwitchCase=\"'svg'\" class=\"sidebar-nav__item-icon sidebar-nav__item-svg\" [innerHTML]=\"i.value\"></span>\n <i *ngSwitchDefault class=\"sidebar-nav__item-icon {{ i.value }}\"></i>\n </ng-container>\n</ng-template>\n<ng-template #tree let-ls>\n <ng-container *ngFor=\"let i of ls\">\n <li\n *ngIf=\"i._hidden !== true\"\n class=\"sidebar-nav__item\"\n [class.sidebar-nav__selected]=\"i._selected\"\n [class.sidebar-nav__open]=\"i._open\"\n >\n <!-- link -->\n <a\n *ngIf=\"i.children.length === 0\"\n (click)=\"to(i)\"\n [attr.data-id]=\"i._id\"\n class=\"sidebar-nav__item-link\"\n [ngClass]=\"{ 'sidebar-nav__item-disabled': i.disabled }\"\n (mouseenter)=\"closeSubMenu()\"\n >\n <ng-container *ngIf=\"i._needIcon\">\n <ng-container *ngIf=\"!collapsed\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\n </ng-container>\n <span *ngIf=\"collapsed\" nz-tooltip nzTooltipPlacement=\"right\" [nzTooltipTitle]=\"i.text\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\n </span>\n </ng-container>\n <span class=\"sidebar-nav__item-text\" [innerHTML]=\"i._text\" [attr.title]=\"i.text\"></span>\n </a>\n <!-- has children link -->\n <a\n *ngIf=\"i.children.length > 0\"\n (click)=\"toggleOpen(i)\"\n (mouseenter)=\"showSubMenu($event, i)\"\n class=\"sidebar-nav__item-link\"\n >\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\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 <!-- badge -->\n <nz-badge *ngIf=\"i.badge\" [nzCount]=\"i.badge\" [nzDot]=\"i.badgeDot\" nzStandalone [nzOverflowCount]=\"9\"></nz-badge>\n <ul *ngIf=\"i.children.length > 0\" class=\"sidebar-nav sidebar-nav__sub sidebar-nav__depth{{ i._depth }}\">\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: i.children }\"></ng-template>\n </ul>\n </li>\n </ng-container>\n</ng-template>\n<ul class=\"sidebar-nav\">\n <ng-container *ngFor=\"let group of list\">\n <li class=\"sidebar-nav__item sidebar-nav__group-title\" *ngIf=\"group.group\">\n <span [innerHTML]=\"group._text\"></span>\n </li>\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: group.children }\"></ng-template>\n </ng-container>\n</ul>\n", components: [{ type: i5.NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset"], exportAs: ["nzBadge"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
418
|
+
__decorate([
|
|
419
|
+
InputBoolean()
|
|
420
|
+
], LayoutDefaultNavComponent.prototype, "disabledAcl", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
InputBoolean()
|
|
423
|
+
], LayoutDefaultNavComponent.prototype, "autoCloseUnderPad", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
InputBoolean()
|
|
426
|
+
], LayoutDefaultNavComponent.prototype, "recursivePath", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
InputBoolean()
|
|
429
|
+
], LayoutDefaultNavComponent.prototype, "openStrictly", void 0);
|
|
430
|
+
__decorate([
|
|
431
|
+
InputNumber()
|
|
432
|
+
], LayoutDefaultNavComponent.prototype, "maxLevelIcon", void 0);
|
|
433
|
+
__decorate([
|
|
434
|
+
ZoneOutside()
|
|
435
|
+
], LayoutDefaultNavComponent.prototype, "showSubMenu", null);
|
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultNavComponent, decorators: [{
|
|
437
|
+
type: Component,
|
|
438
|
+
args: [{ selector: 'layout-default-nav', host: {
|
|
439
|
+
'(click)': '_click()',
|
|
440
|
+
'(document:click)': 'closeSubMenu()'
|
|
441
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template #icon let-i>\n <ng-container *ngIf=\"i\" [ngSwitch]=\"i.type\">\n <i\n *ngSwitchCase=\"'icon'\"\n class=\"sidebar-nav__item-icon\"\n nz-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 ></i>\n <i *ngSwitchCase=\"'iconfont'\" class=\"sidebar-nav__item-icon\" nz-icon [nzIconfont]=\"i.iconfont\"></i>\n <img *ngSwitchCase=\"'img'\" [src]=\"i.value\" class=\"sidebar-nav__item-icon sidebar-nav__item-img\" />\n <span *ngSwitchCase=\"'svg'\" class=\"sidebar-nav__item-icon sidebar-nav__item-svg\" [innerHTML]=\"i.value\"></span>\n <i *ngSwitchDefault class=\"sidebar-nav__item-icon {{ i.value }}\"></i>\n </ng-container>\n</ng-template>\n<ng-template #tree let-ls>\n <ng-container *ngFor=\"let i of ls\">\n <li\n *ngIf=\"i._hidden !== true\"\n class=\"sidebar-nav__item\"\n [class.sidebar-nav__selected]=\"i._selected\"\n [class.sidebar-nav__open]=\"i._open\"\n >\n <!-- link -->\n <a\n *ngIf=\"i.children.length === 0\"\n (click)=\"to(i)\"\n [attr.data-id]=\"i._id\"\n class=\"sidebar-nav__item-link\"\n [ngClass]=\"{ 'sidebar-nav__item-disabled': i.disabled }\"\n (mouseenter)=\"closeSubMenu()\"\n >\n <ng-container *ngIf=\"i._needIcon\">\n <ng-container *ngIf=\"!collapsed\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\n </ng-container>\n <span *ngIf=\"collapsed\" nz-tooltip nzTooltipPlacement=\"right\" [nzTooltipTitle]=\"i.text\">\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\n </span>\n </ng-container>\n <span class=\"sidebar-nav__item-text\" [innerHTML]=\"i._text\" [attr.title]=\"i.text\"></span>\n </a>\n <!-- has children link -->\n <a\n *ngIf=\"i.children.length > 0\"\n (click)=\"toggleOpen(i)\"\n (mouseenter)=\"showSubMenu($event, i)\"\n class=\"sidebar-nav__item-link\"\n >\n <ng-template [ngTemplateOutlet]=\"icon\" [ngTemplateOutletContext]=\"{ $implicit: i.icon }\"></ng-template>\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 <!-- badge -->\n <nz-badge *ngIf=\"i.badge\" [nzCount]=\"i.badge\" [nzDot]=\"i.badgeDot\" nzStandalone [nzOverflowCount]=\"9\"></nz-badge>\n <ul *ngIf=\"i.children.length > 0\" class=\"sidebar-nav sidebar-nav__sub sidebar-nav__depth{{ i._depth }}\">\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: i.children }\"></ng-template>\n </ul>\n </li>\n </ng-container>\n</ng-template>\n<ul class=\"sidebar-nav\">\n <ng-container *ngFor=\"let group of list\">\n <li class=\"sidebar-nav__item sidebar-nav__group-title\" *ngIf=\"group.group\">\n <span [innerHTML]=\"group._text\"></span>\n </li>\n <ng-template [ngTemplateOutlet]=\"tree\" [ngTemplateOutletContext]=\"{ $implicit: group.children }\"></ng-template>\n </ng-container>\n</ul>\n" }]
|
|
442
|
+
}], ctorParameters: function () {
|
|
443
|
+
return [{ type: i1.MenuService }, { type: i1.SettingsService }, { type: i2.Router }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i3.DomSanitizer }, { type: undefined, decorators: [{
|
|
444
|
+
type: Inject,
|
|
445
|
+
args: [DOCUMENT]
|
|
446
|
+
}] }, { type: undefined, decorators: [{
|
|
447
|
+
type: Inject,
|
|
448
|
+
args: [WINDOW]
|
|
449
|
+
}] }, { type: i4$1.Directionality, decorators: [{
|
|
450
|
+
type: Optional
|
|
451
|
+
}] }];
|
|
452
|
+
}, propDecorators: { disabledAcl: [{
|
|
453
|
+
type: Input
|
|
454
|
+
}], autoCloseUnderPad: [{
|
|
455
|
+
type: Input
|
|
456
|
+
}], recursivePath: [{
|
|
457
|
+
type: Input
|
|
458
|
+
}], openStrictly: [{
|
|
459
|
+
type: Input
|
|
460
|
+
}], maxLevelIcon: [{
|
|
461
|
+
type: Input
|
|
462
|
+
}], select: [{
|
|
463
|
+
type: Output
|
|
464
|
+
}], showSubMenu: [] } });
|
|
465
|
+
|
|
466
|
+
class LayoutDefaultComponent {
|
|
467
|
+
constructor(router, msgSrv, settings, el, renderer, doc) {
|
|
468
|
+
this.msgSrv = msgSrv;
|
|
469
|
+
this.settings = settings;
|
|
470
|
+
this.el = el;
|
|
471
|
+
this.renderer = renderer;
|
|
472
|
+
this.doc = doc;
|
|
473
|
+
this.asideUser = null;
|
|
474
|
+
this.nav = null;
|
|
475
|
+
this.content = null;
|
|
476
|
+
this.destroy$ = new Subject();
|
|
477
|
+
this.isFetching = false;
|
|
478
|
+
router.events.pipe(takeUntil(this.destroy$)).subscribe(ev => this.processEv(ev));
|
|
479
|
+
}
|
|
480
|
+
processEv(ev) {
|
|
481
|
+
var _a;
|
|
482
|
+
if (!this.isFetching && ev instanceof RouteConfigLoadStart) {
|
|
483
|
+
this.isFetching = true;
|
|
484
|
+
}
|
|
485
|
+
if (ev instanceof NavigationError || ev instanceof NavigationCancel) {
|
|
486
|
+
this.isFetching = false;
|
|
487
|
+
const err = this.customError === null ? null : (_a = this.customError) !== null && _a !== void 0 ? _a : `Could not load ${ev.url} route`;
|
|
488
|
+
if (err && ev instanceof NavigationError) {
|
|
489
|
+
this.msgSrv.error(err, { nzDuration: 1000 * 3 });
|
|
490
|
+
}
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (!(ev instanceof NavigationEnd || ev instanceof RouteConfigLoadEnd)) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (this.isFetching) {
|
|
497
|
+
setTimeout(() => {
|
|
498
|
+
this.isFetching = false;
|
|
499
|
+
}, 100);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
setClass() {
|
|
503
|
+
const { el, doc, renderer, settings } = this;
|
|
504
|
+
const layout = settings.layout;
|
|
505
|
+
updateHostClass(el.nativeElement, renderer, {
|
|
506
|
+
['alain-default']: true,
|
|
507
|
+
[`alain-default__fixed`]: layout.fixed,
|
|
508
|
+
[`alain-default__collapsed`]: layout.collapsed,
|
|
509
|
+
[`alain-default__hide-aside`]: this.options.hideAside
|
|
510
|
+
});
|
|
511
|
+
doc.body.classList[layout.colorWeak ? 'add' : 'remove']('color-weak');
|
|
512
|
+
}
|
|
513
|
+
ngOnInit() {
|
|
514
|
+
this.options = Object.assign({ logoExpanded: `./assets/logo-full.svg`, logoCollapsed: `./assets/logo.svg`, logoLink: `/`, hideAside: false }, this.options);
|
|
515
|
+
const { settings, destroy$ } = this;
|
|
516
|
+
settings.notify.pipe(takeUntil(destroy$)).subscribe(() => this.setClass());
|
|
517
|
+
this.setClass();
|
|
518
|
+
}
|
|
519
|
+
ngOnDestroy() {
|
|
520
|
+
this.destroy$.next();
|
|
521
|
+
this.destroy$.complete();
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
LayoutDefaultComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultComponent, deps: [{ token: i2.Router }, { token: i2$1.NzMessageService }, { token: i1.SettingsService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
525
|
+
LayoutDefaultComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: LayoutDefaultComponent, selector: "layout-default", inputs: { options: "options", asideUser: "asideUser", nav: "nav", content: "content", customError: "customError" }, queries: [{ propertyName: "headerItems", predicate: LayoutDefaultHeaderItemComponent }], exportAs: ["layoutDefault"], ngImport: i0, template: `
|
|
526
|
+
<div class="alain-default__progress-bar" *ngIf="isFetching"></div>
|
|
527
|
+
<layout-default-header [options]="options" [items]="headerItems"></layout-default-header>
|
|
528
|
+
<div *ngIf="!options.hideAside" class="alain-default__aside">
|
|
529
|
+
<div class="alain-default__aside-inner">
|
|
530
|
+
<ng-container *ngTemplateOutlet="asideUser"></ng-container>
|
|
531
|
+
<ng-container *ngTemplateOutlet="nav"></ng-container>
|
|
532
|
+
<layout-default-nav *ngIf="!nav" class="d-block py-lg"></layout-default-nav>
|
|
533
|
+
</div>
|
|
534
|
+
</div>
|
|
535
|
+
<section class="alain-default__content">
|
|
536
|
+
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
537
|
+
<ng-content></ng-content>
|
|
538
|
+
</section>
|
|
539
|
+
`, isInline: true, components: [{ type: LayoutDefaultHeaderComponent, selector: "layout-default-header", inputs: ["items", "options"] }, { type: LayoutDefaultNavComponent, selector: "layout-default-nav", inputs: ["disabledAcl", "autoCloseUnderPad", "recursivePath", "openStrictly", "maxLevelIcon"], outputs: ["select"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultComponent, decorators: [{
|
|
541
|
+
type: Component,
|
|
542
|
+
args: [{
|
|
543
|
+
selector: 'layout-default',
|
|
544
|
+
exportAs: 'layoutDefault',
|
|
545
|
+
template: `
|
|
546
|
+
<div class="alain-default__progress-bar" *ngIf="isFetching"></div>
|
|
547
|
+
<layout-default-header [options]="options" [items]="headerItems"></layout-default-header>
|
|
548
|
+
<div *ngIf="!options.hideAside" class="alain-default__aside">
|
|
549
|
+
<div class="alain-default__aside-inner">
|
|
550
|
+
<ng-container *ngTemplateOutlet="asideUser"></ng-container>
|
|
551
|
+
<ng-container *ngTemplateOutlet="nav"></ng-container>
|
|
552
|
+
<layout-default-nav *ngIf="!nav" class="d-block py-lg"></layout-default-nav>
|
|
553
|
+
</div>
|
|
554
|
+
</div>
|
|
555
|
+
<section class="alain-default__content">
|
|
556
|
+
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
557
|
+
<ng-content></ng-content>
|
|
558
|
+
</section>
|
|
559
|
+
`
|
|
560
|
+
}]
|
|
561
|
+
}], ctorParameters: function () {
|
|
562
|
+
return [{ type: i2.Router }, { type: i2$1.NzMessageService }, { type: i1.SettingsService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
563
|
+
type: Inject,
|
|
564
|
+
args: [DOCUMENT]
|
|
565
|
+
}] }];
|
|
566
|
+
}, propDecorators: { headerItems: [{
|
|
567
|
+
type: ContentChildren,
|
|
568
|
+
args: [LayoutDefaultHeaderItemComponent, { descendants: false }]
|
|
569
|
+
}], options: [{
|
|
570
|
+
type: Input
|
|
571
|
+
}], asideUser: [{
|
|
572
|
+
type: Input
|
|
573
|
+
}], nav: [{
|
|
574
|
+
type: Input
|
|
575
|
+
}], content: [{
|
|
576
|
+
type: Input
|
|
577
|
+
}], customError: [{
|
|
578
|
+
type: Input
|
|
579
|
+
}] } });
|
|
580
|
+
|
|
581
|
+
class LayoutDefaultHeaderItemTriggerDirective {
|
|
582
|
+
}
|
|
583
|
+
LayoutDefaultHeaderItemTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderItemTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
584
|
+
LayoutDefaultHeaderItemTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: LayoutDefaultHeaderItemTriggerDirective, selector: "[layout-default-header-item-trigger]", host: { properties: { "class.alain-default__nav-item": "true" } }, ngImport: i0 });
|
|
585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultHeaderItemTriggerDirective, decorators: [{
|
|
586
|
+
type: Directive,
|
|
587
|
+
args: [{
|
|
588
|
+
selector: '[layout-default-header-item-trigger]',
|
|
589
|
+
host: {
|
|
590
|
+
'[class.alain-default__nav-item]': `true`
|
|
591
|
+
}
|
|
592
|
+
}]
|
|
593
|
+
}] });
|
|
594
|
+
|
|
595
|
+
const COMPONENTS = [
|
|
596
|
+
LayoutDefaultComponent,
|
|
597
|
+
LayoutDefaultNavComponent,
|
|
598
|
+
LayoutDefaultHeaderComponent,
|
|
599
|
+
LayoutDefaultHeaderItemComponent,
|
|
600
|
+
LayoutDefaultHeaderItemTriggerDirective
|
|
601
|
+
];
|
|
602
|
+
class LayoutDefaultModule {
|
|
603
|
+
}
|
|
604
|
+
LayoutDefaultModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
605
|
+
LayoutDefaultModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultModule, declarations: [LayoutDefaultComponent,
|
|
606
|
+
LayoutDefaultNavComponent,
|
|
607
|
+
LayoutDefaultHeaderComponent,
|
|
608
|
+
LayoutDefaultHeaderItemComponent,
|
|
609
|
+
LayoutDefaultHeaderItemTriggerDirective], imports: [CommonModule,
|
|
610
|
+
RouterModule,
|
|
611
|
+
NzToolTipModule,
|
|
612
|
+
NzIconModule,
|
|
613
|
+
NzAvatarModule,
|
|
614
|
+
NzDropDownModule,
|
|
615
|
+
NzMessageModule,
|
|
616
|
+
NzBadgeModule], exports: [LayoutDefaultComponent,
|
|
617
|
+
LayoutDefaultNavComponent,
|
|
618
|
+
LayoutDefaultHeaderComponent,
|
|
619
|
+
LayoutDefaultHeaderItemComponent,
|
|
620
|
+
LayoutDefaultHeaderItemTriggerDirective] });
|
|
621
|
+
LayoutDefaultModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultModule, imports: [[
|
|
622
|
+
CommonModule,
|
|
623
|
+
RouterModule,
|
|
624
|
+
NzToolTipModule,
|
|
625
|
+
NzIconModule,
|
|
626
|
+
NzAvatarModule,
|
|
627
|
+
NzDropDownModule,
|
|
628
|
+
NzMessageModule,
|
|
629
|
+
NzBadgeModule
|
|
630
|
+
]] });
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: LayoutDefaultModule, decorators: [{
|
|
632
|
+
type: NgModule,
|
|
633
|
+
args: [{
|
|
634
|
+
imports: [
|
|
635
|
+
CommonModule,
|
|
636
|
+
RouterModule,
|
|
637
|
+
NzToolTipModule,
|
|
638
|
+
NzIconModule,
|
|
639
|
+
NzAvatarModule,
|
|
640
|
+
NzDropDownModule,
|
|
641
|
+
NzMessageModule,
|
|
642
|
+
NzBadgeModule
|
|
643
|
+
],
|
|
644
|
+
declarations: COMPONENTS,
|
|
645
|
+
exports: COMPONENTS
|
|
646
|
+
}]
|
|
647
|
+
}] });
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Generated bundle index. Do not edit.
|
|
651
|
+
*/
|
|
652
|
+
|
|
653
|
+
export { LayoutDefaultComponent, LayoutDefaultHeaderComponent, LayoutDefaultHeaderItemComponent, LayoutDefaultHeaderItemTriggerDirective, LayoutDefaultModule, LayoutDefaultNavComponent };
|
|
654
|
+
//# sourceMappingURL=layout-default.mjs.map
|