aril 0.0.6 → 0.0.7
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/aril-0.0.7.tgz +0 -0
- package/esm2022/http/lib/enums.mjs +2 -1
- package/esm2022/http/lib/interfaces.mjs +1 -1
- package/esm2022/http/src/httpClient.mjs +1 -1
- package/esm2022/http/src/serviceBase.mjs +5 -5
- package/esm2022/http/src/serviceStateMethods.mjs +5 -2
- package/esm2022/theme/layout/app/breadcrumb/app.breadcrumb.component.mjs +41 -0
- package/esm2022/theme/layout/app/config/app.config.component.mjs +134 -0
- package/esm2022/theme/layout/app/layout/app.layout.component.mjs +131 -0
- package/esm2022/theme/layout/app/menu/app.menu.component.mjs +399 -0
- package/esm2022/theme/layout/app/profileSidebar/app.profilesidebar.component.mjs +25 -0
- package/esm2022/theme/layout/app/sidebar/app.sidebar.component.mjs +41 -0
- package/esm2022/theme/layout/app/topbar/app.topbar.component.mjs +29 -0
- package/esm2022/theme/layout/aril-theme-layout.mjs +5 -0
- package/esm2022/theme/layout/index.mjs +2 -0
- package/esm2022/theme/layout/service/app.layout.service.mjs +132 -0
- package/esm2022/theme/layout/service/app.menu.service.mjs +27 -0
- package/esm2022/theme/layout/service/menuchangeevent.mjs +2 -0
- package/esm2022/ui/badge/src/badge.component.mjs +1 -1
- package/esm2022/ui/button/src/button.component.mjs +1 -1
- package/esm2022/ui/button/src/split-button.component.mjs +1 -1
- package/esm2022/ui/calendar/src/calendar.component.mjs +1 -1
- package/esm2022/ui/checkbox/src/check-box.component.mjs +3 -3
- package/esm2022/ui/checkbox/src/tri-state-checkbox.component.mjs +3 -3
- package/esm2022/ui/field/src/field.component.mjs +1 -1
- package/esm2022/ui/fileUpload/src/file-upload.component.mjs +1 -1
- package/esm2022/ui/form/index.mjs +20 -13
- package/esm2022/ui/form/src/form-submit-button.component.mjs +4 -3
- package/esm2022/ui/form/src/form.component.mjs +3 -3
- package/esm2022/ui/lib/src/form/form-error-message.component.mjs +1 -1
- package/esm2022/ui/lib/src/form/form-error-message.directive.mjs +1 -1
- package/esm2022/ui/lib/src/input/baseInput.mjs +1 -1
- package/esm2022/ui/lib/src/input/common-input-validators.service.mjs +1 -1
- package/esm2022/ui/lib/src/input/dx-input-error-message.pipe.mjs +1 -1
- package/esm2022/ui/mask/src/mask.component.mjs +3 -3
- package/esm2022/ui/number/src/number.component.mjs +2 -2
- package/esm2022/ui/overlayPanel/src/overlay-panel.component.mjs +1 -1
- package/esm2022/ui/panel/src/panel.component.mjs +2 -2
- package/esm2022/ui/password/src/password.component.mjs +1 -1
- package/esm2022/ui/radioButton/src/radio-button.component.mjs +1 -1
- package/esm2022/ui/selectBox/src/select-box.component.mjs +1 -1
- package/esm2022/ui/switch/src/switch.component.mjs +1 -1
- package/esm2022/ui/table/index.mjs +26 -17
- package/esm2022/ui/table/src/table-column.component.mjs +6 -4
- package/esm2022/ui/table/src/table.component.mjs +24 -42
- package/esm2022/ui/tagBox/src/tag-box.component.mjs +1 -1
- package/esm2022/ui/text/src/text.component.mjs +1 -1
- package/esm2022/ui/textArea/src/text-area.component.mjs +1 -1
- package/esm2022/ui/tree/src/tree.component.mjs +29 -45
- package/esm2022/ui/treeTable/src/tree-table.component.mjs +39 -43
- package/esm2022/ui/value/src/value.component.mjs +3 -3
- package/fesm2022/aril-http.mjs +7 -4
- package/fesm2022/aril-http.mjs.map +1 -1
- package/fesm2022/aril-theme-layout.mjs +918 -0
- package/fesm2022/aril-theme-layout.mjs.map +1 -0
- package/fesm2022/aril-ui-badge.mjs.map +1 -1
- package/fesm2022/aril-ui-button.mjs.map +1 -1
- package/fesm2022/aril-ui-calendar.mjs.map +1 -1
- package/fesm2022/aril-ui-checkbox.mjs +4 -4
- package/fesm2022/aril-ui-checkbox.mjs.map +1 -1
- package/fesm2022/aril-ui-field.mjs.map +1 -1
- package/fesm2022/aril-ui-fileUpload.mjs.map +1 -1
- package/fesm2022/aril-ui-form.mjs +22 -19
- package/fesm2022/aril-ui-form.mjs.map +1 -1
- package/fesm2022/aril-ui-lib.mjs.map +1 -1
- package/fesm2022/aril-ui-mask.mjs +3 -3
- package/fesm2022/aril-ui-mask.mjs.map +1 -1
- package/fesm2022/aril-ui-number.mjs +2 -2
- package/fesm2022/aril-ui-number.mjs.map +1 -1
- package/fesm2022/aril-ui-overlayPanel.mjs.map +1 -1
- package/fesm2022/aril-ui-panel.mjs.map +1 -1
- package/fesm2022/aril-ui-password.mjs.map +1 -1
- package/fesm2022/aril-ui-radioButton.mjs.map +1 -1
- package/fesm2022/aril-ui-selectBox.mjs.map +1 -1
- package/fesm2022/aril-ui-switch.mjs.map +1 -1
- package/fesm2022/aril-ui-table.mjs +45 -57
- package/fesm2022/aril-ui-table.mjs.map +1 -1
- package/fesm2022/aril-ui-tagBox.mjs.map +1 -1
- package/fesm2022/aril-ui-text.mjs.map +1 -1
- package/fesm2022/aril-ui-textArea.mjs.map +1 -1
- package/fesm2022/aril-ui-tree.mjs +28 -44
- package/fesm2022/aril-ui-tree.mjs.map +1 -1
- package/fesm2022/aril-ui-treeTable.mjs +38 -42
- package/fesm2022/aril-ui-treeTable.mjs.map +1 -1
- package/fesm2022/aril-ui-value.mjs +2 -2
- package/fesm2022/aril-ui-value.mjs.map +1 -1
- package/http/lib/enums.d.ts +1 -0
- package/http/lib/interfaces.d.ts +2 -0
- package/http/src/serviceStateMethods.d.ts +2 -1
- package/package.json +7 -1
- package/theme/layout/app/breadcrumb/app.breadcrumb.component.d.ts +16 -0
- package/theme/layout/app/breadcrumb/app.breadcrumb.component.html +10 -0
- package/theme/layout/app/breadcrumb/app.breadcrumb.component.ts +52 -0
- package/theme/layout/app/config/app.config.component.d.ts +36 -0
- package/theme/layout/app/config/app.config.component.html +191 -0
- package/theme/layout/app/config/app.config.component.ts +152 -0
- package/theme/layout/app/layout/app.layout.component.d.ts +51 -0
- package/theme/layout/app/layout/app.layout.component.html +13 -0
- package/theme/layout/app/layout/app.layout.component.ts +183 -0
- package/theme/layout/app/menu/app.menu.component.d.ts +44 -0
- package/theme/layout/app/menu/app.menu.component.html +9 -0
- package/theme/layout/app/menu/app.menu.component.ts +317 -0
- package/theme/layout/app/profileSidebar/app.profilesidebar.component.d.ts +10 -0
- package/theme/layout/app/profileSidebar/app.profilesidebar.component.html +165 -0
- package/theme/layout/app/profileSidebar/app.profilesidebar.component.ts +25 -0
- package/theme/layout/app/sidebar/app.sidebar.component.d.ts +15 -0
- package/theme/layout/app/sidebar/app.sidebar.component.html +67 -0
- package/theme/layout/app/sidebar/app.sidebar.component.ts +40 -0
- package/theme/layout/app/topbar/app.topbar.component.d.ts +13 -0
- package/theme/layout/app/topbar/app.topbar.component.html +41 -0
- package/theme/layout/app/topbar/app.topbar.component.ts +29 -0
- package/theme/layout/index.d.ts +1 -0
- package/theme/layout/index.ts +1 -0
- package/theme/layout/ng-package.json +6 -0
- package/theme/layout/service/app.layout.service.d.ts +51 -0
- package/theme/layout/service/app.layout.service.ts +197 -0
- package/theme/layout/service/app.menu.service.d.ts +14 -0
- package/theme/layout/service/app.menu.service.ts +28 -0
- package/theme/layout/service/menuchangeevent.d.ts +4 -0
- package/theme/layout/service/menuchangeevent.ts +4 -0
- package/ui/calendar/src/calendar.component.d.ts +1 -1
- package/ui/form/index.d.ts +9 -0
- package/ui/form/src/form-submit-button.component.d.ts +1 -1
- package/ui/form/src/form.component.d.ts +1 -1
- package/ui/table/index.d.ts +14 -0
- package/ui/table/src/table-column.component.d.ts +5 -4
- package/ui/table/src/table.component.d.ts +7 -15
- package/ui/tree/src/tree.component.d.ts +13 -18
- package/ui/treeTable/src/tree-table.component.d.ts +14 -18
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { NgClass, NgStyle } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
import { SidebarModule } from 'primeng/sidebar';
|
|
6
|
+
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
7
|
+
import { ButtonModule } from 'primeng/button';
|
|
8
|
+
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
9
|
+
|
|
10
|
+
import { MenuService } from '../../service/app.menu.service';
|
|
11
|
+
import {
|
|
12
|
+
ColorScheme,
|
|
13
|
+
LayoutService,
|
|
14
|
+
MenuColorScheme,
|
|
15
|
+
MenuMode,
|
|
16
|
+
} from '../../service/app.layout.service';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
standalone: true,
|
|
20
|
+
selector: 'app-config',
|
|
21
|
+
imports: [FormsModule, SidebarModule, RadioButtonModule, ButtonModule, InputSwitchModule, NgStyle, NgClass],
|
|
22
|
+
templateUrl: './app.config.component.html',
|
|
23
|
+
})
|
|
24
|
+
export class AppConfigComponent implements OnInit {
|
|
25
|
+
@Input() minimal: boolean = false;
|
|
26
|
+
|
|
27
|
+
componentThemes: any[] = [];
|
|
28
|
+
|
|
29
|
+
scales: number[] = [12, 13, 14, 15, 16];
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
public layoutService: LayoutService,
|
|
33
|
+
public menuService: MenuService
|
|
34
|
+
) { }
|
|
35
|
+
|
|
36
|
+
get visible(): boolean {
|
|
37
|
+
return this.layoutService.state.configSidebarVisible;
|
|
38
|
+
}
|
|
39
|
+
set visible(_val: boolean) {
|
|
40
|
+
this.layoutService.state.configSidebarVisible = _val;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get scale(): number {
|
|
44
|
+
return this.layoutService.config().scale;
|
|
45
|
+
}
|
|
46
|
+
set scale(_val: number) {
|
|
47
|
+
this.layoutService.config.update((config) => ({
|
|
48
|
+
...config,
|
|
49
|
+
scale: _val,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get menuMode(): MenuMode {
|
|
54
|
+
return this.layoutService.config().menuMode;
|
|
55
|
+
}
|
|
56
|
+
set menuMode(_val: MenuMode) {
|
|
57
|
+
this.layoutService.config.update((config) => ({
|
|
58
|
+
...config,
|
|
59
|
+
menuMode: _val,
|
|
60
|
+
}));
|
|
61
|
+
if (
|
|
62
|
+
this.layoutService.isSlimPlus() ||
|
|
63
|
+
this.layoutService.isSlim() ||
|
|
64
|
+
this.layoutService.isHorizontal()
|
|
65
|
+
) {
|
|
66
|
+
this.menuService.reset();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get colorScheme(): ColorScheme {
|
|
71
|
+
return this.layoutService.config().colorScheme;
|
|
72
|
+
}
|
|
73
|
+
set colorScheme(_val: ColorScheme) {
|
|
74
|
+
this.layoutService.config.update((config) => ({
|
|
75
|
+
...config,
|
|
76
|
+
colorScheme: _val,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get inputStyle(): string {
|
|
81
|
+
return this.layoutService.config().inputStyle;
|
|
82
|
+
}
|
|
83
|
+
set inputStyle(_val: string) {
|
|
84
|
+
this.layoutService.config.update((config) => ({
|
|
85
|
+
...config,
|
|
86
|
+
inputStyle: _val,
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
get ripple(): boolean {
|
|
91
|
+
return this.layoutService.config().ripple;
|
|
92
|
+
}
|
|
93
|
+
set ripple(_val: boolean) {
|
|
94
|
+
this.layoutService.config.update((config) => ({
|
|
95
|
+
...config,
|
|
96
|
+
ripple: _val,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get menuTheme(): MenuColorScheme {
|
|
101
|
+
return this.layoutService.config().menuTheme;
|
|
102
|
+
}
|
|
103
|
+
set menuTheme(_val: MenuColorScheme) {
|
|
104
|
+
this.layoutService.config.update((config) => ({
|
|
105
|
+
...config,
|
|
106
|
+
menuTheme: _val,
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get theme(): string {
|
|
111
|
+
return this.layoutService.config().theme;
|
|
112
|
+
}
|
|
113
|
+
set theme(_val: string) {
|
|
114
|
+
this.layoutService.config.update((config) => ({
|
|
115
|
+
...config,
|
|
116
|
+
theme: _val,
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ngOnInit() {
|
|
121
|
+
this.componentThemes = [
|
|
122
|
+
{ name: 'indigo', color: '#6366F1' },
|
|
123
|
+
{ name: 'blue', color: '#3B82F6' },
|
|
124
|
+
{ name: 'purple', color: '#8B5CF6' },
|
|
125
|
+
{ name: 'teal', color: '#14B8A6' },
|
|
126
|
+
{ name: 'cyan', color: '#06b6d4' },
|
|
127
|
+
{ name: 'green', color: '#10b981' },
|
|
128
|
+
{ name: 'orange', color: '#f59e0b' },
|
|
129
|
+
{ name: 'pink', color: '#d946ef' },
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onConfigButtonClick() {
|
|
134
|
+
this.layoutService.showConfigSidebar();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
changeColorScheme(colorScheme: ColorScheme) {
|
|
138
|
+
this.colorScheme = colorScheme;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
changeTheme(theme: string) {
|
|
142
|
+
this.theme = theme;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
decrementScale() {
|
|
146
|
+
this.scale--;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
incrementScale() {
|
|
150
|
+
this.scale++;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OnDestroy, Renderer2 } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { MenuItem } from 'primeng/api';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import { MenuService } from '../../service/app.menu.service';
|
|
6
|
+
import { AppSidebarComponent } from '../sidebar/app.sidebar.component';
|
|
7
|
+
import { AppTopbarComponent } from '../topbar/app.topbar.component';
|
|
8
|
+
import { LayoutService } from '../../service/app.layout.service';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class AppLayoutComponent implements OnDestroy {
|
|
11
|
+
private menuService;
|
|
12
|
+
layoutService: LayoutService;
|
|
13
|
+
renderer: Renderer2;
|
|
14
|
+
router: Router;
|
|
15
|
+
private route;
|
|
16
|
+
sidebarItems: import("@angular/core").InputSignal<MenuItem[], MenuItem[]>;
|
|
17
|
+
overlayMenuOpenSubscription: Subscription;
|
|
18
|
+
menuOutsideClickListener: any;
|
|
19
|
+
menuScrollListener: any;
|
|
20
|
+
appSidebar: AppSidebarComponent;
|
|
21
|
+
appTopbar: AppTopbarComponent;
|
|
22
|
+
constructor(menuService: MenuService, layoutService: LayoutService, renderer: Renderer2, router: Router, route: ActivatedRoute);
|
|
23
|
+
blockBodyScroll(): void;
|
|
24
|
+
unblockBodyScroll(): void;
|
|
25
|
+
hideMenu(): void;
|
|
26
|
+
get containerClass(): {
|
|
27
|
+
'layout-light': boolean;
|
|
28
|
+
'layout-dim': boolean;
|
|
29
|
+
'layout-dark': boolean;
|
|
30
|
+
'layout-colorscheme-menu': boolean;
|
|
31
|
+
'layout-primarycolor-menu': boolean;
|
|
32
|
+
'layout-transparent-menu': boolean;
|
|
33
|
+
'layout-overlay': boolean;
|
|
34
|
+
'layout-static': boolean;
|
|
35
|
+
'layout-slim': boolean;
|
|
36
|
+
'layout-slim-plus': boolean;
|
|
37
|
+
'layout-horizontal': boolean;
|
|
38
|
+
'layout-reveal': boolean;
|
|
39
|
+
'layout-drawer': boolean;
|
|
40
|
+
'layout-static-inactive': boolean;
|
|
41
|
+
'layout-overlay-active': boolean;
|
|
42
|
+
'layout-mobile-active': boolean;
|
|
43
|
+
'p-input-filled': boolean;
|
|
44
|
+
'p-ripple-disabled': boolean;
|
|
45
|
+
'layout-sidebar-active': boolean;
|
|
46
|
+
'layout-sidebar-anchored': boolean;
|
|
47
|
+
};
|
|
48
|
+
ngOnDestroy(): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppLayoutComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppLayoutComponent, "app-layout", never, { "sidebarItems": { "alias": "sidebarItems"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="layout-container" [ngClass]="containerClass">
|
|
2
|
+
<app-sidebar></app-sidebar>
|
|
3
|
+
<div class="layout-content-wrapper">
|
|
4
|
+
<app-topbar></app-topbar>
|
|
5
|
+
<!-- <app-breadcrumb class="content-breadcrumb"></app-breadcrumb> -->
|
|
6
|
+
<div class="layout-content">
|
|
7
|
+
<router-outlet></router-outlet>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<app-profilemenu></app-profilemenu>
|
|
11
|
+
<app-config></app-config>
|
|
12
|
+
<div class="layout-mask"></div>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { NgClass } from '@angular/common';
|
|
2
|
+
import { Component, OnDestroy, Renderer2, ViewChild, effect, input } from '@angular/core';
|
|
3
|
+
import { ActivatedRoute, NavigationEnd, Router, RouterOutlet } from '@angular/router';
|
|
4
|
+
|
|
5
|
+
import { MenuItem } from 'primeng/api';
|
|
6
|
+
import { filter, Subscription } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
import { MenuService } from '../../service/app.menu.service';
|
|
9
|
+
import { AppSidebarComponent } from '../sidebar/app.sidebar.component';
|
|
10
|
+
import { AppTopbarComponent } from '../topbar/app.topbar.component';
|
|
11
|
+
import { AppBreadcrumbComponent } from '../breadcrumb/app.breadcrumb.component';
|
|
12
|
+
import { AppProfileSidebarComponent } from '../profileSidebar/app.profilesidebar.component';
|
|
13
|
+
import { LayoutService } from '../../service/app.layout.service';
|
|
14
|
+
import { AppConfigComponent } from '../config/app.config.component';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
standalone: true,
|
|
18
|
+
selector: 'app-layout',
|
|
19
|
+
imports: [NgClass, RouterOutlet, AppSidebarComponent, AppTopbarComponent, AppBreadcrumbComponent, AppProfileSidebarComponent, AppConfigComponent],
|
|
20
|
+
templateUrl: './app.layout.component.html'
|
|
21
|
+
})
|
|
22
|
+
export class AppLayoutComponent implements OnDestroy {
|
|
23
|
+
sidebarItems = input<MenuItem[]>([]);
|
|
24
|
+
|
|
25
|
+
overlayMenuOpenSubscription: Subscription;
|
|
26
|
+
|
|
27
|
+
menuOutsideClickListener: any;
|
|
28
|
+
|
|
29
|
+
menuScrollListener: any;
|
|
30
|
+
|
|
31
|
+
@ViewChild(AppSidebarComponent) appSidebar!: AppSidebarComponent;
|
|
32
|
+
|
|
33
|
+
@ViewChild(AppTopbarComponent) appTopbar!: AppTopbarComponent;
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
private menuService: MenuService,
|
|
37
|
+
public layoutService: LayoutService,
|
|
38
|
+
public renderer: Renderer2,
|
|
39
|
+
public router: Router,
|
|
40
|
+
private route: ActivatedRoute
|
|
41
|
+
) {
|
|
42
|
+
this.overlayMenuOpenSubscription = this.layoutService.overlayOpen$.subscribe(() => {
|
|
43
|
+
if (!this.menuOutsideClickListener) {
|
|
44
|
+
this.menuOutsideClickListener = this.renderer.listen(
|
|
45
|
+
'document',
|
|
46
|
+
'click',
|
|
47
|
+
(event) => {
|
|
48
|
+
const isOutsideClicked = !(
|
|
49
|
+
this.appSidebar.el.nativeElement.isSameNode(
|
|
50
|
+
event.target
|
|
51
|
+
) ||
|
|
52
|
+
this.appSidebar.el.nativeElement.contains(
|
|
53
|
+
event.target
|
|
54
|
+
) ||
|
|
55
|
+
this.appTopbar.menuButton.nativeElement.isSameNode(
|
|
56
|
+
event.target
|
|
57
|
+
) ||
|
|
58
|
+
this.appTopbar.menuButton.nativeElement.contains(
|
|
59
|
+
event.target
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
if (isOutsideClicked) {
|
|
63
|
+
this.hideMenu();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (
|
|
70
|
+
(this.layoutService.isHorizontal() || this.layoutService.isSlim() || this.layoutService.isSlimPlus()) && !this.menuScrollListener) {
|
|
71
|
+
this.menuScrollListener = this.renderer.listen(
|
|
72
|
+
this.appSidebar.menuContainer.nativeElement,
|
|
73
|
+
'scroll',
|
|
74
|
+
(event) => {
|
|
75
|
+
if (this.layoutService.isDesktop()) {
|
|
76
|
+
this.hideMenu();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (this.layoutService.state.staticMenuMobileActive) {
|
|
83
|
+
this.blockBodyScroll();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
|
88
|
+
this.hideMenu();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
effect(() => {
|
|
92
|
+
this.menuService.menuItems.set(this.sidebarItems());
|
|
93
|
+
}, { allowSignalWrites: true });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
blockBodyScroll(): void {
|
|
97
|
+
if (document.body.classList) {
|
|
98
|
+
document.body.classList.add('blocked-scroll');
|
|
99
|
+
} else {
|
|
100
|
+
document.body.className += ' blocked-scroll';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
unblockBodyScroll(): void {
|
|
105
|
+
if (document.body.classList) {
|
|
106
|
+
document.body.classList.remove('blocked-scroll');
|
|
107
|
+
} else {
|
|
108
|
+
document.body.className = document.body.className.replace(
|
|
109
|
+
new RegExp(
|
|
110
|
+
'(^|\\b)' +
|
|
111
|
+
'blocked-scroll'.split(' ').join('|') +
|
|
112
|
+
'(\\b|$)',
|
|
113
|
+
'gi'
|
|
114
|
+
),
|
|
115
|
+
' '
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
hideMenu() {
|
|
121
|
+
this.layoutService.state.overlayMenuActive = false;
|
|
122
|
+
this.layoutService.state.staticMenuMobileActive = false;
|
|
123
|
+
this.layoutService.state.menuHoverActive = false;
|
|
124
|
+
this.menuService.reset();
|
|
125
|
+
|
|
126
|
+
if (this.menuOutsideClickListener) {
|
|
127
|
+
this.menuOutsideClickListener();
|
|
128
|
+
this.menuOutsideClickListener = null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (this.menuScrollListener) {
|
|
132
|
+
this.menuScrollListener();
|
|
133
|
+
this.menuScrollListener = null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
this.unblockBodyScroll();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
get containerClass() {
|
|
140
|
+
return {
|
|
141
|
+
'layout-light': this.layoutService.config().colorScheme === 'light',
|
|
142
|
+
'layout-dim': this.layoutService.config().colorScheme === 'dim',
|
|
143
|
+
'layout-dark': this.layoutService.config().colorScheme === 'dark',
|
|
144
|
+
'layout-colorscheme-menu':
|
|
145
|
+
this.layoutService.config().menuTheme === 'colorScheme',
|
|
146
|
+
'layout-primarycolor-menu':
|
|
147
|
+
this.layoutService.config().menuTheme === 'primaryColor',
|
|
148
|
+
'layout-transparent-menu':
|
|
149
|
+
this.layoutService.config().menuTheme === 'transparent',
|
|
150
|
+
'layout-overlay':
|
|
151
|
+
this.layoutService.config().menuMode === 'overlay',
|
|
152
|
+
'layout-static': this.layoutService.config().menuMode === 'static',
|
|
153
|
+
'layout-slim': this.layoutService.config().menuMode === 'slim',
|
|
154
|
+
'layout-slim-plus':
|
|
155
|
+
this.layoutService.config().menuMode === 'slim-plus',
|
|
156
|
+
'layout-horizontal':
|
|
157
|
+
this.layoutService.config().menuMode === 'horizontal',
|
|
158
|
+
'layout-reveal': this.layoutService.config().menuMode === 'reveal',
|
|
159
|
+
'layout-drawer': this.layoutService.config().menuMode === 'drawer',
|
|
160
|
+
'layout-static-inactive':
|
|
161
|
+
this.layoutService.state.staticMenuDesktopInactive &&
|
|
162
|
+
this.layoutService.config().menuMode === 'static',
|
|
163
|
+
'layout-overlay-active': this.layoutService.state.overlayMenuActive,
|
|
164
|
+
'layout-mobile-active':
|
|
165
|
+
this.layoutService.state.staticMenuMobileActive,
|
|
166
|
+
'p-input-filled':
|
|
167
|
+
this.layoutService.config().inputStyle === 'filled',
|
|
168
|
+
'p-ripple-disabled': !this.layoutService.config().ripple,
|
|
169
|
+
'layout-sidebar-active': this.layoutService.state.sidebarActive,
|
|
170
|
+
'layout-sidebar-anchored': this.layoutService.state.anchored,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
ngOnDestroy() {
|
|
175
|
+
if (this.overlayMenuOpenSubscription) {
|
|
176
|
+
this.overlayMenuOpenSubscription.unsubscribe();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (this.menuOutsideClickListener) {
|
|
180
|
+
this.menuOutsideClickListener();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { AnimationEvent } from '@angular/animations';
|
|
4
|
+
import { MenuItem } from 'primeng/api';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
import { MenuService } from '../../service/app.menu.service';
|
|
7
|
+
import { LayoutService } from '../../service/app.layout.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class AppMenuItemComponent implements OnInit, OnDestroy {
|
|
10
|
+
layoutService: LayoutService;
|
|
11
|
+
private cd;
|
|
12
|
+
router: Router;
|
|
13
|
+
private menuService;
|
|
14
|
+
item: MenuItem;
|
|
15
|
+
index: number;
|
|
16
|
+
root: boolean;
|
|
17
|
+
parentKey: string;
|
|
18
|
+
submenu: ElementRef;
|
|
19
|
+
active: boolean;
|
|
20
|
+
menuSourceSubscription: Subscription;
|
|
21
|
+
menuResetSubscription: Subscription;
|
|
22
|
+
key: string;
|
|
23
|
+
constructor(layoutService: LayoutService, cd: ChangeDetectorRef, router: Router, menuService: MenuService);
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
ngAfterViewChecked(): void;
|
|
26
|
+
updateActiveStateFromRoute(): void;
|
|
27
|
+
onSubmenuAnimated(event: AnimationEvent): void;
|
|
28
|
+
calculatePosition(overlay: HTMLElement, target: HTMLElement): void;
|
|
29
|
+
itemClick(event: Event): void;
|
|
30
|
+
onMouseEnter(): void;
|
|
31
|
+
get submenuAnimation(): "collapsed" | "expanded" | "hidden" | "visible";
|
|
32
|
+
get isHorizontal(): boolean;
|
|
33
|
+
get isSlim(): boolean;
|
|
34
|
+
get isSlimPlus(): boolean;
|
|
35
|
+
get activeClass(): boolean;
|
|
36
|
+
ngOnDestroy(): void;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppMenuItemComponent, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppMenuItemComponent, "[app-menuitem]", never, { "item": { "alias": "item"; "required": false; }; "index": { "alias": "index"; "required": false; }; "root": { "alias": "root"; "required": false; }; "parentKey": { "alias": "parentKey"; "required": false; }; }, {}, never, never, true, never>;
|
|
39
|
+
}
|
|
40
|
+
export declare class AppMenuComponent {
|
|
41
|
+
menuService: MenuService;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppMenuComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppMenuComponent, "app-menu", never, {}, {}, never, never, true, never>;
|
|
44
|
+
}
|