@tectra-ng/ui 0.0.0-stage → 0.1.1

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 (317) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -2
  3. package/amount/README.md +28 -0
  4. package/autocomplete/README.md +82 -0
  5. package/avatar/README.md +43 -0
  6. package/badge/README.md +19 -0
  7. package/button/README.md +46 -0
  8. package/button-group/README.md +8 -0
  9. package/card/README.md +30 -0
  10. package/cascade-select/README.md +49 -0
  11. package/checkbox/README.md +64 -0
  12. package/chip/README.md +38 -0
  13. package/chips-input/README.md +47 -0
  14. package/color-picker/README.md +43 -0
  15. package/confirm/README.md +46 -0
  16. package/country/README.md +23 -0
  17. package/country-select/README.md +39 -0
  18. package/dialog/README.md +84 -0
  19. package/divider/README.md +24 -0
  20. package/drawer/README.md +54 -0
  21. package/email-suggestion/README.md +20 -0
  22. package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
  23. package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
  24. package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
  25. package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
  26. package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
  27. package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
  28. package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
  29. package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
  30. package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
  31. package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
  32. package/fesm2022/tectra-ng-ui-button.mjs +725 -0
  33. package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
  34. package/fesm2022/tectra-ng-ui-card.mjs +210 -0
  35. package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
  36. package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
  37. package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
  38. package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
  39. package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
  40. package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
  41. package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
  42. package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
  43. package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
  44. package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
  45. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
  46. package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
  47. package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
  48. package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
  49. package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
  50. package/fesm2022/tectra-ng-ui-country.mjs +313 -0
  51. package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
  52. package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
  53. package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
  54. package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
  55. package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
  56. package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
  57. package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
  58. package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
  59. package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
  60. package/fesm2022/tectra-ng-ui-field.mjs +492 -0
  61. package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
  62. package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
  63. package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
  64. package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
  65. package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
  66. package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
  67. package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
  68. package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
  69. package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
  70. package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
  71. package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
  72. package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
  73. package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
  74. package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
  75. package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
  76. package/fesm2022/tectra-ng-ui-input.mjs +260 -0
  77. package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
  78. package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
  79. package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
  80. package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
  81. package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
  82. package/fesm2022/tectra-ng-ui-label.mjs +271 -0
  83. package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
  84. package/fesm2022/tectra-ng-ui-link.mjs +699 -0
  85. package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
  86. package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
  87. package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
  88. package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
  89. package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
  90. package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
  91. package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
  92. package/fesm2022/tectra-ng-ui-message.mjs +975 -0
  93. package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
  94. package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
  95. package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
  96. package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
  97. package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
  98. package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
  99. package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
  100. package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
  101. package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
  102. package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
  103. package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
  104. package/fesm2022/tectra-ng-ui-password.mjs +871 -0
  105. package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
  106. package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
  107. package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
  108. package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
  109. package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
  110. package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
  111. package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
  112. package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
  113. package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
  114. package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
  115. package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
  116. package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
  117. package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
  118. package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
  119. package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
  120. package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
  121. package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
  122. package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
  123. package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
  124. package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
  125. package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
  126. package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
  127. package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
  128. package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
  129. package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
  130. package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
  131. package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
  132. package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
  133. package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
  134. package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
  135. package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
  136. package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
  137. package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
  138. package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
  139. package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
  140. package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
  141. package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
  142. package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
  143. package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
  144. package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
  145. package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
  146. package/fesm2022/tectra-ng-ui.mjs +4 -0
  147. package/fesm2022/tectra-ng-ui.mjs.map +1 -0
  148. package/field/README.md +43 -0
  149. package/fieldset/README.md +36 -0
  150. package/highlight-text/README.md +20 -0
  151. package/icon-field/README.md +30 -0
  152. package/input/README.md +22 -0
  153. package/input-group/README.md +21 -0
  154. package/input-mask/README.md +30 -0
  155. package/input-number/README.md +61 -0
  156. package/input-otp/README.md +44 -0
  157. package/key-filter/README.md +31 -0
  158. package/knob/README.md +50 -0
  159. package/label/README.md +29 -0
  160. package/link/README.md +47 -0
  161. package/listbox/README.md +68 -0
  162. package/mention-textarea/README.md +47 -0
  163. package/menu/README.md +65 -0
  164. package/message/README.md +58 -0
  165. package/multiselect/README.md +85 -0
  166. package/overlay-badge/README.md +30 -0
  167. package/package.json +301 -3
  168. package/paginator/README.md +60 -0
  169. package/panel/README.md +45 -0
  170. package/password/README.md +60 -0
  171. package/password-generator/README.md +34 -0
  172. package/pill/README.md +42 -0
  173. package/popover/README.md +67 -0
  174. package/progress-bar/README.md +32 -0
  175. package/progress-spinner/README.md +22 -0
  176. package/radio-button/README.md +54 -0
  177. package/rating/README.md +49 -0
  178. package/select/README.md +78 -0
  179. package/skeleton/README.md +27 -0
  180. package/slider/README.md +48 -0
  181. package/speed-dial/README.md +49 -0
  182. package/split-button/README.md +45 -0
  183. package/status-icon/README.md +22 -0
  184. package/table/README.md +178 -0
  185. package/tag/README.md +42 -0
  186. package/textarea/README.md +37 -0
  187. package/toast/README.md +52 -0
  188. package/toggle-button/README.md +34 -0
  189. package/toggle-switch/README.md +49 -0
  190. package/tooltip/README.md +60 -0
  191. package/tree-select/README.md +49 -0
  192. package/types/tectra-ng-ui-amount.d.ts +135 -0
  193. package/types/tectra-ng-ui-amount.d.ts.map +1 -0
  194. package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
  195. package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
  196. package/types/tectra-ng-ui-avatar.d.ts +289 -0
  197. package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
  198. package/types/tectra-ng-ui-badge.d.ts +119 -0
  199. package/types/tectra-ng-ui-badge.d.ts.map +1 -0
  200. package/types/tectra-ng-ui-button-group.d.ts +6 -0
  201. package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
  202. package/types/tectra-ng-ui-button.d.ts +466 -0
  203. package/types/tectra-ng-ui-button.d.ts.map +1 -0
  204. package/types/tectra-ng-ui-card.d.ts +71 -0
  205. package/types/tectra-ng-ui-card.d.ts.map +1 -0
  206. package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
  207. package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
  208. package/types/tectra-ng-ui-checkbox.d.ts +450 -0
  209. package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
  210. package/types/tectra-ng-ui-chip.d.ts +106 -0
  211. package/types/tectra-ng-ui-chip.d.ts.map +1 -0
  212. package/types/tectra-ng-ui-chips-input.d.ts +187 -0
  213. package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
  214. package/types/tectra-ng-ui-color-picker.d.ts +237 -0
  215. package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
  216. package/types/tectra-ng-ui-confirm.d.ts +80 -0
  217. package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
  218. package/types/tectra-ng-ui-country-select.d.ts +235 -0
  219. package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
  220. package/types/tectra-ng-ui-country.d.ts +105 -0
  221. package/types/tectra-ng-ui-country.d.ts.map +1 -0
  222. package/types/tectra-ng-ui-dialog.d.ts +453 -0
  223. package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
  224. package/types/tectra-ng-ui-divider.d.ts +70 -0
  225. package/types/tectra-ng-ui-divider.d.ts.map +1 -0
  226. package/types/tectra-ng-ui-drawer.d.ts +188 -0
  227. package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
  228. package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
  229. package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
  230. package/types/tectra-ng-ui-field.d.ts +139 -0
  231. package/types/tectra-ng-ui-field.d.ts.map +1 -0
  232. package/types/tectra-ng-ui-fieldset.d.ts +74 -0
  233. package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
  234. package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
  235. package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
  236. package/types/tectra-ng-ui-icon-field.d.ts +77 -0
  237. package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
  238. package/types/tectra-ng-ui-input-group.d.ts +18 -0
  239. package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
  240. package/types/tectra-ng-ui-input-mask.d.ts +91 -0
  241. package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
  242. package/types/tectra-ng-ui-input-number.d.ts +326 -0
  243. package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
  244. package/types/tectra-ng-ui-input-otp.d.ts +173 -0
  245. package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
  246. package/types/tectra-ng-ui-input.d.ts +113 -0
  247. package/types/tectra-ng-ui-input.d.ts.map +1 -0
  248. package/types/tectra-ng-ui-key-filter.d.ts +43 -0
  249. package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
  250. package/types/tectra-ng-ui-knob.d.ts +207 -0
  251. package/types/tectra-ng-ui-knob.d.ts.map +1 -0
  252. package/types/tectra-ng-ui-label.d.ts +53 -0
  253. package/types/tectra-ng-ui-label.d.ts.map +1 -0
  254. package/types/tectra-ng-ui-link.d.ts +223 -0
  255. package/types/tectra-ng-ui-link.d.ts.map +1 -0
  256. package/types/tectra-ng-ui-listbox.d.ts +131 -0
  257. package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
  258. package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
  259. package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
  260. package/types/tectra-ng-ui-menu.d.ts +512 -0
  261. package/types/tectra-ng-ui-menu.d.ts.map +1 -0
  262. package/types/tectra-ng-ui-message.d.ts +390 -0
  263. package/types/tectra-ng-ui-message.d.ts.map +1 -0
  264. package/types/tectra-ng-ui-multiselect.d.ts +216 -0
  265. package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
  266. package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
  267. package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
  268. package/types/tectra-ng-ui-paginator.d.ts +293 -0
  269. package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
  270. package/types/tectra-ng-ui-panel.d.ts +133 -0
  271. package/types/tectra-ng-ui-panel.d.ts.map +1 -0
  272. package/types/tectra-ng-ui-password-generator.d.ts +80 -0
  273. package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
  274. package/types/tectra-ng-ui-password.d.ts +271 -0
  275. package/types/tectra-ng-ui-password.d.ts.map +1 -0
  276. package/types/tectra-ng-ui-pill.d.ts +167 -0
  277. package/types/tectra-ng-ui-pill.d.ts.map +1 -0
  278. package/types/tectra-ng-ui-popover.d.ts +244 -0
  279. package/types/tectra-ng-ui-popover.d.ts.map +1 -0
  280. package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
  281. package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
  282. package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
  283. package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
  284. package/types/tectra-ng-ui-radio-button.d.ts +380 -0
  285. package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
  286. package/types/tectra-ng-ui-rating.d.ts +195 -0
  287. package/types/tectra-ng-ui-rating.d.ts.map +1 -0
  288. package/types/tectra-ng-ui-select.d.ts +761 -0
  289. package/types/tectra-ng-ui-select.d.ts.map +1 -0
  290. package/types/tectra-ng-ui-skeleton.d.ts +182 -0
  291. package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
  292. package/types/tectra-ng-ui-slider.d.ts +220 -0
  293. package/types/tectra-ng-ui-slider.d.ts.map +1 -0
  294. package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
  295. package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
  296. package/types/tectra-ng-ui-split-button.d.ts +139 -0
  297. package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
  298. package/types/tectra-ng-ui-status-icon.d.ts +105 -0
  299. package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
  300. package/types/tectra-ng-ui-table.d.ts +1301 -0
  301. package/types/tectra-ng-ui-table.d.ts.map +1 -0
  302. package/types/tectra-ng-ui-tag.d.ts +157 -0
  303. package/types/tectra-ng-ui-tag.d.ts.map +1 -0
  304. package/types/tectra-ng-ui-textarea.d.ts +146 -0
  305. package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
  306. package/types/tectra-ng-ui-toast.d.ts +268 -0
  307. package/types/tectra-ng-ui-toast.d.ts.map +1 -0
  308. package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
  309. package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
  310. package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
  311. package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
  312. package/types/tectra-ng-ui-tooltip.d.ts +275 -0
  313. package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
  314. package/types/tectra-ng-ui-tree-select.d.ts +339 -0
  315. package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
  316. package/types/tectra-ng-ui.d.ts +2 -0
  317. package/types/tectra-ng-ui.d.ts.map +1 -0
@@ -0,0 +1,2478 @@
1
+ import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
2
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, Injector, TemplateRef, afterRenderEffect, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
5
+ import { TxIcon } from "@tectra-ng/icons";
6
+ import { TxSkeleton } from "@tectra-ng/ui/skeleton";
7
+ import { TxTypeahead, nextListIndex, uniqueId } from "@tectra-ng/core/a11y";
8
+ import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
9
+ import { injectTranslations } from "@tectra-ng/core/i18n";
10
+ import { CdkConnectedOverlay, CdkOverlayOrigin } from "@angular/cdk/overlay";
11
+ import { TxOverlayAnchor, TxOverlayInsets, TxOverlayRoom, placementFromPosition, txAnimateEnter, txAnimateLeave, txPositions, txScrollStrategy, watchOrigin } from "@tectra-ng/core/overlay";
12
+ import { optionalBoolean } from "@tectra-ng/core/utils";
13
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
14
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
15
+ import { toStyleObject } from "@tectra-ng/themes";
16
+ const DEFAULT_LIST_HEIGHT = 200;
17
+ var TxOptionList = class TxOptionList {
18
+ rows = input.required(...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
19
+ listboxId = input.required(...ngDevMode ? [{ debugName: "listboxId" }] : /* istanbul ignore next */ []);
20
+ activeIndex = input(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
21
+ multiple = input(false, {
22
+ ...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
23
+ transform: booleanAttribute
24
+ });
25
+ checkbox = input(false, {
26
+ ...ngDevMode ? { debugName: "checkbox" } : /* istanbul ignore next */ {},
27
+ transform: booleanAttribute
28
+ });
29
+ checkmark = input(false, {
30
+ ...ngDevMode ? { debugName: "checkmark" } : /* istanbul ignore next */ {},
31
+ transform: booleanAttribute
32
+ });
33
+ virtualScroll = input(false, {
34
+ ...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
35
+ transform: booleanAttribute
36
+ });
37
+ itemSize = input(36, ...ngDevMode ? [{ debugName: "itemSize" }] : /* istanbul ignore next */ []);
38
+ scrollHeight = input(void 0, ...ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
39
+ loading = input(false, {
40
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
41
+ transform: booleanAttribute
42
+ });
43
+ query = input("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
44
+ emptyText = input("", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
45
+ loadingText = input("", ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
46
+ optionTemplate = input(void 0, ...ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []);
47
+ groupTemplate = input(void 0, ...ngDevMode ? [{ debugName: "groupTemplate" }] : /* istanbul ignore next */ []);
48
+ emptyTemplate = input(void 0, ...ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []);
49
+ emptyFilterTemplate = input(void 0, ...ngDevMode ? [{ debugName: "emptyFilterTemplate" }] : /* istanbul ignore next */ []);
50
+ passThrough = input({}, ...ngDevMode ? [{ debugName: "passThrough" }] : /* istanbul ignore next */ []);
51
+ unstyled = input(false, {
52
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
53
+ transform: booleanAttribute
54
+ });
55
+ focusable = input(false, {
56
+ ...ngDevMode ? { debugName: "focusable" } : /* istanbul ignore next */ {},
57
+ transform: booleanAttribute
58
+ });
59
+ disabled = input(false, {
60
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
61
+ transform: booleanAttribute
62
+ });
63
+ ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
64
+ ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
65
+ ariaDescribedBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []);
66
+ ariaInvalid = input(false, {
67
+ ...ngDevMode ? { debugName: "ariaInvalid" } : /* istanbul ignore next */ {},
68
+ transform: booleanAttribute
69
+ });
70
+ optionClick = output();
71
+ optionHover = output();
72
+ rangeChange = output();
73
+ listKeydown = output();
74
+ listFocus = output();
75
+ listBlur = output();
76
+ document = inject(DOCUMENT);
77
+ viewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
78
+ list = viewChild("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
79
+ sections = computed(() => {
80
+ const sections = [];
81
+ this.rows().forEach((row, index) => {
82
+ if (row.type === "group") sections.push({
83
+ group: row,
84
+ rows: []
85
+ });
86
+ else {
87
+ if (!sections.length) sections.push({
88
+ group: null,
89
+ rows: []
90
+ });
91
+ sections[sections.length - 1].rows.push({
92
+ row,
93
+ index
94
+ });
95
+ }
96
+ });
97
+ return sections;
98
+ }, ...ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []);
99
+ optionCount = computed(() => this.rows().filter((row) => row.type !== "group").length, ...ngDevMode ? [{ debugName: "optionCount" }] : /* istanbul ignore next */ []);
100
+ activeId = computed(() => {
101
+ const row = this.rows()[this.activeIndex()];
102
+ return row?.type === "option" ? row.id : null;
103
+ }, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
104
+ virtualHeight = computed(() => {
105
+ const limit = parseFloat(this.scrollHeight() ?? "") || DEFAULT_LIST_HEIGHT;
106
+ return Math.min(this.rows().length * this.itemSize(), limit);
107
+ }, ...ngDevMode ? [{ debugName: "virtualHeight" }] : /* istanbul ignore next */ []);
108
+ trackRow = (index, row) => row.id;
109
+ constructor() {
110
+ effect((onCleanup) => {
111
+ const viewport = this.viewport();
112
+ if (!viewport) return;
113
+ const subscription = viewport.renderedRangeStream.subscribe((range) => this.rangeChange.emit({
114
+ start: range.start,
115
+ end: range.end
116
+ }));
117
+ onCleanup(() => subscription.unsubscribe());
118
+ });
119
+ afterRenderEffect(() => {
120
+ this.virtualHeight();
121
+ this.viewport()?.checkViewportSize();
122
+ });
123
+ }
124
+ focus() {
125
+ (this.viewport()?.elementRef.nativeElement ?? this.list()?.nativeElement)?.focus();
126
+ }
127
+ scrollToTop() {
128
+ this.viewport()?.scrollToOffset(0);
129
+ }
130
+ scrollToIndex(index) {
131
+ const viewport = this.viewport();
132
+ if (viewport) {
133
+ const size = this.itemSize();
134
+ const top = index * size;
135
+ const offset = viewport.measureScrollOffset("top");
136
+ const height = viewport.getViewportSize();
137
+ if (top < offset) viewport.scrollToOffset(top);
138
+ else if (top + size > offset + height) viewport.scrollToOffset(top + size - height);
139
+ return;
140
+ }
141
+ const row = this.rows()[index];
142
+ const id = row?.type === "option" ? row.id : null;
143
+ queueMicrotask(() => id ? this.document.getElementById(id)?.scrollIntoView?.({ block: "nearest" }) : void 0);
144
+ }
145
+ static ɵfac = i0.ɵɵngDeclareFactory({
146
+ minVersion: "12.0.0",
147
+ version: "22.2.3",
148
+ ngImport: i0,
149
+ type: TxOptionList,
150
+ deps: [],
151
+ target: i0.ɵɵFactoryTarget.Component
152
+ });
153
+ static ɵcmp = i0.ɵɵngDeclareComponent({
154
+ minVersion: "17.0.0",
155
+ version: "22.2.3",
156
+ type: TxOptionList,
157
+ isStandalone: true,
158
+ selector: "tx-option-list",
159
+ inputs: {
160
+ rows: {
161
+ classPropertyName: "rows",
162
+ publicName: "rows",
163
+ isSignal: true,
164
+ isRequired: true,
165
+ transformFunction: null
166
+ },
167
+ listboxId: {
168
+ classPropertyName: "listboxId",
169
+ publicName: "listboxId",
170
+ isSignal: true,
171
+ isRequired: true,
172
+ transformFunction: null
173
+ },
174
+ activeIndex: {
175
+ classPropertyName: "activeIndex",
176
+ publicName: "activeIndex",
177
+ isSignal: true,
178
+ isRequired: false,
179
+ transformFunction: null
180
+ },
181
+ multiple: {
182
+ classPropertyName: "multiple",
183
+ publicName: "multiple",
184
+ isSignal: true,
185
+ isRequired: false,
186
+ transformFunction: null
187
+ },
188
+ checkbox: {
189
+ classPropertyName: "checkbox",
190
+ publicName: "checkbox",
191
+ isSignal: true,
192
+ isRequired: false,
193
+ transformFunction: null
194
+ },
195
+ checkmark: {
196
+ classPropertyName: "checkmark",
197
+ publicName: "checkmark",
198
+ isSignal: true,
199
+ isRequired: false,
200
+ transformFunction: null
201
+ },
202
+ virtualScroll: {
203
+ classPropertyName: "virtualScroll",
204
+ publicName: "virtualScroll",
205
+ isSignal: true,
206
+ isRequired: false,
207
+ transformFunction: null
208
+ },
209
+ itemSize: {
210
+ classPropertyName: "itemSize",
211
+ publicName: "itemSize",
212
+ isSignal: true,
213
+ isRequired: false,
214
+ transformFunction: null
215
+ },
216
+ scrollHeight: {
217
+ classPropertyName: "scrollHeight",
218
+ publicName: "scrollHeight",
219
+ isSignal: true,
220
+ isRequired: false,
221
+ transformFunction: null
222
+ },
223
+ loading: {
224
+ classPropertyName: "loading",
225
+ publicName: "loading",
226
+ isSignal: true,
227
+ isRequired: false,
228
+ transformFunction: null
229
+ },
230
+ query: {
231
+ classPropertyName: "query",
232
+ publicName: "query",
233
+ isSignal: true,
234
+ isRequired: false,
235
+ transformFunction: null
236
+ },
237
+ emptyText: {
238
+ classPropertyName: "emptyText",
239
+ publicName: "emptyText",
240
+ isSignal: true,
241
+ isRequired: false,
242
+ transformFunction: null
243
+ },
244
+ loadingText: {
245
+ classPropertyName: "loadingText",
246
+ publicName: "loadingText",
247
+ isSignal: true,
248
+ isRequired: false,
249
+ transformFunction: null
250
+ },
251
+ optionTemplate: {
252
+ classPropertyName: "optionTemplate",
253
+ publicName: "optionTemplate",
254
+ isSignal: true,
255
+ isRequired: false,
256
+ transformFunction: null
257
+ },
258
+ groupTemplate: {
259
+ classPropertyName: "groupTemplate",
260
+ publicName: "groupTemplate",
261
+ isSignal: true,
262
+ isRequired: false,
263
+ transformFunction: null
264
+ },
265
+ emptyTemplate: {
266
+ classPropertyName: "emptyTemplate",
267
+ publicName: "emptyTemplate",
268
+ isSignal: true,
269
+ isRequired: false,
270
+ transformFunction: null
271
+ },
272
+ emptyFilterTemplate: {
273
+ classPropertyName: "emptyFilterTemplate",
274
+ publicName: "emptyFilterTemplate",
275
+ isSignal: true,
276
+ isRequired: false,
277
+ transformFunction: null
278
+ },
279
+ passThrough: {
280
+ classPropertyName: "passThrough",
281
+ publicName: "passThrough",
282
+ isSignal: true,
283
+ isRequired: false,
284
+ transformFunction: null
285
+ },
286
+ unstyled: {
287
+ classPropertyName: "unstyled",
288
+ publicName: "unstyled",
289
+ isSignal: true,
290
+ isRequired: false,
291
+ transformFunction: null
292
+ },
293
+ focusable: {
294
+ classPropertyName: "focusable",
295
+ publicName: "focusable",
296
+ isSignal: true,
297
+ isRequired: false,
298
+ transformFunction: null
299
+ },
300
+ disabled: {
301
+ classPropertyName: "disabled",
302
+ publicName: "disabled",
303
+ isSignal: true,
304
+ isRequired: false,
305
+ transformFunction: null
306
+ },
307
+ ariaLabel: {
308
+ classPropertyName: "ariaLabel",
309
+ publicName: "ariaLabel",
310
+ isSignal: true,
311
+ isRequired: false,
312
+ transformFunction: null
313
+ },
314
+ ariaLabelledBy: {
315
+ classPropertyName: "ariaLabelledBy",
316
+ publicName: "ariaLabelledBy",
317
+ isSignal: true,
318
+ isRequired: false,
319
+ transformFunction: null
320
+ },
321
+ ariaDescribedBy: {
322
+ classPropertyName: "ariaDescribedBy",
323
+ publicName: "ariaDescribedBy",
324
+ isSignal: true,
325
+ isRequired: false,
326
+ transformFunction: null
327
+ },
328
+ ariaInvalid: {
329
+ classPropertyName: "ariaInvalid",
330
+ publicName: "ariaInvalid",
331
+ isSignal: true,
332
+ isRequired: false,
333
+ transformFunction: null
334
+ }
335
+ },
336
+ outputs: {
337
+ optionClick: "optionClick",
338
+ optionHover: "optionHover",
339
+ rangeChange: "rangeChange",
340
+ listKeydown: "listKeydown",
341
+ listFocus: "listFocus",
342
+ listBlur: "listBlur"
343
+ },
344
+ host: {
345
+ properties: { "attr.data-styled": "unstyled() ? null : true" },
346
+ classAttribute: "tx-option-list"
347
+ },
348
+ viewQueries: [{
349
+ propertyName: "viewport",
350
+ first: true,
351
+ predicate: CdkVirtualScrollViewport,
352
+ descendants: true,
353
+ isSignal: true
354
+ }, {
355
+ propertyName: "list",
356
+ first: true,
357
+ predicate: ["list"],
358
+ descendants: true,
359
+ isSignal: true
360
+ }],
361
+ ngImport: i0,
362
+ template: "@if (rows().length) {\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"tx-select__list tx-select__list--virtual\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [itemSize]=\"itemSize()\"\n [style.height.px]=\"virtualHeight()\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-activedescendant]=\"focusable() ? activeId() : null\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"ariaDescribedBy() ?? null\"\n [attr.aria-invalid]=\"ariaInvalid() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n <ng-container *cdkVirtualFor=\"let row of rows(); let index = index; trackBy: trackRow\">\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: row, index: index, virtual: true }\" />\n </ng-container>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n #list\n class=\"tx-select__list\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [style.max-height]=\"scrollHeight() ?? null\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-activedescendant]=\"focusable() ? activeId() : null\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"ariaDescribedBy() ?? null\"\n [attr.aria-invalid]=\"ariaInvalid() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n @for (section of sections(); track section.group?.id ?? 'options') {\n @if (section.group; as group) {\n <div role=\"group\" class=\"tx-select__group-block\" [attr.aria-labelledby]=\"group.id\">\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: group, index: -1, virtual: false }\" />\n @for (entry of section.rows; track entry.row.id) {\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: entry.row, index: entry.index, virtual: false }\" />\n }\n </div>\n } @else {\n @for (entry of section.rows; track entry.row.id) {\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: entry.row, index: entry.index, virtual: false }\" />\n }\n }\n }\n </div>\n }\n} @else {\n <div\n #list\n class=\"tx-select__list tx-select__list--empty\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n <div class=\"tx-select__empty\" role=\"presentation\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (loading()) {\n {{ loadingText() }}\n } @else if (query().trim() && emptyFilterTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: query().trim() }\" />\n } @else if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ emptyText() }}\n }\n </div>\n </div>\n}\n\n<ng-template #rowTemplate let-row let-index=\"index\" let-virtual=\"virtual\">\n @switch (row.type) {\n @case ('group') {\n <div\n role=\"presentation\"\n class=\"tx-select__group\"\n [id]=\"row.id\"\n [style.height.px]=\"virtual ? itemSize() : null\"\n [class]=\"passThrough().group?.class\"\n [style]=\"passThrough().group?.style\"\n >\n @if (groupTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: row.group }\" />\n } @else {\n {{ row.label }}\n }\n </div>\n }\n @case ('loader') {\n <div role=\"presentation\" class=\"tx-select__option tx-select__option--loader\" [style.height.px]=\"virtual ? itemSize() : null\">\n <tx-skeleton [width]=\"'60%'\" />\n </div>\n }\n @default {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- options use aria-activedescendant: focus and keys stay on the field or the list -->\n <div\n role=\"option\"\n class=\"tx-select__option\"\n [id]=\"row.id\"\n [style.height.px]=\"virtual ? itemSize() : null\"\n [class.tx-select__option--active]=\"index === activeIndex()\"\n [class.tx-select__option--selected]=\"row.selected\"\n [class.tx-select__option--disabled]=\"row.disabled\"\n [class.tx-select__option--multiple]=\"checkbox()\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [attr.aria-setsize]=\"virtual ? optionCount() : null\"\n [attr.aria-posinset]=\"virtual ? row.index + 1 : null\"\n [class]=\"passThrough().option?.class\"\n [style]=\"passThrough().option?.style\"\n (mouseenter)=\"row.disabled || optionHover.emit(index)\"\n (click)=\"row.disabled || optionClick.emit(row)\"\n >\n @if (checkbox()) {\n <span class=\"tx-select__checkbox\" aria-hidden=\"true\" [class]=\"passThrough().check?.class\" [style]=\"passThrough().check?.style\">\n @if (row.selected) {\n <tx-icon [name]=\"'check'\" />\n }\n </span>\n }\n <span class=\"tx-select__option-label\">\n @if (optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: row.option, selected: row.selected, disabled: row.disabled, index: row.index }\"\n />\n } @else {\n {{ row.label }}\n }\n </span>\n @if (!checkbox() && checkmark() && row.selected) {\n <tx-icon class=\"tx-select__check\" [name]=\"'check'\" [class]=\"passThrough().check?.class\" [style]=\"passThrough().check?.style\" />\n }\n </div>\n }\n }\n</ng-template>\n",
363
+ styles: [":host{display:block}.tx-select__list{overflow-y:auto}.tx-select__option{display:flex;align-items:center;cursor:pointer}.tx-select__option-label{flex:1 1 auto;min-width:0}.tx-select__option--disabled,.tx-select__option--loader{cursor:default}:host([data-styled]) .tx-select__list{display:flex;flex-direction:column;gap:var(--tx-select-list-gap);max-height:var(--tx-select-list-max-height);padding:var(--tx-select-list-padding);outline:none}:host([data-styled]) .tx-select__list--virtual{display:block;max-height:none;padding:0}:host([data-styled]) .tx-select__list--virtual .tx-select__option,:host([data-styled]) .tx-select__list--virtual .tx-select__group{box-sizing:border-box;margin-inline:var(--tx-select-list-padding)}:host([data-styled]) .tx-select__group-block{display:flex;flex-direction:column;gap:var(--tx-select-list-gap)}:host([data-styled]) .tx-select__group{display:flex;align-items:flex-end;padding:var(--tx-select-option-group-padding);color:var(--tx-select-option-group-color);font-size:var(--tx-select-option-group-font-size);font-weight:var(--tx-select-option-group-font-weight)}:host([data-styled]) .tx-select__option{gap:var(--tx-select-option-gap);transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),color var(--tx-motion-duration) var(--tx-motion-easing);padding:var(--tx-select-option-padding);border-radius:var(--tx-select-option-border-radius);color:var(--tx-select-option-color)}:host([data-styled]) .tx-select__option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]) .tx-select__option--active{background:var(--tx-select-option-focus-background)}:host([data-styled]) .tx-select__option--selected:not(.tx-select__option--multiple){background:var(--tx-select-option-selected-background);color:var(--tx-select-option-selected-color);font-weight:var(--tx-select-option-selected-font-weight)}:host([data-styled]) .tx-select__option--selected:not(.tx-select__option--multiple).tx-select__option--active{background:var(--tx-select-option-selected-focus-background);color:var(--tx-select-option-selected-focus-color)}:host([data-styled]) .tx-select__option--disabled{color:var(--tx-select-option-disabled-color)}:host([data-styled]) .tx-select__check{flex:none;color:var(--tx-select-option-check-color)}:host([data-styled]) .tx-select__checkbox{transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),border-color var(--tx-motion-duration) var(--tx-motion-easing);display:inline-grid;flex:none;place-items:center;box-sizing:border-box;width:var(--tx-select-checkbox-size);height:var(--tx-select-checkbox-size);border:1px solid var(--tx-select-checkbox-border-color);border-radius:var(--tx-select-checkbox-border-radius);background:var(--tx-select-checkbox-background);box-shadow:var(--tx-select-checkbox-shadow);color:var(--tx-select-checkbox-checked-color);font-size:var(--tx-select-checkbox-icon-size)}:host([data-styled]) .tx-select__option:not(.tx-select__option--disabled):hover .tx-select__checkbox{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled]) .tx-select__option--selected .tx-select__checkbox{border-color:var(--tx-select-checkbox-checked-background);background:var(--tx-select-checkbox-checked-background)}:host([data-styled]) .tx-select__option--disabled .tx-select__checkbox{opacity:.6}:host([data-styled]) .tx-select__empty{padding:var(--tx-select-empty-padding);color:var(--tx-select-empty-color)}\n"],
364
+ dependencies: [
365
+ {
366
+ kind: "component",
367
+ type: CdkVirtualScrollViewport,
368
+ selector: "cdk-virtual-scroll-viewport",
369
+ inputs: ["orientation", "appendOnly"],
370
+ outputs: ["scrolledIndexChange"]
371
+ },
372
+ {
373
+ kind: "directive",
374
+ type: CdkFixedSizeVirtualScroll,
375
+ selector: "cdk-virtual-scroll-viewport[itemSize]",
376
+ inputs: [
377
+ "itemSize",
378
+ "minBufferPx",
379
+ "maxBufferPx"
380
+ ]
381
+ },
382
+ {
383
+ kind: "directive",
384
+ type: CdkVirtualForOf,
385
+ selector: "[cdkVirtualFor][cdkVirtualForOf]",
386
+ inputs: [
387
+ "cdkVirtualForOf",
388
+ "cdkVirtualForTrackBy",
389
+ "cdkVirtualForTemplate",
390
+ "cdkVirtualForTemplateCacheSize"
391
+ ]
392
+ },
393
+ {
394
+ kind: "directive",
395
+ type: NgTemplateOutlet,
396
+ selector: "[ngTemplateOutlet]",
397
+ inputs: [
398
+ "ngTemplateOutletContext",
399
+ "ngTemplateOutlet",
400
+ "ngTemplateOutletInjector"
401
+ ]
402
+ },
403
+ {
404
+ kind: "component",
405
+ type: TxIcon,
406
+ selector: "tx-icon",
407
+ inputs: ["name"]
408
+ },
409
+ {
410
+ kind: "component",
411
+ type: TxSkeleton,
412
+ selector: "tx-skeleton",
413
+ inputs: [
414
+ "shape",
415
+ "size",
416
+ "width",
417
+ "height",
418
+ "borderRadius",
419
+ "lines",
420
+ "animation",
421
+ "dt",
422
+ "pt",
423
+ "ptOptions",
424
+ "unstyled"
425
+ ]
426
+ }
427
+ ],
428
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
429
+ });
430
+ };
431
+ i0.ɵɵngDeclareClassMetadata({
432
+ minVersion: "12.0.0",
433
+ version: "22.2.3",
434
+ ngImport: i0,
435
+ type: TxOptionList,
436
+ decorators: [{
437
+ type: Component,
438
+ args: [{
439
+ selector: "tx-option-list",
440
+ imports: [
441
+ CdkVirtualScrollViewport,
442
+ CdkFixedSizeVirtualScroll,
443
+ CdkVirtualForOf,
444
+ NgTemplateOutlet,
445
+ TxIcon,
446
+ TxSkeleton
447
+ ],
448
+ changeDetection: ChangeDetectionStrategy.OnPush,
449
+ host: {
450
+ class: "tx-option-list",
451
+ "[attr.data-styled]": "unstyled() ? null : true"
452
+ },
453
+ template: "@if (rows().length) {\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"tx-select__list tx-select__list--virtual\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [itemSize]=\"itemSize()\"\n [style.height.px]=\"virtualHeight()\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-activedescendant]=\"focusable() ? activeId() : null\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"ariaDescribedBy() ?? null\"\n [attr.aria-invalid]=\"ariaInvalid() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n <ng-container *cdkVirtualFor=\"let row of rows(); let index = index; trackBy: trackRow\">\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: row, index: index, virtual: true }\" />\n </ng-container>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n #list\n class=\"tx-select__list\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [style.max-height]=\"scrollHeight() ?? null\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-activedescendant]=\"focusable() ? activeId() : null\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"ariaDescribedBy() ?? null\"\n [attr.aria-invalid]=\"ariaInvalid() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n @for (section of sections(); track section.group?.id ?? 'options') {\n @if (section.group; as group) {\n <div role=\"group\" class=\"tx-select__group-block\" [attr.aria-labelledby]=\"group.id\">\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: group, index: -1, virtual: false }\" />\n @for (entry of section.rows; track entry.row.id) {\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: entry.row, index: entry.index, virtual: false }\" />\n }\n </div>\n } @else {\n @for (entry of section.rows; track entry.row.id) {\n <ng-container [ngTemplateOutlet]=\"rowTemplate\" [ngTemplateOutletContext]=\"{ $implicit: entry.row, index: entry.index, virtual: false }\" />\n }\n }\n }\n </div>\n }\n} @else {\n <div\n #list\n class=\"tx-select__list tx-select__list--empty\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.tabindex]=\"focusable() ? (disabled() ? -1 : 0) : null\"\n [attr.aria-busy]=\"loading() || null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (keydown)=\"listKeydown.emit($event)\"\n (focus)=\"listFocus.emit($event)\"\n (blur)=\"listBlur.emit($event)\"\n >\n <div class=\"tx-select__empty\" role=\"presentation\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (loading()) {\n {{ loadingText() }}\n } @else if (query().trim() && emptyFilterTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: query().trim() }\" />\n } @else if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ emptyText() }}\n }\n </div>\n </div>\n}\n\n<ng-template #rowTemplate let-row let-index=\"index\" let-virtual=\"virtual\">\n @switch (row.type) {\n @case ('group') {\n <div\n role=\"presentation\"\n class=\"tx-select__group\"\n [id]=\"row.id\"\n [style.height.px]=\"virtual ? itemSize() : null\"\n [class]=\"passThrough().group?.class\"\n [style]=\"passThrough().group?.style\"\n >\n @if (groupTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: row.group }\" />\n } @else {\n {{ row.label }}\n }\n </div>\n }\n @case ('loader') {\n <div role=\"presentation\" class=\"tx-select__option tx-select__option--loader\" [style.height.px]=\"virtual ? itemSize() : null\">\n <tx-skeleton [width]=\"'60%'\" />\n </div>\n }\n @default {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- options use aria-activedescendant: focus and keys stay on the field or the list -->\n <div\n role=\"option\"\n class=\"tx-select__option\"\n [id]=\"row.id\"\n [style.height.px]=\"virtual ? itemSize() : null\"\n [class.tx-select__option--active]=\"index === activeIndex()\"\n [class.tx-select__option--selected]=\"row.selected\"\n [class.tx-select__option--disabled]=\"row.disabled\"\n [class.tx-select__option--multiple]=\"checkbox()\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [attr.aria-setsize]=\"virtual ? optionCount() : null\"\n [attr.aria-posinset]=\"virtual ? row.index + 1 : null\"\n [class]=\"passThrough().option?.class\"\n [style]=\"passThrough().option?.style\"\n (mouseenter)=\"row.disabled || optionHover.emit(index)\"\n (click)=\"row.disabled || optionClick.emit(row)\"\n >\n @if (checkbox()) {\n <span class=\"tx-select__checkbox\" aria-hidden=\"true\" [class]=\"passThrough().check?.class\" [style]=\"passThrough().check?.style\">\n @if (row.selected) {\n <tx-icon [name]=\"'check'\" />\n }\n </span>\n }\n <span class=\"tx-select__option-label\">\n @if (optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: row.option, selected: row.selected, disabled: row.disabled, index: row.index }\"\n />\n } @else {\n {{ row.label }}\n }\n </span>\n @if (!checkbox() && checkmark() && row.selected) {\n <tx-icon class=\"tx-select__check\" [name]=\"'check'\" [class]=\"passThrough().check?.class\" [style]=\"passThrough().check?.style\" />\n }\n </div>\n }\n }\n</ng-template>\n",
454
+ styles: [":host{display:block}.tx-select__list{overflow-y:auto}.tx-select__option{display:flex;align-items:center;cursor:pointer}.tx-select__option-label{flex:1 1 auto;min-width:0}.tx-select__option--disabled,.tx-select__option--loader{cursor:default}:host([data-styled]) .tx-select__list{display:flex;flex-direction:column;gap:var(--tx-select-list-gap);max-height:var(--tx-select-list-max-height);padding:var(--tx-select-list-padding);outline:none}:host([data-styled]) .tx-select__list--virtual{display:block;max-height:none;padding:0}:host([data-styled]) .tx-select__list--virtual .tx-select__option,:host([data-styled]) .tx-select__list--virtual .tx-select__group{box-sizing:border-box;margin-inline:var(--tx-select-list-padding)}:host([data-styled]) .tx-select__group-block{display:flex;flex-direction:column;gap:var(--tx-select-list-gap)}:host([data-styled]) .tx-select__group{display:flex;align-items:flex-end;padding:var(--tx-select-option-group-padding);color:var(--tx-select-option-group-color);font-size:var(--tx-select-option-group-font-size);font-weight:var(--tx-select-option-group-font-weight)}:host([data-styled]) .tx-select__option{gap:var(--tx-select-option-gap);transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),color var(--tx-motion-duration) var(--tx-motion-easing);padding:var(--tx-select-option-padding);border-radius:var(--tx-select-option-border-radius);color:var(--tx-select-option-color)}:host([data-styled]) .tx-select__option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]) .tx-select__option--active{background:var(--tx-select-option-focus-background)}:host([data-styled]) .tx-select__option--selected:not(.tx-select__option--multiple){background:var(--tx-select-option-selected-background);color:var(--tx-select-option-selected-color);font-weight:var(--tx-select-option-selected-font-weight)}:host([data-styled]) .tx-select__option--selected:not(.tx-select__option--multiple).tx-select__option--active{background:var(--tx-select-option-selected-focus-background);color:var(--tx-select-option-selected-focus-color)}:host([data-styled]) .tx-select__option--disabled{color:var(--tx-select-option-disabled-color)}:host([data-styled]) .tx-select__check{flex:none;color:var(--tx-select-option-check-color)}:host([data-styled]) .tx-select__checkbox{transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),border-color var(--tx-motion-duration) var(--tx-motion-easing);display:inline-grid;flex:none;place-items:center;box-sizing:border-box;width:var(--tx-select-checkbox-size);height:var(--tx-select-checkbox-size);border:1px solid var(--tx-select-checkbox-border-color);border-radius:var(--tx-select-checkbox-border-radius);background:var(--tx-select-checkbox-background);box-shadow:var(--tx-select-checkbox-shadow);color:var(--tx-select-checkbox-checked-color);font-size:var(--tx-select-checkbox-icon-size)}:host([data-styled]) .tx-select__option:not(.tx-select__option--disabled):hover .tx-select__checkbox{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled]) .tx-select__option--selected .tx-select__checkbox{border-color:var(--tx-select-checkbox-checked-background);background:var(--tx-select-checkbox-checked-background)}:host([data-styled]) .tx-select__option--disabled .tx-select__checkbox{opacity:.6}:host([data-styled]) .tx-select__empty{padding:var(--tx-select-empty-padding);color:var(--tx-select-empty-color)}\n"]
455
+ }]
456
+ }],
457
+ ctorParameters: () => [],
458
+ propDecorators: {
459
+ rows: [{
460
+ type: i0.Input,
461
+ args: [{
462
+ isSignal: true,
463
+ alias: "rows",
464
+ required: true
465
+ }]
466
+ }],
467
+ listboxId: [{
468
+ type: i0.Input,
469
+ args: [{
470
+ isSignal: true,
471
+ alias: "listboxId",
472
+ required: true
473
+ }]
474
+ }],
475
+ activeIndex: [{
476
+ type: i0.Input,
477
+ args: [{
478
+ isSignal: true,
479
+ alias: "activeIndex",
480
+ required: false
481
+ }]
482
+ }],
483
+ multiple: [{
484
+ type: i0.Input,
485
+ args: [{
486
+ isSignal: true,
487
+ alias: "multiple",
488
+ required: false
489
+ }]
490
+ }],
491
+ checkbox: [{
492
+ type: i0.Input,
493
+ args: [{
494
+ isSignal: true,
495
+ alias: "checkbox",
496
+ required: false
497
+ }]
498
+ }],
499
+ checkmark: [{
500
+ type: i0.Input,
501
+ args: [{
502
+ isSignal: true,
503
+ alias: "checkmark",
504
+ required: false
505
+ }]
506
+ }],
507
+ virtualScroll: [{
508
+ type: i0.Input,
509
+ args: [{
510
+ isSignal: true,
511
+ alias: "virtualScroll",
512
+ required: false
513
+ }]
514
+ }],
515
+ itemSize: [{
516
+ type: i0.Input,
517
+ args: [{
518
+ isSignal: true,
519
+ alias: "itemSize",
520
+ required: false
521
+ }]
522
+ }],
523
+ scrollHeight: [{
524
+ type: i0.Input,
525
+ args: [{
526
+ isSignal: true,
527
+ alias: "scrollHeight",
528
+ required: false
529
+ }]
530
+ }],
531
+ loading: [{
532
+ type: i0.Input,
533
+ args: [{
534
+ isSignal: true,
535
+ alias: "loading",
536
+ required: false
537
+ }]
538
+ }],
539
+ query: [{
540
+ type: i0.Input,
541
+ args: [{
542
+ isSignal: true,
543
+ alias: "query",
544
+ required: false
545
+ }]
546
+ }],
547
+ emptyText: [{
548
+ type: i0.Input,
549
+ args: [{
550
+ isSignal: true,
551
+ alias: "emptyText",
552
+ required: false
553
+ }]
554
+ }],
555
+ loadingText: [{
556
+ type: i0.Input,
557
+ args: [{
558
+ isSignal: true,
559
+ alias: "loadingText",
560
+ required: false
561
+ }]
562
+ }],
563
+ optionTemplate: [{
564
+ type: i0.Input,
565
+ args: [{
566
+ isSignal: true,
567
+ alias: "optionTemplate",
568
+ required: false
569
+ }]
570
+ }],
571
+ groupTemplate: [{
572
+ type: i0.Input,
573
+ args: [{
574
+ isSignal: true,
575
+ alias: "groupTemplate",
576
+ required: false
577
+ }]
578
+ }],
579
+ emptyTemplate: [{
580
+ type: i0.Input,
581
+ args: [{
582
+ isSignal: true,
583
+ alias: "emptyTemplate",
584
+ required: false
585
+ }]
586
+ }],
587
+ emptyFilterTemplate: [{
588
+ type: i0.Input,
589
+ args: [{
590
+ isSignal: true,
591
+ alias: "emptyFilterTemplate",
592
+ required: false
593
+ }]
594
+ }],
595
+ passThrough: [{
596
+ type: i0.Input,
597
+ args: [{
598
+ isSignal: true,
599
+ alias: "passThrough",
600
+ required: false
601
+ }]
602
+ }],
603
+ unstyled: [{
604
+ type: i0.Input,
605
+ args: [{
606
+ isSignal: true,
607
+ alias: "unstyled",
608
+ required: false
609
+ }]
610
+ }],
611
+ focusable: [{
612
+ type: i0.Input,
613
+ args: [{
614
+ isSignal: true,
615
+ alias: "focusable",
616
+ required: false
617
+ }]
618
+ }],
619
+ disabled: [{
620
+ type: i0.Input,
621
+ args: [{
622
+ isSignal: true,
623
+ alias: "disabled",
624
+ required: false
625
+ }]
626
+ }],
627
+ ariaLabel: [{
628
+ type: i0.Input,
629
+ args: [{
630
+ isSignal: true,
631
+ alias: "ariaLabel",
632
+ required: false
633
+ }]
634
+ }],
635
+ ariaLabelledBy: [{
636
+ type: i0.Input,
637
+ args: [{
638
+ isSignal: true,
639
+ alias: "ariaLabelledBy",
640
+ required: false
641
+ }]
642
+ }],
643
+ ariaDescribedBy: [{
644
+ type: i0.Input,
645
+ args: [{
646
+ isSignal: true,
647
+ alias: "ariaDescribedBy",
648
+ required: false
649
+ }]
650
+ }],
651
+ ariaInvalid: [{
652
+ type: i0.Input,
653
+ args: [{
654
+ isSignal: true,
655
+ alias: "ariaInvalid",
656
+ required: false
657
+ }]
658
+ }],
659
+ optionClick: [{
660
+ type: i0.Output,
661
+ args: ["optionClick"]
662
+ }],
663
+ optionHover: [{
664
+ type: i0.Output,
665
+ args: ["optionHover"]
666
+ }],
667
+ rangeChange: [{
668
+ type: i0.Output,
669
+ args: ["rangeChange"]
670
+ }],
671
+ listKeydown: [{
672
+ type: i0.Output,
673
+ args: ["listKeydown"]
674
+ }],
675
+ listFocus: [{
676
+ type: i0.Output,
677
+ args: ["listFocus"]
678
+ }],
679
+ listBlur: [{
680
+ type: i0.Output,
681
+ args: ["listBlur"]
682
+ }],
683
+ viewport: [{
684
+ type: i0.ViewChild,
685
+ args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }]
686
+ }],
687
+ list: [{
688
+ type: i0.ViewChild,
689
+ args: ["list", { isSignal: true }]
690
+ }]
691
+ }
692
+ });
693
+ var TxSelectOptionTemplate = class TxSelectOptionTemplate {
694
+ templateRef = inject(TemplateRef);
695
+ static ɵfac = i0.ɵɵngDeclareFactory({
696
+ minVersion: "12.0.0",
697
+ version: "22.2.3",
698
+ ngImport: i0,
699
+ type: TxSelectOptionTemplate,
700
+ deps: [],
701
+ target: i0.ɵɵFactoryTarget.Directive
702
+ });
703
+ static ɵdir = i0.ɵɵngDeclareDirective({
704
+ minVersion: "14.0.0",
705
+ version: "22.2.3",
706
+ type: TxSelectOptionTemplate,
707
+ isStandalone: true,
708
+ selector: "ng-template[txSelectOption]",
709
+ ngImport: i0
710
+ });
711
+ };
712
+ i0.ɵɵngDeclareClassMetadata({
713
+ minVersion: "12.0.0",
714
+ version: "22.2.3",
715
+ ngImport: i0,
716
+ type: TxSelectOptionTemplate,
717
+ decorators: [{
718
+ type: Directive,
719
+ args: [{ selector: "ng-template[txSelectOption]" }]
720
+ }]
721
+ });
722
+ var TxSelectValueTemplate = class TxSelectValueTemplate {
723
+ templateRef = inject(TemplateRef);
724
+ static ɵfac = i0.ɵɵngDeclareFactory({
725
+ minVersion: "12.0.0",
726
+ version: "22.2.3",
727
+ ngImport: i0,
728
+ type: TxSelectValueTemplate,
729
+ deps: [],
730
+ target: i0.ɵɵFactoryTarget.Directive
731
+ });
732
+ static ɵdir = i0.ɵɵngDeclareDirective({
733
+ minVersion: "14.0.0",
734
+ version: "22.2.3",
735
+ type: TxSelectValueTemplate,
736
+ isStandalone: true,
737
+ selector: "ng-template[txSelectValue]",
738
+ ngImport: i0
739
+ });
740
+ };
741
+ i0.ɵɵngDeclareClassMetadata({
742
+ minVersion: "12.0.0",
743
+ version: "22.2.3",
744
+ ngImport: i0,
745
+ type: TxSelectValueTemplate,
746
+ decorators: [{
747
+ type: Directive,
748
+ args: [{ selector: "ng-template[txSelectValue]" }]
749
+ }]
750
+ });
751
+ var TxSelectGroupTemplate = class TxSelectGroupTemplate {
752
+ templateRef = inject(TemplateRef);
753
+ static ɵfac = i0.ɵɵngDeclareFactory({
754
+ minVersion: "12.0.0",
755
+ version: "22.2.3",
756
+ ngImport: i0,
757
+ type: TxSelectGroupTemplate,
758
+ deps: [],
759
+ target: i0.ɵɵFactoryTarget.Directive
760
+ });
761
+ static ɵdir = i0.ɵɵngDeclareDirective({
762
+ minVersion: "14.0.0",
763
+ version: "22.2.3",
764
+ type: TxSelectGroupTemplate,
765
+ isStandalone: true,
766
+ selector: "ng-template[txSelectGroup]",
767
+ ngImport: i0
768
+ });
769
+ };
770
+ i0.ɵɵngDeclareClassMetadata({
771
+ minVersion: "12.0.0",
772
+ version: "22.2.3",
773
+ ngImport: i0,
774
+ type: TxSelectGroupTemplate,
775
+ decorators: [{
776
+ type: Directive,
777
+ args: [{ selector: "ng-template[txSelectGroup]" }]
778
+ }]
779
+ });
780
+ var TxSelectHeaderTemplate = class TxSelectHeaderTemplate {
781
+ templateRef = inject(TemplateRef);
782
+ static ɵfac = i0.ɵɵngDeclareFactory({
783
+ minVersion: "12.0.0",
784
+ version: "22.2.3",
785
+ ngImport: i0,
786
+ type: TxSelectHeaderTemplate,
787
+ deps: [],
788
+ target: i0.ɵɵFactoryTarget.Directive
789
+ });
790
+ static ɵdir = i0.ɵɵngDeclareDirective({
791
+ minVersion: "14.0.0",
792
+ version: "22.2.3",
793
+ type: TxSelectHeaderTemplate,
794
+ isStandalone: true,
795
+ selector: "ng-template[txSelectHeader]",
796
+ ngImport: i0
797
+ });
798
+ };
799
+ i0.ɵɵngDeclareClassMetadata({
800
+ minVersion: "12.0.0",
801
+ version: "22.2.3",
802
+ ngImport: i0,
803
+ type: TxSelectHeaderTemplate,
804
+ decorators: [{
805
+ type: Directive,
806
+ args: [{ selector: "ng-template[txSelectHeader]" }]
807
+ }]
808
+ });
809
+ var TxSelectFooterTemplate = class TxSelectFooterTemplate {
810
+ templateRef = inject(TemplateRef);
811
+ static ɵfac = i0.ɵɵngDeclareFactory({
812
+ minVersion: "12.0.0",
813
+ version: "22.2.3",
814
+ ngImport: i0,
815
+ type: TxSelectFooterTemplate,
816
+ deps: [],
817
+ target: i0.ɵɵFactoryTarget.Directive
818
+ });
819
+ static ɵdir = i0.ɵɵngDeclareDirective({
820
+ minVersion: "14.0.0",
821
+ version: "22.2.3",
822
+ type: TxSelectFooterTemplate,
823
+ isStandalone: true,
824
+ selector: "ng-template[txSelectFooter]",
825
+ ngImport: i0
826
+ });
827
+ };
828
+ i0.ɵɵngDeclareClassMetadata({
829
+ minVersion: "12.0.0",
830
+ version: "22.2.3",
831
+ ngImport: i0,
832
+ type: TxSelectFooterTemplate,
833
+ decorators: [{
834
+ type: Directive,
835
+ args: [{ selector: "ng-template[txSelectFooter]" }]
836
+ }]
837
+ });
838
+ var TxSelectEmptyTemplate = class TxSelectEmptyTemplate {
839
+ templateRef = inject(TemplateRef);
840
+ static ɵfac = i0.ɵɵngDeclareFactory({
841
+ minVersion: "12.0.0",
842
+ version: "22.2.3",
843
+ ngImport: i0,
844
+ type: TxSelectEmptyTemplate,
845
+ deps: [],
846
+ target: i0.ɵɵFactoryTarget.Directive
847
+ });
848
+ static ɵdir = i0.ɵɵngDeclareDirective({
849
+ minVersion: "14.0.0",
850
+ version: "22.2.3",
851
+ type: TxSelectEmptyTemplate,
852
+ isStandalone: true,
853
+ selector: "ng-template[txSelectEmpty]",
854
+ ngImport: i0
855
+ });
856
+ };
857
+ i0.ɵɵngDeclareClassMetadata({
858
+ minVersion: "12.0.0",
859
+ version: "22.2.3",
860
+ ngImport: i0,
861
+ type: TxSelectEmptyTemplate,
862
+ decorators: [{
863
+ type: Directive,
864
+ args: [{ selector: "ng-template[txSelectEmpty]" }]
865
+ }]
866
+ });
867
+ var TxSelectEmptyFilterTemplate = class TxSelectEmptyFilterTemplate {
868
+ templateRef = inject(TemplateRef);
869
+ static ɵfac = i0.ɵɵngDeclareFactory({
870
+ minVersion: "12.0.0",
871
+ version: "22.2.3",
872
+ ngImport: i0,
873
+ type: TxSelectEmptyFilterTemplate,
874
+ deps: [],
875
+ target: i0.ɵɵFactoryTarget.Directive
876
+ });
877
+ static ɵdir = i0.ɵɵngDeclareDirective({
878
+ minVersion: "14.0.0",
879
+ version: "22.2.3",
880
+ type: TxSelectEmptyFilterTemplate,
881
+ isStandalone: true,
882
+ selector: "ng-template[txSelectEmptyFilter]",
883
+ ngImport: i0
884
+ });
885
+ };
886
+ i0.ɵɵngDeclareClassMetadata({
887
+ minVersion: "12.0.0",
888
+ version: "22.2.3",
889
+ ngImport: i0,
890
+ type: TxSelectEmptyFilterTemplate,
891
+ decorators: [{
892
+ type: Directive,
893
+ args: [{ selector: "ng-template[txSelectEmptyFilter]" }]
894
+ }]
895
+ });
896
+ function readOptionField(option, field) {
897
+ if (!field || option === null || typeof option !== "object") return option;
898
+ return field.split(".").reduce((current, key) => current !== null && typeof current === "object" ? current[key] : void 0, option);
899
+ }
900
+ const BASE_LETTERS = {
901
+ ł: "l",
902
+ ø: "o",
903
+ đ: "d",
904
+ ß: "ss",
905
+ æ: "ae",
906
+ œ: "oe",
907
+ ı: "i",
908
+ ħ: "h",
909
+ þ: "th"
910
+ };
911
+ function foldText(text) {
912
+ return text.normalize("NFD").replace(/\p{M}/gu, "").toLocaleLowerCase().replace(/[łøđßæœıħþ]/g, (letter) => BASE_LETTERS[letter]);
913
+ }
914
+ function matchesQuery(text, query, mode) {
915
+ const value = foldText(text);
916
+ switch (mode) {
917
+ case "startsWith": return value.startsWith(query);
918
+ case "endsWith": return value.endsWith(query);
919
+ case "equals": return value === query;
920
+ default: return value.includes(query);
921
+ }
922
+ }
923
+ function sameOptionValue(a, b, dataKey) {
924
+ if (dataKey && a !== null && b !== null && typeof a === "object" && typeof b === "object") return readOptionField(a, dataKey) === readOptionField(b, dataKey);
925
+ return a === b;
926
+ }
927
+ function buildOptionRows(request) {
928
+ const { options, fields, group, idPrefix, isSelected } = request;
929
+ const query = foldText(request.query.trim());
930
+ const rows = [];
931
+ let index = 0;
932
+ const toItem = (option) => {
933
+ const value = readOptionField(option, fields.value);
934
+ const item = {
935
+ type: "option",
936
+ id: `${idPrefix}-${index}`,
937
+ index,
938
+ label: String(readOptionField(option, fields.label) ?? ""),
939
+ value,
940
+ option,
941
+ selected: isSelected(value),
942
+ disabled: !!(fields.disabled && option !== null && typeof option === "object" && readOptionField(option, fields.disabled)) || !!request.isBlocked?.(value)
943
+ };
944
+ index += 1;
945
+ return item;
946
+ };
947
+ const matches = (option) => !query || (request.filterFields.length ? request.filterFields : [fields.label]).some((field) => matchesQuery(String(readOptionField(option, field) ?? ""), query, request.matchMode));
948
+ if (group) {
949
+ options.forEach((groupOption, groupIndex) => {
950
+ const children = readOptionField(groupOption, fields.groupChildren);
951
+ const items = [];
952
+ for (const child of Array.isArray(children) ? children : []) if (matches(child)) items.push(toItem(child));
953
+ else index += 1;
954
+ if (items.length || !query) {
955
+ rows.push({
956
+ type: "group",
957
+ id: `${idPrefix}-group-${groupIndex}`,
958
+ label: String(readOptionField(groupOption, fields.groupLabel) ?? ""),
959
+ group: groupOption
960
+ });
961
+ rows.push(...items);
962
+ }
963
+ });
964
+ return rows;
965
+ }
966
+ for (const option of options) {
967
+ if (option === void 0 || option === null) {
968
+ if (!query) rows.push({
969
+ type: "loader",
970
+ id: `${idPrefix}-${index}`,
971
+ index
972
+ });
973
+ index += 1;
974
+ continue;
975
+ }
976
+ if (matches(option)) rows.push(toItem(option));
977
+ else index += 1;
978
+ }
979
+ return rows;
980
+ }
981
+ function isSelectableRow(row) {
982
+ return row?.type === "option" && !row.disabled;
983
+ }
984
+ var TxOptionsBase = class TxOptionsBase extends TxFormControlBase {
985
+ optionLabel = input("label", ...ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []);
986
+ optionValue = input("value", ...ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []);
987
+ optionDisabled = input("disabled", ...ngDevMode ? [{ debugName: "optionDisabled" }] : /* istanbul ignore next */ []);
988
+ group = input(false, {
989
+ ...ngDevMode ? { debugName: "group" } : /* istanbul ignore next */ {},
990
+ transform: booleanAttribute
991
+ });
992
+ optionGroupLabel = input("label", ...ngDevMode ? [{ debugName: "optionGroupLabel" }] : /* istanbul ignore next */ []);
993
+ optionGroupChildren = input("items", ...ngDevMode ? [{ debugName: "optionGroupChildren" }] : /* istanbul ignore next */ []);
994
+ dataKey = input(void 0, ...ngDevMode ? [{ debugName: "dataKey" }] : /* istanbul ignore next */ []);
995
+ filter = input(false, {
996
+ ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
997
+ transform: booleanAttribute
998
+ });
999
+ filterBy = input(void 0, ...ngDevMode ? [{ debugName: "filterBy" }] : /* istanbul ignore next */ []);
1000
+ filterMatchMode = input("contains", ...ngDevMode ? [{ debugName: "filterMatchMode" }] : /* istanbul ignore next */ []);
1001
+ filterPlaceholder = input(void 0, ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
1002
+ filterDelay = input(0, ...ngDevMode ? [{ debugName: "filterDelay" }] : /* istanbul ignore next */ []);
1003
+ loading = input(false, {
1004
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
1005
+ transform: booleanAttribute
1006
+ });
1007
+ lazy = input(false, {
1008
+ ...ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {},
1009
+ transform: booleanAttribute
1010
+ });
1011
+ virtualScroll = input(false, {
1012
+ ...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
1013
+ transform: booleanAttribute
1014
+ });
1015
+ virtualScrollItemSize = input(35, ...ngDevMode ? [{ debugName: "virtualScrollItemSize" }] : /* istanbul ignore next */ []);
1016
+ scrollHeight = input(void 0, ...ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
1017
+ emptyMessage = input(void 0, ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
1018
+ emptyFilterMessage = input(void 0, ...ngDevMode ? [{ debugName: "emptyFilterMessage" }] : /* istanbul ignore next */ []);
1019
+ filtered = output();
1020
+ lazyLoad = output();
1021
+ optionTemplate = contentChild(TxSelectOptionTemplate, ...ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []);
1022
+ groupTemplate = contentChild(TxSelectGroupTemplate, ...ngDevMode ? [{ debugName: "groupTemplate" }] : /* istanbul ignore next */ []);
1023
+ headerTemplate = contentChild(TxSelectHeaderTemplate, ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
1024
+ footerTemplate = contentChild(TxSelectFooterTemplate, ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
1025
+ emptyTemplate = contentChild(TxSelectEmptyTemplate, ...ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []);
1026
+ emptyFilterTemplate = contentChild(TxSelectEmptyFilterTemplate, ...ngDevMode ? [{ debugName: "emptyFilterTemplate" }] : /* istanbul ignore next */ []);
1027
+ optionList = viewChild(TxOptionList, ...ngDevMode ? [{ debugName: "optionList" }] : /* istanbul ignore next */ []);
1028
+ translations = injectTranslations();
1029
+ listboxId = uniqueId("tx-listbox");
1030
+ query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
1031
+ activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
1032
+ selectionFull = computed(() => false, ...ngDevMode ? [{ debugName: "selectionFull" }] : /* istanbul ignore next */ []);
1033
+ typeahead = new TxTypeahead();
1034
+ filterTimer = null;
1035
+ lastLazyRange = "";
1036
+ clearTimers = inject(DestroyRef).onDestroy(() => this.filterTimer && clearTimeout(this.filterTimer));
1037
+ fields = computed(() => ({
1038
+ label: this.optionLabel(),
1039
+ value: this.optionValue(),
1040
+ disabled: this.optionDisabled(),
1041
+ groupLabel: this.optionGroupLabel(),
1042
+ groupChildren: this.optionGroupChildren(),
1043
+ dataKey: this.dataKey()
1044
+ }), ...ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []);
1045
+ filterFields = computed(() => (this.filterBy() ?? "").split(",").map((field) => field.trim()).filter(Boolean), ...ngDevMode ? [{ debugName: "filterFields" }] : /* istanbul ignore next */ []);
1046
+ allRows = computed(() => this.buildRows(""), ...ngDevMode ? [{ debugName: "allRows" }] : /* istanbul ignore next */ []);
1047
+ localQuery = computed(() => this.filter() && !this.lazy() ? this.query().trim() : "", ...ngDevMode ? [{ debugName: "localQuery" }] : /* istanbul ignore next */ []);
1048
+ rows = computed(() => this.localQuery() ? this.buildRows(this.localQuery()) : this.allRows(), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
1049
+ selectableItems = computed(() => this.rows().filter(isSelectableRow), ...ngDevMode ? [{ debugName: "selectableItems" }] : /* istanbul ignore next */ []);
1050
+ activeItemId = computed(() => {
1051
+ const row = this.isListActive() ? this.rows()[this.activeIndex()] : void 0;
1052
+ return row?.type === "option" ? row.id : null;
1053
+ }, ...ngDevMode ? [{ debugName: "activeItemId" }] : /* istanbul ignore next */ []);
1054
+ emptyText = computed(() => this.query().trim() ? this.emptyFilterMessage() ?? this.translations().emptyMessage : this.emptyMessage() ?? this.translations().emptyMessage, ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
1055
+ constructor() {
1056
+ super();
1057
+ effect(() => {
1058
+ this.rows();
1059
+ untracked(() => {
1060
+ if (this.isListActive() && this.activeIndex() >= 0 && !isSelectableRow(this.rows()[this.activeIndex()])) this.activeIndex.set(this.rows().findIndex(isSelectableRow));
1061
+ });
1062
+ });
1063
+ }
1064
+ onRangeChange(range) {
1065
+ this.requestLazy(range.start, range.end);
1066
+ }
1067
+ onFilterInput(event) {
1068
+ this.query.set(event.target.value);
1069
+ this.activeIndex.set(this.rows().findIndex(isSelectableRow));
1070
+ this.optionList()?.scrollToTop();
1071
+ this.emitFilter();
1072
+ }
1073
+ sameValue(a, b) {
1074
+ return sameOptionValue(a, b, this.dataKey());
1075
+ }
1076
+ resetActive(preferSelected, fallbackToFirst = true) {
1077
+ const rows = this.rows();
1078
+ const selected = preferSelected ? rows.findIndex((row) => isSelectableRow(row) && row.selected) : -1;
1079
+ this.activeIndex.set(selected >= 0 ? selected : fallbackToFirst ? rows.findIndex(isSelectableRow) : -1);
1080
+ }
1081
+ resetLazyRange() {
1082
+ this.lastLazyRange = "";
1083
+ }
1084
+ moveActive(key) {
1085
+ const rows = this.rows();
1086
+ const options = {
1087
+ count: rows.length,
1088
+ current: this.activeIndex(),
1089
+ isDisabled: (index) => !isSelectableRow(rows[index])
1090
+ };
1091
+ let next = nextListIndex(key, options);
1092
+ if (next !== null && !isSelectableRow(rows[next])) {
1093
+ const forward = key === "PageDown" ? "ArrowDown" : "ArrowUp";
1094
+ const backward = forward === "ArrowDown" ? "ArrowUp" : "ArrowDown";
1095
+ const stepped = nextListIndex(forward, {
1096
+ ...options,
1097
+ current: next,
1098
+ loop: false
1099
+ });
1100
+ next = stepped !== null && isSelectableRow(rows[stepped]) ? stepped : nextListIndex(backward, {
1101
+ ...options,
1102
+ current: next,
1103
+ loop: false
1104
+ });
1105
+ }
1106
+ if (next !== null && isSelectableRow(rows[next])) {
1107
+ this.activeIndex.set(next);
1108
+ this.scrollActiveIntoView();
1109
+ return true;
1110
+ }
1111
+ return false;
1112
+ }
1113
+ findByTyping(key) {
1114
+ const rows = this.rows();
1115
+ const found = this.typeahead.search(key, rows.map((row) => isSelectableRow(row) ? row.label : ""), this.activeIndex());
1116
+ const row = found === null ? void 0 : rows[found];
1117
+ if (found === null || !isSelectableRow(row)) return null;
1118
+ this.activeIndex.set(found);
1119
+ return row;
1120
+ }
1121
+ scrollActiveIntoView() {
1122
+ this.optionList()?.scrollToIndex(this.activeIndex());
1123
+ }
1124
+ emitFilter() {
1125
+ if (this.filterTimer) {
1126
+ clearTimeout(this.filterTimer);
1127
+ this.filterTimer = null;
1128
+ }
1129
+ const query = this.query();
1130
+ if (this.filterDelay() > 0) this.filterTimer = setTimeout(() => {
1131
+ this.filterTimer = null;
1132
+ this.filtered.emit({ query });
1133
+ }, this.filterDelay());
1134
+ else this.filtered.emit({ query });
1135
+ }
1136
+ requestLazy(start, end) {
1137
+ if (!this.lazy()) return;
1138
+ const loaders = this.rows().slice(start, end).filter((row) => row.type === "loader");
1139
+ if (!loaders.length) return;
1140
+ const event = {
1141
+ first: loaders[0].index,
1142
+ last: loaders[loaders.length - 1].index + 1,
1143
+ query: this.query()
1144
+ };
1145
+ const key = `${event.first}:${event.last}:${event.query}`;
1146
+ if (key !== this.lastLazyRange) {
1147
+ this.lastLazyRange = key;
1148
+ this.lazyLoad.emit(event);
1149
+ }
1150
+ }
1151
+ buildRows(query) {
1152
+ return buildOptionRows({
1153
+ options: this.source(),
1154
+ fields: this.fields(),
1155
+ group: this.group(),
1156
+ idPrefix: this.listboxId,
1157
+ query,
1158
+ filterFields: this.filterFields(),
1159
+ matchMode: this.filterMatchMode(),
1160
+ isSelected: (value) => this.isSelected(value),
1161
+ isBlocked: (value) => this.selectionFull() && !this.isSelected(value)
1162
+ });
1163
+ }
1164
+ static ɵfac = i0.ɵɵngDeclareFactory({
1165
+ minVersion: "12.0.0",
1166
+ version: "22.2.3",
1167
+ ngImport: i0,
1168
+ type: TxOptionsBase,
1169
+ deps: [],
1170
+ target: i0.ɵɵFactoryTarget.Directive
1171
+ });
1172
+ static ɵdir = i0.ɵɵngDeclareDirective({
1173
+ minVersion: "17.2.0",
1174
+ version: "22.2.3",
1175
+ type: TxOptionsBase,
1176
+ isStandalone: true,
1177
+ inputs: {
1178
+ optionLabel: {
1179
+ classPropertyName: "optionLabel",
1180
+ publicName: "optionLabel",
1181
+ isSignal: true,
1182
+ isRequired: false,
1183
+ transformFunction: null
1184
+ },
1185
+ optionValue: {
1186
+ classPropertyName: "optionValue",
1187
+ publicName: "optionValue",
1188
+ isSignal: true,
1189
+ isRequired: false,
1190
+ transformFunction: null
1191
+ },
1192
+ optionDisabled: {
1193
+ classPropertyName: "optionDisabled",
1194
+ publicName: "optionDisabled",
1195
+ isSignal: true,
1196
+ isRequired: false,
1197
+ transformFunction: null
1198
+ },
1199
+ group: {
1200
+ classPropertyName: "group",
1201
+ publicName: "group",
1202
+ isSignal: true,
1203
+ isRequired: false,
1204
+ transformFunction: null
1205
+ },
1206
+ optionGroupLabel: {
1207
+ classPropertyName: "optionGroupLabel",
1208
+ publicName: "optionGroupLabel",
1209
+ isSignal: true,
1210
+ isRequired: false,
1211
+ transformFunction: null
1212
+ },
1213
+ optionGroupChildren: {
1214
+ classPropertyName: "optionGroupChildren",
1215
+ publicName: "optionGroupChildren",
1216
+ isSignal: true,
1217
+ isRequired: false,
1218
+ transformFunction: null
1219
+ },
1220
+ dataKey: {
1221
+ classPropertyName: "dataKey",
1222
+ publicName: "dataKey",
1223
+ isSignal: true,
1224
+ isRequired: false,
1225
+ transformFunction: null
1226
+ },
1227
+ filter: {
1228
+ classPropertyName: "filter",
1229
+ publicName: "filter",
1230
+ isSignal: true,
1231
+ isRequired: false,
1232
+ transformFunction: null
1233
+ },
1234
+ filterBy: {
1235
+ classPropertyName: "filterBy",
1236
+ publicName: "filterBy",
1237
+ isSignal: true,
1238
+ isRequired: false,
1239
+ transformFunction: null
1240
+ },
1241
+ filterMatchMode: {
1242
+ classPropertyName: "filterMatchMode",
1243
+ publicName: "filterMatchMode",
1244
+ isSignal: true,
1245
+ isRequired: false,
1246
+ transformFunction: null
1247
+ },
1248
+ filterPlaceholder: {
1249
+ classPropertyName: "filterPlaceholder",
1250
+ publicName: "filterPlaceholder",
1251
+ isSignal: true,
1252
+ isRequired: false,
1253
+ transformFunction: null
1254
+ },
1255
+ filterDelay: {
1256
+ classPropertyName: "filterDelay",
1257
+ publicName: "filterDelay",
1258
+ isSignal: true,
1259
+ isRequired: false,
1260
+ transformFunction: null
1261
+ },
1262
+ loading: {
1263
+ classPropertyName: "loading",
1264
+ publicName: "loading",
1265
+ isSignal: true,
1266
+ isRequired: false,
1267
+ transformFunction: null
1268
+ },
1269
+ lazy: {
1270
+ classPropertyName: "lazy",
1271
+ publicName: "lazy",
1272
+ isSignal: true,
1273
+ isRequired: false,
1274
+ transformFunction: null
1275
+ },
1276
+ virtualScroll: {
1277
+ classPropertyName: "virtualScroll",
1278
+ publicName: "virtualScroll",
1279
+ isSignal: true,
1280
+ isRequired: false,
1281
+ transformFunction: null
1282
+ },
1283
+ virtualScrollItemSize: {
1284
+ classPropertyName: "virtualScrollItemSize",
1285
+ publicName: "virtualScrollItemSize",
1286
+ isSignal: true,
1287
+ isRequired: false,
1288
+ transformFunction: null
1289
+ },
1290
+ scrollHeight: {
1291
+ classPropertyName: "scrollHeight",
1292
+ publicName: "scrollHeight",
1293
+ isSignal: true,
1294
+ isRequired: false,
1295
+ transformFunction: null
1296
+ },
1297
+ emptyMessage: {
1298
+ classPropertyName: "emptyMessage",
1299
+ publicName: "emptyMessage",
1300
+ isSignal: true,
1301
+ isRequired: false,
1302
+ transformFunction: null
1303
+ },
1304
+ emptyFilterMessage: {
1305
+ classPropertyName: "emptyFilterMessage",
1306
+ publicName: "emptyFilterMessage",
1307
+ isSignal: true,
1308
+ isRequired: false,
1309
+ transformFunction: null
1310
+ }
1311
+ },
1312
+ outputs: {
1313
+ filtered: "filtered",
1314
+ lazyLoad: "lazyLoad"
1315
+ },
1316
+ queries: [
1317
+ {
1318
+ propertyName: "optionTemplate",
1319
+ first: true,
1320
+ predicate: TxSelectOptionTemplate,
1321
+ descendants: true,
1322
+ isSignal: true
1323
+ },
1324
+ {
1325
+ propertyName: "groupTemplate",
1326
+ first: true,
1327
+ predicate: TxSelectGroupTemplate,
1328
+ descendants: true,
1329
+ isSignal: true
1330
+ },
1331
+ {
1332
+ propertyName: "headerTemplate",
1333
+ first: true,
1334
+ predicate: TxSelectHeaderTemplate,
1335
+ descendants: true,
1336
+ isSignal: true
1337
+ },
1338
+ {
1339
+ propertyName: "footerTemplate",
1340
+ first: true,
1341
+ predicate: TxSelectFooterTemplate,
1342
+ descendants: true,
1343
+ isSignal: true
1344
+ },
1345
+ {
1346
+ propertyName: "emptyTemplate",
1347
+ first: true,
1348
+ predicate: TxSelectEmptyTemplate,
1349
+ descendants: true,
1350
+ isSignal: true
1351
+ },
1352
+ {
1353
+ propertyName: "emptyFilterTemplate",
1354
+ first: true,
1355
+ predicate: TxSelectEmptyFilterTemplate,
1356
+ descendants: true,
1357
+ isSignal: true
1358
+ }
1359
+ ],
1360
+ viewQueries: [{
1361
+ propertyName: "optionList",
1362
+ first: true,
1363
+ predicate: TxOptionList,
1364
+ descendants: true,
1365
+ isSignal: true
1366
+ }],
1367
+ usesInheritance: true,
1368
+ ngImport: i0
1369
+ });
1370
+ };
1371
+ i0.ɵɵngDeclareClassMetadata({
1372
+ minVersion: "12.0.0",
1373
+ version: "22.2.3",
1374
+ ngImport: i0,
1375
+ type: TxOptionsBase,
1376
+ decorators: [{ type: Directive }],
1377
+ ctorParameters: () => [],
1378
+ propDecorators: {
1379
+ optionLabel: [{
1380
+ type: i0.Input,
1381
+ args: [{
1382
+ isSignal: true,
1383
+ alias: "optionLabel",
1384
+ required: false
1385
+ }]
1386
+ }],
1387
+ optionValue: [{
1388
+ type: i0.Input,
1389
+ args: [{
1390
+ isSignal: true,
1391
+ alias: "optionValue",
1392
+ required: false
1393
+ }]
1394
+ }],
1395
+ optionDisabled: [{
1396
+ type: i0.Input,
1397
+ args: [{
1398
+ isSignal: true,
1399
+ alias: "optionDisabled",
1400
+ required: false
1401
+ }]
1402
+ }],
1403
+ group: [{
1404
+ type: i0.Input,
1405
+ args: [{
1406
+ isSignal: true,
1407
+ alias: "group",
1408
+ required: false
1409
+ }]
1410
+ }],
1411
+ optionGroupLabel: [{
1412
+ type: i0.Input,
1413
+ args: [{
1414
+ isSignal: true,
1415
+ alias: "optionGroupLabel",
1416
+ required: false
1417
+ }]
1418
+ }],
1419
+ optionGroupChildren: [{
1420
+ type: i0.Input,
1421
+ args: [{
1422
+ isSignal: true,
1423
+ alias: "optionGroupChildren",
1424
+ required: false
1425
+ }]
1426
+ }],
1427
+ dataKey: [{
1428
+ type: i0.Input,
1429
+ args: [{
1430
+ isSignal: true,
1431
+ alias: "dataKey",
1432
+ required: false
1433
+ }]
1434
+ }],
1435
+ filter: [{
1436
+ type: i0.Input,
1437
+ args: [{
1438
+ isSignal: true,
1439
+ alias: "filter",
1440
+ required: false
1441
+ }]
1442
+ }],
1443
+ filterBy: [{
1444
+ type: i0.Input,
1445
+ args: [{
1446
+ isSignal: true,
1447
+ alias: "filterBy",
1448
+ required: false
1449
+ }]
1450
+ }],
1451
+ filterMatchMode: [{
1452
+ type: i0.Input,
1453
+ args: [{
1454
+ isSignal: true,
1455
+ alias: "filterMatchMode",
1456
+ required: false
1457
+ }]
1458
+ }],
1459
+ filterPlaceholder: [{
1460
+ type: i0.Input,
1461
+ args: [{
1462
+ isSignal: true,
1463
+ alias: "filterPlaceholder",
1464
+ required: false
1465
+ }]
1466
+ }],
1467
+ filterDelay: [{
1468
+ type: i0.Input,
1469
+ args: [{
1470
+ isSignal: true,
1471
+ alias: "filterDelay",
1472
+ required: false
1473
+ }]
1474
+ }],
1475
+ loading: [{
1476
+ type: i0.Input,
1477
+ args: [{
1478
+ isSignal: true,
1479
+ alias: "loading",
1480
+ required: false
1481
+ }]
1482
+ }],
1483
+ lazy: [{
1484
+ type: i0.Input,
1485
+ args: [{
1486
+ isSignal: true,
1487
+ alias: "lazy",
1488
+ required: false
1489
+ }]
1490
+ }],
1491
+ virtualScroll: [{
1492
+ type: i0.Input,
1493
+ args: [{
1494
+ isSignal: true,
1495
+ alias: "virtualScroll",
1496
+ required: false
1497
+ }]
1498
+ }],
1499
+ virtualScrollItemSize: [{
1500
+ type: i0.Input,
1501
+ args: [{
1502
+ isSignal: true,
1503
+ alias: "virtualScrollItemSize",
1504
+ required: false
1505
+ }]
1506
+ }],
1507
+ scrollHeight: [{
1508
+ type: i0.Input,
1509
+ args: [{
1510
+ isSignal: true,
1511
+ alias: "scrollHeight",
1512
+ required: false
1513
+ }]
1514
+ }],
1515
+ emptyMessage: [{
1516
+ type: i0.Input,
1517
+ args: [{
1518
+ isSignal: true,
1519
+ alias: "emptyMessage",
1520
+ required: false
1521
+ }]
1522
+ }],
1523
+ emptyFilterMessage: [{
1524
+ type: i0.Input,
1525
+ args: [{
1526
+ isSignal: true,
1527
+ alias: "emptyFilterMessage",
1528
+ required: false
1529
+ }]
1530
+ }],
1531
+ filtered: [{
1532
+ type: i0.Output,
1533
+ args: ["filtered"]
1534
+ }],
1535
+ lazyLoad: [{
1536
+ type: i0.Output,
1537
+ args: ["lazyLoad"]
1538
+ }],
1539
+ optionTemplate: [{
1540
+ type: i0.ContentChild,
1541
+ args: [i0.forwardRef(() => TxSelectOptionTemplate), { isSignal: true }]
1542
+ }],
1543
+ groupTemplate: [{
1544
+ type: i0.ContentChild,
1545
+ args: [i0.forwardRef(() => TxSelectGroupTemplate), { isSignal: true }]
1546
+ }],
1547
+ headerTemplate: [{
1548
+ type: i0.ContentChild,
1549
+ args: [i0.forwardRef(() => TxSelectHeaderTemplate), { isSignal: true }]
1550
+ }],
1551
+ footerTemplate: [{
1552
+ type: i0.ContentChild,
1553
+ args: [i0.forwardRef(() => TxSelectFooterTemplate), { isSignal: true }]
1554
+ }],
1555
+ emptyTemplate: [{
1556
+ type: i0.ContentChild,
1557
+ args: [i0.forwardRef(() => TxSelectEmptyTemplate), { isSignal: true }]
1558
+ }],
1559
+ emptyFilterTemplate: [{
1560
+ type: i0.ContentChild,
1561
+ args: [i0.forwardRef(() => TxSelectEmptyFilterTemplate), { isSignal: true }]
1562
+ }],
1563
+ optionList: [{
1564
+ type: i0.ViewChild,
1565
+ args: [i0.forwardRef(() => TxOptionList), { isSignal: true }]
1566
+ }]
1567
+ }
1568
+ });
1569
+ var TxSelectBase = class TxSelectBase extends TxOptionsBase {
1570
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
1571
+ inputId = input(void 0, ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
1572
+ ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1573
+ ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
1574
+ resetFilterOnHide = input(false, {
1575
+ ...ngDevMode ? { debugName: "resetFilterOnHide" } : /* istanbul ignore next */ {},
1576
+ transform: booleanAttribute
1577
+ });
1578
+ showClear = input(false, {
1579
+ ...ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {},
1580
+ transform: booleanAttribute
1581
+ });
1582
+ size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
1583
+ variant = input("outlined", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
1584
+ invalid = input(void 0, {
1585
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
1586
+ transform: optionalBoolean
1587
+ });
1588
+ readonly = input(false, {
1589
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
1590
+ transform: booleanAttribute
1591
+ });
1592
+ opened = output();
1593
+ closed = output();
1594
+ cleared = output();
1595
+ box = viewChild.required("box", ...ngDevMode ? [{ debugName: "box" }] : /* istanbul ignore next */ []);
1596
+ trigger = viewChild("trigger", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
1597
+ filterInput = viewChild("filterInput", ...ngDevMode ? [{ debugName: "filterInput" }] : /* istanbul ignore next */ []);
1598
+ panel = viewChild("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
1599
+ document = inject(DOCUMENT);
1600
+ injector = inject(Injector);
1601
+ overlayInsets = inject(TxOverlayInsets);
1602
+ stopWatchingTrigger = null;
1603
+ hasEntered = false;
1604
+ stopWatching = inject(DestroyRef).onDestroy(() => this.stopWatchingTrigger?.());
1605
+ isInvalid = injectFieldInvalid(this.invalid);
1606
+ room = new TxOverlayRoom(txPositions("bottom-start", 4));
1607
+ connectedOverlay = viewChild(CdkConnectedOverlay, ...ngDevMode ? [{ debugName: "connectedOverlay" }] : /* istanbul ignore next */ []);
1608
+ positions = this.room.positions;
1609
+ scrollStrategy = txScrollStrategy(this.injector);
1610
+ viewportMargin = this.room.viewportMargin;
1611
+ isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
1612
+ isPanelMounted = signal(false, ...ngDevMode ? [{ debugName: "isPanelMounted" }] : /* istanbul ignore next */ []);
1613
+ panelPlacement = signal("bottom-start", ...ngDevMode ? [{ debugName: "panelPlacement" }] : /* istanbul ignore next */ []);
1614
+ panelWidth = signal(0, ...ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []);
1615
+ canClear = computed(() => this.showClear() && this.hasValue() && !this.disabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "canClear" }] : /* istanbul ignore next */ []);
1616
+ isListActive() {
1617
+ return this.isOpen();
1618
+ }
1619
+ get typingTarget() {
1620
+ return false;
1621
+ }
1622
+ open() {
1623
+ if (this.disabled() || this.readonly() || this.isOpen()) return;
1624
+ this.panelWidth.set(this.box().nativeElement.offsetWidth);
1625
+ this.activeIndex.set(-1);
1626
+ this.isOpen.set(true);
1627
+ this.hasEntered = false;
1628
+ this.resetLazyRange();
1629
+ this.isPanelMounted.set(true);
1630
+ this.room.open(this.overlayInsets.measure());
1631
+ this.stopWatchingTrigger = watchOrigin(this.box().nativeElement, this.overlayInsets, {
1632
+ insetsChange: (insets) => this.room.follow(insets, this.box().nativeElement, this.panel()?.nativeElement, this.connectedOverlay(), this.injector),
1633
+ containerScroll: () => this.close()
1634
+ });
1635
+ if (this.lazy() && !this.virtualScroll()) this.requestLazy(0, this.rows().length);
1636
+ this.opened.emit();
1637
+ }
1638
+ close() {
1639
+ if (!this.isOpen()) return;
1640
+ this.isOpen.set(false);
1641
+ this.stopWatchingTrigger?.();
1642
+ this.stopWatchingTrigger = null;
1643
+ if (this.resetFilterOnHide() && this.query()) {
1644
+ this.query.set("");
1645
+ this.emitFilter();
1646
+ }
1647
+ this.markTouched();
1648
+ this.closed.emit();
1649
+ const panel = this.panel()?.nativeElement;
1650
+ (panel ? txAnimateLeave(panel, this.panelPlacement()) : Promise.resolve()).then(() => {
1651
+ if (!this.isOpen()) this.isPanelMounted.set(false);
1652
+ });
1653
+ }
1654
+ activateFromNothing(last) {
1655
+ const rows = this.rows();
1656
+ const selected = rows.findIndex((row) => isSelectableRow(row) && row.selected);
1657
+ const edge = last ? rows.map((row, index) => isSelectableRow(row) ? index : -1).filter((index) => index >= 0).pop() ?? -1 : rows.findIndex(isSelectableRow);
1658
+ this.activeIndex.set(selected >= 0 ? selected : edge);
1659
+ this.scrollActiveIntoView();
1660
+ }
1661
+ openFromKeyboard() {
1662
+ this.open();
1663
+ if (this.isOpen() && this.activeIndex() < 0) this.resetActive(true);
1664
+ }
1665
+ toggle() {
1666
+ if (this.isOpen()) this.close();
1667
+ else this.open();
1668
+ }
1669
+ clear() {
1670
+ this.clearValue();
1671
+ this.cleared.emit();
1672
+ this.focusTrigger();
1673
+ }
1674
+ focusTrigger() {
1675
+ this.trigger()?.nativeElement.focus();
1676
+ }
1677
+ onBoxClick(event) {
1678
+ const target = event.target;
1679
+ if (target.closest(".tx-select__clear, .tx-select__chip-remove") || this.ignoreBoxClick(target)) return;
1680
+ this.toggle();
1681
+ this.focusTrigger();
1682
+ }
1683
+ onPanelAttach() {
1684
+ this.filterInput()?.nativeElement.focus();
1685
+ }
1686
+ onPositionChange(change) {
1687
+ this.panelPlacement.set(placementFromPosition(change.connectionPair) ?? "bottom-start");
1688
+ const panel = this.panel()?.nativeElement;
1689
+ if (!this.hasEntered && this.room.fit(this.box().nativeElement, panel, this.connectedOverlay(), this.injector)) return;
1690
+ if (!this.hasEntered && panel) {
1691
+ this.hasEntered = true;
1692
+ txAnimateEnter(panel, this.panelPlacement());
1693
+ const selected = this.rows().findIndex((row) => isSelectableRow(row) && row.selected);
1694
+ this.optionList()?.scrollToIndex(this.activeIndex() >= 0 ? this.activeIndex() : selected);
1695
+ }
1696
+ }
1697
+ onPanelDetach() {
1698
+ this.isPanelMounted.set(false);
1699
+ this.close();
1700
+ }
1701
+ onOutsideClick(event) {
1702
+ if (!this.box().nativeElement.contains(event.target)) this.close();
1703
+ }
1704
+ onPanelKeydown(event) {
1705
+ if (event.key === "Escape" && this.isOpen()) {
1706
+ event.preventDefault();
1707
+ this.close();
1708
+ this.focusTrigger();
1709
+ }
1710
+ }
1711
+ onPanelMousedown(event) {
1712
+ if (!event.target.closest("input, button, a[href], textarea, select, [tabindex]")) event.preventDefault();
1713
+ }
1714
+ onPanelFocusOut(event) {
1715
+ const next = event.relatedTarget;
1716
+ if (next && !this.panel()?.nativeElement.contains(next) && !this.box().nativeElement.contains(next)) this.close();
1717
+ else if (!next) queueMicrotask(() => {
1718
+ const active = this.document.activeElement;
1719
+ if (this.isOpen() && (!active || active === this.document.body)) (this.filterInput()?.nativeElement ?? this.trigger()?.nativeElement)?.focus();
1720
+ });
1721
+ }
1722
+ onOptionClick(item) {
1723
+ this.activate(item);
1724
+ }
1725
+ onKeydown(event) {
1726
+ if (this.readonly()) return;
1727
+ const target = event.target;
1728
+ const typing = target.classList.contains("tx-select__filter-input") || this.typingTarget;
1729
+ if (this.handleExtraKey(event, typing)) return;
1730
+ const active = this.rows()[this.activeIndex()];
1731
+ if (event.key === "Escape") {
1732
+ if (this.isOpen()) {
1733
+ event.preventDefault();
1734
+ this.close();
1735
+ this.focusTrigger();
1736
+ }
1737
+ return;
1738
+ }
1739
+ if (event.key === "Tab") {
1740
+ if (!(target.classList.contains("tx-select__filter-input") && this.panelHasFocusable(target, event.shiftKey))) this.close();
1741
+ return;
1742
+ }
1743
+ if (event.key === "Enter" || event.key === " " && !typing) {
1744
+ event.preventDefault();
1745
+ if (!this.isOpen()) this.openFromKeyboard();
1746
+ else if (isSelectableRow(active)) this.activate(active);
1747
+ else this.onEnterWithoutOption();
1748
+ return;
1749
+ }
1750
+ if ([
1751
+ "ArrowDown",
1752
+ "ArrowUp",
1753
+ "Home",
1754
+ "End",
1755
+ "PageDown",
1756
+ "PageUp"
1757
+ ].includes(event.key) && !(typing && (event.key === "Home" || event.key === "End"))) {
1758
+ event.preventDefault();
1759
+ if (!this.isOpen()) {
1760
+ this.openFromKeyboard();
1761
+ return;
1762
+ }
1763
+ if (this.activeIndex() < 0 && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
1764
+ this.activateFromNothing(event.key === "ArrowUp");
1765
+ return;
1766
+ }
1767
+ this.moveActive(event.key);
1768
+ return;
1769
+ }
1770
+ if (!typing && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
1771
+ const item = this.findByTyping(event.key);
1772
+ if (item) {
1773
+ if (this.isOpen()) this.scrollActiveIntoView();
1774
+ else this.onTypeaheadClosed(item);
1775
+ }
1776
+ }
1777
+ }
1778
+ onEnterWithoutOption() {
1779
+ this.close();
1780
+ }
1781
+ panelHasFocusable(from, backward) {
1782
+ const panel = this.panel()?.nativeElement;
1783
+ if (!panel) return false;
1784
+ return Array.from(panel.querySelectorAll("button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])")).filter((element) => element !== from && !element.matches(":disabled")).some((element) => backward ? element.compareDocumentPosition(from) & Node.DOCUMENT_POSITION_FOLLOWING : from.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING);
1785
+ }
1786
+ static ɵfac = i0.ɵɵngDeclareFactory({
1787
+ minVersion: "12.0.0",
1788
+ version: "22.2.3",
1789
+ ngImport: i0,
1790
+ type: TxSelectBase,
1791
+ deps: null,
1792
+ target: i0.ɵɵFactoryTarget.Directive
1793
+ });
1794
+ static ɵdir = i0.ɵɵngDeclareDirective({
1795
+ minVersion: "17.2.0",
1796
+ version: "22.2.3",
1797
+ type: TxSelectBase,
1798
+ isStandalone: true,
1799
+ inputs: {
1800
+ placeholder: {
1801
+ classPropertyName: "placeholder",
1802
+ publicName: "placeholder",
1803
+ isSignal: true,
1804
+ isRequired: false,
1805
+ transformFunction: null
1806
+ },
1807
+ inputId: {
1808
+ classPropertyName: "inputId",
1809
+ publicName: "inputId",
1810
+ isSignal: true,
1811
+ isRequired: false,
1812
+ transformFunction: null
1813
+ },
1814
+ ariaLabel: {
1815
+ classPropertyName: "ariaLabel",
1816
+ publicName: "ariaLabel",
1817
+ isSignal: true,
1818
+ isRequired: false,
1819
+ transformFunction: null
1820
+ },
1821
+ ariaLabelledBy: {
1822
+ classPropertyName: "ariaLabelledBy",
1823
+ publicName: "ariaLabelledBy",
1824
+ isSignal: true,
1825
+ isRequired: false,
1826
+ transformFunction: null
1827
+ },
1828
+ resetFilterOnHide: {
1829
+ classPropertyName: "resetFilterOnHide",
1830
+ publicName: "resetFilterOnHide",
1831
+ isSignal: true,
1832
+ isRequired: false,
1833
+ transformFunction: null
1834
+ },
1835
+ showClear: {
1836
+ classPropertyName: "showClear",
1837
+ publicName: "showClear",
1838
+ isSignal: true,
1839
+ isRequired: false,
1840
+ transformFunction: null
1841
+ },
1842
+ size: {
1843
+ classPropertyName: "size",
1844
+ publicName: "size",
1845
+ isSignal: true,
1846
+ isRequired: false,
1847
+ transformFunction: null
1848
+ },
1849
+ variant: {
1850
+ classPropertyName: "variant",
1851
+ publicName: "variant",
1852
+ isSignal: true,
1853
+ isRequired: false,
1854
+ transformFunction: null
1855
+ },
1856
+ invalid: {
1857
+ classPropertyName: "invalid",
1858
+ publicName: "invalid",
1859
+ isSignal: true,
1860
+ isRequired: false,
1861
+ transformFunction: null
1862
+ },
1863
+ readonly: {
1864
+ classPropertyName: "readonly",
1865
+ publicName: "readonly",
1866
+ isSignal: true,
1867
+ isRequired: false,
1868
+ transformFunction: null
1869
+ }
1870
+ },
1871
+ outputs: {
1872
+ opened: "opened",
1873
+ closed: "closed",
1874
+ cleared: "cleared"
1875
+ },
1876
+ viewQueries: [
1877
+ {
1878
+ propertyName: "box",
1879
+ first: true,
1880
+ predicate: ["box"],
1881
+ descendants: true,
1882
+ isSignal: true
1883
+ },
1884
+ {
1885
+ propertyName: "trigger",
1886
+ first: true,
1887
+ predicate: ["trigger"],
1888
+ descendants: true,
1889
+ isSignal: true
1890
+ },
1891
+ {
1892
+ propertyName: "filterInput",
1893
+ first: true,
1894
+ predicate: ["filterInput"],
1895
+ descendants: true,
1896
+ isSignal: true
1897
+ },
1898
+ {
1899
+ propertyName: "panel",
1900
+ first: true,
1901
+ predicate: ["panel"],
1902
+ descendants: true,
1903
+ isSignal: true
1904
+ },
1905
+ {
1906
+ propertyName: "connectedOverlay",
1907
+ first: true,
1908
+ predicate: CdkConnectedOverlay,
1909
+ descendants: true,
1910
+ isSignal: true
1911
+ }
1912
+ ],
1913
+ usesInheritance: true,
1914
+ ngImport: i0
1915
+ });
1916
+ };
1917
+ i0.ɵɵngDeclareClassMetadata({
1918
+ minVersion: "12.0.0",
1919
+ version: "22.2.3",
1920
+ ngImport: i0,
1921
+ type: TxSelectBase,
1922
+ decorators: [{ type: Directive }],
1923
+ propDecorators: {
1924
+ placeholder: [{
1925
+ type: i0.Input,
1926
+ args: [{
1927
+ isSignal: true,
1928
+ alias: "placeholder",
1929
+ required: false
1930
+ }]
1931
+ }],
1932
+ inputId: [{
1933
+ type: i0.Input,
1934
+ args: [{
1935
+ isSignal: true,
1936
+ alias: "inputId",
1937
+ required: false
1938
+ }]
1939
+ }],
1940
+ ariaLabel: [{
1941
+ type: i0.Input,
1942
+ args: [{
1943
+ isSignal: true,
1944
+ alias: "ariaLabel",
1945
+ required: false
1946
+ }]
1947
+ }],
1948
+ ariaLabelledBy: [{
1949
+ type: i0.Input,
1950
+ args: [{
1951
+ isSignal: true,
1952
+ alias: "ariaLabelledBy",
1953
+ required: false
1954
+ }]
1955
+ }],
1956
+ resetFilterOnHide: [{
1957
+ type: i0.Input,
1958
+ args: [{
1959
+ isSignal: true,
1960
+ alias: "resetFilterOnHide",
1961
+ required: false
1962
+ }]
1963
+ }],
1964
+ showClear: [{
1965
+ type: i0.Input,
1966
+ args: [{
1967
+ isSignal: true,
1968
+ alias: "showClear",
1969
+ required: false
1970
+ }]
1971
+ }],
1972
+ size: [{
1973
+ type: i0.Input,
1974
+ args: [{
1975
+ isSignal: true,
1976
+ alias: "size",
1977
+ required: false
1978
+ }]
1979
+ }],
1980
+ variant: [{
1981
+ type: i0.Input,
1982
+ args: [{
1983
+ isSignal: true,
1984
+ alias: "variant",
1985
+ required: false
1986
+ }]
1987
+ }],
1988
+ invalid: [{
1989
+ type: i0.Input,
1990
+ args: [{
1991
+ isSignal: true,
1992
+ alias: "invalid",
1993
+ required: false
1994
+ }]
1995
+ }],
1996
+ readonly: [{
1997
+ type: i0.Input,
1998
+ args: [{
1999
+ isSignal: true,
2000
+ alias: "readonly",
2001
+ required: false
2002
+ }]
2003
+ }],
2004
+ opened: [{
2005
+ type: i0.Output,
2006
+ args: ["opened"]
2007
+ }],
2008
+ closed: [{
2009
+ type: i0.Output,
2010
+ args: ["closed"]
2011
+ }],
2012
+ cleared: [{
2013
+ type: i0.Output,
2014
+ args: ["cleared"]
2015
+ }],
2016
+ box: [{
2017
+ type: i0.ViewChild,
2018
+ args: ["box", { isSignal: true }]
2019
+ }],
2020
+ trigger: [{
2021
+ type: i0.ViewChild,
2022
+ args: ["trigger", { isSignal: true }]
2023
+ }],
2024
+ filterInput: [{
2025
+ type: i0.ViewChild,
2026
+ args: ["filterInput", { isSignal: true }]
2027
+ }],
2028
+ panel: [{
2029
+ type: i0.ViewChild,
2030
+ args: ["panel", { isSignal: true }]
2031
+ }],
2032
+ connectedOverlay: [{
2033
+ type: i0.ViewChild,
2034
+ args: [i0.forwardRef(() => CdkConnectedOverlay), { isSignal: true }]
2035
+ }]
2036
+ }
2037
+ });
2038
+ var TxSelect = class TxSelect extends TxSelectBase {
2039
+ options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
2040
+ editable = input(false, {
2041
+ ...ngDevMode ? { debugName: "editable" } : /* istanbul ignore next */ {},
2042
+ transform: booleanAttribute
2043
+ });
2044
+ checkmark = input(false, {
2045
+ ...ngDevMode ? { debugName: "checkmark" } : /* istanbul ignore next */ {},
2046
+ transform: booleanAttribute
2047
+ });
2048
+ dropdownIcon = input("chevron-down", ...ngDevMode ? [{ debugName: "dropdownIcon" }] : /* istanbul ignore next */ []);
2049
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
2050
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
2051
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
2052
+ unstyled = input(void 0, {
2053
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
2054
+ transform: optionalBoolean
2055
+ });
2056
+ changed = output();
2057
+ valueTemplate = contentChild(TxSelectValueTemplate, ...ngDevMode ? [{ debugName: "valueTemplate" }] : /* istanbul ignore next */ []);
2058
+ isUnstyled = injectUnstyled(this.unstyled);
2059
+ passThrough = injectPassThrough("select", this, this.pt, this.ptOptions);
2060
+ chosen = signal(null, ...ngDevMode ? [{ debugName: "chosen" }] : /* istanbul ignore next */ []);
2061
+ source = this.options;
2062
+ selectedItem = computed(() => {
2063
+ const found = this.allRows().find((row) => row.type === "option" && row.selected);
2064
+ const chosen = this.chosen();
2065
+ return found ?? (chosen && this.isSelected(chosen.value) ? chosen : null);
2066
+ }, ...ngDevMode ? [{ debugName: "selectedItem" }] : /* istanbul ignore next */ []);
2067
+ hasValue = computed(() => {
2068
+ const value = this.value();
2069
+ return value !== null && value !== void 0 && value !== "";
2070
+ }, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
2071
+ editableText = computed(() => {
2072
+ const value = this.value();
2073
+ return this.selectedItem()?.label ?? (value === null || value === void 0 ? "" : String(value));
2074
+ }, ...ngDevMode ? [{ debugName: "editableText" }] : /* istanbul ignore next */ []);
2075
+ tokenStyle = computed(() => toStyleObject(this.dt(), "--tx-select"), ...ngDevMode ? [{ debugName: "tokenStyle" }] : /* istanbul ignore next */ []);
2076
+ hostStyle = computed(() => ({
2077
+ ...this.tokenStyle(),
2078
+ ...this.passThrough().root?.style
2079
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
2080
+ panelStyle = computed(() => ({
2081
+ ...this.tokenStyle(),
2082
+ ...this.passThrough().panel?.style
2083
+ }), ...ngDevMode ? [{ debugName: "panelStyle" }] : /* istanbul ignore next */ []);
2084
+ get typingTarget() {
2085
+ return this.editable();
2086
+ }
2087
+ choose(item) {
2088
+ if (item.disabled) return;
2089
+ this.select(item);
2090
+ this.close();
2091
+ this.focusTrigger();
2092
+ }
2093
+ onEditableInput(event) {
2094
+ const text = event.target.value;
2095
+ const folded = foldText(text.trim());
2096
+ const match = folded ? this.allRows().find((row) => isSelectableRow(row) && foldText(row.label) === folded) : void 0;
2097
+ this.chosen.set(match ?? null);
2098
+ this.updateValue(match ? match.value : text || null);
2099
+ this.changed.emit({
2100
+ value: this.value(),
2101
+ option: match?.option ?? null
2102
+ });
2103
+ if (!this.isOpen()) this.open();
2104
+ const startsWith = folded ? this.rows().findIndex((row) => isSelectableRow(row) && foldText(row.label).startsWith(folded)) : -1;
2105
+ if (startsWith >= 0) {
2106
+ this.activeIndex.set(startsWith);
2107
+ this.scrollActiveIntoView();
2108
+ }
2109
+ }
2110
+ isSelected(value) {
2111
+ const current = this.value();
2112
+ return current !== null && current !== void 0 && this.sameValue(value, current);
2113
+ }
2114
+ activate(item) {
2115
+ this.choose(item);
2116
+ }
2117
+ clearValue() {
2118
+ this.chosen.set(null);
2119
+ this.updateValue(null);
2120
+ this.changed.emit({
2121
+ value: null,
2122
+ option: null
2123
+ });
2124
+ }
2125
+ onTypeaheadClosed(item) {
2126
+ this.select(item);
2127
+ }
2128
+ handleExtraKey() {
2129
+ return false;
2130
+ }
2131
+ ignoreBoxClick(target) {
2132
+ return this.editable() && !!target.closest(".tx-select__input");
2133
+ }
2134
+ select(item) {
2135
+ this.chosen.set(item);
2136
+ this.updateValue(item.value);
2137
+ this.changed.emit({
2138
+ value: item.value,
2139
+ option: item.option
2140
+ });
2141
+ }
2142
+ static ɵfac = i0.ɵɵngDeclareFactory({
2143
+ minVersion: "12.0.0",
2144
+ version: "22.2.3",
2145
+ ngImport: i0,
2146
+ type: TxSelect,
2147
+ deps: null,
2148
+ target: i0.ɵɵFactoryTarget.Component
2149
+ });
2150
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2151
+ minVersion: "17.0.0",
2152
+ version: "22.2.3",
2153
+ type: TxSelect,
2154
+ isStandalone: true,
2155
+ selector: "tx-select",
2156
+ inputs: {
2157
+ options: {
2158
+ classPropertyName: "options",
2159
+ publicName: "options",
2160
+ isSignal: true,
2161
+ isRequired: false,
2162
+ transformFunction: null
2163
+ },
2164
+ editable: {
2165
+ classPropertyName: "editable",
2166
+ publicName: "editable",
2167
+ isSignal: true,
2168
+ isRequired: false,
2169
+ transformFunction: null
2170
+ },
2171
+ checkmark: {
2172
+ classPropertyName: "checkmark",
2173
+ publicName: "checkmark",
2174
+ isSignal: true,
2175
+ isRequired: false,
2176
+ transformFunction: null
2177
+ },
2178
+ dropdownIcon: {
2179
+ classPropertyName: "dropdownIcon",
2180
+ publicName: "dropdownIcon",
2181
+ isSignal: true,
2182
+ isRequired: false,
2183
+ transformFunction: null
2184
+ },
2185
+ dt: {
2186
+ classPropertyName: "dt",
2187
+ publicName: "dt",
2188
+ isSignal: true,
2189
+ isRequired: false,
2190
+ transformFunction: null
2191
+ },
2192
+ pt: {
2193
+ classPropertyName: "pt",
2194
+ publicName: "pt",
2195
+ isSignal: true,
2196
+ isRequired: false,
2197
+ transformFunction: null
2198
+ },
2199
+ ptOptions: {
2200
+ classPropertyName: "ptOptions",
2201
+ publicName: "ptOptions",
2202
+ isSignal: true,
2203
+ isRequired: false,
2204
+ transformFunction: null
2205
+ },
2206
+ unstyled: {
2207
+ classPropertyName: "unstyled",
2208
+ publicName: "unstyled",
2209
+ isSignal: true,
2210
+ isRequired: false,
2211
+ transformFunction: null
2212
+ }
2213
+ },
2214
+ outputs: { changed: "changed" },
2215
+ host: {
2216
+ properties: {
2217
+ "class": "passThrough().root?.class",
2218
+ "style": "hostStyle()",
2219
+ "attr.data-styled": "!isUnstyled() || null",
2220
+ "attr.data-size": "size()",
2221
+ "attr.data-variant": "variant()",
2222
+ "class.tx-select--open": "isOpen()",
2223
+ "class.tx-select--disabled": "disabled()",
2224
+ "class.tx-select--invalid": "isInvalid()",
2225
+ "class.tx-select--readonly": "readonly()",
2226
+ "class.tx-select--filled": "hasValue()",
2227
+ "class.tx-select--editable": "editable()"
2228
+ },
2229
+ classAttribute: "tx-select"
2230
+ },
2231
+ providers: [{
2232
+ provide: NG_VALUE_ACCESSOR,
2233
+ useExisting: forwardRef(() => TxSelect),
2234
+ multi: true
2235
+ }],
2236
+ queries: [{
2237
+ propertyName: "valueTemplate",
2238
+ first: true,
2239
+ predicate: TxSelectValueTemplate,
2240
+ descendants: true,
2241
+ isSignal: true
2242
+ }],
2243
+ usesInheritance: true,
2244
+ ngImport: i0,
2245
+ template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayWidth]=\"panelWidth()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2246
+ styles: [":host{display:block;width:100%}.tx-select__box{display:flex;align-items:center;cursor:pointer}.tx-select__trigger{flex:1 1 auto;min-width:0}.tx-select__value{display:block;min-height:1lh;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-select__dropdown{display:inline-flex}:host(.tx-select--disabled) .tx-select__box{cursor:not-allowed}:host(.tx-select--readonly) .tx-select__box{cursor:default}:host([data-styled]){font-family:var(--tx-font-family)}:host([data-styled]) .tx-select__box{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-radius:var(--tx-form-field-border-radius);outline:none;background:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);--_px: var(--tx-form-field-padding-x);--_py: var(--tx-form-field-padding-y);gap:var(--tx-select-gap);width:100%;padding-inline-end:0}:host([data-styled])[data-variant=filled] .tx-select__box{background:var(--tx-form-field-filled-background)}:host([data-styled]):not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled])[data-variant=filled]:not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{background:var(--tx-form-field-filled-hover-background)}:host([data-styled]) .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-focus-border-color);box-shadow:var(--tx-form-field-focus-ring-shadow)}:host([data-styled])[data-variant=filled] .tx-select__box:has(.tx-select__trigger:focus){background:var(--tx-form-field-filled-focus-background)}:host([data-styled]).tx-select--readonly .tx-select__box,:host([data-styled]).tx-select--readonly .tx-select__box:hover{background:var(--tx-form-field-readonly-background);cursor:default;border-color:var(--tx-form-field-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box{border-color:var(--tx-form-field-invalid-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-invalid-border-color);box-shadow:var(--tx-form-field-invalid-focus-ring-shadow)}:host([data-styled]).tx-select--disabled .tx-select__box{background:var(--tx-form-field-disabled-background);box-shadow:none;color:var(--tx-form-field-disabled-color);cursor:not-allowed}:host([data-styled])[data-size=small] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-sm-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-sm-padding-y));padding-inline:calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-sm-font-size);line-height:var(--tx-form-field-sm-line-height);--_px: var(--tx-form-field-sm-padding-x);--_py: var(--tx-form-field-sm-padding-y);padding-inline-end:0}:host([data-styled])[data-size=large] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-lg-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-lg-padding-y));padding-inline:calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-lg-font-size);line-height:var(--tx-form-field-lg-line-height);--_px: var(--tx-form-field-lg-padding-x);--_py: var(--tx-form-field-lg-padding-y);padding-inline-end:0}:host([data-styled]) .tx-select__trigger{padding:0;padding-inline-end:var(--_px);border:none;outline:none;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:inherit}:host([data-styled]) .tx-select__input{cursor:text}:host([data-styled]) .tx-select__input::placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled]) .tx-select__input:disabled{cursor:not-allowed}:host([data-styled]).tx-select--invalid .tx-select__input::placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__value--placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled])[data-variant=filled] .tx-select__value--placeholder,:host([data-styled])[data-variant=filled] .tx-select__input::placeholder{color:var(--tx-form-field-filled-placeholder-color)}:host([data-styled]).tx-select--invalid .tx-select__value--placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__clear{display:grid;flex:none;place-items:center;width:var(--tx-select-clear-size);height:var(--tx-select-clear-size);padding:0;border:none;border-radius:var(--tx-radius-full);background:none;color:var(--tx-select-dropdown-color);font-size:var(--tx-select-clear-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-select__clear:hover{color:var(--tx-form-field-color)}:host([data-styled]) .tx-select__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-select__dropdown{flex:none;align-items:center;align-self:stretch;justify-content:center;width:var(--tx-select-dropdown-width);color:var(--tx-select-dropdown-color)}:host([data-styled]) .tx-select__spinner{animation:tx-select-spin .8s linear infinite}@keyframes tx-select-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-select__spinner{animation-duration:2.4s}}.tx-select__panel{box-sizing:border-box;width:100%}.tx-select__panel[data-styled]{overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}.tx-select__panel[data-styled] .tx-select__header{padding:var(--tx-select-header-padding)}.tx-select__panel[data-styled] .tx-select__footer{padding:var(--tx-select-footer-padding)}.tx-select__panel[data-styled] .tx-select__filter{display:flex;align-items:center;gap:var(--tx-select-filter-gap);padding:var(--tx-select-filter-padding)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-field{position:relative;display:flex;flex:1 1 auto;align-items:center;min-width:0}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-radius:var(--tx-form-field-border-radius);outline:none;background:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);width:100%;min-width:0;padding-inline-end:calc(var(--tx-form-field-padding-x) + 1em + var(--tx-select-filter-icon-inset))}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:hover{border-color:var(--tx-form-field-hover-border-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:focus{border-color:var(--tx-form-field-focus-border-color);box-shadow:var(--tx-form-field-focus-ring-shadow)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input::placeholder{color:var(--tx-form-field-placeholder-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-icon{position:absolute;right:var(--tx-select-filter-icon-inset);color:var(--tx-form-field-icon-color);pointer-events:none}\n"],
2247
+ dependencies: [
2248
+ {
2249
+ kind: "directive",
2250
+ type: CdkOverlayOrigin,
2251
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
2252
+ exportAs: ["cdkOverlayOrigin"]
2253
+ },
2254
+ {
2255
+ kind: "directive",
2256
+ type: CdkConnectedOverlay,
2257
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
2258
+ inputs: [
2259
+ "cdkConnectedOverlayOrigin",
2260
+ "cdkConnectedOverlayPositions",
2261
+ "cdkConnectedOverlayPositionStrategy",
2262
+ "cdkConnectedOverlayOffsetX",
2263
+ "cdkConnectedOverlayOffsetY",
2264
+ "cdkConnectedOverlayWidth",
2265
+ "cdkConnectedOverlayHeight",
2266
+ "cdkConnectedOverlayMinWidth",
2267
+ "cdkConnectedOverlayMinHeight",
2268
+ "cdkConnectedOverlayBackdropClass",
2269
+ "cdkConnectedOverlayPanelClass",
2270
+ "cdkConnectedOverlayViewportMargin",
2271
+ "cdkConnectedOverlayScrollStrategy",
2272
+ "cdkConnectedOverlayOpen",
2273
+ "cdkConnectedOverlayDisableClose",
2274
+ "cdkConnectedOverlayTransformOriginOn",
2275
+ "cdkConnectedOverlayHasBackdrop",
2276
+ "cdkConnectedOverlayLockPosition",
2277
+ "cdkConnectedOverlayFlexibleDimensions",
2278
+ "cdkConnectedOverlayGrowAfterOpen",
2279
+ "cdkConnectedOverlayPush",
2280
+ "cdkConnectedOverlayDisposeOnNavigation",
2281
+ "cdkConnectedOverlayUsePopover",
2282
+ "cdkConnectedOverlayMatchWidth",
2283
+ "cdkConnectedOverlay"
2284
+ ],
2285
+ outputs: [
2286
+ "backdropClick",
2287
+ "positionChange",
2288
+ "attach",
2289
+ "detach",
2290
+ "overlayKeydown",
2291
+ "overlayOutsideClick"
2292
+ ],
2293
+ exportAs: ["cdkConnectedOverlay"]
2294
+ },
2295
+ {
2296
+ kind: "directive",
2297
+ type: TxOverlayAnchor,
2298
+ selector: "[cdkConnectedOverlay][txOverlayAnchor]"
2299
+ },
2300
+ {
2301
+ kind: "directive",
2302
+ type: NgTemplateOutlet,
2303
+ selector: "[ngTemplateOutlet]",
2304
+ inputs: [
2305
+ "ngTemplateOutletContext",
2306
+ "ngTemplateOutlet",
2307
+ "ngTemplateOutletInjector"
2308
+ ]
2309
+ },
2310
+ {
2311
+ kind: "component",
2312
+ type: TxIcon,
2313
+ selector: "tx-icon",
2314
+ inputs: ["name"]
2315
+ },
2316
+ {
2317
+ kind: "component",
2318
+ type: TxOptionList,
2319
+ selector: "tx-option-list",
2320
+ inputs: [
2321
+ "rows",
2322
+ "listboxId",
2323
+ "activeIndex",
2324
+ "multiple",
2325
+ "checkbox",
2326
+ "checkmark",
2327
+ "virtualScroll",
2328
+ "itemSize",
2329
+ "scrollHeight",
2330
+ "loading",
2331
+ "query",
2332
+ "emptyText",
2333
+ "loadingText",
2334
+ "optionTemplate",
2335
+ "groupTemplate",
2336
+ "emptyTemplate",
2337
+ "emptyFilterTemplate",
2338
+ "passThrough",
2339
+ "unstyled",
2340
+ "focusable",
2341
+ "disabled",
2342
+ "ariaLabel",
2343
+ "ariaLabelledBy",
2344
+ "ariaDescribedBy",
2345
+ "ariaInvalid"
2346
+ ],
2347
+ outputs: [
2348
+ "optionClick",
2349
+ "optionHover",
2350
+ "rangeChange",
2351
+ "listKeydown",
2352
+ "listFocus",
2353
+ "listBlur"
2354
+ ]
2355
+ }
2356
+ ],
2357
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2358
+ });
2359
+ };
2360
+ i0.ɵɵngDeclareClassMetadata({
2361
+ minVersion: "12.0.0",
2362
+ version: "22.2.3",
2363
+ ngImport: i0,
2364
+ type: TxSelect,
2365
+ decorators: [{
2366
+ type: Component,
2367
+ args: [{
2368
+ selector: "tx-select",
2369
+ imports: [
2370
+ CdkOverlayOrigin,
2371
+ CdkConnectedOverlay,
2372
+ TxOverlayAnchor,
2373
+ NgTemplateOutlet,
2374
+ TxIcon,
2375
+ TxOptionList
2376
+ ],
2377
+ changeDetection: ChangeDetectionStrategy.OnPush,
2378
+ providers: [{
2379
+ provide: NG_VALUE_ACCESSOR,
2380
+ useExisting: forwardRef(() => TxSelect),
2381
+ multi: true
2382
+ }],
2383
+ host: {
2384
+ class: "tx-select",
2385
+ "[class]": "passThrough().root?.class",
2386
+ "[style]": "hostStyle()",
2387
+ "[attr.data-styled]": "!isUnstyled() || null",
2388
+ "[attr.data-size]": "size()",
2389
+ "[attr.data-variant]": "variant()",
2390
+ "[class.tx-select--open]": "isOpen()",
2391
+ "[class.tx-select--disabled]": "disabled()",
2392
+ "[class.tx-select--invalid]": "isInvalid()",
2393
+ "[class.tx-select--readonly]": "readonly()",
2394
+ "[class.tx-select--filled]": "hasValue()",
2395
+ "[class.tx-select--editable]": "editable()"
2396
+ },
2397
+ template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox inside the box takes focus and keys; the box only widens the click area -->\n<div\n #box\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-select__box\"\n [class]=\"passThrough().box?.class\"\n [style]=\"passThrough().box?.style\"\n (click)=\"onBoxClick($event)\"\n>\n @if (editable()) {\n <input\n #trigger\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n class=\"tx-select__trigger tx-select__input\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [placeholder]=\"placeholder()\"\n [value]=\"editableText()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n (input)=\"onEditableInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n } @else {\n <button\n #trigger\n type=\"button\"\n role=\"combobox\"\n class=\"tx-select__trigger\"\n aria-haspopup=\"listbox\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() || inputId() ? null : placeholder() || null)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-activedescendant]=\"filter() ? null : activeItemId()\"\n [attr.aria-busy]=\"loading() || null\"\n [disabled]=\"disabled()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (selectedItem(); as item) {\n <span class=\"tx-select__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">\n @if (valueTemplate() ?? optionTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.option, selected: true, disabled: item.disabled, index: item.index }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n } @else {\n <span class=\"tx-select__value tx-select__value--placeholder\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{\n placeholder()\n }}</span>\n }\n </button>\n }\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-select__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n <span class=\"tx-select__dropdown\" aria-hidden=\"true\" [class]=\"passThrough().dropdown?.class\" [style]=\"passThrough().dropdown?.style\">\n @if (loading()) {\n <tx-icon class=\"tx-select__spinner\" [name]=\"'spinner'\" />\n } @else {\n <tx-icon class=\"tx-select__chevron\" [name]=\"dropdownIcon()\" />\n }\n </span>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayViewportMargin]=\"viewportMargin()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n [cdkConnectedOverlayWidth]=\"panelWidth()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (attach)=\"onPanelAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"onPanelDetach()\"\n>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its search field and actions -->\n <div\n #panel\n class=\"tx-select__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-size]=\"size()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (mousedown)=\"onPanelMousedown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <div class=\"tx-select__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n @if (filter()) {\n <div class=\"tx-select__filter\" [class]=\"passThrough().filter?.class\" [style]=\"passThrough().filter?.style\">\n <span class=\"tx-select__filter-field\">\n <input\n #filterInput\n type=\"text\"\n autocomplete=\"off\"\n class=\"tx-select__filter-input\"\n role=\"searchbox\"\n [class]=\"passThrough().filterInput?.class\"\n [style]=\"passThrough().filterInput?.style\"\n [attr.aria-label]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeItemId()\"\n [placeholder]=\"filterPlaceholder() ?? translations().searchPlaceholder\"\n [value]=\"query()\"\n (input)=\"onFilterInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n <tx-icon class=\"tx-select__filter-icon\" [name]=\"'search'\" />\n </span>\n </div>\n }\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"checkmark()\"\n [virtualScroll]=\"virtualScroll()\"\n [itemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"scrollHeight()\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef\"\n [groupTemplate]=\"groupTemplate()?.templateRef\"\n [emptyTemplate]=\"emptyTemplate()?.templateRef\"\n [emptyFilterTemplate]=\"emptyFilterTemplate()?.templateRef\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n (rangeChange)=\"onRangeChange($event)\"\n />\n @if (footerTemplate(); as template) {\n <div class=\"tx-select__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n </div>\n }\n </div>\n</ng-template>\n",
2398
+ styles: [":host{display:block;width:100%}.tx-select__box{display:flex;align-items:center;cursor:pointer}.tx-select__trigger{flex:1 1 auto;min-width:0}.tx-select__value{display:block;min-height:1lh;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-select__dropdown{display:inline-flex}:host(.tx-select--disabled) .tx-select__box{cursor:not-allowed}:host(.tx-select--readonly) .tx-select__box{cursor:default}:host([data-styled]){font-family:var(--tx-font-family)}:host([data-styled]) .tx-select__box{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-radius:var(--tx-form-field-border-radius);outline:none;background:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);--_px: var(--tx-form-field-padding-x);--_py: var(--tx-form-field-padding-y);gap:var(--tx-select-gap);width:100%;padding-inline-end:0}:host([data-styled])[data-variant=filled] .tx-select__box{background:var(--tx-form-field-filled-background)}:host([data-styled]):not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{border-color:var(--tx-form-field-hover-border-color)}:host([data-styled])[data-variant=filled]:not(.tx-select--disabled,.tx-select--readonly) .tx-select__box:not(:has(.tx-select__trigger:focus)):hover{background:var(--tx-form-field-filled-hover-background)}:host([data-styled]) .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-focus-border-color);box-shadow:var(--tx-form-field-focus-ring-shadow)}:host([data-styled])[data-variant=filled] .tx-select__box:has(.tx-select__trigger:focus){background:var(--tx-form-field-filled-focus-background)}:host([data-styled]).tx-select--readonly .tx-select__box,:host([data-styled]).tx-select--readonly .tx-select__box:hover{background:var(--tx-form-field-readonly-background);cursor:default;border-color:var(--tx-form-field-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box{border-color:var(--tx-form-field-invalid-border-color)}:host([data-styled]).tx-select--invalid .tx-select__box:has(.tx-select__trigger:focus){border-color:var(--tx-form-field-invalid-border-color);box-shadow:var(--tx-form-field-invalid-focus-ring-shadow)}:host([data-styled]).tx-select--disabled .tx-select__box{background:var(--tx-form-field-disabled-background);box-shadow:none;color:var(--tx-form-field-disabled-color);cursor:not-allowed}:host([data-styled])[data-size=small] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-sm-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-sm-padding-y));padding-inline:calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-sm-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-sm-font-size);line-height:var(--tx-form-field-sm-line-height);--_px: var(--tx-form-field-sm-padding-x);--_py: var(--tx-form-field-sm-padding-y);padding-inline-end:0}:host([data-styled])[data-size=large] .tx-select__box{padding-top:var(--tx-field-padding-top, var(--tx-form-field-lg-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-lg-padding-y));padding-inline:calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-lg-padding-x) + var(--tx-field-inset-end, 0px));font-size:var(--tx-form-field-lg-font-size);line-height:var(--tx-form-field-lg-line-height);--_px: var(--tx-form-field-lg-padding-x);--_py: var(--tx-form-field-lg-padding-y);padding-inline-end:0}:host([data-styled]) .tx-select__trigger{padding:0;padding-inline-end:var(--_px);border:none;outline:none;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:inherit}:host([data-styled]) .tx-select__input{cursor:text}:host([data-styled]) .tx-select__input::placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled]) .tx-select__input:disabled{cursor:not-allowed}:host([data-styled]).tx-select--invalid .tx-select__input::placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__value--placeholder{color:var(--tx-form-field-placeholder-color)}:host([data-styled])[data-variant=filled] .tx-select__value--placeholder,:host([data-styled])[data-variant=filled] .tx-select__input::placeholder{color:var(--tx-form-field-filled-placeholder-color)}:host([data-styled]).tx-select--invalid .tx-select__value--placeholder{color:var(--tx-form-field-invalid-placeholder-color)}:host([data-styled]) .tx-select__clear{display:grid;flex:none;place-items:center;width:var(--tx-select-clear-size);height:var(--tx-select-clear-size);padding:0;border:none;border-radius:var(--tx-radius-full);background:none;color:var(--tx-select-dropdown-color);font-size:var(--tx-select-clear-size);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-select__clear:hover{color:var(--tx-form-field-color)}:host([data-styled]) .tx-select__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-select__dropdown{flex:none;align-items:center;align-self:stretch;justify-content:center;width:var(--tx-select-dropdown-width);color:var(--tx-select-dropdown-color)}:host([data-styled]) .tx-select__spinner{animation:tx-select-spin .8s linear infinite}@keyframes tx-select-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-select__spinner{animation-duration:2.4s}}.tx-select__panel{box-sizing:border-box;width:100%}.tx-select__panel[data-styled]{overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}.tx-select__panel[data-styled] .tx-select__header{padding:var(--tx-select-header-padding)}.tx-select__panel[data-styled] .tx-select__footer{padding:var(--tx-select-footer-padding)}.tx-select__panel[data-styled] .tx-select__filter{display:flex;align-items:center;gap:var(--tx-select-filter-gap);padding:var(--tx-select-filter-padding)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-field{position:relative;display:flex;flex:1 1 auto;align-items:center;min-width:0}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input{box-sizing:border-box;padding-top:var(--tx-field-padding-top, var(--tx-form-field-padding-y));padding-bottom:var(--tx-field-padding-bottom, var(--tx-form-field-padding-y));padding-inline:calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-start, 0px)) calc(var(--tx-form-field-padding-x) + var(--tx-field-inset-end, 0px));border:1px solid var(--tx-form-field-border-color);border-radius:var(--tx-form-field-border-radius);outline:none;background:var(--tx-form-field-background);box-shadow:var(--tx-form-field-shadow);color:var(--tx-form-field-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height);transition:background-color var(--tx-form-field-transition-duration),border-color var(--tx-form-field-transition-duration),box-shadow var(--tx-form-field-transition-duration);width:100%;min-width:0;padding-inline-end:calc(var(--tx-form-field-padding-x) + 1em + var(--tx-select-filter-icon-inset))}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:hover{border-color:var(--tx-form-field-hover-border-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input:focus{border-color:var(--tx-form-field-focus-border-color);box-shadow:var(--tx-form-field-focus-ring-shadow)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-input::placeholder{color:var(--tx-form-field-placeholder-color)}.tx-select__panel[data-styled] .tx-select__filter .tx-select__filter-icon{position:absolute;right:var(--tx-select-filter-icon-inset);color:var(--tx-form-field-icon-color);pointer-events:none}\n"]
2399
+ }]
2400
+ }],
2401
+ propDecorators: {
2402
+ options: [{
2403
+ type: i0.Input,
2404
+ args: [{
2405
+ isSignal: true,
2406
+ alias: "options",
2407
+ required: false
2408
+ }]
2409
+ }],
2410
+ editable: [{
2411
+ type: i0.Input,
2412
+ args: [{
2413
+ isSignal: true,
2414
+ alias: "editable",
2415
+ required: false
2416
+ }]
2417
+ }],
2418
+ checkmark: [{
2419
+ type: i0.Input,
2420
+ args: [{
2421
+ isSignal: true,
2422
+ alias: "checkmark",
2423
+ required: false
2424
+ }]
2425
+ }],
2426
+ dropdownIcon: [{
2427
+ type: i0.Input,
2428
+ args: [{
2429
+ isSignal: true,
2430
+ alias: "dropdownIcon",
2431
+ required: false
2432
+ }]
2433
+ }],
2434
+ dt: [{
2435
+ type: i0.Input,
2436
+ args: [{
2437
+ isSignal: true,
2438
+ alias: "dt",
2439
+ required: false
2440
+ }]
2441
+ }],
2442
+ pt: [{
2443
+ type: i0.Input,
2444
+ args: [{
2445
+ isSignal: true,
2446
+ alias: "pt",
2447
+ required: false
2448
+ }]
2449
+ }],
2450
+ ptOptions: [{
2451
+ type: i0.Input,
2452
+ args: [{
2453
+ isSignal: true,
2454
+ alias: "ptOptions",
2455
+ required: false
2456
+ }]
2457
+ }],
2458
+ unstyled: [{
2459
+ type: i0.Input,
2460
+ args: [{
2461
+ isSignal: true,
2462
+ alias: "unstyled",
2463
+ required: false
2464
+ }]
2465
+ }],
2466
+ changed: [{
2467
+ type: i0.Output,
2468
+ args: ["changed"]
2469
+ }],
2470
+ valueTemplate: [{
2471
+ type: i0.ContentChild,
2472
+ args: [i0.forwardRef(() => TxSelectValueTemplate), { isSignal: true }]
2473
+ }]
2474
+ }
2475
+ });
2476
+ export { TxOptionList, TxOptionsBase, TxSelect, TxSelectBase, TxSelectEmptyFilterTemplate, TxSelectEmptyTemplate, TxSelectFooterTemplate, TxSelectGroupTemplate, TxSelectHeaderTemplate, TxSelectOptionTemplate, TxSelectValueTemplate, buildOptionRows, foldText, isSelectableRow, matchesQuery, readOptionField, sameOptionValue };
2477
+
2478
+ //# sourceMappingURL=tectra-ng-ui-select.mjs.map