@star-ng/ui 0.0.0-placeholder.0 → 0.1.0

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 (217) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -3
  3. package/fesm2022/star-ng-ui-accordion.mjs +376 -0
  4. package/fesm2022/star-ng-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/star-ng-ui-autocomplete.mjs +782 -0
  6. package/fesm2022/star-ng-ui-autocomplete.mjs.map +1 -0
  7. package/fesm2022/star-ng-ui-avatar.mjs +154 -0
  8. package/fesm2022/star-ng-ui-avatar.mjs.map +1 -0
  9. package/fesm2022/star-ng-ui-badge.mjs +153 -0
  10. package/fesm2022/star-ng-ui-badge.mjs.map +1 -0
  11. package/fesm2022/star-ng-ui-breadcrumb.mjs +199 -0
  12. package/fesm2022/star-ng-ui-breadcrumb.mjs.map +1 -0
  13. package/fesm2022/star-ng-ui-button.mjs +282 -0
  14. package/fesm2022/star-ng-ui-button.mjs.map +1 -0
  15. package/fesm2022/star-ng-ui-card.mjs +112 -0
  16. package/fesm2022/star-ng-ui-card.mjs.map +1 -0
  17. package/fesm2022/star-ng-ui-chart.mjs +1904 -0
  18. package/fesm2022/star-ng-ui-chart.mjs.map +1 -0
  19. package/fesm2022/star-ng-ui-checkbox.mjs +345 -0
  20. package/fesm2022/star-ng-ui-checkbox.mjs.map +1 -0
  21. package/fesm2022/star-ng-ui-core.mjs +392 -0
  22. package/fesm2022/star-ng-ui-core.mjs.map +1 -0
  23. package/fesm2022/star-ng-ui-data-display.mjs +1556 -0
  24. package/fesm2022/star-ng-ui-data-display.mjs.map +1 -0
  25. package/fesm2022/star-ng-ui-date-picker.mjs +2786 -0
  26. package/fesm2022/star-ng-ui-date-picker.mjs.map +1 -0
  27. package/fesm2022/star-ng-ui-dialog.mjs +948 -0
  28. package/fesm2022/star-ng-ui-dialog.mjs.map +1 -0
  29. package/fesm2022/star-ng-ui-drawer.mjs +158 -0
  30. package/fesm2022/star-ng-ui-drawer.mjs.map +1 -0
  31. package/fesm2022/star-ng-ui-editor.mjs +416 -0
  32. package/fesm2022/star-ng-ui-editor.mjs.map +1 -0
  33. package/fesm2022/star-ng-ui-field.mjs +378 -0
  34. package/fesm2022/star-ng-ui-field.mjs.map +1 -0
  35. package/fesm2022/star-ng-ui-file-upload.mjs +762 -0
  36. package/fesm2022/star-ng-ui-file-upload.mjs.map +1 -0
  37. package/fesm2022/star-ng-ui-i18n-de.mjs +179 -0
  38. package/fesm2022/star-ng-ui-i18n-de.mjs.map +1 -0
  39. package/fesm2022/star-ng-ui-i18n-es.mjs +179 -0
  40. package/fesm2022/star-ng-ui-i18n-es.mjs.map +1 -0
  41. package/fesm2022/star-ng-ui-input-group.mjs +188 -0
  42. package/fesm2022/star-ng-ui-input-group.mjs.map +1 -0
  43. package/fesm2022/star-ng-ui-input-mask.mjs +434 -0
  44. package/fesm2022/star-ng-ui-input-mask.mjs.map +1 -0
  45. package/fesm2022/star-ng-ui-input-number.mjs +691 -0
  46. package/fesm2022/star-ng-ui-input-number.mjs.map +1 -0
  47. package/fesm2022/star-ng-ui-input-otp.mjs +343 -0
  48. package/fesm2022/star-ng-ui-input-otp.mjs.map +1 -0
  49. package/fesm2022/star-ng-ui-input-tags.mjs +616 -0
  50. package/fesm2022/star-ng-ui-input-tags.mjs.map +1 -0
  51. package/fesm2022/star-ng-ui-knob.mjs +514 -0
  52. package/fesm2022/star-ng-ui-knob.mjs.map +1 -0
  53. package/fesm2022/star-ng-ui-layout.mjs +608 -0
  54. package/fesm2022/star-ng-ui-layout.mjs.map +1 -0
  55. package/fesm2022/star-ng-ui-listbox.mjs +978 -0
  56. package/fesm2022/star-ng-ui-listbox.mjs.map +1 -0
  57. package/fesm2022/star-ng-ui-media.mjs +833 -0
  58. package/fesm2022/star-ng-ui-media.mjs.map +1 -0
  59. package/fesm2022/star-ng-ui-menu.mjs +1840 -0
  60. package/fesm2022/star-ng-ui-menu.mjs.map +1 -0
  61. package/fesm2022/star-ng-ui-message.mjs +191 -0
  62. package/fesm2022/star-ng-ui-message.mjs.map +1 -0
  63. package/fesm2022/star-ng-ui-paginator.mjs +387 -0
  64. package/fesm2022/star-ng-ui-paginator.mjs.map +1 -0
  65. package/fesm2022/star-ng-ui-panel.mjs +324 -0
  66. package/fesm2022/star-ng-ui-panel.mjs.map +1 -0
  67. package/fesm2022/star-ng-ui-password.mjs +517 -0
  68. package/fesm2022/star-ng-ui-password.mjs.map +1 -0
  69. package/fesm2022/star-ng-ui-popover.mjs +241 -0
  70. package/fesm2022/star-ng-ui-popover.mjs.map +1 -0
  71. package/fesm2022/star-ng-ui-progress-bar.mjs +183 -0
  72. package/fesm2022/star-ng-ui-progress-bar.mjs.map +1 -0
  73. package/fesm2022/star-ng-ui-radio.mjs +411 -0
  74. package/fesm2022/star-ng-ui-radio.mjs.map +1 -0
  75. package/fesm2022/star-ng-ui-rating.mjs +211 -0
  76. package/fesm2022/star-ng-ui-rating.mjs.map +1 -0
  77. package/fesm2022/star-ng-ui-select-button.mjs +613 -0
  78. package/fesm2022/star-ng-ui-select-button.mjs.map +1 -0
  79. package/fesm2022/star-ng-ui-select.mjs +2523 -0
  80. package/fesm2022/star-ng-ui-select.mjs.map +1 -0
  81. package/fesm2022/star-ng-ui-skeleton.mjs +160 -0
  82. package/fesm2022/star-ng-ui-skeleton.mjs.map +1 -0
  83. package/fesm2022/star-ng-ui-slider.mjs +552 -0
  84. package/fesm2022/star-ng-ui-slider.mjs.map +1 -0
  85. package/fesm2022/star-ng-ui-spinner.mjs +148 -0
  86. package/fesm2022/star-ng-ui-spinner.mjs.map +1 -0
  87. package/fesm2022/star-ng-ui-stepper.mjs +360 -0
  88. package/fesm2022/star-ng-ui-stepper.mjs.map +1 -0
  89. package/fesm2022/star-ng-ui-table.mjs +3477 -0
  90. package/fesm2022/star-ng-ui-table.mjs.map +1 -0
  91. package/fesm2022/star-ng-ui-tabs.mjs +464 -0
  92. package/fesm2022/star-ng-ui-tabs.mjs.map +1 -0
  93. package/fesm2022/star-ng-ui-tag.mjs +129 -0
  94. package/fesm2022/star-ng-ui-tag.mjs.map +1 -0
  95. package/fesm2022/star-ng-ui-theme-switch.mjs +105 -0
  96. package/fesm2022/star-ng-ui-theme-switch.mjs.map +1 -0
  97. package/fesm2022/star-ng-ui-theme.mjs +98 -0
  98. package/fesm2022/star-ng-ui-theme.mjs.map +1 -0
  99. package/fesm2022/star-ng-ui-toast.mjs +298 -0
  100. package/fesm2022/star-ng-ui-toast.mjs.map +1 -0
  101. package/fesm2022/star-ng-ui-toggle-switch.mjs +316 -0
  102. package/fesm2022/star-ng-ui-toggle-switch.mjs.map +1 -0
  103. package/fesm2022/star-ng-ui-tooltip.mjs +297 -0
  104. package/fesm2022/star-ng-ui-tooltip.mjs.map +1 -0
  105. package/fesm2022/star-ng-ui-transloco.mjs +40 -0
  106. package/fesm2022/star-ng-ui-transloco.mjs.map +1 -0
  107. package/fesm2022/star-ng-ui-tree.mjs +1446 -0
  108. package/fesm2022/star-ng-ui-tree.mjs.map +1 -0
  109. package/fesm2022/star-ng-ui-utility.mjs +2134 -0
  110. package/fesm2022/star-ng-ui-utility.mjs.map +1 -0
  111. package/fesm2022/star-ng-ui.mjs +51 -0
  112. package/package.json +281 -5
  113. package/styles/_base.scss +70 -0
  114. package/styles/_shared.scss +2 -0
  115. package/styles/_tokens.scss +190 -0
  116. package/styles/controls/_accordion.scss +75 -0
  117. package/styles/controls/_autocomplete.scss +44 -0
  118. package/styles/controls/_avatar.scss +39 -0
  119. package/styles/controls/_breadcrumb.scss +45 -0
  120. package/styles/controls/_button.scss +137 -0
  121. package/styles/controls/_card.scss +38 -0
  122. package/styles/controls/_chart.scss +214 -0
  123. package/styles/controls/_chip.scss +51 -0
  124. package/styles/controls/_choice.scss +153 -0
  125. package/styles/controls/_data-display.scss +118 -0
  126. package/styles/controls/_date-picker.scss +300 -0
  127. package/styles/controls/_dialog.scss +123 -0
  128. package/styles/controls/_drawer.scss +118 -0
  129. package/styles/controls/_editor.scss +74 -0
  130. package/styles/controls/_field.scss +92 -0
  131. package/styles/controls/_file-upload.scss +136 -0
  132. package/styles/controls/_input-group.scss +104 -0
  133. package/styles/controls/_input-mask.scss +46 -0
  134. package/styles/controls/_input-number.scss +125 -0
  135. package/styles/controls/_knob.scss +76 -0
  136. package/styles/controls/_layout.scss +182 -0
  137. package/styles/controls/_listbox.scss +38 -0
  138. package/styles/controls/_media.scss +222 -0
  139. package/styles/controls/_menu.scss +254 -0
  140. package/styles/controls/_message.scss +48 -0
  141. package/styles/controls/_org-chart.scss +128 -0
  142. package/styles/controls/_paginator.scss +59 -0
  143. package/styles/controls/_panel.scss +83 -0
  144. package/styles/controls/_popover.scss +40 -0
  145. package/styles/controls/_progress-bar.scss +74 -0
  146. package/styles/controls/_select-button.scss +61 -0
  147. package/styles/controls/_select.scss +216 -0
  148. package/styles/controls/_skeleton.scss +43 -0
  149. package/styles/controls/_slider.scss +163 -0
  150. package/styles/controls/_spinner.scss +34 -0
  151. package/styles/controls/_stepper.scss +109 -0
  152. package/styles/controls/_table.scss +523 -0
  153. package/styles/controls/_tabs.scss +93 -0
  154. package/styles/controls/_tag.scss +84 -0
  155. package/styles/controls/_toast.scss +141 -0
  156. package/styles/controls/_tooltip.scss +14 -0
  157. package/styles/controls/_tree.scss +113 -0
  158. package/styles/controls/_utility.scss +654 -0
  159. package/styles/star-ng.css +5803 -0
  160. package/styles/star-ng.min.css +1 -0
  161. package/styles/star-ng.scss +50 -0
  162. package/theme/star-theme-first-paint.js +1 -0
  163. package/types/star-ng-ui-accordion.d.ts +82 -0
  164. package/types/star-ng-ui-autocomplete.d.ts +171 -0
  165. package/types/star-ng-ui-avatar.d.ts +43 -0
  166. package/types/star-ng-ui-badge.d.ts +46 -0
  167. package/types/star-ng-ui-breadcrumb.d.ts +39 -0
  168. package/types/star-ng-ui-button.d.ts +79 -0
  169. package/types/star-ng-ui-card.d.ts +29 -0
  170. package/types/star-ng-ui-chart.d.ts +337 -0
  171. package/types/star-ng-ui-checkbox.d.ts +92 -0
  172. package/types/star-ng-ui-core.d.ts +310 -0
  173. package/types/star-ng-ui-data-display.d.ts +339 -0
  174. package/types/star-ng-ui-date-picker.d.ts +701 -0
  175. package/types/star-ng-ui-dialog.d.ts +254 -0
  176. package/types/star-ng-ui-drawer.d.ts +29 -0
  177. package/types/star-ng-ui-editor.d.ts +96 -0
  178. package/types/star-ng-ui-field.d.ts +146 -0
  179. package/types/star-ng-ui-file-upload.d.ts +192 -0
  180. package/types/star-ng-ui-i18n-de.d.ts +7 -0
  181. package/types/star-ng-ui-i18n-es.d.ts +7 -0
  182. package/types/star-ng-ui-input-group.d.ts +58 -0
  183. package/types/star-ng-ui-input-mask.d.ts +126 -0
  184. package/types/star-ng-ui-input-number.d.ts +193 -0
  185. package/types/star-ng-ui-input-otp.d.ts +86 -0
  186. package/types/star-ng-ui-input-tags.d.ts +159 -0
  187. package/types/star-ng-ui-knob.d.ts +121 -0
  188. package/types/star-ng-ui-layout.d.ts +154 -0
  189. package/types/star-ng-ui-listbox.d.ts +197 -0
  190. package/types/star-ng-ui-media.d.ts +161 -0
  191. package/types/star-ng-ui-menu.d.ts +332 -0
  192. package/types/star-ng-ui-message.d.ts +52 -0
  193. package/types/star-ng-ui-paginator.d.ts +85 -0
  194. package/types/star-ng-ui-panel.d.ts +65 -0
  195. package/types/star-ng-ui-password.d.ts +129 -0
  196. package/types/star-ng-ui-popover.d.ts +57 -0
  197. package/types/star-ng-ui-progress-bar.d.ts +49 -0
  198. package/types/star-ng-ui-radio.d.ts +116 -0
  199. package/types/star-ng-ui-rating.d.ts +52 -0
  200. package/types/star-ng-ui-select-button.d.ts +169 -0
  201. package/types/star-ng-ui-select.d.ts +540 -0
  202. package/types/star-ng-ui-skeleton.d.ts +47 -0
  203. package/types/star-ng-ui-slider.d.ts +145 -0
  204. package/types/star-ng-ui-spinner.d.ts +29 -0
  205. package/types/star-ng-ui-stepper.d.ts +89 -0
  206. package/types/star-ng-ui-table.d.ts +829 -0
  207. package/types/star-ng-ui-tabs.d.ts +109 -0
  208. package/types/star-ng-ui-tag.d.ts +35 -0
  209. package/types/star-ng-ui-theme-switch.d.ts +36 -0
  210. package/types/star-ng-ui-theme.d.ts +95 -0
  211. package/types/star-ng-ui-toast.d.ts +84 -0
  212. package/types/star-ng-ui-toggle-switch.d.ts +81 -0
  213. package/types/star-ng-ui-tooltip.d.ts +66 -0
  214. package/types/star-ng-ui-transloco.d.ts +14 -0
  215. package/types/star-ng-ui-tree.d.ts +310 -0
  216. package/types/star-ng-ui-utility.d.ts +533 -0
  217. package/types/star-ng-ui.d.ts +51 -0
@@ -0,0 +1,978 @@
1
+ import { _IdGenerator } from "@angular/cdk/a11y";
2
+ import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import * as i0 from "@angular/core";
5
+ import { ChangeDetectionStrategy, Component, ElementRef, Injector, afterNextRender, booleanAttribute, computed, contentChild, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
6
+ import { STAR_UI_TEXT, matchesFilter, optionText, readOption } from "@star-ng/ui/core";
7
+ import { StarOptionTemplate } from "@star-ng/ui/select";
8
+ function buildLayout(options, groupOf, idPrefix) {
9
+ const rows = [];
10
+ const rowOfOption = [];
11
+ let current = null;
12
+ let groupId = null;
13
+ let groupRow = -1;
14
+ options.forEach((option, index) => {
15
+ if (groupOf) {
16
+ const label = groupOf(option);
17
+ if (index === 0 || label !== current) {
18
+ current = label;
19
+ groupId = `${idPrefix}-group-${index}`;
20
+ groupRow = rows.length;
21
+ rows.push({
22
+ kind: "group",
23
+ key: `g:${index}`,
24
+ label,
25
+ id: groupId
26
+ });
27
+ }
28
+ }
29
+ rowOfOption.push(rows.length);
30
+ rows.push({
31
+ kind: "option",
32
+ key: `o:${index}`,
33
+ option,
34
+ index,
35
+ groupId,
36
+ groupRow
37
+ });
38
+ });
39
+ return {
40
+ rows,
41
+ rowOfOption
42
+ };
43
+ }
44
+ function pageSize(viewportHeight, itemSize) {
45
+ const lines = Math.floor(viewportHeight / Math.max(1, itemSize));
46
+ return Math.max(1, lines - 1);
47
+ }
48
+ function keyboardTarget(key, active, count, page) {
49
+ if (count <= 0) return -1;
50
+ const last = count - 1;
51
+ let target;
52
+ switch (key) {
53
+ case "ArrowDown":
54
+ target = active + 1;
55
+ break;
56
+ case "ArrowUp":
57
+ target = active - 1;
58
+ break;
59
+ case "Home":
60
+ target = 0;
61
+ break;
62
+ case "End":
63
+ target = last;
64
+ break;
65
+ case "PageDown":
66
+ target = (active < 0 ? 0 : active) + page;
67
+ break;
68
+ case "PageUp": target = (active < 0 ? last : active) - page;
69
+ }
70
+ return Math.min(Math.max(target, 0), last);
71
+ }
72
+ function typeaheadIndex(count, labelAt, typed) {
73
+ for (let i = 0; i < count; i++) if (labelAt(i).toLowerCase().startsWith(typed)) return i;
74
+ return -1;
75
+ }
76
+ function revealRows(layout, index) {
77
+ const row = layout.rowOfOption[index];
78
+ if (row === void 0) return [0, 0];
79
+ return [layout.rows[row - 1]?.kind === "group" ? row - 1 : row, row];
80
+ }
81
+ function revealOffset(first, last, itemSize, scrollOffset, viewportHeight) {
82
+ const top = first * itemSize;
83
+ const bottom = (last + 1) * itemSize;
84
+ if (top < scrollOffset) return top;
85
+ if (viewportHeight > 0 && bottom > scrollOffset + viewportHeight) return bottom - viewportHeight;
86
+ return null;
87
+ }
88
+ function ariaPosition(index, count) {
89
+ return {
90
+ setsize: count,
91
+ posinset: index + 1
92
+ };
93
+ }
94
+ function listHeight(scrollHeight, rowCount, itemSize) {
95
+ return `min(${scrollHeight}, ${rowCount * Math.max(1, itemSize)}px)`;
96
+ }
97
+ function isRowRendered(row, range) {
98
+ return row >= range.start && row < range.end;
99
+ }
100
+ var StarListbox = class StarListbox {
101
+ text = inject(STAR_UI_TEXT);
102
+ listId = inject(_IdGenerator).getId("star-listbox-");
103
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
104
+ options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
105
+ optionLabel = input(null, ...ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []);
106
+ optionValue = input(null, ...ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []);
107
+ optionDisabled = input(null, ...ngDevMode ? [{ debugName: "optionDisabled" }] : /* istanbul ignore next */ []);
108
+ optionGroup = input(null, ...ngDevMode ? [{ debugName: "optionGroup" }] : /* istanbul ignore next */ []);
109
+ multiple = input(false, {
110
+ ...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
111
+ transform: booleanAttribute
112
+ });
113
+ filter = input(false, {
114
+ ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
115
+ transform: booleanAttribute
116
+ });
117
+ scrollHeight = input("16rem", ...ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
118
+ virtualScroll = input(false, {
119
+ ...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
120
+ transform: booleanAttribute
121
+ });
122
+ virtualItemSize = input(40, ...ngDevMode ? [{ debugName: "virtualItemSize" }] : /* istanbul ignore next */ []);
123
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
124
+ disabled = input(false, {
125
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
126
+ transform: booleanAttribute
127
+ });
128
+ invalid = input(false, {
129
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
130
+ transform: booleanAttribute
131
+ });
132
+ touched = input(false, {
133
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
134
+ transform: booleanAttribute
135
+ });
136
+ touch = output();
137
+ optionTemplate = contentChild(StarOptionTemplate, ...ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []);
138
+ list = viewChild("list", {
139
+ ...ngDevMode ? { debugName: "list" } : /* istanbul ignore next */ {},
140
+ read: ElementRef
141
+ });
142
+ viewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
143
+ injector = inject(Injector);
144
+ query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
145
+ active = signal(-1, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
146
+ typeahead = "";
147
+ typeaheadAt = 0;
148
+ visible = computed(() => {
149
+ const options = this.options().filter((option) => matchesFilter(this.labelOf(option), this.query()));
150
+ if (!this.optionGroup()) return options;
151
+ const order = /* @__PURE__ */ new Map();
152
+ for (const option of options) {
153
+ const group = this.groupOf(option);
154
+ if (!order.has(group)) order.set(group, order.size);
155
+ }
156
+ return options.map((option, index) => ({
157
+ option,
158
+ index,
159
+ rank: order.get(this.groupOf(option)) ?? 0
160
+ })).sort((a, b) => a.rank - b.rank || a.index - b.index).map(({ option }) => option);
161
+ }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
162
+ groupOf(option) {
163
+ const key = this.optionGroup();
164
+ const group = key ? readOption(option, key) : null;
165
+ return group === null || group === void 0 ? "" : String(group);
166
+ }
167
+ groupHeading(index) {
168
+ if (!this.optionGroup()) return null;
169
+ const options = this.visible();
170
+ const group = this.groupOf(options[index]);
171
+ return index === 0 || this.groupOf(options[index - 1]) !== group ? group : null;
172
+ }
173
+ groupId(index) {
174
+ if (!this.optionGroup()) return null;
175
+ const options = this.visible();
176
+ let first = index;
177
+ while (first > 0 && this.groupOf(options[first - 1]) === this.groupOf(options[index])) first--;
178
+ return `${this.listId}-group-${first}`;
179
+ }
180
+ itemSize = computed(() => Math.max(1, this.virtualItemSize()), ...ngDevMode ? [{ debugName: "itemSize" }] : /* istanbul ignore next */ []);
181
+ layout = computed(() => buildLayout(this.visible(), this.optionGroup() ? (option) => this.groupOf(option) : null, this.listId), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
182
+ viewportHeight = computed(() => listHeight(this.scrollHeight(), this.layout().rows.length, this.itemSize()), ...ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []);
183
+ renderedRange = signal({
184
+ start: 0,
185
+ end: 0
186
+ }, ...ngDevMode ? [{ debugName: "renderedRange" }] : /* istanbul ignore next */ []);
187
+ trackRow = (_index, row) => row.key;
188
+ positionOf(index) {
189
+ return ariaPosition(index, this.visible().length);
190
+ }
191
+ describedBy(row) {
192
+ return row.groupId !== null && isRowRendered(row.groupRow, this.renderedRange()) ? row.groupId : null;
193
+ }
194
+ activeId = computed(() => {
195
+ const index = this.active();
196
+ if (index < 0 || index >= this.visible().length) return null;
197
+ if (this.virtualScroll()) {
198
+ const row = this.layout().rowOfOption[index];
199
+ if (row === void 0 || !isRowRendered(row, this.renderedRange())) return null;
200
+ }
201
+ return `${this.listId}-${index}`;
202
+ }, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
203
+ constructor() {
204
+ effect((onCleanup) => {
205
+ const viewport = this.viewport();
206
+ if (!viewport) return;
207
+ const element = viewport.getElementRef().nativeElement;
208
+ this.renderedRange.set(viewport.getRenderedRange());
209
+ const range = viewport.renderedRangeStream.subscribe((next) => afterNextRender(() => this.renderedRange.set({ ...next }), { injector: this.injector }));
210
+ afterNextRender(() => element.querySelector(".cdk-virtual-scroll-content-wrapper")?.setAttribute("role", "presentation"), { injector: this.injector });
211
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => viewport.checkViewportSize());
212
+ observer?.observe(element);
213
+ onCleanup(() => {
214
+ range.unsubscribe();
215
+ observer?.disconnect();
216
+ });
217
+ });
218
+ }
219
+ labelOf(option) {
220
+ return optionText(option, this.optionLabel());
221
+ }
222
+ isDisabled(option) {
223
+ const key = this.optionDisabled();
224
+ return key ? !!readOption(option, key) : false;
225
+ }
226
+ valueOf(option) {
227
+ return readOption(option, this.optionValue());
228
+ }
229
+ isSelected(option) {
230
+ const value = this.value();
231
+ const optionValue = this.valueOf(option);
232
+ return Array.isArray(value) ? value.some((v) => Object.is(v, optionValue)) : Object.is(value, optionValue);
233
+ }
234
+ firstSelectedOrZero() {
235
+ return Math.max(0, this.visible().findIndex((option) => this.isSelected(option)));
236
+ }
237
+ choose(option) {
238
+ if (this.disabled() || this.isDisabled(option)) return;
239
+ const optionValue = this.valueOf(option);
240
+ if (this.multiple()) {
241
+ const current = Array.isArray(this.value()) ? this.value() : [];
242
+ this.value.set(this.isSelected(option) ? current.filter((v) => !Object.is(v, optionValue)) : [...current, optionValue]);
243
+ } else this.value.set(optionValue);
244
+ }
245
+ onFilterInput(text) {
246
+ this.query.set(text);
247
+ this.active.set(0);
248
+ this.viewport()?.scrollToOffset(0);
249
+ }
250
+ onFocus() {
251
+ if (this.active() >= 0) return;
252
+ this.active.set(this.firstSelectedOrZero());
253
+ if (this.virtualScroll()) this.reveal(this.active());
254
+ }
255
+ reveal(index) {
256
+ if (!this.virtualScroll()) {
257
+ queueMicrotask(() => this.list()?.nativeElement.querySelector(`#${CSS.escape(this.activeId() ?? "")}`)?.scrollIntoView?.({ block: "nearest" }));
258
+ return;
259
+ }
260
+ const viewport = this.viewport();
261
+ if (!viewport) return;
262
+ const [first, last] = revealRows(this.layout(), index);
263
+ const offset = revealOffset(first, last, this.itemSize(), viewport.measureScrollOffset(), viewport.getViewportSize());
264
+ if (offset !== null) viewport.scrollToOffset(offset);
265
+ }
266
+ onKeydown(event) {
267
+ const options = this.visible();
268
+ if (!options.length || this.disabled()) return;
269
+ const fromInput = event.target instanceof HTMLInputElement;
270
+ const page = pageSize(this.viewport()?.getViewportSize() || 256, this.itemSize());
271
+ const move = (key) => {
272
+ event.preventDefault();
273
+ this.active.set(typeof key === "number" ? key : keyboardTarget(key, this.active(), options.length, page));
274
+ this.reveal(this.active());
275
+ if (!this.multiple() && !fromInput) {
276
+ const option = options[this.active()];
277
+ if (!this.isDisabled(option)) this.value.set(this.valueOf(option));
278
+ }
279
+ };
280
+ switch (event.key) {
281
+ case "ArrowDown":
282
+ case "ArrowUp": return move(event.key);
283
+ case "Home":
284
+ case "End":
285
+ if (fromInput) return;
286
+ return move(event.key);
287
+ case "PageDown":
288
+ case "PageUp":
289
+ if (fromInput || !this.virtualScroll()) return;
290
+ return move(event.key);
291
+ case " ":
292
+ case "Enter":
293
+ if (event.key === " " && fromInput) return;
294
+ event.preventDefault();
295
+ if (options[this.active()] !== void 0) this.choose(options[this.active()]);
296
+ return;
297
+ default: if (event.key.length === 1 && !fromInput) {
298
+ const now = Date.now();
299
+ this.typeahead = (now - this.typeaheadAt > 500 ? "" : this.typeahead) + event.key.toLowerCase();
300
+ this.typeaheadAt = now;
301
+ const index = typeaheadIndex(options.length, (i) => this.labelOf(options[i]), this.typeahead);
302
+ if (index >= 0) move(index);
303
+ }
304
+ }
305
+ }
306
+ focus() {
307
+ this.list()?.nativeElement.focus();
308
+ }
309
+ static ɵfac = i0.ɵɵngDeclareFactory({
310
+ minVersion: "12.0.0",
311
+ version: "22.2.6",
312
+ ngImport: i0,
313
+ type: StarListbox,
314
+ deps: [],
315
+ target: i0.ɵɵFactoryTarget.Component
316
+ });
317
+ static ɵcmp = i0.ɵɵngDeclareComponent({
318
+ minVersion: "17.0.0",
319
+ version: "22.2.6",
320
+ type: StarListbox,
321
+ isStandalone: true,
322
+ selector: "star-listbox",
323
+ inputs: {
324
+ value: {
325
+ classPropertyName: "value",
326
+ publicName: "value",
327
+ isSignal: true,
328
+ isRequired: false,
329
+ transformFunction: null
330
+ },
331
+ options: {
332
+ classPropertyName: "options",
333
+ publicName: "options",
334
+ isSignal: true,
335
+ isRequired: false,
336
+ transformFunction: null
337
+ },
338
+ optionLabel: {
339
+ classPropertyName: "optionLabel",
340
+ publicName: "optionLabel",
341
+ isSignal: true,
342
+ isRequired: false,
343
+ transformFunction: null
344
+ },
345
+ optionValue: {
346
+ classPropertyName: "optionValue",
347
+ publicName: "optionValue",
348
+ isSignal: true,
349
+ isRequired: false,
350
+ transformFunction: null
351
+ },
352
+ optionDisabled: {
353
+ classPropertyName: "optionDisabled",
354
+ publicName: "optionDisabled",
355
+ isSignal: true,
356
+ isRequired: false,
357
+ transformFunction: null
358
+ },
359
+ optionGroup: {
360
+ classPropertyName: "optionGroup",
361
+ publicName: "optionGroup",
362
+ isSignal: true,
363
+ isRequired: false,
364
+ transformFunction: null
365
+ },
366
+ multiple: {
367
+ classPropertyName: "multiple",
368
+ publicName: "multiple",
369
+ isSignal: true,
370
+ isRequired: false,
371
+ transformFunction: null
372
+ },
373
+ filter: {
374
+ classPropertyName: "filter",
375
+ publicName: "filter",
376
+ isSignal: true,
377
+ isRequired: false,
378
+ transformFunction: null
379
+ },
380
+ scrollHeight: {
381
+ classPropertyName: "scrollHeight",
382
+ publicName: "scrollHeight",
383
+ isSignal: true,
384
+ isRequired: false,
385
+ transformFunction: null
386
+ },
387
+ virtualScroll: {
388
+ classPropertyName: "virtualScroll",
389
+ publicName: "virtualScroll",
390
+ isSignal: true,
391
+ isRequired: false,
392
+ transformFunction: null
393
+ },
394
+ virtualItemSize: {
395
+ classPropertyName: "virtualItemSize",
396
+ publicName: "virtualItemSize",
397
+ isSignal: true,
398
+ isRequired: false,
399
+ transformFunction: null
400
+ },
401
+ ariaLabel: {
402
+ classPropertyName: "ariaLabel",
403
+ publicName: "ariaLabel",
404
+ isSignal: true,
405
+ isRequired: false,
406
+ transformFunction: null
407
+ },
408
+ disabled: {
409
+ classPropertyName: "disabled",
410
+ publicName: "disabled",
411
+ isSignal: true,
412
+ isRequired: false,
413
+ transformFunction: null
414
+ },
415
+ invalid: {
416
+ classPropertyName: "invalid",
417
+ publicName: "invalid",
418
+ isSignal: true,
419
+ isRequired: false,
420
+ transformFunction: null
421
+ },
422
+ touched: {
423
+ classPropertyName: "touched",
424
+ publicName: "touched",
425
+ isSignal: true,
426
+ isRequired: false,
427
+ transformFunction: null
428
+ }
429
+ },
430
+ outputs: {
431
+ value: "valueChange",
432
+ touch: "touch"
433
+ },
434
+ host: {
435
+ properties: {
436
+ "class.star-listbox-box--disabled": "disabled()",
437
+ "class.star-listbox-box--invalid": "invalid() && touched()"
438
+ },
439
+ classAttribute: "star-listbox-box"
440
+ },
441
+ queries: [{
442
+ propertyName: "optionTemplate",
443
+ first: true,
444
+ predicate: StarOptionTemplate,
445
+ descendants: true,
446
+ isSignal: true
447
+ }],
448
+ viewQueries: [{
449
+ propertyName: "list",
450
+ first: true,
451
+ predicate: ["list"],
452
+ descendants: true,
453
+ read: ElementRef,
454
+ isSignal: true
455
+ }, {
456
+ propertyName: "viewport",
457
+ first: true,
458
+ predicate: CdkVirtualScrollViewport,
459
+ descendants: true,
460
+ isSignal: true
461
+ }],
462
+ ngImport: i0,
463
+ template: `
464
+ @if (filter()) {
465
+ <div class="star-panel__filter">
466
+ <i class="ph-bold ph-magnifying-glass" aria-hidden="true"></i>
467
+ <input
468
+ #filterInput
469
+ type="search"
470
+ class="star-input star-input--sm"
471
+ autocomplete="off"
472
+ [attr.aria-label]="text.filterPlaceholder"
473
+ [attr.aria-controls]="listId"
474
+ [placeholder]="text.filterPlaceholder"
475
+ [value]="query()"
476
+ (input)="onFilterInput(filterInput.value)"
477
+ (keydown)="onKeydown($event)"
478
+ />
479
+ </div>
480
+ }
481
+ @if (virtualScroll()) {
482
+ <!-- Virtual scroll: the CDK viewport is the listbox. Group headings and options are rows of one height. -->
483
+ <cdk-virtual-scroll-viewport
484
+ #list
485
+ class="star-listbox star-listbox--virtual star-listbox--viewport"
486
+ role="listbox"
487
+ [id]="listId"
488
+ [itemSize]="itemSize()"
489
+ [minBufferPx]="itemSize() * 4"
490
+ [maxBufferPx]="itemSize() * 8"
491
+ [attr.tabindex]="disabled() ? -1 : 0"
492
+ [attr.aria-label]="ariaLabel()"
493
+ [attr.aria-multiselectable]="multiple() || null"
494
+ [attr.aria-activedescendant]="activeId()"
495
+ [attr.aria-disabled]="disabled() || null"
496
+ [style.--star-item-size.px]="itemSize()"
497
+ [style.height]="viewportHeight()"
498
+ (keydown)="onKeydown($event)"
499
+ (focus)="onFocus()"
500
+ (blur)="touch.emit()"
501
+ >
502
+ <ng-container *cdkVirtualFor="let row of layout().rows; trackBy: trackRow">
503
+ @if (row.kind === 'group') {
504
+ <div class="star-listbox__group" role="presentation" [id]="row.id">
505
+ {{ row.label }}
506
+ </div>
507
+ } @else {
508
+ @let option = row.option;
509
+ @let i = row.index;
510
+ @let position = positionOf(i);
511
+ <!-- Keyboard is handled on the listbox via aria-activedescendant. -->
512
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
513
+ <div
514
+ class="star-listbox__option"
515
+ role="option"
516
+ [id]="listId + '-' + i"
517
+ [class.star-listbox__option--active]="active() === i"
518
+ [class.star-listbox__option--selected]="isSelected(option)"
519
+ [attr.aria-selected]="isSelected(option)"
520
+ [attr.aria-disabled]="isDisabled(option) || null"
521
+ [attr.aria-describedby]="describedBy(row)"
522
+ [attr.aria-setsize]="position.setsize"
523
+ [attr.aria-posinset]="position.posinset"
524
+ (click)="active.set(i); choose(option)"
525
+ >
526
+ @if (multiple()) {
527
+ <span class="star-check__box" aria-hidden="true">
528
+ @if (isSelected(option)) {
529
+ <i class="ph-bold ph-check"></i>
530
+ }
531
+ </span>
532
+ }
533
+ <span class="star-listbox__label">
534
+ @if (optionTemplate(); as custom) {
535
+ <ng-container
536
+ *ngTemplateOutlet="
537
+ custom.template;
538
+ context: { $implicit: option, selected: isSelected(option), index: i }
539
+ "
540
+ />
541
+ } @else {
542
+ {{ labelOf(option) }}
543
+ }
544
+ </span>
545
+ </div>
546
+ }
547
+ </ng-container>
548
+ </cdk-virtual-scroll-viewport>
549
+ @if (!visible().length) {
550
+ <div class="star-listbox__empty" role="presentation">{{ text.emptyFilterMessage }}</div>
551
+ }
552
+ } @else {
553
+ <ul
554
+ #list
555
+ class="star-listbox"
556
+ role="listbox"
557
+ [id]="listId"
558
+ [attr.tabindex]="disabled() ? -1 : 0"
559
+ [attr.aria-label]="ariaLabel()"
560
+ [attr.aria-multiselectable]="multiple() || null"
561
+ [attr.aria-activedescendant]="activeId()"
562
+ [attr.aria-disabled]="disabled() || null"
563
+ [style.max-height]="scrollHeight()"
564
+ (keydown)="onKeydown($event)"
565
+ (focus)="onFocus()"
566
+ (blur)="touch.emit()"
567
+ >
568
+ @for (option of visible(); track $index; let i = $index) {
569
+ @if (groupHeading(i); as heading) {
570
+ <li class="star-listbox__group" role="presentation" [id]="groupId(i)">{{ heading }}</li>
571
+ }
572
+ <!-- Keyboard is handled on the listbox via aria-activedescendant. -->
573
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
574
+ <li
575
+ class="star-listbox__option"
576
+ role="option"
577
+ [id]="listId + '-' + i"
578
+ [class.star-listbox__option--active]="active() === i"
579
+ [class.star-listbox__option--selected]="isSelected(option)"
580
+ [attr.aria-selected]="isSelected(option)"
581
+ [attr.aria-disabled]="isDisabled(option) || null"
582
+ [attr.aria-describedby]="groupId(i)"
583
+ (click)="active.set(i); choose(option)"
584
+ >
585
+ @if (multiple()) {
586
+ <span class="star-check__box" aria-hidden="true">
587
+ @if (isSelected(option)) {
588
+ <i class="ph-bold ph-check"></i>
589
+ }
590
+ </span>
591
+ }
592
+ <span class="star-listbox__label">
593
+ @if (optionTemplate(); as custom) {
594
+ <ng-container
595
+ *ngTemplateOutlet="
596
+ custom.template;
597
+ context: { $implicit: option, selected: isSelected(option), index: i }
598
+ "
599
+ />
600
+ } @else {
601
+ {{ labelOf(option) }}
602
+ }
603
+ </span>
604
+ </li>
605
+ }
606
+ </ul>
607
+ <!-- Outside the listbox: a listbox may contain options and groups only. -->
608
+ @if (!visible().length) {
609
+ <div class="star-listbox__empty" role="presentation">{{ text.emptyFilterMessage }}</div>
610
+ }
611
+ }
612
+ `,
613
+ isInline: true,
614
+ dependencies: [
615
+ {
616
+ kind: "directive",
617
+ type: NgTemplateOutlet,
618
+ selector: "[ngTemplateOutlet]",
619
+ inputs: [
620
+ "ngTemplateOutletContext",
621
+ "ngTemplateOutlet",
622
+ "ngTemplateOutletInjector"
623
+ ]
624
+ },
625
+ {
626
+ kind: "component",
627
+ type: CdkVirtualScrollViewport,
628
+ selector: "cdk-virtual-scroll-viewport",
629
+ inputs: ["orientation", "appendOnly"],
630
+ outputs: ["scrolledIndexChange"]
631
+ },
632
+ {
633
+ kind: "directive",
634
+ type: CdkFixedSizeVirtualScroll,
635
+ selector: "cdk-virtual-scroll-viewport[itemSize]",
636
+ inputs: [
637
+ "itemSize",
638
+ "minBufferPx",
639
+ "maxBufferPx"
640
+ ]
641
+ },
642
+ {
643
+ kind: "directive",
644
+ type: CdkVirtualForOf,
645
+ selector: "[cdkVirtualFor][cdkVirtualForOf]",
646
+ inputs: [
647
+ "cdkVirtualForOf",
648
+ "cdkVirtualForTrackBy",
649
+ "cdkVirtualForTemplate",
650
+ "cdkVirtualForTemplateCacheSize"
651
+ ]
652
+ }
653
+ ],
654
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
655
+ });
656
+ };
657
+ i0.ɵɵngDeclareClassMetadata({
658
+ minVersion: "12.0.0",
659
+ version: "22.2.6",
660
+ ngImport: i0,
661
+ type: StarListbox,
662
+ decorators: [{
663
+ type: Component,
664
+ args: [{
665
+ selector: "star-listbox",
666
+ imports: [
667
+ NgTemplateOutlet,
668
+ CdkVirtualScrollViewport,
669
+ CdkFixedSizeVirtualScroll,
670
+ CdkVirtualForOf
671
+ ],
672
+ changeDetection: ChangeDetectionStrategy.OnPush,
673
+ host: {
674
+ class: "star-listbox-box",
675
+ "[class.star-listbox-box--disabled]": "disabled()",
676
+ "[class.star-listbox-box--invalid]": "invalid() && touched()"
677
+ },
678
+ template: `
679
+ @if (filter()) {
680
+ <div class="star-panel__filter">
681
+ <i class="ph-bold ph-magnifying-glass" aria-hidden="true"></i>
682
+ <input
683
+ #filterInput
684
+ type="search"
685
+ class="star-input star-input--sm"
686
+ autocomplete="off"
687
+ [attr.aria-label]="text.filterPlaceholder"
688
+ [attr.aria-controls]="listId"
689
+ [placeholder]="text.filterPlaceholder"
690
+ [value]="query()"
691
+ (input)="onFilterInput(filterInput.value)"
692
+ (keydown)="onKeydown($event)"
693
+ />
694
+ </div>
695
+ }
696
+ @if (virtualScroll()) {
697
+ <!-- Virtual scroll: the CDK viewport is the listbox. Group headings and options are rows of one height. -->
698
+ <cdk-virtual-scroll-viewport
699
+ #list
700
+ class="star-listbox star-listbox--virtual star-listbox--viewport"
701
+ role="listbox"
702
+ [id]="listId"
703
+ [itemSize]="itemSize()"
704
+ [minBufferPx]="itemSize() * 4"
705
+ [maxBufferPx]="itemSize() * 8"
706
+ [attr.tabindex]="disabled() ? -1 : 0"
707
+ [attr.aria-label]="ariaLabel()"
708
+ [attr.aria-multiselectable]="multiple() || null"
709
+ [attr.aria-activedescendant]="activeId()"
710
+ [attr.aria-disabled]="disabled() || null"
711
+ [style.--star-item-size.px]="itemSize()"
712
+ [style.height]="viewportHeight()"
713
+ (keydown)="onKeydown($event)"
714
+ (focus)="onFocus()"
715
+ (blur)="touch.emit()"
716
+ >
717
+ <ng-container *cdkVirtualFor="let row of layout().rows; trackBy: trackRow">
718
+ @if (row.kind === 'group') {
719
+ <div class="star-listbox__group" role="presentation" [id]="row.id">
720
+ {{ row.label }}
721
+ </div>
722
+ } @else {
723
+ @let option = row.option;
724
+ @let i = row.index;
725
+ @let position = positionOf(i);
726
+ <!-- Keyboard is handled on the listbox via aria-activedescendant. -->
727
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
728
+ <div
729
+ class="star-listbox__option"
730
+ role="option"
731
+ [id]="listId + '-' + i"
732
+ [class.star-listbox__option--active]="active() === i"
733
+ [class.star-listbox__option--selected]="isSelected(option)"
734
+ [attr.aria-selected]="isSelected(option)"
735
+ [attr.aria-disabled]="isDisabled(option) || null"
736
+ [attr.aria-describedby]="describedBy(row)"
737
+ [attr.aria-setsize]="position.setsize"
738
+ [attr.aria-posinset]="position.posinset"
739
+ (click)="active.set(i); choose(option)"
740
+ >
741
+ @if (multiple()) {
742
+ <span class="star-check__box" aria-hidden="true">
743
+ @if (isSelected(option)) {
744
+ <i class="ph-bold ph-check"></i>
745
+ }
746
+ </span>
747
+ }
748
+ <span class="star-listbox__label">
749
+ @if (optionTemplate(); as custom) {
750
+ <ng-container
751
+ *ngTemplateOutlet="
752
+ custom.template;
753
+ context: { $implicit: option, selected: isSelected(option), index: i }
754
+ "
755
+ />
756
+ } @else {
757
+ {{ labelOf(option) }}
758
+ }
759
+ </span>
760
+ </div>
761
+ }
762
+ </ng-container>
763
+ </cdk-virtual-scroll-viewport>
764
+ @if (!visible().length) {
765
+ <div class="star-listbox__empty" role="presentation">{{ text.emptyFilterMessage }}</div>
766
+ }
767
+ } @else {
768
+ <ul
769
+ #list
770
+ class="star-listbox"
771
+ role="listbox"
772
+ [id]="listId"
773
+ [attr.tabindex]="disabled() ? -1 : 0"
774
+ [attr.aria-label]="ariaLabel()"
775
+ [attr.aria-multiselectable]="multiple() || null"
776
+ [attr.aria-activedescendant]="activeId()"
777
+ [attr.aria-disabled]="disabled() || null"
778
+ [style.max-height]="scrollHeight()"
779
+ (keydown)="onKeydown($event)"
780
+ (focus)="onFocus()"
781
+ (blur)="touch.emit()"
782
+ >
783
+ @for (option of visible(); track $index; let i = $index) {
784
+ @if (groupHeading(i); as heading) {
785
+ <li class="star-listbox__group" role="presentation" [id]="groupId(i)">{{ heading }}</li>
786
+ }
787
+ <!-- Keyboard is handled on the listbox via aria-activedescendant. -->
788
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
789
+ <li
790
+ class="star-listbox__option"
791
+ role="option"
792
+ [id]="listId + '-' + i"
793
+ [class.star-listbox__option--active]="active() === i"
794
+ [class.star-listbox__option--selected]="isSelected(option)"
795
+ [attr.aria-selected]="isSelected(option)"
796
+ [attr.aria-disabled]="isDisabled(option) || null"
797
+ [attr.aria-describedby]="groupId(i)"
798
+ (click)="active.set(i); choose(option)"
799
+ >
800
+ @if (multiple()) {
801
+ <span class="star-check__box" aria-hidden="true">
802
+ @if (isSelected(option)) {
803
+ <i class="ph-bold ph-check"></i>
804
+ }
805
+ </span>
806
+ }
807
+ <span class="star-listbox__label">
808
+ @if (optionTemplate(); as custom) {
809
+ <ng-container
810
+ *ngTemplateOutlet="
811
+ custom.template;
812
+ context: { $implicit: option, selected: isSelected(option), index: i }
813
+ "
814
+ />
815
+ } @else {
816
+ {{ labelOf(option) }}
817
+ }
818
+ </span>
819
+ </li>
820
+ }
821
+ </ul>
822
+ <!-- Outside the listbox: a listbox may contain options and groups only. -->
823
+ @if (!visible().length) {
824
+ <div class="star-listbox__empty" role="presentation">{{ text.emptyFilterMessage }}</div>
825
+ }
826
+ }
827
+ `
828
+ }]
829
+ }],
830
+ ctorParameters: () => [],
831
+ propDecorators: {
832
+ value: [{
833
+ type: i0.Input,
834
+ args: [{
835
+ isSignal: true,
836
+ alias: "value",
837
+ required: false
838
+ }]
839
+ }, {
840
+ type: i0.Output,
841
+ args: ["valueChange"]
842
+ }],
843
+ options: [{
844
+ type: i0.Input,
845
+ args: [{
846
+ isSignal: true,
847
+ alias: "options",
848
+ required: false
849
+ }]
850
+ }],
851
+ optionLabel: [{
852
+ type: i0.Input,
853
+ args: [{
854
+ isSignal: true,
855
+ alias: "optionLabel",
856
+ required: false
857
+ }]
858
+ }],
859
+ optionValue: [{
860
+ type: i0.Input,
861
+ args: [{
862
+ isSignal: true,
863
+ alias: "optionValue",
864
+ required: false
865
+ }]
866
+ }],
867
+ optionDisabled: [{
868
+ type: i0.Input,
869
+ args: [{
870
+ isSignal: true,
871
+ alias: "optionDisabled",
872
+ required: false
873
+ }]
874
+ }],
875
+ optionGroup: [{
876
+ type: i0.Input,
877
+ args: [{
878
+ isSignal: true,
879
+ alias: "optionGroup",
880
+ required: false
881
+ }]
882
+ }],
883
+ multiple: [{
884
+ type: i0.Input,
885
+ args: [{
886
+ isSignal: true,
887
+ alias: "multiple",
888
+ required: false
889
+ }]
890
+ }],
891
+ filter: [{
892
+ type: i0.Input,
893
+ args: [{
894
+ isSignal: true,
895
+ alias: "filter",
896
+ required: false
897
+ }]
898
+ }],
899
+ scrollHeight: [{
900
+ type: i0.Input,
901
+ args: [{
902
+ isSignal: true,
903
+ alias: "scrollHeight",
904
+ required: false
905
+ }]
906
+ }],
907
+ virtualScroll: [{
908
+ type: i0.Input,
909
+ args: [{
910
+ isSignal: true,
911
+ alias: "virtualScroll",
912
+ required: false
913
+ }]
914
+ }],
915
+ virtualItemSize: [{
916
+ type: i0.Input,
917
+ args: [{
918
+ isSignal: true,
919
+ alias: "virtualItemSize",
920
+ required: false
921
+ }]
922
+ }],
923
+ ariaLabel: [{
924
+ type: i0.Input,
925
+ args: [{
926
+ isSignal: true,
927
+ alias: "ariaLabel",
928
+ required: false
929
+ }]
930
+ }],
931
+ disabled: [{
932
+ type: i0.Input,
933
+ args: [{
934
+ isSignal: true,
935
+ alias: "disabled",
936
+ required: false
937
+ }]
938
+ }],
939
+ invalid: [{
940
+ type: i0.Input,
941
+ args: [{
942
+ isSignal: true,
943
+ alias: "invalid",
944
+ required: false
945
+ }]
946
+ }],
947
+ touched: [{
948
+ type: i0.Input,
949
+ args: [{
950
+ isSignal: true,
951
+ alias: "touched",
952
+ required: false
953
+ }]
954
+ }],
955
+ touch: [{
956
+ type: i0.Output,
957
+ args: ["touch"]
958
+ }],
959
+ optionTemplate: [{
960
+ type: i0.ContentChild,
961
+ args: [i0.forwardRef(() => StarOptionTemplate), { isSignal: true }]
962
+ }],
963
+ list: [{
964
+ type: i0.ViewChild,
965
+ args: ["list", {
966
+ read: ElementRef,
967
+ isSignal: true
968
+ }]
969
+ }],
970
+ viewport: [{
971
+ type: i0.ViewChild,
972
+ args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }]
973
+ }]
974
+ }
975
+ });
976
+ export { StarListbox };
977
+
978
+ //# sourceMappingURL=star-ng-ui-listbox.mjs.map