@edsis/angular 22.0.45 → 22.0.53
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 +152 -76
- package/fesm2022/edsis-angular-block-shell.mjs.map +1 -1
- package/fesm2022/edsis-angular-block-themes.mjs +334 -37
- package/fesm2022/edsis-angular-block-themes.mjs.map +1 -1
- package/package.json +5 -5
- package/types/edsis-angular-block-shell.d.ts +3 -0
- package/types/edsis-angular-block-themes.d.ts +9 -4
|
@@ -1,20 +1,169 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders,
|
|
2
|
+
import { inject, effect, Service, InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, Injector, linkedSignal, computed, afterNextRender, input, output, Component, ElementRef, signal, DestroyRef, Directive } from '@angular/core';
|
|
3
|
+
import { NavigationService } from '@edsis/navigation/service';
|
|
4
|
+
import { LayoutService, isUiLayoutType, isUiLayoutWidth, isUiLayoutSurface, isUiLayoutStyle } from '@edsis/theme/layout';
|
|
5
|
+
import { ThemeStyleService, ThemeModeService, ThemeColorService, ThemeBrandService, isThemeMode, isThemeColor, isThemeBrand, themeStylePresetEntry, DEFAULT_THEME_MODE, DEFAULT_THEME_COLOR, DEFAULT_THEME_BRAND, ThemeSpaceService, ThemeRadiusService, THEME_STYLES, THEME_MODES, THEME_COLORS, THEME_BRANDS, THEME_SPACES, THEME_RADII, isThemeStyle, isThemeSpace, isThemeRadius, isThemeStyleSettingLocked } from '@edsis/theme/styles';
|
|
6
|
+
import { LAYOUT_DEFAULT_TYPE, LAYOUT_DEFAULT_WIDTH, LAYOUT_DEFAULT_SURFACE, LAYOUT_DEFAULT_STYLE } from '@edsis/theme/layout/types';
|
|
3
7
|
import { DOCUMENT } from '@angular/common';
|
|
4
8
|
import { SheetComponent } from '@edsis/component/sheet';
|
|
5
|
-
import {
|
|
6
|
-
import { LayoutService } from '@edsis/theme/layout/services';
|
|
9
|
+
import { LayoutService as LayoutService$1 } from '@edsis/theme/layout/services';
|
|
7
10
|
import { ButtonComponent } from '@edsis/component/button';
|
|
8
11
|
import { IconComponent } from '@edsis/component/icon';
|
|
9
|
-
import { LayoutService as LayoutService$1, isUiLayoutStyle, isUiLayoutSurface, isUiLayoutWidth } from '@edsis/theme/layout';
|
|
10
12
|
import { PageComponent, PageContentComponent, PageFooterComponent, PageHeaderComponent } from '@edsis/theme/page';
|
|
11
|
-
import { ThemeModeService, ThemeSpaceService, ThemeRadiusService, ThemeStyleService, THEME_STYLES, THEME_MODES, THEME_SPACES, THEME_RADII, isThemeStyle, isThemeMode, isThemeSpace, isThemeRadius } from '@edsis/theme/styles';
|
|
12
13
|
import { ToggleGroupComponent, ToggleGroupItemDirective } from '@edsis/component/toggle-group';
|
|
13
14
|
import { TooltipDirective } from '@edsis/component/tooltip';
|
|
14
15
|
|
|
16
|
+
const PRIMARY_NAVIGATION_ID$2 = 'main';
|
|
17
|
+
const NAVIGATION_TYPES = ['sidebar', 'dockbar', 'navbar', 'flyout'];
|
|
18
|
+
const NAVIGATION_ORIENTATIONS = ['vertical', 'horizontal'];
|
|
19
|
+
const NAVIGATION_POSITIONS = ['left', 'right', 'top', 'bottom'];
|
|
20
|
+
const NAVIGATION_DOCKBAR_MODES = ['default', 'drawer', 'sticky'];
|
|
21
|
+
class ThemeStylePresetService {
|
|
22
|
+
config = inject(APP_PREFERENCES_CONFIG, { optional: true });
|
|
23
|
+
themeStyle = inject(ThemeStyleService);
|
|
24
|
+
themeMode = inject(ThemeModeService);
|
|
25
|
+
themeColor = inject(ThemeColorService);
|
|
26
|
+
themeBrand = inject(ThemeBrandService);
|
|
27
|
+
layout = inject(LayoutService);
|
|
28
|
+
navigation = inject(NavigationService);
|
|
29
|
+
constructor() {
|
|
30
|
+
let previousStyle = this.themeStyle.style();
|
|
31
|
+
this.enforceLockedValues(previousStyle);
|
|
32
|
+
effect(() => {
|
|
33
|
+
const style = this.themeStyle.style();
|
|
34
|
+
if (style === previousStyle)
|
|
35
|
+
return;
|
|
36
|
+
previousStyle = style;
|
|
37
|
+
this.applyPreset(style);
|
|
38
|
+
});
|
|
39
|
+
effect(() => this.enforceLockedValues(this.themeStyle.style()));
|
|
40
|
+
}
|
|
41
|
+
applyPreset(style) {
|
|
42
|
+
this.applyThemeValues(style);
|
|
43
|
+
this.applyLayoutValues(style);
|
|
44
|
+
this.applyNavigationValues(style);
|
|
45
|
+
}
|
|
46
|
+
applyThemeValues(style) {
|
|
47
|
+
const mode = this.valueFor(style, 'theme-mode', this.defaultMode());
|
|
48
|
+
if (isThemeMode(mode))
|
|
49
|
+
this.themeMode.setMode(mode);
|
|
50
|
+
const color = this.valueFor(style, 'theme-color', this.defaultColor());
|
|
51
|
+
if (isThemeColor(color))
|
|
52
|
+
this.themeColor.setColor(color);
|
|
53
|
+
const brand = this.valueFor(style, 'theme-brand', this.defaultBrand());
|
|
54
|
+
if (isThemeBrand(brand))
|
|
55
|
+
this.themeBrand.setBrand(brand);
|
|
56
|
+
}
|
|
57
|
+
applyLayoutValues(style) {
|
|
58
|
+
const type = this.valueFor(style, 'layout-type', this.defaultLayoutType());
|
|
59
|
+
if (isUiLayoutType(type))
|
|
60
|
+
this.layout.setType(type);
|
|
61
|
+
const width = this.valueFor(style, 'layout-width', this.defaultLayoutWidth());
|
|
62
|
+
if (isUiLayoutWidth(width))
|
|
63
|
+
this.layout.setWidth(width);
|
|
64
|
+
const surface = this.valueFor(style, 'layout-surface', this.defaultLayoutSurface());
|
|
65
|
+
if (isUiLayoutSurface(surface))
|
|
66
|
+
this.layout.setSurface(surface);
|
|
67
|
+
const appearance = this.valueFor(style, 'layout-appearance', this.defaultLayoutAppearance());
|
|
68
|
+
if (isUiLayoutStyle(appearance))
|
|
69
|
+
this.layout.setAppearance(appearance);
|
|
70
|
+
}
|
|
71
|
+
applyNavigationValues(style) {
|
|
72
|
+
const orientation = this.valueFor(style, 'nav-orientation', this.defaultNavigationOrientation());
|
|
73
|
+
const type = this.valueFor(style, 'nav-type', this.defaultNavigationType());
|
|
74
|
+
const position = this.valueFor(style, 'nav-position', this.defaultNavigationPosition());
|
|
75
|
+
const typeMode = this.valueFor(style, 'nav-type-mode', 'default');
|
|
76
|
+
this.navigation.update(PRIMARY_NAVIGATION_ID$2, {
|
|
77
|
+
orientation: isNavigationOrientation(orientation)
|
|
78
|
+
? orientation
|
|
79
|
+
: this.defaultNavigationOrientation(),
|
|
80
|
+
type: isNavigationType(type) ? type : this.defaultNavigationType(),
|
|
81
|
+
position: isNavigationPosition(position) ? position : this.defaultNavigationPosition(),
|
|
82
|
+
collapsed: typeMode === 'collapsed'
|
|
83
|
+
? true
|
|
84
|
+
: typeMode === 'expanded'
|
|
85
|
+
? false
|
|
86
|
+
: this.defaultNavigationCollapsed(),
|
|
87
|
+
dockbarMode: isNavigationDockbarMode(typeMode)
|
|
88
|
+
? typeMode
|
|
89
|
+
: this.defaultNavigationDockbarMode(),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
enforceLockedValues(style) {
|
|
93
|
+
const appearance = themeStylePresetEntry(style, 'layout-appearance');
|
|
94
|
+
if (appearance.control === 'fix' &&
|
|
95
|
+
isUiLayoutStyle(appearance.value) &&
|
|
96
|
+
this.layout.appearance() !== appearance.value) {
|
|
97
|
+
this.layout.setAppearance(appearance.value);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
valueFor(style, key, fallback) {
|
|
101
|
+
const value = themeStylePresetEntry(style, key).value;
|
|
102
|
+
return value === 'default' ? fallback : value;
|
|
103
|
+
}
|
|
104
|
+
defaultMode() {
|
|
105
|
+
return this.config?.defaults?.theme.mode ?? DEFAULT_THEME_MODE;
|
|
106
|
+
}
|
|
107
|
+
defaultColor() {
|
|
108
|
+
return this.config?.defaults?.theme.color ?? DEFAULT_THEME_COLOR;
|
|
109
|
+
}
|
|
110
|
+
defaultBrand() {
|
|
111
|
+
return this.config?.defaults?.theme.brand ?? DEFAULT_THEME_BRAND;
|
|
112
|
+
}
|
|
113
|
+
defaultLayoutType() {
|
|
114
|
+
return this.config?.defaults?.layout.type ?? LAYOUT_DEFAULT_TYPE;
|
|
115
|
+
}
|
|
116
|
+
defaultLayoutWidth() {
|
|
117
|
+
return this.config?.defaults?.layout.width ?? LAYOUT_DEFAULT_WIDTH;
|
|
118
|
+
}
|
|
119
|
+
defaultLayoutSurface() {
|
|
120
|
+
return this.config?.defaults?.layout.surface ?? LAYOUT_DEFAULT_SURFACE;
|
|
121
|
+
}
|
|
122
|
+
defaultLayoutAppearance() {
|
|
123
|
+
return this.config?.defaults?.layout.appearance ?? LAYOUT_DEFAULT_STYLE;
|
|
124
|
+
}
|
|
125
|
+
defaultNavigationOrientation() {
|
|
126
|
+
return this.config?.defaults?.navigation.orientation ?? 'vertical';
|
|
127
|
+
}
|
|
128
|
+
defaultNavigationType() {
|
|
129
|
+
return this.config?.defaults?.navigation.type ?? 'sidebar';
|
|
130
|
+
}
|
|
131
|
+
defaultNavigationPosition() {
|
|
132
|
+
return this.config?.defaults?.navigation.position ?? 'left';
|
|
133
|
+
}
|
|
134
|
+
defaultNavigationCollapsed() {
|
|
135
|
+
return this.config?.defaults?.navigation.collapsed ?? false;
|
|
136
|
+
}
|
|
137
|
+
defaultNavigationDockbarMode() {
|
|
138
|
+
return this.config?.defaults?.navigation.dockbarMode ?? 'default';
|
|
139
|
+
}
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ThemeStylePresetService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
141
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.6", ngImport: i0, type: ThemeStylePresetService });
|
|
142
|
+
}
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ThemeStylePresetService, decorators: [{
|
|
144
|
+
type: Service
|
|
145
|
+
}], ctorParameters: () => [] });
|
|
146
|
+
function isNavigationType(value) {
|
|
147
|
+
return NAVIGATION_TYPES.includes(value);
|
|
148
|
+
}
|
|
149
|
+
function isNavigationOrientation(value) {
|
|
150
|
+
return NAVIGATION_ORIENTATIONS.includes(value);
|
|
151
|
+
}
|
|
152
|
+
function isNavigationPosition(value) {
|
|
153
|
+
return NAVIGATION_POSITIONS.includes(value);
|
|
154
|
+
}
|
|
155
|
+
function isNavigationDockbarMode(value) {
|
|
156
|
+
return NAVIGATION_DOCKBAR_MODES.includes(value);
|
|
157
|
+
}
|
|
158
|
+
|
|
15
159
|
const APP_PREFERENCES_CONFIG = new InjectionToken('APP_PREFERENCES_CONFIG');
|
|
16
160
|
function provideAppPreferences(config = {}) {
|
|
17
|
-
return makeEnvironmentProviders([
|
|
161
|
+
return makeEnvironmentProviders([
|
|
162
|
+
{ provide: APP_PREFERENCES_CONFIG, useValue: config },
|
|
163
|
+
provideEnvironmentInitializer(() => {
|
|
164
|
+
inject(ThemeStylePresetService);
|
|
165
|
+
}),
|
|
166
|
+
]);
|
|
18
167
|
}
|
|
19
168
|
|
|
20
169
|
const NAVIGATION_FOCUS_SELECTOR = '[data-navigation-id="main"] a[href]:not([aria-disabled="true"]), [data-navigation-id="main"] button:not(:disabled):not([aria-disabled="true"])';
|
|
@@ -22,7 +171,7 @@ const CONTENT_FOCUS_SELECTOR = '[data-block-shell-content][tabindex="-1"]';
|
|
|
22
171
|
class AppPreferencesPanelService {
|
|
23
172
|
document = inject(DOCUMENT, { optional: true });
|
|
24
173
|
injector = inject(Injector);
|
|
25
|
-
layout = inject(LayoutService);
|
|
174
|
+
layout = inject(LayoutService$1);
|
|
26
175
|
openedState = linkedSignal({ ...(ngDevMode ? { debugName: "openedState" } : /* istanbul ignore next */ {}), source: this.layout.type,
|
|
27
176
|
computation: () => false });
|
|
28
177
|
origin = null;
|
|
@@ -125,14 +274,16 @@ class AppPreferenceSettingGroupComponent {
|
|
|
125
274
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
126
275
|
headingId = input.required(/* @ts-ignore */
|
|
127
276
|
...(ngDevMode ? [{ debugName: "headingId" }] : /* istanbul ignore next */ []));
|
|
277
|
+
locked = input(false, /* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []));
|
|
128
279
|
optionSelected = output();
|
|
129
280
|
onValueChange(value) {
|
|
130
|
-
if (value !== null) {
|
|
281
|
+
if (value !== null && !this.locked()) {
|
|
131
282
|
this.optionSelected.emit(value);
|
|
132
283
|
}
|
|
133
284
|
}
|
|
134
285
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AppPreferenceSettingGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
135
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AppPreferenceSettingGroupComponent, isStandalone: true, selector: "app-preference-setting-group", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, activeLabel: { classPropertyName: "activeLabel", publicName: "activeLabel", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null }, headingId: { classPropertyName: "headingId", publicName: "headingId", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { optionSelected: "optionSelected" }, ngImport: i0, template: `
|
|
286
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AppPreferenceSettingGroupComponent, isStandalone: true, selector: "app-preference-setting-group", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, activeLabel: { classPropertyName: "activeLabel", publicName: "activeLabel", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null }, headingId: { classPropertyName: "headingId", publicName: "headingId", isSignal: true, isRequired: true, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected" }, ngImport: i0, template: `
|
|
136
287
|
<section class="border-b border-border/65 px-3 py-2.5 last:border-b-0">
|
|
137
288
|
<div class="flex items-start justify-between gap-3">
|
|
138
289
|
<div class="min-w-0">
|
|
@@ -142,13 +293,22 @@ class AppPreferenceSettingGroupComponent {
|
|
|
142
293
|
}
|
|
143
294
|
</div>
|
|
144
295
|
|
|
145
|
-
<span
|
|
296
|
+
<span
|
|
297
|
+
class="flex shrink-0 items-center gap-1 font-mono text-xs text-muted-foreground"
|
|
298
|
+
[attr.aria-label]="locked() ? activeLabel() + ', dikunci oleh gaya tema' : null"
|
|
299
|
+
>
|
|
300
|
+
{{ activeLabel() }}
|
|
301
|
+
@if (locked()) {
|
|
302
|
+
<Icon name="lock" [size]="14" aria-hidden="true" />
|
|
303
|
+
}
|
|
304
|
+
</span>
|
|
146
305
|
</div>
|
|
147
306
|
|
|
148
307
|
<ToggleGroup
|
|
149
308
|
type="single"
|
|
150
309
|
variant="segmented"
|
|
151
310
|
[value]="selected()"
|
|
311
|
+
[disabled]="locked()"
|
|
152
312
|
[attr.aria-labelledby]="headingId()"
|
|
153
313
|
class="mt-2 grid w-full grid-flow-col auto-cols-fr gap-0"
|
|
154
314
|
(valueChange)="onValueChange($event)"
|
|
@@ -184,13 +344,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
184
344
|
}
|
|
185
345
|
</div>
|
|
186
346
|
|
|
187
|
-
<span
|
|
347
|
+
<span
|
|
348
|
+
class="flex shrink-0 items-center gap-1 font-mono text-xs text-muted-foreground"
|
|
349
|
+
[attr.aria-label]="locked() ? activeLabel() + ', dikunci oleh gaya tema' : null"
|
|
350
|
+
>
|
|
351
|
+
{{ activeLabel() }}
|
|
352
|
+
@if (locked()) {
|
|
353
|
+
<Icon name="lock" [size]="14" aria-hidden="true" />
|
|
354
|
+
}
|
|
355
|
+
</span>
|
|
188
356
|
</div>
|
|
189
357
|
|
|
190
358
|
<ToggleGroup
|
|
191
359
|
type="single"
|
|
192
360
|
variant="segmented"
|
|
193
361
|
[value]="selected()"
|
|
362
|
+
[disabled]="locked()"
|
|
194
363
|
[attr.aria-labelledby]="headingId()"
|
|
195
364
|
class="mt-2 grid w-full grid-flow-col auto-cols-fr gap-0"
|
|
196
365
|
(valueChange)="onValueChange($event)"
|
|
@@ -211,10 +380,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
211
380
|
</section>
|
|
212
381
|
`,
|
|
213
382
|
}]
|
|
214
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], activeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeLabel", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], headingId: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingId", required: true }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }] } });
|
|
383
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], activeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeLabel", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], headingId: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingId", required: true }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }] } });
|
|
215
384
|
|
|
216
385
|
const PRIMARY_NAVIGATION_ID$1 = 'main';
|
|
217
386
|
const VERTICAL_NAVIGATION_TYPES = ['sidebar', 'dockbar'];
|
|
387
|
+
const HORIZONTAL_NAVIGATION_TYPES = ['navbar', 'flyout'];
|
|
388
|
+
const NAVIGATION_LAYOUT_TYPES = ['vertical', 'horizontal'];
|
|
218
389
|
const DOCKBAR_MODES = ['default', 'sticky', 'drawer'];
|
|
219
390
|
const THEME_STYLE_OPTIONS = {
|
|
220
391
|
dinamic: { label: 'Dinamis', icon: 'auto_awesome' },
|
|
@@ -227,6 +398,12 @@ const THEME_MODE_OPTIONS = {
|
|
|
227
398
|
dark: { label: 'Gelap', icon: 'dark_mode' },
|
|
228
399
|
system: { label: 'Sistem', icon: 'contrast' },
|
|
229
400
|
};
|
|
401
|
+
const THEME_COLOR_OPTIONS = {
|
|
402
|
+
default: { label: 'Default', icon: 'format_color_fill' },
|
|
403
|
+
};
|
|
404
|
+
const THEME_BRAND_OPTIONS = {
|
|
405
|
+
default: { label: 'Default', icon: 'branding_watermark' },
|
|
406
|
+
};
|
|
230
407
|
const THEME_SPACE_OPTIONS = {
|
|
231
408
|
normal: { label: 'Normal', icon: 'density_large' },
|
|
232
409
|
compact: { label: 'Ringkas', icon: 'density_small' },
|
|
@@ -240,6 +417,7 @@ const THEME_RADIUS_OPTIONS = {
|
|
|
240
417
|
const LAYOUT_APPEARANCE_OPTIONS = {
|
|
241
418
|
base: { label: 'Dasar', icon: 'crop_square' },
|
|
242
419
|
'border-rail': { label: 'Border rail', icon: 'border_outer' },
|
|
420
|
+
ala: { label: 'Ala', icon: 'space_dashboard' },
|
|
243
421
|
};
|
|
244
422
|
const LAYOUT_SURFACE_OPTIONS = {
|
|
245
423
|
flat: { label: 'Datar', icon: 'crop_16_9' },
|
|
@@ -251,9 +429,21 @@ const LAYOUT_WIDTH_OPTIONS = {
|
|
|
251
429
|
container: { label: 'Container', icon: 'width_normal' },
|
|
252
430
|
fluid: { label: 'Fluid', icon: 'fit_screen' },
|
|
253
431
|
};
|
|
432
|
+
const LAYOUT_TYPE_OPTIONS = {
|
|
433
|
+
vertical: { label: 'Vertikal', icon: 'view_sidebar' },
|
|
434
|
+
horizontal: { label: 'Horizontal', icon: 'view_stream' },
|
|
435
|
+
};
|
|
254
436
|
const NAVIGATION_TYPE_OPTIONS = {
|
|
255
437
|
sidebar: { label: 'Sidebar', icon: 'left_panel_open' },
|
|
256
438
|
dockbar: { label: 'Dockbar', icon: 'dock_to_left' },
|
|
439
|
+
navbar: { label: 'Navbar', icon: 'top_panel_open' },
|
|
440
|
+
flyout: { label: 'Flyout', icon: 'menu_open' },
|
|
441
|
+
};
|
|
442
|
+
const NAVIGATION_POSITION_OPTIONS = {
|
|
443
|
+
left: { label: 'Kiri', icon: 'align_horizontal_left' },
|
|
444
|
+
right: { label: 'Kanan', icon: 'align_horizontal_right' },
|
|
445
|
+
top: { label: 'Atas', icon: 'vertical_align_top' },
|
|
446
|
+
bottom: { label: 'Bawah', icon: 'vertical_align_bottom' },
|
|
257
447
|
};
|
|
258
448
|
const DOCKBAR_MODE_OPTIONS = {
|
|
259
449
|
default: { label: 'Default', icon: 'vertical_align_center' },
|
|
@@ -273,7 +463,9 @@ class AppPreferencesSurfaceComponent {
|
|
|
273
463
|
themeSpace = inject(ThemeSpaceService);
|
|
274
464
|
themeRadius = inject(ThemeRadiusService);
|
|
275
465
|
themeStyle = inject(ThemeStyleService);
|
|
276
|
-
|
|
466
|
+
themeColor = inject(ThemeColorService);
|
|
467
|
+
themeBrand = inject(ThemeBrandService);
|
|
468
|
+
layout = inject(LayoutService);
|
|
277
469
|
navigation = inject(NavigationService);
|
|
278
470
|
host = inject((ElementRef));
|
|
279
471
|
closeRequested = output();
|
|
@@ -286,9 +478,12 @@ class AppPreferencesSurfaceComponent {
|
|
|
286
478
|
space = this.themeSpace.space;
|
|
287
479
|
radius = this.themeRadius.radius;
|
|
288
480
|
style = this.themeStyle.style;
|
|
481
|
+
color = this.themeColor.color;
|
|
482
|
+
brand = this.themeBrand.brand;
|
|
289
483
|
appearance = this.layout.appearance;
|
|
290
484
|
surface = this.layout.surface;
|
|
291
485
|
width = this.layout.width;
|
|
486
|
+
layoutType = this.layout.type;
|
|
292
487
|
navigationState = computed(() => this.navigation.state(PRIMARY_NAVIGATION_ID$1)() ?? {
|
|
293
488
|
id: PRIMARY_NAVIGATION_ID$1,
|
|
294
489
|
orientation: 'vertical',
|
|
@@ -300,21 +495,33 @@ class AppPreferencesSurfaceComponent {
|
|
|
300
495
|
...(ngDevMode ? [{ debugName: "navigationState" }] : /* istanbul ignore next */ []));
|
|
301
496
|
styleOptions = toOptions(THEME_STYLES, THEME_STYLE_OPTIONS);
|
|
302
497
|
modeOptions = toOptions(THEME_MODES, THEME_MODE_OPTIONS);
|
|
498
|
+
colorOptions = toOptions(THEME_COLORS, THEME_COLOR_OPTIONS);
|
|
499
|
+
brandOptions = toOptions(THEME_BRANDS, THEME_BRAND_OPTIONS);
|
|
303
500
|
spaceOptions = toOptions(THEME_SPACES, THEME_SPACE_OPTIONS);
|
|
304
501
|
radiusOptions = toOptions(THEME_RADII, THEME_RADIUS_OPTIONS);
|
|
305
|
-
appearanceOptions = toOptions(['base', 'border-rail'], LAYOUT_APPEARANCE_OPTIONS);
|
|
502
|
+
appearanceOptions = toOptions(['base', 'border-rail', 'ala'], LAYOUT_APPEARANCE_OPTIONS);
|
|
306
503
|
surfaceOptions = toOptions(['flat', 'grid'], LAYOUT_SURFACE_OPTIONS);
|
|
307
504
|
widthOptions = toOptions(['full', 'wide', 'container', 'fluid'], LAYOUT_WIDTH_OPTIONS);
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
?
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
505
|
+
layoutTypeOptions = toOptions(NAVIGATION_LAYOUT_TYPES, LAYOUT_TYPE_OPTIONS);
|
|
506
|
+
navigationTypeOptions = computed(() => toOptions(this.navigationState().orientation === 'vertical'
|
|
507
|
+
? VERTICAL_NAVIGATION_TYPES
|
|
508
|
+
: HORIZONTAL_NAVIGATION_TYPES, NAVIGATION_TYPE_OPTIONS), /* @ts-ignore */
|
|
509
|
+
...(ngDevMode ? [{ debugName: "navigationTypeOptions" }] : /* istanbul ignore next */ []));
|
|
510
|
+
navigationPositionOptions = computed(() => toOptions(this.navigationState().orientation === 'vertical' ? ['left', 'right'] : ['top', 'bottom'], NAVIGATION_POSITION_OPTIONS), /* @ts-ignore */
|
|
511
|
+
...(ngDevMode ? [{ debugName: "navigationPositionOptions" }] : /* istanbul ignore next */ []));
|
|
512
|
+
navigationModeOptions = computed(() => this.navigationState().orientation === 'horizontal'
|
|
513
|
+
? []
|
|
514
|
+
: this.navigationState().type === 'sidebar'
|
|
515
|
+
? [
|
|
516
|
+
{ value: 'expanded', label: 'Diperluas', icon: 'unfold_more' },
|
|
517
|
+
{ value: 'collapsed', label: 'Dipadatkan', icon: 'compress' },
|
|
518
|
+
]
|
|
519
|
+
: toOptions(DOCKBAR_MODES, DOCKBAR_MODE_OPTIONS), /* @ts-ignore */
|
|
315
520
|
...(ngDevMode ? [{ debugName: "navigationModeOptions" }] : /* istanbul ignore next */ []));
|
|
316
521
|
navigationMode = computed(() => {
|
|
317
522
|
const state = this.navigationState();
|
|
523
|
+
if (state.orientation === 'horizontal')
|
|
524
|
+
return 'default';
|
|
318
525
|
return state.type === 'sidebar'
|
|
319
526
|
? state.collapsed
|
|
320
527
|
? 'collapsed'
|
|
@@ -324,6 +531,8 @@ class AppPreferencesSurfaceComponent {
|
|
|
324
531
|
...(ngDevMode ? [{ debugName: "navigationMode" }] : /* istanbul ignore next */ []));
|
|
325
532
|
navigationModeLabel = computed(() => {
|
|
326
533
|
const state = this.navigationState();
|
|
534
|
+
if (state.orientation === 'horizontal')
|
|
535
|
+
return 'Default';
|
|
327
536
|
return state.type === 'sidebar'
|
|
328
537
|
? state.collapsed
|
|
329
538
|
? 'Dipadatkan'
|
|
@@ -331,6 +540,10 @@ class AppPreferencesSurfaceComponent {
|
|
|
331
540
|
: DOCKBAR_MODE_OPTIONS[state.dockbarMode].label;
|
|
332
541
|
}, /* @ts-ignore */
|
|
333
542
|
...(ngDevMode ? [{ debugName: "navigationModeLabel" }] : /* istanbul ignore next */ []));
|
|
543
|
+
navigationTypeLabel = computed(() => NAVIGATION_TYPE_OPTIONS[this.navigationState().type].label, /* @ts-ignore */
|
|
544
|
+
...(ngDevMode ? [{ debugName: "navigationTypeLabel" }] : /* istanbul ignore next */ []));
|
|
545
|
+
navigationPositionLabel = computed(() => NAVIGATION_POSITION_OPTIONS[this.navigationState().position].label, /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "navigationPositionLabel" }] : /* istanbul ignore next */ []));
|
|
334
547
|
constructor() {
|
|
335
548
|
const host = this.host.nativeElement;
|
|
336
549
|
afterNextRender(() => {
|
|
@@ -343,9 +556,17 @@ class AppPreferencesSurfaceComponent {
|
|
|
343
556
|
this.themeStyle.setStyle(value);
|
|
344
557
|
}
|
|
345
558
|
selectMode(value) {
|
|
346
|
-
if (isThemeMode(value))
|
|
559
|
+
if (!this.isLocked('theme-mode') && isThemeMode(value))
|
|
347
560
|
this.themeMode.setMode(value);
|
|
348
561
|
}
|
|
562
|
+
selectColor(value) {
|
|
563
|
+
if (!this.isLocked('theme-color') && isThemeColor(value))
|
|
564
|
+
this.themeColor.setColor(value);
|
|
565
|
+
}
|
|
566
|
+
selectBrand(value) {
|
|
567
|
+
if (!this.isLocked('theme-brand') && isThemeBrand(value))
|
|
568
|
+
this.themeBrand.setBrand(value);
|
|
569
|
+
}
|
|
349
570
|
selectSpace(value) {
|
|
350
571
|
if (isThemeSpace(value))
|
|
351
572
|
this.themeSpace.setSpace(value);
|
|
@@ -355,24 +576,50 @@ class AppPreferencesSurfaceComponent {
|
|
|
355
576
|
this.themeRadius.setRadius(value);
|
|
356
577
|
}
|
|
357
578
|
selectAppearance(value) {
|
|
358
|
-
if (isUiLayoutStyle(value))
|
|
579
|
+
if (!this.isLocked('layout-appearance') && isUiLayoutStyle(value)) {
|
|
359
580
|
this.layout.setAppearance(value);
|
|
581
|
+
}
|
|
360
582
|
}
|
|
361
583
|
selectSurface(value) {
|
|
362
|
-
if (isUiLayoutSurface(value))
|
|
584
|
+
if (!this.isLocked('layout-surface') && isUiLayoutSurface(value)) {
|
|
363
585
|
this.layout.setSurface(value);
|
|
586
|
+
}
|
|
364
587
|
}
|
|
365
588
|
selectWidth(value) {
|
|
366
|
-
if (isUiLayoutWidth(value))
|
|
589
|
+
if (!this.isLocked('layout-width') && isUiLayoutWidth(value))
|
|
367
590
|
this.layout.setWidth(value);
|
|
368
591
|
}
|
|
592
|
+
selectLayoutType(value) {
|
|
593
|
+
if (this.isLayoutTypeLocked() ||
|
|
594
|
+
!isUiLayoutType(value) ||
|
|
595
|
+
!NAVIGATION_LAYOUT_TYPES.includes(value)) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
const orientation = value;
|
|
599
|
+
const state = this.navigationState();
|
|
600
|
+
const type = isNavigationTypeForOrientation(state.type, orientation)
|
|
601
|
+
? state.type
|
|
602
|
+
: orientation === 'vertical'
|
|
603
|
+
? 'sidebar'
|
|
604
|
+
: 'navbar';
|
|
605
|
+
const position = isNavigationPositionForOrientation(state.position, orientation)
|
|
606
|
+
? state.position
|
|
607
|
+
: orientation === 'vertical'
|
|
608
|
+
? 'left'
|
|
609
|
+
: 'top';
|
|
610
|
+
this.layout.setType(value);
|
|
611
|
+
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { orientation, type, position });
|
|
612
|
+
}
|
|
369
613
|
selectNavigationType(value) {
|
|
370
|
-
|
|
614
|
+
const state = this.navigationState();
|
|
615
|
+
if (!this.isLocked('nav-type') && isNavigationTypeForOrientation(value, state.orientation)) {
|
|
371
616
|
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { type: value });
|
|
372
617
|
}
|
|
373
618
|
}
|
|
374
619
|
selectNavigationMode(value) {
|
|
375
620
|
const state = this.navigationState();
|
|
621
|
+
if (this.isLocked('nav-type-mode'))
|
|
622
|
+
return;
|
|
376
623
|
if (state.type === 'sidebar' && (value === 'expanded' || value === 'collapsed')) {
|
|
377
624
|
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { collapsed: value === 'collapsed' });
|
|
378
625
|
}
|
|
@@ -382,6 +629,13 @@ class AppPreferencesSurfaceComponent {
|
|
|
382
629
|
});
|
|
383
630
|
}
|
|
384
631
|
}
|
|
632
|
+
selectNavigationPosition(value) {
|
|
633
|
+
const state = this.navigationState();
|
|
634
|
+
if (!this.isLocked('nav-position') &&
|
|
635
|
+
isNavigationPositionForOrientation(value, state.orientation)) {
|
|
636
|
+
this.navigation.update(PRIMARY_NAVIGATION_ID$1, { position: value });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
385
639
|
resetToDefaults() {
|
|
386
640
|
const defaults = this.defaults;
|
|
387
641
|
if (!defaults)
|
|
@@ -391,6 +645,14 @@ class AppPreferencesSurfaceComponent {
|
|
|
391
645
|
this.themeMode.setMode(defaults.theme.mode);
|
|
392
646
|
changed = true;
|
|
393
647
|
}
|
|
648
|
+
if (this.color() !== defaults.theme.color) {
|
|
649
|
+
this.themeColor.setColor(defaults.theme.color);
|
|
650
|
+
changed = true;
|
|
651
|
+
}
|
|
652
|
+
if (this.brand() !== defaults.theme.brand) {
|
|
653
|
+
this.themeBrand.setBrand(defaults.theme.brand);
|
|
654
|
+
changed = true;
|
|
655
|
+
}
|
|
394
656
|
if (this.space() !== defaults.theme.space) {
|
|
395
657
|
this.themeSpace.setSpace(defaults.theme.space);
|
|
396
658
|
changed = true;
|
|
@@ -403,7 +665,7 @@ class AppPreferencesSurfaceComponent {
|
|
|
403
665
|
this.themeStyle.setStyle(defaults.theme.style);
|
|
404
666
|
changed = true;
|
|
405
667
|
}
|
|
406
|
-
if (this.appearance() !== defaults.layout.appearance) {
|
|
668
|
+
if (!this.isLocked('layout-appearance') && this.appearance() !== defaults.layout.appearance) {
|
|
407
669
|
this.layout.setAppearance(defaults.layout.appearance);
|
|
408
670
|
changed = true;
|
|
409
671
|
}
|
|
@@ -415,11 +677,30 @@ class AppPreferencesSurfaceComponent {
|
|
|
415
677
|
this.layout.setWidth(defaults.layout.width);
|
|
416
678
|
changed = true;
|
|
417
679
|
}
|
|
680
|
+
if (!this.isLayoutTypeLocked() && this.layoutType() !== defaults.layout.type) {
|
|
681
|
+
this.selectLayoutType(defaults.layout.type);
|
|
682
|
+
changed = true;
|
|
683
|
+
}
|
|
418
684
|
const navigation = this.navigationState();
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
685
|
+
const nextNavigation = {
|
|
686
|
+
orientation: this.isLocked('nav-orientation')
|
|
687
|
+
? navigation.orientation
|
|
688
|
+
: defaults.navigation.orientation,
|
|
689
|
+
type: this.isLocked('nav-type') ? navigation.type : defaults.navigation.type,
|
|
690
|
+
position: this.isLocked('nav-position') ? navigation.position : defaults.navigation.position,
|
|
691
|
+
collapsed: this.isLocked('nav-type-mode')
|
|
692
|
+
? navigation.collapsed
|
|
693
|
+
: defaults.navigation.collapsed,
|
|
694
|
+
dockbarMode: this.isLocked('nav-type-mode')
|
|
695
|
+
? navigation.dockbarMode
|
|
696
|
+
: defaults.navigation.dockbarMode,
|
|
697
|
+
};
|
|
698
|
+
if (navigation.orientation !== nextNavigation.orientation ||
|
|
699
|
+
navigation.type !== nextNavigation.type ||
|
|
700
|
+
navigation.position !== nextNavigation.position ||
|
|
701
|
+
navigation.collapsed !== nextNavigation.collapsed ||
|
|
702
|
+
navigation.dockbarMode !== nextNavigation.dockbarMode) {
|
|
703
|
+
this.navigation.update(PRIMARY_NAVIGATION_ID$1, nextNavigation);
|
|
423
704
|
changed = true;
|
|
424
705
|
}
|
|
425
706
|
this.announce(changed ? 'Preferensi dikembalikan ke default.' : 'Preferensi sudah menggunakan default.');
|
|
@@ -428,8 +709,14 @@ class AppPreferencesSurfaceComponent {
|
|
|
428
709
|
this.announcement.set('');
|
|
429
710
|
queueMicrotask(() => this.announcement.set(message));
|
|
430
711
|
}
|
|
712
|
+
isLocked(key) {
|
|
713
|
+
return isThemeStyleSettingLocked(this.style(), key);
|
|
714
|
+
}
|
|
715
|
+
isLayoutTypeLocked() {
|
|
716
|
+
return this.isLocked('layout-type') || this.isLocked('nav-orientation');
|
|
717
|
+
}
|
|
431
718
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AppPreferencesSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
432
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", 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-style\"\n title=\"Gaya tema\"\n [activeLabel]=\"styleOptions.find((option) => option.value === style())?.label ?? style()\"\n [options]=\"styleOptions\"\n [selected]=\"style()\"\n (optionSelected)=\"selectStyle($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 (optionSelected)=\"selectMode($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 (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 (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-appearance\"\n title=\"Bingkai\"\n [activeLabel]=\"\n appearanceOptions.find((option) => option.value === appearance())?.label ?? appearance()\n \"\n [options]=\"appearanceOptions\"\n [selected]=\"appearance()\"\n (optionSelected)=\"selectAppearance($event)\"\n />\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 (optionSelected)=\"selectSurface($event)\"\n />\n <
|
|
719
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", 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-style\"\n title=\"Gaya tema\"\n [activeLabel]=\"styleOptions.find((option) => option.value === style())?.label ?? style()\"\n [options]=\"styleOptions\"\n [selected]=\"style()\"\n (optionSelected)=\"selectStyle($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 (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 (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-appearance\"\n title=\"Bingkai\"\n [activeLabel]=\"\n appearanceOptions.find((option) => option.value === appearance())?.label ?? appearance()\n \"\n [options]=\"appearanceOptions\"\n [selected]=\"appearance()\"\n [locked]=\"isLocked('layout-appearance')\"\n (optionSelected)=\"selectAppearance($event)\"\n />\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"] }] });
|
|
433
720
|
}
|
|
434
721
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AppPreferencesSurfaceComponent, decorators: [{
|
|
435
722
|
type: Component,
|
|
@@ -443,8 +730,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
443
730
|
PageHeaderComponent,
|
|
444
731
|
], host: {
|
|
445
732
|
class: 'block h-full min-h-0 w-full',
|
|
446
|
-
}, 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-style\"\n title=\"Gaya tema\"\n [activeLabel]=\"styleOptions.find((option) => option.value === style())?.label ?? style()\"\n [options]=\"styleOptions\"\n [selected]=\"style()\"\n (optionSelected)=\"selectStyle($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 (optionSelected)=\"selectMode($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 (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 (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-appearance\"\n title=\"Bingkai\"\n [activeLabel]=\"\n appearanceOptions.find((option) => option.value === appearance())?.label ?? appearance()\n \"\n [options]=\"appearanceOptions\"\n [selected]=\"appearance()\"\n (optionSelected)=\"selectAppearance($event)\"\n />\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 (optionSelected)=\"selectSurface($event)\"\n />\n <
|
|
733
|
+
}, 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-style\"\n title=\"Gaya tema\"\n [activeLabel]=\"styleOptions.find((option) => option.value === style())?.label ?? style()\"\n [options]=\"styleOptions\"\n [selected]=\"style()\"\n (optionSelected)=\"selectStyle($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 (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 (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-appearance\"\n title=\"Bingkai\"\n [activeLabel]=\"\n appearanceOptions.find((option) => option.value === appearance())?.label ?? appearance()\n \"\n [options]=\"appearanceOptions\"\n [selected]=\"appearance()\"\n [locked]=\"isLocked('layout-appearance')\"\n (optionSelected)=\"selectAppearance($event)\"\n />\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" }]
|
|
447
734
|
}], ctorParameters: () => [], propDecorators: { closeRequested: [{ type: i0.Output, args: ["closeRequested"] }] } });
|
|
735
|
+
function isNavigationTypeForOrientation(value, orientation) {
|
|
736
|
+
return orientation === 'vertical'
|
|
737
|
+
? VERTICAL_NAVIGATION_TYPES.includes(value)
|
|
738
|
+
: HORIZONTAL_NAVIGATION_TYPES.includes(value);
|
|
739
|
+
}
|
|
740
|
+
function isNavigationPositionForOrientation(value, orientation) {
|
|
741
|
+
return orientation === 'vertical'
|
|
742
|
+
? value === 'left' || value === 'right'
|
|
743
|
+
: value === 'top' || value === 'bottom';
|
|
744
|
+
}
|
|
448
745
|
|
|
449
746
|
const PRIMARY_NAVIGATION_ID = 'main';
|
|
450
747
|
const NARROW_VIEWPORT_QUERY = '(max-width: 767.98px)';
|
|
@@ -516,8 +813,8 @@ class AppPreferencesComponent {
|
|
|
516
813
|
[showCloseButton]="false"
|
|
517
814
|
[restoreFocus]="false"
|
|
518
815
|
aria-labelledby="app-preferences-title"
|
|
519
|
-
class="
|
|
520
|
-
(
|
|
816
|
+
class="w-[min(19rem,calc(100dvw-2rem))]! max-w-none! gap-0! p-0!"
|
|
817
|
+
(openedChange)="onSheetOpenChange($event)"
|
|
521
818
|
>
|
|
522
819
|
<app-preferences-surface
|
|
523
820
|
id="app-preferences-panel"
|
|
@@ -553,8 +850,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
553
850
|
[showCloseButton]="false"
|
|
554
851
|
[restoreFocus]="false"
|
|
555
852
|
aria-labelledby="app-preferences-title"
|
|
556
|
-
class="
|
|
557
|
-
(
|
|
853
|
+
class="w-[min(19rem,calc(100dvw-2rem))]! max-w-none! gap-0! p-0!"
|
|
854
|
+
(openedChange)="onSheetOpenChange($event)"
|
|
558
855
|
>
|
|
559
856
|
<app-preferences-surface
|
|
560
857
|
id="app-preferences-panel"
|