@tectra-ng/ui 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/accordion/README.md +61 -0
  2. package/breadcrumb/README.md +57 -0
  3. package/fesm2022/tectra-ng-ui-accordion.mjs +980 -0
  4. package/fesm2022/tectra-ng-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
  6. package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
  7. package/fesm2022/tectra-ng-ui-breadcrumb.mjs +382 -0
  8. package/fesm2022/tectra-ng-ui-breadcrumb.mjs.map +1 -0
  9. package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
  10. package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
  11. package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
  12. package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
  13. package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
  14. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
  15. package/fesm2022/tectra-ng-ui-field.mjs +1 -1
  16. package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
  17. package/fesm2022/tectra-ng-ui-file-upload.mjs +1452 -0
  18. package/fesm2022/tectra-ng-ui-file-upload.mjs.map +1 -0
  19. package/fesm2022/tectra-ng-ui-input-group.mjs +2 -2
  20. package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -1
  21. package/fesm2022/tectra-ng-ui-input.mjs +2 -2
  22. package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
  23. package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
  24. package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
  25. package/fesm2022/tectra-ng-ui-menubar.mjs +742 -0
  26. package/fesm2022/tectra-ng-ui-menubar.mjs.map +1 -0
  27. package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
  28. package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
  29. package/fesm2022/tectra-ng-ui-panel-menu.mjs +610 -0
  30. package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -0
  31. package/fesm2022/tectra-ng-ui-scroll-panel.mjs +319 -0
  32. package/fesm2022/tectra-ng-ui-scroll-panel.mjs.map +1 -0
  33. package/fesm2022/tectra-ng-ui-select.mjs +2 -2
  34. package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
  35. package/fesm2022/tectra-ng-ui-splitter.mjs +750 -0
  36. package/fesm2022/tectra-ng-ui-splitter.mjs.map +1 -0
  37. package/fesm2022/tectra-ng-ui-stepper.mjs +1166 -0
  38. package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -0
  39. package/fesm2022/tectra-ng-ui-table.mjs +194 -50
  40. package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
  41. package/fesm2022/tectra-ng-ui-tabs.mjs +1218 -0
  42. package/fesm2022/tectra-ng-ui-tabs.mjs.map +1 -0
  43. package/fesm2022/tectra-ng-ui-textarea.mjs +4 -1
  44. package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -1
  45. package/fesm2022/tectra-ng-ui-toolbar.mjs +348 -0
  46. package/fesm2022/tectra-ng-ui-toolbar.mjs.map +1 -0
  47. package/fesm2022/tectra-ng-ui-tree-select.mjs +2 -2
  48. package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
  49. package/fesm2022/tectra-ng-ui-tree-table.mjs +80 -2
  50. package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
  51. package/field/README.md +1 -1
  52. package/file-upload/README.md +85 -0
  53. package/menubar/README.md +51 -0
  54. package/package.json +44 -4
  55. package/panel-menu/README.md +45 -0
  56. package/scroll-panel/README.md +35 -0
  57. package/splitter/README.md +62 -0
  58. package/stepper/README.md +66 -0
  59. package/table/README.md +1 -1
  60. package/tabs/README.md +69 -0
  61. package/toolbar/README.md +35 -0
  62. package/types/tectra-ng-ui-accordion.d.ts +304 -0
  63. package/types/tectra-ng-ui-accordion.d.ts.map +1 -0
  64. package/types/tectra-ng-ui-breadcrumb.d.ts +157 -0
  65. package/types/tectra-ng-ui-breadcrumb.d.ts.map +1 -0
  66. package/types/tectra-ng-ui-file-upload.d.ts +527 -0
  67. package/types/tectra-ng-ui-file-upload.d.ts.map +1 -0
  68. package/types/tectra-ng-ui-menubar.d.ts +201 -0
  69. package/types/tectra-ng-ui-menubar.d.ts.map +1 -0
  70. package/types/tectra-ng-ui-panel-menu.d.ts +244 -0
  71. package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -0
  72. package/types/tectra-ng-ui-scroll-panel.d.ts +94 -0
  73. package/types/tectra-ng-ui-scroll-panel.d.ts.map +1 -0
  74. package/types/tectra-ng-ui-splitter.d.ts +226 -0
  75. package/types/tectra-ng-ui-splitter.d.ts.map +1 -0
  76. package/types/tectra-ng-ui-stepper.d.ts +446 -0
  77. package/types/tectra-ng-ui-stepper.d.ts.map +1 -0
  78. package/types/tectra-ng-ui-table.d.ts +2 -4
  79. package/types/tectra-ng-ui-table.d.ts.map +1 -1
  80. package/types/tectra-ng-ui-tabs.d.ts +420 -0
  81. package/types/tectra-ng-ui-tabs.d.ts.map +1 -0
  82. package/types/tectra-ng-ui-textarea.d.ts +1 -0
  83. package/types/tectra-ng-ui-textarea.d.ts.map +1 -1
  84. package/types/tectra-ng-ui-toolbar.d.ts +85 -0
  85. package/types/tectra-ng-ui-toolbar.d.ts.map +1 -0
  86. package/types/tectra-ng-ui-tree-table.d.ts.map +1 -1
@@ -0,0 +1,742 @@
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, TemplateRef, ViewContainerRef, booleanAttribute, computed, contentChild, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { RouterLink } from "@angular/router";
5
+ import { TxTypeahead, uniqueId } from "@tectra-ng/core/a11y";
6
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
7
+ import { injectTranslations } from "@tectra-ng/core/i18n";
8
+ import { TxOverlay } from "@tectra-ng/core/overlay";
9
+ import { optionalBoolean } from "@tectra-ng/core/utils";
10
+ import { TxIcon } from "@tectra-ng/icons";
11
+ import { toStyleObject } from "@tectra-ng/themes";
12
+ import { TxBadge } from "@tectra-ng/ui/badge";
13
+ import { TxMenuList } from "@tectra-ng/ui/menu";
14
+ var TxMenubarItemTemplate = class TxMenubarItemTemplate {
15
+ template = inject(TemplateRef);
16
+ static ngTemplateContextGuard(_directive, context) {
17
+ return !!context;
18
+ }
19
+ static ɵfac = i0.ɵɵngDeclareFactory({
20
+ minVersion: "12.0.0",
21
+ version: "22.2.3",
22
+ ngImport: i0,
23
+ type: TxMenubarItemTemplate,
24
+ deps: [],
25
+ target: i0.ɵɵFactoryTarget.Directive
26
+ });
27
+ static ɵdir = i0.ɵɵngDeclareDirective({
28
+ minVersion: "14.0.0",
29
+ version: "22.2.3",
30
+ type: TxMenubarItemTemplate,
31
+ isStandalone: true,
32
+ selector: "ng-template[txMenubarItem]",
33
+ ngImport: i0
34
+ });
35
+ };
36
+ i0.ɵɵngDeclareClassMetadata({
37
+ minVersion: "12.0.0",
38
+ version: "22.2.3",
39
+ ngImport: i0,
40
+ type: TxMenubarItemTemplate,
41
+ decorators: [{
42
+ type: Directive,
43
+ args: [{ selector: "ng-template[txMenubarItem]" }]
44
+ }]
45
+ });
46
+ var TxMenubar = class TxMenubar {
47
+ host = inject(ElementRef).nativeElement;
48
+ document = inject(DOCUMENT);
49
+ overlay = inject(TxOverlay);
50
+ viewContainerRef = inject(ViewContainerRef);
51
+ typeahead = new TxTypeahead();
52
+ baseId = uniqueId("tx-menubar");
53
+ submenu = null;
54
+ stopWatchingOutside = () => void 0;
55
+ model = input([], ...ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []);
56
+ autoDisplay = input(false, {
57
+ ...ngDevMode ? { debugName: "autoDisplay" } : /* istanbul ignore next */ {},
58
+ transform: booleanAttribute
59
+ });
60
+ breakpoint = input("960px", ...ngDevMode ? [{ debugName: "breakpoint" }] : /* istanbul ignore next */ []);
61
+ ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
62
+ ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
63
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
64
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
65
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
66
+ unstyled = input(void 0, {
67
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
68
+ transform: optionalBoolean
69
+ });
70
+ itemClick = output();
71
+ focused = output();
72
+ blurred = output();
73
+ itemTemplate = contentChild(TxMenubarItemTemplate, ...ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []);
74
+ submenuTemplate = viewChild.required("submenu", ...ngDevMode ? [{ debugName: "submenuTemplate" }] : /* istanbul ignore next */ []);
75
+ listId = `${this.baseId}-list`;
76
+ translations = injectTranslations();
77
+ isUnstyled = injectUnstyled(this.unstyled);
78
+ passThrough = injectPassThrough("menubar", this, this.pt, this.ptOptions);
79
+ hostStyle = computed(() => ({
80
+ ...toStyleObject(this.dt(), "--tx-menubar"),
81
+ ...this.passThrough().root?.style
82
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
83
+ submenuPt = computed(() => ({ root: this.passThrough().submenu }), ...ngDevMode ? [{ debugName: "submenuPt" }] : /* istanbul ignore next */ []);
84
+ entries = computed(() => this.build(this.model(), "", 0), ...ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []);
85
+ openKey = signal(null, ...ngDevMode ? [{ debugName: "openKey" }] : /* istanbul ignore next */ []);
86
+ focusKey = signal(null, ...ngDevMode ? [{ debugName: "focusKey" }] : /* istanbul ignore next */ []);
87
+ mobile = signal(false, ...ngDevMode ? [{ debugName: "mobile" }] : /* istanbul ignore next */ []);
88
+ mobileOpen = signal(false, ...ngDevMode ? [{ debugName: "mobileOpen" }] : /* istanbul ignore next */ []);
89
+ expanded = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
90
+ firstKey = computed(() => this.entries().find((entry) => !entry.item.separator && !entry.item.disabled)?.key ?? null, ...ngDevMode ? [{ debugName: "firstKey" }] : /* istanbul ignore next */ []);
91
+ constructor() {
92
+ effect((onCleanup) => {
93
+ const query = `(max-width: ${this.breakpoint()})`;
94
+ const view = this.document.defaultView;
95
+ if (!view?.matchMedia) return;
96
+ const media = view.matchMedia(query);
97
+ const update = () => {
98
+ this.mobile.set(media.matches);
99
+ this.closeSubmenu();
100
+ this.mobileOpen.set(false);
101
+ };
102
+ untracked(update);
103
+ media.addEventListener?.("change", update);
104
+ onCleanup(() => media.removeEventListener?.("change", update));
105
+ });
106
+ inject(DestroyRef).onDestroy(() => {
107
+ this.stopWatchingOutside();
108
+ this.submenu?.ref.close("api");
109
+ });
110
+ }
111
+ hasChildren(entry) {
112
+ return entry.children.some((child) => !child.item.separator);
113
+ }
114
+ tabIndex(entry) {
115
+ return entry.key === (this.focusKey() ?? this.firstKey()) ? 0 : -1;
116
+ }
117
+ isExpanded(entry) {
118
+ return this.mobile() ? this.expanded().has(entry.key) : this.openKey() === entry.key;
119
+ }
120
+ context(entry) {
121
+ return {
122
+ $implicit: entry.item,
123
+ hasSubmenu: this.hasChildren(entry)
124
+ };
125
+ }
126
+ childItems(entry) {
127
+ return entry.item.items ?? [];
128
+ }
129
+ toggleMobile() {
130
+ this.mobileOpen.update((open) => !open);
131
+ if (this.mobileOpen()) this.watchOutside();
132
+ else this.stopWatchingOutside();
133
+ }
134
+ onItemClick(entry, event) {
135
+ if (entry.item.disabled) {
136
+ event.preventDefault();
137
+ return;
138
+ }
139
+ if (this.hasChildren(entry)) {
140
+ if (this.mobile()) this.toggleExpanded(entry);
141
+ else if (this.openKey() === entry.key) this.closeSubmenu();
142
+ else this.openSubmenu(entry, event.detail === 0 ? "first" : null);
143
+ return;
144
+ }
145
+ this.select(entry, event);
146
+ }
147
+ onItemEnter(entry) {
148
+ if (this.mobile() || entry.level > 0 || entry.item.disabled) return;
149
+ if (this.openKey() === null && !this.autoDisplay()) return;
150
+ if (this.hasChildren(entry)) this.openSubmenu(entry, null);
151
+ else this.closeSubmenu();
152
+ }
153
+ onItemFocus(entry) {
154
+ this.focusKey.set(entry.key);
155
+ }
156
+ onKeydown(event) {
157
+ const target = event.target;
158
+ const entry = this.entryOf(target);
159
+ if (!entry) return;
160
+ if (this.mobile()) {
161
+ this.onMobileKeydown(event, entry);
162
+ return;
163
+ }
164
+ switch (event.key) {
165
+ case "ArrowRight":
166
+ event.preventDefault();
167
+ this.moveRoot(entry, 1, false);
168
+ return;
169
+ case "ArrowLeft":
170
+ event.preventDefault();
171
+ this.moveRoot(entry, -1, false);
172
+ return;
173
+ case "Home":
174
+ event.preventDefault();
175
+ this.focusEntry(this.navigable(this.entries())[0]);
176
+ return;
177
+ case "End": {
178
+ event.preventDefault();
179
+ const items = this.navigable(this.entries());
180
+ this.focusEntry(items[items.length - 1]);
181
+ return;
182
+ }
183
+ case "ArrowDown":
184
+ case "ArrowUp":
185
+ if (this.hasChildren(entry) && !entry.item.disabled) {
186
+ event.preventDefault();
187
+ this.openSubmenu(entry, event.key === "ArrowDown" ? "first" : "last");
188
+ }
189
+ return;
190
+ case "Enter":
191
+ case " ":
192
+ event.preventDefault();
193
+ if (this.hasChildren(entry)) this.openSubmenu(entry, "first");
194
+ else target.click();
195
+ return;
196
+ case "Escape":
197
+ this.closeSubmenu();
198
+ return;
199
+ default: this.search(event, entry, this.navigable(this.entries()));
200
+ }
201
+ }
202
+ onSubmenuKeydown(event) {
203
+ const key = this.submenu?.key;
204
+ const entry = this.entries().find((item) => item.key === key);
205
+ if (!entry || event.defaultPrevented) return;
206
+ if (event.key === "ArrowRight" && !event.target.hasAttribute("aria-haspopup")) {
207
+ event.preventDefault();
208
+ this.moveRoot(entry, 1, true);
209
+ }
210
+ }
211
+ onSubmenuLeave() {
212
+ const entry = this.entries().find((item) => item.key === this.submenu?.key);
213
+ if (entry) this.moveRoot(entry, -1, true);
214
+ }
215
+ onSubmenuSelected(event) {
216
+ this.closeSubmenu();
217
+ this.itemClick.emit(event);
218
+ }
219
+ closeSubmenu() {
220
+ this.submenu?.ref.close("api");
221
+ }
222
+ onFocusIn(event) {
223
+ if (!(event.relatedTarget instanceof Node) || !this.host.contains(event.relatedTarget)) this.focused.emit(event);
224
+ }
225
+ onFocusOut(event) {
226
+ if (!(event.relatedTarget instanceof Node) || !this.host.contains(event.relatedTarget)) this.blurred.emit(event);
227
+ }
228
+ select(entry, event) {
229
+ const itemEvent = {
230
+ item: entry.item,
231
+ originalEvent: event
232
+ };
233
+ entry.item.command?.(itemEvent);
234
+ this.itemClick.emit(itemEvent);
235
+ this.closeSubmenu();
236
+ if (this.mobile()) {
237
+ this.mobileOpen.set(false);
238
+ this.stopWatchingOutside();
239
+ }
240
+ }
241
+ toggleExpanded(entry) {
242
+ this.expanded.update((keys) => {
243
+ const next = new Set(keys);
244
+ if (next.has(entry.key)) [...next].filter((key) => key === entry.key || key.startsWith(`${entry.key}-`)).forEach((key) => next.delete(key));
245
+ else {
246
+ [...next].filter((key) => this.isSibling(key, entry)).forEach((key) => next.delete(key));
247
+ next.add(entry.key);
248
+ }
249
+ return next;
250
+ });
251
+ }
252
+ isSibling(key, entry) {
253
+ const parent = entry.key.split("-").slice(0, -1).join("-");
254
+ const keyParent = key.split("-").slice(0, -1).join("-");
255
+ return key !== entry.key && keyParent === parent;
256
+ }
257
+ openSubmenu(entry, focus) {
258
+ if (this.submenu?.key === entry.key) {
259
+ if (focus) this.submenu.ref.element.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus();
260
+ return;
261
+ }
262
+ this.closeSubmenu();
263
+ const origin = this.elementOf(entry);
264
+ if (!origin) return;
265
+ const ref = this.overlay.open(this.submenuTemplate(), {
266
+ origin,
267
+ viewContainerRef: this.viewContainerRef,
268
+ context: {
269
+ $implicit: this.childItems(entry),
270
+ focus
271
+ },
272
+ placement: "bottom-start",
273
+ offset: 4,
274
+ layer: "dropdown",
275
+ closeOnOutsideClick: false,
276
+ restoreFocus: focus !== null
277
+ });
278
+ this.submenu = {
279
+ key: entry.key,
280
+ ref
281
+ };
282
+ this.openKey.set(entry.key);
283
+ this.watchOutside();
284
+ ref.closed.subscribe(() => {
285
+ if (this.submenu?.ref === ref) {
286
+ this.submenu = null;
287
+ this.openKey.set(null);
288
+ this.stopWatchingOutside();
289
+ }
290
+ });
291
+ }
292
+ watchOutside() {
293
+ this.stopWatchingOutside();
294
+ const listener = (event) => {
295
+ const target = event.target;
296
+ if (target instanceof Element && (this.host.contains(target) || target.closest("tx-menu-list"))) return;
297
+ this.closeSubmenu();
298
+ this.mobileOpen.set(false);
299
+ this.stopWatchingOutside();
300
+ };
301
+ this.document.addEventListener("pointerdown", listener, true);
302
+ this.stopWatchingOutside = () => {
303
+ this.document.removeEventListener("pointerdown", listener, true);
304
+ this.stopWatchingOutside = () => void 0;
305
+ };
306
+ }
307
+ moveRoot(entry, delta, open) {
308
+ const items = this.navigable(this.entries());
309
+ const next = items[(items.findIndex((item) => item.key === entry.key) + delta + items.length) % items.length];
310
+ if (!next) return;
311
+ const wasOpen = this.submenu !== null;
312
+ this.closeSubmenu();
313
+ this.focusEntry(next);
314
+ if ((open || wasOpen) && this.hasChildren(next)) this.openSubmenu(next, open ? "first" : null);
315
+ }
316
+ onMobileKeydown(event, entry) {
317
+ const visible = this.visibleMobileEntries();
318
+ const index = visible.findIndex((item) => item.key === entry.key);
319
+ switch (event.key) {
320
+ case "ArrowDown":
321
+ event.preventDefault();
322
+ this.focusEntry(visible[(index + 1) % visible.length]);
323
+ return;
324
+ case "ArrowUp":
325
+ event.preventDefault();
326
+ this.focusEntry(visible[(index - 1 + visible.length) % visible.length]);
327
+ return;
328
+ case "Home":
329
+ event.preventDefault();
330
+ this.focusEntry(visible[0]);
331
+ return;
332
+ case "End":
333
+ event.preventDefault();
334
+ this.focusEntry(visible[visible.length - 1]);
335
+ return;
336
+ case "ArrowRight":
337
+ if (this.hasChildren(entry) && !entry.item.disabled) {
338
+ event.preventDefault();
339
+ if (!this.expanded().has(entry.key)) this.toggleExpanded(entry);
340
+ }
341
+ return;
342
+ case "ArrowLeft": {
343
+ event.preventDefault();
344
+ if (this.expanded().has(entry.key)) {
345
+ this.toggleExpanded(entry);
346
+ return;
347
+ }
348
+ const parent = this.findEntry(entry.key.split("-").slice(0, -1).join("-"));
349
+ if (parent) {
350
+ this.toggleExpanded(parent);
351
+ this.focusEntry(parent);
352
+ }
353
+ return;
354
+ }
355
+ case "Enter":
356
+ case " ":
357
+ event.preventDefault();
358
+ event.target.click();
359
+ return;
360
+ case "Escape":
361
+ this.mobileOpen.set(false);
362
+ this.stopWatchingOutside();
363
+ this.host.querySelector(".tx-menubar__button")?.focus();
364
+ return;
365
+ default: this.search(event, entry, visible);
366
+ }
367
+ }
368
+ search(event, entry, items) {
369
+ if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;
370
+ const found = this.typeahead.search(event.key, items.map((item) => item.item.label ?? ""), items.indexOf(entry));
371
+ if (found !== null) this.focusEntry(items[found]);
372
+ }
373
+ visibleMobileEntries() {
374
+ const result = [];
375
+ const walk = (entries) => {
376
+ for (const entry of this.navigable(entries)) {
377
+ result.push(entry);
378
+ if (this.expanded().has(entry.key)) walk(entry.children);
379
+ }
380
+ };
381
+ walk(this.entries());
382
+ return result;
383
+ }
384
+ navigable(entries) {
385
+ return entries.filter((entry) => !entry.item.separator && !entry.item.disabled);
386
+ }
387
+ focusEntry(entry) {
388
+ if (!entry) return;
389
+ this.focusKey.set(entry.key);
390
+ this.elementOf(entry)?.focus();
391
+ }
392
+ elementOf(entry) {
393
+ return this.host.querySelector(`#${entry.id}`);
394
+ }
395
+ entryOf(element) {
396
+ const key = element.closest("[data-key]")?.dataset["key"];
397
+ return key === void 0 ? void 0 : this.findEntry(key);
398
+ }
399
+ findEntry(key) {
400
+ const walk = (entries) => {
401
+ for (const entry of entries) {
402
+ if (entry.key === key) return entry;
403
+ const found = walk(entry.children);
404
+ if (found) return found;
405
+ }
406
+ };
407
+ return walk(this.entries());
408
+ }
409
+ build(items, parent, level) {
410
+ return items.filter((item) => item.visible !== false).map((item, index) => {
411
+ const key = parent ? `${parent}-${index}` : `${index}`;
412
+ return {
413
+ item,
414
+ key,
415
+ id: `${this.baseId}-${key}`,
416
+ level,
417
+ children: item.items ? this.build(item.items, key, level + 1) : []
418
+ };
419
+ });
420
+ }
421
+ static ɵfac = i0.ɵɵngDeclareFactory({
422
+ minVersion: "12.0.0",
423
+ version: "22.2.3",
424
+ ngImport: i0,
425
+ type: TxMenubar,
426
+ deps: [],
427
+ target: i0.ɵɵFactoryTarget.Component
428
+ });
429
+ static ɵcmp = i0.ɵɵngDeclareComponent({
430
+ minVersion: "17.0.0",
431
+ version: "22.2.3",
432
+ type: TxMenubar,
433
+ isStandalone: true,
434
+ selector: "tx-menubar",
435
+ inputs: {
436
+ model: {
437
+ classPropertyName: "model",
438
+ publicName: "model",
439
+ isSignal: true,
440
+ isRequired: false,
441
+ transformFunction: null
442
+ },
443
+ autoDisplay: {
444
+ classPropertyName: "autoDisplay",
445
+ publicName: "autoDisplay",
446
+ isSignal: true,
447
+ isRequired: false,
448
+ transformFunction: null
449
+ },
450
+ breakpoint: {
451
+ classPropertyName: "breakpoint",
452
+ publicName: "breakpoint",
453
+ isSignal: true,
454
+ isRequired: false,
455
+ transformFunction: null
456
+ },
457
+ ariaLabel: {
458
+ classPropertyName: "ariaLabel",
459
+ publicName: "ariaLabel",
460
+ isSignal: true,
461
+ isRequired: false,
462
+ transformFunction: null
463
+ },
464
+ ariaLabelledBy: {
465
+ classPropertyName: "ariaLabelledBy",
466
+ publicName: "ariaLabelledBy",
467
+ isSignal: true,
468
+ isRequired: false,
469
+ transformFunction: null
470
+ },
471
+ dt: {
472
+ classPropertyName: "dt",
473
+ publicName: "dt",
474
+ isSignal: true,
475
+ isRequired: false,
476
+ transformFunction: null
477
+ },
478
+ pt: {
479
+ classPropertyName: "pt",
480
+ publicName: "pt",
481
+ isSignal: true,
482
+ isRequired: false,
483
+ transformFunction: null
484
+ },
485
+ ptOptions: {
486
+ classPropertyName: "ptOptions",
487
+ publicName: "ptOptions",
488
+ isSignal: true,
489
+ isRequired: false,
490
+ transformFunction: null
491
+ },
492
+ unstyled: {
493
+ classPropertyName: "unstyled",
494
+ publicName: "unstyled",
495
+ isSignal: true,
496
+ isRequired: false,
497
+ transformFunction: null
498
+ }
499
+ },
500
+ outputs: {
501
+ itemClick: "itemClick",
502
+ focused: "focused",
503
+ blurred: "blurred"
504
+ },
505
+ host: {
506
+ listeners: {
507
+ "focusin": "onFocusIn($event)",
508
+ "focusout": "onFocusOut($event)"
509
+ },
510
+ properties: {
511
+ "class": "passThrough().root?.class",
512
+ "style": "hostStyle()",
513
+ "attr.data-styled": "!isUnstyled() || null",
514
+ "class.tx-menubar--mobile": "mobile()",
515
+ "class.tx-menubar--mobile-open": "mobile() && mobileOpen()"
516
+ },
517
+ classAttribute: "tx-menubar"
518
+ },
519
+ queries: [{
520
+ propertyName: "itemTemplate",
521
+ first: true,
522
+ predicate: TxMenubarItemTemplate,
523
+ descendants: true,
524
+ isSignal: true
525
+ }],
526
+ viewQueries: [{
527
+ propertyName: "submenuTemplate",
528
+ first: true,
529
+ predicate: ["submenu"],
530
+ descendants: true,
531
+ isSignal: true
532
+ }],
533
+ ngImport: i0,
534
+ template: "<div class=\"tx-menubar__start\" [class]=\"passThrough().start?.class\" [style]=\"passThrough().start?.style\"><ng-content select=\"[txMenubarStart]\" /></div>\n@if (mobile()) {\n <button\n type=\"button\"\n class=\"tx-menubar__button\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"translations().menu\"\n [attr.aria-expanded]=\"mobileOpen()\"\n [attr.aria-controls]=\"listId\"\n [class]=\"passThrough().mobileButton?.class\"\n [style]=\"passThrough().mobileButton?.style\"\n (click)=\"toggleMobile()\"\n >\n <tx-icon name=\"bars\" />\n </button>\n}\n<ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: entries(), root: true }\" />\n<div class=\"tx-menubar__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\"><ng-content select=\"[txMenubarEnd]\" /></div>\n\n<ng-template #list let-entries let-root=\"root\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the menu items inside take focus; the list handles their arrow keys -->\n <ul\n class=\"tx-menubar__list\"\n [class.tx-menubar__list--root]=\"root\"\n [class.tx-menubar__list--sub]=\"!root\"\n [attr.id]=\"root ? listId : null\"\n [attr.role]=\"root ? 'menubar' : 'menu'\"\n [attr.aria-orientation]=\"root && !mobile() ? 'horizontal' : 'vertical'\"\n [attr.aria-label]=\"root ? (ariaLabel() ?? null) : null\"\n [attr.aria-labelledby]=\"root ? (ariaLabelledBy() ?? null) : null\"\n [class]=\"root ? passThrough().list?.class : null\"\n [style]=\"root ? passThrough().list?.style : null\"\n (keydown)=\"root && onKeydown($event)\"\n >\n @for (entry of entries; track entry.key) {\n @if (entry.item.separator) {\n <li role=\"separator\" class=\"tx-menubar__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></li>\n } @else {\n <li role=\"none\" class=\"tx-menubar__entry\" [attr.data-key]=\"entry.key\" [class.tx-menubar__entry--expanded]=\"isExpanded(entry)\">\n @if (entry.item.routerLink && !entry.item.disabled && !hasChildren(entry)) {\n <a\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [routerLink]=\"entry.item.routerLink\"\n [queryParams]=\"entry.item.queryParams\"\n [fragment]=\"entry.item.fragment\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </a>\n } @else if (entry.item.url && !entry.item.disabled && !hasChildren(entry)) {\n <a\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [attr.href]=\"entry.item.url\"\n [attr.target]=\"entry.item.target ?? null\"\n [attr.rel]=\"entry.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </a>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- Enter / Space are handled by the list keydown -->\n <div\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [attr.aria-disabled]=\"entry.item.disabled || null\"\n [attr.aria-haspopup]=\"hasChildren(entry) ? 'menu' : null\"\n [attr.aria-expanded]=\"hasChildren(entry) ? isExpanded(entry) : null\"\n [attr.aria-controls]=\"hasChildren(entry) && mobile() ? entry.id + '-menu' : null\"\n [attr.data-severity]=\"entry.item.severity ?? null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </div>\n }\n @if (mobile() && hasChildren(entry)) {\n <div class=\"tx-menubar__collapse\" [id]=\"entry.id + '-menu'\" [attr.inert]=\"isExpanded(entry) ? null : ''\">\n <div class=\"tx-menubar__collapse-inner\">\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: entry.children, root: false }\" />\n </div>\n </div>\n }\n </li>\n }\n }\n </ul>\n</ng-template>\n\n<ng-template #content let-entry>\n @if (itemTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"context(entry)\" />\n } @else {\n @if (entry.item.icon) {\n <tx-icon class=\"tx-menubar__icon\" aria-hidden=\"true\" [name]=\"entry.item.icon\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n }\n <span class=\"tx-menubar__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ entry.item.label }}</span>\n @if (entry.item.badge !== undefined && entry.item.badge !== null) {\n <tx-badge class=\"tx-menubar__badge\" size=\"small\" severity=\"secondary\" [value]=\"entry.item.badge\" [unstyled]=\"isUnstyled()\" />\n }\n @if (hasChildren(entry)) {\n <tx-icon\n class=\"tx-menubar__submenu-icon\"\n aria-hidden=\"true\"\n [name]=\"mobile() || entry.level === 0 ? 'angle-down' : 'angle-right'\"\n [class]=\"passThrough().submenuIcon?.class\"\n [style]=\"passThrough().submenuIcon?.style\"\n />\n }\n }\n</ng-template>\n\n<ng-template #submenu let-items let-focus=\"focus\">\n <tx-menu-list\n panel=\"submenu\"\n [items]=\"items\"\n [tiered]=\"true\"\n [level]=\"1\"\n [focusOnInit]=\"focus\"\n [itemTemplate]=\"itemTemplate()?.template ?? null\"\n [unstyled]=\"isUnstyled()\"\n [pt]=\"submenuPt()\"\n (selected)=\"onSubmenuSelected($event)\"\n (leave)=\"onSubmenuLeave()\"\n (tabbed)=\"closeSubmenu()\"\n (keydown)=\"onSubmenuKeydown($event)\"\n />\n</ng-template>\n",
535
+ styles: [":host{position:relative;display:flex;align-items:center;box-sizing:border-box;min-width:0}.tx-menubar__start:empty,.tx-menubar__end:empty{display:none}.tx-menubar__end{margin-inline-start:auto}.tx-menubar__list{display:flex;margin:0;padding:0;list-style:none;outline:none}.tx-menubar__list--root{align-items:center}.tx-menubar__list--sub{flex-direction:column}.tx-menubar__entry{position:relative;display:block}.tx-menubar__item{display:flex;align-items:center;color:inherit;text-decoration:none;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.tx-menubar__item[aria-disabled=true]{cursor:default}.tx-menubar__label{min-width:0}.tx-menubar__button{display:inline-flex;flex:none;align-items:center;justify-content:center;margin:0;padding:0;border:none;font:inherit;cursor:pointer}.tx-menubar__collapse{display:grid;grid-template-rows:0fr}.tx-menubar__entry--expanded>.tx-menubar__collapse{grid-template-rows:1fr}.tx-menubar__collapse-inner{min-height:0;overflow:hidden}.tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{visibility:hidden}:host(.tx-menubar--mobile) .tx-menubar__list--root{position:absolute;top:100%;left:0;z-index:var(--tx-layer-dropdown);flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;visibility:hidden;opacity:0;pointer-events:none}:host(.tx-menubar--mobile) .tx-menubar__item{white-space:normal}:host(.tx-menubar--mobile) .tx-menubar__submenu-icon{margin-inline-start:auto}:host(.tx-menubar--mobile-open) .tx-menubar__list--root{visibility:visible;opacity:1;pointer-events:auto}:host([data-styled]){--_duration: var(--tx-menubar-transition-duration);gap:var(--tx-menubar-gap);padding:var(--tx-menubar-padding);border:1px solid var(--tx-menubar-border-color);border-radius:var(--tx-menubar-border-radius);background:var(--tx-menubar-background);color:var(--tx-menubar-color);font-family:var(--tx-font-family);font-size:var(--tx-menubar-font-size);line-height:1.45}:host([data-styled]) .tx-menubar__list--root{gap:var(--tx-menubar-gap)}:host([data-styled]) .tx-menubar__item{gap:var(--tx-menubar-item-gap);padding:var(--tx-menubar-item-padding);border-radius:var(--tx-menubar-item-border-radius);color:var(--tx-menubar-item-color);font-weight:var(--tx-menubar-item-font-weight);transition:background-color var(--_duration),color var(--_duration)}:host([data-styled]) .tx-menubar__item:hover,:host([data-styled]) .tx-menubar__item:focus{background:var(--tx-menubar-item-focus-background);color:var(--tx-menubar-item-focus-color)}:host([data-styled]) .tx-menubar__item:hover .tx-menubar__icon,:host([data-styled]) .tx-menubar__item:focus .tx-menubar__icon{color:var(--tx-menubar-item-icon-focus-color)}:host([data-styled]) .tx-menubar__item:hover .tx-menubar__submenu-icon,:host([data-styled]) .tx-menubar__item:focus .tx-menubar__submenu-icon{color:var(--tx-menubar-submenu-icon-focus-color)}:host([data-styled]) .tx-menubar__item:focus-visible{outline:var(--tx-menubar-item-focus-ring-width) solid var(--tx-menubar-item-focus-ring-color);outline-offset:var(--tx-menubar-item-focus-ring-offset)}:host([data-styled]) .tx-menubar__item[aria-disabled=true]{opacity:var(--tx-menubar-item-disabled-opacity)}:host([data-styled]) .tx-menubar__item[aria-disabled=true]:hover{background:none}:host([data-styled]) .tx-menubar__entry--expanded>.tx-menubar__item{background:var(--tx-menubar-item-active-background);color:var(--tx-menubar-item-active-color)}:host([data-styled]) .tx-menubar__entry--expanded>.tx-menubar__item .tx-menubar__icon{color:var(--tx-menubar-item-icon-active-color)}:host([data-styled]) .tx-menubar__icon{font-size:var(--tx-menubar-item-icon-size);color:var(--tx-menubar-item-icon-color);transition:color var(--_duration)}:host([data-styled]) .tx-menubar__submenu-icon{font-size:var(--tx-menubar-submenu-icon-size);color:var(--tx-menubar-submenu-icon-color);transition:color var(--_duration),transform var(--tx-menubar-mobile-expand-duration) var(--tx-menubar-mobile-expand-easing)}:host([data-styled]) .tx-menubar__separator{align-self:stretch;width:1px;margin:0;background:var(--tx-menubar-border-color)}:host([data-styled]) .tx-menubar__button{width:var(--tx-menubar-mobile-button-size);height:var(--tx-menubar-mobile-button-size);border-radius:var(--tx-menubar-mobile-button-border-radius);background:transparent;color:var(--tx-menubar-mobile-button-color);transition:background-color var(--_duration),color var(--_duration)}:host([data-styled]) .tx-menubar__button:hover{background:var(--tx-menubar-mobile-button-hover-background);color:var(--tx-menubar-mobile-button-hover-color)}:host([data-styled]) .tx-menubar__button:focus-visible{outline:var(--tx-menubar-item-focus-ring-width) solid var(--tx-menubar-item-focus-ring-color);outline-offset:2px}:host([data-styled].tx-menubar--mobile) .tx-menubar__list--root{top:calc(100% + var(--tx-menubar-mobile-offset));gap:var(--tx-menubar-mobile-gap);padding:var(--tx-menubar-mobile-padding);border:1px solid var(--tx-menubar-mobile-border-color);border-radius:var(--tx-menubar-mobile-border-radius);background:var(--tx-menubar-mobile-background);box-shadow:var(--tx-menubar-mobile-shadow);transform:translateY(-4px);transition:opacity var(--_duration),transform var(--_duration),visibility var(--_duration)}:host([data-styled].tx-menubar--mobile) .tx-menubar__list--sub{gap:var(--tx-menubar-mobile-gap);padding-block:var(--tx-menubar-mobile-gap);padding-inline-start:var(--tx-menubar-mobile-indent)}:host([data-styled].tx-menubar--mobile) .tx-menubar__collapse{transition:grid-template-rows var(--tx-menubar-mobile-expand-duration) var(--tx-menubar-mobile-expand-easing)}:host([data-styled].tx-menubar--mobile) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{transition:visibility 0s linear var(--tx-menubar-mobile-expand-duration)}:host([data-styled].tx-menubar--mobile) .tx-menubar__entry--expanded>.tx-menubar__item>.tx-menubar__submenu-icon{transform:rotate(-180deg)}:host([data-styled].tx-menubar--mobile) .tx-menubar__separator{width:auto;height:1px}:host([data-styled].tx-menubar--mobile-open) .tx-menubar__list--root{transform:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-menubar__item,:host([data-styled]) .tx-menubar__icon,:host([data-styled]) .tx-menubar__submenu-icon,:host([data-styled]) .tx-menubar__button,:host([data-styled]) .tx-menubar__list--root,:host([data-styled]) .tx-menubar__collapse,:host([data-styled]) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner,:host([data-styled].tx-menubar--mobile) .tx-menubar__item,:host([data-styled].tx-menubar--mobile) .tx-menubar__icon,:host([data-styled].tx-menubar--mobile) .tx-menubar__submenu-icon,:host([data-styled].tx-menubar--mobile) .tx-menubar__button,:host([data-styled].tx-menubar--mobile) .tx-menubar__list--root,:host([data-styled].tx-menubar--mobile) .tx-menubar__collapse,:host([data-styled].tx-menubar--mobile) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{transition:none}}\n"],
536
+ dependencies: [
537
+ {
538
+ kind: "directive",
539
+ type: NgTemplateOutlet,
540
+ selector: "[ngTemplateOutlet]",
541
+ inputs: [
542
+ "ngTemplateOutletContext",
543
+ "ngTemplateOutlet",
544
+ "ngTemplateOutletInjector"
545
+ ]
546
+ },
547
+ {
548
+ kind: "directive",
549
+ type: RouterLink,
550
+ selector: "[routerLink]",
551
+ inputs: [
552
+ "target",
553
+ "queryParams",
554
+ "fragment",
555
+ "queryParamsHandling",
556
+ "state",
557
+ "info",
558
+ "relativeTo",
559
+ "preserveFragment",
560
+ "skipLocationChange",
561
+ "replaceUrl",
562
+ "browserUrl",
563
+ "routerLink"
564
+ ]
565
+ },
566
+ {
567
+ kind: "component",
568
+ type: TxIcon,
569
+ selector: "tx-icon",
570
+ inputs: ["name"]
571
+ },
572
+ {
573
+ kind: "component",
574
+ type: TxBadge,
575
+ selector: "tx-badge",
576
+ inputs: [
577
+ "value",
578
+ "severity",
579
+ "size",
580
+ "dt",
581
+ "pt",
582
+ "ptOptions",
583
+ "unstyled"
584
+ ]
585
+ },
586
+ {
587
+ kind: "component",
588
+ type: TxMenuList,
589
+ selector: "tx-menu-list",
590
+ inputs: [
591
+ "items",
592
+ "tiered",
593
+ "level",
594
+ "panel",
595
+ "variant",
596
+ "itemTemplate",
597
+ "focusOnInit",
598
+ "ariaLabel",
599
+ "ariaLabelledBy",
600
+ "unstyled",
601
+ "pt"
602
+ ],
603
+ outputs: [
604
+ "selected",
605
+ "leave",
606
+ "tabbed"
607
+ ]
608
+ }
609
+ ],
610
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
611
+ });
612
+ };
613
+ i0.ɵɵngDeclareClassMetadata({
614
+ minVersion: "12.0.0",
615
+ version: "22.2.3",
616
+ ngImport: i0,
617
+ type: TxMenubar,
618
+ decorators: [{
619
+ type: Component,
620
+ args: [{
621
+ selector: "tx-menubar",
622
+ imports: [
623
+ NgTemplateOutlet,
624
+ RouterLink,
625
+ TxIcon,
626
+ TxBadge,
627
+ TxMenuList
628
+ ],
629
+ changeDetection: ChangeDetectionStrategy.OnPush,
630
+ host: {
631
+ class: "tx-menubar",
632
+ "[class]": "passThrough().root?.class",
633
+ "[style]": "hostStyle()",
634
+ "[attr.data-styled]": "!isUnstyled() || null",
635
+ "[class.tx-menubar--mobile]": "mobile()",
636
+ "[class.tx-menubar--mobile-open]": "mobile() && mobileOpen()",
637
+ "(focusin)": "onFocusIn($event)",
638
+ "(focusout)": "onFocusOut($event)"
639
+ },
640
+ template: "<div class=\"tx-menubar__start\" [class]=\"passThrough().start?.class\" [style]=\"passThrough().start?.style\"><ng-content select=\"[txMenubarStart]\" /></div>\n@if (mobile()) {\n <button\n type=\"button\"\n class=\"tx-menubar__button\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"translations().menu\"\n [attr.aria-expanded]=\"mobileOpen()\"\n [attr.aria-controls]=\"listId\"\n [class]=\"passThrough().mobileButton?.class\"\n [style]=\"passThrough().mobileButton?.style\"\n (click)=\"toggleMobile()\"\n >\n <tx-icon name=\"bars\" />\n </button>\n}\n<ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: entries(), root: true }\" />\n<div class=\"tx-menubar__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\"><ng-content select=\"[txMenubarEnd]\" /></div>\n\n<ng-template #list let-entries let-root=\"root\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the menu items inside take focus; the list handles their arrow keys -->\n <ul\n class=\"tx-menubar__list\"\n [class.tx-menubar__list--root]=\"root\"\n [class.tx-menubar__list--sub]=\"!root\"\n [attr.id]=\"root ? listId : null\"\n [attr.role]=\"root ? 'menubar' : 'menu'\"\n [attr.aria-orientation]=\"root && !mobile() ? 'horizontal' : 'vertical'\"\n [attr.aria-label]=\"root ? (ariaLabel() ?? null) : null\"\n [attr.aria-labelledby]=\"root ? (ariaLabelledBy() ?? null) : null\"\n [class]=\"root ? passThrough().list?.class : null\"\n [style]=\"root ? passThrough().list?.style : null\"\n (keydown)=\"root && onKeydown($event)\"\n >\n @for (entry of entries; track entry.key) {\n @if (entry.item.separator) {\n <li role=\"separator\" class=\"tx-menubar__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></li>\n } @else {\n <li role=\"none\" class=\"tx-menubar__entry\" [attr.data-key]=\"entry.key\" [class.tx-menubar__entry--expanded]=\"isExpanded(entry)\">\n @if (entry.item.routerLink && !entry.item.disabled && !hasChildren(entry)) {\n <a\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [routerLink]=\"entry.item.routerLink\"\n [queryParams]=\"entry.item.queryParams\"\n [fragment]=\"entry.item.fragment\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </a>\n } @else if (entry.item.url && !entry.item.disabled && !hasChildren(entry)) {\n <a\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [attr.href]=\"entry.item.url\"\n [attr.target]=\"entry.item.target ?? null\"\n [attr.rel]=\"entry.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </a>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- Enter / Space are handled by the list keydown -->\n <div\n role=\"menuitem\"\n class=\"tx-menubar__item\"\n [id]=\"entry.id\"\n [attr.tabindex]=\"tabIndex(entry)\"\n [attr.title]=\"entry.item.title ?? null\"\n [attr.aria-disabled]=\"entry.item.disabled || null\"\n [attr.aria-haspopup]=\"hasChildren(entry) ? 'menu' : null\"\n [attr.aria-expanded]=\"hasChildren(entry) ? isExpanded(entry) : null\"\n [attr.aria-controls]=\"hasChildren(entry) && mobile() ? entry.id + '-menu' : null\"\n [attr.data-severity]=\"entry.item.severity ?? null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(entry, $event)\"\n (mouseenter)=\"onItemEnter(entry)\"\n (focus)=\"onItemFocus(entry)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ $implicit: entry }\" />\n </div>\n }\n @if (mobile() && hasChildren(entry)) {\n <div class=\"tx-menubar__collapse\" [id]=\"entry.id + '-menu'\" [attr.inert]=\"isExpanded(entry) ? null : ''\">\n <div class=\"tx-menubar__collapse-inner\">\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: entry.children, root: false }\" />\n </div>\n </div>\n }\n </li>\n }\n }\n </ul>\n</ng-template>\n\n<ng-template #content let-entry>\n @if (itemTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"context(entry)\" />\n } @else {\n @if (entry.item.icon) {\n <tx-icon class=\"tx-menubar__icon\" aria-hidden=\"true\" [name]=\"entry.item.icon\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n }\n <span class=\"tx-menubar__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ entry.item.label }}</span>\n @if (entry.item.badge !== undefined && entry.item.badge !== null) {\n <tx-badge class=\"tx-menubar__badge\" size=\"small\" severity=\"secondary\" [value]=\"entry.item.badge\" [unstyled]=\"isUnstyled()\" />\n }\n @if (hasChildren(entry)) {\n <tx-icon\n class=\"tx-menubar__submenu-icon\"\n aria-hidden=\"true\"\n [name]=\"mobile() || entry.level === 0 ? 'angle-down' : 'angle-right'\"\n [class]=\"passThrough().submenuIcon?.class\"\n [style]=\"passThrough().submenuIcon?.style\"\n />\n }\n }\n</ng-template>\n\n<ng-template #submenu let-items let-focus=\"focus\">\n <tx-menu-list\n panel=\"submenu\"\n [items]=\"items\"\n [tiered]=\"true\"\n [level]=\"1\"\n [focusOnInit]=\"focus\"\n [itemTemplate]=\"itemTemplate()?.template ?? null\"\n [unstyled]=\"isUnstyled()\"\n [pt]=\"submenuPt()\"\n (selected)=\"onSubmenuSelected($event)\"\n (leave)=\"onSubmenuLeave()\"\n (tabbed)=\"closeSubmenu()\"\n (keydown)=\"onSubmenuKeydown($event)\"\n />\n</ng-template>\n",
641
+ styles: [":host{position:relative;display:flex;align-items:center;box-sizing:border-box;min-width:0}.tx-menubar__start:empty,.tx-menubar__end:empty{display:none}.tx-menubar__end{margin-inline-start:auto}.tx-menubar__list{display:flex;margin:0;padding:0;list-style:none;outline:none}.tx-menubar__list--root{align-items:center}.tx-menubar__list--sub{flex-direction:column}.tx-menubar__entry{position:relative;display:block}.tx-menubar__item{display:flex;align-items:center;color:inherit;text-decoration:none;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.tx-menubar__item[aria-disabled=true]{cursor:default}.tx-menubar__label{min-width:0}.tx-menubar__button{display:inline-flex;flex:none;align-items:center;justify-content:center;margin:0;padding:0;border:none;font:inherit;cursor:pointer}.tx-menubar__collapse{display:grid;grid-template-rows:0fr}.tx-menubar__entry--expanded>.tx-menubar__collapse{grid-template-rows:1fr}.tx-menubar__collapse-inner{min-height:0;overflow:hidden}.tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{visibility:hidden}:host(.tx-menubar--mobile) .tx-menubar__list--root{position:absolute;top:100%;left:0;z-index:var(--tx-layer-dropdown);flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;visibility:hidden;opacity:0;pointer-events:none}:host(.tx-menubar--mobile) .tx-menubar__item{white-space:normal}:host(.tx-menubar--mobile) .tx-menubar__submenu-icon{margin-inline-start:auto}:host(.tx-menubar--mobile-open) .tx-menubar__list--root{visibility:visible;opacity:1;pointer-events:auto}:host([data-styled]){--_duration: var(--tx-menubar-transition-duration);gap:var(--tx-menubar-gap);padding:var(--tx-menubar-padding);border:1px solid var(--tx-menubar-border-color);border-radius:var(--tx-menubar-border-radius);background:var(--tx-menubar-background);color:var(--tx-menubar-color);font-family:var(--tx-font-family);font-size:var(--tx-menubar-font-size);line-height:1.45}:host([data-styled]) .tx-menubar__list--root{gap:var(--tx-menubar-gap)}:host([data-styled]) .tx-menubar__item{gap:var(--tx-menubar-item-gap);padding:var(--tx-menubar-item-padding);border-radius:var(--tx-menubar-item-border-radius);color:var(--tx-menubar-item-color);font-weight:var(--tx-menubar-item-font-weight);transition:background-color var(--_duration),color var(--_duration)}:host([data-styled]) .tx-menubar__item:hover,:host([data-styled]) .tx-menubar__item:focus{background:var(--tx-menubar-item-focus-background);color:var(--tx-menubar-item-focus-color)}:host([data-styled]) .tx-menubar__item:hover .tx-menubar__icon,:host([data-styled]) .tx-menubar__item:focus .tx-menubar__icon{color:var(--tx-menubar-item-icon-focus-color)}:host([data-styled]) .tx-menubar__item:hover .tx-menubar__submenu-icon,:host([data-styled]) .tx-menubar__item:focus .tx-menubar__submenu-icon{color:var(--tx-menubar-submenu-icon-focus-color)}:host([data-styled]) .tx-menubar__item:focus-visible{outline:var(--tx-menubar-item-focus-ring-width) solid var(--tx-menubar-item-focus-ring-color);outline-offset:var(--tx-menubar-item-focus-ring-offset)}:host([data-styled]) .tx-menubar__item[aria-disabled=true]{opacity:var(--tx-menubar-item-disabled-opacity)}:host([data-styled]) .tx-menubar__item[aria-disabled=true]:hover{background:none}:host([data-styled]) .tx-menubar__entry--expanded>.tx-menubar__item{background:var(--tx-menubar-item-active-background);color:var(--tx-menubar-item-active-color)}:host([data-styled]) .tx-menubar__entry--expanded>.tx-menubar__item .tx-menubar__icon{color:var(--tx-menubar-item-icon-active-color)}:host([data-styled]) .tx-menubar__icon{font-size:var(--tx-menubar-item-icon-size);color:var(--tx-menubar-item-icon-color);transition:color var(--_duration)}:host([data-styled]) .tx-menubar__submenu-icon{font-size:var(--tx-menubar-submenu-icon-size);color:var(--tx-menubar-submenu-icon-color);transition:color var(--_duration),transform var(--tx-menubar-mobile-expand-duration) var(--tx-menubar-mobile-expand-easing)}:host([data-styled]) .tx-menubar__separator{align-self:stretch;width:1px;margin:0;background:var(--tx-menubar-border-color)}:host([data-styled]) .tx-menubar__button{width:var(--tx-menubar-mobile-button-size);height:var(--tx-menubar-mobile-button-size);border-radius:var(--tx-menubar-mobile-button-border-radius);background:transparent;color:var(--tx-menubar-mobile-button-color);transition:background-color var(--_duration),color var(--_duration)}:host([data-styled]) .tx-menubar__button:hover{background:var(--tx-menubar-mobile-button-hover-background);color:var(--tx-menubar-mobile-button-hover-color)}:host([data-styled]) .tx-menubar__button:focus-visible{outline:var(--tx-menubar-item-focus-ring-width) solid var(--tx-menubar-item-focus-ring-color);outline-offset:2px}:host([data-styled].tx-menubar--mobile) .tx-menubar__list--root{top:calc(100% + var(--tx-menubar-mobile-offset));gap:var(--tx-menubar-mobile-gap);padding:var(--tx-menubar-mobile-padding);border:1px solid var(--tx-menubar-mobile-border-color);border-radius:var(--tx-menubar-mobile-border-radius);background:var(--tx-menubar-mobile-background);box-shadow:var(--tx-menubar-mobile-shadow);transform:translateY(-4px);transition:opacity var(--_duration),transform var(--_duration),visibility var(--_duration)}:host([data-styled].tx-menubar--mobile) .tx-menubar__list--sub{gap:var(--tx-menubar-mobile-gap);padding-block:var(--tx-menubar-mobile-gap);padding-inline-start:var(--tx-menubar-mobile-indent)}:host([data-styled].tx-menubar--mobile) .tx-menubar__collapse{transition:grid-template-rows var(--tx-menubar-mobile-expand-duration) var(--tx-menubar-mobile-expand-easing)}:host([data-styled].tx-menubar--mobile) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{transition:visibility 0s linear var(--tx-menubar-mobile-expand-duration)}:host([data-styled].tx-menubar--mobile) .tx-menubar__entry--expanded>.tx-menubar__item>.tx-menubar__submenu-icon{transform:rotate(-180deg)}:host([data-styled].tx-menubar--mobile) .tx-menubar__separator{width:auto;height:1px}:host([data-styled].tx-menubar--mobile-open) .tx-menubar__list--root{transform:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-menubar__item,:host([data-styled]) .tx-menubar__icon,:host([data-styled]) .tx-menubar__submenu-icon,:host([data-styled]) .tx-menubar__button,:host([data-styled]) .tx-menubar__list--root,:host([data-styled]) .tx-menubar__collapse,:host([data-styled]) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner,:host([data-styled].tx-menubar--mobile) .tx-menubar__item,:host([data-styled].tx-menubar--mobile) .tx-menubar__icon,:host([data-styled].tx-menubar--mobile) .tx-menubar__submenu-icon,:host([data-styled].tx-menubar--mobile) .tx-menubar__button,:host([data-styled].tx-menubar--mobile) .tx-menubar__list--root,:host([data-styled].tx-menubar--mobile) .tx-menubar__collapse,:host([data-styled].tx-menubar--mobile) .tx-menubar__entry:not(.tx-menubar__entry--expanded)>.tx-menubar__collapse>.tx-menubar__collapse-inner{transition:none}}\n"]
642
+ }]
643
+ }],
644
+ ctorParameters: () => [],
645
+ propDecorators: {
646
+ model: [{
647
+ type: i0.Input,
648
+ args: [{
649
+ isSignal: true,
650
+ alias: "model",
651
+ required: false
652
+ }]
653
+ }],
654
+ autoDisplay: [{
655
+ type: i0.Input,
656
+ args: [{
657
+ isSignal: true,
658
+ alias: "autoDisplay",
659
+ required: false
660
+ }]
661
+ }],
662
+ breakpoint: [{
663
+ type: i0.Input,
664
+ args: [{
665
+ isSignal: true,
666
+ alias: "breakpoint",
667
+ required: false
668
+ }]
669
+ }],
670
+ ariaLabel: [{
671
+ type: i0.Input,
672
+ args: [{
673
+ isSignal: true,
674
+ alias: "ariaLabel",
675
+ required: false
676
+ }]
677
+ }],
678
+ ariaLabelledBy: [{
679
+ type: i0.Input,
680
+ args: [{
681
+ isSignal: true,
682
+ alias: "ariaLabelledBy",
683
+ required: false
684
+ }]
685
+ }],
686
+ dt: [{
687
+ type: i0.Input,
688
+ args: [{
689
+ isSignal: true,
690
+ alias: "dt",
691
+ required: false
692
+ }]
693
+ }],
694
+ pt: [{
695
+ type: i0.Input,
696
+ args: [{
697
+ isSignal: true,
698
+ alias: "pt",
699
+ required: false
700
+ }]
701
+ }],
702
+ ptOptions: [{
703
+ type: i0.Input,
704
+ args: [{
705
+ isSignal: true,
706
+ alias: "ptOptions",
707
+ required: false
708
+ }]
709
+ }],
710
+ unstyled: [{
711
+ type: i0.Input,
712
+ args: [{
713
+ isSignal: true,
714
+ alias: "unstyled",
715
+ required: false
716
+ }]
717
+ }],
718
+ itemClick: [{
719
+ type: i0.Output,
720
+ args: ["itemClick"]
721
+ }],
722
+ focused: [{
723
+ type: i0.Output,
724
+ args: ["focused"]
725
+ }],
726
+ blurred: [{
727
+ type: i0.Output,
728
+ args: ["blurred"]
729
+ }],
730
+ itemTemplate: [{
731
+ type: i0.ContentChild,
732
+ args: [i0.forwardRef(() => TxMenubarItemTemplate), { isSignal: true }]
733
+ }],
734
+ submenuTemplate: [{
735
+ type: i0.ViewChild,
736
+ args: ["submenu", { isSignal: true }]
737
+ }]
738
+ }
739
+ });
740
+ export { TxMenubar, TxMenubarItemTemplate };
741
+
742
+ //# sourceMappingURL=tectra-ng-ui-menubar.mjs.map