@yuuvis/client-framework 2.10.2 → 2.11.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/autocomplete/lib/autocomplete.component.d.ts +4 -4
- package/autocomplete/lib/autocomplete.interface.d.ts +2 -2
- package/common/lib/services/index.d.ts +1 -0
- package/common/lib/services/layout-settings/layout-settings.service.d.ts +15 -0
- package/common/lib/services/theme/index.d.ts +3 -0
- package/common/lib/services/theme/theme.models.d.ts +16 -0
- package/common/lib/services/theme/theme.provider.d.ts +4 -0
- package/common/lib/services/theme/theme.service.d.ts +16 -0
- package/fesm2022/yuuvis-client-framework-common.mjs +213 -4
- package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-forms.mjs +46 -21
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs +135 -52
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-versions.mjs +4 -3
- package/fesm2022/yuuvis-client-framework-object-versions.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-query-list.mjs +5 -4
- package/fesm2022/yuuvis-client-framework-query-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +21 -6
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework.mjs +616 -98
- package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
- package/forms/lib/elements/datetime/datetime.component.d.ts +0 -1
- package/forms/lib/elements/organization/organization.component.d.ts +1 -1
- package/forms/lib/elements/organization-set/organization-set.component.d.ts +1 -1
- package/index.d.ts +5 -2
- package/lib/config/index.d.ts +1 -0
- package/lib/config/session/index.d.ts +3 -0
- package/lib/config/session/session-activity-window-before-end.const.d.ts +43 -0
- package/lib/config/session/session-default-duration.const.d.ts +47 -0
- package/lib/config/session/session-popup-before-end.const.d.ts +47 -0
- package/lib/enums/channel-message.enum.d.ts +4 -0
- package/lib/enums/index.d.ts +1 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/session/channel-payload.model.d.ts +5 -0
- package/lib/models/session/index.d.ts +1 -0
- package/lib/models/snack-bar/index.d.ts +3 -0
- package/lib/models/snack-bar/snack-bar-data.model.d.ts +6 -0
- package/lib/models/snack-bar/snack-bar-level.model.d.ts +1 -0
- package/lib/{services/snack-bar/snack-bar.interface.d.ts → models/snack-bar/snack-bar-options.model.d.ts} +1 -6
- package/lib/providers/index.d.ts +1 -0
- package/lib/providers/session/index.d.ts +1 -0
- package/lib/providers/session/provide-session.provider.d.ts +43 -0
- package/lib/services/index.d.ts +2 -2
- package/lib/services/session/session.service.d.ts +113 -0
- package/lib/services/snack-bar/snack-bar.service.d.ts +5 -5
- package/object-relationship/index.d.ts +1 -0
- package/object-relationship/lib/actions/add-relationship/add-relationship.component.d.ts +10 -0
- package/object-relationship/lib/actions/relationship-target-search/relationship-target-search.component.d.ts +17 -4
- package/object-relationship/lib/object-relationship.const.d.ts +0 -1
- package/object-versions/lib/object-versions.component.d.ts +1 -0
- package/package.json +4 -4
- package/query-list/lib/query-list.component.d.ts +8 -7
- package/tile-list/lib/tile-list/tile-list.component.d.ts +4 -2
- package/lib/assets/i18n/de.json +0 -202
- package/lib/assets/i18n/en.json +0 -202
|
@@ -45,13 +45,13 @@ export declare class AutocompleteComponent extends AbstractMatFormField<Autocomp
|
|
|
45
45
|
* list item has been selected (usually every key stroke is changing the form controls value)
|
|
46
46
|
*/
|
|
47
47
|
forceSelection: import("@angular/core").InputSignal<boolean>;
|
|
48
|
-
_acValues: import("@angular/core").WritableSignal<AutocompleteItem[]>;
|
|
49
|
-
autocompleteValues: import("@angular/core").InputSignal<AutocompleteItem[]>;
|
|
48
|
+
_acValues: import("@angular/core").WritableSignal<AutocompleteItem<unknown>[]>;
|
|
49
|
+
autocompleteValues: import("@angular/core").InputSignal<AutocompleteItem<unknown>[]>;
|
|
50
50
|
autocompleteFnc: import("@angular/core").OutputEmitterRef<string>;
|
|
51
51
|
acBlur: import("@angular/core").OutputEmitterRef<void>;
|
|
52
52
|
chipsInputDisabled: import("@angular/core").Signal<boolean | null>;
|
|
53
|
-
chipsControl: FormControl<AutocompleteItem[] | null>;
|
|
54
|
-
inputControl: FormControl<string | AutocompleteItem
|
|
53
|
+
chipsControl: FormControl<AutocompleteItem<unknown>[] | null>;
|
|
54
|
+
inputControl: FormControl<string | AutocompleteItem<unknown>>;
|
|
55
55
|
ngControl: import("@angular/forms").NgControl | null;
|
|
56
56
|
displayFn(i: AutocompleteItem): string;
|
|
57
57
|
acOptionSelected(event: MatAutocompleteSelectedEvent): void;
|
|
@@ -9,9 +9,21 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
export declare class LayoutSettingsService {
|
|
10
10
|
#private;
|
|
11
11
|
DEFAULT_SPLIT_VIEW_GUTTER_SIZE: number;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `ThemeService.mode` instead.
|
|
14
|
+
*/
|
|
12
15
|
themeMode: import("@angular/core").WritableSignal<LayoutMode>;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `ThemeService.mode` instead.
|
|
18
|
+
*/
|
|
13
19
|
mode: import("@angular/core").Signal<LayoutMode>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Theme initialization is now handled by `ThemeService` internally.
|
|
22
|
+
*/
|
|
14
23
|
init(): void;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `ThemeService.toggleTheme()` instead.
|
|
26
|
+
*/
|
|
15
27
|
setMode(mode: LayoutMode): void;
|
|
16
28
|
saveSettings(key: string, settings: unknown): boolean;
|
|
17
29
|
getSettings(key: string): unknown | undefined;
|
|
@@ -19,6 +31,9 @@ export declare class LayoutSettingsService {
|
|
|
19
31
|
* Clears all layout settings.
|
|
20
32
|
*/
|
|
21
33
|
clearSettings(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `ThemeService.toggleTheme()` instead.
|
|
36
|
+
*/
|
|
22
37
|
applyLayoutMode(mode?: LayoutMode): void;
|
|
23
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutSettingsService, never>;
|
|
24
39
|
static ɵprov: i0.ɵɵInjectableDeclaration<LayoutSettingsService>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Mode = 'light' | 'dark';
|
|
2
|
+
export interface CustomThemeSettings {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
hasDarkTheme?: boolean;
|
|
7
|
+
hasLightTheme?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare enum ThemeStorageKeys {
|
|
10
|
+
THEME_MODE = "yuv.theme:app.theme.mode",
|
|
11
|
+
CUSTOM_THEME = "yuv.theme:app.theme.custom"
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_THEME_KEY = "yuv-default";
|
|
14
|
+
export declare const DEFAULT_THEME: CustomThemeSettings;
|
|
15
|
+
export declare const HIGH_CONTRAST_THEME_KEY = "yuv-high-contrast";
|
|
16
|
+
export declare const HIGH_CONTRAST_THEME: CustomThemeSettings;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
2
|
+
import { CustomThemeSettings } from './theme.models';
|
|
3
|
+
export declare const YUV_CUSTOM_THEME: InjectionToken<CustomThemeSettings[]>;
|
|
4
|
+
export declare const provideYuvCustomTheme: (customTheme: CustomThemeSettings[]) => EnvironmentProviders;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomThemeSettings, Mode } from './theme.models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ThemeService {
|
|
4
|
+
#private;
|
|
5
|
+
mode: import("@angular/core").Signal<Mode>;
|
|
6
|
+
customTheme: import("@angular/core").WritableSignal<CustomThemeSettings>;
|
|
7
|
+
customThemes: import("@angular/core").Signal<CustomThemeSettings[]>;
|
|
8
|
+
currentTheme: import("@angular/core").Signal<string>;
|
|
9
|
+
disableMode: import("@angular/core").Signal<boolean>;
|
|
10
|
+
constructor();
|
|
11
|
+
setMode(mode: Mode): void;
|
|
12
|
+
setCustomTheme(key: string): void;
|
|
13
|
+
toggleTheme(theme: Mode): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
16
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component, inject, ElementRef, Input, Directive, computed, output, signal, EnvironmentInjector, ViewContainerRef, effect, EventEmitter, HostListener, Output, NgZone, contentChildren, Injectable, HostBinding, forwardRef, NgModule } from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component, inject, ElementRef, Input, Directive, computed, output, signal, EnvironmentInjector, ViewContainerRef, effect, EventEmitter, HostListener, Output, NgZone, contentChildren, Injectable, HostBinding, forwardRef, NgModule, InjectionToken, makeEnvironmentProviders, RendererFactory2 } from '@angular/core';
|
|
3
3
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import * as i2 from '@angular/material/dialog';
|
|
@@ -7,14 +7,15 @@ import { MatDialogActions, MatDialogTitle, MatDialogContent, MAT_DIALOG_DATA, Ma
|
|
|
7
7
|
import * as i1 from '@ngx-translate/core';
|
|
8
8
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
|
|
10
|
-
import { TranslateModule as TranslateModule$1, RetentionService, LocaleDatePipe } from '@yuuvis/client-core';
|
|
10
|
+
import { TranslateModule as TranslateModule$1, AppCacheService, RetentionService, LocaleDatePipe } from '@yuuvis/client-core';
|
|
11
11
|
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
12
12
|
import * as i1$1 from '@angular/material/icon';
|
|
13
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
14
14
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
|
-
import { Subject, fromEvent, merge, timer, of } from 'rxjs';
|
|
15
|
+
import { Subject, fromEvent, merge, timer, of, forkJoin, map as map$1 } from 'rxjs';
|
|
16
16
|
import { debounceTime, tap, filter, switchMap, map, takeUntil } from 'rxjs/operators';
|
|
17
17
|
import { NG_VALUE_ACCESSOR, NgControl, FormControlDirective, FormControlName, NgModel } from '@angular/forms';
|
|
18
|
+
import { marker } from '@colsen1991/ngx-translate-extract-marker';
|
|
18
19
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
19
20
|
|
|
20
21
|
class DialogComponent {
|
|
@@ -1060,18 +1061,36 @@ function getFirstFocusableChild(element) {
|
|
|
1060
1061
|
class LayoutSettingsService {
|
|
1061
1062
|
constructor() {
|
|
1062
1063
|
this.#STORAGE_PREFIX = 'yuv.layout:';
|
|
1064
|
+
/**
|
|
1065
|
+
* @deprecated Theme storage is now handled by `ThemeService`.
|
|
1066
|
+
*/
|
|
1063
1067
|
this.#MODE_STORAGE_KEY = 'app.layout.mode';
|
|
1064
1068
|
this.DEFAULT_SPLIT_VIEW_GUTTER_SIZE = 16;
|
|
1069
|
+
/**
|
|
1070
|
+
* @deprecated Use `ThemeService.mode` instead.
|
|
1071
|
+
*/
|
|
1065
1072
|
this.themeMode = signal('system');
|
|
1073
|
+
/**
|
|
1074
|
+
* @deprecated Use `ThemeService.mode` instead.
|
|
1075
|
+
*/
|
|
1066
1076
|
this.mode = this.themeMode.asReadonly();
|
|
1067
1077
|
}
|
|
1068
1078
|
#STORAGE_PREFIX;
|
|
1079
|
+
/**
|
|
1080
|
+
* @deprecated Theme storage is now handled by `ThemeService`.
|
|
1081
|
+
*/
|
|
1069
1082
|
#MODE_STORAGE_KEY;
|
|
1083
|
+
/**
|
|
1084
|
+
* @deprecated Theme initialization is now handled by `ThemeService` internally.
|
|
1085
|
+
*/
|
|
1070
1086
|
init() {
|
|
1071
1087
|
// set configured mode
|
|
1072
1088
|
const modeSettings = this.getSettings(this.#MODE_STORAGE_KEY);
|
|
1073
1089
|
this.applyLayoutMode(modeSettings?.mode || undefined);
|
|
1074
1090
|
}
|
|
1091
|
+
/**
|
|
1092
|
+
* @deprecated Use `ThemeService.toggleTheme()` instead.
|
|
1093
|
+
*/
|
|
1075
1094
|
setMode(mode) {
|
|
1076
1095
|
this.saveSettings(this.#MODE_STORAGE_KEY, { mode });
|
|
1077
1096
|
}
|
|
@@ -1106,6 +1125,9 @@ class LayoutSettingsService {
|
|
|
1106
1125
|
}
|
|
1107
1126
|
});
|
|
1108
1127
|
}
|
|
1128
|
+
/**
|
|
1129
|
+
* @deprecated Use `ThemeService.toggleTheme()` instead.
|
|
1130
|
+
*/
|
|
1109
1131
|
applyLayoutMode(mode) {
|
|
1110
1132
|
const body = document.getElementsByTagName('body')[0];
|
|
1111
1133
|
body.style.colorScheme = mode === 'dark' || mode === 'light' ? mode : 'inherit';
|
|
@@ -1189,6 +1211,193 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
1189
1211
|
}]
|
|
1190
1212
|
}] });
|
|
1191
1213
|
|
|
1214
|
+
var ThemeStorageKeys;
|
|
1215
|
+
(function (ThemeStorageKeys) {
|
|
1216
|
+
ThemeStorageKeys["THEME_MODE"] = "yuv.theme:app.theme.mode";
|
|
1217
|
+
ThemeStorageKeys["CUSTOM_THEME"] = "yuv.theme:app.theme.custom";
|
|
1218
|
+
})(ThemeStorageKeys || (ThemeStorageKeys = {}));
|
|
1219
|
+
const DEFAULT_THEME_KEY = 'yuv-default';
|
|
1220
|
+
const DEFAULT_THEME = {
|
|
1221
|
+
key: DEFAULT_THEME_KEY,
|
|
1222
|
+
label: 'yuv.theme.default.label',
|
|
1223
|
+
description: 'yuv.theme.default.description',
|
|
1224
|
+
hasLightTheme: true,
|
|
1225
|
+
hasDarkTheme: true
|
|
1226
|
+
};
|
|
1227
|
+
const HIGH_CONTRAST_THEME_KEY = 'yuv-high-contrast';
|
|
1228
|
+
const HIGH_CONTRAST_THEME = {
|
|
1229
|
+
key: HIGH_CONTRAST_THEME_KEY,
|
|
1230
|
+
label: 'yuv.theme.highContrast.label',
|
|
1231
|
+
description: 'yuv.theme.highContrast.description',
|
|
1232
|
+
hasLightTheme: true,
|
|
1233
|
+
hasDarkTheme: true
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
const YUV_CUSTOM_THEME = new InjectionToken('CUSTOM_THEME', { factory: () => [HIGH_CONTRAST_THEME] });
|
|
1237
|
+
const provideYuvCustomTheme = (customTheme) => makeEnvironmentProviders([{ provide: YUV_CUSTOM_THEME, useValue: [HIGH_CONTRAST_THEME, ...customTheme] }]);
|
|
1238
|
+
|
|
1239
|
+
class ThemeService {
|
|
1240
|
+
#rendererFactory;
|
|
1241
|
+
#customThemesToken;
|
|
1242
|
+
#document;
|
|
1243
|
+
#storage;
|
|
1244
|
+
#MODE_STORAGE_KEY;
|
|
1245
|
+
#CUSTOM_THEME_STORAGE_KEY;
|
|
1246
|
+
#renderer;
|
|
1247
|
+
#mode;
|
|
1248
|
+
#currentTheme;
|
|
1249
|
+
#disableMode;
|
|
1250
|
+
// Effect to apply classes and save to localStorage
|
|
1251
|
+
#setThemeModeEffect;
|
|
1252
|
+
constructor() {
|
|
1253
|
+
this.#rendererFactory = inject(RendererFactory2);
|
|
1254
|
+
this.#customThemesToken = inject(YUV_CUSTOM_THEME, { optional: true });
|
|
1255
|
+
this.#document = inject(DOCUMENT);
|
|
1256
|
+
this.#storage = inject(AppCacheService);
|
|
1257
|
+
this.#MODE_STORAGE_KEY = ThemeStorageKeys.THEME_MODE;
|
|
1258
|
+
this.#CUSTOM_THEME_STORAGE_KEY = ThemeStorageKeys.CUSTOM_THEME;
|
|
1259
|
+
this.#renderer = this.#rendererFactory.createRenderer(null, null);
|
|
1260
|
+
this.#mode = signal('light');
|
|
1261
|
+
this.mode = this.#mode.asReadonly();
|
|
1262
|
+
this.customTheme = signal(DEFAULT_THEME);
|
|
1263
|
+
this.customThemes = computed(() => {
|
|
1264
|
+
const customThemesToken = this.#customThemesToken || [];
|
|
1265
|
+
return customThemesToken.map((theme) => {
|
|
1266
|
+
const { key, label, description, hasLightTheme, hasDarkTheme } = theme;
|
|
1267
|
+
return {
|
|
1268
|
+
key,
|
|
1269
|
+
label,
|
|
1270
|
+
description,
|
|
1271
|
+
hasLightTheme: hasLightTheme ?? true,
|
|
1272
|
+
hasDarkTheme: hasDarkTheme ?? false
|
|
1273
|
+
};
|
|
1274
|
+
});
|
|
1275
|
+
});
|
|
1276
|
+
this.#currentTheme = signal(DEFAULT_THEME_KEY);
|
|
1277
|
+
this.currentTheme = this.#currentTheme.asReadonly();
|
|
1278
|
+
this.#disableMode = signal(false);
|
|
1279
|
+
this.disableMode = this.#disableMode.asReadonly();
|
|
1280
|
+
// Effect to apply classes and save to localStorage
|
|
1281
|
+
this.#setThemeModeEffect = effect(() => {
|
|
1282
|
+
const currentTheme = this.#mode();
|
|
1283
|
+
const body = this.#document.getElementsByTagName('body')[0];
|
|
1284
|
+
this.setMode(currentTheme);
|
|
1285
|
+
// Theme class
|
|
1286
|
+
if (currentTheme === 'dark') {
|
|
1287
|
+
this.#renderer.setAttribute(body, 'style', 'color-scheme: dark');
|
|
1288
|
+
}
|
|
1289
|
+
else if (currentTheme === 'light') {
|
|
1290
|
+
this.#renderer.setAttribute(body, 'style', 'color-scheme: light');
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
this.#renderer.removeAttribute(body, 'style');
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
this.#initializeModes();
|
|
1297
|
+
}
|
|
1298
|
+
#saveSettings(key, settings) {
|
|
1299
|
+
if (typeof settings === 'object') {
|
|
1300
|
+
this.#storage.setItem(key, JSON.stringify(settings)).subscribe();
|
|
1301
|
+
return true;
|
|
1302
|
+
}
|
|
1303
|
+
else
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
#deleteSettings(key) {
|
|
1307
|
+
this.#storage.removeItem(key).subscribe();
|
|
1308
|
+
return true;
|
|
1309
|
+
}
|
|
1310
|
+
#checkPrefersContrast() {
|
|
1311
|
+
const prefersHighContrast = window.matchMedia('(prefers-contrast: more)').matches;
|
|
1312
|
+
}
|
|
1313
|
+
#initializeModes() {
|
|
1314
|
+
// Theme initialization
|
|
1315
|
+
forkJoin([this.#storage.getItem(this.#MODE_STORAGE_KEY), this.#storage.getItem(this.#CUSTOM_THEME_STORAGE_KEY)])
|
|
1316
|
+
.pipe(map$1(([savedTheme, savedCustomTheme]) => {
|
|
1317
|
+
if (savedTheme) {
|
|
1318
|
+
try {
|
|
1319
|
+
this.#mode.set(JSON.parse(savedTheme).mode);
|
|
1320
|
+
}
|
|
1321
|
+
catch (error) {
|
|
1322
|
+
this.#mode.set(this.#mode());
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
else {
|
|
1326
|
+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
1327
|
+
this.#mode.set(prefersDark ? 'dark' : 'light');
|
|
1328
|
+
}
|
|
1329
|
+
// Contrast initialization
|
|
1330
|
+
this.#checkPrefersContrast();
|
|
1331
|
+
// Custom Theme initialization
|
|
1332
|
+
if (savedCustomTheme) {
|
|
1333
|
+
try {
|
|
1334
|
+
const customThemeKey = JSON.parse(savedCustomTheme).customTheme;
|
|
1335
|
+
this.setCustomTheme(customThemeKey);
|
|
1336
|
+
}
|
|
1337
|
+
catch (error) {
|
|
1338
|
+
// ignore
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}))
|
|
1342
|
+
.subscribe();
|
|
1343
|
+
}
|
|
1344
|
+
setMode(mode) {
|
|
1345
|
+
this.#saveSettings(this.#MODE_STORAGE_KEY, { mode });
|
|
1346
|
+
}
|
|
1347
|
+
setCustomTheme(key) {
|
|
1348
|
+
// Reset contrast to system on custom theme change
|
|
1349
|
+
const previousTheme = this.customTheme();
|
|
1350
|
+
const body = this.#document.getElementsByTagName('body')[0];
|
|
1351
|
+
previousTheme && previousTheme.key && this.#renderer.removeClass(body, previousTheme.key);
|
|
1352
|
+
const selectedTheme = this.customThemes().find((theme) => theme.key === key);
|
|
1353
|
+
if (selectedTheme) {
|
|
1354
|
+
this.customTheme.set(selectedTheme);
|
|
1355
|
+
this.#currentTheme.set(selectedTheme.key);
|
|
1356
|
+
selectedTheme.key && this.#renderer.addClass(body, selectedTheme.key);
|
|
1357
|
+
// Check if custom theme has light or dark mode
|
|
1358
|
+
if ((selectedTheme.hasDarkTheme && selectedTheme.hasLightTheme) || (!selectedTheme.hasDarkTheme && !selectedTheme.hasLightTheme)) {
|
|
1359
|
+
// If both, do nothing further with this (enable group)
|
|
1360
|
+
this.#disableMode.set(false);
|
|
1361
|
+
}
|
|
1362
|
+
else {
|
|
1363
|
+
// Else disable mode button group and set the corresponding mode active
|
|
1364
|
+
if (selectedTheme.hasDarkTheme) {
|
|
1365
|
+
this.#mode.set('dark');
|
|
1366
|
+
}
|
|
1367
|
+
else if (selectedTheme.hasLightTheme) {
|
|
1368
|
+
this.#mode.set('light');
|
|
1369
|
+
}
|
|
1370
|
+
this.#disableMode.set(true);
|
|
1371
|
+
}
|
|
1372
|
+
this.#saveSettings(this.#CUSTOM_THEME_STORAGE_KEY, { customTheme: key });
|
|
1373
|
+
}
|
|
1374
|
+
else {
|
|
1375
|
+
if (key === DEFAULT_THEME_KEY) {
|
|
1376
|
+
this.#disableMode.set(false);
|
|
1377
|
+
this.#renderer.removeClass(body, HIGH_CONTRAST_THEME_KEY);
|
|
1378
|
+
this.#deleteSettings(this.#CUSTOM_THEME_STORAGE_KEY);
|
|
1379
|
+
}
|
|
1380
|
+
// Default theme or no theme found
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
toggleTheme(theme) {
|
|
1384
|
+
this.#mode.set(theme);
|
|
1385
|
+
}
|
|
1386
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1387
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
1388
|
+
}
|
|
1389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, decorators: [{
|
|
1390
|
+
type: Injectable,
|
|
1391
|
+
args: [{
|
|
1392
|
+
providedIn: 'root'
|
|
1393
|
+
}]
|
|
1394
|
+
}], ctorParameters: () => [] });
|
|
1395
|
+
|
|
1396
|
+
marker('yuv.theme.default.label');
|
|
1397
|
+
marker('yuv.theme.default.description');
|
|
1398
|
+
marker('yuv.theme.highContrast.label');
|
|
1399
|
+
marker('yuv.theme.highContrast.description');
|
|
1400
|
+
|
|
1192
1401
|
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
1193
1402
|
class AbstractMatFormField {
|
|
1194
1403
|
constructor() {
|
|
@@ -1375,5 +1584,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
1375
1584
|
* Generated bundle index. Do not edit.
|
|
1376
1585
|
*/
|
|
1377
1586
|
|
|
1378
|
-
export { AbstractMatFormField, AutofocusChildDirective, AutofocusDelayedDirective, BusyOverlayComponent, BusyOverlayDirective, ClickDoubleDirective, ConfirmComponent, ConfirmService, ContainerSizeDirective, DialogComponent, DialogSize, DragScrollDirective, DragSelectDirective, DragSelectItemDirective, FileDropZoneDirective, FocusWithinDirective, FormTranslateService, HaloFocusComponent, LayoutSettingsService, LightDismissDirective, LongPressDirective, NoopValueAccessorDirective, RetentionBadgeComponent, YuvCommonModule, getFirstFocusableChild, getFocusableChildren, injectNgControl };
|
|
1587
|
+
export { AbstractMatFormField, AutofocusChildDirective, AutofocusDelayedDirective, BusyOverlayComponent, BusyOverlayDirective, ClickDoubleDirective, ConfirmComponent, ConfirmService, ContainerSizeDirective, DEFAULT_THEME, DEFAULT_THEME_KEY, DialogComponent, DialogSize, DragScrollDirective, DragSelectDirective, DragSelectItemDirective, FileDropZoneDirective, FocusWithinDirective, FormTranslateService, HIGH_CONTRAST_THEME, HIGH_CONTRAST_THEME_KEY, HaloFocusComponent, LayoutSettingsService, LightDismissDirective, LongPressDirective, NoopValueAccessorDirective, RetentionBadgeComponent, ThemeService, ThemeStorageKeys, YUV_CUSTOM_THEME, YuvCommonModule, getFirstFocusableChild, getFocusableChildren, injectNgControl, provideYuvCustomTheme };
|
|
1379
1588
|
//# sourceMappingURL=yuuvis-client-framework-common.mjs.map
|