aril 0.0.24 → 0.0.26
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/boot/host/src/bootstrap.d.ts +2 -1
- package/boot/mfe/src/bootstrap.d.ts +2 -1
- package/esm2022/boot/host/index.mjs +1 -1
- package/esm2022/boot/host/src/app.component.mjs +1 -1
- package/esm2022/boot/host/src/bootstrap.mjs +14 -6
- package/esm2022/boot/host/src/services/custom-manifest.mjs +1 -1
- package/esm2022/boot/host/src/services/microFrontEnd.service.mjs +1 -1
- package/esm2022/boot/host/src/services/plugin-init.token.mjs +1 -1
- package/esm2022/boot/host/src/services/showdowDOMWrapper.mjs +1 -1
- package/esm2022/boot/index.mjs +1 -1
- package/esm2022/boot/mfe/index.mjs +1 -1
- package/esm2022/boot/mfe/src/app.component.mjs +13 -13
- package/esm2022/boot/mfe/src/bootstrap.mjs +13 -5
- package/esm2022/http/lib/enums.mjs +2 -1
- package/esm2022/http/lib/interfaces.mjs +1 -2
- package/esm2022/http/src/httpClient.mjs +1 -1
- package/esm2022/http/src/serviceBase.mjs +8 -5
- package/esm2022/http/src/serviceStateMethods.mjs +1 -2
- package/esm2022/i18n/src/file-url-token.mjs +1 -1
- package/esm2022/i18n/src/i18n.module.mjs +1 -1
- package/esm2022/i18n/src/loader.mjs +2 -2
- package/esm2022/i18n/src/provideI18n.mjs +1 -1
- package/esm2022/i18n/src/provideScope.mjs +1 -1
- package/esm2022/keycloak/aril-keycloak.mjs +5 -0
- package/esm2022/keycloak/index.mjs +3 -0
- package/esm2022/keycloak/src/auth.interceptor.mjs +13 -0
- package/esm2022/keycloak/src/keycloak.manager.mjs +59 -0
- package/esm2022/public-api.mjs +1 -1
- package/esm2022/theme/index.mjs +1 -1
- package/esm2022/theme/layout/app/config/app.config.component.mjs +4 -4
- package/esm2022/theme/layout/app/layout/app.layout.component.mjs +5 -5
- package/esm2022/theme/layout/app/layout/mfe.layout.component.mjs +21 -21
- package/esm2022/theme/layout/app/menu/app.menu.component.mjs +4 -4
- package/esm2022/theme/layout/app/profileSidebar/app.profilesidebar.component.mjs +2 -2
- package/esm2022/theme/layout/app/sidebar/app.sidebar.component.mjs +2 -2
- package/esm2022/theme/layout/app/topbar/app.topbar.component.mjs +12 -9
- package/esm2022/theme/layout/service/app.layout.service.mjs +1 -1
- package/esm2022/theme/layout/service/app.menu.service.mjs +1 -1
- package/esm2022/ui/button/src/button.component.mjs +2 -2
- package/esm2022/ui/calendar/src/calendar.component.mjs +4 -4
- package/esm2022/ui/field/src/field.component.mjs +5 -5
- package/esm2022/ui/fileUpload/src/file-upload.component.mjs +3 -3
- package/esm2022/ui/form/index.mjs +2 -2
- package/esm2022/ui/form/src/form-submit-button.component.mjs +2 -2
- package/esm2022/ui/form/src/form.component.mjs +1 -1
- package/esm2022/ui/index.mjs +1 -1
- package/esm2022/ui/lib/src/form/form-error-message.directive.mjs +1 -1
- package/esm2022/ui/lib/src/form/form-field-builder.mjs +1 -1
- package/esm2022/ui/lib/src/grid/flex-grid.directive.mjs +1 -1
- package/esm2022/ui/lib/src/input/dx-input-error-message.pipe.mjs +1 -1
- package/esm2022/ui/lib/src/input/input-error-message.pipe.mjs +1 -1
- package/esm2022/ui/lib/src/input/value-accessor.directive.mjs +1 -1
- package/esm2022/ui/mask/src/mask.component.mjs +2 -2
- package/esm2022/ui/number/src/number.component.mjs +2 -2
- package/esm2022/ui/overlayPanel/src/overlay-panel.component.mjs +2 -2
- package/esm2022/ui/password/src/password.component.mjs +2 -2
- package/esm2022/ui/radioButton/src/radio-button.component.mjs +1 -1
- package/esm2022/ui/selectBox/src/select-box.component.mjs +4 -4
- package/esm2022/ui/switch/src/switch.component.mjs +2 -2
- package/esm2022/ui/table/index.mjs +3 -3
- package/esm2022/ui/table/src/table-column.component.mjs +1 -1
- package/esm2022/ui/table/src/table.component.mjs +2 -2
- package/esm2022/ui/tagBox/src/tag-box.component.mjs +1 -1
- package/esm2022/ui/text/src/text.component.mjs +2 -2
- package/esm2022/ui/textArea/src/text-area.component.mjs +3 -3
- package/esm2022/ui/tree/src/tree.component.mjs +5 -5
- package/esm2022/ui/treeTable/src/tree-table.component.mjs +4 -4
- package/esm2022/util/custom_pages/index.mjs +1 -1
- package/esm2022/util/custom_pages/src/notFound.component.mjs +109 -109
- package/esm2022/util/index.mjs +1 -1
- package/esm2022/util/lib/src/module-router.mjs +1 -1
- package/esm2022/util/lib/src/types.mjs +1 -4
- package/esm2022/util/loaders/index.mjs +1 -1
- package/esm2022/util/loaders/script/script.loader.service.mjs +1 -1
- package/esm2022/util/loaders/style/style.loader.service.mjs +1 -1
- package/esm2022/util/primitive-extensions/src/date.extensions.mjs +1 -1
- package/esm2022/util/pub-sub/src/pub-sub.service.mjs +1 -1
- package/fesm2022/{aril-app.component-tFlRp3qI.mjs → aril-app.component-sZDpvJDM.mjs} +16 -14
- package/fesm2022/aril-app.component-sZDpvJDM.mjs.map +1 -0
- package/fesm2022/{aril-aril--3c18nTH.mjs → aril-aril-D__IXMsf.mjs} +24 -10
- package/fesm2022/aril-aril-D__IXMsf.mjs.map +1 -0
- package/fesm2022/aril-boot-host.mjs +13 -5
- package/fesm2022/aril-boot-host.mjs.map +1 -1
- package/fesm2022/{aril-boot-mfe-app.component-wYzFs1Za.mjs → aril-boot-mfe-app.component-zro0FnKY.mjs} +15 -13
- package/fesm2022/aril-boot-mfe-app.component-zro0FnKY.mjs.map +1 -0
- package/fesm2022/aril-boot-mfe.mjs +13 -5
- package/fesm2022/aril-boot-mfe.mjs.map +1 -1
- package/fesm2022/aril-boot.mjs.map +1 -1
- package/fesm2022/aril-http.mjs +6 -4
- package/fesm2022/aril-http.mjs.map +1 -1
- package/fesm2022/aril-i18n.mjs +1 -1
- package/fesm2022/aril-i18n.mjs.map +1 -1
- package/fesm2022/aril-keycloak.mjs +77 -0
- package/fesm2022/aril-keycloak.mjs.map +1 -0
- package/fesm2022/aril-theme-layout.mjs +266 -264
- package/fesm2022/aril-theme-layout.mjs.map +1 -1
- package/fesm2022/aril-theme.mjs.map +1 -1
- package/fesm2022/aril-ui-button.mjs.map +1 -1
- package/fesm2022/aril-ui-calendar.mjs +3 -3
- package/fesm2022/aril-ui-calendar.mjs.map +1 -1
- package/fesm2022/aril-ui-field.mjs +3 -3
- package/fesm2022/aril-ui-field.mjs.map +1 -1
- package/fesm2022/aril-ui-fileUpload.mjs +2 -2
- package/fesm2022/aril-ui-fileUpload.mjs.map +1 -1
- package/fesm2022/aril-ui-form.mjs +28 -28
- package/fesm2022/aril-ui-form.mjs.map +1 -1
- package/fesm2022/aril-ui-lib.mjs.map +1 -1
- package/fesm2022/aril-ui-mask.mjs +1 -1
- 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-password.mjs +2 -2
- package/fesm2022/aril-ui-password.mjs.map +1 -1
- package/fesm2022/aril-ui-radioButton.mjs.map +1 -1
- package/fesm2022/aril-ui-selectBox.mjs +2 -2
- package/fesm2022/aril-ui-selectBox.mjs.map +1 -1
- package/fesm2022/aril-ui-switch.mjs +2 -2
- package/fesm2022/aril-ui-switch.mjs.map +1 -1
- package/fesm2022/aril-ui-table.mjs +23 -23
- package/fesm2022/aril-ui-table.mjs.map +1 -1
- package/fesm2022/aril-ui-tagBox.mjs.map +1 -1
- package/fesm2022/aril-ui-text.mjs +1 -1
- package/fesm2022/aril-ui-text.mjs.map +1 -1
- package/fesm2022/aril-ui-textArea.mjs +2 -2
- package/fesm2022/aril-ui-textArea.mjs.map +1 -1
- package/fesm2022/aril-ui-tree.mjs +4 -4
- package/fesm2022/aril-ui-tree.mjs.map +1 -1
- package/fesm2022/aril-ui-treeTable.mjs +2 -2
- package/fesm2022/aril-ui-treeTable.mjs.map +1 -1
- package/fesm2022/aril-ui.mjs.map +1 -1
- package/fesm2022/aril-util-custom_pages.mjs +108 -108
- package/fesm2022/aril-util-custom_pages.mjs.map +1 -1
- package/fesm2022/aril-util-lib.mjs +0 -3
- package/fesm2022/aril-util-lib.mjs.map +1 -1
- package/fesm2022/aril-util-loaders.mjs.map +1 -1
- package/fesm2022/aril-util-primitive-extensions.mjs.map +1 -1
- package/fesm2022/aril-util-pub-sub.mjs.map +1 -1
- package/fesm2022/aril-util.mjs.map +1 -1
- package/fesm2022/aril.mjs +3 -1
- package/fesm2022/aril.mjs.map +1 -1
- package/http/lib/enums.d.ts +1 -0
- package/keycloak/index.d.ts +2 -0
- package/keycloak/src/auth.interceptor.d.ts +2 -0
- package/keycloak/src/keycloak.manager.d.ts +24 -0
- package/package.json +10 -2
- package/styles/ui/ui.common.scss +24 -24
- package/theme/index.ts +1 -1
- package/theme/layout/app/config/app.config.component.d.ts +1 -1
- package/theme/layout/app/config/app.config.component.ts +4 -4
- package/theme/layout/app/layout/app.layout.component.d.ts +1 -1
- package/theme/layout/app/layout/app.layout.component.ts +6 -6
- package/theme/layout/app/layout/mfe.layout.component.ts +49 -49
- package/theme/layout/app/menu/app.menu.component.d.ts +2 -2
- package/theme/layout/app/menu/app.menu.component.ts +2 -2
- package/theme/layout/app/menu/app.sub.menu.component.html +13 -13
- package/theme/layout/app/profileSidebar/app.profilesidebar.component.ts +1 -1
- package/theme/layout/app/sidebar/app.sidebar.component.ts +1 -1
- package/theme/layout/app/topbar/app.topbar.component.d.ts +3 -2
- package/theme/layout/app/topbar/app.topbar.component.html +45 -37
- package/theme/layout/app/topbar/app.topbar.component.ts +32 -28
- package/theme/layout/service/app.layout.service.ts +178 -178
- package/theme/layout/service/app.menu.service.ts +59 -57
- package/theme/ng-package.json +6 -6
- package/theme/styles/theme/base/components/data/_paginator.scss +92 -92
- package/theme/styles/theme/dark/_variables.scss +918 -918
- package/theme/styles/theme/light/_variables.scss +911 -911
- package/ui/selectBox/src/select-box.component.d.ts +1 -1
- package/ui/table/src/table.component.d.ts +1 -1
- package/fesm2022/aril-app.component-tFlRp3qI.mjs.map +0 -1
- package/fesm2022/aril-aril--3c18nTH.mjs.map +0 -1
- package/fesm2022/aril-boot-mfe-app.component-wYzFs1Za.mjs.map +0 -1
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
import { Injectable, effect, signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
|
|
5
|
-
export type MenuMode = 'static' | 'overlay' | 'horizontal' | 'slim' | 'slim-plus' | 'reveal' | 'drawer';
|
|
6
|
-
|
|
7
|
-
export type ColorScheme = 'light' | 'dark' | 'dim';
|
|
8
|
-
|
|
9
|
-
export type MenuColorScheme = 'colorScheme' | 'primaryColor' | 'transparent';
|
|
10
|
-
|
|
11
|
-
export interface AppConfig {
|
|
12
|
-
inputStyle: string;
|
|
13
|
-
colorScheme: ColorScheme;
|
|
14
|
-
theme: string;
|
|
15
|
-
ripple: boolean;
|
|
16
|
-
menuMode: MenuMode;
|
|
17
|
-
scale: number;
|
|
18
|
-
menuTheme: MenuColorScheme;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface LayoutState {
|
|
22
|
-
staticMenuDesktopInactive: boolean;
|
|
23
|
-
overlayMenuActive: boolean;
|
|
24
|
-
profileSidebarVisible: boolean;
|
|
25
|
-
configSidebarVisible: boolean;
|
|
26
|
-
staticMenuMobileActive: boolean;
|
|
27
|
-
menuHoverActive: boolean;
|
|
28
|
-
sidebarActive: boolean;
|
|
29
|
-
anchored: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Injectable({
|
|
33
|
-
providedIn: 'root'
|
|
34
|
-
})
|
|
35
|
-
export class LayoutService {
|
|
36
|
-
_config: AppConfig = {
|
|
37
|
-
ripple: false,
|
|
38
|
-
inputStyle: 'outlined',
|
|
39
|
-
menuMode: 'horizontal',
|
|
40
|
-
colorScheme: 'light',
|
|
41
|
-
theme: 'indigo',
|
|
42
|
-
scale: 12,
|
|
43
|
-
menuTheme: 'colorScheme'
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// TODO: Set User Config
|
|
47
|
-
config = signal<AppConfig>(this._config);
|
|
48
|
-
|
|
49
|
-
state: LayoutState = {
|
|
50
|
-
staticMenuDesktopInactive: false,
|
|
51
|
-
overlayMenuActive: false,
|
|
52
|
-
profileSidebarVisible: false,
|
|
53
|
-
configSidebarVisible: false,
|
|
54
|
-
staticMenuMobileActive: false,
|
|
55
|
-
menuHoverActive: false,
|
|
56
|
-
sidebarActive: false,
|
|
57
|
-
anchored: false
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
private configUpdate = new Subject<AppConfig>();
|
|
61
|
-
|
|
62
|
-
private overlayOpen = new Subject<any>();
|
|
63
|
-
|
|
64
|
-
configUpdate$ = this.configUpdate.asObservable();
|
|
65
|
-
|
|
66
|
-
overlayOpen$ = this.overlayOpen.asObservable();
|
|
67
|
-
|
|
68
|
-
constructor() {
|
|
69
|
-
effect(() => {
|
|
70
|
-
const config = this.config();
|
|
71
|
-
if (this.updateStyle(config)) {
|
|
72
|
-
this.changeTheme();
|
|
73
|
-
}
|
|
74
|
-
this.changeScale(config.scale);
|
|
75
|
-
this.onConfigUpdate();
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
updateStyle(config: AppConfig) {
|
|
80
|
-
return config.theme !== this._config.theme || config.colorScheme !== this._config.colorScheme;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
onMenuToggle() {
|
|
84
|
-
if (this.isOverlay()) {
|
|
85
|
-
this.state.overlayMenuActive = !this.state.overlayMenuActive;
|
|
86
|
-
|
|
87
|
-
if (this.state.overlayMenuActive) {
|
|
88
|
-
this.overlayOpen.next(null);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (this.isDesktop()) {
|
|
93
|
-
this.state.staticMenuDesktopInactive = !this.state.staticMenuDesktopInactive;
|
|
94
|
-
} else {
|
|
95
|
-
this.state.staticMenuMobileActive = !this.state.staticMenuMobileActive;
|
|
96
|
-
|
|
97
|
-
if (this.state.staticMenuMobileActive) {
|
|
98
|
-
this.overlayOpen.next(null);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
onOverlaySubmenuOpen() {
|
|
104
|
-
this.overlayOpen.next(null);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
showProfileSidebar() {
|
|
108
|
-
this.state.profileSidebarVisible = true;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
showConfigSidebar() {
|
|
112
|
-
this.state.configSidebarVisible = true;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
isOverlay() {
|
|
116
|
-
return this.config().menuMode === 'overlay';
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
isDesktop() {
|
|
120
|
-
return window.innerWidth > 991;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
isSlim() {
|
|
124
|
-
return this.config().menuMode === 'slim';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
isSlimPlus() {
|
|
128
|
-
return this.config().menuMode === 'slim-plus';
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
isHorizontal() {
|
|
132
|
-
return this.config().menuMode === 'horizontal';
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
isMobile() {
|
|
136
|
-
return !this.isDesktop();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
onConfigUpdate() {
|
|
140
|
-
this._config = { ...this.config() };
|
|
141
|
-
this.configUpdate.next(this.config());
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
changeTheme() {
|
|
145
|
-
const config = this.config();
|
|
146
|
-
const themeLink = <HTMLLinkElement>document.getElementById('theme-link');
|
|
147
|
-
const themeLinkHref = themeLink.getAttribute('href')!;
|
|
148
|
-
const newHref = themeLinkHref
|
|
149
|
-
.split('/')
|
|
150
|
-
.map((el) =>
|
|
151
|
-
el == this._config.theme ? (el = config.theme)
|
|
152
|
-
: el == `theme-${this._config.colorScheme}` ? (el = `theme-${config.colorScheme}`)
|
|
153
|
-
: el
|
|
154
|
-
)
|
|
155
|
-
.join('/');
|
|
156
|
-
|
|
157
|
-
this.replaceThemeLink(newHref);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
replaceThemeLink(href: string) {
|
|
161
|
-
const id = 'theme-link';
|
|
162
|
-
let themeLink = <HTMLLinkElement>document.getElementById(id);
|
|
163
|
-
const cloneLinkElement = <HTMLLinkElement>themeLink.cloneNode(true);
|
|
164
|
-
|
|
165
|
-
cloneLinkElement.setAttribute('href', href);
|
|
166
|
-
cloneLinkElement.setAttribute('id', id + '-clone');
|
|
167
|
-
|
|
168
|
-
themeLink.parentNode!.insertBefore(cloneLinkElement, themeLink.nextSibling);
|
|
169
|
-
cloneLinkElement.addEventListener('load', () => {
|
|
170
|
-
themeLink.remove();
|
|
171
|
-
cloneLinkElement.setAttribute('id', id);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
changeScale(value: number) {
|
|
176
|
-
document.documentElement.style.fontSize = `${value}px`;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
1
|
+
import { Injectable, effect, signal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
export type MenuMode = 'static' | 'overlay' | 'horizontal' | 'slim' | 'slim-plus' | 'reveal' | 'drawer';
|
|
6
|
+
|
|
7
|
+
export type ColorScheme = 'light' | 'dark' | 'dim';
|
|
8
|
+
|
|
9
|
+
export type MenuColorScheme = 'colorScheme' | 'primaryColor' | 'transparent';
|
|
10
|
+
|
|
11
|
+
export interface AppConfig {
|
|
12
|
+
inputStyle: string;
|
|
13
|
+
colorScheme: ColorScheme;
|
|
14
|
+
theme: string;
|
|
15
|
+
ripple: boolean;
|
|
16
|
+
menuMode: MenuMode;
|
|
17
|
+
scale: number;
|
|
18
|
+
menuTheme: MenuColorScheme;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface LayoutState {
|
|
22
|
+
staticMenuDesktopInactive: boolean;
|
|
23
|
+
overlayMenuActive: boolean;
|
|
24
|
+
profileSidebarVisible: boolean;
|
|
25
|
+
configSidebarVisible: boolean;
|
|
26
|
+
staticMenuMobileActive: boolean;
|
|
27
|
+
menuHoverActive: boolean;
|
|
28
|
+
sidebarActive: boolean;
|
|
29
|
+
anchored: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Injectable({
|
|
33
|
+
providedIn: 'root'
|
|
34
|
+
})
|
|
35
|
+
export class LayoutService {
|
|
36
|
+
_config: AppConfig = {
|
|
37
|
+
ripple: false,
|
|
38
|
+
inputStyle: 'outlined',
|
|
39
|
+
menuMode: 'horizontal',
|
|
40
|
+
colorScheme: 'light',
|
|
41
|
+
theme: 'indigo',
|
|
42
|
+
scale: 12,
|
|
43
|
+
menuTheme: 'colorScheme'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// TODO: Set User Config
|
|
47
|
+
config = signal<AppConfig>(this._config);
|
|
48
|
+
|
|
49
|
+
state: LayoutState = {
|
|
50
|
+
staticMenuDesktopInactive: false,
|
|
51
|
+
overlayMenuActive: false,
|
|
52
|
+
profileSidebarVisible: false,
|
|
53
|
+
configSidebarVisible: false,
|
|
54
|
+
staticMenuMobileActive: false,
|
|
55
|
+
menuHoverActive: false,
|
|
56
|
+
sidebarActive: false,
|
|
57
|
+
anchored: false
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
private configUpdate = new Subject<AppConfig>();
|
|
61
|
+
|
|
62
|
+
private overlayOpen = new Subject<any>();
|
|
63
|
+
|
|
64
|
+
configUpdate$ = this.configUpdate.asObservable();
|
|
65
|
+
|
|
66
|
+
overlayOpen$ = this.overlayOpen.asObservable();
|
|
67
|
+
|
|
68
|
+
constructor() {
|
|
69
|
+
effect(() => {
|
|
70
|
+
const config = this.config();
|
|
71
|
+
if (this.updateStyle(config)) {
|
|
72
|
+
this.changeTheme();
|
|
73
|
+
}
|
|
74
|
+
this.changeScale(config.scale);
|
|
75
|
+
this.onConfigUpdate();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
updateStyle(config: AppConfig) {
|
|
80
|
+
return config.theme !== this._config.theme || config.colorScheme !== this._config.colorScheme;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
onMenuToggle() {
|
|
84
|
+
if (this.isOverlay()) {
|
|
85
|
+
this.state.overlayMenuActive = !this.state.overlayMenuActive;
|
|
86
|
+
|
|
87
|
+
if (this.state.overlayMenuActive) {
|
|
88
|
+
this.overlayOpen.next(null);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (this.isDesktop()) {
|
|
93
|
+
this.state.staticMenuDesktopInactive = !this.state.staticMenuDesktopInactive;
|
|
94
|
+
} else {
|
|
95
|
+
this.state.staticMenuMobileActive = !this.state.staticMenuMobileActive;
|
|
96
|
+
|
|
97
|
+
if (this.state.staticMenuMobileActive) {
|
|
98
|
+
this.overlayOpen.next(null);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
onOverlaySubmenuOpen() {
|
|
104
|
+
this.overlayOpen.next(null);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
showProfileSidebar() {
|
|
108
|
+
this.state.profileSidebarVisible = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
showConfigSidebar() {
|
|
112
|
+
this.state.configSidebarVisible = true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
isOverlay() {
|
|
116
|
+
return this.config().menuMode === 'overlay';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
isDesktop() {
|
|
120
|
+
return window.innerWidth > 991;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
isSlim() {
|
|
124
|
+
return this.config().menuMode === 'slim';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
isSlimPlus() {
|
|
128
|
+
return this.config().menuMode === 'slim-plus';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
isHorizontal() {
|
|
132
|
+
return this.config().menuMode === 'horizontal';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
isMobile() {
|
|
136
|
+
return !this.isDesktop();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
onConfigUpdate() {
|
|
140
|
+
this._config = { ...this.config() };
|
|
141
|
+
this.configUpdate.next(this.config());
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
changeTheme() {
|
|
145
|
+
const config = this.config();
|
|
146
|
+
const themeLink = <HTMLLinkElement>document.getElementById('theme-link');
|
|
147
|
+
const themeLinkHref = themeLink.getAttribute('href')!;
|
|
148
|
+
const newHref = themeLinkHref
|
|
149
|
+
.split('/')
|
|
150
|
+
.map((el) =>
|
|
151
|
+
el == this._config.theme ? (el = config.theme)
|
|
152
|
+
: el == `theme-${this._config.colorScheme}` ? (el = `theme-${config.colorScheme}`)
|
|
153
|
+
: el
|
|
154
|
+
)
|
|
155
|
+
.join('/');
|
|
156
|
+
|
|
157
|
+
this.replaceThemeLink(newHref);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
replaceThemeLink(href: string) {
|
|
161
|
+
const id = 'theme-link';
|
|
162
|
+
let themeLink = <HTMLLinkElement>document.getElementById(id);
|
|
163
|
+
const cloneLinkElement = <HTMLLinkElement>themeLink.cloneNode(true);
|
|
164
|
+
|
|
165
|
+
cloneLinkElement.setAttribute('href', href);
|
|
166
|
+
cloneLinkElement.setAttribute('id', id + '-clone');
|
|
167
|
+
|
|
168
|
+
themeLink.parentNode!.insertBefore(cloneLinkElement, themeLink.nextSibling);
|
|
169
|
+
cloneLinkElement.addEventListener('load', () => {
|
|
170
|
+
themeLink.remove();
|
|
171
|
+
cloneLinkElement.setAttribute('id', id);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
changeScale(value: number) {
|
|
176
|
+
document.documentElement.style.fontSize = `${value}px`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { Injectable, computed, signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
public
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
menuItem.
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
import { Injectable, computed, signal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { MenuItem } from 'primeng/api';
|
|
4
|
+
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
import { APIs } from 'aril/http';
|
|
8
|
+
|
|
9
|
+
import { MenuChangeEvent } from './menuchangeevent';
|
|
10
|
+
|
|
11
|
+
interface MenuConfig {
|
|
12
|
+
items: MenuItem[];
|
|
13
|
+
prefix?: APIs;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Injectable({
|
|
17
|
+
providedIn: 'root'
|
|
18
|
+
})
|
|
19
|
+
export class AppMenuService {
|
|
20
|
+
private menuSource = new Subject<MenuChangeEvent>();
|
|
21
|
+
private resetSource = new Subject();
|
|
22
|
+
|
|
23
|
+
public menuConfig = signal<MenuConfig>({ items: [], prefix: undefined });
|
|
24
|
+
public subMenuConfig = signal<MenuConfig>({ items: [], prefix: undefined });
|
|
25
|
+
|
|
26
|
+
public menuItems = computed(() => {
|
|
27
|
+
const config = this.menuConfig();
|
|
28
|
+
|
|
29
|
+
if (config.prefix) return config.items.map((item) => this.addPrefix(item, config.prefix));
|
|
30
|
+
else return config.items;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
public subMenuItems = computed(() => {
|
|
34
|
+
const config = this.subMenuConfig();
|
|
35
|
+
|
|
36
|
+
if (config.prefix) return config.items.map((item) => this.addPrefix(item, config.prefix));
|
|
37
|
+
else return config.items;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
menuSource$ = this.menuSource.asObservable();
|
|
41
|
+
resetSource$ = this.resetSource.asObservable();
|
|
42
|
+
|
|
43
|
+
addPrefix(menuItem: MenuItem, appPrefix: APIs | undefined) {
|
|
44
|
+
if (menuItem.items) {
|
|
45
|
+
menuItem.items = menuItem.items.map((item) => this.addPrefix(item, appPrefix));
|
|
46
|
+
} else {
|
|
47
|
+
menuItem.routerLink = `/${appPrefix}/${menuItem.routerLink}`;
|
|
48
|
+
}
|
|
49
|
+
return menuItem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
onMenuStateChange(event: MenuChangeEvent) {
|
|
53
|
+
this.menuSource.next(event);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
reset() {
|
|
57
|
+
this.resetSource.next(true);
|
|
58
|
+
}
|
|
59
|
+
}
|
package/theme/ng-package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"lib": {
|
|
4
|
-
"entryFile": "./index.ts"
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
+
"lib": {
|
|
4
|
+
"entryFile": "./index.ts"
|
|
5
|
+
}
|
|
6
|
+
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
.p-paginator {
|
|
2
|
-
background: $paginatorBg;
|
|
3
|
-
color: $paginatorTextColor;
|
|
4
|
-
border: $paginatorBorder;
|
|
5
|
-
border-width: $paginatorBorderWidth;
|
|
6
|
-
padding: $paginatorPadding;
|
|
7
|
-
border-radius: $borderRadius;
|
|
8
|
-
|
|
9
|
-
.p-paginator-first,
|
|
10
|
-
.p-paginator-prev,
|
|
11
|
-
.p-paginator-next,
|
|
12
|
-
.p-paginator-last {
|
|
13
|
-
background-color: $paginatorElementBg;
|
|
14
|
-
border: $paginatorElementBorder;
|
|
15
|
-
color: $paginatorElementIconColor;
|
|
16
|
-
min-width: $paginatorElementWidth;
|
|
17
|
-
height: $paginatorElementHeight;
|
|
18
|
-
margin: $paginatorElementMargin;
|
|
19
|
-
transition: $listItemTransition;
|
|
20
|
-
border-radius: $paginatorElementBorderRadius;
|
|
21
|
-
|
|
22
|
-
&:not(.p-disabled):not(.p-highlight):hover {
|
|
23
|
-
background: $paginatorElementHoverBg;
|
|
24
|
-
border-color: $paginatorElementHoverBorderColor;
|
|
25
|
-
color: $paginatorElementIconHoverColor;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.p-paginator-first {
|
|
30
|
-
border-top-left-radius: $paginatorElementBorderRadius;
|
|
31
|
-
border-bottom-left-radius: $paginatorElementBorderRadius;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.p-paginator-last {
|
|
35
|
-
border-top-right-radius: $paginatorElementBorderRadius;
|
|
36
|
-
border-bottom-right-radius: $paginatorElementBorderRadius;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.p-dropdown {
|
|
40
|
-
margin-left: $inlineSpacing;
|
|
41
|
-
margin-right: $inlineSpacing;
|
|
42
|
-
height: $paginatorElementHeight;
|
|
43
|
-
|
|
44
|
-
.p-dropdown-label {
|
|
45
|
-
padding-right: 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.p-paginator-page-input {
|
|
50
|
-
margin-left: $inlineSpacing;
|
|
51
|
-
margin-right: $inlineSpacing;
|
|
52
|
-
|
|
53
|
-
.p-inputtext {
|
|
54
|
-
max-width: $paginatorElementWidth;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.p-paginator-current {
|
|
59
|
-
background-color: $paginatorElementBg;
|
|
60
|
-
border: $paginatorElementBorder;
|
|
61
|
-
color: $paginatorElementIconColor;
|
|
62
|
-
min-width: $paginatorElementWidth;
|
|
63
|
-
height: $paginatorElementHeight;
|
|
64
|
-
margin: $paginatorElementMargin;
|
|
65
|
-
padding: 0 $inlineSpacing;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.p-paginator-pages {
|
|
69
|
-
.p-paginator-page {
|
|
70
|
-
background-color: $paginatorElementBg;
|
|
71
|
-
border: $paginatorElementBorder;
|
|
72
|
-
color: $paginatorElementIconColor;
|
|
73
|
-
min-width: 2rem;
|
|
74
|
-
height: 2rem;
|
|
75
|
-
margin: $paginatorElementMargin;
|
|
76
|
-
transition: $listItemTransition;
|
|
77
|
-
border-radius: $paginatorElementBorderRadius;
|
|
78
|
-
|
|
79
|
-
&.p-highlight {
|
|
80
|
-
background: $highlightBg;
|
|
81
|
-
border-color: $highlightBg;
|
|
82
|
-
color: $highlightTextColor;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&:not(.p-highlight):hover {
|
|
86
|
-
background: $paginatorElementHoverBg;
|
|
87
|
-
border-color: $paginatorElementHoverBorderColor;
|
|
88
|
-
color: $paginatorElementIconHoverColor;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
1
|
+
.p-paginator {
|
|
2
|
+
background: $paginatorBg;
|
|
3
|
+
color: $paginatorTextColor;
|
|
4
|
+
border: $paginatorBorder;
|
|
5
|
+
border-width: $paginatorBorderWidth;
|
|
6
|
+
padding: $paginatorPadding;
|
|
7
|
+
border-radius: $borderRadius;
|
|
8
|
+
|
|
9
|
+
.p-paginator-first,
|
|
10
|
+
.p-paginator-prev,
|
|
11
|
+
.p-paginator-next,
|
|
12
|
+
.p-paginator-last {
|
|
13
|
+
background-color: $paginatorElementBg;
|
|
14
|
+
border: $paginatorElementBorder;
|
|
15
|
+
color: $paginatorElementIconColor;
|
|
16
|
+
min-width: $paginatorElementWidth;
|
|
17
|
+
height: $paginatorElementHeight;
|
|
18
|
+
margin: $paginatorElementMargin;
|
|
19
|
+
transition: $listItemTransition;
|
|
20
|
+
border-radius: $paginatorElementBorderRadius;
|
|
21
|
+
|
|
22
|
+
&:not(.p-disabled):not(.p-highlight):hover {
|
|
23
|
+
background: $paginatorElementHoverBg;
|
|
24
|
+
border-color: $paginatorElementHoverBorderColor;
|
|
25
|
+
color: $paginatorElementIconHoverColor;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.p-paginator-first {
|
|
30
|
+
border-top-left-radius: $paginatorElementBorderRadius;
|
|
31
|
+
border-bottom-left-radius: $paginatorElementBorderRadius;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.p-paginator-last {
|
|
35
|
+
border-top-right-radius: $paginatorElementBorderRadius;
|
|
36
|
+
border-bottom-right-radius: $paginatorElementBorderRadius;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.p-dropdown {
|
|
40
|
+
margin-left: $inlineSpacing;
|
|
41
|
+
margin-right: $inlineSpacing;
|
|
42
|
+
height: $paginatorElementHeight;
|
|
43
|
+
|
|
44
|
+
.p-dropdown-label {
|
|
45
|
+
padding-right: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.p-paginator-page-input {
|
|
50
|
+
margin-left: $inlineSpacing;
|
|
51
|
+
margin-right: $inlineSpacing;
|
|
52
|
+
|
|
53
|
+
.p-inputtext {
|
|
54
|
+
max-width: $paginatorElementWidth;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.p-paginator-current {
|
|
59
|
+
background-color: $paginatorElementBg;
|
|
60
|
+
border: $paginatorElementBorder;
|
|
61
|
+
color: $paginatorElementIconColor;
|
|
62
|
+
min-width: $paginatorElementWidth;
|
|
63
|
+
height: $paginatorElementHeight;
|
|
64
|
+
margin: $paginatorElementMargin;
|
|
65
|
+
padding: 0 $inlineSpacing;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.p-paginator-pages {
|
|
69
|
+
.p-paginator-page {
|
|
70
|
+
background-color: $paginatorElementBg;
|
|
71
|
+
border: $paginatorElementBorder;
|
|
72
|
+
color: $paginatorElementIconColor;
|
|
73
|
+
min-width: 2rem;
|
|
74
|
+
height: 2rem;
|
|
75
|
+
margin: $paginatorElementMargin;
|
|
76
|
+
transition: $listItemTransition;
|
|
77
|
+
border-radius: $paginatorElementBorderRadius;
|
|
78
|
+
|
|
79
|
+
&.p-highlight {
|
|
80
|
+
background: $highlightBg;
|
|
81
|
+
border-color: $highlightBg;
|
|
82
|
+
color: $highlightTextColor;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:not(.p-highlight):hover {
|
|
86
|
+
background: $paginatorElementHoverBg;
|
|
87
|
+
border-color: $paginatorElementHoverBorderColor;
|
|
88
|
+
color: $paginatorElementIconHoverColor;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|