@ojiepermana/angular 22.2.4 → 22.2.5
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-4RIokl1C.mjs → ojiepermana-angular-navigation-navigation-badge-count.component-BYN_Vxm3.mjs} +36 -5
- package/fesm2022/{ojiepermana-angular-navigation-navigation-dockbar-menu.component-DC8rfxS5.mjs → ojiepermana-angular-navigation-navigation-dockbar-menu.component-Dlyt6eZr.mjs} +17 -32
- package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-meQb_EWZ.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-DeF_s1vE.mjs} +35 -20
- package/fesm2022/{ojiepermana-angular-navigation-navigation-flyout-menu.component-DRdw2G-c.mjs → ojiepermana-angular-navigation-navigation-flyout-menu.component-BOGL8MY0.mjs} +23 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-horizontal.component-Bx1NcrWO.mjs → ojiepermana-angular-navigation-navigation-horizontal.component-Cb4bHM58.mjs} +29 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-item.component-ERZNpmTZ.mjs → ojiepermana-angular-navigation-navigation-item.component-DLgcJQOC.mjs} +351 -108
- package/fesm2022/{ojiepermana-angular-navigation-navigation-list.component-D-oOKwHg.mjs → ojiepermana-angular-navigation-navigation-list.component-BYc3WCt8.mjs} +20 -1
- package/fesm2022/ojiepermana-angular-navigation.mjs +66 -15
- 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 +92 -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 +16 -0
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +17 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as NavigationBadgeCountComponent } from "./ojiepermana-angular-navigation-navigation-badge-count.component-BYN_Vxm3.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,147 @@ 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
|
+
source = computed(() => {
|
|
18
|
+
const key = this.itemBadge()?.source;
|
|
19
|
+
return key && Object.hasOwn(this.badgeContext(), key) ? this.badgeContext()[key] : null;
|
|
20
|
+
}, ...ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []);
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
22
|
+
minVersion: "12.0.0",
|
|
23
|
+
version: "22.2.3",
|
|
24
|
+
ngImport: i0,
|
|
25
|
+
type: NavigationItemBadgeComponent,
|
|
26
|
+
deps: [],
|
|
27
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
28
|
+
});
|
|
29
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
30
|
+
minVersion: "17.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
type: NavigationItemBadgeComponent,
|
|
33
|
+
isStandalone: true,
|
|
34
|
+
selector: "NavigationItemBadge",
|
|
35
|
+
inputs: {
|
|
36
|
+
staticClass: {
|
|
37
|
+
classPropertyName: "staticClass",
|
|
38
|
+
publicName: "staticClass",
|
|
39
|
+
isSignal: true,
|
|
40
|
+
isRequired: false,
|
|
41
|
+
transformFunction: null
|
|
42
|
+
},
|
|
43
|
+
compact: {
|
|
44
|
+
classPropertyName: "compact",
|
|
45
|
+
publicName: "compact",
|
|
46
|
+
isSignal: true,
|
|
47
|
+
isRequired: false,
|
|
48
|
+
transformFunction: null
|
|
49
|
+
},
|
|
50
|
+
itemBadge: {
|
|
51
|
+
classPropertyName: "itemBadge",
|
|
52
|
+
publicName: "itemBadge",
|
|
53
|
+
isSignal: true,
|
|
54
|
+
isRequired: false,
|
|
55
|
+
transformFunction: null
|
|
56
|
+
},
|
|
57
|
+
badgeContext: {
|
|
58
|
+
classPropertyName: "badgeContext",
|
|
59
|
+
publicName: "badgeContext",
|
|
60
|
+
isSignal: true,
|
|
61
|
+
isRequired: false,
|
|
62
|
+
transformFunction: null
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
host: { classAttribute: "contents" },
|
|
66
|
+
ngImport: i0,
|
|
67
|
+
template: `
|
|
68
|
+
@if (itemBadge()?.source) {
|
|
69
|
+
<NavigationBadgeCount [badge]="source()" [class]="countClasses()" />
|
|
70
|
+
} @else if (!compact() && itemBadge()?.title; as title) {
|
|
71
|
+
<span data-navigation-badge-text="true" [class]="itemBadge()?.classes ?? staticClass()">{{
|
|
72
|
+
title
|
|
73
|
+
}}</span>
|
|
74
|
+
}
|
|
75
|
+
`,
|
|
76
|
+
isInline: true,
|
|
77
|
+
dependencies: [{
|
|
78
|
+
kind: "component",
|
|
79
|
+
type: NavigationBadgeCountComponent,
|
|
80
|
+
selector: "NavigationBadgeCount",
|
|
81
|
+
inputs: ["badge", "class"]
|
|
82
|
+
}]
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
86
|
+
minVersion: "12.0.0",
|
|
87
|
+
version: "22.2.3",
|
|
88
|
+
ngImport: i0,
|
|
89
|
+
type: NavigationItemBadgeComponent,
|
|
90
|
+
decorators: [{
|
|
91
|
+
type: Component,
|
|
92
|
+
args: [{
|
|
93
|
+
selector: "NavigationItemBadge",
|
|
94
|
+
imports: [NavigationBadgeCountComponent],
|
|
95
|
+
host: { class: "contents" },
|
|
96
|
+
template: `
|
|
97
|
+
@if (itemBadge()?.source) {
|
|
98
|
+
<NavigationBadgeCount [badge]="source()" [class]="countClasses()" />
|
|
99
|
+
} @else if (!compact() && itemBadge()?.title; as title) {
|
|
100
|
+
<span data-navigation-badge-text="true" [class]="itemBadge()?.classes ?? staticClass()">{{
|
|
101
|
+
title
|
|
102
|
+
}}</span>
|
|
103
|
+
}
|
|
104
|
+
`
|
|
105
|
+
}]
|
|
106
|
+
}],
|
|
107
|
+
propDecorators: {
|
|
108
|
+
staticClass: [{
|
|
109
|
+
type: i0.Input,
|
|
110
|
+
args: [{
|
|
111
|
+
isSignal: true,
|
|
112
|
+
alias: "staticClass",
|
|
113
|
+
required: false
|
|
114
|
+
}]
|
|
115
|
+
}],
|
|
116
|
+
compact: [{
|
|
117
|
+
type: i0.Input,
|
|
118
|
+
args: [{
|
|
119
|
+
isSignal: true,
|
|
120
|
+
alias: "compact",
|
|
121
|
+
required: false
|
|
122
|
+
}]
|
|
123
|
+
}],
|
|
124
|
+
itemBadge: [{
|
|
125
|
+
type: i0.Input,
|
|
126
|
+
args: [{
|
|
127
|
+
isSignal: true,
|
|
128
|
+
alias: "itemBadge",
|
|
129
|
+
required: false
|
|
130
|
+
}]
|
|
131
|
+
}],
|
|
132
|
+
badgeContext: [{
|
|
133
|
+
type: i0.Input,
|
|
134
|
+
args: [{
|
|
135
|
+
isSignal: true,
|
|
136
|
+
alias: "badgeContext",
|
|
137
|
+
required: false
|
|
138
|
+
}]
|
|
139
|
+
}]
|
|
140
|
+
}
|
|
141
|
+
});
|
|
10
142
|
var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
11
143
|
nav = inject(NAVIGATION_ADAPTER);
|
|
144
|
+
badgeContext = input({}, ...ngDevMode ? [{ debugName: "badgeContext" }] : /* istanbul ignore next */ []);
|
|
12
145
|
item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
13
146
|
active = input(false, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
14
147
|
compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
|
|
15
148
|
orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
16
149
|
level = input(0, ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
17
150
|
iconTemplate = input(void 0, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
|
|
151
|
+
hasIconSlot = computed(() => !!this.item().icon || !!this.item().badge?.source, ...ngDevMode ? [{ debugName: "hasIconSlot" }] : /* istanbul ignore next */ []);
|
|
18
152
|
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
153
|
titleClasses = computed(() => cn("block truncate", this.active() && "text-foreground", this.item().classes?.title), ...ngDevMode ? [{ debugName: "titleClasses" }] : /* istanbul ignore next */ []);
|
|
20
154
|
showSubtitle = computed(() => !!this.item().subtitle && !(this.orientation() === "horizontal" && this.level() === 0), ...ngDevMode ? [{ debugName: "showSubtitle" }] : /* istanbul ignore next */ []);
|
|
@@ -41,6 +175,13 @@ var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
|
41
175
|
isStandalone: true,
|
|
42
176
|
selector: "NavigationItemContent",
|
|
43
177
|
inputs: {
|
|
178
|
+
badgeContext: {
|
|
179
|
+
classPropertyName: "badgeContext",
|
|
180
|
+
publicName: "badgeContext",
|
|
181
|
+
isSignal: true,
|
|
182
|
+
isRequired: false,
|
|
183
|
+
transformFunction: null
|
|
184
|
+
},
|
|
44
185
|
item: {
|
|
45
186
|
classPropertyName: "item",
|
|
46
187
|
publicName: "item",
|
|
@@ -87,58 +228,84 @@ var NavigationItemContentComponent = class NavigationItemContentComponent {
|
|
|
87
228
|
host: { classAttribute: "contents" },
|
|
88
229
|
ngImport: i0,
|
|
89
230
|
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>
|
|
231
|
+
<!-- Keep the badge view alive when compact/preview changes. Non-replaying streams
|
|
232
|
+
must not lose their last emission or restart subscriptions just to move a badge. -->
|
|
233
|
+
<span
|
|
234
|
+
[attr.data-navigation-icon-slot]="compact() && hasIconSlot() ? 'true' : null"
|
|
235
|
+
[class]="compact() && hasIconSlot() ? iconSlotClasses() : 'contents'"
|
|
236
|
+
>
|
|
237
|
+
@if (compact() && item().badge?.source) {
|
|
238
|
+
<span class="sr-only">{{ item().tooltip ?? item().title }}</span>
|
|
113
239
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
240
|
+
@if (item().icon; as iconName) {
|
|
241
|
+
<span
|
|
242
|
+
[attr.data-navigation-icon-slot]="compact() ? null : 'true'"
|
|
243
|
+
[class]="compact() ? 'contents' : iconSlotClasses()"
|
|
244
|
+
>
|
|
245
|
+
@if (iconTemplate(); as customIcon) {
|
|
246
|
+
<ng-container
|
|
247
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
248
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
249
|
+
/>
|
|
250
|
+
} @else {
|
|
251
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
252
|
+
}
|
|
253
|
+
</span>
|
|
254
|
+
}
|
|
255
|
+
@if (!compact()) {
|
|
256
|
+
<span class="min-w-0 flex-1">
|
|
257
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
258
|
+
@if (showSubtitle()) {
|
|
259
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
260
|
+
}
|
|
261
|
+
</span>
|
|
262
|
+
} @else if (!item().icon) {
|
|
263
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
264
|
+
}
|
|
265
|
+
<NavigationItemBadge
|
|
266
|
+
[itemBadge]="item().badge"
|
|
267
|
+
[badgeContext]="badgeContext()"
|
|
268
|
+
[compact]="compact()"
|
|
269
|
+
[staticClass]="defaultBadgeClasses()"
|
|
270
|
+
/>
|
|
271
|
+
</span>
|
|
119
272
|
`,
|
|
120
273
|
isInline: true,
|
|
121
|
-
dependencies: [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
274
|
+
dependencies: [
|
|
275
|
+
{
|
|
276
|
+
kind: "directive",
|
|
277
|
+
type: NgTemplateOutlet,
|
|
278
|
+
selector: "[ngTemplateOutlet]",
|
|
279
|
+
inputs: [
|
|
280
|
+
"ngTemplateOutletContext",
|
|
281
|
+
"ngTemplateOutlet",
|
|
282
|
+
"ngTemplateOutletInjector"
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
kind: "component",
|
|
287
|
+
type: IconComponent,
|
|
288
|
+
selector: "Icon",
|
|
289
|
+
inputs: [
|
|
290
|
+
"name",
|
|
291
|
+
"class",
|
|
292
|
+
"size",
|
|
293
|
+
"strokeWidth",
|
|
294
|
+
"label"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
kind: "component",
|
|
299
|
+
type: NavigationItemBadgeComponent,
|
|
300
|
+
selector: "NavigationItemBadge",
|
|
301
|
+
inputs: [
|
|
302
|
+
"staticClass",
|
|
303
|
+
"compact",
|
|
304
|
+
"itemBadge",
|
|
305
|
+
"badgeContext"
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
]
|
|
142
309
|
});
|
|
143
310
|
};
|
|
144
311
|
i0.ɵɵngDeclareClassMetadata({
|
|
@@ -150,42 +317,66 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
150
317
|
type: Component,
|
|
151
318
|
args: [{
|
|
152
319
|
selector: "NavigationItemContent",
|
|
153
|
-
imports: [
|
|
320
|
+
imports: [
|
|
321
|
+
NgTemplateOutlet,
|
|
322
|
+
IconComponent,
|
|
323
|
+
NavigationItemBadgeComponent
|
|
324
|
+
],
|
|
154
325
|
host: { class: "contents" },
|
|
155
326
|
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>
|
|
327
|
+
<!-- Keep the badge view alive when compact/preview changes. Non-replaying streams
|
|
328
|
+
must not lose their last emission or restart subscriptions just to move a badge. -->
|
|
329
|
+
<span
|
|
330
|
+
[attr.data-navigation-icon-slot]="compact() && hasIconSlot() ? 'true' : null"
|
|
331
|
+
[class]="compact() && hasIconSlot() ? iconSlotClasses() : 'contents'"
|
|
332
|
+
>
|
|
333
|
+
@if (compact() && item().badge?.source) {
|
|
334
|
+
<span class="sr-only">{{ item().tooltip ?? item().title }}</span>
|
|
179
335
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
336
|
+
@if (item().icon; as iconName) {
|
|
337
|
+
<span
|
|
338
|
+
[attr.data-navigation-icon-slot]="compact() ? null : 'true'"
|
|
339
|
+
[class]="compact() ? 'contents' : iconSlotClasses()"
|
|
340
|
+
>
|
|
341
|
+
@if (iconTemplate(); as customIcon) {
|
|
342
|
+
<ng-container
|
|
343
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
344
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
345
|
+
/>
|
|
346
|
+
} @else {
|
|
347
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" size="inherit" />
|
|
348
|
+
}
|
|
349
|
+
</span>
|
|
350
|
+
}
|
|
351
|
+
@if (!compact()) {
|
|
352
|
+
<span class="min-w-0 flex-1">
|
|
353
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
354
|
+
@if (showSubtitle()) {
|
|
355
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
356
|
+
}
|
|
357
|
+
</span>
|
|
358
|
+
} @else if (!item().icon) {
|
|
359
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
360
|
+
}
|
|
361
|
+
<NavigationItemBadge
|
|
362
|
+
[itemBadge]="item().badge"
|
|
363
|
+
[badgeContext]="badgeContext()"
|
|
364
|
+
[compact]="compact()"
|
|
365
|
+
[staticClass]="defaultBadgeClasses()"
|
|
366
|
+
/>
|
|
367
|
+
</span>
|
|
185
368
|
`
|
|
186
369
|
}]
|
|
187
370
|
}],
|
|
188
371
|
propDecorators: {
|
|
372
|
+
badgeContext: [{
|
|
373
|
+
type: i0.Input,
|
|
374
|
+
args: [{
|
|
375
|
+
isSignal: true,
|
|
376
|
+
alias: "badgeContext",
|
|
377
|
+
required: false
|
|
378
|
+
}]
|
|
379
|
+
}],
|
|
189
380
|
item: [{
|
|
190
381
|
type: i0.Input,
|
|
191
382
|
args: [{
|
|
@@ -250,6 +441,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
250
441
|
routeContext = inject(NAVIGATION_ROUTE_CONTEXT_ADAPTER);
|
|
251
442
|
router = inject(Router, { optional: true });
|
|
252
443
|
activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
444
|
+
badgeContext = input({}, ...ngDevMode ? [{ debugName: "badgeContext" }] : /* istanbul ignore next */ []);
|
|
253
445
|
navId = input("default", ...ngDevMode ? [{ debugName: "navId" }] : /* istanbul ignore next */ []);
|
|
254
446
|
item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
255
447
|
level = input(0, ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
@@ -376,7 +568,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
376
568
|
return cn(this.orientation() === "horizontal" && this.level() === 0 ? "mx-1 h-5 w-px" : "my-2 w-full px-2");
|
|
377
569
|
}
|
|
378
570
|
groupHeadingClasses() {
|
|
379
|
-
return cn("nav-heading px-(--nav-item-padding-x) pt-4 pb-1 text-muted-foreground", this.item().classes?.title);
|
|
571
|
+
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
572
|
}
|
|
381
573
|
childListClasses() {
|
|
382
574
|
const isGroupedBranch = this.item().type === "group" || this.item().type === "mega";
|
|
@@ -408,6 +600,13 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
408
600
|
isStandalone: true,
|
|
409
601
|
selector: "li[NavigationItem]",
|
|
410
602
|
inputs: {
|
|
603
|
+
badgeContext: {
|
|
604
|
+
classPropertyName: "badgeContext",
|
|
605
|
+
publicName: "badgeContext",
|
|
606
|
+
isSignal: true,
|
|
607
|
+
isRequired: false,
|
|
608
|
+
transformFunction: null
|
|
609
|
+
},
|
|
411
610
|
navId: {
|
|
412
611
|
classPropertyName: "navId",
|
|
413
612
|
publicName: "navId",
|
|
@@ -551,16 +750,19 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
551
750
|
@case ('group') {
|
|
552
751
|
@if (!compact() && item().title) {
|
|
553
752
|
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
554
|
-
<span class="
|
|
753
|
+
<span class="min-w-0 flex-1">
|
|
754
|
+
<span class="block truncate">{{ item().title }}</span>
|
|
555
755
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
756
|
+
@if (item().subtitle) {
|
|
757
|
+
<span
|
|
758
|
+
class="nav-subtitle -mt-0.5 block truncate text-2xs normal-case text-muted-foreground"
|
|
759
|
+
data-navigation-group-subtitle
|
|
760
|
+
>
|
|
761
|
+
{{ item().subtitle }}
|
|
762
|
+
</span>
|
|
763
|
+
}
|
|
764
|
+
</span>
|
|
765
|
+
<NavigationItemBadge [itemBadge]="item().badge" [badgeContext]="badgeContext()" />
|
|
564
766
|
</div>
|
|
565
767
|
}
|
|
566
768
|
|
|
@@ -579,7 +781,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
579
781
|
[class]="triggerClasses(isActive())"
|
|
580
782
|
[attr.aria-expanded]="showChildren()"
|
|
581
783
|
[attr.aria-controls]="showChildren() ? panelId() : null"
|
|
582
|
-
[attr.aria-label]="compactLabel()"
|
|
784
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
583
785
|
[attr.title]="titleFor()"
|
|
584
786
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
585
787
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -592,6 +794,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
592
794
|
[compact]="compact()"
|
|
593
795
|
[orientation]="orientation()"
|
|
594
796
|
[level]="level()"
|
|
797
|
+
[badgeContext]="badgeContext()"
|
|
595
798
|
[iconTemplate]="iconTemplate()"
|
|
596
799
|
/>
|
|
597
800
|
|
|
@@ -609,7 +812,10 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
609
812
|
|
|
610
813
|
@case ('mega') {
|
|
611
814
|
@if (!compact() && item().title) {
|
|
612
|
-
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
815
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
816
|
+
<span class="min-w-0 flex-1 truncate">{{ item().title }}</span>
|
|
817
|
+
<NavigationItemBadge [itemBadge]="item().badge" [badgeContext]="badgeContext()" />
|
|
818
|
+
</div>
|
|
613
819
|
}
|
|
614
820
|
|
|
615
821
|
<ul
|
|
@@ -635,7 +841,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
635
841
|
[attr.aria-current]="isRouterItemActive() ? 'page' : null"
|
|
636
842
|
[attr.aria-disabled]="item().disabled || null"
|
|
637
843
|
[attr.tabindex]="leafTabIndex()"
|
|
638
|
-
[attr.aria-label]="compactLabel()"
|
|
844
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
639
845
|
[attr.title]="titleFor()"
|
|
640
846
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
641
847
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -649,6 +855,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
649
855
|
[compact]="compact()"
|
|
650
856
|
[orientation]="orientation()"
|
|
651
857
|
[level]="level()"
|
|
858
|
+
[badgeContext]="badgeContext()"
|
|
652
859
|
[iconTemplate]="iconTemplate()"
|
|
653
860
|
/>
|
|
654
861
|
</a>
|
|
@@ -661,7 +868,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
661
868
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
662
869
|
[attr.aria-disabled]="item().disabled || null"
|
|
663
870
|
[attr.tabindex]="leafTabIndex()"
|
|
664
|
-
[attr.aria-label]="compactLabel()"
|
|
871
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
665
872
|
[attr.title]="titleFor()"
|
|
666
873
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
667
874
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -675,6 +882,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
675
882
|
[compact]="compact()"
|
|
676
883
|
[orientation]="orientation()"
|
|
677
884
|
[level]="level()"
|
|
885
|
+
[badgeContext]="badgeContext()"
|
|
678
886
|
[iconTemplate]="iconTemplate()"
|
|
679
887
|
/>
|
|
680
888
|
</a>
|
|
@@ -684,7 +892,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
684
892
|
[class]="leafClasses(isActive())"
|
|
685
893
|
[disabled]="item().disabled || null"
|
|
686
894
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
687
|
-
[attr.aria-label]="compactLabel()"
|
|
895
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
688
896
|
[attr.title]="titleFor()"
|
|
689
897
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
690
898
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -698,6 +906,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
698
906
|
[compact]="compact()"
|
|
699
907
|
[orientation]="orientation()"
|
|
700
908
|
[level]="level()"
|
|
909
|
+
[badgeContext]="badgeContext()"
|
|
701
910
|
[iconTemplate]="iconTemplate()"
|
|
702
911
|
/>
|
|
703
912
|
</button>
|
|
@@ -728,6 +937,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
728
937
|
[itemClass]="itemClass()"
|
|
729
938
|
[activeIds]="activeIds()"
|
|
730
939
|
[activeUrl]="activeUrl()"
|
|
940
|
+
[badgeContext]="badgeContext()"
|
|
731
941
|
[iconTemplate]="iconTemplate()"
|
|
732
942
|
[tooltip-position]="tooltipPosition()"
|
|
733
943
|
[collapseTree]="collapseTree()"
|
|
@@ -750,6 +960,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
750
960
|
type: NavigationItemComponent,
|
|
751
961
|
selector: "li[NavigationItem]",
|
|
752
962
|
inputs: [
|
|
963
|
+
"badgeContext",
|
|
753
964
|
"navId",
|
|
754
965
|
"item",
|
|
755
966
|
"level",
|
|
@@ -787,6 +998,7 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
787
998
|
type: NavigationItemContentComponent,
|
|
788
999
|
selector: "NavigationItemContent",
|
|
789
1000
|
inputs: [
|
|
1001
|
+
"badgeContext",
|
|
790
1002
|
"item",
|
|
791
1003
|
"active",
|
|
792
1004
|
"compact",
|
|
@@ -795,6 +1007,17 @@ var NavigationItemComponent = class NavigationItemComponent {
|
|
|
795
1007
|
"iconTemplate"
|
|
796
1008
|
]
|
|
797
1009
|
},
|
|
1010
|
+
{
|
|
1011
|
+
kind: "component",
|
|
1012
|
+
type: NavigationItemBadgeComponent,
|
|
1013
|
+
selector: "NavigationItemBadge",
|
|
1014
|
+
inputs: [
|
|
1015
|
+
"staticClass",
|
|
1016
|
+
"compact",
|
|
1017
|
+
"itemBadge",
|
|
1018
|
+
"badgeContext"
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
798
1021
|
{
|
|
799
1022
|
kind: "directive",
|
|
800
1023
|
type: NgTemplateOutlet,
|
|
@@ -852,6 +1075,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
852
1075
|
imports: [
|
|
853
1076
|
IconComponent,
|
|
854
1077
|
NavigationItemContentComponent,
|
|
1078
|
+
NavigationItemBadgeComponent,
|
|
855
1079
|
NgTemplateOutlet,
|
|
856
1080
|
RouterLink,
|
|
857
1081
|
TooltipDirective
|
|
@@ -874,16 +1098,19 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
874
1098
|
@case ('group') {
|
|
875
1099
|
@if (!compact() && item().title) {
|
|
876
1100
|
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
877
|
-
<span class="
|
|
1101
|
+
<span class="min-w-0 flex-1">
|
|
1102
|
+
<span class="block truncate">{{ item().title }}</span>
|
|
878
1103
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1104
|
+
@if (item().subtitle) {
|
|
1105
|
+
<span
|
|
1106
|
+
class="nav-subtitle -mt-0.5 block truncate text-2xs normal-case text-muted-foreground"
|
|
1107
|
+
data-navigation-group-subtitle
|
|
1108
|
+
>
|
|
1109
|
+
{{ item().subtitle }}
|
|
1110
|
+
</span>
|
|
1111
|
+
}
|
|
1112
|
+
</span>
|
|
1113
|
+
<NavigationItemBadge [itemBadge]="item().badge" [badgeContext]="badgeContext()" />
|
|
887
1114
|
</div>
|
|
888
1115
|
}
|
|
889
1116
|
|
|
@@ -902,7 +1129,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
902
1129
|
[class]="triggerClasses(isActive())"
|
|
903
1130
|
[attr.aria-expanded]="showChildren()"
|
|
904
1131
|
[attr.aria-controls]="showChildren() ? panelId() : null"
|
|
905
|
-
[attr.aria-label]="compactLabel()"
|
|
1132
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
906
1133
|
[attr.title]="titleFor()"
|
|
907
1134
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
908
1135
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -915,6 +1142,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
915
1142
|
[compact]="compact()"
|
|
916
1143
|
[orientation]="orientation()"
|
|
917
1144
|
[level]="level()"
|
|
1145
|
+
[badgeContext]="badgeContext()"
|
|
918
1146
|
[iconTemplate]="iconTemplate()"
|
|
919
1147
|
/>
|
|
920
1148
|
|
|
@@ -932,7 +1160,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
932
1160
|
|
|
933
1161
|
@case ('mega') {
|
|
934
1162
|
@if (!compact() && item().title) {
|
|
935
|
-
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
1163
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">
|
|
1164
|
+
<span class="min-w-0 flex-1 truncate">{{ item().title }}</span>
|
|
1165
|
+
<NavigationItemBadge [itemBadge]="item().badge" [badgeContext]="badgeContext()" />
|
|
1166
|
+
</div>
|
|
936
1167
|
}
|
|
937
1168
|
|
|
938
1169
|
<ul
|
|
@@ -958,7 +1189,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
958
1189
|
[attr.aria-current]="isRouterItemActive() ? 'page' : null"
|
|
959
1190
|
[attr.aria-disabled]="item().disabled || null"
|
|
960
1191
|
[attr.tabindex]="leafTabIndex()"
|
|
961
|
-
[attr.aria-label]="compactLabel()"
|
|
1192
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
962
1193
|
[attr.title]="titleFor()"
|
|
963
1194
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
964
1195
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -972,6 +1203,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
972
1203
|
[compact]="compact()"
|
|
973
1204
|
[orientation]="orientation()"
|
|
974
1205
|
[level]="level()"
|
|
1206
|
+
[badgeContext]="badgeContext()"
|
|
975
1207
|
[iconTemplate]="iconTemplate()"
|
|
976
1208
|
/>
|
|
977
1209
|
</a>
|
|
@@ -984,7 +1216,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
984
1216
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
985
1217
|
[attr.aria-disabled]="item().disabled || null"
|
|
986
1218
|
[attr.tabindex]="leafTabIndex()"
|
|
987
|
-
[attr.aria-label]="compactLabel()"
|
|
1219
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
988
1220
|
[attr.title]="titleFor()"
|
|
989
1221
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
990
1222
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -998,6 +1230,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
998
1230
|
[compact]="compact()"
|
|
999
1231
|
[orientation]="orientation()"
|
|
1000
1232
|
[level]="level()"
|
|
1233
|
+
[badgeContext]="badgeContext()"
|
|
1001
1234
|
[iconTemplate]="iconTemplate()"
|
|
1002
1235
|
/>
|
|
1003
1236
|
</a>
|
|
@@ -1007,7 +1240,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1007
1240
|
[class]="leafClasses(isActive())"
|
|
1008
1241
|
[disabled]="item().disabled || null"
|
|
1009
1242
|
[attr.aria-current]="isActive() ? 'page' : null"
|
|
1010
|
-
[attr.aria-label]="compactLabel()"
|
|
1243
|
+
[attr.aria-label]="item().badge?.source ? null : compactLabel()"
|
|
1011
1244
|
[attr.title]="titleFor()"
|
|
1012
1245
|
[Tooltip]="compact() ? (titleFor() ?? '') : ''"
|
|
1013
1246
|
[TooltipPosition]="tooltipPosition()"
|
|
@@ -1021,6 +1254,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1021
1254
|
[compact]="compact()"
|
|
1022
1255
|
[orientation]="orientation()"
|
|
1023
1256
|
[level]="level()"
|
|
1257
|
+
[badgeContext]="badgeContext()"
|
|
1024
1258
|
[iconTemplate]="iconTemplate()"
|
|
1025
1259
|
/>
|
|
1026
1260
|
</button>
|
|
@@ -1051,6 +1285,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1051
1285
|
[itemClass]="itemClass()"
|
|
1052
1286
|
[activeIds]="activeIds()"
|
|
1053
1287
|
[activeUrl]="activeUrl()"
|
|
1288
|
+
[badgeContext]="badgeContext()"
|
|
1054
1289
|
[iconTemplate]="iconTemplate()"
|
|
1055
1290
|
[tooltip-position]="tooltipPosition()"
|
|
1056
1291
|
[collapseTree]="collapseTree()"
|
|
@@ -1069,6 +1304,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1069
1304
|
}]
|
|
1070
1305
|
}],
|
|
1071
1306
|
propDecorators: {
|
|
1307
|
+
badgeContext: [{
|
|
1308
|
+
type: i0.Input,
|
|
1309
|
+
args: [{
|
|
1310
|
+
isSignal: true,
|
|
1311
|
+
alias: "badgeContext",
|
|
1312
|
+
required: false
|
|
1313
|
+
}]
|
|
1314
|
+
}],
|
|
1072
1315
|
navId: [{
|
|
1073
1316
|
type: i0.Input,
|
|
1074
1317
|
args: [{
|
|
@@ -1215,4 +1458,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1215
1458
|
}]
|
|
1216
1459
|
}
|
|
1217
1460
|
});
|
|
1218
|
-
export { navigationPanelId as n, NavigationItemContentComponent as r, NavigationItemComponent as t };
|
|
1461
|
+
export { NavigationItemBadgeComponent as i, navigationPanelId as n, NavigationItemContentComponent as r, NavigationItemComponent as t };
|