@edsis/angular 22.0.73 → 22.0.74
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/fesm2022/edsis-angular-block-shell.mjs +96 -356
- package/fesm2022/edsis-angular-block-shell.mjs.map +1 -1
- package/fesm2022/edsis-angular-block-themes.mjs +72 -100
- package/fesm2022/edsis-angular-block-themes.mjs.map +1 -1
- package/fesm2022/edsis-angular-module-auth.mjs +3 -3
- package/fesm2022/edsis-angular-module-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/edsis-angular-block-shell.d.ts +10 -31
- package/types/edsis-angular-block-themes.d.ts +4 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, effect, Service, InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, Injector, linkedSignal, computed, afterNextRender, input, output, Component, ElementRef, signal, DestroyRef, Directive, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { NavigationService } from '@edsis/navigation/service';
|
|
4
|
-
import { LayoutService, isUiLayoutType, isUiLayoutWidth, isUiLayoutSurface
|
|
5
|
-
import {
|
|
6
|
-
import { LAYOUT_DEFAULT_TYPE, LAYOUT_DEFAULT_WIDTH, LAYOUT_DEFAULT_SURFACE
|
|
4
|
+
import { LayoutService, isUiLayoutType, isUiLayoutWidth, isUiLayoutSurface } from '@edsis/theme/layout';
|
|
5
|
+
import { ThemeAppearanceService, ThemeModeService, ThemeSpaceService, ThemeRadiusService, ThemeColorService, ThemeBrandService, isThemeMode, isThemeSpace, isThemeRadius, isThemeColor, isThemeBrand, themeAppearancePresetEntry, DEFAULT_THEME_MODE, DEFAULT_THEME_COLOR, DEFAULT_THEME_BRAND, THEME_APPEARANCES, THEME_MODES, THEME_COLORS, THEME_BRANDS, THEME_SPACES, THEME_RADII, isThemeAppearance, isThemeAppearanceSettingLocked, ThemeDeviceService } from '@edsis/theme/styles';
|
|
6
|
+
import { LAYOUT_DEFAULT_TYPE, LAYOUT_DEFAULT_WIDTH, LAYOUT_DEFAULT_SURFACE } from '@edsis/theme/layout/types';
|
|
7
7
|
import { DOCUMENT } from '@angular/common';
|
|
8
8
|
import { SheetComponent } from '@edsis/component/sheet';
|
|
9
9
|
import { LayoutService as LayoutService$1 } from '@edsis/theme/layout/services';
|
|
@@ -19,9 +19,9 @@ const NAVIGATION_TYPES = ['sidebar', 'dockbar', 'navbar', 'flyout'];
|
|
|
19
19
|
const NAVIGATION_ORIENTATIONS = ['vertical', 'horizontal'];
|
|
20
20
|
const NAVIGATION_POSITIONS = ['left', 'right', 'top', 'bottom'];
|
|
21
21
|
const NAVIGATION_DOCKBAR_MODES = ['default', 'drawer', 'sticky'];
|
|
22
|
-
class
|
|
22
|
+
class ThemeAppearancePresetService {
|
|
23
23
|
config = inject(APP_PREFERENCES_CONFIG, { optional: true });
|
|
24
|
-
|
|
24
|
+
themeAppearance = inject(ThemeAppearanceService);
|
|
25
25
|
themeMode = inject(ThemeModeService);
|
|
26
26
|
themeSpace = inject(ThemeSpaceService);
|
|
27
27
|
themeRadius = inject(ThemeRadiusService);
|
|
@@ -30,63 +30,60 @@ class ThemeStylePresetService {
|
|
|
30
30
|
layout = inject(LayoutService);
|
|
31
31
|
navigation = inject(NavigationService);
|
|
32
32
|
constructor() {
|
|
33
|
-
let
|
|
34
|
-
if (this.
|
|
35
|
-
this.enforceLockedValues(
|
|
33
|
+
let previousAppearance = this.themeAppearance.appearance();
|
|
34
|
+
if (this.themeAppearance.hasStoredAppearance()) {
|
|
35
|
+
this.enforceLockedValues(previousAppearance);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
this.applyPreset(
|
|
38
|
+
this.applyPreset(previousAppearance);
|
|
39
39
|
}
|
|
40
40
|
effect(() => {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
41
|
+
const appearance = this.themeAppearance.appearance();
|
|
42
|
+
if (appearance === previousAppearance)
|
|
43
43
|
return;
|
|
44
|
-
|
|
45
|
-
this.applyPreset(
|
|
44
|
+
previousAppearance = appearance;
|
|
45
|
+
this.applyPreset(appearance);
|
|
46
46
|
});
|
|
47
|
-
effect(() => this.enforceLockedValues(this.
|
|
47
|
+
effect(() => this.enforceLockedValues(this.themeAppearance.appearance()));
|
|
48
48
|
}
|
|
49
|
-
applyPreset(
|
|
50
|
-
this.applyThemeValues(
|
|
51
|
-
this.applyLayoutValues(
|
|
52
|
-
this.applyNavigationValues(
|
|
49
|
+
applyPreset(themeAppearance) {
|
|
50
|
+
this.applyThemeValues(themeAppearance);
|
|
51
|
+
this.applyLayoutValues(themeAppearance);
|
|
52
|
+
this.applyNavigationValues(themeAppearance);
|
|
53
53
|
}
|
|
54
|
-
applyThemeValues(
|
|
55
|
-
const mode = this.valueFor(
|
|
54
|
+
applyThemeValues(themeAppearance) {
|
|
55
|
+
const mode = this.valueFor(themeAppearance, 'theme-mode', this.defaultMode());
|
|
56
56
|
if (isThemeMode(mode))
|
|
57
57
|
this.themeMode.setMode(mode);
|
|
58
|
-
const space = this.valueFor(
|
|
58
|
+
const space = this.valueFor(themeAppearance, 'theme-space', this.defaultSpace());
|
|
59
59
|
if (isThemeSpace(space))
|
|
60
60
|
this.themeSpace.setSpace(space);
|
|
61
|
-
const radius = this.valueFor(
|
|
61
|
+
const radius = this.valueFor(themeAppearance, 'theme-radius', this.defaultRadius());
|
|
62
62
|
if (isThemeRadius(radius))
|
|
63
63
|
this.themeRadius.setRadius(radius);
|
|
64
|
-
const color = this.valueFor(
|
|
64
|
+
const color = this.valueFor(themeAppearance, 'theme-color', this.defaultColor());
|
|
65
65
|
if (isThemeColor(color))
|
|
66
66
|
this.themeColor.setColor(color);
|
|
67
|
-
const brand = this.valueFor(
|
|
67
|
+
const brand = this.valueFor(themeAppearance, 'theme-brand', this.defaultBrand());
|
|
68
68
|
if (isThemeBrand(brand))
|
|
69
69
|
this.themeBrand.setBrand(brand);
|
|
70
70
|
}
|
|
71
|
-
applyLayoutValues(
|
|
72
|
-
const type = this.valueFor(
|
|
71
|
+
applyLayoutValues(themeAppearance) {
|
|
72
|
+
const type = this.valueFor(themeAppearance, 'layout-type', this.defaultLayoutType());
|
|
73
73
|
if (isUiLayoutType(type))
|
|
74
74
|
this.layout.setType(type);
|
|
75
|
-
const width = this.valueFor(
|
|
75
|
+
const width = this.valueFor(themeAppearance, 'layout-width', this.defaultLayoutWidth());
|
|
76
76
|
if (isUiLayoutWidth(width))
|
|
77
77
|
this.layout.setWidth(width);
|
|
78
|
-
const surface = this.valueFor(
|
|
78
|
+
const surface = this.valueFor(themeAppearance, 'layout-surface', this.defaultLayoutSurface());
|
|
79
79
|
if (isUiLayoutSurface(surface))
|
|
80
80
|
this.layout.setSurface(surface);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
const type = this.valueFor(style, 'nav-type', this.defaultNavigationType());
|
|
88
|
-
const position = this.valueFor(style, 'nav-position', this.defaultNavigationPosition());
|
|
89
|
-
const typeMode = this.valueFor(style, 'nav-type-mode', 'default');
|
|
81
|
+
}
|
|
82
|
+
applyNavigationValues(themeAppearance) {
|
|
83
|
+
const orientation = this.valueFor(themeAppearance, 'nav-orientation', this.defaultNavigationOrientation());
|
|
84
|
+
const type = this.valueFor(themeAppearance, 'nav-type', this.defaultNavigationType());
|
|
85
|
+
const position = this.valueFor(themeAppearance, 'nav-position', this.defaultNavigationPosition());
|
|
86
|
+
const typeMode = this.valueFor(themeAppearance, 'nav-type-mode', 'default');
|
|
90
87
|
this.navigation.update(PRIMARY_NAVIGATION_ID$2, {
|
|
91
88
|
orientation: isNavigationOrientation(orientation)
|
|
92
89
|
? orientation
|
|
@@ -103,39 +100,35 @@ class ThemeStylePresetService {
|
|
|
103
100
|
: this.defaultNavigationDockbarMode(),
|
|
104
101
|
});
|
|
105
102
|
}
|
|
106
|
-
enforceLockedValues(
|
|
107
|
-
const mode = this.lockedValueFor(
|
|
103
|
+
enforceLockedValues(themeAppearance) {
|
|
104
|
+
const mode = this.lockedValueFor(themeAppearance, 'theme-mode');
|
|
108
105
|
if (isThemeMode(mode) && this.themeMode.mode() !== mode)
|
|
109
106
|
this.themeMode.setMode(mode);
|
|
110
|
-
const space = this.lockedValueFor(
|
|
107
|
+
const space = this.lockedValueFor(themeAppearance, 'theme-space');
|
|
111
108
|
if (isThemeSpace(space) && this.themeSpace.space() !== space)
|
|
112
109
|
this.themeSpace.setSpace(space);
|
|
113
|
-
const radius = this.lockedValueFor(
|
|
110
|
+
const radius = this.lockedValueFor(themeAppearance, 'theme-radius');
|
|
114
111
|
if (isThemeRadius(radius) && this.themeRadius.radius() !== radius)
|
|
115
112
|
this.themeRadius.setRadius(radius);
|
|
116
|
-
const color = this.lockedValueFor(
|
|
113
|
+
const color = this.lockedValueFor(themeAppearance, 'theme-color');
|
|
117
114
|
if (isThemeColor(color) && this.themeColor.color() !== color)
|
|
118
115
|
this.themeColor.setColor(color);
|
|
119
|
-
const brand = this.lockedValueFor(
|
|
116
|
+
const brand = this.lockedValueFor(themeAppearance, 'theme-brand');
|
|
120
117
|
if (isThemeBrand(brand) && this.themeBrand.brand() !== brand)
|
|
121
118
|
this.themeBrand.setBrand(brand);
|
|
122
|
-
const type = this.lockedValueFor(
|
|
119
|
+
const type = this.lockedValueFor(themeAppearance, 'layout-type');
|
|
123
120
|
if (isUiLayoutType(type) && this.layout.type() !== type)
|
|
124
121
|
this.layout.setType(type);
|
|
125
|
-
const width = this.lockedValueFor(
|
|
122
|
+
const width = this.lockedValueFor(themeAppearance, 'layout-width');
|
|
126
123
|
if (isUiLayoutWidth(width) && this.layout.width() !== width)
|
|
127
124
|
this.layout.setWidth(width);
|
|
128
|
-
const surface = this.lockedValueFor(
|
|
125
|
+
const surface = this.lockedValueFor(themeAppearance, 'layout-surface');
|
|
129
126
|
if (isUiLayoutSurface(surface) && this.layout.surface() !== surface)
|
|
130
127
|
this.layout.setSurface(surface);
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const orientation = this.lockedValueFor(style, 'nav-orientation');
|
|
136
|
-
const navigationType = this.lockedValueFor(style, 'nav-type');
|
|
137
|
-
const position = this.lockedValueFor(style, 'nav-position');
|
|
138
|
-
const typeMode = this.lockedValueFor(style, 'nav-type-mode');
|
|
128
|
+
const orientation = this.lockedValueFor(themeAppearance, 'nav-orientation');
|
|
129
|
+
const navigationType = this.lockedValueFor(themeAppearance, 'nav-type');
|
|
130
|
+
const position = this.lockedValueFor(themeAppearance, 'nav-position');
|
|
131
|
+
const typeMode = this.lockedValueFor(themeAppearance, 'nav-type-mode');
|
|
139
132
|
const currentNavigationState = this.navigation.currentState(PRIMARY_NAVIGATION_ID$2);
|
|
140
133
|
const navigationState = currentNavigationState ?? {
|
|
141
134
|
id: PRIMARY_NAVIGATION_ID$2,
|
|
@@ -176,12 +169,12 @@ class ThemeStylePresetService {
|
|
|
176
169
|
this.navigation.update(PRIMARY_NAVIGATION_ID$2, navigationUpdate);
|
|
177
170
|
}
|
|
178
171
|
}
|
|
179
|
-
lockedValueFor(
|
|
180
|
-
const entry =
|
|
172
|
+
lockedValueFor(themeAppearance, key) {
|
|
173
|
+
const entry = themeAppearancePresetEntry(themeAppearance, key);
|
|
181
174
|
return entry.control === 'fix' ? entry.value : null;
|
|
182
175
|
}
|
|
183
|
-
valueFor(
|
|
184
|
-
const value =
|
|
176
|
+
valueFor(themeAppearance, key, fallback) {
|
|
177
|
+
const value = themeAppearancePresetEntry(themeAppearance, key).value;
|
|
185
178
|
return value === 'default' ? fallback : value;
|
|
186
179
|
}
|
|
187
180
|
defaultMode() {
|
|
@@ -208,9 +201,6 @@ class ThemeStylePresetService {
|
|
|
208
201
|
defaultLayoutSurface() {
|
|
209
202
|
return this.config?.defaults?.layout.surface ?? LAYOUT_DEFAULT_SURFACE;
|
|
210
203
|
}
|
|
211
|
-
defaultLayoutAppearance() {
|
|
212
|
-
return this.config?.defaults?.layout.appearance ?? LAYOUT_DEFAULT_STYLE;
|
|
213
|
-
}
|
|
214
204
|
defaultNavigationOrientation() {
|
|
215
205
|
return this.config?.defaults?.navigation.orientation ?? 'vertical';
|
|
216
206
|
}
|
|
@@ -226,10 +216,10 @@ class ThemeStylePresetService {
|
|
|
226
216
|
defaultNavigationDockbarMode() {
|
|
227
217
|
return this.config?.defaults?.navigation.dockbarMode ?? 'default';
|
|
228
218
|
}
|
|
229
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type:
|
|
230
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.7", ngImport: i0, type:
|
|
219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ThemeAppearancePresetService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
220
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.7", ngImport: i0, type: ThemeAppearancePresetService });
|
|
231
221
|
}
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type:
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ThemeAppearancePresetService, decorators: [{
|
|
233
223
|
type: Service
|
|
234
224
|
}], ctorParameters: () => [] });
|
|
235
225
|
function isNavigationType(value) {
|
|
@@ -250,7 +240,7 @@ function provideAppPreferences(config = {}) {
|
|
|
250
240
|
return makeEnvironmentProviders([
|
|
251
241
|
{ provide: APP_PREFERENCES_CONFIG, useValue: config },
|
|
252
242
|
provideEnvironmentInitializer(() => {
|
|
253
|
-
inject(
|
|
243
|
+
inject(ThemeAppearancePresetService);
|
|
254
244
|
}),
|
|
255
245
|
]);
|
|
256
246
|
}
|
|
@@ -476,11 +466,10 @@ const VERTICAL_NAVIGATION_TYPES = ['sidebar', 'dockbar'];
|
|
|
476
466
|
const HORIZONTAL_NAVIGATION_TYPES = ['navbar', 'flyout'];
|
|
477
467
|
const NAVIGATION_LAYOUT_TYPES = ['vertical', 'horizontal'];
|
|
478
468
|
const DOCKBAR_MODES = ['default', 'sticky', 'drawer'];
|
|
479
|
-
const
|
|
480
|
-
|
|
469
|
+
const THEME_APPEARANCE_OPTIONS = {
|
|
470
|
+
browser: { label: 'Browser', icon: 'language' },
|
|
481
471
|
rail: { label: 'Rail', icon: 'view_sidebar' },
|
|
482
|
-
|
|
483
|
-
aye: { label: 'Aye', icon: 'visibility' },
|
|
472
|
+
tablet: { label: 'Tablet', icon: 'tablet_android' },
|
|
484
473
|
desktop: { label: 'Desktop', icon: 'desktop_windows' },
|
|
485
474
|
};
|
|
486
475
|
const THEME_MODE_OPTIONS = {
|
|
@@ -504,12 +493,6 @@ const THEME_RADIUS_OPTIONS = {
|
|
|
504
493
|
medium: { label: 'Sedang', icon: 'rounded_corner' },
|
|
505
494
|
large: { label: 'Besar', icon: 'rounded_corner' },
|
|
506
495
|
};
|
|
507
|
-
const LAYOUT_APPEARANCE_OPTIONS = {
|
|
508
|
-
base: { label: 'Dasar', icon: 'crop_square' },
|
|
509
|
-
'border-rail': { label: 'Border rail', icon: 'border_outer' },
|
|
510
|
-
ala: { label: 'Ala', icon: 'space_dashboard' },
|
|
511
|
-
desktop: { label: 'Desktop', icon: 'desktop_windows' },
|
|
512
|
-
};
|
|
513
496
|
const LAYOUT_SURFACE_OPTIONS = {
|
|
514
497
|
base: { label: 'Dasar', icon: 'crop_square' },
|
|
515
498
|
flat: { label: 'Datar', icon: 'crop_16_9' },
|
|
@@ -555,7 +538,7 @@ class AppPreferencesSurfaceComponent {
|
|
|
555
538
|
themeMode = inject(ThemeModeService);
|
|
556
539
|
themeSpace = inject(ThemeSpaceService);
|
|
557
540
|
themeRadius = inject(ThemeRadiusService);
|
|
558
|
-
|
|
541
|
+
themeAppearanceService = inject(ThemeAppearanceService);
|
|
559
542
|
themeColor = inject(ThemeColorService);
|
|
560
543
|
themeBrand = inject(ThemeBrandService);
|
|
561
544
|
layout = inject(LayoutService);
|
|
@@ -570,10 +553,9 @@ class AppPreferencesSurfaceComponent {
|
|
|
570
553
|
mode = this.themeMode.mode;
|
|
571
554
|
space = this.themeSpace.space;
|
|
572
555
|
radius = this.themeRadius.radius;
|
|
573
|
-
|
|
556
|
+
themeAppearance = this.themeAppearanceService.appearance;
|
|
574
557
|
color = this.themeColor.color;
|
|
575
558
|
brand = this.themeBrand.brand;
|
|
576
|
-
appearance = this.layout.appearance;
|
|
577
559
|
surface = this.layout.surface;
|
|
578
560
|
width = this.layout.width;
|
|
579
561
|
layoutType = this.layout.type;
|
|
@@ -586,13 +568,12 @@ class AppPreferencesSurfaceComponent {
|
|
|
586
568
|
dockbarMode: 'default',
|
|
587
569
|
}, /* @ts-ignore */
|
|
588
570
|
...(ngDevMode ? [{ debugName: "navigationState" }] : /* istanbul ignore next */ []));
|
|
589
|
-
|
|
571
|
+
themeAppearanceOptions = toOptions(THEME_APPEARANCES, THEME_APPEARANCE_OPTIONS);
|
|
590
572
|
modeOptions = toOptions(THEME_MODES, THEME_MODE_OPTIONS);
|
|
591
573
|
colorOptions = toOptions(THEME_COLORS, THEME_COLOR_OPTIONS);
|
|
592
574
|
brandOptions = toOptions(THEME_BRANDS, THEME_BRAND_OPTIONS);
|
|
593
575
|
spaceOptions = toOptions(THEME_SPACES, THEME_SPACE_OPTIONS);
|
|
594
576
|
radiusOptions = toOptions(THEME_RADII, THEME_RADIUS_OPTIONS);
|
|
595
|
-
appearanceOptions = toOptions(['base', 'border-rail', 'ala', 'desktop'], LAYOUT_APPEARANCE_OPTIONS);
|
|
596
577
|
surfaceOptions = toOptions(['base', 'flat', 'grid'], LAYOUT_SURFACE_OPTIONS);
|
|
597
578
|
widthOptions = toOptions(['full', 'wide', 'container', 'fluid'], LAYOUT_WIDTH_OPTIONS);
|
|
598
579
|
layoutTypeOptions = toOptions(NAVIGATION_LAYOUT_TYPES, LAYOUT_TYPE_OPTIONS);
|
|
@@ -644,14 +625,14 @@ class AppPreferencesSurfaceComponent {
|
|
|
644
625
|
closeButton?.focus({ preventScroll: true });
|
|
645
626
|
});
|
|
646
627
|
}
|
|
647
|
-
|
|
648
|
-
if (!
|
|
628
|
+
selectThemeAppearance(value) {
|
|
629
|
+
if (!isThemeAppearance(value))
|
|
649
630
|
return;
|
|
650
|
-
//
|
|
631
|
+
// An appearance may switch the shell between sidebar and dockbar. Close the
|
|
651
632
|
// currently projected panel first so the navigation tree and preferences
|
|
652
633
|
// surface do not transition at the same time.
|
|
653
634
|
this.preferences.close();
|
|
654
|
-
this.
|
|
635
|
+
this.themeAppearanceService.setAppearance(value);
|
|
655
636
|
}
|
|
656
637
|
selectMode(value) {
|
|
657
638
|
if (!this.isLocked('theme-mode') && isThemeMode(value))
|
|
@@ -673,11 +654,6 @@ class AppPreferencesSurfaceComponent {
|
|
|
673
654
|
if (!this.isLocked('theme-radius') && isThemeRadius(value))
|
|
674
655
|
this.themeRadius.setRadius(value);
|
|
675
656
|
}
|
|
676
|
-
selectAppearance(value) {
|
|
677
|
-
if (!this.isLocked('layout-appearance') && isUiLayoutStyle(value)) {
|
|
678
|
-
this.layout.setAppearance(value);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
657
|
selectSurface(value) {
|
|
682
658
|
if (!this.isLocked('layout-surface') && isUiLayoutSurface(value)) {
|
|
683
659
|
this.layout.setSurface(value);
|
|
@@ -759,12 +735,8 @@ class AppPreferencesSurfaceComponent {
|
|
|
759
735
|
this.themeRadius.setRadius(defaults.theme.radius);
|
|
760
736
|
changed = true;
|
|
761
737
|
}
|
|
762
|
-
if (this.
|
|
763
|
-
this.
|
|
764
|
-
changed = true;
|
|
765
|
-
}
|
|
766
|
-
if (!this.isLocked('layout-appearance') && this.appearance() !== defaults.layout.appearance) {
|
|
767
|
-
this.layout.setAppearance(defaults.layout.appearance);
|
|
738
|
+
if (this.themeAppearance() !== defaults.theme.appearance) {
|
|
739
|
+
this.themeAppearanceService.setAppearance(defaults.theme.appearance);
|
|
768
740
|
changed = true;
|
|
769
741
|
}
|
|
770
742
|
if (!this.isLocked('layout-surface') && this.surface() !== defaults.layout.surface) {
|
|
@@ -808,13 +780,13 @@ class AppPreferencesSurfaceComponent {
|
|
|
808
780
|
queueMicrotask(() => this.announcement.set(message));
|
|
809
781
|
}
|
|
810
782
|
isLocked(key) {
|
|
811
|
-
return
|
|
783
|
+
return isThemeAppearanceSettingLocked(this.themeAppearance(), key);
|
|
812
784
|
}
|
|
813
785
|
isLayoutTypeLocked() {
|
|
814
786
|
return this.isLocked('layout-type') || this.isLocked('nav-orientation');
|
|
815
787
|
}
|
|
816
788
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: AppPreferencesSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
817
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: AppPreferencesSurfaceComponent, isStandalone: true, selector: "app-preferences-surface", outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "block h-full min-h-0 w-full" }, ngImport: i0, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-
|
|
789
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: AppPreferencesSurfaceComponent, isStandalone: true, selector: "app-preferences-surface", outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "block h-full min-h-0 w-full" }, ngImport: i0, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-theme-appearance\"\n title=\"Tampilan tema\"\n [activeLabel]=\"\n themeAppearanceOptions.find((option) => option.value === themeAppearance())?.label ??\n themeAppearance()\n \"\n [options]=\"themeAppearanceOptions\"\n [selected]=\"themeAppearance()\"\n (optionSelected)=\"selectThemeAppearance($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-mode\"\n title=\"Mode warna\"\n description=\"Sistem mengikuti preferensi perangkat.\"\n [activeLabel]=\"modeOptions.find((option) => option.value === mode())?.label ?? mode()\"\n [options]=\"modeOptions\"\n [selected]=\"mode()\"\n [locked]=\"isLocked('theme-mode')\"\n (optionSelected)=\"selectMode($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-color\"\n title=\"Warna tema\"\n [activeLabel]=\"colorOptions.find((option) => option.value === color())?.label ?? color()\"\n [options]=\"colorOptions\"\n [selected]=\"color()\"\n [locked]=\"isLocked('theme-color')\"\n (optionSelected)=\"selectColor($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-brand\"\n title=\"Brand\"\n [activeLabel]=\"brandOptions.find((option) => option.value === brand())?.label ?? brand()\"\n [options]=\"brandOptions\"\n [selected]=\"brand()\"\n [locked]=\"isLocked('theme-brand')\"\n (optionSelected)=\"selectBrand($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-space\"\n title=\"Kerapatan\"\n [activeLabel]=\"spaceOptions.find((option) => option.value === space())?.label ?? space()\"\n [options]=\"spaceOptions\"\n [selected]=\"space()\"\n [locked]=\"isLocked('theme-space')\"\n (optionSelected)=\"selectSpace($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-radius\"\n title=\"Sudut\"\n [activeLabel]=\"\n radiusOptions.find((option) => option.value === radius())?.label ?? radius()\n \"\n [options]=\"radiusOptions\"\n [selected]=\"radius()\"\n [locked]=\"isLocked('theme-radius')\"\n (optionSelected)=\"selectRadius($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-layout\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-layout\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Layout\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-surface\"\n title=\"Latar\"\n [activeLabel]=\"\n surfaceOptions.find((option) => option.value === surface())?.label ?? surface()\n \"\n [options]=\"surfaceOptions\"\n [selected]=\"surface()\"\n [locked]=\"isLocked('layout-surface')\"\n (optionSelected)=\"selectSurface($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-layout-type\"\n title=\"Tipe layout\"\n [activeLabel]=\"\n layoutTypeOptions.find((option) => option.value === layoutType())?.label ?? layoutType()\n \"\n [options]=\"layoutTypeOptions\"\n [selected]=\"layoutType()\"\n [locked]=\"isLayoutTypeLocked()\"\n (optionSelected)=\"selectLayoutType($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-width\"\n title=\"Lebar konten\"\n [activeLabel]=\"widthOptions.find((option) => option.value === width())?.label ?? width()\"\n [options]=\"widthOptions\"\n [selected]=\"width()\"\n [locked]=\"isLocked('layout-width')\"\n (optionSelected)=\"selectWidth($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-navigation\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-navigation\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Navigasi\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-type\"\n title=\"Tipe navigation\"\n [activeLabel]=\"navigationTypeLabel()\"\n [options]=\"navigationTypeOptions()\"\n [selected]=\"navigationState().type\"\n [locked]=\"isLocked('nav-type')\"\n (optionSelected)=\"selectNavigationType($event)\"\n />\n @if (navigationState().orientation === 'vertical') {\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-mode\"\n title=\"Mode navigation\"\n [activeLabel]=\"navigationModeLabel()\"\n [options]=\"navigationModeOptions()\"\n [selected]=\"navigationMode()\"\n [locked]=\"isLocked('nav-type-mode')\"\n (optionSelected)=\"selectNavigationMode($event)\"\n />\n }\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-position\"\n title=\"Posisi navigation\"\n [activeLabel]=\"navigationPositionLabel()\"\n [options]=\"navigationPositionOptions()\"\n [selected]=\"navigationState().position\"\n [locked]=\"isLocked('nav-position')\"\n (optionSelected)=\"selectNavigationPosition($event)\"\n />\n </section>\n </div>\n </PageContent>\n\n @if (hasDefaults()) {\n <PageFooter class=\"px-3 py-0\">\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n class=\"h-full w-full justify-start\"\n (click)=\"resetToDefaults()\"\n >\n <Icon name=\"restart_alt\" [size]=\"18\" />\n Kembalikan default\n </button>\n </PageFooter>\n }\n\n <p class=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</p>\n</Page>\n", dependencies: [{ kind: "component", type: AppPreferenceSettingGroupComponent, selector: "app-preference-setting-group", inputs: ["title", "description", "activeLabel", "options", "selected", "headingId", "locked"], outputs: ["optionSelected"] }, { kind: "component", type: ButtonComponent, selector: "button[Button], a[Button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: PageComponent, selector: "Page", inputs: ["variant", "height", "scroll", "position", "sideMode", "sideOpen", "sideWidth", "class"], outputs: ["sideOpenChange"] }, { kind: "component", type: PageContentComponent, selector: "PageContent", inputs: ["class"] }, { kind: "component", type: PageFooterComponent, selector: "PageFooter", inputs: ["class"] }, { kind: "component", type: PageHeaderComponent, selector: "PageHeader", inputs: ["class"] }] });
|
|
818
790
|
}
|
|
819
791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: AppPreferencesSurfaceComponent, decorators: [{
|
|
820
792
|
type: Component,
|
|
@@ -828,7 +800,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
828
800
|
PageHeaderComponent,
|
|
829
801
|
], host: {
|
|
830
802
|
class: 'block h-full min-h-0 w-full',
|
|
831
|
-
}, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-
|
|
803
|
+
}, template: "<Page variant=\"stacked\" height=\"fix\" scroll=\"content\" class=\"bg-background\">\n <PageHeader class=\"h-11 px-3 py-0\">\n <div class=\"flex h-full items-center justify-between gap-3\">\n <h2\n id=\"app-preferences-title\"\n class=\"min-w-0 truncate text-base font-semibold text-foreground\"\n >\n Preferensi aplikasi\n </h2>\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-11 w-11 shrink-0\"\n data-app-preferences-close\n aria-label=\"Tutup preferensi aplikasi\"\n (click)=\"closeRequested.emit()\"\n >\n <Icon name=\"close\" [size]=\"20\" />\n </button>\n </div>\n </PageHeader>\n\n <PageContent class=\"overscroll-contain bg-muted/20\">\n <div class=\"space-y-5 p-3\">\n <p class=\"text-xs leading-4 text-muted-foreground\">\n Sesuaikan tampilan dan navigasi aplikasi.\n </p>\n\n <section aria-labelledby=\"app-preferences-theme\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-theme\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Tema\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-theme-appearance\"\n title=\"Tampilan tema\"\n [activeLabel]=\"\n themeAppearanceOptions.find((option) => option.value === themeAppearance())?.label ??\n themeAppearance()\n \"\n [options]=\"themeAppearanceOptions\"\n [selected]=\"themeAppearance()\"\n (optionSelected)=\"selectThemeAppearance($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-mode\"\n title=\"Mode warna\"\n description=\"Sistem mengikuti preferensi perangkat.\"\n [activeLabel]=\"modeOptions.find((option) => option.value === mode())?.label ?? mode()\"\n [options]=\"modeOptions\"\n [selected]=\"mode()\"\n [locked]=\"isLocked('theme-mode')\"\n (optionSelected)=\"selectMode($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-color\"\n title=\"Warna tema\"\n [activeLabel]=\"colorOptions.find((option) => option.value === color())?.label ?? color()\"\n [options]=\"colorOptions\"\n [selected]=\"color()\"\n [locked]=\"isLocked('theme-color')\"\n (optionSelected)=\"selectColor($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-brand\"\n title=\"Brand\"\n [activeLabel]=\"brandOptions.find((option) => option.value === brand())?.label ?? brand()\"\n [options]=\"brandOptions\"\n [selected]=\"brand()\"\n [locked]=\"isLocked('theme-brand')\"\n (optionSelected)=\"selectBrand($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-space\"\n title=\"Kerapatan\"\n [activeLabel]=\"spaceOptions.find((option) => option.value === space())?.label ?? space()\"\n [options]=\"spaceOptions\"\n [selected]=\"space()\"\n [locked]=\"isLocked('theme-space')\"\n (optionSelected)=\"selectSpace($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-radius\"\n title=\"Sudut\"\n [activeLabel]=\"\n radiusOptions.find((option) => option.value === radius())?.label ?? radius()\n \"\n [options]=\"radiusOptions\"\n [selected]=\"radius()\"\n [locked]=\"isLocked('theme-radius')\"\n (optionSelected)=\"selectRadius($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-layout\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-layout\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Layout\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-surface\"\n title=\"Latar\"\n [activeLabel]=\"\n surfaceOptions.find((option) => option.value === surface())?.label ?? surface()\n \"\n [options]=\"surfaceOptions\"\n [selected]=\"surface()\"\n [locked]=\"isLocked('layout-surface')\"\n (optionSelected)=\"selectSurface($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-layout-type\"\n title=\"Tipe layout\"\n [activeLabel]=\"\n layoutTypeOptions.find((option) => option.value === layoutType())?.label ?? layoutType()\n \"\n [options]=\"layoutTypeOptions\"\n [selected]=\"layoutType()\"\n [locked]=\"isLayoutTypeLocked()\"\n (optionSelected)=\"selectLayoutType($event)\"\n />\n <app-preference-setting-group\n headingId=\"app-preferences-width\"\n title=\"Lebar konten\"\n [activeLabel]=\"widthOptions.find((option) => option.value === width())?.label ?? width()\"\n [options]=\"widthOptions\"\n [selected]=\"width()\"\n [locked]=\"isLocked('layout-width')\"\n (optionSelected)=\"selectWidth($event)\"\n />\n </section>\n\n <section aria-labelledby=\"app-preferences-navigation\" class=\"space-y-2\">\n <h2\n id=\"app-preferences-navigation\"\n class=\"text-xs font-semibold tracking-wide text-muted-foreground\"\n >\n Navigasi\n </h2>\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-type\"\n title=\"Tipe navigation\"\n [activeLabel]=\"navigationTypeLabel()\"\n [options]=\"navigationTypeOptions()\"\n [selected]=\"navigationState().type\"\n [locked]=\"isLocked('nav-type')\"\n (optionSelected)=\"selectNavigationType($event)\"\n />\n @if (navigationState().orientation === 'vertical') {\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-mode\"\n title=\"Mode navigation\"\n [activeLabel]=\"navigationModeLabel()\"\n [options]=\"navigationModeOptions()\"\n [selected]=\"navigationMode()\"\n [locked]=\"isLocked('nav-type-mode')\"\n (optionSelected)=\"selectNavigationMode($event)\"\n />\n }\n <app-preference-setting-group\n headingId=\"app-preferences-navigation-position\"\n title=\"Posisi navigation\"\n [activeLabel]=\"navigationPositionLabel()\"\n [options]=\"navigationPositionOptions()\"\n [selected]=\"navigationState().position\"\n [locked]=\"isLocked('nav-position')\"\n (optionSelected)=\"selectNavigationPosition($event)\"\n />\n </section>\n </div>\n </PageContent>\n\n @if (hasDefaults()) {\n <PageFooter class=\"px-3 py-0\">\n <button\n type=\"button\"\n Button\n variant=\"ghost\"\n class=\"h-full w-full justify-start\"\n (click)=\"resetToDefaults()\"\n >\n <Icon name=\"restart_alt\" [size]=\"18\" />\n Kembalikan default\n </button>\n </PageFooter>\n }\n\n <p class=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</p>\n</Page>\n" }]
|
|
832
804
|
}], ctorParameters: () => [], propDecorators: { closeRequested: [{ type: i0.Output, args: ["closeRequested"] }] } });
|
|
833
805
|
function isNavigationTypeForOrientation(value, orientation) {
|
|
834
806
|
return orientation === 'vertical'
|
|
@@ -988,14 +960,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
988
960
|
}]
|
|
989
961
|
}] });
|
|
990
962
|
|
|
991
|
-
/**
|
|
963
|
+
/** Registers the immutable runtime device without replacing a stored theme preference. */
|
|
992
964
|
function provideRuntimeThemeDevice() {
|
|
993
965
|
return makeEnvironmentProviders([
|
|
994
966
|
provideAppInitializer(() => {
|
|
995
967
|
const runtime = inject(RuntimeContextService);
|
|
996
968
|
const themeDevice = inject(ThemeDeviceService);
|
|
997
969
|
return runtime.initialize().then(() => {
|
|
998
|
-
themeDevice.
|
|
970
|
+
themeDevice.registerType(runtime.deviceType());
|
|
999
971
|
});
|
|
1000
972
|
}),
|
|
1001
973
|
]);
|