@ojiepermana/angular 22.2.4 → 22.2.6
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-navigation-navigation-badge-count.component-D-WgBF6d.mjs +234 -0
- package/fesm2022/{ojiepermana-angular-navigation-navigation-dockbar-menu.component-DC8rfxS5.mjs → ojiepermana-angular-navigation-navigation-dockbar-menu.component-UrcWBqBk.mjs} +25 -38
- package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-meQb_EWZ.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-1WiRlut1.mjs} +44 -20
- package/fesm2022/{ojiepermana-angular-navigation-navigation-flyout-menu.component-DRdw2G-c.mjs → ojiepermana-angular-navigation-navigation-flyout-menu.component-dAVUnvwq.mjs} +23 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-horizontal.component-Bx1NcrWO.mjs → ojiepermana-angular-navigation-navigation-horizontal.component-OD_cAkg8.mjs} +31 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-item.component-ERZNpmTZ.mjs → ojiepermana-angular-navigation-navigation-item.component-6mJbQ94G.mjs} +402 -108
- package/fesm2022/{ojiepermana-angular-navigation-navigation-list.component-D-oOKwHg.mjs → ojiepermana-angular-navigation-navigation-list.component-DefF7_rB.mjs} +20 -1
- package/fesm2022/ojiepermana-angular-navigation.mjs +95 -19
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +48 -2
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +1 -0
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +1 -0
- package/navigation/README.md +148 -3
- package/package.json +2 -2
- package/theme/styles/css/base/components.css +20 -0
- package/theme/styles/css/base/tokens.css +6 -0
- package/types/ojiepermana-angular-navigation-types.d.ts +3 -3
- package/types/ojiepermana-angular-navigation.d.ts +17 -0
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +16 -2
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-4RIokl1C.mjs +0 -129
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i as hasNavigationCountBadge, s as navigationDescendantBadgeSources, t as NavigationBadgeCountComponent } from "./ojiepermana-angular-navigation-navigation-badge-count.component-D-WgBF6d.mjs";
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
import { Component, computed, inject, input, output, signal } from "@angular/core";
|
|
3
4
|
import { ActivatedRoute, Router, RouterLink } from "@angular/router";
|
|
@@ -7,14 +8,177 @@ import { NgTemplateOutlet } from "@angular/common";
|
|
|
7
8
|
import { LucideChevronRight } from "@lucide/angular";
|
|
8
9
|
import { IconComponent, provideIcons } from "@ojiepermana/angular/component/icon";
|
|
9
10
|
import { TooltipDirective } from "@ojiepermana/angular/component/tooltip";
|
|
11
|
+
var NavigationItemBadgeComponent = class NavigationItemBadgeComponent {
|
|
12
|
+
staticClass = input("nav-badge ml-auto inline-flex h-5 shrink-0 items-center self-center rounded-full bg-muted px-2 text-muted-foreground", ...ngDevMode ? [{ debugName: "staticClass" }] : /* istanbul ignore next */ []);
|
|
13
|
+
compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
|
|
14
|
+
countClasses = computed(() => cn(this.compact() && "nav-count-overlay", this.itemBadge()?.classes), ...ngDevMode ? [{ debugName: "countClasses" }] : /* istanbul ignore next */ []);
|
|
15
|
+
itemBadge = input(...ngDevMode ? [void 0, { debugName: "itemBadge" }] : /* istanbul ignore next */ []);
|
|
16
|
+
badgeContext = input({}, ...ngDevMode ? [{ debugName: "badgeContext" }] : /* istanbul ignore next */ []);
|
|
17
|
+
children = input([], ...ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []);
|
|
18
|
+
descendantSources = computed(() => navigationDescendantBadgeSources(this.itemBadge(), this.children(), this.badgeContext()), ...ngDevMode ? [{ debugName: "descendantSources" }] : /* istanbul ignore next */ []);
|
|
19
|
+
source = computed(() => {
|
|
20
|
+
const key = this.itemBadge()?.source;
|
|
21
|
+
return key && Object.hasOwn(this.badgeContext(), key) ? this.badgeContext()[key] : null;
|
|
22
|
+
}, ...ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []);
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
24
|
+
minVersion: "12.0.0",
|
|
25
|
+
version: "22.2.3",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: NavigationItemBadgeComponent,
|
|
28
|
+
deps: [],
|
|
29
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
30
|
+
});
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
32
|
+
minVersion: "17.0.0",
|
|
33
|
+
version: "22.2.3",
|
|
34
|
+
type: NavigationItemBadgeComponent,
|
|
35
|
+
isStandalone: true,
|
|
36
|
+
selector: "NavigationItemBadge",
|
|
37
|
+
inputs: {
|
|
38
|
+
staticClass: {
|
|
39
|
+
classPropertyName: "staticClass",
|
|
40
|
+
publicName: "staticClass",
|
|
41
|
+
isSignal: true,
|
|
42
|
+
isRequired: false,
|
|
43
|
+
transformFunction: null
|
|
44
|
+
},
|
|
45
|
+
compact: {
|
|
46
|
+
classPropertyName: "compact",
|
|
47
|
+
publicName: "compact",
|
|
48
|
+
isSignal: true,
|
|
49
|
+
isRequired: false,
|
|
50
|
+
transformFunction: null
|
|
51
|
+
},
|
|
52
|
+
itemBadge: {
|
|
53
|
+
classPropertyName: "itemBadge",
|
|
54
|
+
publicName: "itemBadge",
|
|
55
|
+
isSignal: true,
|
|
56
|
+
isRequired: false,
|
|
57
|
+
transformFunction: null
|
|
58
|
+
},
|
|
59
|
+
badgeContext: {
|
|
60
|
+
classPropertyName: "badgeContext",
|
|
61
|
+
publicName: "badgeContext",
|
|
62
|
+
isSignal: true,
|
|
63
|
+
isRequired: false,
|
|
64
|
+
transformFunction: null
|
|
65
|
+
},
|
|
66
|
+
children: {
|
|
67
|
+
classPropertyName: "children",
|
|
68
|
+
publicName: "children",
|
|
69
|
+
isSignal: true,
|
|
70
|
+
isRequired: false,
|
|
71
|
+
transformFunction: null
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
host: { classAttribute: "contents" },
|
|
75
|
+
ngImport: i0,
|
|
76
|
+
template: `
|
|
77
|
+
@if (itemBadge()?.source || descendantSources().length) {
|
|
78
|
+
<NavigationBadgeCount
|
|
79
|
+
[badge]="source()"
|
|
80
|
+
[sources]="itemBadge()?.source ? null : descendantSources()"
|
|
81
|
+
[class]="countClasses()"
|
|
82
|
+
/>
|
|
83
|
+
} @else if (!compact() && itemBadge()?.title; as title) {
|
|
84
|
+
<span data-navigation-badge-text="true" [class]="itemBadge()?.classes ?? staticClass()">{{
|
|
85
|
+
title
|
|
86
|
+
}}</span>
|
|
87
|
+
}
|
|
88
|
+
`,
|
|
89
|
+
isInline: true,
|
|
90
|
+
dependencies: [{
|
|
91
|
+
kind: "component",
|
|
92
|
+
type: NavigationBadgeCountComponent,
|
|
93
|
+
selector: "NavigationBadgeCount",
|
|
94
|
+
inputs: [
|
|
95
|
+
"badge",
|
|
96
|
+
"class",
|
|
97
|
+
"sources"
|
|
98
|
+
]
|
|
99
|
+
}]
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
103
|
+
minVersion: "12.0.0",
|
|
104
|
+
version: "22.2.3",
|
|
105
|
+
ngImport: i0,
|
|
106
|
+
type: NavigationItemBadgeComponent,
|
|
107
|
+
decorators: [{
|
|
108
|
+
type: Component,
|
|
109
|
+
args: [{
|
|
110
|
+
selector: "NavigationItemBadge",
|
|
111
|
+
imports: [NavigationBadgeCountComponent],
|
|
112
|
+
host: { class: "contents" },
|
|
113
|
+
template: `
|
|
114
|
+
@if (itemBadge()?.source || descendantSources().length) {
|
|
115
|
+
<NavigationBadgeCount
|
|
116
|
+
[badge]="source()"
|
|
117
|
+
[sources]="itemBadge()?.source ? null : descendantSources()"
|
|
118
|
+
[class]="countClasses()"
|
|
119
|
+
/>
|
|
120
|
+
} @else if (!compact() && itemBadge()?.title; as title) {
|
|
121
|
+
<span data-navigation-badge-text="true" [class]="itemBadge()?.classes ?? staticClass()">{{
|
|
122
|
+
title
|
|
123
|
+
}}</span>
|
|
124
|
+
}
|
|
125
|
+
`
|
|
126
|
+
}]
|
|
127
|
+
}],
|
|
128
|
+
propDecorators: {
|
|
129
|
+
staticClass: [{
|
|
130
|
+
type: i0.Input,
|
|
131
|
+
args: [{
|
|
132
|
+
isSignal: true,
|
|
133
|
+
alias: "staticClass",
|
|
134
|
+
required: false
|
|
135
|
+
}]
|
|
136
|
+
}],
|
|
137
|
+
compact: [{
|
|
138
|
+
type: i0.Input,
|
|
139
|
+
args: [{
|
|
140
|
+
isSignal: true,
|
|
141
|
+
alias: "compact",
|
|
142
|
+
required: false
|
|
143
|
+
}]
|
|
144
|
+
}],
|
|
145
|
+
itemBadge: [{
|
|
146
|
+
type: i0.Input,
|
|
147
|
+
args: [{
|
|
148
|
+
isSignal: true,
|
|
149
|
+
alias: "itemBadge",
|
|
150
|
+
required: false
|
|
151
|
+
}]
|
|
152
|
+
}],
|
|
153
|
+
badgeContext: [{
|
|
154
|
+
type: i0.Input,
|
|
155
|
+
args: [{
|
|
156
|
+
isSignal: true,
|
|
157
|
+
alias: "badgeContext",
|
|
158
|
+
required: false
|
|
159
|
+
}]
|
|
160
|
+
}],
|
|
161
|
+
children: [{
|
|
162
|
+
type: i0.Input,
|
|
163
|
+
args: [{
|
|
164
|
+
isSignal: true,
|
|
165
|
+
alias: "children",
|
|
166
|
+
required: false
|
|
167
|
+
}]
|
|
168
|
+
}]
|
|
169
|
+
}
|
|
170
|
+
});
|
|
10
171
|
var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
172
|
+
hasCountBadge = hasNavigationCountBadge;
|
|
11
173
|
nav = inject(NAVIGATION_ADAPTER);
|
|
174
|
+
badgeContext = input({}, ...ngDevMode ? [{ debugName: "badgeContext" }] : /* istanbul ignore next */ []);
|
|
12
175
|
item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
13
176
|
active = input(false, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
14
177
|
compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
|
|
15
178
|
orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
16
179
|
level = input(0, ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
17
180
|
iconTemplate = input(void 0, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
|
|
181
|
+
hasIconSlot = computed(() => !!this.item().icon || hasNavigationCountBadge(this.item()), ...ngDevMode ? [{ debugName: "hasIconSlot" }] : /* istanbul ignore next */ []);
|
|
18
182
|
iconSlotClasses = computed(() => cn("relative z-10 inline-flex shrink-0 items-center justify-center transition-colors duration-normal", this.compact() && "mx-auto", this.active() ? "text-current" : "text-muted-foreground group-hover/nav:text-current"), ...ngDevMode ? [{ debugName: "iconSlotClasses" }] : /* istanbul ignore next */ []);
|
|
19
183
|
titleClasses = computed(() => cn("block truncate", this.active() && "text-foreground", this.item().classes?.title), ...ngDevMode ? [{ debugName: "titleClasses" }] : /* istanbul ignore next */ []);
|
|
20
184
|
showSubtitle = computed(() => !!this.item().subtitle && !(this.orientation() === "horizontal" && this.level() === 0), ...ngDevMode ? [{ debugName: "showSubtitle" }] : /* istanbul ignore next */ []);
|
|
@@ -41,6 +205,13 @@ var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
|
41
205
|
isStandalone: true,
|
|
42
206
|
selector: "NavigationItemContent",
|
|
43
207
|
inputs: {
|
|
208
|
+
badgeContext: {
|
|
209
|
+
classPropertyName: "badgeContext",
|
|
210
|
+
publicName: "badgeContext",
|
|
211
|
+
isSignal: true,
|
|
212
|
+
isRequired: false,
|
|
213
|
+
transformFunction: null
|
|
214
|
+
},
|
|
44
215
|
item: {
|
|
45
216
|
classPropertyName: "item",
|
|
46
217
|
publicName: "item",
|
|
@@ -87,58 +258,86 @@ var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
|
87
258
|
host: { classAttribute: "contents" },
|
|
88
259
|
ngImport: i0,
|
|
89
260
|
template: `
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
99
|
-
}
|
|
100
|
-
</span>
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@if (!compact()) {
|
|
104
|
-
<span class="min-w-0 flex-1">
|
|
105
|
-
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
106
|
-
@if (showSubtitle()) {
|
|
107
|
-
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
108
|
-
}
|
|
109
|
-
</span>
|
|
110
|
-
|
|
111
|
-
@if (item().badge?.title; as badgeTitle) {
|
|
112
|
-
<span [class]="item().badge?.classes ?? defaultBadgeClasses()">{{ badgeTitle }}</span>
|
|
261
|
+
<!-- Keep the badge view alive when compact/preview changes. Non-replaying streams
|
|
262
|
+
must not lose their last emission or restart subscriptions just to move a badge. -->
|
|
263
|
+
<span
|
|
264
|
+
[attr.data-navigation-icon-slot]="compact() && hasIconSlot() ? 'true' : null"
|
|
265
|
+
[class]="compact() && hasIconSlot() ? iconSlotClasses() : 'contents'"
|
|
266
|
+
>
|
|
267
|
+
@if (compact() && hasCountBadge(item())) {
|
|
268
|
+
<span class="sr-only">{{ item().tooltip ?? item().title }}</span>
|
|
113
269
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
270
|
+
@if (item().icon; as iconName) {
|
|
271
|
+
<span
|
|
272
|
+
[attr.data-navigation-icon-slot]="compact() ? null : 'true'"
|
|
273
|
+
[class]="compact() ? 'contents' : iconSlotClasses()"
|
|
274
|
+
>
|
|
275
|
+
@if (iconTemplate(); as customIcon) {
|
|
276
|
+
<ng-container
|
|
277
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
278
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
279
|
+
/>
|
|
280
|
+
} @else {
|
|
281
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
282
|
+
}
|
|
283
|
+
</span>
|
|
284
|
+
}
|
|
285
|
+
@if (!compact()) {
|
|
286
|
+
<span class="min-w-0 flex-1">
|
|
287
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
288
|
+
@if (showSubtitle()) {
|
|
289
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
290
|
+
}
|
|
291
|
+
</span>
|
|
292
|
+
} @else if (!item().icon) {
|
|
293
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
294
|
+
}
|
|
295
|
+
<NavigationItemBadge
|
|
296
|
+
[children]="item().children"
|
|
297
|
+
[itemBadge]="item().badge"
|
|
298
|
+
[badgeContext]="badgeContext()"
|
|
299
|
+
[compact]="compact()"
|
|
300
|
+
[staticClass]="defaultBadgeClasses()"
|
|
301
|
+
/>
|
|
302
|
+
</span>
|
|
119
303
|
`,
|
|
120
304
|
isInline: true,
|
|
121
|
-
dependencies: [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
305
|
+
dependencies: [
|
|
306
|
+
{
|
|
307
|
+
kind: "directive",
|
|
308
|
+
type: NgTemplateOutlet,
|
|
309
|
+
selector: "[ngTemplateOutlet]",
|
|
310
|
+
inputs: [
|
|
311
|
+
"ngTemplateOutletContext",
|
|
312
|
+
"ngTemplateOutlet",
|
|
313
|
+
"ngTemplateOutletInjector"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
kind: "component",
|
|
318
|
+
type: IconComponent,
|
|
319
|
+
selector: "Icon",
|
|
320
|
+
inputs: [
|
|
321
|
+
"name",
|
|
322
|
+
"class",
|
|
323
|
+
"size",
|
|
324
|
+
"strokeWidth",
|
|
325
|
+
"label"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "component",
|
|
330
|
+
type: NavigationItemBadgeComponent,
|
|
331
|
+
selector: "NavigationItemBadge",
|
|
332
|
+
inputs: [
|
|
333
|
+
"staticClass",
|
|
334
|
+
"compact",
|
|
335
|
+
"itemBadge",
|
|
336
|
+
"badgeContext",
|
|
337
|
+
"children"
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
]
|
|
142
341
|
});
|
|
143
342
|
};
|
|
144
343
|
i0.ɵɵngDeclareClassMetadata({
|
|
@@ -150,42 +349,67 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
150
349
|
type: Component,
|
|
151
350
|
args: [{
|
|
152
351
|
selector: "NavigationItemContent",
|
|
153
|
-
imports: [
|
|
352
|
+
imports: [
|
|
353
|
+
NgTemplateOutlet,
|
|
354
|
+
IconComponent,
|
|
355
|
+
NavigationItemBadgeComponent
|
|
356
|
+
],
|
|
154
357
|
host: { class: "contents" },
|
|
155
358
|
template: `
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
165
|
-
}
|
|
166
|
-
</span>
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@if (!compact()) {
|
|
170
|
-
<span class="min-w-0 flex-1">
|
|
171
|
-
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
172
|
-
@if (showSubtitle()) {
|
|
173
|
-
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
174
|
-
}
|
|
175
|
-
</span>
|
|
176
|
-
|
|
177
|
-
@if (item().badge?.title; as badgeTitle) {
|
|
178
|
-
<span [class]="item().badge?.classes ?? defaultBadgeClasses()">{{ badgeTitle }}</span>
|
|
359
|
+
<!-- Keep the badge view alive when compact/preview changes. Non-replaying streams
|
|
360
|
+
must not lose their last emission or restart subscriptions just to move a badge. -->
|
|
361
|
+
<span
|
|
362
|
+
[attr.data-navigation-icon-slot]="compact() && hasIconSlot() ? 'true' : null"
|
|
363
|
+
[class]="compact() && hasIconSlot() ? iconSlotClasses() : 'contents'"
|
|
364
|
+
>
|
|
365
|
+
@if (compact() && hasCountBadge(item())) {
|
|
366
|
+
<span class="sr-only">{{ item().tooltip ?? item().title }}</span>
|
|
179
367
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
368
|
+
@if (item().icon; as iconName) {
|
|
369
|
+
<span
|
|
370
|
+
[attr.data-navigation-icon-slot]="compact() ? null : 'true'"
|
|
371
|
+
[class]="compact() ? 'contents' : iconSlotClasses()"
|
|
372
|
+
>
|
|
373
|
+
@if (iconTemplate(); as customIcon) {
|
|
374
|
+
<ng-container
|
|
375
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
376
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
377
|
+
/>
|
|
378
|
+
} @else {
|
|
379
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
380
|
+
}
|
|
381
|
+
</span>
|
|
382
|
+
}
|
|
383
|
+
@if (!compact()) {
|
|
384
|
+
<span class="min-w-0 flex-1">
|
|
385
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
386
|
+
@if (showSubtitle()) {
|
|
387
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
388
|
+
}
|
|
389
|
+
</span>
|
|
390
|
+
} @else if (!item().icon) {
|
|
391
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
392
|
+
}
|
|
393
|
+
<NavigationItemBadge
|
|
394
|
+
[children]="item().children"
|
|
395
|
+
[itemBadge]="item().badge"
|
|
396
|
+
[badgeContext]="badgeContext()"
|
|
397
|
+
[compact]="compact()"
|
|
398
|
+
[staticClass]="defaultBadgeClasses()"
|
|
399
|
+
/>
|
|
400
|
+
</span>
|
|
185
401
|
`
|
|
186
402
|
}]
|
|
187
403
|
}],
|
|
188
404
|
propDecorators: {
|
|
405
|
+
badgeContext: [{
|
|
406
|
+
type: i0.Input,
|
|
407
|
+
args: [{
|
|
408
|
+
isSignal: true,
|
|
409
|
+
alias: "badgeContext",
|
|
410
|
+
required: false
|
|
411
|
+
}]
|
|
412
|
+
}],
|
|
189
413
|
item: [{
|
|
190
414
|
type: i0.Input,
|
|
191
415
|
args: [{
|
|
@@ -246,10 +470,12 @@ function safeNavId(value) {
|
|
|
246
470
|
return value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-") || "default";
|
|
247
471
|
}
|
|
248
472
|
var NavigationItemComponent = class NavigationItemComponent {
|
|
473
|
+
hasCountBadge = hasNavigationCountBadge;
|
|
249
474
|
nav = inject(NAVIGATION_ADAPTER);
|
|
250
475
|
routeContext = inject(NAVIGATION_ROUTE_CONTEXT_ADAPTER);
|
|
251
476
|
router = inject(Router, { optional: true });
|
|
252
477
|
activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
478
|
+
badgeContext = input({}, ...ngDevMode ? [{ debugName: "badgeContext" }] : /* istanbul ignore next */ []);
|
|
253
479
|
navId = input("default", ...ngDevMode ? [{ debugName: "navId" }] : /* istanbul ignore next */ []);
|
|
254
480
|
item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
255
481
|
level = input(0, ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
@@ -376,7 +602,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
376
602
|
return cn(this.orientation() === "horizontal" && this.level() === 0 ? "mx-1 h-5 w-px" : "my-2 w-full px-2");
|
|
377
603
|
}
|
|
378
604
|
groupHeadingClasses() {
|
|
379
|
-
return cn("nav-heading px-(--nav-item-padding-x) pt-4 pb-1 text-muted-foreground", this.item().classes?.title);
|
|
605
|
+
return cn("nav-heading flex min-w-0 items-center gap-(--nav-item-gap) px-(--nav-item-padding-x) pt-4 pb-1 text-muted-foreground", this.item().classes?.title);
|
|
380
606
|
}
|
|
381
607
|
childListClasses() {
|
|
382
608
|
const isGroupedBranch = this.item().type === "group" || this.item().type === "mega";
|
|
@@ -408,6 +634,13 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
408
634
|
isStandalone: true,
|
|
409
635
|
selector: "li[NavigationItem]",
|
|
410
636
|
inputs: {
|
|
637
|
+
badgeContext: {
|
|
638
|
+
classPropertyName: "badgeContext",
|
|
639
|
+
publicName: "badgeContext",
|
|
640
|
+
isSignal: true,
|
|
641
|
+
isRequired: false,
|
|
642
|
+
transformFunction: null
|
|
643
|
+
},
|
|
411
644
|
navId: {
|
|
412
645
|
classPropertyName: "navId",
|
|
413
646
|
publicName: "navId",
|
|
@@ -551,16 +784,23 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
551
784
|
@case ('group') {
|
|
552
785
|
@if (!compact() && item().title) {
|
|
553
786
|
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
554
|
-
<span class="
|
|
787
|
+
<span class="min-w-0 flex-1">
|
|
788
|
+
<span class="block truncate">{{ item().title }}</span>
|
|
555
789
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
790
|
+
@if (item().subtitle) {
|
|
791
|
+
<span
|
|
792
|
+
class="nav-subtitle -mt-0.5 block truncate text-2xs normal-case text-muted-foreground"
|
|
793
|
+
data-navigation-group-subtitle
|
|
794
|
+
>
|
|
795
|
+
{{ item().subtitle }}
|
|
796
|
+
</span>
|
|
797
|
+
}
|
|
798
|
+
</span>
|
|
799
|
+
<NavigationItemBadge
|
|
800
|
+
[children]="item().children"
|
|
801
|
+
[itemBadge]="item().badge"
|
|
802
|
+
[badgeContext]="badgeContext()"
|
|
803
|
+
/>
|
|
564
804
|
</div>
|
|
565
805
|
}
|
|
566
806
|
|
|
@@ -579,7 +819,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
579
819
|
[class]="triggerClasses(isActive())"
|
|
580
820
|
[attr.aria-expanded]="showChildren()"
|
|
581
821
|
[attr.aria-controls]="showChildren() ? panelId() : null"
|
|
582
|
-
[attr.aria-label]="compactLabel()"
|
|
822
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
583
823
|
[attr.title]="titleFor()"
|
|
584
824
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
585
825
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -592,6 +832,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
592
832
|
[compact]="compact()"
|
|
593
833
|
[orientation]="orientation()"
|
|
594
834
|
[level]="level()"
|
|
835
|
+
[badgeContext]="badgeContext()"
|
|
595
836
|
[iconTemplate]="iconTemplate()"
|
|
596
837
|
/>
|
|
597
838
|
|
|
@@ -609,7 +850,14 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
609
850
|
|
|
610
851
|
@case ('mega') {
|
|
611
852
|
@if (!compact() && item().title) {
|
|
612
|
-
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
853
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
854
|
+
<span class="min-w-0 flex-1 truncate">{{ item().title }}</span>
|
|
855
|
+
<NavigationItemBadge
|
|
856
|
+
[children]="item().children"
|
|
857
|
+
[itemBadge]="item().badge"
|
|
858
|
+
[badgeContext]="badgeContext()"
|
|
859
|
+
/>
|
|
860
|
+
</div>
|
|
613
861
|
}
|
|
614
862
|
|
|
615
863
|
<ul
|
|
@@ -635,7 +883,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
635
883
|
[attr.aria-current]="isRouterItemActive() ? 'page' : null"
|
|
636
884
|
[attr.aria-disabled]="item().disabled || null"
|
|
637
885
|
[attr.tabindex]="leafTabIndex()"
|
|
638
|
-
[attr.aria-label]="compactLabel()"
|
|
886
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
639
887
|
[attr.title]="titleFor()"
|
|
640
888
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
641
889
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -649,6 +897,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
649
897
|
[compact]="compact()"
|
|
650
898
|
[orientation]="orientation()"
|
|
651
899
|
[level]="level()"
|
|
900
|
+
[badgeContext]="badgeContext()"
|
|
652
901
|
[iconTemplate]="iconTemplate()"
|
|
653
902
|
/>
|
|
654
903
|
</a>
|
|
@@ -661,7 +910,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
661
910
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
662
911
|
[attr.aria-disabled]="item().disabled || null"
|
|
663
912
|
[attr.tabindex]="leafTabIndex()"
|
|
664
|
-
[attr.aria-label]="compactLabel()"
|
|
913
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
665
914
|
[attr.title]="titleFor()"
|
|
666
915
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
667
916
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -675,6 +924,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
675
924
|
[compact]="compact()"
|
|
676
925
|
[orientation]="orientation()"
|
|
677
926
|
[level]="level()"
|
|
927
|
+
[badgeContext]="badgeContext()"
|
|
678
928
|
[iconTemplate]="iconTemplate()"
|
|
679
929
|
/>
|
|
680
930
|
</a>
|
|
@@ -684,7 +934,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
684
934
|
[class]="leafClasses(isActive())"
|
|
685
935
|
[disabled]="item().disabled || null"
|
|
686
936
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
687
|
-
[attr.aria-label]="compactLabel()"
|
|
937
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
688
938
|
[attr.title]="titleFor()"
|
|
689
939
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
690
940
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -698,6 +948,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
698
948
|
[compact]="compact()"
|
|
699
949
|
[orientation]="orientation()"
|
|
700
950
|
[level]="level()"
|
|
951
|
+
[badgeContext]="badgeContext()"
|
|
701
952
|
[iconTemplate]="iconTemplate()"
|
|
702
953
|
/>
|
|
703
954
|
</button>
|
|
@@ -728,6 +979,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
728
979
|
[itemClass]="itemClass()"
|
|
729
980
|
[activeIds]="activeIds()"
|
|
730
981
|
[activeUrl]="activeUrl()"
|
|
982
|
+
[badgeContext]="badgeContext()"
|
|
731
983
|
[iconTemplate]="iconTemplate()"
|
|
732
984
|
[tooltip-position]="tooltipPosition()"
|
|
733
985
|
[collapseTree]="collapseTree()"
|
|
@@ -750,6 +1002,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
750
1002
|
type: NavigationItemComponent,
|
|
751
1003
|
selector: "li[NavigationItem]",
|
|
752
1004
|
inputs: [
|
|
1005
|
+
"badgeContext",
|
|
753
1006
|
"navId",
|
|
754
1007
|
"item",
|
|
755
1008
|
"level",
|
|
@@ -787,6 +1040,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
787
1040
|
type: NavigationItemContentComponent,
|
|
788
1041
|
selector: "NavigationItemContent",
|
|
789
1042
|
inputs: [
|
|
1043
|
+
"badgeContext",
|
|
790
1044
|
"item",
|
|
791
1045
|
"active",
|
|
792
1046
|
"compact",
|
|
@@ -795,6 +1049,18 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
795
1049
|
"iconTemplate"
|
|
796
1050
|
]
|
|
797
1051
|
},
|
|
1052
|
+
{
|
|
1053
|
+
kind: "component",
|
|
1054
|
+
type: NavigationItemBadgeComponent,
|
|
1055
|
+
selector: "NavigationItemBadge",
|
|
1056
|
+
inputs: [
|
|
1057
|
+
"staticClass",
|
|
1058
|
+
"compact",
|
|
1059
|
+
"itemBadge",
|
|
1060
|
+
"badgeContext",
|
|
1061
|
+
"children"
|
|
1062
|
+
]
|
|
1063
|
+
},
|
|
798
1064
|
{
|
|
799
1065
|
kind: "directive",
|
|
800
1066
|
type: NgTemplateOutlet,
|
|
@@ -852,6 +1118,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
852
1118
|
imports: [
|
|
853
1119
|
IconComponent,
|
|
854
1120
|
NavigationItemContentComponent,
|
|
1121
|
+
NavigationItemBadgeComponent,
|
|
855
1122
|
NgTemplateOutlet,
|
|
856
1123
|
RouterLink,
|
|
857
1124
|
TooltipDirective
|
|
@@ -874,16 +1141,23 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
874
1141
|
@case ('group') {
|
|
875
1142
|
@if (!compact() && item().title) {
|
|
876
1143
|
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
877
|
-
<span class="
|
|
1144
|
+
<span class="min-w-0 flex-1">
|
|
1145
|
+
<span class="block truncate">{{ item().title }}</span>
|
|
878
1146
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1147
|
+
@if (item().subtitle) {
|
|
1148
|
+
<span
|
|
1149
|
+
class="nav-subtitle -mt-0.5 block truncate text-2xs normal-case text-muted-foreground"
|
|
1150
|
+
data-navigation-group-subtitle
|
|
1151
|
+
>
|
|
1152
|
+
{{ item().subtitle }}
|
|
1153
|
+
</span>
|
|
1154
|
+
}
|
|
1155
|
+
</span>
|
|
1156
|
+
<NavigationItemBadge
|
|
1157
|
+
[children]="item().children"
|
|
1158
|
+
[itemBadge]="item().badge"
|
|
1159
|
+
[badgeContext]="badgeContext()"
|
|
1160
|
+
/>
|
|
887
1161
|
</div>
|
|
888
1162
|
}
|
|
889
1163
|
|
|
@@ -902,7 +1176,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
902
1176
|
[class]="triggerClasses(isActive())"
|
|
903
1177
|
[attr.aria-expanded]="showChildren()"
|
|
904
1178
|
[attr.aria-controls]="showChildren() ? panelId() : null"
|
|
905
|
-
[attr.aria-label]="compactLabel()"
|
|
1179
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
906
1180
|
[attr.title]="titleFor()"
|
|
907
1181
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
908
1182
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -915,6 +1189,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
915
1189
|
[compact]="compact()"
|
|
916
1190
|
[orientation]="orientation()"
|
|
917
1191
|
[level]="level()"
|
|
1192
|
+
[badgeContext]="badgeContext()"
|
|
918
1193
|
[iconTemplate]="iconTemplate()"
|
|
919
1194
|
/>
|
|
920
1195
|
|
|
@@ -932,7 +1207,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
932
1207
|
|
|
933
1208
|
@case ('mega') {
|
|
934
1209
|
@if (!compact() && item().title) {
|
|
935
|
-
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
1210
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
1211
|
+
<span class="min-w-0 flex-1 truncate">{{ item().title }}</span>
|
|
1212
|
+
<NavigationItemBadge
|
|
1213
|
+
[children]="item().children"
|
|
1214
|
+
[itemBadge]="item().badge"
|
|
1215
|
+
[badgeContext]="badgeContext()"
|
|
1216
|
+
/>
|
|
1217
|
+
</div>
|
|
936
1218
|
}
|
|
937
1219
|
|
|
938
1220
|
<ul
|
|
@@ -958,7 +1240,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
958
1240
|
[attr.aria-current]="isRouterItemActive() ? 'page' : null"
|
|
959
1241
|
[attr.aria-disabled]="item().disabled || null"
|
|
960
1242
|
[attr.tabindex]="leafTabIndex()"
|
|
961
|
-
[attr.aria-label]="compactLabel()"
|
|
1243
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
962
1244
|
[attr.title]="titleFor()"
|
|
963
1245
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
964
1246
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -972,6 +1254,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
972
1254
|
[compact]="compact()"
|
|
973
1255
|
[orientation]="orientation()"
|
|
974
1256
|
[level]="level()"
|
|
1257
|
+
[badgeContext]="badgeContext()"
|
|
975
1258
|
[iconTemplate]="iconTemplate()"
|
|
976
1259
|
/>
|
|
977
1260
|
</a>
|
|
@@ -984,7 +1267,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
984
1267
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
985
1268
|
[attr.aria-disabled]="item().disabled || null"
|
|
986
1269
|
[attr.tabindex]="leafTabIndex()"
|
|
987
|
-
[attr.aria-label]="compactLabel()"
|
|
1270
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
988
1271
|
[attr.title]="titleFor()"
|
|
989
1272
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
990
1273
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -998,6 +1281,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
998
1281
|
[compact]="compact()"
|
|
999
1282
|
[orientation]="orientation()"
|
|
1000
1283
|
[level]="level()"
|
|
1284
|
+
[badgeContext]="badgeContext()"
|
|
1001
1285
|
[iconTemplate]="iconTemplate()"
|
|
1002
1286
|
/>
|
|
1003
1287
|
</a>
|
|
@@ -1007,7 +1291,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1007
1291
|
[class]="leafClasses(isActive())"
|
|
1008
1292
|
[disabled]="item().disabled || null"
|
|
1009
1293
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
1010
|
-
[attr.aria-label]="compactLabel()"
|
|
1294
|
+
[attr.aria-label]="hasCountBadge(item()) ? null : compactLabel()"
|
|
1011
1295
|
[attr.title]="titleFor()"
|
|
1012
1296
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
1013
1297
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -1021,6 +1305,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1021
1305
|
[compact]="compact()"
|
|
1022
1306
|
[orientation]="orientation()"
|
|
1023
1307
|
[level]="level()"
|
|
1308
|
+
[badgeContext]="badgeContext()"
|
|
1024
1309
|
[iconTemplate]="iconTemplate()"
|
|
1025
1310
|
/>
|
|
1026
1311
|
</button>
|
|
@@ -1051,6 +1336,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1051
1336
|
[itemClass]="itemClass()"
|
|
1052
1337
|
[activeIds]="activeIds()"
|
|
1053
1338
|
[activeUrl]="activeUrl()"
|
|
1339
|
+
[badgeContext]="badgeContext()"
|
|
1054
1340
|
[iconTemplate]="iconTemplate()"
|
|
1055
1341
|
[tooltip-position]="tooltipPosition()"
|
|
1056
1342
|
[collapseTree]="collapseTree()"
|
|
@@ -1069,6 +1355,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1069
1355
|
}]
|
|
1070
1356
|
}],
|
|
1071
1357
|
propDecorators: {
|
|
1358
|
+
badgeContext: [{
|
|
1359
|
+
type: i0.Input,
|
|
1360
|
+
args: [{
|
|
1361
|
+
isSignal: true,
|
|
1362
|
+
alias: "badgeContext",
|
|
1363
|
+
required: false
|
|
1364
|
+
}]
|
|
1365
|
+
}],
|
|
1072
1366
|
navId: [{
|
|
1073
1367
|
type: i0.Input,
|
|
1074
1368
|
args: [{
|
|
@@ -1215,4 +1509,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1215
1509
|
}]
|
|
1216
1510
|
}
|
|
1217
1511
|
});
|
|
1218
|
-
export { navigationPanelId as n, NavigationItemContentComponent as r, NavigationItemComponent as t };
|
|
1512
|
+
export { NavigationItemBadgeComponent as i, navigationPanelId as n, NavigationItemContentComponent as r, NavigationItemComponent as t };
|