@ojiepermana/angular-navigation 22.0.44 → 22.0.45
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/README.md +9 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-BQgpBy1I.mjs +432 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-entry-grid.component-BY-DXx81.mjs +569 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-CACN0O3T.mjs +637 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-SK1lXswT.mjs +423 -0
- package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-SlMGlTuA.mjs +2225 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs +1 -4022
- package/package.json +2 -2
|
@@ -0,0 +1,2225 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TemplateRef, Directive, DestroyRef, signal, computed, effect, InjectionToken, input, model, output, contentChild, isDevMode, forwardRef, Component, booleanAttribute, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular-component/utils';
|
|
4
|
+
import { NavigationService } from '@ojiepermana/angular-navigation/service';
|
|
5
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
6
|
+
import { IconComponent } from '@ojiepermana/angular-component/icon';
|
|
7
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
8
|
+
|
|
9
|
+
class NavigationIconDirective {
|
|
10
|
+
template = inject(TemplateRef);
|
|
11
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
15
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: NavigationIconDirective, isStandalone: true, selector: "ng-template[NavigationIcon]", ngImport: i0 });
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationIconDirective, decorators: [{
|
|
18
|
+
type: Directive,
|
|
19
|
+
args: [{
|
|
20
|
+
selector: 'ng-template[NavigationIcon]',
|
|
21
|
+
}]
|
|
22
|
+
}] });
|
|
23
|
+
|
|
24
|
+
function normalizeType(type, hasChildren) {
|
|
25
|
+
if (type === 'divider' || type === 'spacer' || type === 'group' || type === 'mega') {
|
|
26
|
+
return type;
|
|
27
|
+
}
|
|
28
|
+
if (type === 'collapsible' || type === 'collapsable') {
|
|
29
|
+
return 'collapsible';
|
|
30
|
+
}
|
|
31
|
+
if (type === 'aside' && hasChildren) {
|
|
32
|
+
return 'collapsible';
|
|
33
|
+
}
|
|
34
|
+
if (!type && hasChildren) {
|
|
35
|
+
return 'collapsible';
|
|
36
|
+
}
|
|
37
|
+
return 'item';
|
|
38
|
+
}
|
|
39
|
+
function toKeyPart(value) {
|
|
40
|
+
return value
|
|
41
|
+
.toLowerCase()
|
|
42
|
+
.replace(/[^a-z0-9_-]+/g, '-')
|
|
43
|
+
.replace(/^-+|-+$/g, '');
|
|
44
|
+
}
|
|
45
|
+
function itemFallbackKey(item, index) {
|
|
46
|
+
return (toKeyPart(item.title ?? item.link?.toString() ?? item.href ?? `item-${index}`) ||
|
|
47
|
+
`item-${index}`);
|
|
48
|
+
}
|
|
49
|
+
function normalizeItem(item, index, path) {
|
|
50
|
+
if (item.isHidden?.(item)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const children = (item.children ?? [])
|
|
54
|
+
.map((child, childIndex) => normalizeItem(child, childIndex, `${path}-${childIndex}`))
|
|
55
|
+
.filter((child) => child !== null);
|
|
56
|
+
const hasChildren = children.length > 0;
|
|
57
|
+
const key = item.id ?? `${path}-${itemFallbackKey(item, index)}`;
|
|
58
|
+
return {
|
|
59
|
+
...item,
|
|
60
|
+
key,
|
|
61
|
+
stateId: item.id ?? key,
|
|
62
|
+
panelId: `nav-panel-${toKeyPart(key) || index}`,
|
|
63
|
+
type: normalizeType(item.type, hasChildren),
|
|
64
|
+
source: item,
|
|
65
|
+
children,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function normalizeUiNavItems(items) {
|
|
69
|
+
return items
|
|
70
|
+
.map((item, index) => normalizeItem(item, index, `nav-${index}`))
|
|
71
|
+
.filter((item) => item !== null);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function injectNavigationController(inputs) {
|
|
75
|
+
const nav = inject(NavigationService);
|
|
76
|
+
const destroyRef = inject(DestroyRef);
|
|
77
|
+
// Token unik per instance <Navigation> untuk validasi keunikan id di NavigationService.
|
|
78
|
+
const owner = {};
|
|
79
|
+
const registeredState = signal(null, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "registeredState" }] : /* istanbul ignore next */ []));
|
|
81
|
+
let previousRegisteredId = null;
|
|
82
|
+
const normalizedNavId = computed(() => normalizeId(inputs.navId()), /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "normalizedNavId" }] : /* istanbul ignore next */ []));
|
|
84
|
+
const collapsedPreference = computed(() => inputs.collapsed() ?? (inputs.compact() ? true : null), /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "collapsedPreference" }] : /* istanbul ignore next */ []));
|
|
86
|
+
const normalizedItems = computed(() => normalizeUiNavItems(inputs.data()), /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "normalizedItems" }] : /* istanbul ignore next */ []));
|
|
88
|
+
const fallbackState = computed(() => ({
|
|
89
|
+
id: normalizedNavId(),
|
|
90
|
+
orientation: inputs.orientation(),
|
|
91
|
+
type: fallbackType(inputs.orientation(), inputs.type()),
|
|
92
|
+
position: inputs.position() ?? (inputs.orientation() === 'horizontal' ? 'top' : 'left'),
|
|
93
|
+
collapsed: collapsedPreference() ?? false,
|
|
94
|
+
dockbarMode: inputs.dockbarMode() ?? 'sticky',
|
|
95
|
+
}), /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "fallbackState" }] : /* istanbul ignore next */ []));
|
|
97
|
+
const resolvedState = computed(() => nav.currentState(normalizedNavId()) ?? registeredState() ?? fallbackState(), /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "resolvedState" }] : /* istanbul ignore next */ []));
|
|
99
|
+
const activeIdSet = computed(() => {
|
|
100
|
+
const ids = inputs.activeIds();
|
|
101
|
+
if (!ids) {
|
|
102
|
+
return new Set();
|
|
103
|
+
}
|
|
104
|
+
return ids instanceof Set ? new Set(ids) : new Set(ids);
|
|
105
|
+
}, /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "activeIdSet" }] : /* istanbul ignore next */ []));
|
|
107
|
+
effect(() => {
|
|
108
|
+
if (!inputs.enabled()) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const nextState = nav.register({
|
|
112
|
+
id: normalizedNavId(),
|
|
113
|
+
orientation: inputs.orientation(),
|
|
114
|
+
type: inputs.type(),
|
|
115
|
+
position: inputs.position(),
|
|
116
|
+
collapsed: collapsedPreference(),
|
|
117
|
+
dockbarMode: inputs.dockbarMode(),
|
|
118
|
+
}, owner);
|
|
119
|
+
if (previousRegisteredId && previousRegisteredId !== nextState.id) {
|
|
120
|
+
nav.unregister(previousRegisteredId, owner);
|
|
121
|
+
}
|
|
122
|
+
previousRegisteredId = nextState.id;
|
|
123
|
+
registeredState.set(nextState);
|
|
124
|
+
});
|
|
125
|
+
destroyRef.onDestroy(() => {
|
|
126
|
+
if (previousRegisteredId) {
|
|
127
|
+
nav.unregister(previousRegisteredId, owner);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
normalizedNavId,
|
|
132
|
+
normalizedItems,
|
|
133
|
+
resolvedState,
|
|
134
|
+
activeIdSet,
|
|
135
|
+
toggleCollapsed: () => nav.toggleCollapsed(normalizedNavId()),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function normalizeId(value) {
|
|
139
|
+
return value.trim() || 'default';
|
|
140
|
+
}
|
|
141
|
+
function fallbackType(orientation, type) {
|
|
142
|
+
if (orientation === 'vertical' && (type === 'sidebar' || type === 'dockbar')) {
|
|
143
|
+
return type;
|
|
144
|
+
}
|
|
145
|
+
if (orientation === 'horizontal' && (type === 'navbar' || type === 'flyout')) {
|
|
146
|
+
return type;
|
|
147
|
+
}
|
|
148
|
+
return orientation === 'horizontal' ? 'navbar' : 'sidebar';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const NAVIGATION_SHELL = new InjectionToken('NAVIGATION_SHELL');
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Container navigasi deklaratif. Type ditentukan oleh komponen anak:
|
|
155
|
+
*
|
|
156
|
+
* ```html
|
|
157
|
+
* <Navigation id="main" [data]="items">
|
|
158
|
+
* <NavigationSidebar>
|
|
159
|
+
* <NavigationHeader>…</NavigationHeader>
|
|
160
|
+
* <NavigationContent />
|
|
161
|
+
* <NavigationFooter>…</NavigationFooter>
|
|
162
|
+
* </NavigationSidebar>
|
|
163
|
+
* </Navigation>
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* Header dan footer opsional; `NavigationContent` selalu dirender oleh
|
|
167
|
+
* type (default otomatis bila tidak diproyeksikan).
|
|
168
|
+
*/
|
|
169
|
+
class NavigationContainerComponent {
|
|
170
|
+
navId = input('default', { ...(ngDevMode ? { debugName: "navId" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
171
|
+
data = input([], /* @ts-ignore */
|
|
172
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
173
|
+
ariaLabel = input('Primary navigation', /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
175
|
+
compact = input(false, /* @ts-ignore */
|
|
176
|
+
...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
177
|
+
collapseTree = input('stairs', { ...(ngDevMode ? { debugName: "collapseTree" } : /* istanbul ignore next */ {}), alias: 'collapse-tree' });
|
|
178
|
+
class = input('', /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
180
|
+
itemClass = input('', /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "itemClass" }] : /* istanbul ignore next */ []));
|
|
182
|
+
/** Kelas Tailwind untuk container `<li>` group horizontal (flyout tab / navbar group). */
|
|
183
|
+
groupClass = input('', { ...(ngDevMode ? { debugName: "groupClass" } : /* istanbul ignore next */ {}), alias: 'nav-group-class' });
|
|
184
|
+
activeIds = input(null, /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "activeIds" }] : /* istanbul ignore next */ []));
|
|
186
|
+
activeUrl = input(null, /* @ts-ignore */
|
|
187
|
+
...(ngDevMode ? [{ debugName: "activeUrl" }] : /* istanbul ignore next */ []));
|
|
188
|
+
openedIds = model([], /* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [{ debugName: "openedIds" }] : /* istanbul ignore next */ []));
|
|
190
|
+
itemSelected = output();
|
|
191
|
+
nav = inject(NavigationService);
|
|
192
|
+
destroyRef = inject(DestroyRef);
|
|
193
|
+
hoverPreviewExpanded = signal(false, /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "hoverPreviewExpanded" }] : /* istanbul ignore next */ []));
|
|
195
|
+
/** Konfigurasi type aktif yang didaftarkan wrapper anak (sidebar/dockbar/navbar/flyout). */
|
|
196
|
+
typeConfig = signal(null, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "typeConfig" }] : /* istanbul ignore next */ []));
|
|
198
|
+
orientationPreference = computed(() => this.typeConfig()?.orientation ?? 'vertical', /* @ts-ignore */
|
|
199
|
+
...(ngDevMode ? [{ debugName: "orientationPreference" }] : /* istanbul ignore next */ []));
|
|
200
|
+
typePreference = computed(() => this.typeConfig()?.type ?? null, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "typePreference" }] : /* istanbul ignore next */ []));
|
|
202
|
+
positionPreference = computed(() => this.typeConfig()?.position?.() ?? null, /* @ts-ignore */
|
|
203
|
+
...(ngDevMode ? [{ debugName: "positionPreference" }] : /* istanbul ignore next */ []));
|
|
204
|
+
collapsedPreference = computed(() => this.typeConfig()?.collapsed?.() ?? null, /* @ts-ignore */
|
|
205
|
+
...(ngDevMode ? [{ debugName: "collapsedPreference" }] : /* istanbul ignore next */ []));
|
|
206
|
+
dockbarModePreference = computed(() => this.typeConfig()?.dockbarMode?.() ?? null, /* @ts-ignore */
|
|
207
|
+
...(ngDevMode ? [{ debugName: "dockbarModePreference" }] : /* istanbul ignore next */ []));
|
|
208
|
+
sidebarCollapse = computed(() => this.typeConfig()?.sidebarCollapse?.() ?? false, /* @ts-ignore */
|
|
209
|
+
...(ngDevMode ? [{ debugName: "sidebarCollapse" }] : /* istanbul ignore next */ []));
|
|
210
|
+
previewExpanded = computed(() => this.typeConfig()?.previewExpanded?.() ?? false, /* @ts-ignore */
|
|
211
|
+
...(ngDevMode ? [{ debugName: "previewExpanded" }] : /* istanbul ignore next */ []));
|
|
212
|
+
typeStyle = computed(() => this.typeConfig()?.typeStyle?.() ?? 'flat', /* @ts-ignore */
|
|
213
|
+
...(ngDevMode ? [{ debugName: "typeStyle" }] : /* istanbul ignore next */ []));
|
|
214
|
+
flyoutLabel = computed(() => this.typeConfig()?.flyoutLabel?.() ?? 'Menu', /* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [{ debugName: "flyoutLabel" }] : /* istanbul ignore next */ []));
|
|
216
|
+
flyoutIcon = computed(() => this.typeConfig()?.flyoutIcon?.() ?? null, /* @ts-ignore */
|
|
217
|
+
...(ngDevMode ? [{ debugName: "flyoutIcon" }] : /* istanbul ignore next */ []));
|
|
218
|
+
flyoutIconOnly = computed(() => this.typeConfig()?.flyoutIconOnly?.() ?? false, /* @ts-ignore */
|
|
219
|
+
...(ngDevMode ? [{ debugName: "flyoutIconOnly" }] : /* istanbul ignore next */ []));
|
|
220
|
+
flyoutIconPosition = computed(() => this.typeConfig()?.flyoutIconPosition?.() ?? 'start', /* @ts-ignore */
|
|
221
|
+
...(ngDevMode ? [{ debugName: "flyoutIconPosition" }] : /* istanbul ignore next */ []));
|
|
222
|
+
flyoutTriggerVariant = computed(() => this.typeConfig()?.flyoutTriggerVariant?.() ?? 'button', /* @ts-ignore */
|
|
223
|
+
...(ngDevMode ? [{ debugName: "flyoutTriggerVariant" }] : /* istanbul ignore next */ []));
|
|
224
|
+
flyoutTriggerFloating = computed(() => this.typeConfig()?.flyoutTriggerFloating?.() ?? false, /* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "flyoutTriggerFloating" }] : /* istanbul ignore next */ []));
|
|
226
|
+
flyoutTriggerClass = computed(() => this.typeConfig()?.flyoutTriggerClass?.() ?? '', /* @ts-ignore */
|
|
227
|
+
...(ngDevMode ? [{ debugName: "flyoutTriggerClass" }] : /* istanbul ignore next */ []));
|
|
228
|
+
controller = injectNavigationController({
|
|
229
|
+
navId: this.navId,
|
|
230
|
+
data: this.data,
|
|
231
|
+
orientation: this.orientationPreference,
|
|
232
|
+
type: this.typePreference,
|
|
233
|
+
position: this.positionPreference,
|
|
234
|
+
collapsed: this.collapsedPreference,
|
|
235
|
+
dockbarMode: this.dockbarModePreference,
|
|
236
|
+
compact: this.compact,
|
|
237
|
+
activeIds: this.activeIds,
|
|
238
|
+
enabled: computed(() => this.typeConfig() !== null),
|
|
239
|
+
});
|
|
240
|
+
iconTemplate = contentChild(NavigationIconDirective, /* @ts-ignore */
|
|
241
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
242
|
+
normalizedItems = this.controller.normalizedItems;
|
|
243
|
+
resolvedState = this.controller.resolvedState;
|
|
244
|
+
activeIdSet = this.controller.activeIdSet;
|
|
245
|
+
previewRailExpanded = computed(() => {
|
|
246
|
+
const state = this.resolvedState();
|
|
247
|
+
if (state.orientation !== 'vertical' || state.type !== 'sidebar' || !state.collapsed) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
return this.previewExpanded() || (this.sidebarCollapse() && this.hoverPreviewExpanded());
|
|
251
|
+
}, /* @ts-ignore */
|
|
252
|
+
...(ngDevMode ? [{ debugName: "previewRailExpanded" }] : /* istanbul ignore next */ []));
|
|
253
|
+
previewRailOffset = computed(() => (this.previewRailExpanded() ? '15rem' : '0px'), /* @ts-ignore */
|
|
254
|
+
...(ngDevMode ? [{ debugName: "previewRailOffset" }] : /* istanbul ignore next */ []));
|
|
255
|
+
displayState = computed(() => {
|
|
256
|
+
const state = this.resolvedState();
|
|
257
|
+
if (state.type === 'dockbar') {
|
|
258
|
+
return { ...state, collapsed: true };
|
|
259
|
+
}
|
|
260
|
+
return this.previewRailExpanded() ? { ...state, collapsed: false } : state;
|
|
261
|
+
}, /* @ts-ignore */
|
|
262
|
+
...(ngDevMode ? [{ debugName: "displayState" }] : /* istanbul ignore next */ []));
|
|
263
|
+
dockbarAsideOpen = computed(() => {
|
|
264
|
+
const state = this.resolvedState();
|
|
265
|
+
if (state.type !== 'dockbar' || state.dockbarMode !== 'sticky') {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
return (this.nav.resolveDockbarGroup(state.id, this.normalizedItems(), state.dockbarMode, this.activeIdSet(), this.activeUrl()) !== null);
|
|
269
|
+
}, /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "dockbarAsideOpen" }] : /* istanbul ignore next */ []));
|
|
271
|
+
collapseEnabled = computed(() => {
|
|
272
|
+
const state = this.resolvedState();
|
|
273
|
+
return this.sidebarCollapse() && state.orientation === 'vertical' && state.type === 'sidebar';
|
|
274
|
+
}, /* @ts-ignore */
|
|
275
|
+
...(ngDevMode ? [{ debugName: "collapseEnabled" }] : /* istanbul ignore next */ []));
|
|
276
|
+
/** Kelas shell yang dipakai host komponen type (eks `div` shell internal). */
|
|
277
|
+
shellClasses = computed(() => cn('flex h-full min-h-0 transition-[width,box-shadow,transform] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none', this.resolvedState().orientation === 'horizontal'
|
|
278
|
+
? 'flex-row items-stretch overflow-visible'
|
|
279
|
+
: this.resolvedState().type === 'dockbar'
|
|
280
|
+
? 'flex-col overflow-visible'
|
|
281
|
+
: 'flex-col overflow-hidden', this.resolvedState().type === 'dockbar' && [
|
|
282
|
+
'w-16 shrink-0',
|
|
283
|
+
this.resolvedState().position === 'right' && 'ml-auto',
|
|
284
|
+
], this.resolvedState().position === 'right' ? 'origin-right' : 'origin-left', this.previewRailExpanded() && [
|
|
285
|
+
'absolute inset-y-0 z-20 w-76 overflow-hidden bg-background shadow-xl',
|
|
286
|
+
this.resolvedState().position === 'right'
|
|
287
|
+
? 'right-0 border-l border-[hsl(var(--border)/var(--opacity-70))]'
|
|
288
|
+
: 'left-0 border-r border-[hsl(var(--border)/var(--opacity-70))]',
|
|
289
|
+
]), /* @ts-ignore */
|
|
290
|
+
...(ngDevMode ? [{ debugName: "shellClasses" }] : /* istanbul ignore next */ []));
|
|
291
|
+
state = this.resolvedState;
|
|
292
|
+
hostClasses = computed(() => cn('relative block min-h-0 text-foreground transition-[width] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none', this.resolvedState().orientation === 'horizontal'
|
|
293
|
+
? 'h-full w-full'
|
|
294
|
+
: this.resolvedState().type === 'dockbar'
|
|
295
|
+
? this.dockbarAsideOpen()
|
|
296
|
+
? 'w-76'
|
|
297
|
+
: 'w-16'
|
|
298
|
+
: this.resolvedState().collapsed
|
|
299
|
+
? 'w-16'
|
|
300
|
+
: 'w-76', this.resolvedState().orientation === 'horizontal' ||
|
|
301
|
+
this.resolvedState().type === 'dockbar' ||
|
|
302
|
+
this.previewRailExpanded()
|
|
303
|
+
? 'overflow-visible'
|
|
304
|
+
: 'overflow-hidden', this.class()), /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
306
|
+
constructor() {
|
|
307
|
+
// Publikasikan data ke registry by id agar surface lain (mis. apps-launcher di `Page`)
|
|
308
|
+
// bisa membaca nav by id tanpa mendaftarkan ulang `<Navigation>` dengan id yang sama.
|
|
309
|
+
effect(() => this.nav.publishData(this.navId(), this.data()));
|
|
310
|
+
this.destroyRef.onDestroy(() => this.nav.clearData(this.navId()));
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Dipanggil komponen type saat dibuat. Satu `<Navigation>` hanya boleh
|
|
314
|
+
* memuat satu type hidup — pendaftaran ganda dianggap salah konfigurasi.
|
|
315
|
+
*/
|
|
316
|
+
registerType(config) {
|
|
317
|
+
if (this.typeConfig() !== null && isDevMode()) {
|
|
318
|
+
throw new Error('[Navigation] Hanya satu type (<NavigationSidebar>/<NavigationDockbar>/<NavigationNavbar>/<NavigationFlyout>) yang boleh hidup dalam satu <Navigation>.');
|
|
319
|
+
}
|
|
320
|
+
this.typeConfig.set(config);
|
|
321
|
+
}
|
|
322
|
+
unregisterType(config) {
|
|
323
|
+
if (this.typeConfig() === config) {
|
|
324
|
+
this.typeConfig.set(null);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
toggleCollapsed() {
|
|
328
|
+
this.controller.toggleCollapsed();
|
|
329
|
+
}
|
|
330
|
+
setHoverPreview(value) {
|
|
331
|
+
this.hoverPreviewExpanded.set(this.sidebarCollapse() ? value : false);
|
|
332
|
+
}
|
|
333
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
334
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.4", type: NavigationContainerComponent, isStandalone: true, selector: "Navigation", inputs: { navId: { classPropertyName: "navId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, collapseTree: { classPropertyName: "collapseTree", publicName: "collapse-tree", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, itemClass: { classPropertyName: "itemClass", publicName: "itemClass", isSignal: true, isRequired: false, transformFunction: null }, groupClass: { classPropertyName: "groupClass", publicName: "nav-group-class", isSignal: true, isRequired: false, transformFunction: null }, activeIds: { classPropertyName: "activeIds", publicName: "activeIds", isSignal: true, isRequired: false, transformFunction: null }, activeUrl: { classPropertyName: "activeUrl", publicName: "activeUrl", isSignal: true, isRequired: false, transformFunction: null }, openedIds: { classPropertyName: "openedIds", publicName: "openedIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedIds: "openedIdsChange", itemSelected: "itemSelected" }, host: { attributes: { "role": "navigation" }, listeners: { "mouseenter": "setHoverPreview(true)", "mouseleave": "setHoverPreview(false)" }, properties: { "class": "hostClasses()", "attr.aria-label": "ariaLabel() || null", "attr.data-navigation-id": "resolvedState().id", "attr.data-orientation": "resolvedState().orientation", "attr.data-type": "resolvedState().type", "attr.data-type-style": "typeStyle()", "attr.data-position": "resolvedState().position", "attr.data-collapse-tree": "collapseTree()", "attr.data-preview-expanded": "previewRailExpanded() ? \"true\" : null" } }, providers: [
|
|
335
|
+
{ provide: NAVIGATION_SHELL, useExisting: forwardRef(() => NavigationContainerComponent) },
|
|
336
|
+
], queries: [{ propertyName: "iconTemplate", first: true, predicate: NavigationIconDirective, descendants: true, isSignal: true }], ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
337
|
+
}
|
|
338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationContainerComponent, decorators: [{
|
|
339
|
+
type: Component,
|
|
340
|
+
args: [{
|
|
341
|
+
selector: 'Navigation',
|
|
342
|
+
providers: [
|
|
343
|
+
{ provide: NAVIGATION_SHELL, useExisting: forwardRef(() => NavigationContainerComponent) },
|
|
344
|
+
],
|
|
345
|
+
host: {
|
|
346
|
+
'[class]': 'hostClasses()',
|
|
347
|
+
role: 'navigation',
|
|
348
|
+
'[attr.aria-label]': 'ariaLabel() || null',
|
|
349
|
+
'[attr.data-navigation-id]': 'resolvedState().id',
|
|
350
|
+
'[attr.data-orientation]': 'resolvedState().orientation',
|
|
351
|
+
'[attr.data-type]': 'resolvedState().type',
|
|
352
|
+
'[attr.data-type-style]': 'typeStyle()',
|
|
353
|
+
'[attr.data-position]': 'resolvedState().position',
|
|
354
|
+
'[attr.data-collapse-tree]': 'collapseTree()',
|
|
355
|
+
'[attr.data-preview-expanded]': 'previewRailExpanded() ? "true" : null',
|
|
356
|
+
'(mouseenter)': 'setHoverPreview(true)',
|
|
357
|
+
'(mouseleave)': 'setHoverPreview(false)',
|
|
358
|
+
},
|
|
359
|
+
template: ` <ng-content /> `,
|
|
360
|
+
}]
|
|
361
|
+
}], ctorParameters: () => [], propDecorators: { navId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], collapseTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapse-tree", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], itemClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemClass", required: false }] }], groupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-group-class", required: false }] }], activeIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIds", required: false }] }], activeUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeUrl", required: false }] }], openedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "openedIds", required: false }] }, { type: i0.Output, args: ["openedIdsChange"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], iconTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationIconDirective), { isSignal: true }] }] } });
|
|
362
|
+
|
|
363
|
+
class NavigationItemContentComponent {
|
|
364
|
+
nav = inject(NavigationService);
|
|
365
|
+
item = input.required(/* @ts-ignore */
|
|
366
|
+
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
367
|
+
active = input(false, /* @ts-ignore */
|
|
368
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
369
|
+
compact = input(false, /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
371
|
+
orientation = input('vertical', /* @ts-ignore */
|
|
372
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
373
|
+
level = input(0, /* @ts-ignore */
|
|
374
|
+
...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
|
|
375
|
+
collapseTree = input('stairs', /* @ts-ignore */
|
|
376
|
+
...(ngDevMode ? [{ debugName: "collapseTree" }] : /* istanbul ignore next */ []));
|
|
377
|
+
iconTemplate = input(undefined, /* @ts-ignore */
|
|
378
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
379
|
+
iconSlotClasses = computed(() => cn('relative z-10 inline-flex shrink-0 items-center justify-center transition-[border-color,background-color,color,box-shadow] duration-200', this.orientation() === 'vertical'
|
|
380
|
+
? this.compact()
|
|
381
|
+
? 'h-8 w-8 rounded-full border'
|
|
382
|
+
: 'h-7 w-7 rounded-full border'
|
|
383
|
+
: 'h-5 w-5 rounded-full border border-transparent', this.usesStraightVerticalSurface() &&
|
|
384
|
+
'overflow-hidden bg-background/85 backdrop-blur-sm border-transparent', this.active() && !this.usesStraightVerticalSurface()
|
|
385
|
+
? 'border-primary text-current'
|
|
386
|
+
: 'border-transparent', this.active() && this.usesStraightVerticalSurface() && 'text-current', this.compact() && 'mx-auto'), /* @ts-ignore */
|
|
387
|
+
...(ngDevMode ? [{ debugName: "iconSlotClasses" }] : /* istanbul ignore next */ []));
|
|
388
|
+
titleClasses = computed(() => cn('block truncate', this.active() && 'font-semibold text-foreground', this.item().classes?.title), /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "titleClasses" }] : /* istanbul ignore next */ []));
|
|
390
|
+
showSubtitle = computed(() => !!this.item().subtitle && !(this.orientation() === 'horizontal' && this.level() === 0), /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "showSubtitle" }] : /* istanbul ignore next */ []));
|
|
392
|
+
subtitleClasses = computed(() => cn('block truncate text-xs font-normal text-muted-foreground', this.item().classes?.subtitle), /* @ts-ignore */
|
|
393
|
+
...(ngDevMode ? [{ debugName: "subtitleClasses" }] : /* istanbul ignore next */ []));
|
|
394
|
+
compactFallbackClasses = computed(() => cn('inline-flex h-5 min-w-5 items-center justify-center text-xs font-semibold uppercase'), /* @ts-ignore */
|
|
395
|
+
...(ngDevMode ? [{ debugName: "compactFallbackClasses" }] : /* istanbul ignore next */ []));
|
|
396
|
+
defaultBadgeClasses = computed(() => cn('nav-badge ml-auto inline-flex h-5 shrink-0 items-center rounded-full px-2', this.active() ? 'bg-background text-foreground' : 'bg-muted text-muted-foreground'), /* @ts-ignore */
|
|
397
|
+
...(ngDevMode ? [{ debugName: "defaultBadgeClasses" }] : /* istanbul ignore next */ []));
|
|
398
|
+
defaultIconSize = computed(() => this.usesStraightVerticalSurface() ? 18 : 16, /* @ts-ignore */
|
|
399
|
+
...(ngDevMode ? [{ debugName: "defaultIconSize" }] : /* istanbul ignore next */ []));
|
|
400
|
+
defaultIconClasses = computed(() => cn('text-current', this.item().classes?.icon), /* @ts-ignore */
|
|
401
|
+
...(ngDevMode ? [{ debugName: "defaultIconClasses" }] : /* istanbul ignore next */ []));
|
|
402
|
+
iconContext = computed(() => this.nav.iconContext(this.item(), this.active(), this.level(), this.orientation()), /* @ts-ignore */
|
|
403
|
+
...(ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []));
|
|
404
|
+
compactFallback() {
|
|
405
|
+
return this.nav.compactFallback(this.item());
|
|
406
|
+
}
|
|
407
|
+
usesStraightVerticalSurface() {
|
|
408
|
+
return (this.orientation() === 'vertical' && !this.compact() && this.collapseTree() === 'straight');
|
|
409
|
+
}
|
|
410
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationItemContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
411
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationItemContentComponent, isStandalone: true, selector: "NavigationItemContent", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, collapseTree: { classPropertyName: "collapseTree", publicName: "collapseTree", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: `
|
|
412
|
+
@if (item().icon; as iconName) {
|
|
413
|
+
<span data-navigation-icon-slot="true" [class]="iconSlotClasses()">
|
|
414
|
+
@if (iconTemplate(); as customIcon) {
|
|
415
|
+
<ng-container
|
|
416
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
417
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
418
|
+
/>
|
|
419
|
+
} @else {
|
|
420
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" [size]="defaultIconSize()" />
|
|
421
|
+
}
|
|
422
|
+
</span>
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@if (!compact()) {
|
|
426
|
+
<span class="min-w-0 flex-1">
|
|
427
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
428
|
+
@if (showSubtitle()) {
|
|
429
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
430
|
+
}
|
|
431
|
+
</span>
|
|
432
|
+
|
|
433
|
+
@if (item().badge; as badge) {
|
|
434
|
+
<span [class]="badge.classes ?? defaultBadgeClasses()">{{ badge.title }}</span>
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
@if (compact() && !item().icon) {
|
|
439
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
440
|
+
}
|
|
441
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }] });
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationItemContentComponent, decorators: [{
|
|
444
|
+
type: Component,
|
|
445
|
+
args: [{
|
|
446
|
+
selector: 'NavigationItemContent',
|
|
447
|
+
imports: [NgTemplateOutlet, IconComponent],
|
|
448
|
+
host: {
|
|
449
|
+
class: 'contents',
|
|
450
|
+
},
|
|
451
|
+
template: `
|
|
452
|
+
@if (item().icon; as iconName) {
|
|
453
|
+
<span data-navigation-icon-slot="true" [class]="iconSlotClasses()">
|
|
454
|
+
@if (iconTemplate(); as customIcon) {
|
|
455
|
+
<ng-container
|
|
456
|
+
[ngTemplateOutlet]="customIcon.template"
|
|
457
|
+
[ngTemplateOutletContext]="iconContext()"
|
|
458
|
+
/>
|
|
459
|
+
} @else {
|
|
460
|
+
<Icon [name]="iconName" [class]="defaultIconClasses()" [size]="defaultIconSize()" />
|
|
461
|
+
}
|
|
462
|
+
</span>
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
@if (!compact()) {
|
|
466
|
+
<span class="min-w-0 flex-1">
|
|
467
|
+
<span [class]="titleClasses()">{{ item().title }}</span>
|
|
468
|
+
@if (showSubtitle()) {
|
|
469
|
+
<span [class]="subtitleClasses()">{{ item().subtitle }}</span>
|
|
470
|
+
}
|
|
471
|
+
</span>
|
|
472
|
+
|
|
473
|
+
@if (item().badge; as badge) {
|
|
474
|
+
<span [class]="badge.classes ?? defaultBadgeClasses()">{{ badge.title }}</span>
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@if (compact() && !item().icon) {
|
|
479
|
+
<span aria-hidden="true" [class]="compactFallbackClasses()">{{ compactFallback() }}</span>
|
|
480
|
+
}
|
|
481
|
+
`,
|
|
482
|
+
}]
|
|
483
|
+
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], collapseTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseTree", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }] } });
|
|
484
|
+
|
|
485
|
+
class NavigationItemComponent {
|
|
486
|
+
nav = inject(NavigationService);
|
|
487
|
+
navId = input('default', /* @ts-ignore */
|
|
488
|
+
...(ngDevMode ? [{ debugName: "navId" }] : /* istanbul ignore next */ []));
|
|
489
|
+
item = input.required(/* @ts-ignore */
|
|
490
|
+
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
491
|
+
level = input(0, /* @ts-ignore */
|
|
492
|
+
...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
|
|
493
|
+
orientation = input('vertical', /* @ts-ignore */
|
|
494
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
495
|
+
compact = input(false, /* @ts-ignore */
|
|
496
|
+
...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
497
|
+
itemClass = input('', /* @ts-ignore */
|
|
498
|
+
...(ngDevMode ? [{ debugName: "itemClass" }] : /* istanbul ignore next */ []));
|
|
499
|
+
activeIds = input(new Set(), /* @ts-ignore */
|
|
500
|
+
...(ngDevMode ? [{ debugName: "activeIds" }] : /* istanbul ignore next */ []));
|
|
501
|
+
activeUrl = input(null, /* @ts-ignore */
|
|
502
|
+
...(ngDevMode ? [{ debugName: "activeUrl" }] : /* istanbul ignore next */ []));
|
|
503
|
+
iconTemplate = input(undefined, /* @ts-ignore */
|
|
504
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
505
|
+
collapseTree = input('stairs', /* @ts-ignore */
|
|
506
|
+
...(ngDevMode ? [{ debugName: "collapseTree" }] : /* istanbul ignore next */ []));
|
|
507
|
+
straightRail = input(false, /* @ts-ignore */
|
|
508
|
+
...(ngDevMode ? [{ debugName: "straightRail" }] : /* istanbul ignore next */ []));
|
|
509
|
+
straightRailActive = input(false, /* @ts-ignore */
|
|
510
|
+
...(ngDevMode ? [{ debugName: "straightRailActive" }] : /* istanbul ignore next */ []));
|
|
511
|
+
firstInBranch = input(false, /* @ts-ignore */
|
|
512
|
+
...(ngDevMode ? [{ debugName: "firstInBranch" }] : /* istanbul ignore next */ []));
|
|
513
|
+
lastInBranch = input(false, /* @ts-ignore */
|
|
514
|
+
...(ngDevMode ? [{ debugName: "lastInBranch" }] : /* istanbul ignore next */ []));
|
|
515
|
+
openedIds = input([], /* @ts-ignore */
|
|
516
|
+
...(ngDevMode ? [{ debugName: "openedIds" }] : /* istanbul ignore next */ []));
|
|
517
|
+
openedIdsChange = output();
|
|
518
|
+
itemSelected = output();
|
|
519
|
+
openedIdSet = computed(() => new Set(this.openedIds()), /* @ts-ignore */
|
|
520
|
+
...(ngDevMode ? [{ debugName: "openedIdSet" }] : /* istanbul ignore next */ []));
|
|
521
|
+
isHorizontalRoot = computed(() => this.orientation() === 'horizontal' && this.level() === 0, /* @ts-ignore */
|
|
522
|
+
...(ngDevMode ? [{ debugName: "isHorizontalRoot" }] : /* istanbul ignore next */ []));
|
|
523
|
+
isActive = computed(() => this.nav.isItemActive(this.item(), this.activeIds(), this.activeUrl()), /* @ts-ignore */
|
|
524
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
525
|
+
showChildren = computed(() => !this.compact() && this.isOpen(), /* @ts-ignore */
|
|
526
|
+
...(ngDevMode ? [{ debugName: "showChildren" }] : /* istanbul ignore next */ []));
|
|
527
|
+
hostClasses = computed(() => {
|
|
528
|
+
if (this.item().type === 'divider') {
|
|
529
|
+
return this.dividerClasses();
|
|
530
|
+
}
|
|
531
|
+
if (this.item().type === 'spacer') {
|
|
532
|
+
return 'flex-1';
|
|
533
|
+
}
|
|
534
|
+
if (this.item().type === 'group' || this.item().type === 'mega') {
|
|
535
|
+
return this.groupContainerClasses();
|
|
536
|
+
}
|
|
537
|
+
return this.itemContainerClasses();
|
|
538
|
+
}, /* @ts-ignore */
|
|
539
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
540
|
+
hostRole = computed(() => {
|
|
541
|
+
if (this.item().type === 'divider') {
|
|
542
|
+
return 'separator';
|
|
543
|
+
}
|
|
544
|
+
return this.orientation() === 'horizontal' ? 'none' : null;
|
|
545
|
+
}, /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []));
|
|
547
|
+
headingId = computed(() => `${this.item().panelId}-heading`, /* @ts-ignore */
|
|
548
|
+
...(ngDevMode ? [{ debugName: "headingId" }] : /* istanbul ignore next */ []));
|
|
549
|
+
isRouterItem() {
|
|
550
|
+
return this.nav.isRouterItem(this.item());
|
|
551
|
+
}
|
|
552
|
+
hrefFor() {
|
|
553
|
+
return this.nav.hrefFor(this.item());
|
|
554
|
+
}
|
|
555
|
+
relFor() {
|
|
556
|
+
return this.nav.relFor(this.item());
|
|
557
|
+
}
|
|
558
|
+
routerLinkActiveOptions() {
|
|
559
|
+
return this.nav.routerLinkActiveOptions(this.item());
|
|
560
|
+
}
|
|
561
|
+
itemRole() {
|
|
562
|
+
return this.nav.itemRole(this.orientation(), this.level());
|
|
563
|
+
}
|
|
564
|
+
compactLabel() {
|
|
565
|
+
return this.nav.compactLabel(this.item(), this.compact());
|
|
566
|
+
}
|
|
567
|
+
titleFor() {
|
|
568
|
+
return this.nav.titleFor(this.item(), this.compact());
|
|
569
|
+
}
|
|
570
|
+
isOpen() {
|
|
571
|
+
return (this.openedIdSet().has(this.item().stateId) ||
|
|
572
|
+
this.openedIdSet().has(this.item().key) ||
|
|
573
|
+
this.isActive());
|
|
574
|
+
}
|
|
575
|
+
toggleOpen() {
|
|
576
|
+
if (this.item().disabled) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const next = new Set(this.openedIds());
|
|
580
|
+
if (next.has(this.item().stateId)) {
|
|
581
|
+
next.delete(this.item().stateId);
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
next.add(this.item().stateId);
|
|
585
|
+
}
|
|
586
|
+
this.openedIdsChange.emit([...next]);
|
|
587
|
+
}
|
|
588
|
+
selectItem(event) {
|
|
589
|
+
if (this.item().disabled) {
|
|
590
|
+
event.preventDefault();
|
|
591
|
+
event.stopPropagation();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
this.item().action?.(this.item().source);
|
|
595
|
+
this.itemSelected.emit({
|
|
596
|
+
item: this.item().source,
|
|
597
|
+
key: this.item().key,
|
|
598
|
+
type: this.item().type,
|
|
599
|
+
link: this.item().link,
|
|
600
|
+
external: !!this.hrefFor(),
|
|
601
|
+
});
|
|
602
|
+
this.nav.closePanel(this.navId());
|
|
603
|
+
this.nav.closeDrawer(this.navId());
|
|
604
|
+
}
|
|
605
|
+
leafClasses(active) {
|
|
606
|
+
return cn('NavigationItem nav-text group/nav inline-flex min-w-0 items-center rounded-md font-medium transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring', this.orientation() === 'horizontal' && this.level() === 0
|
|
607
|
+
? 'h-9 px-3 py-2'
|
|
608
|
+
: 'w-full px-3 py-1.5 text-left', this.orientation() === 'horizontal' && this.level() === 0 ? 'gap-3' : 'gap-1.5', this.compact() && 'h-10 w-10 justify-center gap-0 px-0 text-center', this.interactiveStateClasses(active), this.item().disabled && 'pointer-events-none opacity-50', this.item().classes?.wrapper, this.itemClass());
|
|
609
|
+
}
|
|
610
|
+
triggerClasses(active) {
|
|
611
|
+
return cn('nav-trigger nav-text group/nav inline-flex min-w-0 items-center rounded-md font-medium transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50', this.orientation() === 'horizontal' && this.level() === 0
|
|
612
|
+
? 'h-9 px-3 py-2'
|
|
613
|
+
: 'w-full px-3 py-1.5 text-left', this.orientation() === 'horizontal' && this.level() === 0 ? 'gap-3' : 'gap-1.5', this.compact() && 'h-10 w-10 justify-center gap-0 px-0 text-center', this.interactiveStateClasses(active), this.item().classes?.wrapper, this.itemClass());
|
|
614
|
+
}
|
|
615
|
+
interactiveStateClasses(active) {
|
|
616
|
+
const showsNestedActiveConnector = active &&
|
|
617
|
+
this.orientation() === 'vertical' &&
|
|
618
|
+
!this.compact() &&
|
|
619
|
+
this.level() > 1 &&
|
|
620
|
+
this.collapseTree() === 'stairs';
|
|
621
|
+
if (this.orientation() === 'vertical' && !this.compact()) {
|
|
622
|
+
return cn('relative isolate', "before:pointer-events-none before:absolute before:inset-y-0 before:left-2 before:right-2 before:-z-10 before:rounded-md before:border before:border-transparent before:bg-transparent before:transition-colors before:duration-200 before:content-['']", showsNestedActiveConnector &&
|
|
623
|
+
"after:pointer-events-none after:absolute after:-left-2 after:top-1/2 after:-z-10 after:h-px after:w-5 after:-translate-y-1/2 after:rounded-full after:bg-current/25 after:content-['']", active
|
|
624
|
+
? 'font-semibold text-foreground hover:before:border-primary'
|
|
625
|
+
: 'text-foreground/80 hover:text-accent-foreground hover:before:border-primary hover:before:bg-accent');
|
|
626
|
+
}
|
|
627
|
+
return active
|
|
628
|
+
? 'font-semibold text-foreground'
|
|
629
|
+
: 'text-foreground/80 hover:bg-accent hover:text-accent-foreground';
|
|
630
|
+
}
|
|
631
|
+
chevronClasses() {
|
|
632
|
+
return cn('ml-auto shrink-0 self-center transition-transform duration-200', this.isOpen() && 'rotate-90');
|
|
633
|
+
}
|
|
634
|
+
itemContainerClasses() {
|
|
635
|
+
return cn(this.orientation() === 'horizontal' && this.level() === 0 ? 'relative' : 'w-full', this.compact() && 'flex justify-center', this.straightRailClasses());
|
|
636
|
+
}
|
|
637
|
+
groupContainerClasses() {
|
|
638
|
+
return cn('w-full', this.level() > 0 && 'pt-2');
|
|
639
|
+
}
|
|
640
|
+
dividerClasses() {
|
|
641
|
+
return cn(this.orientation() === 'horizontal' && this.level() === 0
|
|
642
|
+
? 'mx-1 h-5 w-px'
|
|
643
|
+
: 'my-2 w-full px-2');
|
|
644
|
+
}
|
|
645
|
+
groupHeadingClasses() {
|
|
646
|
+
return cn('nav-heading px-3 py-2 text-muted-foreground', this.item().classes?.title);
|
|
647
|
+
}
|
|
648
|
+
childListClasses() {
|
|
649
|
+
const isGroupedBranch = this.item().type === 'group' || this.item().type === 'mega';
|
|
650
|
+
const usesStairsTree = this.collapseTree() === 'stairs';
|
|
651
|
+
return cn('flex list-none flex-col gap-0.5 p-0', !this.compact() && 'mt-0.5', this.level() >= 0 &&
|
|
652
|
+
!this.compact() &&
|
|
653
|
+
!isGroupedBranch &&
|
|
654
|
+
usesStairsTree &&
|
|
655
|
+
cn("relative ml-[1.625rem] pl-2 before:absolute before:-top-2 before:bottom-0 before:left-0 before:w-px before:-translate-x-1/2 before:rounded-full before:content-['']", this.isActive() ? 'before:bg-current/25' : 'before:bg-border'));
|
|
656
|
+
}
|
|
657
|
+
showStraightRailForChildren() {
|
|
658
|
+
return (!this.compact() &&
|
|
659
|
+
this.collapseTree() === 'straight' &&
|
|
660
|
+
this.item().type !== 'group' &&
|
|
661
|
+
this.item().type !== 'mega');
|
|
662
|
+
}
|
|
663
|
+
straightRailClasses() {
|
|
664
|
+
if (!this.straightRail() || this.orientation() !== 'vertical' || this.compact()) {
|
|
665
|
+
return '';
|
|
666
|
+
}
|
|
667
|
+
return cn('relative', "before:pointer-events-none before:absolute before:left-[1.625rem] before:w-0 before:-z-10 before:border-l before:border-dotted before:content-['']", this.straightRailActive() ? 'before:border-primary/50' : 'before:border-border/50', this.firstInBranch() ? 'before:-top-9' : 'before:-top-0.5', this.lastInBranch() ? 'before:bottom-[calc(100%-1.25rem)]' : 'before:-bottom-0.5');
|
|
668
|
+
}
|
|
669
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationItemComponent, isStandalone: true, selector: "li[NavigationItem]", inputs: { navId: { classPropertyName: "navId", publicName: "navId", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, itemClass: { classPropertyName: "itemClass", publicName: "itemClass", isSignal: true, isRequired: false, transformFunction: null }, activeIds: { classPropertyName: "activeIds", publicName: "activeIds", isSignal: true, isRequired: false, transformFunction: null }, activeUrl: { classPropertyName: "activeUrl", publicName: "activeUrl", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null }, collapseTree: { classPropertyName: "collapseTree", publicName: "collapseTree", isSignal: true, isRequired: false, transformFunction: null }, straightRail: { classPropertyName: "straightRail", publicName: "straightRail", isSignal: true, isRequired: false, transformFunction: null }, straightRailActive: { classPropertyName: "straightRailActive", publicName: "straightRailActive", isSignal: true, isRequired: false, transformFunction: null }, firstInBranch: { classPropertyName: "firstInBranch", publicName: "firstInBranch", isSignal: true, isRequired: false, transformFunction: null }, lastInBranch: { classPropertyName: "lastInBranch", publicName: "lastInBranch", isSignal: true, isRequired: false, transformFunction: null }, openedIds: { classPropertyName: "openedIds", publicName: "openedIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedIdsChange: "openedIdsChange", itemSelected: "itemSelected" }, host: { properties: { "class": "hostClasses()", "attr.role": "hostRole()", "attr.data-navigation-item-key": "item().key", "attr.aria-hidden": "item().type === \"spacer\" ? \"true\" : null" } }, ngImport: i0, template: `
|
|
671
|
+
@switch (item().type) {
|
|
672
|
+
@case ('divider') {
|
|
673
|
+
<span class="block h-px w-full bg-border"></span>
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
@case ('spacer') {}
|
|
677
|
+
|
|
678
|
+
@case ('group') {
|
|
679
|
+
@if (!compact() && item().title) {
|
|
680
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">{{ item().title }}</div>
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
<ul
|
|
684
|
+
[class]="childListClasses()"
|
|
685
|
+
role="group"
|
|
686
|
+
[attr.aria-labelledby]="item().title ? headingId() : null"
|
|
687
|
+
>
|
|
688
|
+
@for (
|
|
689
|
+
child of item().children;
|
|
690
|
+
track child.key;
|
|
691
|
+
let isFirst = $first;
|
|
692
|
+
let isLast = $last
|
|
693
|
+
) {
|
|
694
|
+
<li
|
|
695
|
+
NavigationItem
|
|
696
|
+
[navId]="navId()"
|
|
697
|
+
[item]="child"
|
|
698
|
+
[level]="level() + 1"
|
|
699
|
+
[orientation]="orientation()"
|
|
700
|
+
[compact]="compact()"
|
|
701
|
+
[itemClass]="itemClass()"
|
|
702
|
+
[activeIds]="activeIds()"
|
|
703
|
+
[activeUrl]="activeUrl()"
|
|
704
|
+
[iconTemplate]="iconTemplate()"
|
|
705
|
+
[collapseTree]="collapseTree()"
|
|
706
|
+
[straightRail]="showStraightRailForChildren()"
|
|
707
|
+
[straightRailActive]="isActive()"
|
|
708
|
+
[firstInBranch]="isFirst"
|
|
709
|
+
[lastInBranch]="isLast"
|
|
710
|
+
[openedIds]="openedIds()"
|
|
711
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
712
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
713
|
+
></li>
|
|
714
|
+
}
|
|
715
|
+
</ul>
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
@case ('collapsible') {
|
|
719
|
+
<button
|
|
720
|
+
type="button"
|
|
721
|
+
[class]="triggerClasses(isActive())"
|
|
722
|
+
[attr.aria-expanded]="isOpen()"
|
|
723
|
+
[attr.aria-controls]="item().panelId"
|
|
724
|
+
[attr.aria-label]="compactLabel()"
|
|
725
|
+
[attr.title]="titleFor()"
|
|
726
|
+
[disabled]="item().disabled || null"
|
|
727
|
+
(click)="toggleOpen()"
|
|
728
|
+
>
|
|
729
|
+
<NavigationItemContent
|
|
730
|
+
[item]="item()"
|
|
731
|
+
[active]="isActive()"
|
|
732
|
+
[compact]="compact()"
|
|
733
|
+
[orientation]="orientation()"
|
|
734
|
+
[level]="level()"
|
|
735
|
+
[collapseTree]="collapseTree()"
|
|
736
|
+
[iconTemplate]="iconTemplate()"
|
|
737
|
+
/>
|
|
738
|
+
|
|
739
|
+
@if (!compact()) {
|
|
740
|
+
<Icon name="chevron_right" [size]="16" [class]="chevronClasses()" />
|
|
741
|
+
}
|
|
742
|
+
</button>
|
|
743
|
+
|
|
744
|
+
@if (showChildren()) {
|
|
745
|
+
<ul [id]="item().panelId" [class]="childListClasses()" role="group">
|
|
746
|
+
@for (
|
|
747
|
+
child of item().children;
|
|
748
|
+
track child.key;
|
|
749
|
+
let isFirst = $first;
|
|
750
|
+
let isLast = $last
|
|
751
|
+
) {
|
|
752
|
+
<li
|
|
753
|
+
NavigationItem
|
|
754
|
+
[navId]="navId()"
|
|
755
|
+
[item]="child"
|
|
756
|
+
[level]="level() + 1"
|
|
757
|
+
[orientation]="orientation()"
|
|
758
|
+
[compact]="false"
|
|
759
|
+
[itemClass]="itemClass()"
|
|
760
|
+
[activeIds]="activeIds()"
|
|
761
|
+
[activeUrl]="activeUrl()"
|
|
762
|
+
[iconTemplate]="iconTemplate()"
|
|
763
|
+
[collapseTree]="collapseTree()"
|
|
764
|
+
[straightRail]="showStraightRailForChildren()"
|
|
765
|
+
[straightRailActive]="isActive()"
|
|
766
|
+
[firstInBranch]="isFirst"
|
|
767
|
+
[lastInBranch]="isLast"
|
|
768
|
+
[openedIds]="openedIds()"
|
|
769
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
770
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
771
|
+
></li>
|
|
772
|
+
}
|
|
773
|
+
</ul>
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
@case ('mega') {
|
|
778
|
+
@if (!compact() && item().title) {
|
|
779
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">{{ item().title }}</div>
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
<ul
|
|
783
|
+
[class]="childListClasses()"
|
|
784
|
+
role="group"
|
|
785
|
+
[attr.aria-labelledby]="item().title ? headingId() : null"
|
|
786
|
+
>
|
|
787
|
+
@for (
|
|
788
|
+
child of item().children;
|
|
789
|
+
track child.key;
|
|
790
|
+
let isFirst = $first;
|
|
791
|
+
let isLast = $last
|
|
792
|
+
) {
|
|
793
|
+
<li
|
|
794
|
+
NavigationItem
|
|
795
|
+
[navId]="navId()"
|
|
796
|
+
[item]="child"
|
|
797
|
+
[level]="level() + 1"
|
|
798
|
+
[orientation]="orientation()"
|
|
799
|
+
[compact]="compact()"
|
|
800
|
+
[itemClass]="itemClass()"
|
|
801
|
+
[activeIds]="activeIds()"
|
|
802
|
+
[activeUrl]="activeUrl()"
|
|
803
|
+
[iconTemplate]="iconTemplate()"
|
|
804
|
+
[collapseTree]="collapseTree()"
|
|
805
|
+
[straightRail]="showStraightRailForChildren()"
|
|
806
|
+
[straightRailActive]="isActive()"
|
|
807
|
+
[firstInBranch]="isFirst"
|
|
808
|
+
[lastInBranch]="isLast"
|
|
809
|
+
[openedIds]="openedIds()"
|
|
810
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
811
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
812
|
+
></li>
|
|
813
|
+
}
|
|
814
|
+
</ul>
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
@default {
|
|
818
|
+
@if (isRouterItem()) {
|
|
819
|
+
<a
|
|
820
|
+
[class]="leafClasses(routerActive.isActive || isActive())"
|
|
821
|
+
[routerLink]="item().link ?? null"
|
|
822
|
+
[queryParams]="item().queryParams ?? null"
|
|
823
|
+
[queryParamsHandling]="item().queryParamsHandling ?? null"
|
|
824
|
+
[fragment]="item().fragment ?? undefined"
|
|
825
|
+
[preserveFragment]="item().preserveFragment ?? false"
|
|
826
|
+
[target]="item().target ?? undefined"
|
|
827
|
+
routerLinkActive
|
|
828
|
+
#routerActive="routerLinkActive"
|
|
829
|
+
[routerLinkActiveOptions]="routerLinkActiveOptions()"
|
|
830
|
+
[attr.aria-current]="routerActive.isActive || isActive() ? 'page' : null"
|
|
831
|
+
[attr.aria-disabled]="item().disabled || null"
|
|
832
|
+
[attr.aria-label]="compactLabel()"
|
|
833
|
+
[attr.title]="titleFor()"
|
|
834
|
+
[attr.role]="itemRole()"
|
|
835
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
836
|
+
(click)="selectItem($event)"
|
|
837
|
+
>
|
|
838
|
+
<NavigationItemContent
|
|
839
|
+
[item]="item()"
|
|
840
|
+
[active]="routerActive.isActive || isActive()"
|
|
841
|
+
[compact]="compact()"
|
|
842
|
+
[orientation]="orientation()"
|
|
843
|
+
[level]="level()"
|
|
844
|
+
[collapseTree]="collapseTree()"
|
|
845
|
+
[iconTemplate]="iconTemplate()"
|
|
846
|
+
/>
|
|
847
|
+
</a>
|
|
848
|
+
} @else if (hrefFor()) {
|
|
849
|
+
<a
|
|
850
|
+
[class]="leafClasses(isActive())"
|
|
851
|
+
[attr.href]="hrefFor()"
|
|
852
|
+
[attr.target]="item().target ?? (item().externalLink ? '_blank' : null)"
|
|
853
|
+
[attr.rel]="relFor()"
|
|
854
|
+
[attr.aria-current]="isActive() ? 'page' : null"
|
|
855
|
+
[attr.aria-disabled]="item().disabled || null"
|
|
856
|
+
[attr.aria-label]="compactLabel()"
|
|
857
|
+
[attr.title]="titleFor()"
|
|
858
|
+
[attr.role]="itemRole()"
|
|
859
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
860
|
+
(click)="selectItem($event)"
|
|
861
|
+
>
|
|
862
|
+
<NavigationItemContent
|
|
863
|
+
[item]="item()"
|
|
864
|
+
[active]="isActive()"
|
|
865
|
+
[compact]="compact()"
|
|
866
|
+
[orientation]="orientation()"
|
|
867
|
+
[level]="level()"
|
|
868
|
+
[collapseTree]="collapseTree()"
|
|
869
|
+
[iconTemplate]="iconTemplate()"
|
|
870
|
+
/>
|
|
871
|
+
</a>
|
|
872
|
+
} @else {
|
|
873
|
+
<button
|
|
874
|
+
type="button"
|
|
875
|
+
[class]="leafClasses(isActive())"
|
|
876
|
+
[disabled]="item().disabled || null"
|
|
877
|
+
[attr.aria-current]="isActive() ? 'page' : null"
|
|
878
|
+
[attr.aria-label]="compactLabel()"
|
|
879
|
+
[attr.title]="titleFor()"
|
|
880
|
+
[attr.role]="itemRole()"
|
|
881
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
882
|
+
(click)="selectItem($event)"
|
|
883
|
+
>
|
|
884
|
+
<NavigationItemContent
|
|
885
|
+
[item]="item()"
|
|
886
|
+
[active]="isActive()"
|
|
887
|
+
[compact]="compact()"
|
|
888
|
+
[orientation]="orientation()"
|
|
889
|
+
[level]="level()"
|
|
890
|
+
[collapseTree]="collapseTree()"
|
|
891
|
+
[iconTemplate]="iconTemplate()"
|
|
892
|
+
/>
|
|
893
|
+
</button>
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationItemComponent, selector: "li[NavigationItem]", inputs: ["navId", "item", "level", "orientation", "compact", "itemClass", "activeIds", "activeUrl", "iconTemplate", "collapseTree", "straightRail", "straightRailActive", "firstInBranch", "lastInBranch", "openedIds"], outputs: ["openedIdsChange", "itemSelected"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }, { kind: "component", type: NavigationItemContentComponent, selector: "NavigationItemContent", inputs: ["item", "active", "compact", "orientation", "level", "collapseTree", "iconTemplate"] }] });
|
|
898
|
+
}
|
|
899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationItemComponent, decorators: [{
|
|
900
|
+
type: Component,
|
|
901
|
+
args: [{
|
|
902
|
+
selector: 'li[NavigationItem]',
|
|
903
|
+
imports: [RouterLink, RouterLinkActive, IconComponent, NavigationItemContentComponent],
|
|
904
|
+
host: {
|
|
905
|
+
'[class]': 'hostClasses()',
|
|
906
|
+
'[attr.role]': 'hostRole()',
|
|
907
|
+
'[attr.data-navigation-item-key]': 'item().key',
|
|
908
|
+
'[attr.aria-hidden]': 'item().type === "spacer" ? "true" : null',
|
|
909
|
+
},
|
|
910
|
+
template: `
|
|
911
|
+
@switch (item().type) {
|
|
912
|
+
@case ('divider') {
|
|
913
|
+
<span class="block h-px w-full bg-border"></span>
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
@case ('spacer') {}
|
|
917
|
+
|
|
918
|
+
@case ('group') {
|
|
919
|
+
@if (!compact() && item().title) {
|
|
920
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">{{ item().title }}</div>
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
<ul
|
|
924
|
+
[class]="childListClasses()"
|
|
925
|
+
role="group"
|
|
926
|
+
[attr.aria-labelledby]="item().title ? headingId() : null"
|
|
927
|
+
>
|
|
928
|
+
@for (
|
|
929
|
+
child of item().children;
|
|
930
|
+
track child.key;
|
|
931
|
+
let isFirst = $first;
|
|
932
|
+
let isLast = $last
|
|
933
|
+
) {
|
|
934
|
+
<li
|
|
935
|
+
NavigationItem
|
|
936
|
+
[navId]="navId()"
|
|
937
|
+
[item]="child"
|
|
938
|
+
[level]="level() + 1"
|
|
939
|
+
[orientation]="orientation()"
|
|
940
|
+
[compact]="compact()"
|
|
941
|
+
[itemClass]="itemClass()"
|
|
942
|
+
[activeIds]="activeIds()"
|
|
943
|
+
[activeUrl]="activeUrl()"
|
|
944
|
+
[iconTemplate]="iconTemplate()"
|
|
945
|
+
[collapseTree]="collapseTree()"
|
|
946
|
+
[straightRail]="showStraightRailForChildren()"
|
|
947
|
+
[straightRailActive]="isActive()"
|
|
948
|
+
[firstInBranch]="isFirst"
|
|
949
|
+
[lastInBranch]="isLast"
|
|
950
|
+
[openedIds]="openedIds()"
|
|
951
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
952
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
953
|
+
></li>
|
|
954
|
+
}
|
|
955
|
+
</ul>
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
@case ('collapsible') {
|
|
959
|
+
<button
|
|
960
|
+
type="button"
|
|
961
|
+
[class]="triggerClasses(isActive())"
|
|
962
|
+
[attr.aria-expanded]="isOpen()"
|
|
963
|
+
[attr.aria-controls]="item().panelId"
|
|
964
|
+
[attr.aria-label]="compactLabel()"
|
|
965
|
+
[attr.title]="titleFor()"
|
|
966
|
+
[disabled]="item().disabled || null"
|
|
967
|
+
(click)="toggleOpen()"
|
|
968
|
+
>
|
|
969
|
+
<NavigationItemContent
|
|
970
|
+
[item]="item()"
|
|
971
|
+
[active]="isActive()"
|
|
972
|
+
[compact]="compact()"
|
|
973
|
+
[orientation]="orientation()"
|
|
974
|
+
[level]="level()"
|
|
975
|
+
[collapseTree]="collapseTree()"
|
|
976
|
+
[iconTemplate]="iconTemplate()"
|
|
977
|
+
/>
|
|
978
|
+
|
|
979
|
+
@if (!compact()) {
|
|
980
|
+
<Icon name="chevron_right" [size]="16" [class]="chevronClasses()" />
|
|
981
|
+
}
|
|
982
|
+
</button>
|
|
983
|
+
|
|
984
|
+
@if (showChildren()) {
|
|
985
|
+
<ul [id]="item().panelId" [class]="childListClasses()" role="group">
|
|
986
|
+
@for (
|
|
987
|
+
child of item().children;
|
|
988
|
+
track child.key;
|
|
989
|
+
let isFirst = $first;
|
|
990
|
+
let isLast = $last
|
|
991
|
+
) {
|
|
992
|
+
<li
|
|
993
|
+
NavigationItem
|
|
994
|
+
[navId]="navId()"
|
|
995
|
+
[item]="child"
|
|
996
|
+
[level]="level() + 1"
|
|
997
|
+
[orientation]="orientation()"
|
|
998
|
+
[compact]="false"
|
|
999
|
+
[itemClass]="itemClass()"
|
|
1000
|
+
[activeIds]="activeIds()"
|
|
1001
|
+
[activeUrl]="activeUrl()"
|
|
1002
|
+
[iconTemplate]="iconTemplate()"
|
|
1003
|
+
[collapseTree]="collapseTree()"
|
|
1004
|
+
[straightRail]="showStraightRailForChildren()"
|
|
1005
|
+
[straightRailActive]="isActive()"
|
|
1006
|
+
[firstInBranch]="isFirst"
|
|
1007
|
+
[lastInBranch]="isLast"
|
|
1008
|
+
[openedIds]="openedIds()"
|
|
1009
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
1010
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
1011
|
+
></li>
|
|
1012
|
+
}
|
|
1013
|
+
</ul>
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
@case ('mega') {
|
|
1018
|
+
@if (!compact() && item().title) {
|
|
1019
|
+
<div [id]="headingId()" [class]="groupHeadingClasses()">{{ item().title }}</div>
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
<ul
|
|
1023
|
+
[class]="childListClasses()"
|
|
1024
|
+
role="group"
|
|
1025
|
+
[attr.aria-labelledby]="item().title ? headingId() : null"
|
|
1026
|
+
>
|
|
1027
|
+
@for (
|
|
1028
|
+
child of item().children;
|
|
1029
|
+
track child.key;
|
|
1030
|
+
let isFirst = $first;
|
|
1031
|
+
let isLast = $last
|
|
1032
|
+
) {
|
|
1033
|
+
<li
|
|
1034
|
+
NavigationItem
|
|
1035
|
+
[navId]="navId()"
|
|
1036
|
+
[item]="child"
|
|
1037
|
+
[level]="level() + 1"
|
|
1038
|
+
[orientation]="orientation()"
|
|
1039
|
+
[compact]="compact()"
|
|
1040
|
+
[itemClass]="itemClass()"
|
|
1041
|
+
[activeIds]="activeIds()"
|
|
1042
|
+
[activeUrl]="activeUrl()"
|
|
1043
|
+
[iconTemplate]="iconTemplate()"
|
|
1044
|
+
[collapseTree]="collapseTree()"
|
|
1045
|
+
[straightRail]="showStraightRailForChildren()"
|
|
1046
|
+
[straightRailActive]="isActive()"
|
|
1047
|
+
[firstInBranch]="isFirst"
|
|
1048
|
+
[lastInBranch]="isLast"
|
|
1049
|
+
[openedIds]="openedIds()"
|
|
1050
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
1051
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
1052
|
+
></li>
|
|
1053
|
+
}
|
|
1054
|
+
</ul>
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
@default {
|
|
1058
|
+
@if (isRouterItem()) {
|
|
1059
|
+
<a
|
|
1060
|
+
[class]="leafClasses(routerActive.isActive || isActive())"
|
|
1061
|
+
[routerLink]="item().link ?? null"
|
|
1062
|
+
[queryParams]="item().queryParams ?? null"
|
|
1063
|
+
[queryParamsHandling]="item().queryParamsHandling ?? null"
|
|
1064
|
+
[fragment]="item().fragment ?? undefined"
|
|
1065
|
+
[preserveFragment]="item().preserveFragment ?? false"
|
|
1066
|
+
[target]="item().target ?? undefined"
|
|
1067
|
+
routerLinkActive
|
|
1068
|
+
#routerActive="routerLinkActive"
|
|
1069
|
+
[routerLinkActiveOptions]="routerLinkActiveOptions()"
|
|
1070
|
+
[attr.aria-current]="routerActive.isActive || isActive() ? 'page' : null"
|
|
1071
|
+
[attr.aria-disabled]="item().disabled || null"
|
|
1072
|
+
[attr.aria-label]="compactLabel()"
|
|
1073
|
+
[attr.title]="titleFor()"
|
|
1074
|
+
[attr.role]="itemRole()"
|
|
1075
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
1076
|
+
(click)="selectItem($event)"
|
|
1077
|
+
>
|
|
1078
|
+
<NavigationItemContent
|
|
1079
|
+
[item]="item()"
|
|
1080
|
+
[active]="routerActive.isActive || isActive()"
|
|
1081
|
+
[compact]="compact()"
|
|
1082
|
+
[orientation]="orientation()"
|
|
1083
|
+
[level]="level()"
|
|
1084
|
+
[collapseTree]="collapseTree()"
|
|
1085
|
+
[iconTemplate]="iconTemplate()"
|
|
1086
|
+
/>
|
|
1087
|
+
</a>
|
|
1088
|
+
} @else if (hrefFor()) {
|
|
1089
|
+
<a
|
|
1090
|
+
[class]="leafClasses(isActive())"
|
|
1091
|
+
[attr.href]="hrefFor()"
|
|
1092
|
+
[attr.target]="item().target ?? (item().externalLink ? '_blank' : null)"
|
|
1093
|
+
[attr.rel]="relFor()"
|
|
1094
|
+
[attr.aria-current]="isActive() ? 'page' : null"
|
|
1095
|
+
[attr.aria-disabled]="item().disabled || null"
|
|
1096
|
+
[attr.aria-label]="compactLabel()"
|
|
1097
|
+
[attr.title]="titleFor()"
|
|
1098
|
+
[attr.role]="itemRole()"
|
|
1099
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
1100
|
+
(click)="selectItem($event)"
|
|
1101
|
+
>
|
|
1102
|
+
<NavigationItemContent
|
|
1103
|
+
[item]="item()"
|
|
1104
|
+
[active]="isActive()"
|
|
1105
|
+
[compact]="compact()"
|
|
1106
|
+
[orientation]="orientation()"
|
|
1107
|
+
[level]="level()"
|
|
1108
|
+
[collapseTree]="collapseTree()"
|
|
1109
|
+
[iconTemplate]="iconTemplate()"
|
|
1110
|
+
/>
|
|
1111
|
+
</a>
|
|
1112
|
+
} @else {
|
|
1113
|
+
<button
|
|
1114
|
+
type="button"
|
|
1115
|
+
[class]="leafClasses(isActive())"
|
|
1116
|
+
[disabled]="item().disabled || null"
|
|
1117
|
+
[attr.aria-current]="isActive() ? 'page' : null"
|
|
1118
|
+
[attr.aria-label]="compactLabel()"
|
|
1119
|
+
[attr.title]="titleFor()"
|
|
1120
|
+
[attr.role]="itemRole()"
|
|
1121
|
+
[attr.data-navigation-root-item]="isHorizontalRoot() ? 'true' : null"
|
|
1122
|
+
(click)="selectItem($event)"
|
|
1123
|
+
>
|
|
1124
|
+
<NavigationItemContent
|
|
1125
|
+
[item]="item()"
|
|
1126
|
+
[active]="isActive()"
|
|
1127
|
+
[compact]="compact()"
|
|
1128
|
+
[orientation]="orientation()"
|
|
1129
|
+
[level]="level()"
|
|
1130
|
+
[collapseTree]="collapseTree()"
|
|
1131
|
+
[iconTemplate]="iconTemplate()"
|
|
1132
|
+
/>
|
|
1133
|
+
</button>
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
`,
|
|
1138
|
+
}]
|
|
1139
|
+
}], propDecorators: { navId: [{ type: i0.Input, args: [{ isSignal: true, alias: "navId", required: false }] }], item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], itemClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemClass", required: false }] }], activeIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIds", required: false }] }], activeUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeUrl", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], collapseTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseTree", required: false }] }], straightRail: [{ type: i0.Input, args: [{ isSignal: true, alias: "straightRail", required: false }] }], straightRailActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "straightRailActive", required: false }] }], firstInBranch: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstInBranch", required: false }] }], lastInBranch: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastInBranch", required: false }] }], openedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "openedIds", required: false }] }], openedIdsChange: [{ type: i0.Output, args: ["openedIdsChange"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }] } });
|
|
1140
|
+
|
|
1141
|
+
class NavigationListComponent {
|
|
1142
|
+
navId = input('default', /* @ts-ignore */
|
|
1143
|
+
...(ngDevMode ? [{ debugName: "navId" }] : /* istanbul ignore next */ []));
|
|
1144
|
+
items = input([], /* @ts-ignore */
|
|
1145
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1146
|
+
collapsed = input(false, /* @ts-ignore */
|
|
1147
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
1148
|
+
compact = input(false, /* @ts-ignore */
|
|
1149
|
+
...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
1150
|
+
position = input('left', /* @ts-ignore */
|
|
1151
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1152
|
+
itemClass = input('', /* @ts-ignore */
|
|
1153
|
+
...(ngDevMode ? [{ debugName: "itemClass" }] : /* istanbul ignore next */ []));
|
|
1154
|
+
activeIds = input(new Set(), /* @ts-ignore */
|
|
1155
|
+
...(ngDevMode ? [{ debugName: "activeIds" }] : /* istanbul ignore next */ []));
|
|
1156
|
+
activeUrl = input(null, /* @ts-ignore */
|
|
1157
|
+
...(ngDevMode ? [{ debugName: "activeUrl" }] : /* istanbul ignore next */ []));
|
|
1158
|
+
iconTemplate = input(undefined, /* @ts-ignore */
|
|
1159
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
1160
|
+
collapseTree = input('stairs', /* @ts-ignore */
|
|
1161
|
+
...(ngDevMode ? [{ debugName: "collapseTree" }] : /* istanbul ignore next */ []));
|
|
1162
|
+
openedIds = input([], /* @ts-ignore */
|
|
1163
|
+
...(ngDevMode ? [{ debugName: "openedIds" }] : /* istanbul ignore next */ []));
|
|
1164
|
+
openedIdsChange = output();
|
|
1165
|
+
itemSelected = output();
|
|
1166
|
+
isCollapsed = computed(() => this.collapsed() || this.compact(), /* @ts-ignore */
|
|
1167
|
+
...(ngDevMode ? [{ debugName: "isCollapsed" }] : /* istanbul ignore next */ []));
|
|
1168
|
+
hostClasses = computed(() => cn('block', this.position() === 'right' && 'items-end text-right'), /* @ts-ignore */
|
|
1169
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1170
|
+
listClasses = computed(() => this.isCollapsed()
|
|
1171
|
+
? cn('flex list-none flex-col items-center gap-0.5 p-0')
|
|
1172
|
+
: cn('flex list-none flex-col gap-0.5 p-0', this.position() === 'right' && 'items-end'), /* @ts-ignore */
|
|
1173
|
+
...(ngDevMode ? [{ debugName: "listClasses" }] : /* istanbul ignore next */ []));
|
|
1174
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1175
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationListComponent, isStandalone: true, selector: "NavigationList", inputs: { navId: { classPropertyName: "navId", publicName: "navId", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, itemClass: { classPropertyName: "itemClass", publicName: "itemClass", isSignal: true, isRequired: false, transformFunction: null }, activeIds: { classPropertyName: "activeIds", publicName: "activeIds", isSignal: true, isRequired: false, transformFunction: null }, activeUrl: { classPropertyName: "activeUrl", publicName: "activeUrl", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null }, collapseTree: { classPropertyName: "collapseTree", publicName: "collapseTree", isSignal: true, isRequired: false, transformFunction: null }, openedIds: { classPropertyName: "openedIds", publicName: "openedIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedIdsChange: "openedIdsChange", itemSelected: "itemSelected" }, host: { properties: { "class": "hostClasses()", "attr.data-position": "position()" } }, ngImport: i0, template: `
|
|
1176
|
+
<ul [class]="listClasses()" role="list">
|
|
1177
|
+
@for (item of items(); track item.key) {
|
|
1178
|
+
<li
|
|
1179
|
+
NavigationItem
|
|
1180
|
+
[navId]="navId()"
|
|
1181
|
+
[item]="item"
|
|
1182
|
+
[level]="0"
|
|
1183
|
+
[orientation]="'vertical'"
|
|
1184
|
+
[compact]="isCollapsed()"
|
|
1185
|
+
[itemClass]="itemClass()"
|
|
1186
|
+
[activeIds]="activeIds()"
|
|
1187
|
+
[activeUrl]="activeUrl()"
|
|
1188
|
+
[iconTemplate]="iconTemplate()"
|
|
1189
|
+
[collapseTree]="collapseTree()"
|
|
1190
|
+
[openedIds]="openedIds()"
|
|
1191
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
1192
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
1193
|
+
></li>
|
|
1194
|
+
}
|
|
1195
|
+
</ul>
|
|
1196
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationItemComponent, selector: "li[NavigationItem]", inputs: ["navId", "item", "level", "orientation", "compact", "itemClass", "activeIds", "activeUrl", "iconTemplate", "collapseTree", "straightRail", "straightRailActive", "firstInBranch", "lastInBranch", "openedIds"], outputs: ["openedIdsChange", "itemSelected"] }] });
|
|
1197
|
+
}
|
|
1198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationListComponent, decorators: [{
|
|
1199
|
+
type: Component,
|
|
1200
|
+
args: [{
|
|
1201
|
+
selector: 'NavigationList',
|
|
1202
|
+
imports: [NavigationItemComponent],
|
|
1203
|
+
host: {
|
|
1204
|
+
'[class]': 'hostClasses()',
|
|
1205
|
+
'[attr.data-position]': 'position()',
|
|
1206
|
+
},
|
|
1207
|
+
template: `
|
|
1208
|
+
<ul [class]="listClasses()" role="list">
|
|
1209
|
+
@for (item of items(); track item.key) {
|
|
1210
|
+
<li
|
|
1211
|
+
NavigationItem
|
|
1212
|
+
[navId]="navId()"
|
|
1213
|
+
[item]="item"
|
|
1214
|
+
[level]="0"
|
|
1215
|
+
[orientation]="'vertical'"
|
|
1216
|
+
[compact]="isCollapsed()"
|
|
1217
|
+
[itemClass]="itemClass()"
|
|
1218
|
+
[activeIds]="activeIds()"
|
|
1219
|
+
[activeUrl]="activeUrl()"
|
|
1220
|
+
[iconTemplate]="iconTemplate()"
|
|
1221
|
+
[collapseTree]="collapseTree()"
|
|
1222
|
+
[openedIds]="openedIds()"
|
|
1223
|
+
(openedIdsChange)="openedIdsChange.emit($event)"
|
|
1224
|
+
(itemSelected)="itemSelected.emit($event)"
|
|
1225
|
+
></li>
|
|
1226
|
+
}
|
|
1227
|
+
</ul>
|
|
1228
|
+
`,
|
|
1229
|
+
}]
|
|
1230
|
+
}], propDecorators: { navId: [{ type: i0.Input, args: [{ isSignal: true, alias: "navId", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], itemClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemClass", required: false }] }], activeIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIds", required: false }] }], activeUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeUrl", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], collapseTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseTree", required: false }] }], openedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "openedIds", required: false }] }], openedIdsChange: [{ type: i0.Output, args: ["openedIdsChange"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }] } });
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Area konten navigasi: merender daftar item sesuai type aktif dari
|
|
1234
|
+
* `<Navigation>` induk. Selalu hadir di setiap type — komponen type
|
|
1235
|
+
* merender default-nya bila consumer tidak memproyeksikan `<NavigationContent />`.
|
|
1236
|
+
*/
|
|
1237
|
+
class NavigationContentComponent {
|
|
1238
|
+
container = inject(NavigationContainerComponent);
|
|
1239
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1240
|
+
hostClasses = computed(() => cn('min-h-0 flex-1', this.container.displayState().orientation === 'horizontal'
|
|
1241
|
+
? 'flex h-full min-w-0 items-stretch justify-center overflow-visible'
|
|
1242
|
+
: 'block overflow-y-auto overflow-x-hidden py-2', this.class()), /* @ts-ignore */
|
|
1243
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1244
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1245
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationContentComponent, isStandalone: true, selector: "NavigationContent", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
|
|
1246
|
+
@let navState = container.displayState();
|
|
1247
|
+
|
|
1248
|
+
@if (navState.orientation === 'horizontal' && navState.type === 'flyout') {
|
|
1249
|
+
<!-- Less-common renderers are code-split: a sidebar-only app never bundles them. -->
|
|
1250
|
+
@defer (on immediate) {
|
|
1251
|
+
<NavigationFlyoutMenu
|
|
1252
|
+
[navId]="navState.id"
|
|
1253
|
+
[items]="container.normalizedItems()"
|
|
1254
|
+
[label]="container.flyoutLabel()"
|
|
1255
|
+
[icon]="container.flyoutIcon()"
|
|
1256
|
+
[iconOnly]="container.flyoutIconOnly()"
|
|
1257
|
+
[iconPosition]="container.flyoutIconPosition()"
|
|
1258
|
+
[variant]="container.flyoutTriggerVariant()"
|
|
1259
|
+
[floating]="container.flyoutTriggerFloating()"
|
|
1260
|
+
[triggerClass]="container.flyoutTriggerClass()"
|
|
1261
|
+
[position]="navState.position"
|
|
1262
|
+
[typeStyle]="container.typeStyle()"
|
|
1263
|
+
[compact]="container.compact()"
|
|
1264
|
+
[itemClass]="container.itemClass()"
|
|
1265
|
+
[groupClass]="container.groupClass()"
|
|
1266
|
+
[activeIds]="container.activeIdSet()"
|
|
1267
|
+
[activeUrl]="container.activeUrl()"
|
|
1268
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1269
|
+
[collapseTree]="container.collapseTree()"
|
|
1270
|
+
[openedIds]="container.openedIds()"
|
|
1271
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1272
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1273
|
+
>
|
|
1274
|
+
<ng-content select="NavigationHeader" ngProjectAs="NavigationHeader" />
|
|
1275
|
+
<ng-content select="NavigationFooter" ngProjectAs="NavigationFooter" />
|
|
1276
|
+
</NavigationFlyoutMenu>
|
|
1277
|
+
}
|
|
1278
|
+
} @else if (navState.orientation === 'horizontal') {
|
|
1279
|
+
@defer (on immediate) {
|
|
1280
|
+
<NavigationHorizontal
|
|
1281
|
+
[navId]="navState.id"
|
|
1282
|
+
[items]="container.normalizedItems()"
|
|
1283
|
+
[position]="navState.position"
|
|
1284
|
+
[typeStyle]="container.typeStyle()"
|
|
1285
|
+
[compact]="container.compact()"
|
|
1286
|
+
[itemClass]="container.itemClass()"
|
|
1287
|
+
[groupClass]="container.groupClass()"
|
|
1288
|
+
[activeIds]="container.activeIdSet()"
|
|
1289
|
+
[activeUrl]="container.activeUrl()"
|
|
1290
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1291
|
+
[collapseTree]="container.collapseTree()"
|
|
1292
|
+
[openedIds]="container.openedIds()"
|
|
1293
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1294
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1295
|
+
/>
|
|
1296
|
+
}
|
|
1297
|
+
} @else if (navState.type === 'dockbar') {
|
|
1298
|
+
@defer (on immediate) {
|
|
1299
|
+
<NavigationDockbarMenu
|
|
1300
|
+
[navId]="navState.id"
|
|
1301
|
+
[items]="container.normalizedItems()"
|
|
1302
|
+
[mode]="navState.dockbarMode"
|
|
1303
|
+
[position]="navState.position"
|
|
1304
|
+
[itemClass]="container.itemClass()"
|
|
1305
|
+
[activeIds]="container.activeIdSet()"
|
|
1306
|
+
[activeUrl]="container.activeUrl()"
|
|
1307
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1308
|
+
[collapseTree]="container.collapseTree()"
|
|
1309
|
+
[openedIds]="container.openedIds()"
|
|
1310
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1311
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1312
|
+
/>
|
|
1313
|
+
}
|
|
1314
|
+
} @else {
|
|
1315
|
+
<!-- The vertical list (sidebar) is the common default — kept eager, no first-paint pop-in. -->
|
|
1316
|
+
<NavigationList
|
|
1317
|
+
[navId]="navState.id"
|
|
1318
|
+
[items]="container.normalizedItems()"
|
|
1319
|
+
[collapsed]="navState.collapsed"
|
|
1320
|
+
[position]="navState.position"
|
|
1321
|
+
[itemClass]="container.itemClass()"
|
|
1322
|
+
[activeIds]="container.activeIdSet()"
|
|
1323
|
+
[activeUrl]="container.activeUrl()"
|
|
1324
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1325
|
+
[collapseTree]="container.collapseTree()"
|
|
1326
|
+
[openedIds]="container.openedIds()"
|
|
1327
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1328
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1329
|
+
/>
|
|
1330
|
+
}
|
|
1331
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationListComponent, selector: "NavigationList", inputs: ["navId", "items", "collapsed", "compact", "position", "itemClass", "activeIds", "activeUrl", "iconTemplate", "collapseTree", "openedIds"], outputs: ["openedIdsChange", "itemSelected"] }], deferBlockDependencies: [() => [/* @ts-ignore */
|
|
1332
|
+
import('./ojiepermana-angular-navigation-navigation-flyout-menu.component-CACN0O3T.mjs').then(m => m.NavigationFlyoutMenuComponent)], () => [/* @ts-ignore */
|
|
1333
|
+
import('./ojiepermana-angular-navigation-navigation-horizontal.component-SK1lXswT.mjs').then(m => m.NavigationHorizontalComponent)], () => [/* @ts-ignore */
|
|
1334
|
+
import('./ojiepermana-angular-navigation-navigation-dockbar-menu.component-BQgpBy1I.mjs').then(m => m.NavigationDockbarMenuComponent)]] });
|
|
1335
|
+
}
|
|
1336
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.4", ngImport: i0, type: NavigationContentComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
1337
|
+
import('./ojiepermana-angular-navigation-navigation-flyout-menu.component-CACN0O3T.mjs').then(m => m.NavigationFlyoutMenuComponent), /* @ts-ignore */
|
|
1338
|
+
import('./ojiepermana-angular-navigation-navigation-horizontal.component-SK1lXswT.mjs').then(m => m.NavigationHorizontalComponent), /* @ts-ignore */
|
|
1339
|
+
import('./ojiepermana-angular-navigation-navigation-dockbar-menu.component-BQgpBy1I.mjs').then(m => m.NavigationDockbarMenuComponent)], resolveMetadata: (NavigationFlyoutMenuComponent, NavigationHorizontalComponent, NavigationDockbarMenuComponent) => ({ decorators: [{
|
|
1340
|
+
type: Component,
|
|
1341
|
+
args: [{
|
|
1342
|
+
selector: 'NavigationContent',
|
|
1343
|
+
imports: [
|
|
1344
|
+
NavigationDockbarMenuComponent,
|
|
1345
|
+
NavigationFlyoutMenuComponent,
|
|
1346
|
+
NavigationHorizontalComponent,
|
|
1347
|
+
NavigationListComponent,
|
|
1348
|
+
],
|
|
1349
|
+
host: {
|
|
1350
|
+
'[class]': 'hostClasses()',
|
|
1351
|
+
},
|
|
1352
|
+
template: `
|
|
1353
|
+
@let navState = container.displayState();
|
|
1354
|
+
|
|
1355
|
+
@if (navState.orientation === 'horizontal' && navState.type === 'flyout') {
|
|
1356
|
+
<!-- Less-common renderers are code-split: a sidebar-only app never bundles them. -->
|
|
1357
|
+
@defer (on immediate) {
|
|
1358
|
+
<NavigationFlyoutMenu
|
|
1359
|
+
[navId]="navState.id"
|
|
1360
|
+
[items]="container.normalizedItems()"
|
|
1361
|
+
[label]="container.flyoutLabel()"
|
|
1362
|
+
[icon]="container.flyoutIcon()"
|
|
1363
|
+
[iconOnly]="container.flyoutIconOnly()"
|
|
1364
|
+
[iconPosition]="container.flyoutIconPosition()"
|
|
1365
|
+
[variant]="container.flyoutTriggerVariant()"
|
|
1366
|
+
[floating]="container.flyoutTriggerFloating()"
|
|
1367
|
+
[triggerClass]="container.flyoutTriggerClass()"
|
|
1368
|
+
[position]="navState.position"
|
|
1369
|
+
[typeStyle]="container.typeStyle()"
|
|
1370
|
+
[compact]="container.compact()"
|
|
1371
|
+
[itemClass]="container.itemClass()"
|
|
1372
|
+
[groupClass]="container.groupClass()"
|
|
1373
|
+
[activeIds]="container.activeIdSet()"
|
|
1374
|
+
[activeUrl]="container.activeUrl()"
|
|
1375
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1376
|
+
[collapseTree]="container.collapseTree()"
|
|
1377
|
+
[openedIds]="container.openedIds()"
|
|
1378
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1379
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1380
|
+
>
|
|
1381
|
+
<ng-content select="NavigationHeader" ngProjectAs="NavigationHeader" />
|
|
1382
|
+
<ng-content select="NavigationFooter" ngProjectAs="NavigationFooter" />
|
|
1383
|
+
</NavigationFlyoutMenu>
|
|
1384
|
+
}
|
|
1385
|
+
} @else if (navState.orientation === 'horizontal') {
|
|
1386
|
+
@defer (on immediate) {
|
|
1387
|
+
<NavigationHorizontal
|
|
1388
|
+
[navId]="navState.id"
|
|
1389
|
+
[items]="container.normalizedItems()"
|
|
1390
|
+
[position]="navState.position"
|
|
1391
|
+
[typeStyle]="container.typeStyle()"
|
|
1392
|
+
[compact]="container.compact()"
|
|
1393
|
+
[itemClass]="container.itemClass()"
|
|
1394
|
+
[groupClass]="container.groupClass()"
|
|
1395
|
+
[activeIds]="container.activeIdSet()"
|
|
1396
|
+
[activeUrl]="container.activeUrl()"
|
|
1397
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1398
|
+
[collapseTree]="container.collapseTree()"
|
|
1399
|
+
[openedIds]="container.openedIds()"
|
|
1400
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1401
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1402
|
+
/>
|
|
1403
|
+
}
|
|
1404
|
+
} @else if (navState.type === 'dockbar') {
|
|
1405
|
+
@defer (on immediate) {
|
|
1406
|
+
<NavigationDockbarMenu
|
|
1407
|
+
[navId]="navState.id"
|
|
1408
|
+
[items]="container.normalizedItems()"
|
|
1409
|
+
[mode]="navState.dockbarMode"
|
|
1410
|
+
[position]="navState.position"
|
|
1411
|
+
[itemClass]="container.itemClass()"
|
|
1412
|
+
[activeIds]="container.activeIdSet()"
|
|
1413
|
+
[activeUrl]="container.activeUrl()"
|
|
1414
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1415
|
+
[collapseTree]="container.collapseTree()"
|
|
1416
|
+
[openedIds]="container.openedIds()"
|
|
1417
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1418
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1419
|
+
/>
|
|
1420
|
+
}
|
|
1421
|
+
} @else {
|
|
1422
|
+
<!-- The vertical list (sidebar) is the common default — kept eager, no first-paint pop-in. -->
|
|
1423
|
+
<NavigationList
|
|
1424
|
+
[navId]="navState.id"
|
|
1425
|
+
[items]="container.normalizedItems()"
|
|
1426
|
+
[collapsed]="navState.collapsed"
|
|
1427
|
+
[position]="navState.position"
|
|
1428
|
+
[itemClass]="container.itemClass()"
|
|
1429
|
+
[activeIds]="container.activeIdSet()"
|
|
1430
|
+
[activeUrl]="container.activeUrl()"
|
|
1431
|
+
[iconTemplate]="container.iconTemplate()"
|
|
1432
|
+
[collapseTree]="container.collapseTree()"
|
|
1433
|
+
[openedIds]="container.openedIds()"
|
|
1434
|
+
(openedIdsChange)="container.openedIds.set($event)"
|
|
1435
|
+
(itemSelected)="container.itemSelected.emit($event)"
|
|
1436
|
+
/>
|
|
1437
|
+
}
|
|
1438
|
+
`,
|
|
1439
|
+
}]
|
|
1440
|
+
}], ctorParameters: null, propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
|
|
1441
|
+
|
|
1442
|
+
class NavigationFooterComponent {
|
|
1443
|
+
shell = inject(NAVIGATION_SHELL, { optional: true });
|
|
1444
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1445
|
+
isHorizontal = computed(() => this.shell?.displayState().orientation === 'horizontal', /* @ts-ignore */
|
|
1446
|
+
...(ngDevMode ? [{ debugName: "isHorizontal" }] : /* istanbul ignore next */ []));
|
|
1447
|
+
hostClasses = computed(() => cn(this.isHorizontal()
|
|
1448
|
+
? 'relative z-10 block h-full w-auto shrink-0'
|
|
1449
|
+
: 'sticky bottom-0 z-10 block h-12 shrink-0 border-t border-[hsl(var(--border)/var(--opacity-70))]', this.class()), /* @ts-ignore */
|
|
1450
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1452
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: NavigationFooterComponent, isStandalone: true, selector: "NavigationFooter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
|
|
1453
|
+
<div class="flex h-full min-w-0 items-center gap-3">
|
|
1454
|
+
<ng-content />
|
|
1455
|
+
</div>
|
|
1456
|
+
`, isInline: true });
|
|
1457
|
+
}
|
|
1458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterComponent, decorators: [{
|
|
1459
|
+
type: Component,
|
|
1460
|
+
args: [{
|
|
1461
|
+
selector: 'NavigationFooter',
|
|
1462
|
+
host: {
|
|
1463
|
+
'[class]': 'hostClasses()',
|
|
1464
|
+
},
|
|
1465
|
+
template: `
|
|
1466
|
+
<div class="flex h-full min-w-0 items-center gap-3">
|
|
1467
|
+
<ng-content />
|
|
1468
|
+
</div>
|
|
1469
|
+
`,
|
|
1470
|
+
}]
|
|
1471
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1472
|
+
|
|
1473
|
+
class NavigationHeaderComponent {
|
|
1474
|
+
shell = inject(NAVIGATION_SHELL);
|
|
1475
|
+
toggle = input(false, /* @ts-ignore */
|
|
1476
|
+
...(ngDevMode ? [{ debugName: "toggle" }] : /* istanbul ignore next */ []));
|
|
1477
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1478
|
+
collapsed = computed(() => this.shell.state().collapsed, /* @ts-ignore */
|
|
1479
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
1480
|
+
displayCollapsed = computed(() => this.shell.displayState().collapsed, /* @ts-ignore */
|
|
1481
|
+
...(ngDevMode ? [{ debugName: "displayCollapsed" }] : /* istanbul ignore next */ []));
|
|
1482
|
+
isHorizontal = computed(() => this.shell.displayState().orientation === 'horizontal', /* @ts-ignore */
|
|
1483
|
+
...(ngDevMode ? [{ debugName: "isHorizontal" }] : /* istanbul ignore next */ []));
|
|
1484
|
+
showToggle = computed(() => {
|
|
1485
|
+
if (this.isHorizontal()) {
|
|
1486
|
+
return false;
|
|
1487
|
+
}
|
|
1488
|
+
return this.toggle() || (this.shell.collapseEnabled() && !this.displayCollapsed());
|
|
1489
|
+
}, /* @ts-ignore */
|
|
1490
|
+
...(ngDevMode ? [{ debugName: "showToggle" }] : /* istanbul ignore next */ []));
|
|
1491
|
+
toggleAriaLabel = computed(() => this.collapsed() ? 'Expand navigation' : 'Collapse navigation', /* @ts-ignore */
|
|
1492
|
+
...(ngDevMode ? [{ debugName: "toggleAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1493
|
+
toggleIconName = computed(() => this.collapsed() ? 'left_panel_open' : 'left_panel_close', /* @ts-ignore */
|
|
1494
|
+
...(ngDevMode ? [{ debugName: "toggleIconName" }] : /* istanbul ignore next */ []));
|
|
1495
|
+
/**
|
|
1496
|
+
* Baris isi header. Saat collapsed/dockbar (vertical) isi (inisial/ikon) dipusatkan di tengah
|
|
1497
|
+
* rail agar simetris dengan ikon nav-item di bawahnya (yang juga center di rail); selain itu kiri
|
|
1498
|
+
* dengan padding `px-3`.
|
|
1499
|
+
*/
|
|
1500
|
+
rowClasses = computed(() => cn('flex h-full items-center', !this.isHorizontal() && this.displayCollapsed() ? 'justify-center' : 'gap-3 px-3'), /* @ts-ignore */
|
|
1501
|
+
...(ngDevMode ? [{ debugName: "rowClasses" }] : /* istanbul ignore next */ []));
|
|
1502
|
+
contentClasses = computed(() => {
|
|
1503
|
+
if (this.isHorizontal()) {
|
|
1504
|
+
return 'flex min-w-0 items-center gap-3';
|
|
1505
|
+
}
|
|
1506
|
+
// Collapsed/dockbar: inisial center (tanpa `flex-1` yang membuatnya rata kiri).
|
|
1507
|
+
return this.displayCollapsed()
|
|
1508
|
+
? 'flex min-w-0 items-center justify-center'
|
|
1509
|
+
: 'flex min-w-0 flex-1 items-center gap-3';
|
|
1510
|
+
}, /* @ts-ignore */
|
|
1511
|
+
...(ngDevMode ? [{ debugName: "contentClasses" }] : /* istanbul ignore next */ []));
|
|
1512
|
+
hostClasses = computed(() => cn(this.isHorizontal()
|
|
1513
|
+
? 'relative z-10 block h-full w-auto shrink-0'
|
|
1514
|
+
: 'sticky top-0 z-10 block h-12 shrink-0 border-b border-[hsl(var(--border)/var(--opacity-70))]', this.class()), /* @ts-ignore */
|
|
1515
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1516
|
+
toggleCollapsed() {
|
|
1517
|
+
this.shell.toggleCollapsed();
|
|
1518
|
+
}
|
|
1519
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationHeaderComponent, isStandalone: true, selector: "NavigationHeader", inputs: { toggle: { classPropertyName: "toggle", publicName: "toggle", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.data-collapsed": "displayCollapsed()" } }, ngImport: i0, template: `
|
|
1521
|
+
<div [class]="rowClasses()">
|
|
1522
|
+
<div [class]="contentClasses()">
|
|
1523
|
+
<ng-content />
|
|
1524
|
+
</div>
|
|
1525
|
+
|
|
1526
|
+
@if (showToggle()) {
|
|
1527
|
+
<button
|
|
1528
|
+
type="button"
|
|
1529
|
+
class="inline-flex h-8 w-8 shrink-0 items-center justify-center bg-transparent text-foreground/80 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1530
|
+
[attr.aria-label]="toggleAriaLabel()"
|
|
1531
|
+
[attr.title]="toggleAriaLabel()"
|
|
1532
|
+
data-navigation-header-toggle="true"
|
|
1533
|
+
(click)="toggleCollapsed()"
|
|
1534
|
+
>
|
|
1535
|
+
<Icon data-navigation-header-toggle-icon="true" [name]="toggleIconName()" [size]="18" />
|
|
1536
|
+
</button>
|
|
1537
|
+
}
|
|
1538
|
+
</div>
|
|
1539
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }] });
|
|
1540
|
+
}
|
|
1541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderComponent, decorators: [{
|
|
1542
|
+
type: Component,
|
|
1543
|
+
args: [{
|
|
1544
|
+
selector: 'NavigationHeader',
|
|
1545
|
+
imports: [IconComponent],
|
|
1546
|
+
host: {
|
|
1547
|
+
'[class]': 'hostClasses()',
|
|
1548
|
+
'[attr.data-collapsed]': 'displayCollapsed()',
|
|
1549
|
+
},
|
|
1550
|
+
template: `
|
|
1551
|
+
<div [class]="rowClasses()">
|
|
1552
|
+
<div [class]="contentClasses()">
|
|
1553
|
+
<ng-content />
|
|
1554
|
+
</div>
|
|
1555
|
+
|
|
1556
|
+
@if (showToggle()) {
|
|
1557
|
+
<button
|
|
1558
|
+
type="button"
|
|
1559
|
+
class="inline-flex h-8 w-8 shrink-0 items-center justify-center bg-transparent text-foreground/80 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1560
|
+
[attr.aria-label]="toggleAriaLabel()"
|
|
1561
|
+
[attr.title]="toggleAriaLabel()"
|
|
1562
|
+
data-navigation-header-toggle="true"
|
|
1563
|
+
(click)="toggleCollapsed()"
|
|
1564
|
+
>
|
|
1565
|
+
<Icon data-navigation-header-toggle-icon="true" [name]="toggleIconName()" [size]="18" />
|
|
1566
|
+
</button>
|
|
1567
|
+
}
|
|
1568
|
+
</div>
|
|
1569
|
+
`,
|
|
1570
|
+
}]
|
|
1571
|
+
}], propDecorators: { toggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggle", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Type sidebar vertikal untuk `<Navigation>`. Slot `NavigationHeader` dan
|
|
1575
|
+
* `NavigationFooter` opsional; `NavigationContent` selalu dirender (default
|
|
1576
|
+
* otomatis bila tidak diproyeksikan).
|
|
1577
|
+
*/
|
|
1578
|
+
class NavigationSidebarComponent {
|
|
1579
|
+
container = inject(NavigationContainerComponent);
|
|
1580
|
+
destroyRef = inject(DestroyRef);
|
|
1581
|
+
position = input(null, /* @ts-ignore */
|
|
1582
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1583
|
+
collapsed = input(null, /* @ts-ignore */
|
|
1584
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
1585
|
+
collapse = input(false, { ...(ngDevMode ? { debugName: "collapse" } : /* istanbul ignore next */ {}), alias: 'nav-sidebar-collapse', transform: booleanAttribute });
|
|
1586
|
+
previewExpanded = input(false, /* @ts-ignore */
|
|
1587
|
+
...(ngDevMode ? [{ debugName: "previewExpanded" }] : /* istanbul ignore next */ []));
|
|
1588
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1589
|
+
headerSlot = contentChild(NavigationHeaderComponent, /* @ts-ignore */
|
|
1590
|
+
...(ngDevMode ? [{ debugName: "headerSlot" }] : /* istanbul ignore next */ []));
|
|
1591
|
+
contentSlot = contentChild(NavigationContentComponent, /* @ts-ignore */
|
|
1592
|
+
...(ngDevMode ? [{ debugName: "contentSlot" }] : /* istanbul ignore next */ []));
|
|
1593
|
+
footerSlot = contentChild(NavigationFooterComponent, /* @ts-ignore */
|
|
1594
|
+
...(ngDevMode ? [{ debugName: "footerSlot" }] : /* istanbul ignore next */ []));
|
|
1595
|
+
hostClasses = computed(() => cn(this.container.shellClasses(), this.class()), /* @ts-ignore */
|
|
1596
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1597
|
+
constructor() {
|
|
1598
|
+
const config = {
|
|
1599
|
+
orientation: 'vertical',
|
|
1600
|
+
type: 'sidebar',
|
|
1601
|
+
position: this.position,
|
|
1602
|
+
collapsed: this.collapsed,
|
|
1603
|
+
sidebarCollapse: this.collapse,
|
|
1604
|
+
previewExpanded: this.previewExpanded,
|
|
1605
|
+
};
|
|
1606
|
+
this.container.registerType(config);
|
|
1607
|
+
this.destroyRef.onDestroy(() => this.container.unregisterType(config));
|
|
1608
|
+
}
|
|
1609
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1610
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationSidebarComponent, isStandalone: true, selector: "NavigationSidebar", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, collapse: { classPropertyName: "collapse", publicName: "nav-sidebar-collapse", isSignal: true, isRequired: false, transformFunction: null }, previewExpanded: { classPropertyName: "previewExpanded", publicName: "previewExpanded", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "headerSlot", first: true, predicate: NavigationHeaderComponent, descendants: true, isSignal: true }, { propertyName: "contentSlot", first: true, predicate: NavigationContentComponent, descendants: true, isSignal: true }, { propertyName: "footerSlot", first: true, predicate: NavigationFooterComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1611
|
+
@if (headerSlot()) {
|
|
1612
|
+
<ng-content select="NavigationHeader" />
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
@if (contentSlot()) {
|
|
1616
|
+
<ng-content select="NavigationContent" />
|
|
1617
|
+
} @else {
|
|
1618
|
+
<NavigationContent />
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
@if (footerSlot()) {
|
|
1622
|
+
<ng-content select="NavigationFooter" />
|
|
1623
|
+
}
|
|
1624
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationContentComponent, selector: "NavigationContent", inputs: ["class"] }] });
|
|
1625
|
+
}
|
|
1626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationSidebarComponent, decorators: [{
|
|
1627
|
+
type: Component,
|
|
1628
|
+
args: [{
|
|
1629
|
+
selector: 'NavigationSidebar',
|
|
1630
|
+
imports: [NavigationContentComponent],
|
|
1631
|
+
host: {
|
|
1632
|
+
'[class]': 'hostClasses()',
|
|
1633
|
+
},
|
|
1634
|
+
template: `
|
|
1635
|
+
@if (headerSlot()) {
|
|
1636
|
+
<ng-content select="NavigationHeader" />
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
@if (contentSlot()) {
|
|
1640
|
+
<ng-content select="NavigationContent" />
|
|
1641
|
+
} @else {
|
|
1642
|
+
<NavigationContent />
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
@if (footerSlot()) {
|
|
1646
|
+
<ng-content select="NavigationFooter" />
|
|
1647
|
+
}
|
|
1648
|
+
`,
|
|
1649
|
+
}]
|
|
1650
|
+
}], ctorParameters: () => [], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], collapse: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-sidebar-collapse", required: false }] }], previewExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewExpanded", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationHeaderComponent), { isSignal: true }] }], contentSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationContentComponent), { isSignal: true }] }], footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationFooterComponent), { isSignal: true }] }] } });
|
|
1651
|
+
|
|
1652
|
+
/**
|
|
1653
|
+
* Type dockbar vertikal (rail ikon + aside) untuk `<Navigation>`. Slot
|
|
1654
|
+
* `NavigationHeader` dan `NavigationFooter` opsional; `NavigationContent`
|
|
1655
|
+
* selalu dirender (default otomatis bila tidak diproyeksikan).
|
|
1656
|
+
*/
|
|
1657
|
+
class NavigationDockbarComponent {
|
|
1658
|
+
container = inject(NavigationContainerComponent);
|
|
1659
|
+
destroyRef = inject(DestroyRef);
|
|
1660
|
+
mode = input(null, /* @ts-ignore */
|
|
1661
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1662
|
+
position = input(null, /* @ts-ignore */
|
|
1663
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1664
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1665
|
+
headerSlot = contentChild(NavigationHeaderComponent, /* @ts-ignore */
|
|
1666
|
+
...(ngDevMode ? [{ debugName: "headerSlot" }] : /* istanbul ignore next */ []));
|
|
1667
|
+
contentSlot = contentChild(NavigationContentComponent, /* @ts-ignore */
|
|
1668
|
+
...(ngDevMode ? [{ debugName: "contentSlot" }] : /* istanbul ignore next */ []));
|
|
1669
|
+
footerSlot = contentChild(NavigationFooterComponent, /* @ts-ignore */
|
|
1670
|
+
...(ngDevMode ? [{ debugName: "footerSlot" }] : /* istanbul ignore next */ []));
|
|
1671
|
+
hostClasses = computed(() => cn(this.container.shellClasses(), this.class()), /* @ts-ignore */
|
|
1672
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1673
|
+
constructor() {
|
|
1674
|
+
const config = {
|
|
1675
|
+
orientation: 'vertical',
|
|
1676
|
+
type: 'dockbar',
|
|
1677
|
+
position: this.position,
|
|
1678
|
+
dockbarMode: this.mode,
|
|
1679
|
+
};
|
|
1680
|
+
this.container.registerType(config);
|
|
1681
|
+
this.destroyRef.onDestroy(() => this.container.unregisterType(config));
|
|
1682
|
+
}
|
|
1683
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationDockbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationDockbarComponent, isStandalone: true, selector: "NavigationDockbar", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "headerSlot", first: true, predicate: NavigationHeaderComponent, descendants: true, isSignal: true }, { propertyName: "contentSlot", first: true, predicate: NavigationContentComponent, descendants: true, isSignal: true }, { propertyName: "footerSlot", first: true, predicate: NavigationFooterComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1685
|
+
@if (headerSlot()) {
|
|
1686
|
+
<ng-content select="NavigationHeader" />
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
@if (contentSlot()) {
|
|
1690
|
+
<ng-content select="NavigationContent" />
|
|
1691
|
+
} @else {
|
|
1692
|
+
<NavigationContent />
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
@if (footerSlot()) {
|
|
1696
|
+
<ng-content select="NavigationFooter" />
|
|
1697
|
+
}
|
|
1698
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationContentComponent, selector: "NavigationContent", inputs: ["class"] }] });
|
|
1699
|
+
}
|
|
1700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationDockbarComponent, decorators: [{
|
|
1701
|
+
type: Component,
|
|
1702
|
+
args: [{
|
|
1703
|
+
selector: 'NavigationDockbar',
|
|
1704
|
+
imports: [NavigationContentComponent],
|
|
1705
|
+
host: {
|
|
1706
|
+
'[class]': 'hostClasses()',
|
|
1707
|
+
},
|
|
1708
|
+
template: `
|
|
1709
|
+
@if (headerSlot()) {
|
|
1710
|
+
<ng-content select="NavigationHeader" />
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
@if (contentSlot()) {
|
|
1714
|
+
<ng-content select="NavigationContent" />
|
|
1715
|
+
} @else {
|
|
1716
|
+
<NavigationContent />
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
@if (footerSlot()) {
|
|
1720
|
+
<ng-content select="NavigationFooter" />
|
|
1721
|
+
}
|
|
1722
|
+
`,
|
|
1723
|
+
}]
|
|
1724
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationHeaderComponent), { isSignal: true }] }], contentSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationContentComponent), { isSignal: true }] }], footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationFooterComponent), { isSignal: true }] }] } });
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Type navbar horizontal untuk `<Navigation>`. Slot `NavigationHeader`
|
|
1728
|
+
* dan `NavigationFooter` opsional; `NavigationContent` selalu dirender
|
|
1729
|
+
* (default otomatis bila tidak diproyeksikan).
|
|
1730
|
+
*/
|
|
1731
|
+
class NavigationNavbarComponent {
|
|
1732
|
+
container = inject(NavigationContainerComponent);
|
|
1733
|
+
destroyRef = inject(DestroyRef);
|
|
1734
|
+
/** Posisi bar terhadap konten layout: `top` (default) atau `bottom` — panel grid membuka ke arah sebaliknya. */
|
|
1735
|
+
position = input(null, { ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), alias: 'nav-position' });
|
|
1736
|
+
typeStyle = input('flat', { ...(ngDevMode ? { debugName: "typeStyle" } : /* istanbul ignore next */ {}), alias: 'nav-appearance' });
|
|
1737
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1738
|
+
headerSlot = contentChild(NavigationHeaderComponent, /* @ts-ignore */
|
|
1739
|
+
...(ngDevMode ? [{ debugName: "headerSlot" }] : /* istanbul ignore next */ []));
|
|
1740
|
+
contentSlot = contentChild(NavigationContentComponent, /* @ts-ignore */
|
|
1741
|
+
...(ngDevMode ? [{ debugName: "contentSlot" }] : /* istanbul ignore next */ []));
|
|
1742
|
+
footerSlot = contentChild(NavigationFooterComponent, /* @ts-ignore */
|
|
1743
|
+
...(ngDevMode ? [{ debugName: "footerSlot" }] : /* istanbul ignore next */ []));
|
|
1744
|
+
hostClasses = computed(() => cn(this.container.shellClasses(), this.class()), /* @ts-ignore */
|
|
1745
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1746
|
+
constructor() {
|
|
1747
|
+
const config = {
|
|
1748
|
+
orientation: 'horizontal',
|
|
1749
|
+
type: 'navbar',
|
|
1750
|
+
position: this.position,
|
|
1751
|
+
typeStyle: this.typeStyle,
|
|
1752
|
+
};
|
|
1753
|
+
this.container.registerType(config);
|
|
1754
|
+
this.destroyRef.onDestroy(() => this.container.unregisterType(config));
|
|
1755
|
+
}
|
|
1756
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1757
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationNavbarComponent, isStandalone: true, selector: "NavigationNavbar", inputs: { position: { classPropertyName: "position", publicName: "nav-position", isSignal: true, isRequired: false, transformFunction: null }, typeStyle: { classPropertyName: "typeStyle", publicName: "nav-appearance", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "headerSlot", first: true, predicate: NavigationHeaderComponent, descendants: true, isSignal: true }, { propertyName: "contentSlot", first: true, predicate: NavigationContentComponent, descendants: true, isSignal: true }, { propertyName: "footerSlot", first: true, predicate: NavigationFooterComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1758
|
+
@if (headerSlot()) {
|
|
1759
|
+
<ng-content select="NavigationHeader" />
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
@if (contentSlot()) {
|
|
1763
|
+
<ng-content select="NavigationContent" />
|
|
1764
|
+
} @else {
|
|
1765
|
+
<NavigationContent />
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
@if (footerSlot()) {
|
|
1769
|
+
<ng-content select="NavigationFooter" />
|
|
1770
|
+
}
|
|
1771
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationContentComponent, selector: "NavigationContent", inputs: ["class"] }] });
|
|
1772
|
+
}
|
|
1773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationNavbarComponent, decorators: [{
|
|
1774
|
+
type: Component,
|
|
1775
|
+
args: [{
|
|
1776
|
+
selector: 'NavigationNavbar',
|
|
1777
|
+
imports: [NavigationContentComponent],
|
|
1778
|
+
host: {
|
|
1779
|
+
'[class]': 'hostClasses()',
|
|
1780
|
+
},
|
|
1781
|
+
template: `
|
|
1782
|
+
@if (headerSlot()) {
|
|
1783
|
+
<ng-content select="NavigationHeader" />
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
@if (contentSlot()) {
|
|
1787
|
+
<ng-content select="NavigationContent" />
|
|
1788
|
+
} @else {
|
|
1789
|
+
<NavigationContent />
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
@if (footerSlot()) {
|
|
1793
|
+
<ng-content select="NavigationFooter" />
|
|
1794
|
+
}
|
|
1795
|
+
`,
|
|
1796
|
+
}]
|
|
1797
|
+
}], ctorParameters: () => [], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-position", required: false }] }], typeStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-appearance", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationHeaderComponent), { isSignal: true }] }], contentSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationContentComponent), { isSignal: true }] }], footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NavigationFooterComponent), { isSignal: true }] }] } });
|
|
1798
|
+
|
|
1799
|
+
/**
|
|
1800
|
+
* Type flyout horizontal (trigger + panel menu) untuk `<Navigation>`.
|
|
1801
|
+
* Slot `NavigationHeader` dan `NavigationFooter` opsional; `NavigationContent`
|
|
1802
|
+
* selalu dirender (default otomatis bila tidak diproyeksikan).
|
|
1803
|
+
*/
|
|
1804
|
+
class NavigationFlyoutComponent {
|
|
1805
|
+
container = inject(NavigationContainerComponent);
|
|
1806
|
+
destroyRef = inject(DestroyRef);
|
|
1807
|
+
label = input('Menu', /* @ts-ignore */
|
|
1808
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1809
|
+
/** Nama Material Symbols untuk trigger (mis. `apps`, `menu`); `null` = label saja. */
|
|
1810
|
+
icon = input(null, /* @ts-ignore */
|
|
1811
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1812
|
+
/** Trigger hanya menampilkan ikon; label tetap dipakai sebagai aria-label/title. */
|
|
1813
|
+
iconOnly = input(false, { ...(ngDevMode ? { debugName: "iconOnly" } : /* istanbul ignore next */ {}), alias: 'icon-only', transform: booleanAttribute });
|
|
1814
|
+
/** Penempatan ikon relatif terhadap label: `start` (default) atau `end`. */
|
|
1815
|
+
iconPosition = input('start', { ...(ngDevMode ? { debugName: "iconPosition" } : /* istanbul ignore next */ {}), alias: 'icon-position' });
|
|
1816
|
+
/** Bentuk visual tombol trigger: `button` (pil, default) | `link` | `plain` (ghost). */
|
|
1817
|
+
triggerVariant = input('button', { ...(ngDevMode ? { debugName: "triggerVariant" } : /* istanbul ignore next */ {}), alias: 'trigger-variant' });
|
|
1818
|
+
/**
|
|
1819
|
+
* Trigger mengambang (`fixed`) alih-alih mengalir di dalam bar/div. Default pojok kanan-atas;
|
|
1820
|
+
* pakai `trigger-class` untuk pindah pojok (mis. `bottom-6 right-6 top-auto`).
|
|
1821
|
+
*
|
|
1822
|
+
* Catatan: `position: fixed` ber-anchor ke viewport HANYA bila tak ada ancestor pembentuk
|
|
1823
|
+
* containing block. Di dalam `<Layout>` (frame-nya memakai `backdrop-blur`), trigger ber-anchor
|
|
1824
|
+
* ke kotak konten frame (bukan viewport sebenarnya) dan bisa ter-clip oleh frame `overflow-hidden`.
|
|
1825
|
+
* Untuk floating sebenar-viewport, tempatkan `<Navigation>` flyout di luar frame `<Layout>`.
|
|
1826
|
+
*/
|
|
1827
|
+
triggerFloating = input(false, { ...(ngDevMode ? { debugName: "triggerFloating" } : /* istanbul ignore next */ {}), alias: 'trigger-floating',
|
|
1828
|
+
transform: booleanAttribute });
|
|
1829
|
+
/** Kelas Tailwind untuk host trigger (posisi pojok floating / styling wrapper saat in-flow). */
|
|
1830
|
+
triggerClass = input('', { ...(ngDevMode ? { debugName: "triggerClass" } : /* istanbul ignore next */ {}), alias: 'trigger-class' });
|
|
1831
|
+
/** Posisi bar terhadap konten layout: `top` (default) atau `bottom` — panel membuka ke arah sebaliknya. */
|
|
1832
|
+
position = input(null, { ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), alias: 'nav-position' });
|
|
1833
|
+
typeStyle = input('flat', { ...(ngDevMode ? { debugName: "typeStyle" } : /* istanbul ignore next */ {}), alias: 'nav-appearance' });
|
|
1834
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1835
|
+
hostClasses = computed(() => cn(this.container.shellClasses(), this.class()), /* @ts-ignore */
|
|
1836
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1837
|
+
constructor() {
|
|
1838
|
+
const config = {
|
|
1839
|
+
orientation: 'horizontal',
|
|
1840
|
+
type: 'flyout',
|
|
1841
|
+
position: this.position,
|
|
1842
|
+
flyoutLabel: this.label,
|
|
1843
|
+
flyoutIcon: this.icon,
|
|
1844
|
+
flyoutIconOnly: this.iconOnly,
|
|
1845
|
+
flyoutIconPosition: this.iconPosition,
|
|
1846
|
+
flyoutTriggerVariant: this.triggerVariant,
|
|
1847
|
+
flyoutTriggerFloating: this.triggerFloating,
|
|
1848
|
+
flyoutTriggerClass: this.triggerClass,
|
|
1849
|
+
typeStyle: this.typeStyle,
|
|
1850
|
+
};
|
|
1851
|
+
this.container.registerType(config);
|
|
1852
|
+
this.destroyRef.onDestroy(() => this.container.unregisterType(config));
|
|
1853
|
+
}
|
|
1854
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFlyoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1855
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: NavigationFlyoutComponent, isStandalone: true, selector: "NavigationFlyout", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "icon-only", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "icon-position", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "trigger-variant", isSignal: true, isRequired: false, transformFunction: null }, triggerFloating: { classPropertyName: "triggerFloating", publicName: "trigger-floating", isSignal: true, isRequired: false, transformFunction: null }, triggerClass: { classPropertyName: "triggerClass", publicName: "trigger-class", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "nav-position", isSignal: true, isRequired: false, transformFunction: null }, typeStyle: { classPropertyName: "typeStyle", publicName: "nav-appearance", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
|
|
1856
|
+
<!-- Bar hanya berisi trigger (dari NavigationContent → FlyoutMenu); NavigationHeader &
|
|
1857
|
+
NavigationFooter di-re-project ke DALAM panel flyout saat dibuka. Urutan dibaca dari sisi
|
|
1858
|
+
bar ke arah luar: header (menempel bar, sticky) → menu → footer (ujung jauh). Mode top:
|
|
1859
|
+
brand atas, logout bawah; mode bottom: cerminannya (brand bawah dekat bar, logout atas). -->
|
|
1860
|
+
<NavigationContent>
|
|
1861
|
+
<ng-content select="NavigationHeader" ngProjectAs="NavigationHeader" />
|
|
1862
|
+
<ng-content select="NavigationFooter" ngProjectAs="NavigationFooter" />
|
|
1863
|
+
</NavigationContent>
|
|
1864
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NavigationContentComponent, selector: "NavigationContent", inputs: ["class"] }] });
|
|
1865
|
+
}
|
|
1866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFlyoutComponent, decorators: [{
|
|
1867
|
+
type: Component,
|
|
1868
|
+
args: [{
|
|
1869
|
+
selector: 'NavigationFlyout',
|
|
1870
|
+
imports: [NavigationContentComponent],
|
|
1871
|
+
host: {
|
|
1872
|
+
'[class]': 'hostClasses()',
|
|
1873
|
+
},
|
|
1874
|
+
template: `
|
|
1875
|
+
<!-- Bar hanya berisi trigger (dari NavigationContent → FlyoutMenu); NavigationHeader &
|
|
1876
|
+
NavigationFooter di-re-project ke DALAM panel flyout saat dibuka. Urutan dibaca dari sisi
|
|
1877
|
+
bar ke arah luar: header (menempel bar, sticky) → menu → footer (ujung jauh). Mode top:
|
|
1878
|
+
brand atas, logout bawah; mode bottom: cerminannya (brand bawah dekat bar, logout atas). -->
|
|
1879
|
+
<NavigationContent>
|
|
1880
|
+
<ng-content select="NavigationHeader" ngProjectAs="NavigationHeader" />
|
|
1881
|
+
<ng-content select="NavigationFooter" ngProjectAs="NavigationFooter" />
|
|
1882
|
+
</NavigationContent>
|
|
1883
|
+
`,
|
|
1884
|
+
}]
|
|
1885
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon-only", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon-position", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger-variant", required: false }] }], triggerFloating: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger-floating", required: false }] }], triggerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger-class", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-position", required: false }] }], typeStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "nav-appearance", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Tampilan compact aktif saat sidebar collapsible sedang collapsed, atau saat
|
|
1889
|
+
* type dockbar aktif — rail dockbar selalu selebar ikon (`w-16`) sehingga
|
|
1890
|
+
* konten expanded tidak pernah muat.
|
|
1891
|
+
*/
|
|
1892
|
+
function isCompactDisplay(shell) {
|
|
1893
|
+
const state = shell.displayState();
|
|
1894
|
+
if (state.orientation !== 'vertical') {
|
|
1895
|
+
return false;
|
|
1896
|
+
}
|
|
1897
|
+
if (state.type === 'dockbar') {
|
|
1898
|
+
return true;
|
|
1899
|
+
}
|
|
1900
|
+
return shell.collapseEnabled() && state.collapsed;
|
|
1901
|
+
}
|
|
1902
|
+
class NavigationCollapseRootDirective {
|
|
1903
|
+
shell = inject(NAVIGATION_SHELL);
|
|
1904
|
+
collapseEnabled = computed(() => {
|
|
1905
|
+
const state = this.shell.displayState();
|
|
1906
|
+
return state.orientation === 'vertical' && (this.shell.collapseEnabled() || state.type === 'dockbar');
|
|
1907
|
+
}, /* @ts-ignore */
|
|
1908
|
+
...(ngDevMode ? [{ debugName: "collapseEnabled" }] : /* istanbul ignore next */ []));
|
|
1909
|
+
displayCollapsed = computed(() => isCompactDisplay(this.shell), /* @ts-ignore */
|
|
1910
|
+
...(ngDevMode ? [{ debugName: "displayCollapsed" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationCollapseRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1912
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: NavigationCollapseRootDirective, isStandalone: true, selector: "[NavigationCollapseRoot]", host: { properties: { "class.w-full": "collapseEnabled()", "class.justify-center": "displayCollapsed()" } }, ngImport: i0 });
|
|
1913
|
+
}
|
|
1914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationCollapseRootDirective, decorators: [{
|
|
1915
|
+
type: Directive,
|
|
1916
|
+
args: [{
|
|
1917
|
+
selector: '[NavigationCollapseRoot]',
|
|
1918
|
+
host: {
|
|
1919
|
+
'[class.w-full]': 'collapseEnabled()',
|
|
1920
|
+
'[class.justify-center]': 'displayCollapsed()',
|
|
1921
|
+
},
|
|
1922
|
+
}]
|
|
1923
|
+
}] });
|
|
1924
|
+
class NavigationCollapseExpandedDirective {
|
|
1925
|
+
shell = inject(NAVIGATION_SHELL);
|
|
1926
|
+
templateRef = inject((TemplateRef));
|
|
1927
|
+
viewContainer = inject(ViewContainerRef);
|
|
1928
|
+
hasView = false;
|
|
1929
|
+
shouldRender = computed(() => !isCompactDisplay(this.shell), /* @ts-ignore */
|
|
1930
|
+
...(ngDevMode ? [{ debugName: "shouldRender" }] : /* istanbul ignore next */ []));
|
|
1931
|
+
constructor() {
|
|
1932
|
+
effect(() => {
|
|
1933
|
+
if (this.shouldRender()) {
|
|
1934
|
+
if (!this.hasView) {
|
|
1935
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
1936
|
+
this.hasView = true;
|
|
1937
|
+
}
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
if (this.hasView) {
|
|
1941
|
+
this.viewContainer.clear();
|
|
1942
|
+
this.hasView = false;
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationCollapseExpandedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1947
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: NavigationCollapseExpandedDirective, isStandalone: true, selector: "[NavigationCollapseExpanded]", ngImport: i0 });
|
|
1948
|
+
}
|
|
1949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationCollapseExpandedDirective, decorators: [{
|
|
1950
|
+
type: Directive,
|
|
1951
|
+
args: [{
|
|
1952
|
+
selector: '[NavigationCollapseExpanded]',
|
|
1953
|
+
}]
|
|
1954
|
+
}], ctorParameters: () => [] });
|
|
1955
|
+
|
|
1956
|
+
/**
|
|
1957
|
+
* Slot aksi di sisi kanan `NavigationFooter`. Selalu didorong ke kanan (`ml-auto`),
|
|
1958
|
+
* rata tengah vertikal, dengan jarak antar-child otomatis (`gap`). Isi bebas dengan
|
|
1959
|
+
* ikon, button, atau teks — mis. tombol logout.
|
|
1960
|
+
*
|
|
1961
|
+
* Otomatis disembunyikan saat sidebar vertical sedang collapsed (rail icon-only)
|
|
1962
|
+
* agar tidak overflow; konsisten dengan `NavigationFooterTitle`.
|
|
1963
|
+
*/
|
|
1964
|
+
class NavigationFooterActionComponent {
|
|
1965
|
+
shell = inject(NAVIGATION_SHELL, { optional: true });
|
|
1966
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1967
|
+
collapsed = computed(() => {
|
|
1968
|
+
const state = this.shell?.displayState();
|
|
1969
|
+
return state ? state.orientation === 'vertical' && state.collapsed : false;
|
|
1970
|
+
}, /* @ts-ignore */
|
|
1971
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
1972
|
+
hostClasses = computed(() => cn(this.collapsed() ? 'hidden' : 'ml-auto flex shrink-0 items-center gap-1', this.class()), /* @ts-ignore */
|
|
1973
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1974
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1975
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: NavigationFooterActionComponent, isStandalone: true, selector: "NavigationFooterAction", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1976
|
+
}
|
|
1977
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterActionComponent, decorators: [{
|
|
1978
|
+
type: Component,
|
|
1979
|
+
args: [{
|
|
1980
|
+
selector: 'NavigationFooterAction',
|
|
1981
|
+
host: {
|
|
1982
|
+
'[class]': 'hostClasses()',
|
|
1983
|
+
},
|
|
1984
|
+
template: `<ng-content />`,
|
|
1985
|
+
}]
|
|
1986
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1987
|
+
|
|
1988
|
+
/**
|
|
1989
|
+
* Turunkan inisial ringkas dari sebuah nama untuk avatar fallback.
|
|
1990
|
+
*
|
|
1991
|
+
* "Ojie Permana" → "OP"
|
|
1992
|
+
* "Ojiepermana" → "OJ"
|
|
1993
|
+
* "" → ""
|
|
1994
|
+
*
|
|
1995
|
+
* Mengambil huruf depan kata pertama dan kata terakhir; bila hanya satu kata,
|
|
1996
|
+
* memakai dua huruf pertamanya.
|
|
1997
|
+
*/
|
|
1998
|
+
function deriveNavigationInitials(name) {
|
|
1999
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
2000
|
+
if (parts.length === 0) {
|
|
2001
|
+
return '';
|
|
2002
|
+
}
|
|
2003
|
+
const first = parts[0] ?? '';
|
|
2004
|
+
if (parts.length === 1) {
|
|
2005
|
+
return first.slice(0, 2).toUpperCase();
|
|
2006
|
+
}
|
|
2007
|
+
const last = parts[parts.length - 1] ?? '';
|
|
2008
|
+
return (first.charAt(0) + last.charAt(0)).toUpperCase();
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* Blok avatar/inisial untuk slot `NavigationFooter` (profil user). Sama seperti
|
|
2013
|
+
* `NavigationHeaderInitial` tetapi default-nya bulat (rounded-full) sesuai
|
|
2014
|
+
* konvensi avatar user. Consumer cukup memberi `name`; inisial diturunkan
|
|
2015
|
+
* otomatis. Beri `src` untuk foto, `icon` untuk material symbol, atau `initials`
|
|
2016
|
+
* untuk override.
|
|
2017
|
+
*
|
|
2018
|
+
* Tetap tampil saat sidebar collapsed; pasangannya `NavigationFooterTitle` yang
|
|
2019
|
+
* menyembunyikan diri.
|
|
2020
|
+
*/
|
|
2021
|
+
class NavigationFooterInitialComponent {
|
|
2022
|
+
name = input('', /* @ts-ignore */
|
|
2023
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
2024
|
+
src = input(null, /* @ts-ignore */
|
|
2025
|
+
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
2026
|
+
initials = input(null, /* @ts-ignore */
|
|
2027
|
+
...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
2028
|
+
icon = input(null, /* @ts-ignore */
|
|
2029
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2030
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2031
|
+
resolvedInitials = computed(() => this.initials()?.slice(0, 2).toUpperCase() || deriveNavigationInitials(this.name()), /* @ts-ignore */
|
|
2032
|
+
...(ngDevMode ? [{ debugName: "resolvedInitials" }] : /* istanbul ignore next */ []));
|
|
2033
|
+
hostClasses = computed(() => cn('inline-flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/10 text-primary', this.class()), /* @ts-ignore */
|
|
2034
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2035
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterInitialComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2036
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationFooterInitialComponent, isStandalone: true, selector: "NavigationFooterInitial", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "name() ? 'img' : null", "attr.aria-label": "name() || null" } }, ngImport: i0, template: `
|
|
2037
|
+
@if (src(); as source) {
|
|
2038
|
+
<img [src]="source" alt="" class="h-full w-full rounded-[inherit] object-cover" />
|
|
2039
|
+
} @else if (icon(); as glyph) {
|
|
2040
|
+
<Icon [name]="glyph" [size]="18" />
|
|
2041
|
+
} @else {
|
|
2042
|
+
<span class="text-xs font-semibold leading-none">{{ resolvedInitials() }}</span>
|
|
2043
|
+
}
|
|
2044
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }] });
|
|
2045
|
+
}
|
|
2046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterInitialComponent, decorators: [{
|
|
2047
|
+
type: Component,
|
|
2048
|
+
args: [{
|
|
2049
|
+
selector: 'NavigationFooterInitial',
|
|
2050
|
+
imports: [IconComponent],
|
|
2051
|
+
host: {
|
|
2052
|
+
'[class]': 'hostClasses()',
|
|
2053
|
+
'[attr.role]': "name() ? 'img' : null",
|
|
2054
|
+
'[attr.aria-label]': 'name() || null',
|
|
2055
|
+
},
|
|
2056
|
+
template: `
|
|
2057
|
+
@if (src(); as source) {
|
|
2058
|
+
<img [src]="source" alt="" class="h-full w-full rounded-[inherit] object-cover" />
|
|
2059
|
+
} @else if (icon(); as glyph) {
|
|
2060
|
+
<Icon [name]="glyph" [size]="18" />
|
|
2061
|
+
} @else {
|
|
2062
|
+
<span class="text-xs font-semibold leading-none">{{ resolvedInitials() }}</span>
|
|
2063
|
+
}
|
|
2064
|
+
`,
|
|
2065
|
+
}]
|
|
2066
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Judul + subjudul untuk slot `NavigationFooter` (mis. nama + email user).
|
|
2070
|
+
* Otomatis disembunyikan saat sidebar vertical sedang collapsed (rail icon-only)
|
|
2071
|
+
* dengan membaca `NAVIGATION_SHELL`.
|
|
2072
|
+
*/
|
|
2073
|
+
class NavigationFooterTitleComponent {
|
|
2074
|
+
shell = inject(NAVIGATION_SHELL, { optional: true });
|
|
2075
|
+
title = input('', /* @ts-ignore */
|
|
2076
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2077
|
+
subtitle = input(null, /* @ts-ignore */
|
|
2078
|
+
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
2079
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2080
|
+
collapsed = computed(() => {
|
|
2081
|
+
const state = this.shell?.displayState();
|
|
2082
|
+
return state ? state.orientation === 'vertical' && state.collapsed : false;
|
|
2083
|
+
}, /* @ts-ignore */
|
|
2084
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
2085
|
+
hostClasses = computed(() => cn(this.collapsed() ? 'hidden' : 'flex min-w-0 flex-col justify-center', this.class()), /* @ts-ignore */
|
|
2086
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2087
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2088
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationFooterTitleComponent, isStandalone: true, selector: "NavigationFooterTitle", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.data-collapsed": "collapsed()" } }, ngImport: i0, template: `
|
|
2089
|
+
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
2090
|
+
title()
|
|
2091
|
+
}}</span>
|
|
2092
|
+
@if (subtitle(); as sub) {
|
|
2093
|
+
<span class="block truncate text-xs leading-tight text-muted-foreground">{{ sub }}</span>
|
|
2094
|
+
}
|
|
2095
|
+
`, isInline: true });
|
|
2096
|
+
}
|
|
2097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationFooterTitleComponent, decorators: [{
|
|
2098
|
+
type: Component,
|
|
2099
|
+
args: [{
|
|
2100
|
+
selector: 'NavigationFooterTitle',
|
|
2101
|
+
host: {
|
|
2102
|
+
'[class]': 'hostClasses()',
|
|
2103
|
+
'[attr.data-collapsed]': 'collapsed()',
|
|
2104
|
+
},
|
|
2105
|
+
template: `
|
|
2106
|
+
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
2107
|
+
title()
|
|
2108
|
+
}}</span>
|
|
2109
|
+
@if (subtitle(); as sub) {
|
|
2110
|
+
<span class="block truncate text-xs leading-tight text-muted-foreground">{{ sub }}</span>
|
|
2111
|
+
}
|
|
2112
|
+
`,
|
|
2113
|
+
}]
|
|
2114
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2115
|
+
|
|
2116
|
+
/**
|
|
2117
|
+
* Blok avatar/inisial untuk slot `NavigationHeader` (brand/logo). Consumer cukup
|
|
2118
|
+
* memberi `name`; inisial diturunkan otomatis ("Ojie Permana" → "OP"). Beri `src`
|
|
2119
|
+
* untuk gambar, `icon` (material symbol) sebagai ganti inisial, atau `initials`
|
|
2120
|
+
* untuk override manual.
|
|
2121
|
+
*
|
|
2122
|
+
* Selalu tampil baik saat sidebar expanded maupun collapsed karena ukurannya muat
|
|
2123
|
+
* di rail icon-only — pasangannya, `NavigationHeaderTitle`, yang menyembunyikan
|
|
2124
|
+
* diri saat collapsed.
|
|
2125
|
+
*/
|
|
2126
|
+
class NavigationHeaderInitialComponent {
|
|
2127
|
+
name = input('', /* @ts-ignore */
|
|
2128
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
2129
|
+
src = input(null, /* @ts-ignore */
|
|
2130
|
+
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
2131
|
+
initials = input(null, /* @ts-ignore */
|
|
2132
|
+
...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
2133
|
+
icon = input(null, /* @ts-ignore */
|
|
2134
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2135
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2136
|
+
resolvedInitials = computed(() => this.initials()?.slice(0, 2).toUpperCase() || deriveNavigationInitials(this.name()), /* @ts-ignore */
|
|
2137
|
+
...(ngDevMode ? [{ debugName: "resolvedInitials" }] : /* istanbul ignore next */ []));
|
|
2138
|
+
hostClasses = computed(() => cn('inline-flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-md bg-primary/10 text-primary', this.class()), /* @ts-ignore */
|
|
2139
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderInitialComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationHeaderInitialComponent, isStandalone: true, selector: "NavigationHeaderInitial", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "name() ? 'img' : null", "attr.aria-label": "name() || null" } }, ngImport: i0, template: `
|
|
2142
|
+
@if (src(); as source) {
|
|
2143
|
+
<img [src]="source" alt="" class="h-full w-full rounded-[inherit] object-cover" />
|
|
2144
|
+
} @else if (icon(); as glyph) {
|
|
2145
|
+
<Icon [name]="glyph" [size]="18" />
|
|
2146
|
+
} @else {
|
|
2147
|
+
<span class="text-xs font-semibold leading-none">{{ resolvedInitials() }}</span>
|
|
2148
|
+
}
|
|
2149
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "Icon", inputs: ["name", "class", "size", "fill", "weight", "grade", "opticalSize"] }] });
|
|
2150
|
+
}
|
|
2151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderInitialComponent, decorators: [{
|
|
2152
|
+
type: Component,
|
|
2153
|
+
args: [{
|
|
2154
|
+
selector: 'NavigationHeaderInitial',
|
|
2155
|
+
imports: [IconComponent],
|
|
2156
|
+
host: {
|
|
2157
|
+
'[class]': 'hostClasses()',
|
|
2158
|
+
'[attr.role]': "name() ? 'img' : null",
|
|
2159
|
+
'[attr.aria-label]': 'name() || null',
|
|
2160
|
+
},
|
|
2161
|
+
template: `
|
|
2162
|
+
@if (src(); as source) {
|
|
2163
|
+
<img [src]="source" alt="" class="h-full w-full rounded-[inherit] object-cover" />
|
|
2164
|
+
} @else if (icon(); as glyph) {
|
|
2165
|
+
<Icon [name]="glyph" [size]="18" />
|
|
2166
|
+
} @else {
|
|
2167
|
+
<span class="text-xs font-semibold leading-none">{{ resolvedInitials() }}</span>
|
|
2168
|
+
}
|
|
2169
|
+
`,
|
|
2170
|
+
}]
|
|
2171
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Judul + subjudul untuk slot `NavigationHeader`. Otomatis disembunyikan saat
|
|
2175
|
+
* sidebar vertical sedang collapsed (rail icon-only) dengan membaca
|
|
2176
|
+
* `NAVIGATION_SHELL` — consumer tidak perlu mengelola state collapse sendiri.
|
|
2177
|
+
*/
|
|
2178
|
+
class NavigationHeaderTitleComponent {
|
|
2179
|
+
shell = inject(NAVIGATION_SHELL, { optional: true });
|
|
2180
|
+
title = input('', /* @ts-ignore */
|
|
2181
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2182
|
+
subtitle = input(null, /* @ts-ignore */
|
|
2183
|
+
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
2184
|
+
class = input('', { ...(ngDevMode ? { debugName: "class" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2185
|
+
collapsed = computed(() => {
|
|
2186
|
+
const state = this.shell?.displayState();
|
|
2187
|
+
return state ? state.orientation === 'vertical' && state.collapsed : false;
|
|
2188
|
+
}, /* @ts-ignore */
|
|
2189
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
2190
|
+
hostClasses = computed(() => cn(this.collapsed() ? 'hidden' : 'flex min-w-0 flex-col justify-center', this.class()), /* @ts-ignore */
|
|
2191
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NavigationHeaderTitleComponent, isStandalone: true, selector: "NavigationHeaderTitle", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.data-collapsed": "collapsed()" } }, ngImport: i0, template: `
|
|
2194
|
+
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
2195
|
+
title()
|
|
2196
|
+
}}</span>
|
|
2197
|
+
@if (subtitle(); as sub) {
|
|
2198
|
+
<span class="block truncate text-xs leading-tight text-muted-foreground">{{ sub }}</span>
|
|
2199
|
+
}
|
|
2200
|
+
`, isInline: true });
|
|
2201
|
+
}
|
|
2202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NavigationHeaderTitleComponent, decorators: [{
|
|
2203
|
+
type: Component,
|
|
2204
|
+
args: [{
|
|
2205
|
+
selector: 'NavigationHeaderTitle',
|
|
2206
|
+
host: {
|
|
2207
|
+
'[class]': 'hostClasses()',
|
|
2208
|
+
'[attr.data-collapsed]': 'collapsed()',
|
|
2209
|
+
},
|
|
2210
|
+
template: `
|
|
2211
|
+
<span class="block truncate text-sm font-semibold leading-tight text-foreground">{{
|
|
2212
|
+
title()
|
|
2213
|
+
}}</span>
|
|
2214
|
+
@if (subtitle(); as sub) {
|
|
2215
|
+
<span class="block truncate text-xs leading-tight text-muted-foreground">{{ sub }}</span>
|
|
2216
|
+
}
|
|
2217
|
+
`,
|
|
2218
|
+
}]
|
|
2219
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* Generated bundle index. Do not edit.
|
|
2223
|
+
*/
|
|
2224
|
+
|
|
2225
|
+
export { NavigationItemComponent as N, NavigationItemContentComponent as a, NavigationListComponent as b, NavigationCollapseExpandedDirective as c, NavigationCollapseRootDirective as d, NavigationContainerComponent as e, NavigationContentComponent as f, NavigationDockbarComponent as g, NavigationFlyoutComponent as h, NavigationFooterActionComponent as i, NavigationFooterComponent as j, NavigationFooterInitialComponent as k, NavigationFooterTitleComponent as l, NavigationHeaderComponent as m, NavigationHeaderInitialComponent as n, NavigationHeaderTitleComponent as o, NavigationIconDirective as p, NavigationNavbarComponent as q, NavigationSidebarComponent as r, deriveNavigationInitials as s, normalizeUiNavItems as t };
|