@tectra-ng/blocks 0.0.0-stage → 0.1.7

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 (101) hide show
  1. package/README.md +16 -2
  2. package/action-tile/README.md +33 -0
  3. package/actions-menu/README.md +42 -0
  4. package/app-footer/README.md +30 -0
  5. package/app-layout/README.md +51 -0
  6. package/command-palette/README.md +63 -0
  7. package/console-layout/README.md +70 -0
  8. package/cookie-notice/README.md +45 -0
  9. package/empty-state/README.md +35 -0
  10. package/fesm2022/tectra-ng-blocks-action-tile.mjs +294 -0
  11. package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -0
  12. package/fesm2022/tectra-ng-blocks-actions-menu.mjs +380 -0
  13. package/fesm2022/tectra-ng-blocks-actions-menu.mjs.map +1 -0
  14. package/fesm2022/tectra-ng-blocks-app-footer.mjs +276 -0
  15. package/fesm2022/tectra-ng-blocks-app-footer.mjs.map +1 -0
  16. package/fesm2022/tectra-ng-blocks-app-layout.mjs +544 -0
  17. package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -0
  18. package/fesm2022/tectra-ng-blocks-command-palette.mjs +663 -0
  19. package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -0
  20. package/fesm2022/tectra-ng-blocks-console-layout.mjs +1060 -0
  21. package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -0
  22. package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +416 -0
  23. package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -0
  24. package/fesm2022/tectra-ng-blocks-empty-state.mjs +278 -0
  25. package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -0
  26. package/fesm2022/tectra-ng-blocks-filters-panel.mjs +959 -0
  27. package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -0
  28. package/fesm2022/tectra-ng-blocks-kanban.mjs +864 -0
  29. package/fesm2022/tectra-ng-blocks-kanban.mjs.map +1 -0
  30. package/fesm2022/tectra-ng-blocks-network-status.mjs +303 -0
  31. package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -0
  32. package/fesm2022/tectra-ng-blocks-page-header.mjs +195 -0
  33. package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -0
  34. package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +692 -0
  35. package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -0
  36. package/fesm2022/tectra-ng-blocks-public-header.mjs +372 -0
  37. package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -0
  38. package/fesm2022/tectra-ng-blocks-qr-code.mjs +487 -0
  39. package/fesm2022/tectra-ng-blocks-qr-code.mjs.map +1 -0
  40. package/fesm2022/tectra-ng-blocks-switch-language.mjs +316 -0
  41. package/fesm2022/tectra-ng-blocks-switch-language.mjs.map +1 -0
  42. package/fesm2022/tectra-ng-blocks-switch-theme.mjs +416 -0
  43. package/fesm2022/tectra-ng-blocks-switch-theme.mjs.map +1 -0
  44. package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs +260 -0
  45. package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs.map +1 -0
  46. package/fesm2022/tectra-ng-blocks-wizard.mjs +1284 -0
  47. package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -0
  48. package/fesm2022/tectra-ng-blocks.mjs +4 -0
  49. package/fesm2022/tectra-ng-blocks.mjs.map +1 -0
  50. package/filters-panel/README.md +68 -0
  51. package/kanban/README.md +55 -0
  52. package/network-status/README.md +33 -0
  53. package/package.json +137 -3
  54. package/page-header/README.md +32 -0
  55. package/pinned-tabs/README.md +42 -0
  56. package/public-header/README.md +44 -0
  57. package/qr-code/README.md +52 -0
  58. package/switch-language/README.md +33 -0
  59. package/switch-theme/README.md +32 -0
  60. package/topbar-preferences/README.md +35 -0
  61. package/types/tectra-ng-blocks-action-tile.d.ts +114 -0
  62. package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -0
  63. package/types/tectra-ng-blocks-actions-menu.d.ts +112 -0
  64. package/types/tectra-ng-blocks-actions-menu.d.ts.map +1 -0
  65. package/types/tectra-ng-blocks-app-footer.d.ts +111 -0
  66. package/types/tectra-ng-blocks-app-footer.d.ts.map +1 -0
  67. package/types/tectra-ng-blocks-app-layout.d.ts +212 -0
  68. package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -0
  69. package/types/tectra-ng-blocks-command-palette.d.ts +291 -0
  70. package/types/tectra-ng-blocks-command-palette.d.ts.map +1 -0
  71. package/types/tectra-ng-blocks-console-layout.d.ts +454 -0
  72. package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -0
  73. package/types/tectra-ng-blocks-cookie-notice.d.ts +168 -0
  74. package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -0
  75. package/types/tectra-ng-blocks-empty-state.d.ts +138 -0
  76. package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -0
  77. package/types/tectra-ng-blocks-filters-panel.d.ts +314 -0
  78. package/types/tectra-ng-blocks-filters-panel.d.ts.map +1 -0
  79. package/types/tectra-ng-blocks-kanban.d.ts +260 -0
  80. package/types/tectra-ng-blocks-kanban.d.ts.map +1 -0
  81. package/types/tectra-ng-blocks-network-status.d.ts +108 -0
  82. package/types/tectra-ng-blocks-network-status.d.ts.map +1 -0
  83. package/types/tectra-ng-blocks-page-header.d.ts +86 -0
  84. package/types/tectra-ng-blocks-page-header.d.ts.map +1 -0
  85. package/types/tectra-ng-blocks-pinned-tabs.d.ts +159 -0
  86. package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -0
  87. package/types/tectra-ng-blocks-public-header.d.ts +142 -0
  88. package/types/tectra-ng-blocks-public-header.d.ts.map +1 -0
  89. package/types/tectra-ng-blocks-qr-code.d.ts +160 -0
  90. package/types/tectra-ng-blocks-qr-code.d.ts.map +1 -0
  91. package/types/tectra-ng-blocks-switch-language.d.ts +106 -0
  92. package/types/tectra-ng-blocks-switch-language.d.ts.map +1 -0
  93. package/types/tectra-ng-blocks-switch-theme.d.ts +108 -0
  94. package/types/tectra-ng-blocks-switch-theme.d.ts.map +1 -0
  95. package/types/tectra-ng-blocks-topbar-preferences.d.ts +103 -0
  96. package/types/tectra-ng-blocks-topbar-preferences.d.ts.map +1 -0
  97. package/types/tectra-ng-blocks-wizard.d.ts +682 -0
  98. package/types/tectra-ng-blocks-wizard.d.ts.map +1 -0
  99. package/types/tectra-ng-blocks.d.ts +2 -0
  100. package/types/tectra-ng-blocks.d.ts.map +1 -0
  101. package/wizard/README.md +77 -0
@@ -0,0 +1,380 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, computed, input, output, viewChild } from "@angular/core";
3
+ import { nextListIndex } from "@tectra-ng/core/a11y";
4
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
5
+ import { injectTranslations } from "@tectra-ng/core/i18n";
6
+ import { optionalBoolean } from "@tectra-ng/core/utils";
7
+ import { TxIcon } from "@tectra-ng/icons";
8
+ import { toStyleObject } from "@tectra-ng/themes";
9
+ import { TxButton } from "@tectra-ng/ui/button";
10
+ import { TxPopover, TxPopoverTrigger } from "@tectra-ng/ui/popover";
11
+ import { TxTooltip } from "@tectra-ng/ui/tooltip";
12
+ const MENU_KEYS = /* @__PURE__ */ new Set([
13
+ "ArrowDown",
14
+ "ArrowUp",
15
+ "Home",
16
+ "End"
17
+ ]);
18
+ var TxActionsMenu = class TxActionsMenu {
19
+ popover = viewChild(TxPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
20
+ list = viewChild("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
21
+ pending = null;
22
+ items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
23
+ tooltip = input(void 0, ...ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []);
24
+ ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
25
+ size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
26
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
27
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
28
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
29
+ unstyled = input(void 0, {
30
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
31
+ transform: optionalBoolean
32
+ });
33
+ itemSelect = output();
34
+ isUnstyled = injectUnstyled(this.unstyled);
35
+ passThrough = injectPassThrough("actionsMenu", this, this.pt, this.ptOptions);
36
+ translations = injectTranslations();
37
+ tokenStyle = computed(() => toStyleObject(this.dt(), "--tx-actions-menu"), ...ngDevMode ? [{ debugName: "tokenStyle" }] : /* istanbul ignore next */ []);
38
+ hostStyle = computed(() => ({
39
+ ...this.tokenStyle(),
40
+ ...this.passThrough().root?.style
41
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
42
+ popoverTokens = { content: { padding: "0" } };
43
+ name = computed(() => this.ariaLabel() ?? this.tooltip() ?? this.translations().moreActions, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
44
+ close() {
45
+ this.popover()?.hide();
46
+ }
47
+ select(item) {
48
+ this.pending = item;
49
+ this.close();
50
+ }
51
+ onClosed() {
52
+ const item = this.pending;
53
+ this.pending = null;
54
+ if (item) this.itemSelect.emit(item.id);
55
+ }
56
+ onKeydown(event) {
57
+ if (!MENU_KEYS.has(event.key)) return;
58
+ const items = Array.from(this.list()?.nativeElement.querySelectorAll("[role=\"menuitem\"]") ?? []);
59
+ const current = items.indexOf(event.target);
60
+ const next = nextListIndex(event.key, {
61
+ count: items.length,
62
+ current
63
+ });
64
+ if (next === null) return;
65
+ event.preventDefault();
66
+ items[next]?.focus();
67
+ }
68
+ static ɵfac = i0.ɵɵngDeclareFactory({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.3",
71
+ ngImport: i0,
72
+ type: TxActionsMenu,
73
+ deps: [],
74
+ target: i0.ɵɵFactoryTarget.Component
75
+ });
76
+ static ɵcmp = i0.ɵɵngDeclareComponent({
77
+ minVersion: "17.0.0",
78
+ version: "22.2.3",
79
+ type: TxActionsMenu,
80
+ isStandalone: true,
81
+ selector: "tx-actions-menu",
82
+ inputs: {
83
+ items: {
84
+ classPropertyName: "items",
85
+ publicName: "items",
86
+ isSignal: true,
87
+ isRequired: true,
88
+ transformFunction: null
89
+ },
90
+ tooltip: {
91
+ classPropertyName: "tooltip",
92
+ publicName: "tooltip",
93
+ isSignal: true,
94
+ isRequired: false,
95
+ transformFunction: null
96
+ },
97
+ ariaLabel: {
98
+ classPropertyName: "ariaLabel",
99
+ publicName: "ariaLabel",
100
+ isSignal: true,
101
+ isRequired: false,
102
+ transformFunction: null
103
+ },
104
+ size: {
105
+ classPropertyName: "size",
106
+ publicName: "size",
107
+ isSignal: true,
108
+ isRequired: false,
109
+ transformFunction: null
110
+ },
111
+ dt: {
112
+ classPropertyName: "dt",
113
+ publicName: "dt",
114
+ isSignal: true,
115
+ isRequired: false,
116
+ transformFunction: null
117
+ },
118
+ pt: {
119
+ classPropertyName: "pt",
120
+ publicName: "pt",
121
+ isSignal: true,
122
+ isRequired: false,
123
+ transformFunction: null
124
+ },
125
+ ptOptions: {
126
+ classPropertyName: "ptOptions",
127
+ publicName: "ptOptions",
128
+ isSignal: true,
129
+ isRequired: false,
130
+ transformFunction: null
131
+ },
132
+ unstyled: {
133
+ classPropertyName: "unstyled",
134
+ publicName: "unstyled",
135
+ isSignal: true,
136
+ isRequired: false,
137
+ transformFunction: null
138
+ }
139
+ },
140
+ outputs: { itemSelect: "itemSelect" },
141
+ host: {
142
+ properties: {
143
+ "class": "passThrough().root?.class",
144
+ "style": "hostStyle()",
145
+ "attr.data-styled": "!isUnstyled() || null",
146
+ "attr.data-size": "size()"
147
+ },
148
+ classAttribute: "tx-actions-menu"
149
+ },
150
+ viewQueries: [{
151
+ propertyName: "popover",
152
+ first: true,
153
+ predicate: TxPopover,
154
+ descendants: true,
155
+ isSignal: true
156
+ }, {
157
+ propertyName: "list",
158
+ first: true,
159
+ predicate: ["list"],
160
+ descendants: true,
161
+ isSignal: true
162
+ }],
163
+ ngImport: i0,
164
+ template: "@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n",
165
+ styles: [":host{display:inline-flex}.tx-actions-menu__list{display:flex;flex-direction:column}.tx-actions-menu__item{display:flex;align-items:center;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;white-space:nowrap;cursor:pointer}.tx-actions-menu__icon{flex-shrink:0}.tx-actions-menu__list[data-styled]{gap:var(--tx-actions-menu-list-gap);min-width:var(--tx-actions-menu-list-min-width);padding:var(--tx-actions-menu-list-padding)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item{gap:var(--tx-actions-menu-item-gap);padding:var(--tx-actions-menu-item-padding-y) var(--tx-actions-menu-item-padding-x);border-radius:var(--tx-actions-menu-item-border-radius);color:var(--tx-actions-menu-item-color);font-family:var(--tx-font-family);font-size:var(--tx-actions-menu-item-font-size);font-weight:var(--tx-actions-menu-item-font-weight);line-height:var(--tx-actions-menu-item-line-height);transition:background-color var(--tx-actions-menu-item-transition-duration)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:hover{background:var(--tx-actions-menu-item-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:active{background:var(--tx-actions-menu-item-active-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:focus-visible{outline:2px solid var(--tx-actions-menu-item-focus-ring-color);outline-offset:-2px}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger{color:var(--tx-actions-menu-item-danger-color)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:hover{background:var(--tx-actions-menu-item-danger-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:active{background:var(--tx-actions-menu-item-danger-active-background)}@media(prefers-reduced-motion:reduce){.tx-actions-menu__list[data-styled] .tx-actions-menu__item{transition:none}}\n"],
166
+ dependencies: [
167
+ {
168
+ kind: "component",
169
+ type: TxButton,
170
+ selector: "button[txButton], a[txButton]",
171
+ inputs: [
172
+ "label",
173
+ "severity",
174
+ "size",
175
+ "variant",
176
+ "outlined",
177
+ "text",
178
+ "link",
179
+ "rounded",
180
+ "raised",
181
+ "plain",
182
+ "fluid",
183
+ "disabled",
184
+ "tabindex",
185
+ "icon",
186
+ "iconPos",
187
+ "iconOnly",
188
+ "loading",
189
+ "loadingIcon",
190
+ "badge",
191
+ "badgeSeverity",
192
+ "dt",
193
+ "pt",
194
+ "ptOptions",
195
+ "unstyled"
196
+ ]
197
+ },
198
+ {
199
+ kind: "component",
200
+ type: TxIcon,
201
+ selector: "tx-icon",
202
+ inputs: ["name"]
203
+ },
204
+ {
205
+ kind: "component",
206
+ type: TxPopover,
207
+ selector: "tx-popover",
208
+ inputs: [
209
+ "placement",
210
+ "offset",
211
+ "arrow",
212
+ "header",
213
+ "closeButton",
214
+ "dismissable",
215
+ "closeOnEscape",
216
+ "autoFocus",
217
+ "restoreFocus",
218
+ "scroll",
219
+ "ariaLabel",
220
+ "ariaLabelledBy",
221
+ "panelClass",
222
+ "open",
223
+ "dt",
224
+ "pt",
225
+ "ptOptions",
226
+ "unstyled"
227
+ ],
228
+ outputs: [
229
+ "openChange",
230
+ "opened",
231
+ "closed"
232
+ ]
233
+ },
234
+ {
235
+ kind: "directive",
236
+ type: TxPopoverTrigger,
237
+ selector: "[txPopoverTrigger]",
238
+ inputs: ["txPopoverTrigger"]
239
+ },
240
+ {
241
+ kind: "directive",
242
+ type: TxTooltip,
243
+ selector: "[txTooltip]",
244
+ inputs: [
245
+ "txTooltip",
246
+ "tooltipPlacement",
247
+ "tooltipEvent",
248
+ "tooltipShowDelay",
249
+ "tooltipHideDelay",
250
+ "tooltipLife",
251
+ "tooltipOffset",
252
+ "tooltipArrow",
253
+ "tooltipInteractive",
254
+ "tooltipDisabled",
255
+ "tooltipOverflowOnly",
256
+ "tooltipMultiline",
257
+ "tooltipContext",
258
+ "tooltipClass",
259
+ "tooltipDt",
260
+ "tooltipPt",
261
+ "tooltipPtOptions",
262
+ "tooltipUnstyled"
263
+ ],
264
+ outputs: ["tooltipShown", "tooltipHidden"],
265
+ exportAs: ["txTooltip"]
266
+ }
267
+ ],
268
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
269
+ });
270
+ };
271
+ i0.ɵɵngDeclareClassMetadata({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.3",
274
+ ngImport: i0,
275
+ type: TxActionsMenu,
276
+ decorators: [{
277
+ type: Component,
278
+ args: [{
279
+ selector: "tx-actions-menu",
280
+ imports: [
281
+ TxButton,
282
+ TxIcon,
283
+ TxPopover,
284
+ TxPopoverTrigger,
285
+ TxTooltip
286
+ ],
287
+ changeDetection: ChangeDetectionStrategy.OnPush,
288
+ host: {
289
+ class: "tx-actions-menu",
290
+ "[class]": "passThrough().root?.class",
291
+ "[style]": "hostStyle()",
292
+ "[attr.data-styled]": "!isUnstyled() || null",
293
+ "[attr.data-size]": "size()"
294
+ },
295
+ template: "@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n",
296
+ styles: [":host{display:inline-flex}.tx-actions-menu__list{display:flex;flex-direction:column}.tx-actions-menu__item{display:flex;align-items:center;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;white-space:nowrap;cursor:pointer}.tx-actions-menu__icon{flex-shrink:0}.tx-actions-menu__list[data-styled]{gap:var(--tx-actions-menu-list-gap);min-width:var(--tx-actions-menu-list-min-width);padding:var(--tx-actions-menu-list-padding)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item{gap:var(--tx-actions-menu-item-gap);padding:var(--tx-actions-menu-item-padding-y) var(--tx-actions-menu-item-padding-x);border-radius:var(--tx-actions-menu-item-border-radius);color:var(--tx-actions-menu-item-color);font-family:var(--tx-font-family);font-size:var(--tx-actions-menu-item-font-size);font-weight:var(--tx-actions-menu-item-font-weight);line-height:var(--tx-actions-menu-item-line-height);transition:background-color var(--tx-actions-menu-item-transition-duration)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:hover{background:var(--tx-actions-menu-item-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:active{background:var(--tx-actions-menu-item-active-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:focus-visible{outline:2px solid var(--tx-actions-menu-item-focus-ring-color);outline-offset:-2px}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger{color:var(--tx-actions-menu-item-danger-color)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:hover{background:var(--tx-actions-menu-item-danger-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:active{background:var(--tx-actions-menu-item-danger-active-background)}@media(prefers-reduced-motion:reduce){.tx-actions-menu__list[data-styled] .tx-actions-menu__item{transition:none}}\n"]
297
+ }]
298
+ }],
299
+ propDecorators: {
300
+ popover: [{
301
+ type: i0.ViewChild,
302
+ args: [i0.forwardRef(() => TxPopover), { isSignal: true }]
303
+ }],
304
+ list: [{
305
+ type: i0.ViewChild,
306
+ args: ["list", { isSignal: true }]
307
+ }],
308
+ items: [{
309
+ type: i0.Input,
310
+ args: [{
311
+ isSignal: true,
312
+ alias: "items",
313
+ required: true
314
+ }]
315
+ }],
316
+ tooltip: [{
317
+ type: i0.Input,
318
+ args: [{
319
+ isSignal: true,
320
+ alias: "tooltip",
321
+ required: false
322
+ }]
323
+ }],
324
+ ariaLabel: [{
325
+ type: i0.Input,
326
+ args: [{
327
+ isSignal: true,
328
+ alias: "ariaLabel",
329
+ required: false
330
+ }]
331
+ }],
332
+ size: [{
333
+ type: i0.Input,
334
+ args: [{
335
+ isSignal: true,
336
+ alias: "size",
337
+ required: false
338
+ }]
339
+ }],
340
+ dt: [{
341
+ type: i0.Input,
342
+ args: [{
343
+ isSignal: true,
344
+ alias: "dt",
345
+ required: false
346
+ }]
347
+ }],
348
+ pt: [{
349
+ type: i0.Input,
350
+ args: [{
351
+ isSignal: true,
352
+ alias: "pt",
353
+ required: false
354
+ }]
355
+ }],
356
+ ptOptions: [{
357
+ type: i0.Input,
358
+ args: [{
359
+ isSignal: true,
360
+ alias: "ptOptions",
361
+ required: false
362
+ }]
363
+ }],
364
+ unstyled: [{
365
+ type: i0.Input,
366
+ args: [{
367
+ isSignal: true,
368
+ alias: "unstyled",
369
+ required: false
370
+ }]
371
+ }],
372
+ itemSelect: [{
373
+ type: i0.Output,
374
+ args: ["itemSelect"]
375
+ }]
376
+ }
377
+ });
378
+ export { TxActionsMenu };
379
+
380
+ //# sourceMappingURL=tectra-ng-blocks-actions-menu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-blocks-actions-menu.mjs","names":[],"sources":["../../../../packages/blocks/actions-menu/src/actions-menu.component.ts","../../../../packages/blocks/actions-menu/src/actions-menu.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, input, output, viewChild } from '@angular/core';\nimport { nextListIndex } from '@tectra-ng/core/a11y';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TectraActionsMenuTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxPopover, TxPopoverTrigger } from '@tectra-ng/ui/popover';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxActionsMenuItem, TxActionsMenuPart, TxActionsMenuSize } from './actions-menu.types';\n\nconst MENU_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End']);\n\n@Component({\n selector: 'tx-actions-menu',\n imports: [TxButton, TxIcon, TxPopover, TxPopoverTrigger, TxTooltip],\n templateUrl: './actions-menu.component.html',\n styleUrl: './actions-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-actions-menu',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n },\n})\nexport class TxActionsMenu {\n private readonly popover = viewChild(TxPopover);\n private readonly list = viewChild<ElementRef<HTMLElement>>('list');\n private pending: TxActionsMenuItem | null = null;\n\n readonly items = input.required<readonly TxActionsMenuItem[]>();\n readonly tooltip = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly size = input<TxActionsMenuSize>('medium');\n readonly dt = input<TectraDeepPartial<TectraActionsMenuTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxActionsMenuPart, TxActionsMenu> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly itemSelect = output<string>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('actionsMenu', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-actions-menu'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n protected readonly popoverTokens = { content: { padding: '0' } };\n protected readonly name = computed(() => this.ariaLabel() ?? this.tooltip() ?? this.translations().moreActions);\n\n close(): void {\n this.popover()?.hide();\n }\n\n protected select(item: TxActionsMenuItem): void {\n this.pending = item;\n this.close();\n }\n\n protected onClosed(): void {\n const item = this.pending;\n this.pending = null;\n if (item) {\n this.itemSelect.emit(item.id);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!MENU_KEYS.has(event.key)) {\n return;\n }\n const items = Array.from(this.list()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n const current = items.indexOf(event.target as HTMLElement);\n const next = nextListIndex(event.key, { count: items.length, current });\n if (next === null) {\n return;\n }\n event.preventDefault();\n items[next]?.focus();\n }\n}\n","@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAa;CAAW;CAAQ;AAAK,CAAC;AAgBjE,IAAa,gBAAb,MAAa,cAAa;CACP,UAAU,UAAU,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9B,OAAO,UAAmC,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC1D,UAAoC;CAEnC,QAAQ,MAAM,SAAwC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACtD,UAAU,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,YAAY,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAChD,OAAO,MAAyB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACzC,KAAK,MAA8D,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC7E,KAAK,MAAmE,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CA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