@ojiepermana/angular 22.2.2 → 22.2.4
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/ojiepermana-angular-component-drawer.mjs +2 -1
- package/fesm2022/{ojiepermana-angular-navigation-navigation-dockbar-menu.component-CGfu2V6f.mjs → ojiepermana-angular-navigation-navigation-dockbar-menu.component-DC8rfxS5.mjs} +32 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-zBCXDa4c.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-meQb_EWZ.mjs} +1 -1
- package/fesm2022/{ojiepermana-angular-navigation-navigation-flyout-menu.component-DYkYIIHd.mjs → ojiepermana-angular-navigation-navigation-flyout-menu.component-DRdw2G-c.mjs} +2 -2
- package/fesm2022/{ojiepermana-angular-navigation-navigation-horizontal.component-LNTertHr.mjs → ojiepermana-angular-navigation-navigation-horizontal.component-Bx1NcrWO.mjs} +2 -2
- package/fesm2022/{ojiepermana-angular-navigation-navigation-item.component-DiGOcizS.mjs → ojiepermana-angular-navigation-navigation-item.component-ERZNpmTZ.mjs} +2 -2
- package/fesm2022/{ojiepermana-angular-navigation-navigation-list.component-DB22Gl-5.mjs → ojiepermana-angular-navigation-navigation-list.component-D-oOKwHg.mjs} +4 -3
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +3 -2
- package/fesm2022/ojiepermana-angular-navigation.mjs +13 -15
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +152 -109
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +168 -77
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +3 -0
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +3 -0
- package/package.json +2 -2
- package/theme/component/settings/README.md +19 -0
- package/theme/layout/README.md +67 -0
- package/types/ojiepermana-angular-component-icon.d.ts +1 -15
- package/types/ojiepermana-angular-component-select.d.ts +0 -2
- package/types/ojiepermana-angular-navigation.d.ts +1 -3
- package/types/ojiepermana-angular-theme-component-settings.d.ts +18 -1
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +108 -11
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, Service, booleanAttribute, computed, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
2
|
+
import { Component, InjectionToken, Service, booleanAttribute, computed, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
3
3
|
import { NavigationAsideFooterDirective, NavigationContainerComponent, NavigationDockbarComponent, NavigationFlyoutComponent, NavigationFooterActionComponent, NavigationFooterComponent, NavigationFooterInitialComponent, NavigationFooterTitleComponent, NavigationHeaderComponent, NavigationHeaderInitialComponent, NavigationHeaderTitleComponent, NavigationMinidockComponent, NavigationNavbarComponent, NavigationSidebarComponent } from "@ojiepermana/angular/navigation";
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from "@ojiepermana/angular/component/utils/core";
|
|
5
|
+
import { LucideDoorOpen, LucideGrip, LucideLogOut } from "@lucide/angular";
|
|
5
6
|
import { IconComponent, provideIcons } from "@ojiepermana/angular/component/icon";
|
|
6
7
|
import { ThemeSettingsComponent } from "@ojiepermana/angular/theme/component/settings";
|
|
7
8
|
import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
|
|
8
|
-
import { cn } from "@ojiepermana/angular/component/utils/core";
|
|
9
9
|
import { LayoutComponent, LayoutContentComponent, LayoutEmptyComponent, LayoutFluidComponent, LayoutHorizontalComponent, LayoutNavigationComponent, LayoutVerticalComponent } from "@ojiepermana/angular/theme/layout";
|
|
10
10
|
import { LAYOUT_DEFAULT_APPEARANCE, LAYOUT_DEFAULT_SURFACE, LAYOUT_DEFAULT_TYPE, LAYOUT_DEFAULT_WIDTH } from "@ojiepermana/angular/theme/layout/types";
|
|
11
11
|
import { toMinidockItems } from "@ojiepermana/angular/navigation/types";
|
|
@@ -44,12 +44,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
44
44
|
type: LayoutIdentityService,
|
|
45
45
|
decorators: [{ type: Service }]
|
|
46
46
|
});
|
|
47
|
+
const LAYOUT_USER_OPTIONS = new InjectionToken("LAYOUT_USER_OPTIONS");
|
|
48
|
+
function provideLayoutUserOptions(options) {
|
|
49
|
+
return [{
|
|
50
|
+
provide: LAYOUT_USER_OPTIONS,
|
|
51
|
+
useValue: options
|
|
52
|
+
}];
|
|
53
|
+
}
|
|
47
54
|
var LayoutBrand = class LayoutBrand {
|
|
48
55
|
brand = input.required(...ngDevMode ? [{ debugName: "brand" }] : /* istanbul ignore next */ []);
|
|
49
56
|
compact = input(false, {
|
|
50
57
|
...ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {},
|
|
51
58
|
transform: booleanAttribute
|
|
52
59
|
});
|
|
60
|
+
wordmarkClasses = computed(() => cn("block truncate font-semibold tracking-tight text-foreground", this.compact() ? "text-xs leading-none" : "nav-text in-data-[collapsed=true]:text-xs in-data-[collapsed=true]:leading-none"), ...ngDevMode ? [{ debugName: "wordmarkClasses" }] : /* istanbul ignore next */ []);
|
|
61
|
+
taglineClasses = computed(() => cn("block truncate text-muted-foreground", this.compact() ? "text-2xs leading-none" : "nav-subtitle in-data-[collapsed=true]:text-2xs in-data-[collapsed=true]:leading-none"), ...ngDevMode ? [{ debugName: "taglineClasses" }] : /* istanbul ignore next */ []);
|
|
53
62
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
54
63
|
minVersion: "12.0.0",
|
|
55
64
|
version: "22.2.3",
|
|
@@ -83,7 +92,22 @@ var LayoutBrand = class LayoutBrand {
|
|
|
83
92
|
host: { classAttribute: "contents" },
|
|
84
93
|
ngImport: i0,
|
|
85
94
|
template: `
|
|
86
|
-
|
|
95
|
+
@if (brand().wordmark; as wordmark) {
|
|
96
|
+
<span
|
|
97
|
+
data-layout-brand-mark
|
|
98
|
+
role="img"
|
|
99
|
+
[attr.aria-label]="brand().name"
|
|
100
|
+
[attr.data-compact]="compact()"
|
|
101
|
+
class="inline-flex min-w-0 max-w-full flex-col justify-center"
|
|
102
|
+
>
|
|
103
|
+
<span data-layout-brand-wordmark [class]="wordmarkClasses()">{{ wordmark }}</span>
|
|
104
|
+
@if (brand().tagline; as tagline) {
|
|
105
|
+
<span data-layout-brand-tagline [class]="taglineClasses()">{{ tagline }}</span>
|
|
106
|
+
}
|
|
107
|
+
</span>
|
|
108
|
+
} @else {
|
|
109
|
+
<NavigationHeaderInitial [name]="brand().name" [icon]="brand().icon" [compact]="compact()" />
|
|
110
|
+
}
|
|
87
111
|
@if (!compact()) {
|
|
88
112
|
<NavigationHeaderTitle [title]="brand().title" [subtitle]="brand().subtitle" />
|
|
89
113
|
}
|
|
@@ -125,7 +149,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
125
149
|
imports: [NavigationHeaderInitialComponent, NavigationHeaderTitleComponent],
|
|
126
150
|
host: { class: "contents" },
|
|
127
151
|
template: `
|
|
128
|
-
|
|
152
|
+
@if (brand().wordmark; as wordmark) {
|
|
153
|
+
<span
|
|
154
|
+
data-layout-brand-mark
|
|
155
|
+
role="img"
|
|
156
|
+
[attr.aria-label]="brand().name"
|
|
157
|
+
[attr.data-compact]="compact()"
|
|
158
|
+
class="inline-flex min-w-0 max-w-full flex-col justify-center"
|
|
159
|
+
>
|
|
160
|
+
<span data-layout-brand-wordmark [class]="wordmarkClasses()">{{ wordmark }}</span>
|
|
161
|
+
@if (brand().tagline; as tagline) {
|
|
162
|
+
<span data-layout-brand-tagline [class]="taglineClasses()">{{ tagline }}</span>
|
|
163
|
+
}
|
|
164
|
+
</span>
|
|
165
|
+
} @else {
|
|
166
|
+
<NavigationHeaderInitial [name]="brand().name" [icon]="brand().icon" [compact]="compact()" />
|
|
167
|
+
}
|
|
129
168
|
@if (!compact()) {
|
|
130
169
|
<NavigationHeaderTitle [title]="brand().title" [subtitle]="brand().subtitle" />
|
|
131
170
|
}
|
|
@@ -151,15 +190,39 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
151
190
|
}]
|
|
152
191
|
}
|
|
153
192
|
});
|
|
193
|
+
function optionalBooleanAttribute(value) {
|
|
194
|
+
return value === null || value === void 0 ? null : booleanAttribute(value);
|
|
195
|
+
}
|
|
154
196
|
var LayoutUser = class LayoutUser {
|
|
197
|
+
options = inject(LAYOUT_USER_OPTIONS, { optional: true });
|
|
155
198
|
user = input.required(...ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []);
|
|
156
199
|
detailed = input(false, {
|
|
157
200
|
...ngDevMode ? { debugName: "detailed" } : /* istanbul ignore next */ {},
|
|
158
201
|
transform: booleanAttribute
|
|
159
202
|
});
|
|
160
|
-
|
|
161
|
-
|
|
203
|
+
showInitial = input(true, {
|
|
204
|
+
...ngDevMode ? { debugName: "showInitial" } : /* istanbul ignore next */ {},
|
|
205
|
+
alias: "show-initial",
|
|
206
|
+
transform: booleanAttribute
|
|
207
|
+
});
|
|
208
|
+
showEmail = input(null, {
|
|
209
|
+
...ngDevMode ? { debugName: "showEmail" } : /* istanbul ignore next */ {},
|
|
210
|
+
alias: "show-email",
|
|
211
|
+
transform: optionalBooleanAttribute
|
|
212
|
+
});
|
|
213
|
+
showThemeSettings = input(null, {
|
|
214
|
+
...ngDevMode ? { debugName: "showThemeSettings" } : /* istanbul ignore next */ {},
|
|
215
|
+
alias: "show-theme-settings",
|
|
216
|
+
transform: optionalBooleanAttribute
|
|
217
|
+
});
|
|
218
|
+
logoutLabel = input(null, ...ngDevMode ? [{ debugName: "logoutLabel" }] : /* istanbul ignore next */ []);
|
|
219
|
+
logoutIcon = input(null, ...ngDevMode ? [{ debugName: "logoutIcon" }] : /* istanbul ignore next */ []);
|
|
162
220
|
logout = output();
|
|
221
|
+
showsIdentity = computed(() => this.detailed() || this.options?.detailed === true, ...ngDevMode ? [{ debugName: "showsIdentity" }] : /* istanbul ignore next */ []);
|
|
222
|
+
showsEmail = computed(() => this.showEmail() ?? this.options?.showEmail ?? true, ...ngDevMode ? [{ debugName: "showsEmail" }] : /* istanbul ignore next */ []);
|
|
223
|
+
showsThemeSettings = computed(() => this.showThemeSettings() ?? this.options?.showThemeSettings ?? true, ...ngDevMode ? [{ debugName: "showsThemeSettings" }] : /* istanbul ignore next */ []);
|
|
224
|
+
resolvedLogoutLabel = computed(() => this.logoutLabel() ?? this.options?.logoutLabel ?? "Logout", ...ngDevMode ? [{ debugName: "resolvedLogoutLabel" }] : /* istanbul ignore next */ []);
|
|
225
|
+
resolvedLogoutIcon = computed(() => this.logoutIcon() ?? this.options?.logoutIcon ?? "log-out", ...ngDevMode ? [{ debugName: "resolvedLogoutIcon" }] : /* istanbul ignore next */ []);
|
|
163
226
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
164
227
|
minVersion: "12.0.0",
|
|
165
228
|
version: "22.2.3",
|
|
@@ -189,6 +252,27 @@ var LayoutUser = class LayoutUser {
|
|
|
189
252
|
isRequired: false,
|
|
190
253
|
transformFunction: null
|
|
191
254
|
},
|
|
255
|
+
showInitial: {
|
|
256
|
+
classPropertyName: "showInitial",
|
|
257
|
+
publicName: "show-initial",
|
|
258
|
+
isSignal: true,
|
|
259
|
+
isRequired: false,
|
|
260
|
+
transformFunction: null
|
|
261
|
+
},
|
|
262
|
+
showEmail: {
|
|
263
|
+
classPropertyName: "showEmail",
|
|
264
|
+
publicName: "show-email",
|
|
265
|
+
isSignal: true,
|
|
266
|
+
isRequired: false,
|
|
267
|
+
transformFunction: null
|
|
268
|
+
},
|
|
269
|
+
showThemeSettings: {
|
|
270
|
+
classPropertyName: "showThemeSettings",
|
|
271
|
+
publicName: "show-theme-settings",
|
|
272
|
+
isSignal: true,
|
|
273
|
+
isRequired: false,
|
|
274
|
+
transformFunction: null
|
|
275
|
+
},
|
|
192
276
|
logoutLabel: {
|
|
193
277
|
classPropertyName: "logoutLabel",
|
|
194
278
|
publicName: "logoutLabel",
|
|
@@ -206,25 +290,33 @@ var LayoutUser = class LayoutUser {
|
|
|
206
290
|
},
|
|
207
291
|
outputs: { logout: "logout" },
|
|
208
292
|
host: { classAttribute: "contents" },
|
|
209
|
-
providers: [provideIcons(LucideLogOut)],
|
|
293
|
+
providers: [provideIcons(LucideLogOut, LucideDoorOpen)],
|
|
210
294
|
ngImport: i0,
|
|
211
295
|
template: `
|
|
212
|
-
@if (
|
|
213
|
-
|
|
214
|
-
|
|
296
|
+
@if (showsIdentity()) {
|
|
297
|
+
@if (showInitial()) {
|
|
298
|
+
<NavigationFooterInitial [name]="user().name" />
|
|
299
|
+
}
|
|
300
|
+
<NavigationFooterTitle
|
|
301
|
+
class="min-w-0 max-w-64 flex-1"
|
|
302
|
+
[title]="user().name"
|
|
303
|
+
[subtitle]="showsEmail() ? user().email : null"
|
|
304
|
+
/>
|
|
215
305
|
}
|
|
216
306
|
|
|
217
307
|
<NavigationFooterAction class="ml-auto">
|
|
218
308
|
<button
|
|
219
309
|
type="button"
|
|
220
|
-
[attr.aria-label]="
|
|
221
|
-
[attr.title]="
|
|
222
|
-
class="inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
310
|
+
[attr.aria-label]="resolvedLogoutLabel()"
|
|
311
|
+
[attr.title]="resolvedLogoutLabel()"
|
|
312
|
+
class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
223
313
|
(click)="logout.emit()"
|
|
224
314
|
>
|
|
225
|
-
<Icon [name]="
|
|
315
|
+
<Icon [name]="resolvedLogoutIcon()" [size]="18" />
|
|
226
316
|
</button>
|
|
227
|
-
|
|
317
|
+
@if (showsThemeSettings()) {
|
|
318
|
+
<ThemeSettings [trigger-icon-only]="true" class="size-8! min-h-8!" />
|
|
319
|
+
}
|
|
228
320
|
</NavigationFooterAction>
|
|
229
321
|
`,
|
|
230
322
|
isInline: true,
|
|
@@ -247,6 +339,7 @@ var LayoutUser = class LayoutUser {
|
|
|
247
339
|
selector: "ThemeSettings",
|
|
248
340
|
inputs: [
|
|
249
341
|
"open",
|
|
342
|
+
"inline",
|
|
250
343
|
"trigger",
|
|
251
344
|
"triggerLabel",
|
|
252
345
|
"trigger-icon-only",
|
|
@@ -296,7 +389,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
296
389
|
type: Component,
|
|
297
390
|
args: [{
|
|
298
391
|
selector: "LayoutUser",
|
|
299
|
-
providers: [provideIcons(LucideLogOut)],
|
|
392
|
+
providers: [provideIcons(LucideLogOut, LucideDoorOpen)],
|
|
300
393
|
imports: [
|
|
301
394
|
IconComponent,
|
|
302
395
|
ThemeSettingsComponent,
|
|
@@ -306,22 +399,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
306
399
|
],
|
|
307
400
|
host: { class: "contents" },
|
|
308
401
|
template: `
|
|
309
|
-
@if (
|
|
310
|
-
|
|
311
|
-
|
|
402
|
+
@if (showsIdentity()) {
|
|
403
|
+
@if (showInitial()) {
|
|
404
|
+
<NavigationFooterInitial [name]="user().name" />
|
|
405
|
+
}
|
|
406
|
+
<NavigationFooterTitle
|
|
407
|
+
class="min-w-0 max-w-64 flex-1"
|
|
408
|
+
[title]="user().name"
|
|
409
|
+
[subtitle]="showsEmail() ? user().email : null"
|
|
410
|
+
/>
|
|
312
411
|
}
|
|
313
412
|
|
|
314
413
|
<NavigationFooterAction class="ml-auto">
|
|
315
414
|
<button
|
|
316
415
|
type="button"
|
|
317
|
-
[attr.aria-label]="
|
|
318
|
-
[attr.title]="
|
|
319
|
-
class="inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
416
|
+
[attr.aria-label]="resolvedLogoutLabel()"
|
|
417
|
+
[attr.title]="resolvedLogoutLabel()"
|
|
418
|
+
class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
320
419
|
(click)="logout.emit()"
|
|
321
420
|
>
|
|
322
|
-
<Icon [name]="
|
|
421
|
+
<Icon [name]="resolvedLogoutIcon()" [size]="18" />
|
|
323
422
|
</button>
|
|
324
|
-
|
|
423
|
+
@if (showsThemeSettings()) {
|
|
424
|
+
<ThemeSettings [trigger-icon-only]="true" class="size-8! min-h-8!" />
|
|
425
|
+
}
|
|
325
426
|
</NavigationFooterAction>
|
|
326
427
|
`
|
|
327
428
|
}]
|
|
@@ -343,6 +444,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
343
444
|
required: false
|
|
344
445
|
}]
|
|
345
446
|
}],
|
|
447
|
+
showInitial: [{
|
|
448
|
+
type: i0.Input,
|
|
449
|
+
args: [{
|
|
450
|
+
isSignal: true,
|
|
451
|
+
alias: "show-initial",
|
|
452
|
+
required: false
|
|
453
|
+
}]
|
|
454
|
+
}],
|
|
455
|
+
showEmail: [{
|
|
456
|
+
type: i0.Input,
|
|
457
|
+
args: [{
|
|
458
|
+
isSignal: true,
|
|
459
|
+
alias: "show-email",
|
|
460
|
+
required: false
|
|
461
|
+
}]
|
|
462
|
+
}],
|
|
463
|
+
showThemeSettings: [{
|
|
464
|
+
type: i0.Input,
|
|
465
|
+
args: [{
|
|
466
|
+
isSignal: true,
|
|
467
|
+
alias: "show-theme-settings",
|
|
468
|
+
required: false
|
|
469
|
+
}]
|
|
470
|
+
}],
|
|
346
471
|
logoutLabel: [{
|
|
347
472
|
type: i0.Input,
|
|
348
473
|
args: [{
|
|
@@ -473,6 +598,9 @@ var LayoutNavSidebar = class LayoutNavSidebar {
|
|
|
473
598
|
inputs: [
|
|
474
599
|
"user",
|
|
475
600
|
"detailed",
|
|
601
|
+
"show-initial",
|
|
602
|
+
"show-email",
|
|
603
|
+
"show-theme-settings",
|
|
476
604
|
"logoutLabel",
|
|
477
605
|
"logoutIcon"
|
|
478
606
|
],
|
|
@@ -634,7 +762,6 @@ var LayoutNavDockbar = class LayoutNavDockbar {
|
|
|
634
762
|
},
|
|
635
763
|
outputs: { logout: "logout" },
|
|
636
764
|
host: { classAttribute: "contents" },
|
|
637
|
-
providers: [provideIcons(LucideLogOut)],
|
|
638
765
|
ngImport: i0,
|
|
639
766
|
template: `
|
|
640
767
|
<NavigationDockbar
|
|
@@ -653,41 +780,12 @@ var LayoutNavDockbar = class LayoutNavDockbar {
|
|
|
653
780
|
</NavigationFooter>
|
|
654
781
|
|
|
655
782
|
<ng-template NavigationAsideFooter>
|
|
656
|
-
<
|
|
657
|
-
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
658
|
-
user().name
|
|
659
|
-
}}</span>
|
|
660
|
-
<span class="block truncate text-xs leading-tight text-muted-foreground">{{
|
|
661
|
-
user().email
|
|
662
|
-
}}</span>
|
|
663
|
-
</div>
|
|
664
|
-
|
|
665
|
-
<button
|
|
666
|
-
type="button"
|
|
667
|
-
aria-label="Logout"
|
|
668
|
-
title="Logout"
|
|
669
|
-
class="ml-auto inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
670
|
-
(click)="logout.emit()"
|
|
671
|
-
>
|
|
672
|
-
<Icon name="log-out" [size]="18" />
|
|
673
|
-
</button>
|
|
783
|
+
<LayoutUser [user]="user()" detailed [show-initial]="false" (logout)="logout.emit()" />
|
|
674
784
|
</ng-template>
|
|
675
785
|
</NavigationDockbar>
|
|
676
786
|
`,
|
|
677
787
|
isInline: true,
|
|
678
788
|
dependencies: [
|
|
679
|
-
{
|
|
680
|
-
kind: "component",
|
|
681
|
-
type: IconComponent,
|
|
682
|
-
selector: "Icon",
|
|
683
|
-
inputs: [
|
|
684
|
-
"name",
|
|
685
|
-
"class",
|
|
686
|
-
"size",
|
|
687
|
-
"strokeWidth",
|
|
688
|
-
"label"
|
|
689
|
-
]
|
|
690
|
-
},
|
|
691
789
|
{
|
|
692
790
|
kind: "directive",
|
|
693
791
|
type: NavigationAsideFooterDirective,
|
|
@@ -730,6 +828,9 @@ var LayoutNavDockbar = class LayoutNavDockbar {
|
|
|
730
828
|
inputs: [
|
|
731
829
|
"user",
|
|
732
830
|
"detailed",
|
|
831
|
+
"show-initial",
|
|
832
|
+
"show-email",
|
|
833
|
+
"show-theme-settings",
|
|
733
834
|
"logoutLabel",
|
|
734
835
|
"logoutIcon"
|
|
735
836
|
],
|
|
@@ -747,9 +848,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
747
848
|
type: Component,
|
|
748
849
|
args: [{
|
|
749
850
|
selector: "LayoutNavDockbar",
|
|
750
|
-
providers: [provideIcons(LucideLogOut)],
|
|
751
851
|
imports: [
|
|
752
|
-
IconComponent,
|
|
753
852
|
NavigationAsideFooterDirective,
|
|
754
853
|
NavigationDockbarComponent,
|
|
755
854
|
NavigationHeaderComponent,
|
|
@@ -775,24 +874,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
775
874
|
</NavigationFooter>
|
|
776
875
|
|
|
777
876
|
<ng-template NavigationAsideFooter>
|
|
778
|
-
<
|
|
779
|
-
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
780
|
-
user().name
|
|
781
|
-
}}</span>
|
|
782
|
-
<span class="block truncate text-xs leading-tight text-muted-foreground">{{
|
|
783
|
-
user().email
|
|
784
|
-
}}</span>
|
|
785
|
-
</div>
|
|
786
|
-
|
|
787
|
-
<button
|
|
788
|
-
type="button"
|
|
789
|
-
aria-label="Logout"
|
|
790
|
-
title="Logout"
|
|
791
|
-
class="ml-auto inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
792
|
-
(click)="logout.emit()"
|
|
793
|
-
>
|
|
794
|
-
<Icon name="log-out" [size]="18" />
|
|
795
|
-
</button>
|
|
877
|
+
<LayoutUser [user]="user()" detailed [show-initial]="false" (logout)="logout.emit()" />
|
|
796
878
|
</ng-template>
|
|
797
879
|
</NavigationDockbar>
|
|
798
880
|
`
|
|
@@ -943,6 +1025,9 @@ var LayoutNavMinidock = class LayoutNavMinidock {
|
|
|
943
1025
|
inputs: [
|
|
944
1026
|
"user",
|
|
945
1027
|
"detailed",
|
|
1028
|
+
"show-initial",
|
|
1029
|
+
"show-email",
|
|
1030
|
+
"show-theme-settings",
|
|
946
1031
|
"logoutLabel",
|
|
947
1032
|
"logoutIcon"
|
|
948
1033
|
],
|
|
@@ -1103,6 +1188,9 @@ var LayoutNavNavbar = class LayoutNavNavbar {
|
|
|
1103
1188
|
inputs: [
|
|
1104
1189
|
"user",
|
|
1105
1190
|
"detailed",
|
|
1191
|
+
"show-initial",
|
|
1192
|
+
"show-email",
|
|
1193
|
+
"show-theme-settings",
|
|
1106
1194
|
"logoutLabel",
|
|
1107
1195
|
"logoutIcon"
|
|
1108
1196
|
],
|
|
@@ -1278,6 +1366,9 @@ var LayoutNavFlyout = class LayoutNavFlyout {
|
|
|
1278
1366
|
inputs: [
|
|
1279
1367
|
"user",
|
|
1280
1368
|
"detailed",
|
|
1369
|
+
"show-initial",
|
|
1370
|
+
"show-email",
|
|
1371
|
+
"show-theme-settings",
|
|
1281
1372
|
"logoutLabel",
|
|
1282
1373
|
"logoutIcon"
|
|
1283
1374
|
],
|
|
@@ -2428,4 +2519,4 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
2428
2519
|
}
|
|
2429
2520
|
})
|
|
2430
2521
|
});
|
|
2431
|
-
export { LAYOUT_DESKTOP_NAVIGATION_DATA_ID, LayoutBrand, LayoutIdentityService, LayoutNavDockbar, LayoutNavFlyout, LayoutNavMinidock, LayoutNavMinimal, LayoutNavNavbar, LayoutNavSidebar, LayoutUser, LayoutWrapperDefault };
|
|
2522
|
+
export { LAYOUT_DESKTOP_NAVIGATION_DATA_ID, LAYOUT_USER_OPTIONS, LayoutBrand, LayoutIdentityService, LayoutNavDockbar, LayoutNavFlyout, LayoutNavMinidock, LayoutNavMinimal, LayoutNavNavbar, LayoutNavSidebar, LayoutUser, LayoutWrapperDefault, provideLayoutUserOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ojiepermana/angular",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.4",
|
|
4
4
|
"description": "Accessible, tree-shakable Angular 22 design system from ojiepermana: UI components, charts, navigation shells, theme tokens, and an OpenAPI SDK generator.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -503,5 +503,5 @@
|
|
|
503
503
|
"module": "fesm2022/ojiepermana-angular.mjs",
|
|
504
504
|
"typings": "types/ojiepermana-angular.d.ts",
|
|
505
505
|
"type": "module",
|
|
506
|
-
"gitHead": "
|
|
506
|
+
"gitHead": "9bf6b28075ea1896efc601f2228d5c9a568354d1"
|
|
507
507
|
}
|
|
@@ -41,6 +41,25 @@ open; Escape, backdrop click, and the close controls dismiss it; focus returns
|
|
|
41
41
|
to the opening trigger. Its header and footer use the navigation topbar height,
|
|
42
42
|
semantic borders, and theme tokens so it sits naturally beside a layout shell.
|
|
43
43
|
|
|
44
|
+
## Inline page
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<ThemeSettings inline />
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`inline` renders the same sections directly in the page: no trigger, no drawer,
|
|
51
|
+
no backdrop, and `open` is ignored. It is the right shape for a dedicated
|
|
52
|
+
settings route, while a navigation footer keeps the drawer. Both modes share the
|
|
53
|
+
runtime services and the same `THEME_SETTINGS_ADAPTER` gate, so an inline page
|
|
54
|
+
and an open drawer always show the same values: a swatch chosen on one is
|
|
55
|
+
checked on the other at once. The container carries `data-theme-settings-inline`
|
|
56
|
+
as a styling hook. The default stays `false`, so existing drawers are untouched.
|
|
57
|
+
|
|
58
|
+
Each instance owns its accent and neutral radio groups (a per-application unique
|
|
59
|
+
`name`), so several instances on one document, inline and drawer together, never
|
|
60
|
+
uncheck each other through native radio grouping. The ids are deterministic per
|
|
61
|
+
application injector, so SSR and hydration agree.
|
|
62
|
+
|
|
44
63
|
## Shell
|
|
45
64
|
|
|
46
65
|
Directly below **Theme** sits a **Shell** section with all three shell axes, driven
|
package/theme/layout/README.md
CHANGED
|
@@ -358,6 +358,73 @@ cookie, dan target redirect berbeda tiap aplikasi, jadi efeknya milik consumer.
|
|
|
358
358
|
Consumer yang tidak mengikat `(logout)` tetap merender tanpa error; tombolnya
|
|
359
359
|
sekadar tidak melakukan apa pun.
|
|
360
360
|
|
|
361
|
+
#### Identitas user di footer: `LayoutUser` dan `provideLayoutUserOptions()`
|
|
362
|
+
|
|
363
|
+
Setiap nav type merender footer user lewat satu komponen bersama, `LayoutUser`:
|
|
364
|
+
sidebar (termasuk Sheet mobile), rail dockbar beserta aside-nya, minidock, navbar,
|
|
365
|
+
dan panel flyout. Default yang lama tidak berubah: surface vertical menampilkan
|
|
366
|
+
inisial, nama, dan email; navbar dan flyout hanya tombol logout; di samping logout
|
|
367
|
+
ada shortcut `ThemeSettings`; ikonnya `log-out`.
|
|
368
|
+
|
|
369
|
+
Konfigurasi aplikasi-wide disediakan sekali lewat token, sehingga tampilannya
|
|
370
|
+
konsisten di semua surface tanpa menyentuh input komponen internal:
|
|
371
|
+
|
|
372
|
+
```ts
|
|
373
|
+
import { provideLayoutUserOptions } from '@ojiepermana/angular/theme/layout/wrapper';
|
|
374
|
+
|
|
375
|
+
export const appConfig = {
|
|
376
|
+
providers: [
|
|
377
|
+
provideLayoutUserOptions({
|
|
378
|
+
detailed: true, // inisial + nama juga pada navbar dan flyout
|
|
379
|
+
showEmail: false, // sembunyikan baris email
|
|
380
|
+
showThemeSettings: false, // settings sudah tersedia di halaman tersendiri
|
|
381
|
+
logoutIcon: 'door-open', // 'log-out' dan 'door-open' terdaftar di library
|
|
382
|
+
logoutLabel: 'Keluar',
|
|
383
|
+
}),
|
|
384
|
+
],
|
|
385
|
+
};
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
| Opsi | Type | Default | Deskripsi |
|
|
389
|
+
| ------------------- | --------- | ----------- | --------------------------------------------------------------- |
|
|
390
|
+
| `detailed` | `boolean` | `false` | Tampilkan identitas pada semua surface, termasuk navbar/flyout. |
|
|
391
|
+
| `showEmail` | `boolean` | `true` | Render `user.email` di bawah nama. |
|
|
392
|
+
| `showThemeSettings` | `boolean` | `true` | Render shortcut `ThemeSettings` di samping logout. |
|
|
393
|
+
| `logoutLabel` | `string` | `'Logout'` | Accessible name tombol logout. |
|
|
394
|
+
| `logoutIcon` | `string` | `'log-out'` | Nama ikon Lucide; nama lain didaftarkan lewat `provideIcons()`. |
|
|
395
|
+
|
|
396
|
+
Input pada `<LayoutUser>` sendiri (`detailed`, `show-initial`, `show-email`,
|
|
397
|
+
`show-theme-settings`, `logoutLabel`, `logoutIcon`) selalu menang atas opsi
|
|
398
|
+
tersebut; nilai yang tidak diikat jatuh ke opsi, lalu ke default di atas.
|
|
399
|
+
`show-initial` ada untuk surface yang sudah menampilkan inisial di tempat lain,
|
|
400
|
+
seperti aside dockbar yang menampilkan inisialnya di rail. Nama panjang
|
|
401
|
+
dipotong (`truncate`) pada kolom judul yang `min-w-0 flex-1`, jadi tombol logout
|
|
402
|
+
tidak pernah terdorong atau terpotong.
|
|
403
|
+
|
|
404
|
+
#### Brand: inisial, ikon, atau wordmark
|
|
405
|
+
|
|
406
|
+
`BrandIdentity` menerima `wordmark` dan `tagline` opsional. Dengan `wordmark`,
|
|
407
|
+
`LayoutBrand` merender teks tersebut (plus tagline bila ada) menggantikan blok
|
|
408
|
+
inisial/ikon; tanpa `wordmark`, fallback `NavigationHeaderInitial` tetap dipakai.
|
|
409
|
+
Accessible name selalu `brand.name` (`role="img"`), dan `title`/`subtitle` tetap
|
|
410
|
+
mengikuti aturan `compact` yang sama.
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
const brand: BrandIdentity = {
|
|
414
|
+
name: 'PT Contoh Nusantara',
|
|
415
|
+
icon: null,
|
|
416
|
+
title: 'Contoh Nusantara',
|
|
417
|
+
subtitle: 'Enterprise Operations',
|
|
418
|
+
wordmark: 'CONTOH',
|
|
419
|
+
tagline: 'NUSANTARA SYSTEM',
|
|
420
|
+
};
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Hook styling untuk consumer: `[data-layout-brand-mark]` (dengan `data-compact`
|
|
424
|
+
`"true"`/`"false"`), `[data-layout-brand-wordmark]`, dan
|
|
425
|
+
`[data-layout-brand-tagline]`. Library hanya mengatur tier tipografi dan
|
|
426
|
+
`truncate`; warna, ukuran, dan tata letak milik consumer.
|
|
427
|
+
|
|
361
428
|
Saat viewport kembali ke desktop, Sheet ditutup otomatis. Pemilihan item mobile juga menutup
|
|
362
429
|
Sheet dan mengembalikan fokus melalui primitive Sheet.
|
|
363
430
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LucideIcon, LucideIconData } from "@lucide/angular";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import {
|
|
3
|
+
import { Provider } from "@angular/core";
|
|
4
4
|
export declare class IconComponent {
|
|
5
5
|
private readonly nearest;
|
|
6
6
|
private readonly registry;
|
|
@@ -64,20 +64,6 @@ type IconInput = LucideIcon | LucideIconData;
|
|
|
64
64
|
* bootstrapApplication(App, { providers: [provideIcons(LucideHouse, LucideSettings)] });
|
|
65
65
|
*/
|
|
66
66
|
export declare function provideIcons(...icons: IconInput[]): Provider;
|
|
67
|
-
/** The icons visible from one injector level: own icons merged over every parent level. */
|
|
68
|
-
type IconSet = ReadonlyMap<string, LucideIconData>;
|
|
69
|
-
/**
|
|
70
|
-
* What one `provideIcons()` call contributes at its own injector level. Several
|
|
71
|
-
* calls on the same level add up (multi), so `providers: [provideIcons(a), provideIcons(b)]`
|
|
72
|
-
* keeps both. Internal: not exported from the entry point.
|
|
73
|
-
*/
|
|
74
|
-
declare const UI_ICON_CONTRIBUTIONS: InjectionToken<readonly IconSet[]>;
|
|
75
|
-
/**
|
|
76
|
-
* The merged set visible at one injector level. Every `provideIcons()` call also
|
|
77
|
-
* provides this token with `own + parent`, so a child level never hides an icon
|
|
78
|
-
* registered above it (route, app root). Nearest wins on a name clash. Internal.
|
|
79
|
-
*/
|
|
80
|
-
declare const UI_ICONS: InjectionToken<IconSet>;
|
|
81
67
|
/**
|
|
82
68
|
* Root view of the registered icons. The `<Icon>` component resolves from the set
|
|
83
69
|
* of its nearest injector first, then falls back here, so icons registered with
|
|
@@ -28,8 +28,6 @@ declare abstract class SelectMaterialBridge extends MatSelect {
|
|
|
28
28
|
protected materialConfigureSkipPredicate(predicate: (option: MatOption) => boolean): void;
|
|
29
29
|
protected materialSetActiveItem(option: MatOption | number): void;
|
|
30
30
|
}
|
|
31
|
-
/** Material does not currently expose an option host accessor publicly. */
|
|
32
|
-
declare function materialOptionHost(option: MatOption): HTMLElement;
|
|
33
31
|
/**
|
|
34
32
|
* Custom shadcn-styled select.
|
|
35
33
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NavigationIconDirective, NavigationIconDirective as NavigationIconDirective$1 } from "@ojiepermana/angular/navigation/icon";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import {
|
|
3
|
+
import { Signal, TemplateRef } from "@angular/core";
|
|
4
4
|
import { NAVIGATION_DOCKBAR_FALLBACK_ICON, NavigationActionHandler, NavigationAppearance, NavigationAppearance as NavigationAppearance$1, NavigationBadgeAriaLabel, NavigationBadgeContext, NavigationBadgeContext as NavigationBadgeContext$1, NavigationBadgeCount, NavigationBadgeSource, NavigationBadgeSource as NavigationBadgeSource$1, NavigationBadgeValueSource, NavigationCollapseTree, NavigationCollapseTree as NavigationCollapseTree$1, NavigationDockbarMode, NavigationDockbarMode as NavigationDockbarMode$1, NavigationDockbarRouteConfig, NavigationDockbarRouteContext, NavigationDockbarRouteContext as NavigationDockbarRouteContext$1, NavigationFlyoutIconPosition, NavigationFlyoutIconPosition as NavigationFlyoutIconPosition$1, NavigationFlyoutTriggerVariant, NavigationFlyoutTriggerVariant as NavigationFlyoutTriggerVariant$1, NavigationHorizontalPosition, NavigationHorizontalPosition as NavigationHorizontalPosition$1, NavigationHorizontalType, NavigationIconContext, NavigationIconContext as NavigationIconContext$1, NavigationItem, NavigationItem as NavigationItem$1, NavigationItemBadge, NavigationItemClasses, NavigationItemType, NavigationLink, NavigationNormalizedItem, NavigationNormalizedItem as NavigationNormalizedItem$1, NavigationNormalizedItemType, NavigationOrientation, NavigationOrientation as NavigationOrientation$1, NavigationPosition, NavigationPosition as NavigationPosition$1, NavigationRegisterInput, NavigationResolvedRouteContext, NavigationResolvedRouteContext as NavigationResolvedRouteContext$1, NavigationRouteData, NavigationSelection, NavigationSelection as NavigationSelection$1, NavigationState, NavigationState as NavigationState$1, NavigationType, NavigationType as NavigationType$1, NavigationVerticalPosition, NavigationVerticalPosition as NavigationVerticalPosition$1, NavigationVerticalType, NavigationVisibilityHandler, formatNavigationBadgeCount, normalizeUiNavItems, toMinidockItems } from "@ojiepermana/angular/navigation/types";
|
|
5
5
|
export * from "@ojiepermana/angular/navigation/core";
|
|
6
6
|
/**
|
|
@@ -50,7 +50,6 @@ interface NavigationShellContext {
|
|
|
50
50
|
readonly collapseEnabled: Signal<boolean>;
|
|
51
51
|
toggleCollapsed(): void;
|
|
52
52
|
}
|
|
53
|
-
declare const NAVIGATION_SHELL: InjectionToken<NavigationShellContext>;
|
|
54
53
|
interface NavigationDockbarRouteHeaderState {
|
|
55
54
|
readonly activeEntry: NavigationNormalizedItem$1 | null;
|
|
56
55
|
readonly panelGroup: NavigationNormalizedItem$1 | null;
|
|
@@ -297,7 +296,6 @@ export declare class NavigationHeaderComponent {
|
|
|
297
296
|
*/
|
|
298
297
|
protected readonly showToggle: import("@angular/core").Signal<boolean>;
|
|
299
298
|
protected readonly toggleAriaLabel: import("@angular/core").Signal<"Expand navigation" | "Collapse navigation">;
|
|
300
|
-
protected readonly toggleIconName: import("@angular/core").Signal<"panel-left-open" | "panel-left-close">;
|
|
301
299
|
/**
|
|
302
300
|
* Baris isi header. Saat collapsed/dockbar (vertical) isi (inisial/ikon) dipusatkan di tengah
|
|
303
301
|
* rail agar simetris dengan ikon nav-item di bawahnya (yang juga center di rail); selain itu kiri
|
|
@@ -6,7 +6,14 @@ import { NavigationType } from "@ojiepermana/angular/navigation/types";
|
|
|
6
6
|
import { ShellMode } from "@ojiepermana/angular/theme/shell/types";
|
|
7
7
|
/** Native control styling exposed by the settings trigger. */
|
|
8
8
|
type ThemeSettingsTrigger = 'button' | 'link';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A navigation-aligned, right-side inspector for runtime theme and shell settings.
|
|
11
|
+
*
|
|
12
|
+
* `inline` renders the same sections directly in the page instead: no trigger,
|
|
13
|
+
* no drawer, no backdrop. Both modes read and write the same services and the
|
|
14
|
+
* same adapter, so an inline page and an open drawer stay in sync without any
|
|
15
|
+
* extra wiring.
|
|
16
|
+
*/
|
|
10
17
|
export declare class ThemeSettingsComponent {
|
|
11
18
|
/**
|
|
12
19
|
* Present only when the app provided an adapter. It is a render gate here: the
|
|
@@ -15,6 +22,11 @@ export declare class ThemeSettingsComponent {
|
|
|
15
22
|
*/
|
|
16
23
|
protected readonly settings: import("@ojiepermana/angular/theme/component/settings").ThemeSettingsAdapter | null;
|
|
17
24
|
readonly open: import("@angular/core").ModelSignal<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Render the sections in place, as page content, instead of behind a trigger
|
|
27
|
+
* and drawer. `open` is ignored while inline: there is no overlay to open.
|
|
28
|
+
*/
|
|
29
|
+
readonly inline: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
30
|
readonly trigger: import("@angular/core").InputSignal<ThemeSettingsTrigger>;
|
|
19
31
|
readonly triggerLabel: import("@angular/core").InputSignal<string>;
|
|
20
32
|
readonly triggerIconOnly: import("@angular/core").InputSignal<boolean>;
|
|
@@ -29,6 +41,11 @@ export declare class ThemeSettingsComponent {
|
|
|
29
41
|
"required": false;
|
|
30
42
|
"isSignal": true;
|
|
31
43
|
};
|
|
44
|
+
"inline": {
|
|
45
|
+
"alias": "inline";
|
|
46
|
+
"required": false;
|
|
47
|
+
"isSignal": true;
|
|
48
|
+
};
|
|
32
49
|
"trigger": {
|
|
33
50
|
"alias": "trigger";
|
|
34
51
|
"required": false;
|