@star-ng/ui 0.0.0-stage → 0.2.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 +162 -2
  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 +786 -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 +484 -0
  22. package/fesm2022/star-ng-ui-core.mjs.map +1 -0
  23. package/fesm2022/star-ng-ui-data-display.mjs +1870 -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 +886 -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 +2547 -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 +3531 -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 +285 -3
  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 +124 -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 +5807 -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 +373 -0
  173. package/types/star-ng-ui-data-display.d.ts +438 -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 +170 -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 +563 -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 +885 -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 +343 -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,786 @@
1
+ import { CdkConnectedOverlay, CdkOverlayOrigin } from "@angular/cdk/overlay";
2
+ import { NgTemplateOutlet } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, booleanAttribute, computed, effect, inject, input, linkedSignal, model, output, signal, untracked, viewChild } from "@angular/core";
5
+ import { matchesFilter } from "@star-ng/ui/core";
6
+ import { StarOptionListBase } from "@star-ng/ui/select";
7
+ var StarAutoCompleteBase = class StarAutoCompleteBase extends StarOptionListBase {
8
+ suggestions = input(null, ...ngDevMode ? [{ debugName: "suggestions" }] : /* istanbul ignore next */ []);
9
+ minQueryLength = input(1, ...ngDevMode ? [{ debugName: "minQueryLength" }] : /* istanbul ignore next */ []);
10
+ delay = input(300, ...ngDevMode ? [{ debugName: "delay" }] : /* istanbul ignore next */ []);
11
+ dropdown = input(false, {
12
+ ...ngDevMode ? { debugName: "dropdown" } : /* istanbul ignore next */ {},
13
+ transform: booleanAttribute
14
+ });
15
+ autoHighlight = input(false, {
16
+ ...ngDevMode ? { debugName: "autoHighlight" } : /* istanbul ignore next */ {},
17
+ transform: booleanAttribute
18
+ });
19
+ showEmptyMessage = input(true, {
20
+ ...ngDevMode ? { debugName: "showEmptyMessage" } : /* istanbul ignore next */ {},
21
+ transform: booleanAttribute
22
+ });
23
+ completeMethod = output();
24
+ closeOnChoose = true;
25
+ control = viewChild.required("control", ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
26
+ known = signal([], ...ngDevMode ? [{ debugName: "known" }] : /* istanbul ignore next */ []);
27
+ showAll = signal(false, ...ngDevMode ? [{ debugName: "showAll" }] : /* istanbul ignore next */ []);
28
+ searchTimer;
29
+ query = linkedSignal(() => this.queryFromValue(), ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
30
+ visibleOptions = computed(() => {
31
+ const remote = this.suggestions();
32
+ const query = this.query();
33
+ const candidates = remote ?? (this.showAll() || !query ? this.options() : this.options().filter((option) => matchesFilter(this.labelOf(option), query)));
34
+ return this.groupedOrder(this.isMultiple ? candidates.filter((option) => !this.isSelected(option)) : candidates);
35
+ }, ...ngDevMode ? [{ debugName: "visibleOptions" }] : /* istanbul ignore next */ []);
36
+ queryLongEnough = computed(() => this.showAll() || this.query().length >= this.minQueryLength(), ...ngDevMode ? [{ debugName: "queryLongEnough" }] : /* istanbul ignore next */ []);
37
+ panelVisible = computed(() => this.open() && this.queryLongEnough() && (this.visibleOptions().length > 0 || this.loading() || this.showEmptyMessage()), ...ngDevMode ? [{ debugName: "panelVisible" }] : /* istanbul ignore next */ []);
38
+ liveText = computed(() => {
39
+ if (!this.panelVisible()) return "";
40
+ if (this.loading()) return this.text.searching;
41
+ const count = this.visibleOptions().length;
42
+ return count ? this.text.resultsAvailable(count) : this.emptyText();
43
+ }, ...ngDevMode ? [{ debugName: "liveText" }] : /* istanbul ignore next */ []);
44
+ constructor() {
45
+ super();
46
+ inject(DestroyRef).onDestroy(() => clearTimeout(this.searchTimer));
47
+ effect(() => {
48
+ this.visibleOptions();
49
+ untracked(() => {
50
+ this.resetScroll();
51
+ this.activeIndex.set(this.autoHighlight() ? this.firstEnabledFrom(0, 1) : -1);
52
+ });
53
+ });
54
+ }
55
+ initialActiveIndex() {
56
+ return this.autoHighlight() ? this.firstEnabledFrom(0, 1) : -1;
57
+ }
58
+ optionForValue(value) {
59
+ const pools = [
60
+ this.known(),
61
+ this.suggestions() ?? [],
62
+ this.options()
63
+ ];
64
+ for (const pool of pools) {
65
+ const match = pool.find((option) => this.equals(this.valueOf(option), value));
66
+ if (match !== void 0) return match;
67
+ }
68
+ }
69
+ labelForValue(value) {
70
+ const option = this.optionForValue(value);
71
+ if (option !== void 0) return this.labelOf(option);
72
+ return this.optionValue() === null ? this.labelOf(value) : String(value);
73
+ }
74
+ remember(option) {
75
+ this.known.update((known) => known.includes(option) ? known : [...known, option]);
76
+ }
77
+ onQuery(text) {
78
+ this.query.set(text);
79
+ this.showAll.set(false);
80
+ clearTimeout(this.searchTimer);
81
+ if (text.length < this.minQueryLength()) {
82
+ this.closePanel(false);
83
+ return;
84
+ }
85
+ this.openPanel();
86
+ this.searchTimer = setTimeout(() => this.completeMethod.emit({ query: text }), this.delay());
87
+ }
88
+ showAllOptions() {
89
+ if (!this.interactive()) return;
90
+ if (this.panelVisible()) {
91
+ this.closePanel();
92
+ return;
93
+ }
94
+ this.showAll.set(true);
95
+ this.completeMethod.emit({ query: "" });
96
+ this.openPanel();
97
+ this.focus();
98
+ }
99
+ onOutsideClick(event) {
100
+ if (this.control().nativeElement.contains(event.target)) return;
101
+ this.closePanel(false);
102
+ this.onBlurCommit();
103
+ this.touch.emit();
104
+ }
105
+ onInputBlur() {
106
+ if (this.panelVisible()) return;
107
+ this.onBlurCommit();
108
+ this.touch.emit();
109
+ }
110
+ onKeydown(event) {
111
+ if (event.key === "Home" || event.key === "End") return;
112
+ if (event.key === "Enter" && !this.panelVisible()) return;
113
+ if (event.key === "ArrowDown" && !this.open() && !this.queryLongEnough()) return;
114
+ super.onKeydown(event);
115
+ }
116
+ setText(text) {
117
+ this.query.set(text);
118
+ this.trigger().nativeElement.value = text;
119
+ }
120
+ highlight(label) {
121
+ const query = this.query().trim();
122
+ const index = query ? label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) : -1;
123
+ if (index < 0) return [
124
+ label,
125
+ "",
126
+ ""
127
+ ];
128
+ return [
129
+ label.slice(0, index),
130
+ label.slice(index, index + query.length),
131
+ label.slice(index + query.length)
132
+ ];
133
+ }
134
+ chips() {
135
+ return [];
136
+ }
137
+ static ɵfac = i0.ɵɵngDeclareFactory({
138
+ minVersion: "12.0.0",
139
+ version: "22.2.6",
140
+ ngImport: i0,
141
+ type: StarAutoCompleteBase,
142
+ deps: [],
143
+ target: i0.ɵɵFactoryTarget.Directive
144
+ });
145
+ static ɵdir = i0.ɵɵngDeclareDirective({
146
+ minVersion: "17.2.0",
147
+ version: "22.2.6",
148
+ type: StarAutoCompleteBase,
149
+ isStandalone: true,
150
+ inputs: {
151
+ suggestions: {
152
+ classPropertyName: "suggestions",
153
+ publicName: "suggestions",
154
+ isSignal: true,
155
+ isRequired: false,
156
+ transformFunction: null
157
+ },
158
+ minQueryLength: {
159
+ classPropertyName: "minQueryLength",
160
+ publicName: "minQueryLength",
161
+ isSignal: true,
162
+ isRequired: false,
163
+ transformFunction: null
164
+ },
165
+ delay: {
166
+ classPropertyName: "delay",
167
+ publicName: "delay",
168
+ isSignal: true,
169
+ isRequired: false,
170
+ transformFunction: null
171
+ },
172
+ dropdown: {
173
+ classPropertyName: "dropdown",
174
+ publicName: "dropdown",
175
+ isSignal: true,
176
+ isRequired: false,
177
+ transformFunction: null
178
+ },
179
+ autoHighlight: {
180
+ classPropertyName: "autoHighlight",
181
+ publicName: "autoHighlight",
182
+ isSignal: true,
183
+ isRequired: false,
184
+ transformFunction: null
185
+ },
186
+ showEmptyMessage: {
187
+ classPropertyName: "showEmptyMessage",
188
+ publicName: "showEmptyMessage",
189
+ isSignal: true,
190
+ isRequired: false,
191
+ transformFunction: null
192
+ }
193
+ },
194
+ outputs: { completeMethod: "completeMethod" },
195
+ viewQueries: [{
196
+ propertyName: "control",
197
+ first: true,
198
+ predicate: ["control"],
199
+ descendants: true,
200
+ isSignal: true
201
+ }],
202
+ usesInheritance: true,
203
+ ngImport: i0
204
+ });
205
+ };
206
+ i0.ɵɵngDeclareClassMetadata({
207
+ minVersion: "12.0.0",
208
+ version: "22.2.6",
209
+ ngImport: i0,
210
+ type: StarAutoCompleteBase,
211
+ decorators: [{ type: Directive }],
212
+ ctorParameters: () => [],
213
+ propDecorators: {
214
+ suggestions: [{
215
+ type: i0.Input,
216
+ args: [{
217
+ isSignal: true,
218
+ alias: "suggestions",
219
+ required: false
220
+ }]
221
+ }],
222
+ minQueryLength: [{
223
+ type: i0.Input,
224
+ args: [{
225
+ isSignal: true,
226
+ alias: "minQueryLength",
227
+ required: false
228
+ }]
229
+ }],
230
+ delay: [{
231
+ type: i0.Input,
232
+ args: [{
233
+ isSignal: true,
234
+ alias: "delay",
235
+ required: false
236
+ }]
237
+ }],
238
+ dropdown: [{
239
+ type: i0.Input,
240
+ args: [{
241
+ isSignal: true,
242
+ alias: "dropdown",
243
+ required: false
244
+ }]
245
+ }],
246
+ autoHighlight: [{
247
+ type: i0.Input,
248
+ args: [{
249
+ isSignal: true,
250
+ alias: "autoHighlight",
251
+ required: false
252
+ }]
253
+ }],
254
+ showEmptyMessage: [{
255
+ type: i0.Input,
256
+ args: [{
257
+ isSignal: true,
258
+ alias: "showEmptyMessage",
259
+ required: false
260
+ }]
261
+ }],
262
+ completeMethod: [{
263
+ type: i0.Output,
264
+ args: ["completeMethod"]
265
+ }],
266
+ control: [{
267
+ type: i0.ViewChild,
268
+ args: ["control", { isSignal: true }]
269
+ }]
270
+ }
271
+ });
272
+ const TEMPLATE = `
273
+ <div #control class="star-select__control star-ac__control" cdkOverlayOrigin #origin="cdkOverlayOrigin">
274
+ @if (isMultiple) {
275
+ @for (chip of chips(); track $index) {
276
+ <span class="star-chip star-chip--sm">
277
+ {{ chip.label }}
278
+ @if (interactive()) {
279
+ <button
280
+ type="button"
281
+ class="star-chip__remove"
282
+ tabindex="-1"
283
+ [attr.aria-label]="text.removeItem(chip.label)"
284
+ (click)="removeValue(chip.value)"
285
+ >
286
+ <i class="ph-bold ph-x" aria-hidden="true"></i>
287
+ </button>
288
+ }
289
+ </span>
290
+ }
291
+ }
292
+ <input
293
+ #trigger
294
+ type="text"
295
+ class="star-ac__input"
296
+ role="combobox"
297
+ aria-autocomplete="list"
298
+ autocomplete="off"
299
+ [id]="inputId()"
300
+ [attr.name]="name() || null"
301
+ [value]="query()"
302
+ [attr.placeholder]="placeholder()"
303
+ [disabled]="disabled()"
304
+ [readOnly]="readonly()"
305
+ [attr.aria-label]="ariaLabel()"
306
+ [attr.aria-labelledby]="ariaLabelledBy()"
307
+ [attr.aria-required]="required() || null"
308
+ [attr.aria-invalid]="showInvalid() || null"
309
+ [attr.aria-expanded]="panelVisible()"
310
+ [attr.aria-controls]="panelVisible() ? listId : null"
311
+ [attr.aria-activedescendant]="panelVisible() ? activeId() : null"
312
+ (input)="onQuery(trigger.value)"
313
+ (keydown)="onKeydown($event)"
314
+ (blur)="onInputBlur()"
315
+ />
316
+ @if (loading()) {
317
+ <i class="ph-bold ph-spinner-gap star-spin star-select__caret" aria-hidden="true"></i>
318
+ }
319
+ @if (showClear() && hasValue() && interactive()) {
320
+ <button type="button" class="star-select__icon-btn" [attr.aria-label]="text.clear" (click)="clear()">
321
+ <i class="ph-bold ph-x" aria-hidden="true"></i>
322
+ </button>
323
+ }
324
+ @if (dropdown()) {
325
+ <button
326
+ type="button"
327
+ class="star-select__icon-btn"
328
+ tabindex="-1"
329
+ [attr.aria-label]="text.showOptions"
330
+ [disabled]="!interactive()"
331
+ (click)="showAllOptions()"
332
+ >
333
+ <i class="ph-bold ph-caret-down" aria-hidden="true"></i>
334
+ </button>
335
+ }
336
+ </div>
337
+ <span class="star-sr-only" aria-live="polite">{{ liveText() }}</span>
338
+
339
+ <ng-template
340
+ cdkConnectedOverlay
341
+ cdkConnectedOverlayUsePopover="inline"
342
+ cdkConnectedOverlayMatchWidth
343
+ [cdkConnectedOverlayOrigin]="origin"
344
+ [cdkConnectedOverlayOpen]="panelVisible()"
345
+ [cdkConnectedOverlayPositions]="positions"
346
+ (attach)="onPanelAttached()"
347
+ (detach)="closePanel(false)"
348
+ (overlayOutsideClick)="onOutsideClick($event)"
349
+ >
350
+ <div class="star-panel" (mousedown)="onPanelMousedown($event)">
351
+ <ul
352
+ class="star-listbox"
353
+ role="listbox"
354
+ [id]="listId"
355
+ [class.star-listbox--virtual]="virtualScroll()"
356
+ [style.--star-item-size.px]="virtualScroll() ? virtualItemSize() : null"
357
+ [style.max-height]="scrollHeight()"
358
+ [attr.aria-label]="ariaLabel()"
359
+ [attr.aria-labelledby]="ariaLabelledBy()"
360
+ (scroll)="onListScroll($event)"
361
+ >
362
+ @if (virtualWindow().before) {
363
+ <li class="star-listbox__spacer" role="presentation" [style.height.px]="virtualWindow().before"></li>
364
+ }
365
+ @for (row of renderedRows(); track row.key) {
366
+ @if (row.kind === 'group') {
367
+ <li class="star-listbox__group" role="presentation" [id]="row.id">{{ row.label }}</li>
368
+ } @else {
369
+ @let option = row.option;
370
+ @let i = row.index;
371
+ <!-- Keyboard is handled on the combobox via aria-activedescendant (WAI-ARIA combobox pattern). -->
372
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
373
+ <li
374
+ class="star-listbox__option"
375
+ role="option"
376
+ [id]="optionId(i)"
377
+ [class.star-listbox__option--active]="activeIndex() === i"
378
+ [attr.aria-selected]="activeIndex() === i"
379
+ [attr.aria-disabled]="isDisabled(option) || null"
380
+ [attr.aria-describedby]="describedBy(row)"
381
+ [attr.aria-setsize]="virtualScroll() ? visibleOptions().length : null"
382
+ [attr.aria-posinset]="virtualScroll() ? i + 1 : null"
383
+ (click)="onOptionClick(option, i)"
384
+ (mousemove)="isDisabled(option) || activeIndex.set(i)"
385
+ >
386
+ <span class="star-listbox__label">
387
+ @if (optionTemplate(); as custom) {
388
+ <ng-container *ngTemplateOutlet="custom.template; context: optionContext(option, i)" />
389
+ } @else {
390
+ @let parts = highlight(labelOf(option));
391
+ {{ parts[0] }}<mark class="star-ac__match">{{ parts[1] }}</mark>{{ parts[2] }}
392
+ }
393
+ </span>
394
+ </li>
395
+ }
396
+ } @empty {
397
+ <li class="star-listbox__empty" role="presentation">
398
+ {{ loading() ? text.searching : emptyText() }}
399
+ </li>
400
+ }
401
+ @if (virtualWindow().after) {
402
+ <li class="star-listbox__spacer" role="presentation" [style.height.px]="virtualWindow().after"></li>
403
+ }
404
+ </ul>
405
+ </div>
406
+ </ng-template>
407
+ `;
408
+ const HOST = {
409
+ class: "star-select star-ac",
410
+ "[class.star-select--open]": "panelVisible()",
411
+ "[class.star-select--disabled]": "disabled()",
412
+ "[class.star-select--invalid]": "showInvalid()",
413
+ "[class.star-select--sm]": "size() === 'sm'"
414
+ };
415
+ var StarAutoComplete = class StarAutoComplete extends StarAutoCompleteBase {
416
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
417
+ selected = output();
418
+ isMultiple = false;
419
+ hasValue = computed(() => this.value() !== null || !!this.query(), ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
420
+ queryFromValue() {
421
+ const value = this.value();
422
+ return value === null ? "" : this.labelForValue(value);
423
+ }
424
+ isSelected(option) {
425
+ const value = this.value();
426
+ return value !== null && this.equals(this.valueOf(option), value);
427
+ }
428
+ choose(option) {
429
+ this.remember(option);
430
+ this.value.set(this.valueOf(option));
431
+ this.setText(this.labelOf(option));
432
+ this.selected.emit(option);
433
+ }
434
+ onBlurCommit() {
435
+ const text = this.query().trim();
436
+ if (!text) {
437
+ if (this.value() !== null) this.value.set(null);
438
+ return;
439
+ }
440
+ if (text === this.queryFromValue()) return;
441
+ const exact = this.visibleOptions().find((option) => !this.isDisabled(option) && this.labelOf(option).toLocaleLowerCase() === text.toLocaleLowerCase());
442
+ if (exact !== void 0) this.choose(exact);
443
+ else this.setText(this.queryFromValue());
444
+ }
445
+ removeValue(_value) {
446
+ this.clear();
447
+ }
448
+ clear() {
449
+ this.value.set(null);
450
+ this.setText("");
451
+ this.focus();
452
+ }
453
+ static ɵfac = i0.ɵɵngDeclareFactory({
454
+ minVersion: "12.0.0",
455
+ version: "22.2.6",
456
+ ngImport: i0,
457
+ type: StarAutoComplete,
458
+ deps: null,
459
+ target: i0.ɵɵFactoryTarget.Component
460
+ });
461
+ static ɵcmp = i0.ɵɵngDeclareComponent({
462
+ minVersion: "17.0.0",
463
+ version: "22.2.6",
464
+ type: StarAutoComplete,
465
+ isStandalone: true,
466
+ selector: "star-autocomplete",
467
+ inputs: { value: {
468
+ classPropertyName: "value",
469
+ publicName: "value",
470
+ isSignal: true,
471
+ isRequired: false,
472
+ transformFunction: null
473
+ } },
474
+ outputs: {
475
+ value: "valueChange",
476
+ selected: "selected"
477
+ },
478
+ host: {
479
+ properties: {
480
+ "class.star-select--open": "panelVisible()",
481
+ "class.star-select--disabled": "disabled()",
482
+ "class.star-select--invalid": "showInvalid()",
483
+ "class.star-select--sm": "size() === 'sm'"
484
+ },
485
+ classAttribute: "star-select star-ac"
486
+ },
487
+ usesInheritance: true,
488
+ ngImport: i0,
489
+ template: "\n <div #control class=\"star-select__control star-ac__control\" cdkOverlayOrigin #origin=\"cdkOverlayOrigin\">\n @if (isMultiple) {\n @for (chip of chips(); track $index) {\n <span class=\"star-chip star-chip--sm\">\n {{ chip.label }}\n @if (interactive()) {\n <button\n type=\"button\"\n class=\"star-chip__remove\"\n tabindex=\"-1\"\n [attr.aria-label]=\"text.removeItem(chip.label)\"\n (click)=\"removeValue(chip.value)\"\n >\n <i class=\"ph-bold ph-x\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n }\n }\n <input\n #trigger\n type=\"text\"\n class=\"star-ac__input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [id]=\"inputId()\"\n [attr.name]=\"name() || null\"\n [value]=\"query()\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"showInvalid() || null\"\n [attr.aria-expanded]=\"panelVisible()\"\n [attr.aria-controls]=\"panelVisible() ? listId : null\"\n [attr.aria-activedescendant]=\"panelVisible() ? activeId() : null\"\n (input)=\"onQuery(trigger.value)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onInputBlur()\"\n />\n @if (loading()) {\n <i class=\"ph-bold ph-spinner-gap star-spin star-select__caret\" aria-hidden=\"true\"></i>\n }\n @if (showClear() && hasValue() && interactive()) {\n <button type=\"button\" class=\"star-select__icon-btn\" [attr.aria-label]=\"text.clear\" (click)=\"clear()\">\n <i class=\"ph-bold ph-x\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (dropdown()) {\n <button\n type=\"button\"\n class=\"star-select__icon-btn\"\n tabindex=\"-1\"\n [attr.aria-label]=\"text.showOptions\"\n [disabled]=\"!interactive()\"\n (click)=\"showAllOptions()\"\n >\n <i class=\"ph-bold ph-caret-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <span class=\"star-sr-only\" aria-live=\"polite\">{{ liveText() }}</span>\n\n <ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayUsePopover=\"inline\"\n cdkConnectedOverlayMatchWidth\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"panelVisible()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (attach)=\"onPanelAttached()\"\n (detach)=\"closePanel(false)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n >\n <div class=\"star-panel\" (mousedown)=\"onPanelMousedown($event)\">\n <ul\n class=\"star-listbox\"\n role=\"listbox\"\n [id]=\"listId\"\n [class.star-listbox--virtual]=\"virtualScroll()\"\n [style.--star-item-size.px]=\"virtualScroll() ? virtualItemSize() : null\"\n [style.max-height]=\"scrollHeight()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n (scroll)=\"onListScroll($event)\"\n >\n @if (virtualWindow().before) {\n <li class=\"star-listbox__spacer\" role=\"presentation\" [style.height.px]=\"virtualWindow().before\"></li>\n }\n @for (row of renderedRows(); track row.key) {\n @if (row.kind === 'group') {\n <li class=\"star-listbox__group\" role=\"presentation\" [id]=\"row.id\">{{ row.label }}</li>\n } @else {\n @let option = row.option;\n @let i = row.index;\n <!-- Keyboard is handled on the combobox via aria-activedescendant (WAI-ARIA combobox pattern). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"star-listbox__option\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [class.star-listbox__option--active]=\"activeIndex() === i\"\n [attr.aria-selected]=\"activeIndex() === i\"\n [attr.aria-disabled]=\"isDisabled(option) || null\"\n [attr.aria-describedby]=\"describedBy(row)\"\n [attr.aria-setsize]=\"virtualScroll() ? visibleOptions().length : null\"\n [attr.aria-posinset]=\"virtualScroll() ? i + 1 : null\"\n (click)=\"onOptionClick(option, i)\"\n (mousemove)=\"isDisabled(option) || activeIndex.set(i)\"\n >\n <span class=\"star-listbox__label\">\n @if (optionTemplate(); as custom) {\n <ng-container *ngTemplateOutlet=\"custom.template; context: optionContext(option, i)\" />\n } @else {\n @let parts = highlight(labelOf(option));\n {{ parts[0] }}<mark class=\"star-ac__match\">{{ parts[1] }}</mark>{{ parts[2] }}\n }\n </span>\n </li>\n }\n } @empty {\n <li class=\"star-listbox__empty\" role=\"presentation\">\n {{ loading() ? text.searching : emptyText() }}\n </li>\n }\n @if (virtualWindow().after) {\n <li class=\"star-listbox__spacer\" role=\"presentation\" [style.height.px]=\"virtualWindow().after\"></li>\n }\n </ul>\n </div>\n </ng-template>\n",
490
+ isInline: true,
491
+ dependencies: [
492
+ {
493
+ kind: "directive",
494
+ type: CdkConnectedOverlay,
495
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
496
+ inputs: [
497
+ "cdkConnectedOverlayOrigin",
498
+ "cdkConnectedOverlayPositions",
499
+ "cdkConnectedOverlayPositionStrategy",
500
+ "cdkConnectedOverlayOffsetX",
501
+ "cdkConnectedOverlayOffsetY",
502
+ "cdkConnectedOverlayWidth",
503
+ "cdkConnectedOverlayHeight",
504
+ "cdkConnectedOverlayMinWidth",
505
+ "cdkConnectedOverlayMinHeight",
506
+ "cdkConnectedOverlayBackdropClass",
507
+ "cdkConnectedOverlayPanelClass",
508
+ "cdkConnectedOverlayViewportMargin",
509
+ "cdkConnectedOverlayScrollStrategy",
510
+ "cdkConnectedOverlayOpen",
511
+ "cdkConnectedOverlayDisableClose",
512
+ "cdkConnectedOverlayTransformOriginOn",
513
+ "cdkConnectedOverlayHasBackdrop",
514
+ "cdkConnectedOverlayLockPosition",
515
+ "cdkConnectedOverlayFlexibleDimensions",
516
+ "cdkConnectedOverlayGrowAfterOpen",
517
+ "cdkConnectedOverlayPush",
518
+ "cdkConnectedOverlayDisposeOnNavigation",
519
+ "cdkConnectedOverlayUsePopover",
520
+ "cdkConnectedOverlayMatchWidth",
521
+ "cdkConnectedOverlay"
522
+ ],
523
+ outputs: [
524
+ "backdropClick",
525
+ "positionChange",
526
+ "attach",
527
+ "detach",
528
+ "overlayKeydown",
529
+ "overlayOutsideClick"
530
+ ],
531
+ exportAs: ["cdkConnectedOverlay"]
532
+ },
533
+ {
534
+ kind: "directive",
535
+ type: CdkOverlayOrigin,
536
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
537
+ exportAs: ["cdkOverlayOrigin"]
538
+ },
539
+ {
540
+ kind: "directive",
541
+ type: NgTemplateOutlet,
542
+ selector: "[ngTemplateOutlet]",
543
+ inputs: [
544
+ "ngTemplateOutletContext",
545
+ "ngTemplateOutlet",
546
+ "ngTemplateOutletInjector"
547
+ ]
548
+ }
549
+ ],
550
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
551
+ });
552
+ };
553
+ i0.ɵɵngDeclareClassMetadata({
554
+ minVersion: "12.0.0",
555
+ version: "22.2.6",
556
+ ngImport: i0,
557
+ type: StarAutoComplete,
558
+ decorators: [{
559
+ type: Component,
560
+ args: [{
561
+ selector: "star-autocomplete",
562
+ imports: [
563
+ CdkConnectedOverlay,
564
+ CdkOverlayOrigin,
565
+ NgTemplateOutlet
566
+ ],
567
+ changeDetection: ChangeDetectionStrategy.OnPush,
568
+ host: HOST,
569
+ template: TEMPLATE
570
+ }]
571
+ }],
572
+ propDecorators: {
573
+ value: [{
574
+ type: i0.Input,
575
+ args: [{
576
+ isSignal: true,
577
+ alias: "value",
578
+ required: false
579
+ }]
580
+ }, {
581
+ type: i0.Output,
582
+ args: ["valueChange"]
583
+ }],
584
+ selected: [{
585
+ type: i0.Output,
586
+ args: ["selected"]
587
+ }]
588
+ }
589
+ });
590
+ var StarMultiAutoComplete = class StarMultiAutoComplete extends StarAutoCompleteBase {
591
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
592
+ selectionLimit = input(0, ...ngDevMode ? [{ debugName: "selectionLimit" }] : /* istanbul ignore next */ []);
593
+ isMultiple = true;
594
+ hasValue = computed(() => this.value().length > 0, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
595
+ queryFromValue() {
596
+ return "";
597
+ }
598
+ chips() {
599
+ return this.value().map((value) => ({
600
+ value,
601
+ label: this.labelForValue(value)
602
+ }));
603
+ }
604
+ isSelected(option) {
605
+ const optionValue = this.valueOf(option);
606
+ return this.value().some((value) => this.equals(value, optionValue));
607
+ }
608
+ choose(option) {
609
+ const limit = this.selectionLimit();
610
+ if (this.isSelected(option) || limit > 0 && this.value().length >= limit) return;
611
+ this.remember(option);
612
+ this.value.update((values) => [...values, this.valueOf(option)]);
613
+ this.setText("");
614
+ }
615
+ onBlurCommit() {
616
+ this.setText("");
617
+ }
618
+ onKeydown(event) {
619
+ if (event.key === "Backspace" && !this.query() && this.value().length && this.interactive()) {
620
+ this.value.update((values) => values.slice(0, -1));
621
+ return;
622
+ }
623
+ super.onKeydown(event);
624
+ }
625
+ removeValue(value) {
626
+ this.value.update((values) => values.filter((v) => !this.equals(v, value)));
627
+ this.focus();
628
+ }
629
+ clear() {
630
+ this.value.set([]);
631
+ this.setText("");
632
+ this.focus();
633
+ }
634
+ static ɵfac = i0.ɵɵngDeclareFactory({
635
+ minVersion: "12.0.0",
636
+ version: "22.2.6",
637
+ ngImport: i0,
638
+ type: StarMultiAutoComplete,
639
+ deps: null,
640
+ target: i0.ɵɵFactoryTarget.Component
641
+ });
642
+ static ɵcmp = i0.ɵɵngDeclareComponent({
643
+ minVersion: "17.0.0",
644
+ version: "22.2.6",
645
+ type: StarMultiAutoComplete,
646
+ isStandalone: true,
647
+ selector: "star-multi-autocomplete",
648
+ inputs: {
649
+ value: {
650
+ classPropertyName: "value",
651
+ publicName: "value",
652
+ isSignal: true,
653
+ isRequired: false,
654
+ transformFunction: null
655
+ },
656
+ selectionLimit: {
657
+ classPropertyName: "selectionLimit",
658
+ publicName: "selectionLimit",
659
+ isSignal: true,
660
+ isRequired: false,
661
+ transformFunction: null
662
+ }
663
+ },
664
+ outputs: { value: "valueChange" },
665
+ host: {
666
+ properties: {
667
+ "class.star-select--open": "panelVisible()",
668
+ "class.star-select--disabled": "disabled()",
669
+ "class.star-select--invalid": "showInvalid()",
670
+ "class.star-select--sm": "size() === 'sm'"
671
+ },
672
+ classAttribute: "star-select star-ac star-ac--multi"
673
+ },
674
+ usesInheritance: true,
675
+ ngImport: i0,
676
+ template: "\n <div #control class=\"star-select__control star-ac__control\" cdkOverlayOrigin #origin=\"cdkOverlayOrigin\">\n @if (isMultiple) {\n @for (chip of chips(); track $index) {\n <span class=\"star-chip star-chip--sm\">\n {{ chip.label }}\n @if (interactive()) {\n <button\n type=\"button\"\n class=\"star-chip__remove\"\n tabindex=\"-1\"\n [attr.aria-label]=\"text.removeItem(chip.label)\"\n (click)=\"removeValue(chip.value)\"\n >\n <i class=\"ph-bold ph-x\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n }\n }\n <input\n #trigger\n type=\"text\"\n class=\"star-ac__input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [id]=\"inputId()\"\n [attr.name]=\"name() || null\"\n [value]=\"query()\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"showInvalid() || null\"\n [attr.aria-expanded]=\"panelVisible()\"\n [attr.aria-controls]=\"panelVisible() ? listId : null\"\n [attr.aria-activedescendant]=\"panelVisible() ? activeId() : null\"\n (input)=\"onQuery(trigger.value)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onInputBlur()\"\n />\n @if (loading()) {\n <i class=\"ph-bold ph-spinner-gap star-spin star-select__caret\" aria-hidden=\"true\"></i>\n }\n @if (showClear() && hasValue() && interactive()) {\n <button type=\"button\" class=\"star-select__icon-btn\" [attr.aria-label]=\"text.clear\" (click)=\"clear()\">\n <i class=\"ph-bold ph-x\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (dropdown()) {\n <button\n type=\"button\"\n class=\"star-select__icon-btn\"\n tabindex=\"-1\"\n [attr.aria-label]=\"text.showOptions\"\n [disabled]=\"!interactive()\"\n (click)=\"showAllOptions()\"\n >\n <i class=\"ph-bold ph-caret-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <span class=\"star-sr-only\" aria-live=\"polite\">{{ liveText() }}</span>\n\n <ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayUsePopover=\"inline\"\n cdkConnectedOverlayMatchWidth\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"panelVisible()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (attach)=\"onPanelAttached()\"\n (detach)=\"closePanel(false)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n >\n <div class=\"star-panel\" (mousedown)=\"onPanelMousedown($event)\">\n <ul\n class=\"star-listbox\"\n role=\"listbox\"\n [id]=\"listId\"\n [class.star-listbox--virtual]=\"virtualScroll()\"\n [style.--star-item-size.px]=\"virtualScroll() ? virtualItemSize() : null\"\n [style.max-height]=\"scrollHeight()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n (scroll)=\"onListScroll($event)\"\n >\n @if (virtualWindow().before) {\n <li class=\"star-listbox__spacer\" role=\"presentation\" [style.height.px]=\"virtualWindow().before\"></li>\n }\n @for (row of renderedRows(); track row.key) {\n @if (row.kind === 'group') {\n <li class=\"star-listbox__group\" role=\"presentation\" [id]=\"row.id\">{{ row.label }}</li>\n } @else {\n @let option = row.option;\n @let i = row.index;\n <!-- Keyboard is handled on the combobox via aria-activedescendant (WAI-ARIA combobox pattern). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"star-listbox__option\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [class.star-listbox__option--active]=\"activeIndex() === i\"\n [attr.aria-selected]=\"activeIndex() === i\"\n [attr.aria-disabled]=\"isDisabled(option) || null\"\n [attr.aria-describedby]=\"describedBy(row)\"\n [attr.aria-setsize]=\"virtualScroll() ? visibleOptions().length : null\"\n [attr.aria-posinset]=\"virtualScroll() ? i + 1 : null\"\n (click)=\"onOptionClick(option, i)\"\n (mousemove)=\"isDisabled(option) || activeIndex.set(i)\"\n >\n <span class=\"star-listbox__label\">\n @if (optionTemplate(); as custom) {\n <ng-container *ngTemplateOutlet=\"custom.template; context: optionContext(option, i)\" />\n } @else {\n @let parts = highlight(labelOf(option));\n {{ parts[0] }}<mark class=\"star-ac__match\">{{ parts[1] }}</mark>{{ parts[2] }}\n }\n </span>\n </li>\n }\n } @empty {\n <li class=\"star-listbox__empty\" role=\"presentation\">\n {{ loading() ? text.searching : emptyText() }}\n </li>\n }\n @if (virtualWindow().after) {\n <li class=\"star-listbox__spacer\" role=\"presentation\" [style.height.px]=\"virtualWindow().after\"></li>\n }\n </ul>\n </div>\n </ng-template>\n",
677
+ isInline: true,
678
+ dependencies: [
679
+ {
680
+ kind: "directive",
681
+ type: CdkConnectedOverlay,
682
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
683
+ inputs: [
684
+ "cdkConnectedOverlayOrigin",
685
+ "cdkConnectedOverlayPositions",
686
+ "cdkConnectedOverlayPositionStrategy",
687
+ "cdkConnectedOverlayOffsetX",
688
+ "cdkConnectedOverlayOffsetY",
689
+ "cdkConnectedOverlayWidth",
690
+ "cdkConnectedOverlayHeight",
691
+ "cdkConnectedOverlayMinWidth",
692
+ "cdkConnectedOverlayMinHeight",
693
+ "cdkConnectedOverlayBackdropClass",
694
+ "cdkConnectedOverlayPanelClass",
695
+ "cdkConnectedOverlayViewportMargin",
696
+ "cdkConnectedOverlayScrollStrategy",
697
+ "cdkConnectedOverlayOpen",
698
+ "cdkConnectedOverlayDisableClose",
699
+ "cdkConnectedOverlayTransformOriginOn",
700
+ "cdkConnectedOverlayHasBackdrop",
701
+ "cdkConnectedOverlayLockPosition",
702
+ "cdkConnectedOverlayFlexibleDimensions",
703
+ "cdkConnectedOverlayGrowAfterOpen",
704
+ "cdkConnectedOverlayPush",
705
+ "cdkConnectedOverlayDisposeOnNavigation",
706
+ "cdkConnectedOverlayUsePopover",
707
+ "cdkConnectedOverlayMatchWidth",
708
+ "cdkConnectedOverlay"
709
+ ],
710
+ outputs: [
711
+ "backdropClick",
712
+ "positionChange",
713
+ "attach",
714
+ "detach",
715
+ "overlayKeydown",
716
+ "overlayOutsideClick"
717
+ ],
718
+ exportAs: ["cdkConnectedOverlay"]
719
+ },
720
+ {
721
+ kind: "directive",
722
+ type: CdkOverlayOrigin,
723
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
724
+ exportAs: ["cdkOverlayOrigin"]
725
+ },
726
+ {
727
+ kind: "directive",
728
+ type: NgTemplateOutlet,
729
+ selector: "[ngTemplateOutlet]",
730
+ inputs: [
731
+ "ngTemplateOutletContext",
732
+ "ngTemplateOutlet",
733
+ "ngTemplateOutletInjector"
734
+ ]
735
+ }
736
+ ],
737
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
738
+ });
739
+ };
740
+ i0.ɵɵngDeclareClassMetadata({
741
+ minVersion: "12.0.0",
742
+ version: "22.2.6",
743
+ ngImport: i0,
744
+ type: StarMultiAutoComplete,
745
+ decorators: [{
746
+ type: Component,
747
+ args: [{
748
+ selector: "star-multi-autocomplete",
749
+ imports: [
750
+ CdkConnectedOverlay,
751
+ CdkOverlayOrigin,
752
+ NgTemplateOutlet
753
+ ],
754
+ changeDetection: ChangeDetectionStrategy.OnPush,
755
+ host: {
756
+ ...HOST,
757
+ class: "star-select star-ac star-ac--multi"
758
+ },
759
+ template: TEMPLATE
760
+ }]
761
+ }],
762
+ propDecorators: {
763
+ value: [{
764
+ type: i0.Input,
765
+ args: [{
766
+ isSignal: true,
767
+ alias: "value",
768
+ required: false
769
+ }]
770
+ }, {
771
+ type: i0.Output,
772
+ args: ["valueChange"]
773
+ }],
774
+ selectionLimit: [{
775
+ type: i0.Input,
776
+ args: [{
777
+ isSignal: true,
778
+ alias: "selectionLimit",
779
+ required: false
780
+ }]
781
+ }]
782
+ }
783
+ });
784
+ export { StarAutoComplete, StarAutoCompleteBase, StarMultiAutoComplete };
785
+
786
+ //# sourceMappingURL=star-ng-ui-autocomplete.mjs.map